b1346c34fff93428b806fdc380e91e885a8f0a0f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-13  Alex Christensen  <achristensen@webkit.org>
2
3         Prevent checked_cf_cast crashes in ResourceResponse::platformCertificateInfo
4         https://bugs.webkit.org/show_bug.cgi?id=195686
5
6         Reviewed by Tim Horton.
7
8         This covers up a type confusion bug on some OSes until rdar://problem/48853137 is resolved.
9
10         * SourcesCocoa.txt:
11         * WebCore.xcodeproj/project.pbxproj:
12         * platform/network/cocoa/ResourceResponseCocoa.mm:
13
14 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
15
16         [GStreamer][WebRTC] Add support for omxh264enc encoder
17         https://bugs.webkit.org/show_bug.cgi?id=195676
18
19         Reviewed by Philippe Normand.
20
21         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
22         (setup_omxh264enc):
23         (set_bitrate_bit_per_sec):
24         (gst_webrtc_video_encoder_class_init):
25
26 2019-03-13  Antoine Quint  <graouts@apple.com>
27
28         REGRESSION(r240634): Element::hasPointerCapture() passes a JS-controlled value directly into a HashMap as a key
29         https://bugs.webkit.org/show_bug.cgi?id=195683
30         <rdar://problem/48659950>
31
32         Reviewed by Alex Christensen.
33
34         While PointerID is defined as int32_t, we now use int64_t as the key of the HashMap mapping PointerID to CapturingData so that we use
35         a value outside of the int32_t range as a safe empty and removed values, allowing any int32_t to be provided through the API for
36         lookup in this HashMap.
37
38         Test: pointerevents/pointer-id-crash.html
39
40         * page/PointerCaptureController.h:
41
42 2019-03-12  Brady Eidson  <beidson@apple.com>
43
44         Take UnboundedNetworking assertion when a file upload is in progress.
45         https://bugs.webkit.org/show_bug.cgi?id=195497
46
47         Reviewed by Geoff Garen.
48
49         * platform/network/ResourceRequestBase.cpp:
50         (WebCore::ResourceRequestBase::hasUpload const):
51         * platform/network/ResourceRequestBase.h:
52
53 2019-03-13  Youenn Fablet  <youenn@apple.com>
54
55         Enable libwebrtc logging control through WebCore
56         https://bugs.webkit.org/show_bug.cgi?id=195658
57
58         Reviewed by Eric Carlson.
59
60         Add support for WebCore logging of libwebrtc messages.
61         This is controlled by WebRTC log channel state and level.
62         In case of private browsing mode, any logging is disabled.
63         This will stay for the lifetime of the process.
64         No change of behavior.
65
66         * Modules/mediastream/RTCPeerConnection.cpp:
67         (WebCore::RTCPeerConnection::create):
68         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
69         (WebCore::doReleaseLogging):
70         (WebCore::setLogging):
71         (WebCore::computeLogLevel):
72         (WebCore::initializePeerConnectionFactoryAndThreads):
73         (WebCore::LibWebRTCProvider::setEnableLogging):
74         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
75
76 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
77
78         [GStreamer][WebRTC] Do not sync encoder on the clock
79         https://bugs.webkit.org/show_bug.cgi?id=195673
80
81         we should encode as fast as possible and totally ignore timestamp while
82         doing so.
83
84         Reviewed by Philippe Normand.
85
86         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
87         (WebCore::GStreamerVideoEncoder::InitEncode):
88
89 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
90
91         [GStreamer][WebRTC]: Use codec setting video height/width as fallback
92         https://bugs.webkit.org/show_bug.cgi?id=195675
93
94         Reviewed by Philippe Normand.
95
96         In some cases the frame height and width is not set (not sure why/ in
97         what conditions but it happens) so make sure to get the information from
98         the VideoCodec when configuring the encoder.
99
100         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
101         (WebCore::GStreamerVideoDecoder::GStreamerVideoDecoder):
102         (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
103
104 2019-03-13  Miguel Gomez  <magomez@igalia.com>
105
106         [CoordinatedGraphics] Null dereference in CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded
107         https://bugs.webkit.org/show_bug.cgi?id=195615
108
109         Reviewed by Carlos Garcia Campos.
110
111         Exit early if we don't receive a valid coordinator.
112
113         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
114         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
115
116 2019-03-13  Fujii Hironori  <Hironori.Fujii@sony.com>
117
118         [Win][PlayStation] Remove WebCore::standardUserAgentForURL
119         https://bugs.webkit.org/show_bug.cgi?id=195662
120
121         Reviewed by Ryosuke Niwa.
122
123         WebCore::standardUserAgentForURL is just a stub in Windows port.
124
125         No new tests because there is no behavior change.
126
127         * platform/win/UserAgentWin.cpp:
128         (WebCore::standardUserAgentForURL): Deleted.
129         * platform/playstation/UserAgentPlayStation.cpp:
130         (WebCore::standardUserAgentForURL): Deleted.
131
132 2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
133
134         [Win] Fix a slew of simple clang-cl warnings.
135         https://bugs.webkit.org/show_bug.cgi?id=195652
136
137         Reviewed by Don Olmstead.
138
139         * page/AutoscrollController.cpp:
140         (WebCore::AutoscrollController::handleMouseReleaseEvent): -Wswitch
141         * platform/network/curl/CurlContext.cpp:
142         (WebCore::CurlHandle::willSetupSslCtx):
143         (WebCore::CurlHandle::appendRequestHeaders): -Wunused-variable
144         * platform/network/curl/CurlFormDataStream.cpp:
145         (WebCore::CurlFormDataStream::computeContentLength): -Wunused-variable
146         * platform/network/curl/CurlRequest.cpp:
147         (WebCore::CurlRequest::CurlRequest): -Wreorder
148         (WebCore::CurlRequest::setupTransfer): -Wunused-variable
149         * platform/network/curl/CurlSSLVerifier.cpp:
150         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
151         * platform/network/curl/CurlSSLVerifier.h: -Wunused-private-field
152         * platform/win/LoggingWin.cpp:
153         (WebCore::logLevelString): -Wwritable-strings
154         * rendering/RenderThemeWin.cpp: -Wunused-const-variable (x2)
155         (WebCore::RenderThemeWin::getThemeData): -Wswitch
156
157 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
158
159         Move the code for determining the need for touch bar quirks to Quirks class
160         https://bugs.webkit.org/show_bug.cgi?id=195654
161
162         Reviewed by Brent Fulgham.
163
164         Moved the code to determine whether the touch bar quirks are needed or not from WebKit2.
165
166         * WebCore.xcodeproj/project.pbxproj:
167         * page/Quirks.cpp:
168         (WebCore::Quirks::isTouchBarUpdateSupressedForHiddenContentEditable const):
169         (WebCore::Quirks::isNeverRichlyEditableForTouchBar const):
170         * page/Quirks.h:
171
172 2019-03-12  Justin Fan  <justin_fan@apple.com>
173
174         [Web GPU] Update GPURenderPipelineDescriptor and add GPUColorStateDescriptor.format
175         https://bugs.webkit.org/show_bug.cgi?id=195518
176         <rdar://problem/46322356>
177
178         Reviewed by Myles C. Maxfield.
179
180         Upgrade the implementation of GPURenderPipelineDescriptor and GPURenderPipeline and match the updated Web GPU API.
181         Add stubs for GPUColorStateDescriptor so attachment format can be provided by GPURenderPipelineDescriptor.
182
183         All affected Web GPU tests updated to cover existing behavior.
184
185         Update file names and symbols:
186         * CMakeLists.txt:
187         * DerivedSources-input.xcfilelist:
188         * DerivedSources-output.xcfilelist:
189         * DerivedSources.make:
190         * Sources.txt:
191         * WebCore.xcodeproj/project.pbxproj:
192         * bindings/js/WebCoreBuiltinNames.h:
193
194         Updates to GPURenderPipeline, GPURenderPipelineDescriptor, and its components:
195         * Modules/webgpu/GPUColorStateDescriptor.idl: Added. Provide the expected texture format of the render pipeline's color attachments.
196         * Modules/webgpu/GPUInputStateDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUInputStateDescriptor.idl.
197         * Modules/webgpu/GPUTextureFormat.idl: Update the existing values to match the new style.
198         * Modules/webgpu/GPUVertexAttributeDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexAttributeDescriptor.idl.
199         * Modules/webgpu/GPUVertexInputDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexInputDescriptor.idl.
200         * Modules/webgpu/WebGPUDevice.cpp:
201         (WebCore::WebGPUDevice::createPipelineLayout const): Remove unnecessary comment.
202         (WebCore::WebGPUDevice::createRenderPipeline const): Descriptor validation and conversion moved into WebGPURenderPipelineDescriptor.
203         (WebCore::validateAndConvertPipelineStage): Deleted.
204         * Modules/webgpu/WebGPUDevice.h: create* functions should not return nullable.
205         * Modules/webgpu/WebGPUIndexFormat.h: Removed. Moved into GPUInputStateDescriptor.idl.
206         * Modules/webgpu/WebGPUInputStateDescriptor.h: Removed.
207         * Modules/webgpu/WebGPUInputStepMode.idl: Removed. Moved into GPUVertexInputDescriptor.idl.
208         * Modules/webgpu/WebGPUPipelineLayout.h:
209         (WebCore::WebGPUPipelineLayout::pipelineLayout): Getters should return raw references.
210         * Modules/webgpu/WebGPUPipelineStageDescriptor.h: Now shares a common base with GPUPipelineStageDescriptor.
211         * Modules/webgpu/WebGPURenderPipeline.cpp:
212         (WebCore::WebGPURenderPipeline::create):
213         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
214         * Modules/webgpu/WebGPURenderPipeline.h:  Now internally nullable.
215         (WebCore::WebGPURenderPipeline::renderPipeline const):
216         (WebCore::WebGPURenderPipeline::renderPipeline): Deleted.
217         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
218         (WebCore::WebGPUPipelineStageDescriptor::asGPUPipelineStageDescriptor const): Validate and convert a WebGPUPipelineStageDescriptor to GPU version.
219         (WebCore::WebGPURenderPipelineDescriptor::asGPURenderPipelineDescriptor const): Ditto for WebGPURenderPipelineDescriptor.
220         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Now shares a base class and some instance variables with GPURenderPipelineDescriptor.
221         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Update GPUPrimitiveTopology for new style and add colorStates.
222         * Modules/webgpu/WebGPUShaderModule.idl: Small pilot to test using InterfaceName to easily rename DOM-facing interfaces.
223         * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Removed.
224         * Modules/webgpu/WebGPUVertexFormat.idl: Removed. Moved and updated in GPUVertexAttributeDescriptor.idl.
225         * Modules/webgpu/WebGPUVertexInputDescriptor.h: Removed.
226         * platform/graphics/gpu/GPUInputStateDescriptor.h:
227         * platform/graphics/gpu/GPUPipelineStageDescriptor.h:
228         (WebCore::GPUPipelineStageDescriptor::GPUPipelineStageDescriptor):
229         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Add shared base class for Web/GPURenderPipelineDescriptor.
230         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
231         * platform/graphics/gpu/GPUTextureFormat.h:
232         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
233         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
234         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
235         (WebCore::setFunctionsForPipelineDescriptor): Make fragment required since descriptor validation fails if fragment function is not found right now.
236         (WebCore::mtlVertexFormatForGPUVertexFormat): Renamed from validateAndConvertVertexFormatToMTLVertexFormat.
237         (WebCore::mtlStepFunctionForGPUInputStepMode): Renamed from validateAndConvertStepModeToMTLStepFunction
238         (WebCore::trySetInputStateForPipelineDescriptor):
239         (WebCore::trySetColorStatesForColorAttachmentArray):
240         (WebCore::tryCreateMtlRenderPipelineState):
241         (WebCore::GPURenderPipeline::create):
242         (WebCore::validateAndConvertVertexFormatToMTLVertexFormat): Deleted.
243         (WebCore::validateAndConvertStepModeToMTLStepFunction): Deleted.
244         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
245         (WebCore::platformTextureFormatForGPUTextureFormat):
246         * platform/graphics/gpu/GPUColorStateDescriptor.h: Added.
247
248         Misc:
249         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
250         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
251         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
252         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
253         * platform/graphics/gpu/GPURenderPassEncoder.h:
254         * platform/graphics/gpu/GPURenderPipeline.h:
255         (WebCore::GPURenderPipeline::primitiveTopology const):
256         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
257         (WebCore::GPURenderPassEncoder::setPipeline):
258         (WebCore::primitiveTypeForGPUPrimitiveTopology):
259        
260 2019-03-12  Zalan Bujtas  <zalan@apple.com>
261
262         [ContentChangeObserver] Reset state when touchStart does not turn into click.
263         https://bugs.webkit.org/show_bug.cgi?id=195603
264         <rdar://problem/48796582>
265
266         Reviewed by Simon Fraser.
267
268         Add reset() function to assert and reset the current state.
269
270         * page/ios/ContentChangeObserver.cpp:
271         (WebCore::ContentChangeObserver::willNotProceedWithClick):
272         (WebCore::ContentChangeObserver::adjustObservedState):
273         * page/ios/ContentChangeObserver.h:
274
275 2019-03-12  Timothy Hatcher  <timothy@apple.com>
276
277         Expose document attributes and body background color through HTMLConverter.
278         https://bugs.webkit.org/show_bug.cgi?id=195636
279         rdar://problem/45055697
280
281         Reviewed by Tim Horton.
282
283         * editing/cocoa/HTMLConverter.h:
284         * editing/cocoa/HTMLConverter.mm:
285         (HTMLConverter::convert):
286         (WebCore::attributedStringFromRange):
287         (WebCore::attributedStringFromSelection):
288         (WebCore::attributedStringBetweenStartAndEnd):
289
290 2019-03-12  Antti Koivisto  <antti@apple.com>
291
292         Compositing layer that renders two positioned elements should not hit test
293         https://bugs.webkit.org/show_bug.cgi?id=195371
294         <rdar://problem/48649586>
295
296         Reviewed by Simon Fraser.
297
298         Followup to fix the test case (fast/scrolling/ios/overflow-scroll-overlap-2.html)
299
300         * platform/graphics/ca/GraphicsLayerCA.cpp:
301         (WebCore::GraphicsLayerCA::setEventRegion):
302
303         Revert a last minute change (that was done to fix a Mac displaylist test).
304
305         * rendering/RenderLayerBacking.cpp:
306         (WebCore::RenderLayerBacking::paintIntoLayer):
307
308         Compute the region on iOS only for now (it is not used on other platforms).
309
310 2019-03-12  Dean Jackson  <dino@apple.com>
311
312         [WebGL] WebGLBuffer can be too large
313         https://bugs.webkit.org/show_bug.cgi?id=195068
314         <rdar://problem/48414289>
315
316         Reviewed by Antoine Quint.
317
318         When creating an element array buffer, make sure to
319         test against the maximum size of an ArrayBuffer, rather
320         than just assume it can be created.
321
322         Test: fast/canvas/webgl/largeBuffer.html
323
324         * html/canvas/WebGLBuffer.cpp:
325         (WebCore::WebGLBuffer::associateBufferDataImpl):
326
327 2019-03-12  Sihui Liu  <sihui_liu@apple.com>
328
329         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-*-event-exception.html are failing
330         https://bugs.webkit.org/show_bug.cgi?id=195581
331
332         Reviewed by Brady Eidson.
333
334         Uncaught exceptions should be handled after IDBRequest dispatches events so that IDBTransaction would stay 
335         active during event dispatch.
336
337         * Modules/indexeddb/IDBRequest.cpp:
338         (WebCore::IDBRequest::dispatchEvent):
339         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
340         * Modules/indexeddb/IDBRequest.h:
341
342 2019-03-12  Sihui Liu  <sihui_liu@apple.com>
343
344         Layout Test imported/w3c/web-platform-tests/IndexedDB/transaction-abort-request-error.html is failing
345         https://bugs.webkit.org/show_bug.cgi?id=195570
346
347         Reviewed by Brady Eidson.
348
349         IDBRequest result should be undefined if it is never set.
350
351         * Modules/indexeddb/IDBRequest.cpp:
352         (WebCore::IDBRequest::IDBRequest):
353
354 2019-03-12  Youenn Fablet  <youenn@apple.com>
355
356         Rename originsMatch in originSerializationsMatch
357         https://bugs.webkit.org/show_bug.cgi?id=195572
358
359         Reviewed by Jiewen Tan.
360
361         In addition to renaming, make use of SecurityOrigin::isSameOriginAs
362         where it makes more sense than to compare origin serialization.
363         The main difference is that isSameOriginAs will return false for two different unique origins
364         while originsSerializationsMatch will not.
365
366         * Modules/credentialmanagement/CredentialsContainer.cpp:
367         (WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
368         * Modules/mediastream/RTCController.cpp:
369         (WebCore::matchDocumentOrigin):
370         * Modules/mediastream/RTCPeerConnection.cpp:
371         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
372         * loader/DocumentLoader.cpp:
373         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const):
374         * loader/cache/CachedResourceLoader.cpp:
375         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
376         * page/SecurityOrigin.cpp:
377         (WebCore::serializedOriginsMatch):
378         (WebCore::originsMatch): Deleted.
379         * page/SecurityOrigin.h:
380
381 2019-03-12  Zalan Bujtas  <zalan@apple.com>
382
383         [Synthetic Click] Dispatch mouseout soon after mouseup
384         https://bugs.webkit.org/show_bug.cgi?id=195575
385         <rdar://problem/47093049>
386
387         Reviewed by Simon Fraser.
388
389         Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
390
391         Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
392
393         * page/EventHandler.h:
394         * page/ios/EventHandlerIOS.mm:
395         (WebCore::EventHandler::dispatchFakeMouseOut):
396
397 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
398
399         In CachedFrame's constructor, release-assert that DOMWindow still has a frame after page-caching subframes
400         https://bugs.webkit.org/show_bug.cgi?id=195609
401
402         Reviewed by Chris Dumez.
403
404         r242677 added release assertions to DOMWindow::suspendForPageCache. But when the first release assert in
405         that function is hit, we still can't tell whether active DOM objects are detaching frames, or if creating
406         CachedFrame's on one of subframes is causing the frame to go way.
407
408         Add a release assertion immediately after creating CachedFrame on subframes to detect this case.
409
410         * history/CachedFrame.cpp:
411         (WebCore::CachedFrame::CachedFrame):
412
413 2019-03-12  Zalan Bujtas  <zalan@apple.com>
414
415         [ContentChangeObserver] Stop content change observation when the touch event turns into long press
416         https://bugs.webkit.org/show_bug.cgi?id=195601
417         <rdar://problem/48796324>
418
419         Reviewed by Wenson Hsieh.
420
421         Cancel the ongoing content observation (started at touchStart) when the touch event does not turn into a tap gesture.
422
423         Not testable because any subsequent tap would reset the state anyway (though it might be measurable through some code triggering heavy content change).
424
425         * page/ios/ContentChangeObserver.cpp:
426         (WebCore::ContentChangeObserver::didRecognizeLongPress):
427         (WebCore::ContentChangeObserver::willNotProceedWithClick):
428         * page/ios/ContentChangeObserver.h:
429
430 2019-03-12  Antti Koivisto  <antti@apple.com>
431
432         Compositing layer that renders two positioned elements should not hit test
433         https://bugs.webkit.org/show_bug.cgi?id=195371
434         <rdar://problem/48649586>
435
436         Reviewed by Simon Fraser.
437
438         Compute and pass an event region for layers if it differs from layer bounds.
439
440         This patch fixes various block overflow and layer expansion cases. It does not handle
441         overflowing line boxes yet (it adds tests for those too).
442
443         Test: fast/scrolling/ios/overflow-scroll-overlap-2.html
444
445         * platform/graphics/GraphicsLayer.cpp:
446         (WebCore::GraphicsLayer::setEventRegion):
447         * platform/graphics/GraphicsLayer.h:
448         (WebCore::GraphicsLayer::eventRegion):
449         * platform/graphics/Region.h:
450         * platform/graphics/ca/GraphicsLayerCA.cpp:
451         (WebCore::GraphicsLayerCA::setEventRegion):
452         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
453         (WebCore::GraphicsLayerCA::updateEventRegion):
454
455         Pass the region via the main platform layer of the graphics layer.
456
457         * platform/graphics/ca/GraphicsLayerCA.h:
458         * platform/graphics/ca/PlatformCALayer.h:
459         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
460         * rendering/PaintInfo.h:
461         * rendering/PaintPhase.h:
462
463         Add EventRegion paint phase that computes the region instead of painting anything.
464
465         * rendering/RenderBlock.cpp:
466         (WebCore::RenderBlock::paintObject):
467         * rendering/RenderLayer.cpp:
468         (WebCore::RenderLayer::paintForegroundForFragments):
469         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
470
471         Invoke EventRegion paint phase.
472
473         * rendering/RenderLayer.h:
474         * rendering/RenderLayerBacking.cpp:
475         (WebCore::RenderLayerBacking::paintIntoLayer):
476
477         Request event region when pointing a layer.
478
479 2019-03-12  Philippe Normand  <pnormand@igalia.com>
480
481         [GStreamer][v4l2] Synchronous video texture flushing support
482         https://bugs.webkit.org/show_bug.cgi?id=195453
483
484         Reviewed by Xabier Rodriguez-Calvar.
485
486         The v4l2 video decoder currently requires that downstream users of
487         the graphics resources complete any pending draw call and release
488         resources before returning from the DRAIN query.
489
490         To accomplish this the player monitors the pipeline and whenever a
491         v4l2 decoder is added, synchronous video texture flushing support
492         is enabled. Additionally and for all decoder configurations, a
493         flush is performed before disposing of the player.
494
495         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
496         (WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
497         Monitor elements added to the decodebin bin.
498         (WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
499         a flag if a v4l2 decoder was added in decodebin.
500         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
501         to the deep-element-added signal so as to monitor pipeline
502         topology updates.
503         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
504         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
505         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
506         Flush video texture before disposing of the player.
507         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
508         Synchronously flush if the pipeline contains a v4l2 decoder.
509         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
510         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
511         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
512         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
513         boolean flag used mostly to trigger synchronous flush conditions.
514         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
515         Optionally drop the current buffer in a synchronous manner. By
516         default the method keeps operating asynchronously.
517         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
518
519 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
520
521         Move the remaining code to decide whether site specific quirks are needed to Quirks class
522         https://bugs.webkit.org/show_bug.cgi?id=195610
523
524         Reviewed by Antti Koivisto.
525
526         Moved the remaining code scattered across WebCore to decide whether a site specific quirk
527         is needed or not to Quirks class introduced in r236818.
528
529         * Modules/fetch/FetchRequest.cpp:
530         (WebCore::needsSignalQuirk): Deleted.
531         (WebCore::processInvalidSignal):
532         * html/HTMLFormControlElement.cpp:
533         (WebCore::HTMLFormControlElement::needsMouseFocusableQuirk const):
534         * html/HTMLMediaElement.cpp:
535         (WebCore::needsAutoplayPlayPauseEventsQuirk): Deleted.
536         (WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):
537         (WebCore::needsSeekingSupportQuirk): Deleted.
538         (WebCore::HTMLMediaElement::supportsSeeking const):
539         * html/MediaElementSession.cpp:
540         (WebCore::needsArbitraryUserGestureAutoplayQuirk): Deleted.
541         (WebCore::needsPerDocumentAutoplayBehaviorQuirk): Deleted.
542         (WebCore::MediaElementSession::playbackPermitted const):
543         * page/Quirks.cpp:
544         (WebCore::allowedAutoplayQuirks): Added.
545         (WebCore::Quirks::needsQuirks const): Added.
546         (WebCore::Quirks::shouldIgnoreInvalidSignal const): Added.
547         (WebCore::Quirks::needsFormControlToBeMouseFocusable const): Added.
548         (WebCore::Quirks::needsAutoplayPlayPauseEvents const): Added.
549         (WebCore::Quirks::needsSeekingSupportDisabled const): Addd.
550         (WebCore::Quirks::needsPerDocumentAutoplayBehavior const): Added.
551         (WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const): Added.
552         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const): Added.
553         (WebCore::Quirks::hasWebSQLSupportQuirk const): Fixed the coding style.
554         * page/Quirks.h:
555
556 2019-03-12  Enrique Ocaña González  <eocanha@igalia.com>
557
558         [Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed
559         https://bugs.webkit.org/show_bug.cgi?id=195454
560
561         Reviewed by Jer Noble.
562
563         This change fixes YouTube 2019 MSE Conformance Tests "26. SFRPausedAccuracy"
564         and "27. HFRPausedAccuracy".
565
566         The first timeUpdate event after play() is omitted, because currentTime
567         doesn't actually change in that scenario.
568
569         Tests 26 and 27 measure the time drift (real time vs. media time) on playback
570         and start counting since the first timeUpdate event. In WebKit, that event
571         happens at play(), before the pipeline has completed the transition to playing.
572         Therefore, the real time inherits this startup delay and the test thinks that
573         the player has drifted.
574
575         * html/HTMLMediaElement.cpp:
576         (WebCore::HTMLMediaElement::playInternal): Don't emit a timeUpdated event unless currentTime has changed.
577
578 2019-03-12  Enrique Ocaña González  <eocanha@igalia.com>
579
580         [EME][GStreamer] Speculative build fix
581         https://bugs.webkit.org/show_bug.cgi?id=195614
582
583         Unreviewed speculative WPE build fix after r242776.
584
585         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added missing include.
586
587 2019-03-12  Philippe Normand  <pnormand@igalia.com>
588
589         [GStreamer] remove legacy GStreamer version checks
590         https://bugs.webkit.org/show_bug.cgi?id=195552
591
592         Reviewed by Xabier Rodriguez-Calvar.
593
594         We require GStreamer 1.8.x so version checks below that make
595         little sense. Also checks for odd minor version numbers make sense
596         only for the latest GStreamer git development version.
597
598         * platform/graphics/gstreamer/GStreamerCommon.cpp:
599         (WebCore::initializeGStreamerAndRegisterWebKitElements):
600         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
601         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
602         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
603         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
604         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
605
606 2019-03-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
607
608         [EME] generateRequest was not using the sanitized init data
609         https://bugs.webkit.org/show_bug.cgi?id=195555
610
611         Reviewed by Jer Noble.
612
613         * Modules/encryptedmedia/MediaKeySession.cpp:
614         (WebCore::MediaKeySession::generateRequest): Use sanitized init
615         data instead of the original one.
616
617 2019-03-12  Rob Buis  <rbuis@igalia.com>
618
619         Implement further CORS restrictions
620         https://bugs.webkit.org/show_bug.cgi?id=188644
621
622         Reviewed by Darin Adler.
623
624         Verify that header value length is not greater than 128 [1]. Also implement
625         Step 5 of [2] to append values to existing header value when calling
626         Headers.append.
627
628         Tests: fetch/api/cors/cors-preflight-not-cors-safelisted.any.html
629                fetch/api/cors/cors-preflight-not-cors-safelisted.any.worker.html
630                fetch/api/headers/headers-no-cors.window.html
631
632         [1] https://fetch.spec.whatwg.org/#cors-safelisted-request-header
633         [2] https://fetch.spec.whatwg.org/#concept-headers-append
634
635         * Modules/fetch/FetchHeaders.cpp:
636         (WebCore::canWriteHeader):
637         (WebCore::appendToHeaderMap):
638         (WebCore::FetchHeaders::remove):
639         (WebCore::FetchHeaders::set):
640         (WebCore::FetchHeaders::filterAndFill):
641         * platform/network/HTTPParsers.cpp:
642         (WebCore::isCrossOriginSafeRequestHeader): verify that header length is not greater than 128
643
644 2019-03-11  Ryosuke Niwa  <rniwa@webkit.org>
645
646         Remove OS X Server QuickTime plugin quirks
647         https://bugs.webkit.org/show_bug.cgi?id=195607
648
649         Reviewed by Brent Fulgham.
650
651         r87244 added a site specific quirk for Mac OS X Sever wiki pages.
652         However, the issue has since been resolved as of OS X Mountain Lion,
653         of which Apple has ended the support in September 2015.
654
655         Because the latest versions of Safari no longer supports non-Flash plugins,
656         the only scenario in which this quirk comes into play is when a third party app
657         which embeds WKWebView or WebKitLegacy loaded web pages on a OS X Server
658         running OS X Mountain Lion or earlier.
659
660         Given these observations, it's probably safe to remove this quirk from WebKit.
661
662         * html/HTMLObjectElement.cpp:
663         (WebCore::HTMLObjectElement::hasFallbackContent const):
664         (WebCore::HTMLObjectElement::hasValidClassId):
665         (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Deleted.
666         * html/HTMLObjectElement.h:
667
668 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
669
670         Unreviewed speculative WPE build fix after r195586.
671
672         * platform/encryptedmedia/CDMInstance.h:
673
674 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
675
676         Remove MediaWiki site specific quirks
677         https://bugs.webkit.org/show_bug.cgi?id=195597
678
679         Reviewed by Simon Fraser.
680
681         r47383 added a site specific quirk for the KHTML workaround in MediaWiki.
682
683         Blink since removed this workaround:
684         https://github.com/chromium/chromium/commit/ecf84fc9c1a51c8ede7adfd0b0cba446d9a8caa0
685
686         Given Chrome has been shipping without this quirk for six years, it's safe to assume
687         this site specific quirk is no longer neeed for Web compatibility.
688
689         * css/StyleSheetContents.cpp:
690         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
691         * css/parser/CSSParserContext.cpp:
692         (WebCore::CSSParserContext::CSSParserContext):
693         (WebCore::operator==):
694         * css/parser/CSSParserContext.h:
695         (WebCore::CSSParserContextHash::hash):
696
697 2019-03-11  Ryosuke Niwa  <rniwa@webkit.org>
698
699         Remove OpenCube QuickMenu quirks from navigator.appVersion
700         https://bugs.webkit.org/show_bug.cgi?id=195600
701
702         Reviewed by Simon Fraser.
703
704         Remove the site specific quirk added in r35050 for OpenCube QuickMenu library for nwa.com
705
706         Blink removed this code back in 2013. The fact Chrome has been shipping successfully without
707         this quirk for six years is a good evidence that it's no longer needed for the Web compatibility.
708
709         * page/Navigator.cpp:
710         (WebCore::Navigator::appVersion const):
711         (WebCore::shouldHideFourDot): Deleted.
712
713 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
714
715         Unreviewed, rolling out r242763.
716
717         Causes layout test crashes on iOS simulator
718
719         Reverted changeset:
720
721         "[Synthetic Click] Dispatch mouseout soon after mouseup"
722         https://bugs.webkit.org/show_bug.cgi?id=195575
723         https://trac.webkit.org/changeset/242763
724
725 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
726
727         Add Optional to Forward.h.
728         https://bugs.webkit.org/show_bug.cgi?id=195586
729
730         Reviewed by Darin Adler.
731
732         * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
733         * Modules/encryptedmedia/MediaKeyStatusMap.h:
734         * Modules/webauthn/apdu/ApduCommand.cpp:
735         * Modules/webauthn/apdu/ApduCommand.h:
736         * Modules/webauthn/apdu/ApduResponse.cpp:
737         * Modules/webauthn/apdu/ApduResponse.h:
738         * Modules/webauthn/fido/FidoHidMessage.cpp:
739         * Modules/webauthn/fido/FidoHidMessage.h:
740         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
741         * Modules/webauthn/fido/U2fCommandConstructor.h:
742         * Modules/webdatabase/SQLTransaction.cpp:
743         * Modules/webdatabase/SQLTransaction.h:
744         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
745         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
746         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
747         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
748         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
749         * Modules/webgpu/WebGPU.cpp:
750         * Modules/webgpu/WebGPU.h:
751         * Modules/webgpu/WebGPUCommandBuffer.cpp:
752         * Modules/webgpu/WebGPUCommandBuffer.h:
753         * animation/WebAnimation.cpp:
754         * animation/WebAnimation.h:
755         * crypto/gcrypt/GCryptUtilities.cpp:
756         * crypto/gcrypt/GCryptUtilities.h:
757         * css/CSSStyleDeclaration.cpp:
758         * css/CSSStyleDeclaration.h:
759         * dom/TextDecoder.cpp:
760         * dom/TextDecoder.h:
761         * dom/UserGestureIndicator.cpp:
762         * dom/UserGestureIndicator.h:
763         * editing/ChangeListTypeCommand.cpp:
764         * editing/ChangeListTypeCommand.h:
765         * editing/EditingStyle.cpp:
766         * editing/EditingStyle.h:
767         * html/DOMFormData.cpp:
768         * html/DOMFormData.h:
769         * html/HTMLAllCollection.cpp:
770         * html/HTMLAllCollection.h:
771         * html/HTMLAnchorElement.cpp:
772         * html/HTMLAnchorElement.h:
773         * html/ImageBitmap.cpp:
774         * html/ImageBitmap.h:
775         * html/canvas/Path2D.h:
776         * html/canvas/WebMetalEnums.cpp:
777         * html/canvas/WebMetalEnums.h:
778         * html/parser/HTMLParserIdioms.cpp:
779         * html/parser/HTMLParserIdioms.h:
780         * loader/ResourceCryptographicDigest.cpp:
781         * loader/ResourceCryptographicDigest.h:
782         * mathml/MathMLOperatorDictionary.cpp:
783         * mathml/MathMLOperatorDictionary.h:
784         * page/PerformanceEntry.cpp:
785         * page/PerformanceEntry.h:
786         * page/ResourceUsageData.h:
787         * platform/ReferrerPolicy.cpp:
788         * platform/ReferrerPolicy.h:
789         * platform/Theme.cpp:
790         * platform/Theme.h:
791         * platform/encryptedmedia/CDMInstance.h:
792         * platform/graphics/gpu/GPUDevice.cpp:
793         * platform/graphics/gpu/GPUDevice.h:
794         * platform/graphics/transforms/AffineTransform.cpp:
795         * platform/graphics/transforms/AffineTransform.h:
796         * platform/graphics/transforms/TransformState.cpp:
797         * platform/graphics/transforms/TransformState.h:
798         * platform/graphics/transforms/TransformationMatrix.cpp:
799         * platform/graphics/transforms/TransformationMatrix.h:
800         * platform/graphics/win/ImageDecoderDirect2D.cpp:
801         * platform/graphics/win/ImageDecoderDirect2D.h:
802         * platform/mediacapabilities/AudioConfiguration.h:
803         * platform/network/CacheValidation.cpp:
804         * platform/network/CacheValidation.h:
805         * platform/network/DataURLDecoder.cpp:
806         * platform/network/DataURLDecoder.h:
807         * platform/network/HTTPParsers.cpp:
808         * platform/network/HTTPParsers.h:
809         * platform/network/curl/CookieJarDB.cpp:
810         * platform/network/curl/CookieJarDB.h:
811         * platform/win/SearchPopupMenuDB.cpp:
812         * platform/win/SearchPopupMenuDB.h:
813         * rendering/ImageQualityController.cpp:
814         * rendering/ImageQualityController.h:
815         * svg/SVGToOTFFontConversion.cpp:
816         * svg/SVGToOTFFontConversion.h:
817         Remove unnecessary includes from headers.
818
819 2019-03-11  Jer Noble  <jer.noble@apple.com>
820
821         REGRESSION(r236281): YouTube Movies fail with "video format" error
822         https://bugs.webkit.org/show_bug.cgi?id=195598
823         <rdar://problem/48782842>
824
825         Reviewed by Jon Lee.
826
827         Partially revert r236281 for YouTube.com.
828
829         * page/Quirks.cpp:
830         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
831
832 2019-03-11  Justin Fan  <justin_fan@apple.com>
833
834         [Web GPU] BindGroups/Argument buffers: Move MTLBuffer creation from and GPUBindGroup validation to GPUDevice.createBindGroup
835         https://bugs.webkit.org/show_bug.cgi?id=195519
836         <rdar://problem/48781297>
837
838         Reviewed by Myles C. Maxfield.
839
840         Metal's Argument Buffers should not be tied directly to GPUBindGroupLayout; rather, create the MTLBuffer 
841         in GPUBindGroup creation process.
842         Move GPUBindGroup validation out of setBindGroup and to GPUBindGroup creation for performance.
843
844         Covered by existing tests. No behavior change.
845
846         * Modules/webgpu/WebGPUDevice.cpp:
847         (WebCore::WebGPUDevice::createBindGroup const):
848         * Sources.txt:
849         * SourcesCocoa.txt:
850         * WebCore.xcodeproj/project.pbxproj:
851         * platform/graphics/gpu/GPUBindGroup.cpp: Removed.
852         * platform/graphics/gpu/GPUBindGroup.h:
853         (WebCore::GPUBindGroup::vertexArgsBuffer): A buffer that arguments will be encoded into during setBindGroup.
854         (WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
855         (WebCore::GPUBindGroup::boundBuffers const): A list of resources that are bound by this GPUBindGroup.
856         (WebCore::GPUBindGroup::boundTextures const): Ditto.
857         (WebCore::GPUBindGroup::layout const): Deleted.
858         (WebCore::GPUBindGroup::bindings const): Deleted.
859         * platform/graphics/gpu/GPUBindGroupLayout.h: No longer creating and retaining MTLBuffers.
860         (WebCore::GPUBindGroupLayout::vertexEncoder const):
861         (WebCore::GPUBindGroupLayout::fragmentEncoder const):
862         (WebCore::GPUBindGroupLayout::computeEncoder const):
863         (WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::isValid const): Deleted.
864         (WebCore::GPUBindGroupLayout::vertexArguments const): Deleted.
865         (WebCore::GPUBindGroupLayout::fragmentArguments const): Deleted.
866         (WebCore::GPUBindGroupLayout::computeArguments const): Deleted.
867         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
868         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
869         (WebCore::tryCreateMtlArgumentEncoder):
870         (WebCore::GPUBindGroupLayout::tryCreate):
871         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
872         (WebCore::tryCreateArgumentEncoderAndBuffer): Deleted.
873         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Added.
874         (WebCore::tryCreateArgumentBuffer): Create and associate the MTLBuffer that backs the MTLArgumentEncoder.
875         (WebCore::tryGetResourceAsBufferBinding): Validate a GPUBindingResource.
876         (WebCore::trySetBufferOnEncoder): Encodes a GPUBufferBinding's MTLBuffer on a MTLArgumentEncoder.
877         (WebCore::tryGetResourceAsSampler): Ditto, for GPUSamplers.
878         (WebCore::trySetSamplerOnEncoder):
879         (WebCore::tryGetResourceAsTexture): Ditto, for GPUTextures.
880         (WebCore::trySetTextureOnEncoder):
881         (WebCore::GPUBindGroup::tryCreate): Most setBindGroup validation moved here.
882         (WebCore::GPUBindGroup::GPUBindGroup): Retains the resource references needed for setBindGroup. 
883         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
884         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Most validation moved to GPUBindGroup::tryCreate().
885         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Deleted.
886         (WebCore::GPUProgrammablePassEncoder::setResourceAsSamplerOnEncoder): Deleted.
887         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder): Deleted.
888         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
889         (WebCore::GPURenderPassEncoder::useResource):
890         (WebCore::GPURenderPassEncoder::setVertexBuffer):
891         (WebCore::GPURenderPassEncoder::setFragmentBuffer):
892
893         Misc:
894         * platform/graphics/gpu/GPUCommandBuffer.cpp/h: Move missing includes to header.
895
896 2019-03-11  Zalan Bujtas  <zalan@apple.com>
897
898         [Synthetic Click] Dispatch mouseout soon after mouseup
899         https://bugs.webkit.org/show_bug.cgi?id=195575
900         <rdar://problem/47093049>
901
902         Reviewed by Simon Fraser.
903
904         Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
905
906         Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
907
908         * page/EventHandler.h:
909         * page/ios/EventHandlerIOS.mm:
910         (WebCore::EventHandler::dispatchFakeMouseOut):
911
912 2019-03-11  Youenn Fablet  <youenn@apple.com>
913
914         REGRESSION: (r242181) API test DragAndDropTests.ExternalSourcePlainTextToIFrame is Timing out
915         https://bugs.webkit.org/show_bug.cgi?id=195362
916
917         Reviewed by Alexey Proskuryakov.
918
919         Covered by API test no longer crashing.
920
921         * page/SecurityOrigin.cpp:
922         (WebCore::originsMatch):
923         String representation should only match if originsMatch returns true.
924
925 2019-03-11  Justin Fan  <justin_fan@apple.com>
926
927         [Web GPU] Update GPUSwapChainDescriptor, GPUSwapChain and implement GPUCanvasContext
928         https://bugs.webkit.org/show_bug.cgi?id=194406
929         <rdar://problem/47892466>
930
931         Reviewed by Myles C. Maxfield.
932
933         GPUSwapChain no longer inherits from GPUBasedRenderingContext, and is now created from a GPUDevice. 
934         WebGPURenderingContext is now GPUCanvasContext and delegates functionality to the GPUSwapChain, if it exists. 
935         GPUQueue now implicitly presents the GPUSwapChain's current drawable at the task boundary, if one exists.
936         Creating a new GPUSwapChain with the same GPUCanvasContext invalidates the previous one and its drawable and pipeline attachments.
937         Calling GPUSwapChain::getCurrentTexture returns the same drawable within one task cycle. 
938         Some mentions of "WebGPU" have been renamed to "Web GPU" and "gpu".
939
940         All Web GPU tests updated to match.
941
942         Add new files and symbols.
943         * CMakeLists.txt:
944         * DerivedSources-input.xcfilelist:
945         * DerivedSources-output.xcfilelist:
946         * DerivedSources.make:
947         * Sources.txt:
948         * WebCore.xcodeproj/project.pbxproj:
949         * bindings/js/WebCoreBuiltinNames.h:
950
951         Rename some mentions of "webgpu" to "gpu".
952         * Modules/webgpu/DOMWindowWebGPU.cpp:
953         (WebCore::DOMWindowWebGPU::gpu):
954         (WebCore::DOMWindowWebGPU::gpu const):
955         * Modules/webgpu/DOMWindowWebGPU.h:
956         * Modules/webgpu/DOMWindowWebGPU.idl:
957
958         Replace WebGPURenderingContext with GPUCanvasContext.
959         * Modules/webgpu/GPUCanvasContext.cpp: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.cpp.
960         (WebCore::GPUCanvasContext::create):
961         (WebCore::GPUCanvasContext::GPUCanvasContext):
962         (WebCore::GPUCanvasContext::replaceSwapChain):
963         (WebCore::GPUCanvasContext::platformLayer const):
964         (WebCore::GPUCanvasContext::reshape):
965         (WebCore::GPUCanvasContext::markLayerComposited):
966         * Modules/webgpu/GPUCanvasContext.h: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.h.
967         * Modules/webgpu/GPUCanvasContext.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.idl.
968         * dom/Document.cpp:
969         (WebCore::Document::getCSSCanvasContext):
970         * dom/Document.h:
971         * dom/Document.idl:
972         * html/HTMLCanvasElement.cpp:
973         (WebCore::HTMLCanvasElement::getContext):
974         (WebCore::HTMLCanvasElement::isWebGPUType):
975         (WebCore::HTMLCanvasElement::createContextWebGPU):
976         (WebCore::HTMLCanvasElement::getContextWebGPU):
977         * html/HTMLCanvasElement.h:
978         * html/HTMLCanvasElement.idl:
979         * inspector/InspectorCanvas.cpp:
980         (WebCore::InspectorCanvas::buildObjectForCanvas):
981         * inspector/agents/InspectorCanvasAgent.cpp:
982         (WebCore::contextAsScriptValue):
983
984         Update WebGPUSwapChain.
985         * Modules/webgpu/GPUTextureDescriptor.idl:
986         * Modules/webgpu/GPUTextureFormat.idl: Add the other two texture formats supported by CAMetalLayer.
987         * Modules/webgpu/WebGPUDevice.cpp: Implement createSwapChain.
988         (WebCore::WebGPUDevice::createSwapChain const):
989         (WebCore::WebGPUDevice::getQueue const):
990         (WebCore::WebGPUDevice::getQueue): Deleted.
991         * Modules/webgpu/WebGPUDevice.h:
992         * Modules/webgpu/WebGPUDevice.idl:
993         * Modules/webgpu/WebGPUSwapChain.cpp:
994         (WebCore::WebGPUSwapChain::create):
995         (WebCore::WebGPUSwapChain::WebGPUSwapChain):
996         (WebCore::WebGPUSwapChain::getCurrentTexture): Renamed from getNextTexture. Only returns the next drawable if the last was presented.
997         (WebCore::WebGPUSwapChain::destroy): Invalidate this GPUSwapChain and its textures and views.
998         (WebCore::WebGPUSwapChain::configure): Deleted.
999         (WebCore::WebGPUSwapChain::getNextTexture): Deleted.
1000         (WebCore::WebGPUSwapChain::present): Deleted.
1001         (WebCore::WebGPUSwapChain::reshape): Deleted.
1002         (WebCore::WebGPUSwapChain::markLayerComposited): Deleted.
1003         * Modules/webgpu/WebGPUSwapChain.h: Now a device-based object rather than a rendering context.
1004         (WebCore::WebGPUSwapChain::swapChain const):
1005         (WebCore::WebGPUSwapChain::WebGPUSwapChain): Deleted.
1006         * Modules/webgpu/WebGPUSwapChain.idl:
1007         * Modules/webgpu/WebGPUSwapChainDescriptor.h: Added.
1008         * platform/graphics/gpu/GPUDevice.cpp: Implement tryCreateSwapChain.
1009         (WebCore::GPUDevice::tryCreateSwapChain const):
1010         (WebCore::GPUDevice::getQueue const):
1011         (WebCore::GPUDevice::getQueue): Deleted.
1012         * platform/graphics/gpu/GPUDevice.h: Retain a reference to the current GPUSwapChain, if one exists.
1013         (WebCore::GPUDevice::swapChain const):
1014         * platform/graphics/gpu/GPUQueue.h:
1015         * platform/graphics/gpu/GPUSwapChain.h:
1016         (WebCore::GPUSwapChain::destroy):
1017         * platform/graphics/gpu/GPUSwapChainDescriptor.h: Added.
1018         * platform/graphics/gpu/GPUTextureFormat.h: Add the other two texture formats supported by CAMetalLayer.
1019         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1020         (WebCore::GPUBuffer::commandBufferCommitted):
1021         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
1022         (WebCore::GPUQueue::tryCreate): Renamed from create to better fit functionality. Now retain a reference to the GPUDevice.
1023         (WebCore::GPUQueue::GPUQueue):
1024         (WebCore::GPUQueue::submit): Now checks state of all resources before marking them as committed or committing any resource.
1025                 In addition, schedules the current drawable to be presented after all commands have been submitted during this task cycle.
1026         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1027         (WebCore::useAttachments): Ensure that the command buffer is aware of any texture resources used as attachments.
1028         (WebCore::GPURenderPassEncoder::tryCreate):
1029         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
1030         (WebCore::tryGetSupportedPixelFormat): Supported texture formats are the intersection of Web GPU's texture formats and CAMetalLayer's.
1031         (WebCore::setLayerShape):
1032         (WebCore::tryCreateSwapLayer): Create and configure the CAMetalLayer backing the swap chain.
1033         (WebCore::GPUSwapChain::tryCreate):
1034         (WebCore::GPUSwapChain::GPUSwapChain):
1035         (WebCore::GPUSwapChain::tryGetCurrentTexture): Renamed from getNextTexture. Only returns a texture if the last one was presented.
1036         (WebCore::GPUSwapChain::present):
1037         (WebCore::GPUSwapChain::reshape):
1038         (WebCore::GPUSwapChain::takeDrawable): Swaps out the current drawable so that it can be presented. The GPUSwapChain thus releases its reference to it.
1039         (WebCore::GPUSwapChain::create): Deleted.
1040         (WebCore::GPUSwapChain::setDevice): Deleted.
1041         (WebCore::GPUSwapChain::setFormat): Deleted.
1042         (WebCore::GPUSwapChain::getNextTexture): Deleted.
1043         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
1044         (WebCore::platformTextureFormatForGPUTextureFormat):
1045
1046         Misc:
1047         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Missing include.
1048
1049 2019-03-11  Chris Dumez  <cdumez@apple.com>
1050
1051         Update device orientation & motion permission native SPI as per latest proposal
1052         https://bugs.webkit.org/show_bug.cgi?id=195567
1053
1054         Reviewed by Youenn Fablet.
1055
1056         * dom/DeviceOrientationAndMotionAccessController.cpp:
1057         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
1058         * page/ChromeClient.h:
1059
1060 2019-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1061
1062         [macOS] Dispatching reentrant "contextmenu" events may cause crashes
1063         https://bugs.webkit.org/show_bug.cgi?id=195571
1064         <rdar://problem/48086046>
1065
1066         Reviewed by Andy Estes.
1067
1068         Make ContextMenuController::handleContextMenuEvent robust against reentrancy by guarding it with a boolean flag.
1069         As demonstrated in the test case, it is currently possible to force WebKit into a bad state by dispatching a
1070         synthetic "contextmenu" event from within the scope of one of the "before(copy|cut|paste)" events triggered as
1071         a result of handling a context menu event.
1072
1073         Test: fast/events/contextmenu-reentrancy-crash.html
1074
1075         * page/ContextMenuController.cpp:
1076         (WebCore::ContextMenuController::handleContextMenuEvent):
1077         * page/ContextMenuController.h:
1078
1079 2019-03-11  Andy Estes  <aestes@apple.com>
1080
1081         [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
1082         https://bugs.webkit.org/show_bug.cgi?id=195530
1083         <rdar://problem/48747164>
1084
1085         Reviewed by Alex Christensen.
1086
1087         * Modules/applepay/PaymentCoordinatorClient.h: Defined isWebPaymentCoordinator.
1088         * page/Settings.yaml: Defined the applePayRemoteUIEnabled setting and reordered the other
1089         Apple Pay settings.
1090
1091 2019-03-11  Alex Christensen  <achristensen@webkit.org>
1092
1093         Soft linking to Reveal framework should be optional
1094         https://bugs.webkit.org/show_bug.cgi?id=195576
1095         <rdar://problem/46822452>
1096
1097         Reviewed by Megan Gardner.
1098
1099         Systems exist with ENABLE(REVEAL) true and the Reveal framework does not exist.
1100
1101         * editing/cocoa/DictionaryLookup.mm:
1102         (WebCore::showPopupOrCreateAnimationController):
1103
1104 2019-03-11  Yusuke Suzuki  <ysuzuki@apple.com>
1105
1106         [JSC] Reduce # of structures in JSGlobalObject initialization
1107         https://bugs.webkit.org/show_bug.cgi?id=195498
1108
1109         Reviewed by Darin Adler.
1110
1111         * bindings/js/SerializedScriptValue.cpp:
1112         (WebCore::CloneSerializer::serialize):
1113
1114 2019-03-11  Brent Fulgham  <bfulgham@apple.com>
1115
1116         Remove obsolete runtime flag for StorageAccess API Prompt
1117         https://bugs.webkit.org/show_bug.cgi?id=195564
1118         <rdar://problem/37279014>
1119
1120         Reviewed by Chris Dumez.
1121
1122         This bug tracks the work of removing the obsolete flag that had been used to optionally
1123         prevent display of the StorageAccess API prompt. We have since shipped the final version
1124         of this feature with an always-on prompt, and should have removed this runtime flag.
1125
1126         No test changes because this has no change in behavior. Tests already assume the prompt
1127         behavior, and did not test turning the flag off.
1128
1129         * page/RuntimeEnabledFeatures.h:
1130         (WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled): Deleted.
1131         (WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const): Deleted.
1132         * testing/InternalSettings.cpp:
1133         (WebCore::InternalSettings::Backup::Backup):
1134         (WebCore::InternalSettings::Backup::restoreTo):
1135         (WebCore::InternalSettings::setStorageAccessPromptsEnabled): Deleted.
1136         * testing/InternalSettings.h:
1137         (): Deleted.
1138         * testing/InternalSettings.idl:
1139
1140 2019-03-11  Eric Carlson  <eric.carlson@apple.com>
1141
1142         Add web audio release logging
1143         https://bugs.webkit.org/show_bug.cgi?id=195554
1144         <rdar://problem/48767211>
1145
1146         Reviewed by Jer Noble.
1147
1148         No new tests, no functional change.
1149
1150         * Modules/webaudio/AudioBasicInspectorNode.cpp:
1151         (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
1152         * Modules/webaudio/AudioBufferSourceNode.cpp:
1153         (WebCore::AudioBufferSourceNode::setBuffer):
1154         (WebCore::AudioBufferSourceNode::startPlaying):
1155         * Modules/webaudio/AudioContext.cpp:
1156         (WebCore::nextLogIdentifier):
1157         (WebCore::AudioContext::AudioContext):
1158         (WebCore::AudioContext::uninitialize):
1159         (WebCore::AudioContext::stop):
1160         (WebCore::AudioContext::createBufferSource):
1161         (WebCore::AudioContext::createMediaElementSource):
1162         (WebCore::AudioContext::createMediaStreamSource):
1163         (WebCore::AudioContext::createScriptProcessor):
1164         (WebCore::AudioContext::createBiquadFilter):
1165         (WebCore::AudioContext::createWaveShaper):
1166         (WebCore::AudioContext::createPanner):
1167         (WebCore::AudioContext::createConvolver):
1168         (WebCore::AudioContext::createDynamicsCompressor):
1169         (WebCore::AudioContext::createAnalyser):
1170         (WebCore::AudioContext::createGain):
1171         (WebCore::AudioContext::createDelay):
1172         (WebCore::AudioContext::createChannelSplitter):
1173         (WebCore::AudioContext::createChannelMerger):
1174         (WebCore::AudioContext::createOscillator):
1175         (WebCore::AudioContext::createPeriodicWave):
1176         (WebCore::AudioContext::willBeginPlayback):
1177         (WebCore::AudioContext::startRendering):
1178         (WebCore::AudioContext::fireCompletionEvent):
1179         (WebCore::AudioContext::logChannel const):
1180         * Modules/webaudio/AudioContext.h:
1181         (WebCore::AudioContext::nextAudioNodeLogIdentifier):
1182         (WebCore::AudioContext::nextAudioParameterLogIdentifier):
1183         * Modules/webaudio/AudioDestinationNode.cpp:
1184         (WebCore::AudioDestinationNode::AudioDestinationNode):
1185         * Modules/webaudio/AudioNode.cpp:
1186         (WebCore::convertEnumerationToString):
1187         (WebCore::AudioNode::AudioNode):
1188         (WebCore::AudioNode::~AudioNode):
1189         (WebCore::AudioNode::setNodeType):
1190         (WebCore::AudioNode::addInput):
1191         (WebCore::AudioNode::addOutput):
1192         (WebCore::AudioNode::connect):
1193         (WebCore::AudioNode::disconnect):
1194         (WebCore::AudioNode::setChannelCount):
1195         (WebCore::AudioNode::setChannelCountMode):
1196         (WebCore::AudioNode::setChannelInterpretation):
1197         (WebCore::AudioNode::logChannel const):
1198         * Modules/webaudio/AudioNode.h:
1199         (WTF::LogArgument<WebCore::AudioNode::NodeType>::toString):
1200         * Modules/webaudio/AudioParam.cpp:
1201         (WebCore::AudioParam::AudioParam):
1202         (WebCore::AudioParam::setValue):
1203         (WebCore::AudioParam::connect):
1204         (WebCore::AudioParam::disconnect):
1205         (WebCore::AudioParam::logChannel const):
1206         * Modules/webaudio/AudioParam.h:
1207         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1208         (WebCore::AudioScheduledSourceNode::start):
1209         (WebCore::AudioScheduledSourceNode::stop):
1210         * Modules/webaudio/BiquadFilterNode.cpp:
1211         (WebCore::BiquadFilterNode::BiquadFilterNode):
1212         * Modules/webaudio/ChannelMergerNode.cpp:
1213         (WebCore::ChannelMergerNode::ChannelMergerNode):
1214         * Modules/webaudio/ChannelSplitterNode.cpp:
1215         (WebCore::ChannelSplitterNode::ChannelSplitterNode):
1216         * Modules/webaudio/ConvolverNode.cpp:
1217         (WebCore::ConvolverNode::ConvolverNode):
1218         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1219         (WebCore::DefaultAudioDestinationNode::initialize):
1220         (WebCore::DefaultAudioDestinationNode::uninitialize):
1221         (WebCore::DefaultAudioDestinationNode::enableInput):
1222         (WebCore::DefaultAudioDestinationNode::setChannelCount):
1223         * Modules/webaudio/DelayNode.cpp:
1224         (WebCore::DelayNode::DelayNode):
1225         * Modules/webaudio/DynamicsCompressorNode.cpp:
1226         (WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
1227         * Modules/webaudio/GainNode.cpp:
1228         (WebCore::GainNode::GainNode):
1229         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1230         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
1231         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1232         (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode):
1233         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1234         (WebCore::OfflineAudioDestinationNode::startRendering):
1235         * Modules/webaudio/OscillatorNode.cpp:
1236         (WebCore::OscillatorNode::setType):
1237         (WebCore::OscillatorNode::setPeriodicWave):
1238         * Modules/webaudio/OscillatorNode.h:
1239         (WTF::LogArgument<WebCore::OscillatorNode::Type>::toString):
1240         * Modules/webaudio/PannerNode.cpp:
1241         (WebCore::PannerNode::PannerNode):
1242         * Modules/webaudio/ScriptProcessorNode.cpp:
1243         (WebCore::ScriptProcessorNode::ScriptProcessorNode):
1244         * Modules/webaudio/WaveShaperNode.cpp:
1245         (WebCore::WaveShaperNode::WaveShaperNode):
1246         (WebCore::WaveShaperNode::setCurve):
1247         (WebCore::WaveShaperNode::setOversample):
1248         * Modules/webaudio/WaveShaperNode.h:
1249         (WTF::LogArgument<WebCore::WaveShaperNode::OverSampleType>::toString):
1250
1251 2019-03-11  Youenn Fablet  <youenn@apple.com>
1252
1253         Make IDBDatabaseIdentifier take a ClientOrigin as member
1254         https://bugs.webkit.org/show_bug.cgi?id=195544
1255
1256         Reviewed by Geoffrey Garen.
1257
1258         Instead of taking a top and a frame origin, make
1259         make IDBDatabaseIdentifier take a ClientOrigin.
1260
1261         This allows reusing some ClientOrigin code
1262         and will ease implementation of storage quota checking in
1263         NetworkProcess, as quota managers are keyed by client origins.
1264
1265         No change of behavior.
1266
1267         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1268         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
1269         (WebCore::IDBDatabaseIdentifier::isolatedCopy const):
1270         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
1271         (WebCore::IDBDatabaseIdentifier::debugString const):
1272         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1273         (WebCore::IDBDatabaseIdentifier::hash const):
1274         (WebCore::IDBDatabaseIdentifier::operator== const):
1275         (WebCore::IDBDatabaseIdentifier::origin const):
1276         (WebCore::IDBDatabaseIdentifier::isRelatedToOrigin const):
1277         (WebCore::IDBDatabaseIdentifier::encode const):
1278         (WebCore::IDBDatabaseIdentifier::decode):
1279         * page/ClientOrigin.h:
1280         (WebCore::ClientOrigin::isRelated const):
1281
1282 2019-03-11  Zan Dobersek  <zdobersek@igalia.com>
1283
1284         Unreviewed. Manually rolling out r242701 and r242703 since the changes
1285         are causing test timeouts and crashes on GTK and WPE.
1286
1287         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1288         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1289         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1290         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1291         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
1292         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
1293         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1294         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
1295         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer):
1296         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
1297         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
1298         (): Deleted.
1299
1300 2019-03-11  Jer Noble  <jer.noble@apple.com>
1301
1302         Use AVContentKeySession for "com.apple.fps.2_0" CDM version when AVStreamSession is absent
1303         https://bugs.webkit.org/show_bug.cgi?id=195462
1304         <rdar://problem/48712306>
1305
1306         Reviewed by Eric Carlson.
1307
1308         The difference between "com.apple.fps.2_0" and "3_0" is a protocol difference more than an
1309         implementation difference. In "2_0", the "EME nitialization" data comes in the form of a "content
1310         identifier", while the true initialization data is retrieved through a side channel directly from
1311         the attached element. In "3_0", the "EME initialization data" is the exact initialization data
1312         given by the parser, with no "content identifier" at all.
1313
1314         In the original implementation, the "2_0" used AVStreamSession, and "3_0" used AVContentKeySession,
1315         but in the absense of AVStreamSession, those protocol differences are minor and can be implemented
1316         using AVContentKeySession.
1317
1318         Changes:
1319
1320         - Add a new helper struct in CDMPrivateMediaSourceAVFObjC that represents the parsed parameters
1321           of the CDM string.
1322         - Add an "initData()" accessor to SourceBufferPrivateAVFObjC so that the "2_0" path can implement
1323           the side channel access to the necessary initialization data.
1324         - Refactor some of the SPI code to not re-declare unnecessary APIs.
1325         - In CDMSessionAVContentKeySession::generateKeyRequest(), this function can never be called twice
1326           so it is a logical impossibility to have a certificate at this point. Remove all this if() code.
1327
1328         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
1329         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
1330         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1331         (WebCore::CDMPrivateMediaSourceAVFObjC::parseKeySystem):
1332         (WebCore::queryDecoderAvailability):
1333         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem):
1334         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
1335         (WebCore::validKeySystemRE): Deleted.
1336         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
1337         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1338         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
1339         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
1340         (WebCore::CDMSessionAVContentKeySession::update):
1341         (WebCore::CDMSessionAVContentKeySession::addParser):
1342         (WebCore::CDMSessionAVContentKeySession::removeParser):
1343         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
1344         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1345         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1346         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
1347         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1348         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1349         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
1350         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1351         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1352         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1353
1354 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
1355
1356         Unreviewed, rolling out r242688, r242643, r242624.
1357
1358         Caused multiple layout test failures and crashes on iOS and macOS.
1359
1360         Reverted changeset:
1361
1362         "requestAnimationFrame should execute before the next frame"
1363         https://bugs.webkit.org/show_bug.cgi?id=177484
1364         https://trac.webkit.org/changeset/242624/webkit
1365
1366         * Sources.txt:
1367         * WebCore.xcodeproj/project.pbxproj:
1368         * accessibility/mac/AXObjectCacheMac.mm:
1369         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
1370         * animation/DocumentAnimationScheduler.cpp: Added.
1371         (WebCore::DocumentAnimationScheduler::create):
1372         (WebCore::DocumentAnimationScheduler::DocumentAnimationScheduler):
1373         (WebCore::DocumentAnimationScheduler::detachFromDocument):
1374         (WebCore::DocumentAnimationScheduler::scheduleWebAnimationsResolution):
1375         (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution):
1376         (WebCore::DocumentAnimationScheduler::scheduleScriptedAnimationResolution):
1377         (WebCore::DocumentAnimationScheduler::displayRefreshFired):
1378         (WebCore::DocumentAnimationScheduler::windowScreenDidChange):
1379         (WebCore::DocumentAnimationScheduler::createDisplayRefreshMonitor const):
1380         * animation/DocumentAnimationScheduler.h: Renamed from Source/WebCore/page/RenderingUpdateScheduler.h.
1381         (WebCore::DocumentAnimationScheduler::lastTimestamp):
1382         (WebCore::DocumentAnimationScheduler::isFiring const):
1383         * animation/DocumentTimeline.cpp:
1384         (WebCore::DocumentTimeline::DocumentTimeline):
1385         (WebCore::DocumentTimeline::updateThrottlingState):
1386         (WebCore::DocumentTimeline::suspendAnimations):
1387         (WebCore::DocumentTimeline::resumeAnimations):
1388         (WebCore::DocumentTimeline::liveCurrentTime const):
1389         (WebCore::DocumentTimeline::currentTime):
1390         (WebCore::DocumentTimeline::cacheCurrentTime):
1391         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded):
1392         (WebCore::DocumentTimeline::animationTimingDidChange):
1393         (WebCore::DocumentTimeline::scheduleAnimationResolution):
1394         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
1395         (WebCore::DocumentTimeline::animationResolutionTimerFired):
1396         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
1397         (WebCore::DocumentTimeline::scheduleNextTick):
1398         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
1399         (WebCore::DocumentTimeline::resolveAnimationsForElement):
1400         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Deleted.
1401         * animation/DocumentTimeline.h:
1402         * dom/Document.cpp:
1403         (WebCore::Document::resolveStyle):
1404         (WebCore::Document::prepareForDestruction):
1405         (WebCore::Document::windowScreenDidChange):
1406         (WebCore::Document::updateIntersectionObservations):
1407         (WebCore::Document::scheduleForcedIntersectionObservationUpdate):
1408         (WebCore::Document::animationScheduler):
1409         (WebCore::Document::updateAnimationsAndSendEvents): Deleted.
1410         (WebCore::Document::serviceRequestAnimationFrameCallbacks): Deleted.
1411         * dom/Document.h:
1412         * dom/ScriptedAnimationController.cpp:
1413         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
1414         (WebCore::ScriptedAnimationController::scheduleAnimation):
1415         (WebCore::ScriptedAnimationController::animationTimerFired):
1416         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire):
1417         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): Deleted.
1418         * dom/ScriptedAnimationController.h:
1419         * page/FrameView.cpp:
1420         (WebCore::FrameView::viewportContentsChanged):
1421         * page/IntersectionObserver.cpp:
1422         (WebCore::IntersectionObserver::observe):
1423         * page/Page.cpp:
1424         (WebCore::Page::Page):
1425         (WebCore::Page::willDisplayPage):
1426         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate):
1427         (WebCore::Page::updateIntersectionObservations):
1428         (WebCore::Page::scheduleForcedIntersectionObservationUpdate):
1429         (WebCore::Page::layoutIfNeeded): Deleted.
1430         (WebCore::Page::renderingUpdate): Deleted.
1431         (WebCore::Page::renderingUpdateScheduler): Deleted.
1432         * page/Page.h:
1433         * page/PageOverlayController.cpp:
1434         (WebCore::PageOverlayController::didChangeViewExposedRect):
1435         (WebCore::PageOverlayController::notifyFlushRequired):
1436         * page/RenderingUpdateScheduler.cpp: Removed.
1437         * page/ios/ContentChangeObserver.h:
1438         * page/mac/ServicesOverlayController.mm:
1439         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
1440         * rendering/RenderLayerCompositor.cpp:
1441         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
1442
1443 2019-03-11  Darin Adler  <darin@apple.com>
1444
1445         Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
1446         https://bugs.webkit.org/show_bug.cgi?id=195533
1447
1448         Reviewed by Brent Fulgham.
1449
1450         * accessibility/AccessibilityNodeObject.cpp:
1451         (WebCore::AccessibilityNodeObject::changeValueByStep): Use numberToStringFixedPrecision.
1452         (WebCore::AccessibilityNodeObject::changeValueByPercent): Ditto.
1453         * accessibility/AccessibilityScrollbar.cpp:
1454         (WebCore::AccessibilityScrollbar::setValue): Ditto.
1455         * css/CSSFontVariationValue.cpp:
1456         (WebCore::CSSFontVariationValue::customCSSText const): Use appendFixedPrecisionNumber.
1457         * css/CSSGradientValue.cpp:
1458         (WebCore::CSSLinearGradientValue::customCSSText const): Ditto.
1459         (WebCore::CSSRadialGradientValue::customCSSText const): Ditto.
1460         * css/CSSKeyframeRule.cpp:
1461         (WebCore::StyleRuleKeyframe::keyText const): Ditto.
1462         * css/CSSTimingFunctionValue.cpp:
1463         (WebCore::CSSCubicBezierTimingFunctionValue::customCSSText const): Ditto.
1464         (WebCore::CSSSpringTimingFunctionValue::customCSSText const): Ditto.
1465         * css/parser/CSSParserToken.cpp:
1466         (WebCore::CSSParserToken::serialize const): Ditto.
1467         * html/HTMLImageElement.cpp:
1468         (WebCore::HTMLImageElement::completeURLsInAttributeValue const): Ditto.
1469         * inspector/InspectorOverlay.cpp:
1470         (WebCore::InspectorOverlay::drawRulers): Use numberToStringFixedPrecision.
1471         * loader/ResourceLoadStatistics.cpp:
1472         (WebCore::ResourceLoadStatistics::toString const): Use appendFixedPrecisionNumber.
1473         * page/PrintContext.cpp:
1474         (WebCore::PrintContext::pageProperty): Use numberToStringFixedPrecision.
1475         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1476         (WebCore::gcTimerString): Use numberToStringFixedPrecision.
1477         * platform/LayoutUnit.h:
1478         (WTF::ValueToString<WebCore::LayoutUnit>::string): Ditto.
1479         * platform/graphics/Color.cpp:
1480         (WebCore::Color::cssText const): Use appendFixedPrecisionNumber.
1481         * platform/graphics/ExtendedColor.cpp:
1482         (WebCore::ExtendedColor::cssText const): Ditto.
1483         * svg/SVGAngleValue.cpp:
1484         (WebCore::SVGAngleValue::valueAsString const): Use numberToStringFixedPrecision.
1485         * svg/SVGNumberListValues.cpp:
1486         (WebCore::SVGNumberListValues::valueAsString const): Use appendFixedPrecisionNumber.
1487         * svg/SVGPathStringBuilder.cpp:
1488         (WebCore::appendNumber): Ditto.
1489         (WebCore::appendPoint): Ditto.
1490         * svg/SVGPointListValues.cpp:
1491         (WebCore::SVGPointListValues::valueAsString const): Ditto.
1492         * svg/SVGTransformValue.cpp:
1493         (WebCore::SVGTransformValue::valueAsString const): Ditto.
1494         * svg/properties/SVGPropertyTraits.h:
1495         (WebCore::SVGPropertyTraits<float>::toString): Use numberToStringFixedPrecision.
1496         (WebCore::SVGPropertyTraits<FloatPoint>::toString): Use appendFixedPrecisionNumber.
1497         (WebCore::SVGPropertyTraits<FloatRect>::toString): Ditto.
1498         * testing/Internals.cpp:
1499         (WebCore::Internals::dumpMarkerRects): Use appendFixedPrecisionNumber.
1500         (WebCore::Internals::getCurrentCursorInfo): Ditto.
1501         * xml/XPathValue.cpp:
1502         (WebCore::XPath::Value::toString const): Use numberToStringFixedPrecision.
1503
1504 2019-03-11  Philippe Normand  <pnormand@igalia.com>
1505
1506         Unreviewed, Non-GStreamer-GL build fix after r242701.
1507
1508         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1509         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1510
1511 2019-03-11  Philippe Normand  <pnormand@igalia.com>
1512
1513         [GStreamer][v4l2] Synchronous video texture flushing support
1514         https://bugs.webkit.org/show_bug.cgi?id=195453
1515
1516         Reviewed by Xabier Rodriguez-Calvar.
1517
1518         The v4l2 video decoder currently requires that downstream users of
1519         the graphics resources complete any pending draw call and release
1520         resources before returning from the DRAIN query.
1521
1522         To accomplish this the player monitors the pipeline and whenever a
1523         v4l2 decoder is added, synchronous video texture flushing support
1524         is enabled. Additionally and for all decoder configurations, a
1525         flush is performed before disposing of the player.
1526
1527         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1528         (WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
1529         Monitor elements added to the decodebin bin.
1530         (WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
1531         a flag if a v4l2 decoder was added in decodebin.
1532         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
1533         to the deep-element-added signal so as to monitor pipeline
1534         topology updates.
1535         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1536         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1537         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1538         Flush video texture before disposing of the player.
1539         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
1540         Synchronously flush if the pipeline contains a v4l2 decoder.
1541         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
1542         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1543         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
1544         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
1545         boolean flag used mostly to trigger synchronous flush conditions.
1546         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
1547         Optionally drop the current buffer in a synchronous manner. By
1548         default the method keeps operating asynchronously.
1549         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
1550
1551 2019-03-11  Antti Koivisto  <antti@apple.com>
1552
1553         Rename contentOffsetInCompostingLayer to contentOffsetInCompositingLayer
1554         https://bugs.webkit.org/show_bug.cgi?id=195553
1555
1556         Reviewed by Simon Fraser.
1557
1558         Less composting, more compositing.
1559
1560         * rendering/RenderLayerBacking.cpp:
1561         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
1562         (WebCore::RenderLayerBacking::resetContentsRect):
1563         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
1564         (WebCore::RenderLayerBacking::updateImageContents):
1565         (WebCore::RenderLayerBacking::contentOffsetInCompositingLayer const):
1566         (WebCore::RenderLayerBacking::contentsBox const):
1567         (WebCore::RenderLayerBacking::backgroundBoxForSimpleContainerPainting const):
1568         (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer const): Deleted.
1569         * rendering/RenderLayerBacking.h:
1570
1571 2019-03-10  Ross Kirsling  <ross.kirsling@sony.com>
1572
1573         Invalid flags in a RegExp literal should be an early SyntaxError
1574         https://bugs.webkit.org/show_bug.cgi?id=195514
1575
1576         Reviewed by Darin Adler.
1577
1578         * bindings/js/SerializedScriptValue.cpp:
1579         (WebCore::CloneDeserializer::readTerminal):
1580         Consume YarrFlags.
1581
1582 2019-03-10  Tim Horton  <timothy_horton@apple.com>
1583
1584         Add SPI to retrieve the set of text inputs in a given rect, and later focus one
1585         https://bugs.webkit.org/show_bug.cgi?id=195499
1586
1587         Reviewed by Darin Adler.
1588
1589         New API tests: WebKit.RequestTextInputContext and WebKit.FocusTextInputContext
1590
1591         * WebCore.xcodeproj/project.pbxproj:
1592         * dom/Document.cpp:
1593         (WebCore::Document::identifierForElement):
1594         (WebCore::Document::elementWithIdentifier):
1595         (WebCore::Document::identifiedElementWasRemovedFromDocument):
1596         * dom/Document.h:
1597         Add a mechanism where Document will vend an ObjectIdentifier for a given
1598         element, and can (if possible) retrieve that element later.
1599
1600         * dom/Element.cpp:
1601         (WebCore::Element::removedFromAncestor):
1602         If an Element has an identifier created for it, inform Document to remove
1603         it from the identifier map when the element is detached.
1604
1605         (WebCore::Element::createElementIdentifier):
1606         * dom/Element.h:
1607         * dom/ElementIdentifier.h: Added.
1608         * dom/ElementRareData.cpp:
1609         * dom/ElementRareData.h:
1610         (WebCore::ElementRareData::hasElementIdentifier const):
1611         (WebCore::ElementRareData::setHasElementIdentifier):
1612         (WebCore::ElementRareData::ElementRareData):
1613         Store a bit indicating if the Element has had a identifier created for it,
1614         so that we can avoid a hash lookup on every Element removal.
1615
1616         * dom/Node.h:
1617         * html/HTMLTextFormControlElement.h:
1618
1619 2019-03-10  Zalan Bujtas  <zalan@apple.com>
1620
1621         [ContentChangeObserver] Fix failing test cases
1622         https://bugs.webkit.org/show_bug.cgi?id=195524
1623         <rdar://problem/48745101>
1624
1625         Reviewed by Simon Fraser.
1626
1627         1. Do not start DOM timer install observation when we already detected change at touchstart.
1628         2. hasPendingActivity() should only care about ContentChangeObserver flags.
1629         3. Do not try to notify the client when we are in the mouseMoved dispatch call (currently it could happen
1630         when a timer gets intalled and removed right away).
1631
1632         * page/ios/ContentChangeObserver.cpp:
1633         (WebCore::ContentChangeObserver::adjustObservedState):
1634         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
1635         * page/ios/ContentChangeObserver.h:
1636         (WebCore::ContentChangeObserver::hasPendingActivity const):
1637         (WebCore::ContentChangeObserver::isObservationTimeWindowActive const):
1638
1639 2019-03-10  Simon Fraser  <simon.fraser@apple.com>
1640
1641         ScrollingTree should have the final say on where layers go
1642         https://bugs.webkit.org/show_bug.cgi?id=195507
1643
1644         Reviewed by Antti Koivisto.
1645
1646         Main thread layer flushing can race with scrolling tree layer changes on macOS, causing
1647         flashing as layers jump around sometimes. We go to some lengths to avoid this by trying
1648         not to touch properties on layers that are being interacted with (scrollableArea->setIsUserScroll in
1649         updateScrollPositionAfterAsyncScroll()), but that's fragile.
1650
1651         This patch adds ScrollingTree::applyScrollingTreeLayerPositions(), which enters
1652         ScrollingTree::applyLayerPositions() on the main thread/UI process. This traverses
1653         the tree allowing each node to run their layer positioning logic.
1654
1655         For macOS WK2, this is called from TiledCoreAnimationDrawingArea::flushLayers() after flushCompositingStateIncludingSubframes().
1656         For macOS WK2 with UI-side compositing, RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
1657         calls m_webPageProxy.scrollingCoordinatorProxy()->applyScrollingTreeLayerPositions().
1658         iOS WK2 is unchanged, using viewportChangedViaDelegatedScrolling() which does the same thing, allowing
1659         for the dynamic viewport changes that happen when zooming on iOS.
1660
1661         Testing this requires infrastructure that we don't have yet.
1662
1663         * page/scrolling/AsyncScrollingCoordinator.cpp:
1664         (WebCore::AsyncScrollingCoordinator::applyScrollingTreeLayerPositions):
1665         * page/scrolling/AsyncScrollingCoordinator.h:
1666         * page/scrolling/ScrollingCoordinator.h:
1667         (WebCore::ScrollingCoordinator::applyScrollingTreeLayerPositions):
1668         * page/scrolling/ScrollingTree.cpp:
1669         (WebCore::ScrollingTree::handleWheelEvent):
1670         (WebCore::ScrollingTree::commitTreeState):
1671         (WebCore::ScrollingTree::applyLayerPositions):
1672         (WebCore::ScrollingTree::applyLayerPositionsRecursive):
1673         * page/scrolling/ScrollingTree.h:
1674         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1675         (WebCore::ScrollingTreeFrameHostingNode::applyLayerPositions):
1676         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1677         * page/scrolling/ScrollingTreeNode.h:
1678         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1679         (WebCore::ScrollingTreeScrollingNode::applyLayerPositions):
1680         * page/scrolling/ScrollingTreeScrollingNode.h:
1681         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1682         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1683         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
1684         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1685         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1686         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
1687         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
1688         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1689         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1690         (WebCore::ScrollingTreeFrameScrollingNodeMac::applyLayerPositions):
1691
1692 2019-03-09  Andy Estes  <aestes@apple.com>
1693
1694         [Apple Pay] CanMakePaymentsWithActiveCard and OpenPaymentSetup should be async messages
1695         https://bugs.webkit.org/show_bug.cgi?id=195526
1696         <rdar://problem/48745636>
1697
1698         Reviewed by Chris Dumez.
1699
1700         * Modules/applepay/PaymentCoordinatorClient.h:
1701         * loader/EmptyClients.cpp:
1702         * testing/MockPaymentCoordinator.cpp:
1703         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
1704         (WebCore::MockPaymentCoordinator::openPaymentSetup):
1705         * testing/MockPaymentCoordinator.h:
1706
1707 2019-03-09  Zalan Bujtas  <zalan@apple.com>
1708
1709         [ContentChangeObserver] Click event fires immediately on hover menu at seriouseats.com
1710         https://bugs.webkit.org/show_bug.cgi?id=195520
1711         <rdar://problem/48740098>
1712
1713         Reviewed by Simon Fraser.
1714
1715         Unfortunately seriouseats has a 300ms hover intent delay to deal with accidental menupane pop-ups. This page also hides this
1716         non-fixed width menupane using absolute positioning and negative left.  
1717
1718         Test: fast/events/touch/ios/content-observation/move-content-from-offscreen.html
1719
1720         * page/ios/ContentChangeObserver.cpp:
1721         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1722         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
1723         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Content auhtors tend to use x - 1 values (where x = 10^y)
1724
1725 2019-03-09  Chris Dumez  <cdumez@apple.com>
1726
1727         Add assertions to help debug crash under DOMWindowExtension::suspendForPageCache()
1728         https://bugs.webkit.org/show_bug.cgi?id=195488
1729
1730         Reviewed by Ryosuke Niwa.
1731
1732         Try and figure out how the document can be detached from its frame while we're suspending
1733         DOMWindowExtensions.
1734
1735         * page/DOMWindow.cpp:
1736         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1737         (WebCore::DOMWindow::suspendForPageCache):
1738         * page/DOMWindow.h:
1739
1740 2019-03-09  Chris Dumez  <cdumez@apple.com>
1741
1742         Simplify DOMWindowProperty code / handling
1743         https://bugs.webkit.org/show_bug.cgi?id=195495
1744
1745         Reviewed by Ryosuke Niwa.
1746
1747         DOMWindowProperty code was unnecessarily complex because DOMWindowExtension inherited
1748         from it and DOMWindowExtension needs a lot of information about the global object's
1749         lifetime to communicate to the injected bbundle client. This subclassing is also
1750         very confusing because a DOMWindowExtension is not a *property* on the Window object.
1751
1752         This patch updates DOMWindowExtension to stop subclassing DOMWindowProperty and
1753         moves all the complexity from DOMWindowProperty to DOMWindowExtension.
1754         DOMWindowProperty is now a very simple base class which merely has a WeakPtr to
1755         the window and getters for the window and the frame.
1756
1757         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1758         (WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
1759         (WebCore::DOMWindowIndexedDatabase::indexedDB):
1760         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
1761         There is no reason for DOMWindowIndexedDatabase to move its IDBFactory to a
1762         separate data member which in PageCache. Script do not run while in PageCache.
1763         Also, frames are nulled out while in the PageCache so the indexedDB() getter
1764         would return null anyway while in PageCache.
1765
1766         * css/StyleMedia.idl:
1767         * loader/appcache/ApplicationCacheHost.cpp:
1768         (WebCore::ApplicationCacheHost::setDOMApplicationCache):
1769         Store a WeakPtr to the DOMApplicationCache for safety.
1770
1771         (WebCore::ApplicationCacheHost::dispatchDOMEvent):
1772         Do not fire events on the DOMApplicationCache if it is frameless to maintain
1773         previous behavior. Previously, the DOMApplicationCache would have been nulled
1774         out when detached from its frame so we would not have fired events.
1775
1776         * loader/appcache/ApplicationCacheHost.h:
1777         * loader/appcache/DOMApplicationCache.cpp:
1778         * loader/appcache/DOMApplicationCache.h:
1779         Remove some unnecessary complexity. The ApplicationCacheHost is owned by the
1780         DocumentLoader, which changes on navigation. There is therefore no reason to
1781         null out the DOMApplicationCache on the ApplicationCacheHost when its gets
1782         detached from its frame or enters PageCache.
1783
1784         * page/BarProp.idl:
1785         * page/DOMSelection.idl:
1786         * page/DOMWindow.cpp:
1787         (WebCore::DOMWindow::willDestroyCachedFrame):
1788         (WebCore::DOMWindow::willDestroyDocumentInFrame):
1789         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1790         (WebCore::DOMWindow::registerExtension):
1791         (WebCore::DOMWindow::unregisterExtension):
1792
1793         (WebCore::DOMWindow::resetDOMWindowProperties): Removed.
1794         Stop clearing some of the DOMWindow's properties when the document gets destroyed or when
1795         the Window for the initial empty document gets reused on navigation. I think we used to
1796         need this because DOMWindowProperty used to hold pointers to their frame. However, this
1797         is no longer the case nowadays as DOMWindowProperty objects get their frame from their
1798         Window.
1799
1800         (WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
1801         (WebCore::DOMWindow::suspendForPageCache):
1802         (WebCore::DOMWindow::resumeFromPageCache):
1803         * page/DOMWindow.h:
1804         * page/DOMWindowExtension.cpp:
1805         (WebCore::DOMWindowExtension::DOMWindowExtension):
1806         (WebCore::DOMWindowExtension::~DOMWindowExtension):
1807         (WebCore::DOMWindowExtension::frame const):
1808         (WebCore::DOMWindowExtension::suspendForPageCache):
1809         (WebCore::DOMWindowExtension::resumeFromPageCache):
1810         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
1811         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInFrame):
1812         (WebCore::DOMWindowExtension::willDetachGlobalObjectFromFrame):
1813         * page/DOMWindowExtension.h:
1814         * page/DOMWindowProperty.cpp:
1815         (WebCore::DOMWindowProperty::DOMWindowProperty):
1816         * page/DOMWindowProperty.h:
1817         (WebCore::DOMWindowProperty::window const):
1818         * page/History.idl:
1819         * page/Location.idl:
1820         * page/Navigator.cpp:
1821         (WebCore::Navigator::plugins):
1822         (WebCore::Navigator::mimeTypes):
1823         * page/PerformanceNavigation.idl:
1824         * page/PerformanceTiming.idl:
1825         * page/Screen.idl:
1826         * page/VisualViewport.cpp:
1827         (WebCore::VisualViewport::scriptExecutionContext const):
1828         * plugins/DOMMimeTypeArray.idl:
1829         * plugins/DOMPluginArray.idl:
1830
1831 2019-03-09  Zalan Bujtas  <zalan@apple.com>
1832
1833         [ContentChangeObserver] Start observing for content change between touchEnd and mouseMoved start
1834         https://bugs.webkit.org/show_bug.cgi?id=195510
1835         <rdar://problem/48735695>
1836
1837         Reviewed by Simon Fraser.
1838
1839         This patch covers the observation of async changes triggered by touchStart/touchEnd (animations, timers, style recalcs).
1840
1841         Test: fast/events/touch/ios/content-observation/visibility-change-after-touch-end.html
1842
1843         * page/ios/ContentChangeObserver.cpp:
1844         (WebCore::ContentChangeObserver::didCancelTouchEvent):
1845         (WebCore::ContentChangeObserver::adjustObservedState):
1846         * page/ios/ContentChangeObserver.h:
1847         (WebCore::ContentChangeObserver::setIsInBetweenTouchEndAndMouseMoved):
1848         (WebCore::ContentChangeObserver::isInBetweenTouchEndAndMouseMoved const):
1849         (WebCore::ContentChangeObserver::isObservingContentChanges const):
1850
1851 2019-03-08  Simon Fraser  <simon.fraser@apple.com>
1852
1853         Make it clearer which data is protected by the two locks in ScrollingTree
1854         https://bugs.webkit.org/show_bug.cgi?id=195501
1855
1856         Reviewed by Tim Horton.
1857
1858         Gather ScrollingTree member variables into two structs, and name the struct
1859         members and the locks to make it clear which data is protected by each lock.
1860         
1861         We only need to protect data read by multiple threads; these are the scrolling
1862         thread, the event handling thread (which runs ThreadedScrollingTree::tryToHandleWheelEvent()),
1863         and the main thread, which pokes various bits of pin/rubber-banding state.
1864         Ideally the main thread would always push data to the scrolling thread via a commit,
1865         but that's not what happens now.
1866
1867         Suspiciously, ScrollingTree::shouldHandleWheelEventSynchronously() uses the root node,
1868         so should probably hold a lock shared with the scrolling thread (webkit.org/b/195502).
1869         
1870         * page/scrolling/ScrollingTree.cpp:
1871         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
1872         (WebCore::ScrollingTree::commitTreeState):
1873         (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
1874         (WebCore::ScrollingTree::setMainFrameScrollPosition):
1875         (WebCore::ScrollingTree::eventTrackingTypeForPoint):
1876         (WebCore::ScrollingTree::isRubberBandInProgress):
1877         (WebCore::ScrollingTree::setMainFrameIsRubberBanding):
1878         (WebCore::ScrollingTree::isScrollSnapInProgress):
1879         (WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
1880         (WebCore::ScrollingTree::setMainFramePinState):
1881         (WebCore::ScrollingTree::setCanRubberBandState):
1882         (WebCore::ScrollingTree::setScrollPinningBehavior):
1883         (WebCore::ScrollingTree::scrollPinningBehavior):
1884         (WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
1885         (WebCore::ScrollingTree::latchedNode):
1886         (WebCore::ScrollingTree::setLatchedNode):
1887         (WebCore::ScrollingTree::clearLatchedNode):
1888         (WebCore::ScrollingTree::scrollingTreeAsText):
1889         (WebCore::ScrollingTree::touchActionDataAtPoint const):
1890         (WebCore::ScrollingTree::mainFrameScrollPosition): Deleted.
1891         (WebCore::ScrollingTree::mainFrameLayoutViewport): Deleted.
1892         (WebCore::ScrollingTree::rubberBandsAtLeft): Deleted.
1893         (WebCore::ScrollingTree::rubberBandsAtRight): Deleted.
1894         (WebCore::ScrollingTree::rubberBandsAtBottom): Deleted.
1895         (WebCore::ScrollingTree::rubberBandsAtTop): Deleted.
1896         * page/scrolling/ScrollingTree.h:
1897         (WebCore::ScrollingTree::hasLatchedNode const):
1898         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1899         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
1900         * platform/graphics/FloatPoint.h:
1901         (WebCore::FloatPoint::isZero const):
1902
1903 2019-03-08  Simon Fraser  <simon.fraser@apple.com>
1904
1905         Share some code that sets CALayer positions
1906         https://bugs.webkit.org/show_bug.cgi?id=195485
1907
1908         Reviewed by Zalan Bujtas.
1909
1910         Share some code between ScrollingTreeStickyNode and ScrollingTreeFixedNode that sets the position
1911         of a CALayer given the top-left location.
1912
1913         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1914         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
1915         (WebCore::ScrollingTreeFixedNodeInternal::operator*): Deleted.
1916         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1917         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
1918         (WebCore::ScrollingTreeStickyNodeInternal::operator*): Deleted.
1919         * platform/graphics/cocoa/WebCoreCALayerExtras.h:
1920         * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
1921         (-[CALayer _web_setLayerTopLeftPosition:]):
1922
1923 2019-03-08  Chris Dumez  <cdumez@apple.com>
1924
1925         Add support for Device Orientation / Motion permission API
1926         https://bugs.webkit.org/show_bug.cgi?id=195329
1927         <rdar://problem/47645367>
1928
1929         Reviewed by Geoffrey Garen.
1930
1931         Add support for Device Orientation / Motion permission API:
1932         - https://github.com/w3c/deviceorientation/issues/57
1933
1934         Pages can add event listeners for 'deviceorientation' / 'devicemotion' events but
1935         such events will not be fired until the page's JavaScript calls
1936         DeviceOrientationEvent.requestPermission() / DeviceMotionEvent.requestPermission()
1937         and the user grants the request.
1938
1939         The feature is currently behind an experimental feature flag, off by default.
1940
1941         Tests: fast/device-orientation/device-motion-request-permission-denied.html
1942                fast/device-orientation/device-motion-request-permission-granted.html
1943                fast/device-orientation/device-motion-request-permission-user-gesture.html
1944                fast/device-orientation/device-orientation-request-permission-denied.html
1945                fast/device-orientation/device-orientation-request-permission-granted.html
1946                fast/device-orientation/device-orientation-request-permission-user-gesture.html
1947
1948         * CMakeLists.txt:
1949         * DerivedSources-input.xcfilelist:
1950         * DerivedSources-output.xcfilelist:
1951         * DerivedSources.make:
1952         * Sources.txt:
1953         * WebCore.xcodeproj/project.pbxproj:
1954         * dom/DeviceMotionEvent.h:
1955         * dom/DeviceMotionEvent.idl:
1956         * dom/DeviceOrientationAndMotionAccessController.cpp: Added.
1957         (WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
1958         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
1959         (WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
1960         * dom/DeviceOrientationAndMotionAccessController.h: Added.
1961         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
1962         * dom/DeviceOrientationEvent.h:
1963         * dom/DeviceOrientationEvent.idl:
1964         * dom/DeviceOrientationOrMotionEvent.cpp: Added.
1965         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
1966         * dom/DeviceOrientationOrMotionEvent.h: Added.
1967         * dom/DeviceOrientationOrMotionEvent.idl: Added.
1968         * dom/DeviceOrientationOrMotionPermissionState.h: Added.
1969         * dom/DeviceOrientationOrMotionPermissionState.idl: Added.
1970         * dom/Document.cpp:
1971         (WebCore::Document::deviceOrientationAndMotionAccessController):
1972         * dom/Document.h:
1973         * dom/Event.cpp:
1974         * dom/MessagePort.cpp:
1975         * dom/Microtasks.cpp:
1976         * page/ChromeClient.h:
1977         * page/DOMWindow.cpp:
1978         (WebCore::DOMWindow::addEventListener):
1979         (WebCore::DOMWindow::deviceOrientationController const):
1980         (WebCore::DOMWindow::deviceMotionController const):
1981         (WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
1982         (WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):
1983         (WebCore::DOMWindow::startListeningForDeviceOrientationIfNecessary):
1984         (WebCore::DOMWindow::stopListeningForDeviceOrientationIfNecessary):
1985         (WebCore::DOMWindow::startListeningForDeviceMotionIfNecessary):
1986         (WebCore::DOMWindow::stopListeningForDeviceMotionIfNecessary):
1987         (WebCore::DOMWindow::removeEventListener):
1988         (WebCore::DOMWindow::removeAllEventListeners):
1989         * page/DOMWindow.h:
1990         * page/DeviceController.cpp:
1991         (WebCore::DeviceController::hasDeviceEventListener const):
1992         * page/DeviceController.h:
1993         * page/Settings.yaml:
1994
1995 2019-03-08  Zalan Bujtas  <zalan@apple.com>
1996
1997         [ContentChangeObserver] Expand "isConsideredClickable" to descendants
1998         https://bugs.webkit.org/show_bug.cgi?id=195478
1999         <rdar://problem/48724935>
2000
2001         Reviewed by Simon Fraser.
2002
2003         In StyleChangeScope we try to figure out whether newly visible content should stick (menu panes etc) by checking if it is clickable.
2004         This works fine as long as all the visible elements are gaining new renderers through this style update processs.
2005         However when an element becomes visible by a change other than display: (not)none, it's not sufficient to just check the element itself,
2006         since it might not respond to click at all, while its descendants do.
2007         A concrete example is a max-height value change on usps.com, where the max-height is on a container (menu pane).
2008         This container itself is not clickable while most of its children are (menu items).    
2009
2010         Test: fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container.html
2011
2012         * page/ios/ContentChangeObserver.cpp:
2013         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
2014         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
2015         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const):
2016         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
2017         (WebCore::isConsideredHidden): Deleted.
2018         * page/ios/ContentChangeObserver.h:
2019
2020 2019-03-08  Zalan Bujtas  <zalan@apple.com>
2021
2022         [ContentChangeObserver] Cleanup adjustObservedState
2023         https://bugs.webkit.org/show_bug.cgi?id=195470
2024         <rdar://problem/48717823>
2025
2026         Reviewed by Simon Fraser.
2027
2028         This is in preparation for introducing an observation window from touchStart -> mouseMoved.
2029         1. Cancel pending activities (future timers, pending stylesheet recalcs) when visible content change is detected.
2030         2. The fixed time window takes care of notifying the client -timers, style recalcs during the window should not signal themselves.  
2031         3. Reset m_isObservingPendingStyleRecalc at StartedStyleRecalc instead of EndedStyleRecalc. 
2032
2033         * page/ios/ContentChangeObserver.cpp:
2034         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
2035         (WebCore::ContentChangeObserver::styleRecalcDidStart):
2036         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
2037         (WebCore::ContentChangeObserver::adjustObservedState):
2038         * page/ios/ContentChangeObserver.h:
2039         (WebCore::ContentChangeObserver::hasPendingActivity const):
2040         (WebCore::ContentChangeObserver::isObservationTimeWindowActive const):
2041
2042 2019-03-08  Zalan Bujtas  <zalan@apple.com>
2043
2044         [ContentChangeObserver] Add StartedDOMTimerExecution and StartedStyleRecalc
2045         https://bugs.webkit.org/show_bug.cgi?id=195463
2046         <rdar://problem/48714762>
2047
2048         Reviewed by Simon Fraser.
2049
2050         This is in preparation for introducing m_isObservingContentChanges flag to track observing state across events (touchStart -> mouseMoved).
2051
2052         * page/ios/ContentChangeObserver.cpp:
2053         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
2054         (WebCore::ContentChangeObserver::styleRecalcDidStart):
2055         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
2056         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
2057         (WebCore::ContentChangeObserver::adjustObservedState):
2058         * page/ios/ContentChangeObserver.h:
2059         (WebCore::ContentChangeObserver::isObservingPendingStyleRecalc const):
2060         (WebCore::ContentChangeObserver::isObservingStyleRecalc const): Deleted.
2061
2062 2019-03-08  Chris Fleizach  <cfleizach@apple.com>
2063
2064         AX: AOM accessibleclick does not work on iOS
2065         https://bugs.webkit.org/show_bug.cgi?id=195423
2066         <rdar://problem/48682110>
2067
2068         Reviewed by Joanmarie Diggs.
2069
2070         Return this value of this method so it can be surfaced to a higher level.
2071
2072         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2073         (-[WebAccessibilityObjectWrapper _accessibilityActivate]):
2074
2075 2019-03-08  Chris Dumez  <cdumez@apple.com>
2076
2077         imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_error.html is a flaky crash
2078         https://bugs.webkit.org/show_bug.cgi?id=195441
2079         <rdar://problem/43437394>
2080
2081         Reviewed by Alexey Proskuryakov.
2082
2083         FileReader is an ActiveDOMObject, which means that FileReader::stop() gets called when
2084         its script execution context is about to get destroyed. FileReader::stop() sets m_state
2085         to DONE. FileReader::abort() would schedule an asynchronous task and then ASSERT that
2086         m_state is not DONE, which would hit if FileReader::stop() had been called in between
2087         the task being scheduled and its execution. To address the issue, have the task abort
2088         early if isContextStopped() returns true.
2089
2090         Also replace calls to setPendingActivity() / unsetPendingActivity() with a
2091         PendingActivity data member as mismatched call to those can lead to leaks.
2092
2093         * fileapi/FileReader.cpp:
2094         (WebCore::FileReader::canSuspendForDocumentSuspension const):
2095         No reason not to suspend if there is no pending read.
2096
2097         (WebCore::FileReader::stop):
2098         (WebCore::FileReader::readInternal):
2099         (WebCore::FileReader::abort):
2100         (WebCore::FileReader::didFinishLoading):
2101         (WebCore::FileReader::didFail):
2102         * fileapi/FileReader.h:
2103
2104 2019-03-08  Zan Dobersek  <zdobersek@igalia.com>
2105
2106         GLContextEGL: desired EGL config should search for 8-bit components by default
2107         https://bugs.webkit.org/show_bug.cgi?id=195413
2108
2109         Reviewed by Carlos Garcia Campos.
2110
2111         The EGL config search in GLContextEGL should by default look for
2112         RGBA8888 configurations while allowing RGB565 as an alternative.
2113         This prevents from accidentally landing on an RGBA1010102
2114         configuration that is available with some graphics stacks, and which is
2115         not expected in e.g. window snapshotting that's done for layout test
2116         output comparison.
2117
2118         * platform/graphics/egl/GLContextEGL.cpp:
2119         (WebCore::GLContextEGL::getEGLConfig): EGL config search should by
2120         default request 8-bit color channels.
2121
2122 2019-03-08  Miguel Gomez  <magomez@igalia.com>
2123
2124         Use a thread safe refcounter for FilterOperation.
2125         https://bugs.webkit.org/show_bug.cgi?id=194149
2126
2127         Reviewed by Carlos Garcia Campos.
2128
2129         Use a thread safe refcounter for FilterOperation.
2130
2131         * platform/graphics/filters/FilterOperation.h:
2132
2133 2019-03-07  Yusuke Suzuki  <ysuzuki@apple.com>
2134
2135         [JSC] Make more fields lazy in JSGlobalObject
2136         https://bugs.webkit.org/show_bug.cgi?id=195449
2137
2138         Reviewed by Mark Lam.
2139
2140         Use arrayBufferConstructor() since getDirect does not work with lazy property.
2141
2142         * bindings/js/JSDOMGlobalObject.cpp:
2143         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2144
2145 2019-03-07  Zalan Bujtas  <zalan@apple.com>
2146
2147         [ContentChangeObserver][REGRESSION] Check if visibility change happens while dispatching mouseMoved
2148         https://bugs.webkit.org/show_bug.cgi?id=195421
2149         <rdar://problem/48682004>
2150
2151         Reviewed by Simon Fraser.
2152
2153         Visibility change might be triggered synchronously while dispatching mouseMoved event.
2154
2155         Test: fast/events/touch/ios/content-observation/visibility-change-happens-while-in-mousemoved.html
2156
2157         * page/ios/ContentChangeObserver.cpp:
2158         (WebCore::ContentChangeObserver::mouseMovedDidStart):
2159         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
2160         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
2161         * page/ios/ContentChangeObserver.h:
2162         (WebCore::ContentChangeObserver::isObservingContentChanges const):
2163
2164 2019-03-07  Zalan Bujtas  <zalan@apple.com>
2165
2166         [ContentChangeObserver] Check if max-height change triggers visible content change.
2167         https://bugs.webkit.org/show_bug.cgi?id=195417
2168         <rdar://problem/48680631>
2169
2170         Reviewed by Simon Fraser.
2171
2172         A fixed max-height non-zero value could indicate visible content change. usps.com uses this technique to show menu panes.  
2173
2174         Test: fast/events/touch/ios/content-observation/visibility-change-is-max-height-change.html
2175
2176         * page/ios/ContentChangeObserver.cpp:
2177         (WebCore::isConsideredHidden):
2178         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
2179         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
2180         (WebCore::elementImplicitVisibility): Deleted.
2181         * page/ios/ContentChangeObserver.h:
2182
2183 2019-03-07  Yusuke Suzuki  <ysuzuki@apple.com>
2184
2185         Unreviewed, fix failing EWS build for ios-sim
2186
2187         * page/ios/ContentChangeObserver.cpp:
2188         (WebCore::ContentChangeObserver::touchEventDidStart):
2189
2190 2019-03-07  Eric Carlson  <eric.carlson@apple.com>
2191
2192         [MSE] Adopt new AVSampleBufferDisplayLayer SPI
2193         https://bugs.webkit.org/show_bug.cgi?id=195445
2194         <rdar://problem/48480516>
2195
2196         Reviewed by Jer Noble.
2197
2198         No new tests, no functional change.
2199
2200         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2201         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): Only register for 
2202         kCMSampleBufferConsumerNotification_BufferConsumed notiication when
2203         -[AVSampleBufferDisplayLayer prerollDecodeWithCompletionHandler:] isn't available.
2204         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): Ditto, for unregistering.
2205         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Use 
2206         -[AVSampleBufferDisplayLayer prerollDecodeWithCompletionHandler:] when possible.
2207
2208 2019-03-07  Zalan Bujtas  <zalan@apple.com>
2209
2210         [ContentChangeObserver] Click event fires immediately on hover menu at Ebbets.com
2211         https://bugs.webkit.org/show_bug.cgi?id=195397
2212
2213         Reviewed by Simon Fraser.
2214
2215         This patch introduces TouchEventScope to track changes triggered by touch start.
2216
2217         Test: fast/events/touch/ios/content-observation/visibility-change-on-touch-start-simple.html
2218
2219         * page/ios/ContentChangeObserver.cpp:
2220         (WebCore::ContentChangeObserver::touchEventDidStart):
2221         (WebCore::ContentChangeObserver::touchEventDidFinish):
2222         (WebCore::ContentChangeObserver::mouseMovedDidStart):
2223         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
2224         (WebCore::ContentChangeObserver::adjustObservedState):
2225         (WebCore::ContentChangeObserver::TouchEventScope::TouchEventScope):
2226         (WebCore::ContentChangeObserver::TouchEventScope::~TouchEventScope):
2227         * page/ios/ContentChangeObserver.h:
2228         (WebCore::ContentChangeObserver::isObservingContentChanges const):
2229
2230 2019-03-07  Zalan Bujtas  <zalan@apple.com>
2231
2232         [ContentChangeObserver] Introduce fixed duration content observation
2233         https://bugs.webkit.org/show_bug.cgi?id=195295
2234         <rdar://problem/48579913>
2235
2236         Reviewed by Simon Fraser.
2237
2238         Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
2239         This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
2240         we stop observing for content changes before they even get fired.
2241
2242         Test: fast/events/touch/ios/content-observation/visibility-change-happens-on-timer-hops.html
2243
2244         * page/ios/ContentChangeObserver.cpp:
2245         (WebCore::ContentChangeObserver::ContentChangeObserver):
2246         (WebCore::ContentChangeObserver::startContentObservationForDuration):
2247         (WebCore::ContentChangeObserver::completeDurationBasedContentObservation):
2248         (WebCore::ContentChangeObserver::didInstallDOMTimer):
2249         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
2250         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
2251         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
2252         (WebCore::ContentChangeObserver::styleRecalcDidStart):
2253         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
2254         (WebCore::ContentChangeObserver::cancelPendingActivities):
2255         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects):
2256         (WebCore::ContentChangeObserver::willDetachPage):
2257         (WebCore::ContentChangeObserver::contentVisibilityDidChange):
2258         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
2259         (WebCore::ContentChangeObserver::adjustObservedState):
2260         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
2261         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
2262         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange): Deleted.
2263         * page/ios/ContentChangeObserver.h:
2264         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
2265         (WebCore::ContentChangeObserver::isObservingContentChanges const):
2266         (WebCore::ContentChangeObserver::hasPendingActivity const):
2267
2268 2019-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
2269
2270         requestAnimationFrame should execute before the next frame
2271         https://bugs.webkit.org/show_bug.cgi?id=177484
2272
2273         Reviewed by Simon Fraser.
2274
2275         This change fixes two issues with animation timing:
2276
2277         1. Calling the requestAnimationFrame callbacks would have happened when
2278            the DisplayLink fires. This may have happened even if the frame is
2279            missed and no display is committed.
2280
2281         2. Style changes and layout triggered by script could trigger painting
2282            at more than 60fps. CoreAnimation commits could happen at more than
2283            60fps, although WindowServer will throttle those, and only some will
2284            be shown on the screen.
2285
2286         This change introduces a new paint scheduling model where painting is
2287         driven by a "RenderingUpdateScheduler", which only triggers paints once
2288         per 16.7ms frame.
2289
2290         Code that previously scheduled a compositing layer flush now schedules a
2291         "RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
2292         callback. When the render happens, we service requestAnimationFrame callbacks,
2293         Web Animations and intersection observations per the "Update the rendering"
2294         step of the HTML Event Loop specification
2295         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
2296
2297         In the future, more rendering steps will be added to this code.
2298
2299         * Sources.txt:
2300         * WebCore.xcodeproj/project.pbxproj:
2301         * accessibility/mac/AXObjectCacheMac.mm:
2302         Fix layout tests by adding null check.
2303
2304         * animation/DocumentAnimationScheduler.cpp: Removed.
2305         * animation/DocumentAnimationScheduler.h: Removed.
2306         * animation/DocumentTimeline.cpp:
2307         (WebCore::DocumentTimeline::DocumentTimeline):
2308         (WebCore::DocumentTimeline::updateThrottlingState):
2309         (WebCore::DocumentTimeline::resumeAnimations):
2310         (WebCore::DocumentTimeline::liveCurrentTime const):
2311         (WebCore::DocumentTimeline::currentTime):
2312         (WebCore::DocumentTimeline::animationTimingDidChange):
2313         (WebCore::DocumentTimeline::scheduleAnimationResolution):
2314         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
2315         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
2316         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
2317         (WebCore::DocumentTimeline::scheduleNextTick):
2318         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
2319         Simplify this function by handling the case of no-animations separately.
2320
2321         (WebCore::DocumentTimeline::resolveAnimationsForElement):
2322         Simplify the loop and delete hasPendingAcceleratedAnimations because it
2323         is initialized to true and is not changed inside the loop.
2324
2325         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
2326         (WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
2327         * animation/DocumentTimeline.h:
2328         * dom/Document.cpp:
2329         (WebCore::Document::resolveStyle):
2330         There is no need to force update in resolveStyle(). notifyFlushRequired()
2331         will be called eventually which will scheduleRenderingUpdate().
2332
2333         (WebCore::Document::prepareForDestruction):
2334         (WebCore::Document::updateAnimationsAndSendEvents):
2335         (WebCore::Document::serviceRequestAnimationFrameCallbacks):
2336         (WebCore::Document::windowScreenDidChange):
2337         (WebCore::Document::updateIntersectionObservations):
2338         (WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
2339         (WebCore::Document::animationScheduler): Deleted.
2340         * dom/Document.h:
2341         (WebCore::Document::numberOfIntersectionObservers const):
2342         * dom/ScriptedAnimationController.cpp:
2343         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
2344         (WebCore::ScriptedAnimationController::scheduleAnimation):
2345         (WebCore::ScriptedAnimationController::animationTimerFired):
2346         (WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
2347         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
2348         * dom/ScriptedAnimationController.h:
2349         * page/FrameView.cpp:
2350         (WebCore::FrameView::viewportContentsChanged):
2351         * page/IntersectionObserver.cpp:
2352         (WebCore::IntersectionObserver::observe):
2353         * page/Page.cpp:
2354         (WebCore::Page::Page):
2355         (WebCore::Page::layoutIfNeeded):
2356         (WebCore::Page::renderingUpdate):
2357         (WebCore::Page::renderingUpdateScheduler):
2358         (WebCore::Page::willDisplayPage): Deleted.
2359         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
2360         (WebCore::Page::updateIntersectionObservations): Deleted.
2361         (WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
2362         * page/Page.h:
2363         * page/PageOverlayController.cpp:
2364         (WebCore::PageOverlayController::didChangeViewExposedRect):
2365         (WebCore::PageOverlayController::notifyFlushRequired):
2366         * page/ResourceUsageData.h:
2367         Include header files that become missing because of adding 
2368         RenderingUpdateScheduler.cpp.
2369
2370         * page/RenderingUpdateScheduler.cpp: Added.
2371         (WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
2372         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
2373         (WebCore::RenderingUpdateScheduler::startTimer):
2374         (WebCore::RenderingUpdateScheduler::clearTimer):
2375         (WebCore::RenderingUpdateScheduler::windowScreenDidChange):
2376         (WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
2377         (WebCore::RenderingUpdateScheduler::displayRefreshFired):
2378         * page/RenderingUpdateScheduler.h: Added.
2379         (WebCore::RenderingUpdateScheduler::create):
2380         * page/ios/ContentChangeObserver.h:
2381         Include header files that become missing because of adding 
2382         RenderingUpdateScheduler.cpp.
2383
2384         * page/mac/ServicesOverlayController.mm:
2385         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
2386         * rendering/RenderLayerCompositor.cpp:
2387         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
2388
2389 2019-03-07  Zalan Bujtas  <zalan@apple.com>
2390
2391         [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
2392         https://bugs.webkit.org/show_bug.cgi?id=195353
2393         <rdar://problem/48626394>
2394
2395         Reviewed by Simon Fraser.
2396
2397         Move content observation tests to a dedicated directory.
2398
2399         Tests: fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html
2400                fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html
2401                fast/events/touch/ios/content-observation/stuck-with-hover-state.html
2402                fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html
2403                fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html
2404
2405         * page/Settings.yaml:
2406         * page/ios/ContentChangeObserver.cpp:
2407         (WebCore::ContentChangeObserver::didInstallDOMTimer):
2408         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
2409         * page/ios/ContentChangeObserver.h:
2410         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
2411         * testing/InternalSettings.cpp:
2412         (WebCore::InternalSettings::resetToConsistentState):
2413
2414 2019-03-07  John Wilander  <wilander@apple.com>
2415
2416         Make sure an empty host matches the internal representation "nullOrigin" in WebCore::RegistrableDomain::matches()
2417         https://bugs.webkit.org/show_bug.cgi?id=195435
2418
2419         Reviewed by Brent Fulgham.
2420
2421         No new tests. Tests are currently failing and will pass again with
2422         this patch.
2423
2424         WebCore::RegistrableDomain::matches() is a quick way to compare a
2425         RegistrableDomain with a URL. Since RegistrableDomain represents the
2426         empty host as "nullOrigin," a URL with an empty host needs to match
2427         that representation in WebCore::RegistrableDomain::matches().
2428         Failure to do so caused debug assertions in fast/ layout tests after
2429         https://trac.webkit.org/changeset/242603/webkit.
2430
2431         * platform/RegistrableDomain.h:
2432         (WebCore::RegistrableDomain::matches const):
2433
2434 2019-03-07  Justin Fan  <justin_fan@apple.com>
2435
2436         Unreviewed build fixes since MTLClampToBorderColor is only supported on macOS.
2437
2438         * Modules/webgpu/GPUSamplerDescriptor.idl:
2439         * platform/graphics/gpu/GPUSamplerDescriptor.h:
2440         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Forgot include.
2441         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
2442         (WebCore::mtlAddressModeForAddressMode):
2443         (WebCore::tryCreateMtlSamplerState):
2444         (WebCore::mtlBorderColorForBorderColor): Deleted.
2445
2446 2019-03-07  Justin Fan  <justin_fan@apple.com>
2447
2448         [Web GPU] GPUSampler implementation
2449         https://bugs.webkit.org/show_bug.cgi?id=195427
2450         <rdar://problem/48686011>
2451
2452         Reviewed by Dean Jackson.
2453
2454         Implement ability to create GPUSamplers and use them as pipeline resource bindings.
2455
2456         Test: texture-triangle-strip.html updated.
2457
2458         Add symbols to project:
2459         * CMakeLists.txt:
2460         * DerivedSources-input.xcfilelist:
2461         * DerivedSources-output.xcfilelist:
2462         * DerivedSources.make:
2463         * Sources.txt:
2464         * SourcesCocoa.txt:
2465         * WebCore.xcodeproj/project.pbxproj:
2466         * bindings/js/WebCoreBuiltinNames.h:
2467
2468         GPUSampler creation:
2469         * Modules/webgpu/GPUSamplerDescriptor.idl: Added.
2470         * Modules/webgpu/WebGPUDevice.cpp:
2471         (WebCore::WebGPUDevice::createSampler const): Added.
2472         * Modules/webgpu/WebGPUDevice.h:
2473         * Modules/webgpu/WebGPUDevice.idl:
2474         * Modules/webgpu/WebGPUSampler.cpp: Added.
2475         (WebCore::WebGPUSampler::create):
2476         (WebCore::WebGPUSampler::WebGPUSampler):
2477         * Modules/webgpu/WebGPUSampler.h: Added.
2478         (WebCore::WebGPUSampler::sampler const):
2479         * Modules/webgpu/WebGPUSampler.idl: Added.
2480         * platform/graphics/gpu/GPUDevice.cpp:
2481         (WebCore::GPUDevice::tryCreateSampler const): Added.
2482         * platform/graphics/gpu/GPUDevice.h:
2483         * platform/graphics/gpu/GPUSampler.h: Added.
2484         (WebCore::GPUSampler::platformSampler const):
2485         * platform/graphics/gpu/GPUSamplerDescriptor.h: Added.
2486         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm: Added.
2487         (WebCore::mtlAddressModeForAddressMode):
2488         (WebCore::mtlBorderColorForBorderColor):
2489         (WebCore::mtlMinMagFilterForFilterMode):
2490         (WebCore::mtlMipFilterForFilterMode):
2491         (WebCore::tryCreateMtlSamplerState):
2492         (WebCore::GPUSampler::tryCreate):
2493         (WebCore::GPUSampler::GPUSampler):
2494
2495         Move GPUCompareFunction to Utils for shared use.
2496         * platform/graphics/gpu/GPUCompareFunction.h:
2497         * platform/graphics/gpu/GPUUtils.h:
2498         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2499         (WebCore::tryCreateMtlDepthStencilState):
2500         (WebCore::validateAndConvertDepthCompareFunctionToMtl): Deleted.
2501         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
2502         (WebCore::platformTextureFormatForGPUTextureFormat):
2503         (WebCore::platformCompareFunctionForGPUCompareFunction):
2504
2505         Expand bind groups to accept GPUSamplers:
2506         * Modules/webgpu/WebGPUBindGroupBinding.h:
2507         * Modules/webgpu/WebGPUBindGroupBinding.idl:
2508         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
2509         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const):
2510         * platform/graphics/gpu/GPUBindGroupBinding.h:
2511         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2512         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2513         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
2514         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
2515         (WebCore::GPUProgrammablePassEncoder::setResourceAsSamplerOnEncoder): Added.
2516         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder):
2517
2518         Misc:
2519         * Modules/webgpu/WebGPUTexture.cpp: Missing includes.
2520         * Modules/webgpu/WebGPUTexture.h:
2521         * Modules/webgpu/WebGPUSwapChain.cpp: Removed extra include.
2522
2523 2019-03-07  Commit Queue  <commit-queue@webkit.org>
2524
2525         Unreviewed, rolling out r242297.
2526         https://bugs.webkit.org/show_bug.cgi?id=195430
2527
2528         Broke Microsoft Visio. (Requested by dydz on #webkit).
2529
2530         Reverted changeset:
2531
2532         "[iOS] Turn mouse event simulation on by default"
2533         https://bugs.webkit.org/show_bug.cgi?id=195218
2534         https://trac.webkit.org/changeset/242297
2535
2536 2019-03-07  Sihui Liu  <sihui_liu@apple.com>
2537
2538         Crash in com.apple.WebCore: WebCore::IDBTransaction::pendingOperationTimerFired + 72
2539         https://bugs.webkit.org/show_bug.cgi?id=195214
2540         <rdar://problem/48461116>
2541
2542         Reviewed by Geoffrey Garen.
2543
2544         When IDBTransaction is ready to commit, a commit operation would be schedule to 
2545         m_pendingTransactionOperationQueue. If connection to IDBServer is lost, pending operations are moved to 
2546         m_transactionOperationsInProgressQueue and will be completed with TransactionOperation::doComplete. doComplete 
2547         executes complete function of the operation, clears the complete function, and then removes the operation from 
2548         m_transactionOperationsInProgressQueue. In doComplete, we do early return when complete function is null, 
2549         since the doComplete could be invoked twice due to the race conditions between receiving "operation complete" 
2550         message from server and client-side abort.
2551
2552         However, commit operation does not have a complete function because it should be the last operation of 
2553         transaction and it gets removed from queue in its perform function. A commit operation would not be removed from 
2554         m_transactionOperationsInProgressQueue because of the early return. It would be removed from 
2555         m_transactionOperationMap, which may hold the last ref to the commit operation, in 
2556         IDBTransaction::connectionClosedFromServer. In this case, when pendingOperationTimerFired is called later, the 
2557         commit operation left in m_transactionOperationsInProgressQueue would be used and found to be freed. We should
2558         not use null check of complete function to decide whether an operation is completed.
2559
2560         * Modules/indexeddb/client/TransactionOperation.h:
2561         (WebCore::IDBClient::TransactionOperation::doComplete):
2562
2563 2019-03-07  John Wilander  <wilander@apple.com>
2564
2565         Resource Load Statistics: Log first-party navigations with link decoration
2566         https://bugs.webkit.org/show_bug.cgi?id=195301
2567         <rdar://problem/48569971>
2568
2569         Reviewed by Brent Fulgham.
2570
2571         Test: http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html
2572
2573         This patch adds two new members to WebCore::ResourceLoadStatistics:
2574         - topFrameLinkDecorationsFrom, a set of domains
2575         - gotLinkDecorationFromPrevalentResource, a boolean state
2576
2577         * loader/ResourceLoadStatistics.cpp:
2578         (WebCore::ResourceLoadStatistics::encode const):
2579         (WebCore::ResourceLoadStatistics::decode):
2580         (WebCore::ResourceLoadStatistics::toString const):
2581         (WebCore::ResourceLoadStatistics::merge):
2582         * loader/ResourceLoadStatistics.h:
2583
2584 2019-03-07  Simon Fraser  <simon.fraser@apple.com>
2585
2586         [iOS WK] REGRESSION (r242132): Fixed position banners flicker and move when scrolling (Apple, Tesla, YouTube, Reddit)
2587         https://bugs.webkit.org/show_bug.cgi?id=195396
2588         rdar://problem/48518959
2589
2590         Reviewed by Antti Koivisto.
2591         
2592         r242132 introduced two issues that contributed to jumpiness of position:fixed layers when scrolling.
2593         
2594         First, ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling() would early return if the scroll position
2595         hadn't changed. It also needs to check the supplied layoutViewport (if any), but in some cases running the
2596         notifyRelatedNodesAfterScrollPositionChange() code is necessary even without a scroll position change:
2597         if the web process has committed new scrolling tree state (e.g. with new fixed constraints) since
2598         the last call, we have to run the layer positioning code to have fixed layers re-adjust their position relative
2599         to the root. This was the primary bug fix.
2600
2601         Secondly, a layer tree commit can give ScrollingTreeFrameScrollingNode a new layout viewport, but we need to
2602         adjust this by the scrolling tree's current scroll position in case it gets used before the next scroll.
2603
2604         Currently no way to test this, as it's very timing-dependent.
2605
2606         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2607         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
2608         (WebCore::ScrollingTreeFrameScrollingNode::scrollPositionAndLayoutViewportMatch):
2609         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2610         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2611         (WebCore::ScrollingTreeScrollingNode::scrollPositionAndLayoutViewportMatch):
2612         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
2613         * page/scrolling/ScrollingTreeScrollingNode.h:
2614
2615 2019-03-07  Youenn Fablet  <youenn@apple.com>
2616
2617         Introduce a quota manager for Cache API/Service Worker/IDB storage
2618         https://bugs.webkit.org/show_bug.cgi?id=195283
2619
2620         Reviewed by Chris Dumez.
2621
2622         Introduce a generic quota manager and quota users to be used in Network Process.
2623         Quota manager/users are scoped by client origin.
2624         Quota manager is used to check for quota by an entity wanting to execute a storage task of a given taskSize.
2625         Quota manager will check the current space used by all its quota users.
2626         If the size + taskSize is above quota, it will call a function to try extend the quota.
2627         In the meantime, the task (and all tasks that may be added) are queued.
2628
2629         Once the new quota is received, the quota manager will either allow or disallow the first task in the queue.
2630         The quota manager will try to execute as many tasks as possible with the provided quota.
2631         If some tasks are remaining and quota limit is hit, the quota manager will compute the space needed for all remaining requests
2632         and do another quota extension request.
2633
2634         * Sources.txt:
2635         * WebCore.xcodeproj/project.pbxproj:
2636         * page/ClientOrigin.h:
2637         * storage/StorageQuotaManager.cpp: Added.
2638         (WebCore::StorageQuotaManager::~StorageQuotaManager):
2639         (WebCore::StorageQuotaManager::spaceUsage const):
2640         (WebCore::StorageQuotaManager::requestSpace):
2641         (WebCore::StorageQuotaManager::askForMoreSpace):
2642         (WebCore::StorageQuotaManager::processPendingRequests):
2643         * storage/StorageQuotaManager.h: Added.
2644         (WebCore::StorageQuotaManager::StorageQuotaManager):
2645         (WebCore::StorageQuotaManager::addUser):
2646         (WebCore::StorageQuotaManager::removeUser):
2647         * storage/StorageQuotaUser.h: Added.
2648
2649 2019-03-07  John Wilander  <wilander@apple.com>
2650
2651         Resource Load Statistics: Make it possible to purge only script-accessible cookies
2652         https://bugs.webkit.org/show_bug.cgi?id=195383
2653         <rdar://problem/48570136>
2654
2655         Reviewed by Brent Fulgham.
2656
2657         Test: http/tests/resourceLoadStatistics/delete-script-accessible-cookies.html
2658
2659         This patch provides the ability to purge all script-accessible cookies while leaving
2660         HttpOnly cookies in place.
2661
2662         * loader/CookieJar.h:
2663             Added boolean enum IncludeHttpOnlyCookies for use as function parameter.
2664         * platform/network/NetworkStorageSession.h:
2665         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2666         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
2667             Support for the new IncludeHttpOnlyCookies flag.
2668         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2669         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
2670             Stubbed out the new function and added a FIXME comment.
2671         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2672         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
2673             Stubbed out the new function and added a FIXME comment.
2674
2675 2019-03-06  Mark Lam  <mark.lam@apple.com>
2676
2677         Exception is a JSCell, not a JSObject.
2678         https://bugs.webkit.org/show_bug.cgi?id=195392
2679
2680         Reviewed by Saam Barati.
2681
2682         * bridge/objc/objc_utility.h:
2683         * bridge/objc/objc_utility.mm:
2684         (JSC::Bindings::throwError):
2685         * bridge/runtime_object.cpp:
2686         (JSC::Bindings::RuntimeObject::throwInvalidAccessError):
2687         * bridge/runtime_object.h:
2688
2689 2019-03-07  Devin Rousso  <drousso@apple.com>
2690
2691         Web Inspector: Canvas: lazily create the agent
2692         https://bugs.webkit.org/show_bug.cgi?id=195241
2693
2694         Reviewed by Joseph Pecoraro.
2695
2696         No functionality change.
2697
2698         * html/canvas/CanvasRenderingContext.h:
2699         * html/canvas/CanvasRenderingContext.cpp:
2700         (WebCore::CanvasRenderingContext::instances): Added.
2701         (WebCore::CanvasRenderingContext::instancesMutex): Added.
2702         (WebCore::CanvasRenderingContext::CanvasRenderingContext):
2703         (WebCore::CanvasRenderingContext::~CanvasRenderingContext):
2704
2705         * html/canvas/WebGLProgram.h:
2706         * html/canvas/WebGLProgram.cpp:
2707         (WebCore::WebGLProgram::instances): Added.
2708         (WebCore::WebGLProgram::instancesMutex): Added.
2709         (WebCore::WebGLProgram::WebGLProgram):
2710         (WebCore::WebGLProgram::~WebGLProgram):
2711         * html/canvas/WebGLRenderingContextBase.cpp:
2712         (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
2713
2714         * inspector/InspectorController.cpp:
2715         (WebCore::InspectorController::InspectorController):
2716         (WebCore::InspectorController::createLazyAgents):
2717
2718         * inspector/agents/InspectorCanvasAgent.h:
2719         * inspector/agents/InspectorCanvasAgent.cpp:
2720         (WebCore::InspectorCanvasAgent::enable):
2721         (WebCore::InspectorCanvasAgent::disable):
2722         (WebCore::InspectorCanvasAgent::frameNavigated):
2723         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
2724         (WebCore::InspectorCanvasAgent::canvasDestroyed):
2725         (WebCore::InspectorCanvasAgent::didCreateProgram):
2726         (WebCore::InspectorCanvasAgent::willDeleteProgram):
2727         (WebCore::InspectorCanvasAgent::bindCanvas): Added.
2728         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
2729
2730         * inspector/InspectorInstrumentation.h:
2731         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
2732         (WebCore::InspectorInstrumentation::didCreateProgram):
2733         (WebCore::InspectorInstrumentation::willDeleteProgram):
2734
2735 2019-03-06  Ross Kirsling  <ross.kirsling@sony.com>
2736
2737         [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
2738         https://bugs.webkit.org/show_bug.cgi?id=195346
2739
2740         Reviewed by Fujii Hironori.
2741
2742         * platform/graphics/win/FontCacheWin.cpp:
2743         (WebCore::appendLinkedFonts):
2744         (WebCore::getLinkedFonts):
2745         (WebCore::FontCache::systemFallbackForCharacters):
2746         (WebCore::FontCache::fontFromDescriptionAndLogFont):
2747         (WebCore::createGDIFont):
2748         (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
2749         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2750         (WebCore::FontCustomPlatformData::fontPlatformData):
2751         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
2752         (WebCore::GlyphPage::fill):
2753         * platform/graphics/win/IconWin.cpp:
2754         (WebCore::Icon::createIconForFiles):
2755         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2756         (WebCore::mimeTypeCache):
2757         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
2758         * platform/graphics/win/UniscribeController.cpp:
2759         (WebCore::UniscribeController::itemizeShapeAndPlace):
2760         (WebCore::UniscribeController::shape):
2761         * platform/network/win/DownloadBundleWin.cpp:
2762         (WebCore::DownloadBundle::appendResumeData):
2763         (WebCore::DownloadBundle::extractResumeData):
2764         * platform/text/win/LocaleWin.cpp:
2765         (WebCore::LCIDFromLocaleInternal):
2766         (WebCore::LCIDFromLocale):
2767         (WebCore::LocaleWin::getLocaleInfoString):
2768         * platform/win/BString.cpp:
2769         (WebCore::BString::BString):
2770         * platform/win/ClipboardUtilitiesWin.cpp:
2771         (WebCore::getWebLocData):
2772         (WebCore::createGlobalData):
2773         (WebCore::getFileDescriptorData):
2774         (WebCore::getURL):
2775         (WebCore::getCFData):
2776         (WebCore::setCFData):
2777         * platform/win/DragDataWin.cpp:
2778         (WebCore::DragData::asFilenames const):
2779         * platform/win/DragImageWin.cpp:
2780         (WebCore::createDragImageIconForCachedImageFilename):
2781         (WebCore::dragLabelFont):
2782         * platform/win/MIMETypeRegistryWin.cpp:
2783         (WebCore::mimeTypeForExtension):
2784         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
2785         * platform/win/PasteboardWin.cpp:
2786         (WebCore::Pasteboard::read):
2787         (WebCore::filesystemPathFromUrlOrTitle):
2788         (WebCore::Pasteboard::writeURLToDataObject):
2789         (WebCore::createGlobalImageFileDescriptor):
2790         (WebCore::createGlobalHDropContent):
2791         * platform/win/SSLKeyGeneratorWin.cpp:
2792         (WebCore::signedPublicKeyAndChallengeString):
2793         * platform/win/SharedBufferWin.cpp:
2794         (WebCore::SharedBuffer::createFromReadingFile):
2795         * rendering/RenderThemeWin.cpp:
2796         (WebCore::fillFontDescription):
2797         Use wchar helpers as needed.
2798
2799 2019-03-06  Devin Rousso  <drousso@apple.com>
2800
2801         Web Inspector: DOM Debugger: event breakpoints still fire when breakpoints are disabled
2802         https://bugs.webkit.org/show_bug.cgi?id=195377
2803         <rdar://problem/48651645>
2804
2805         Reviewed by Joseph Pecoraro and Matt Baker.
2806
2807         Test: inspector/dom-debugger/event-listener-breakpoints.html
2808
2809         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2810         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
2811         (WebCore::InspectorDOMDebuggerAgent::willFireTimer):
2812         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame):
2813
2814 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2815
2816         Crash when attempting to change input type while dismissing datalist suggestions
2817         https://bugs.webkit.org/show_bug.cgi?id=195384
2818         <rdar://problem/48563718>
2819
2820         Reviewed by Brent Fulgham.
2821
2822         When closing a datalist suggestion menu, WebPageProxy sends a message to WebPage instructing it to tell its
2823         active datalist suggestions picker to close. However, for a myriad of reasons, the suggestions picker (kept
2824         alive by its text input type) may have already gone away by this point. To mitigate this, make WebPage weakly
2825         reference its active datalist suggestions picker.
2826
2827         Test: fast/forms/datalist/change-input-type-after-closing-datalist-suggestions.html
2828
2829         * platform/DataListSuggestionPicker.h:
2830
2831         Make DataListSuggestionPicker capable of being weakly referenced. Additionally, fix some minor preexisting
2832         issues in this header (#imports instead of #includes, as well as an unnecessary include of IntRect.h).
2833
2834 2019-03-06  Ryan Haddad  <ryanhaddad@apple.com>
2835
2836         Remove an unneeded assert that was added with r242113
2837         https://bugs.webkit.org/show_bug.cgi?id=195391
2838
2839         Reviewed by Simon Fraser.
2840
2841         Many layout tests are failing ASSERT(m_mediaBufferingIsSuspended). Since m_mediaBufferingIsSuspended is
2842         protected by an 'if' statement directly afterwards, the assertion should be safe to remove.
2843
2844         * page/Page.cpp:
2845         (WebCore::Page::resumeAllMediaBuffering):
2846
2847 2019-03-06  Justin Fan  <justin_fan@apple.com>
2848
2849         Unreviewed build fix. Replace a forward declaration with an include.
2850
2851         * Modules/webgpu/WebGPUTextureView.cpp:
2852         * Modules/webgpu/WebGPUTextureView.h:
2853
2854 2019-03-06  Justin Fan  <justin_fan@apple.com>
2855
2856         [Web GPU] GPUTexture and GPUTextureView updates, and related GPUBindGroup updates
2857         https://bugs.webkit.org/show_bug.cgi?id=195347
2858
2859         Reviewed by Dean Jackson.
2860
2861         Implement the ability to display image data as a GPUTexture in the rendering pipeline. Improve GPUTexture and 
2862         GPUTextureView implementations. Rename various bind group classes to GPU* to match API.
2863
2864         Test: webgpu/texture-triangle-strip.html
2865
2866         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
2867         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Update to validate GPUTextureView resources.
2868         * Modules/webgpu/WebGPUCommandBuffer.cpp: Move instead of copy the converted view objects.
2869         (WebCore::WebGPUCommandBuffer::copyBufferToTexture):
2870         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer):
2871         (WebCore::WebGPUCommandBuffer::copyTextureToTexture):
2872         * Modules/webgpu/WebGPUCommandBuffer.h:
2873         (WebCore::WebGPUCommandBuffer::commandBuffer const): No longer returns const so used resources can be registered on it.
2874         * Modules/webgpu/WebGPUDevice.cpp:
2875         (WebCore::WebGPUDevice::createBindGroupLayout const): Rename WebGPUBindGroupLayoutDescriptor and replace unnecessary rvalue reference.
2876         * Modules/webgpu/WebGPUDevice.h: Ditto.
2877         * Modules/webgpu/WebGPUDevice.idl: Ditto.
2878         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
2879         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
2880         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
2881         * Modules/webgpu/WebGPUQueue.cpp:
2882         (WebCore::WebGPUQueue::submit):
2883         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
2884         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
2885         * Modules/webgpu/WebGPUTexture.cpp:
2886         (WebCore::WebGPUTexture::~WebGPUTexture): Clean up any resources created for and from this WebGPUTexture.
2887         (WebCore::WebGPUTexture::createDefaultTextureView): Now returns an empty object other than null on failure.
2888         (WebCore::WebGPUTexture::destroy):
2889         (WebCore::WebGPUTexture::destroyImpl):
2890         * Modules/webgpu/WebGPUTexture.h: Keep a list of any views created from this texture.
2891         * Modules/webgpu/WebGPUTexture.idl: Enable destroy.
2892         * Modules/webgpu/WebGPUTextureView.cpp:
2893         (WebCore::WebGPUTextureView::create):
2894         (WebCore::WebGPUTextureView::WebGPUTextureView):
2895         (WebCore::WebGPUTextureView::destroy):
2896         * Modules/webgpu/WebGPUTextureView.h:
2897         (WebCore::WebGPUTextureView::~WebGPUTextureView): Clean up any resources backing this WebGPUTextureView.
2898         (WebCore::WebGPUTextureView::texture const):
2899         (WebCore::WebGPUTextureView::texture): Deleted.
2900         * platform/graphics/gpu/GPUBindGroupLayout.h:
2901         * platform/graphics/gpu/GPUCommandBuffer.h:
2902         (WebCore::GPUCommandBuffer::usedTextures const): Keep a list of all texture resources that will be used by this command buffer on submit.
2903         (WebCore::GPUCommandBuffer::isEncodingPass const): Added to prevent multiple pass encoders from being active on one command buffer.
2904         (WebCore::GPUCommandBuffer::setIsEncodingPass):
2905         (WebCore::GPUCommandBuffer::useTexture):
2906         * platform/graphics/gpu/GPUDevice.cpp:
2907         (WebCore::GPUDevice::tryCreateBindGroupLayout const):
2908         * platform/graphics/gpu/GPUDevice.h:
2909         * platform/graphics/gpu/GPUPipelineLayout.cpp:
2910         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
2911         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp:
2912         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
2913         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2914         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
2915         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
2916         (): Deleted.
2917         * platform/graphics/gpu/GPUQueue.h:
2918         * platform/graphics/gpu/GPURenderPassEncoder.h:
2919         * platform/graphics/gpu/GPUTexture.h:
2920         (WebCore::GPUTexture::isReadOnly const):
2921         (WebCore::GPUTexture::destroy):
2922         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2923         (WebCore::MTLDataTypeForBindingType):
2924         (WebCore::GPUBindGroupLayout::tryCreate):
2925         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
2926         (WebCore::GPUCommandBuffer::create):
2927         (WebCore::GPUCommandBuffer::~GPUCommandBuffer): Ensure blitEncoder is ended before releasing it.
2928         (WebCore::GPUCommandBuffer::endBlitEncoding):
2929         (WebCore::GPUCommandBuffer::copyBufferToTexture): Ensure textures are marked for usage before submission occurs.
2930         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
2931         (WebCore::GPUCommandBuffer::copyTextureToTexture):
2932         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
2933         (WebCore::GPUDevice::create):
2934         (WebCore::GPUDevice::GPUDevice):
2935         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2936         (WebCore::GPUProgrammablePassEncoder::endPass):
2937         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Now supports texture resources.
2938         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Just moved.
2939         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder):
2940         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2941         (WebCore::GPUQueue::submit): Ensures destroyed GPUTextures are not submitted.
2942         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2943         (WebCore::GPURenderPassEncoder::tryCreate): Ensure any other encoders are ended before attempting to activate a new one.
2944         (WebCore::GPURenderPassEncoder::platformPassEncoder const):
2945         (WebCore::GPURenderPassEncoder::endPass): Invalidates the MTLCommandEncoder upon success.
2946         (WebCore::GPURenderPassEncoder::setPipeline):
2947         (WebCore::GPURenderPassEncoder::setVertexBuffers):
2948         (WebCore::GPURenderPassEncoder::draw):
2949         (WebCore::GPURenderPassEncoder::useResource):
2950         (WebCore::GPURenderPassEncoder::setVertexBuffer):
2951         (WebCore::GPURenderPassEncoder::setFragmentBuffer):
2952         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2953         (WebCore::GPUSwapChain::getNextTexture):
2954         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
2955         (WebCore::storageModeForPixelFormatAndSampleCount): 
2956                 Always create MTLStorageModePrivate textures on macOS, as Web GPU doesn't provide CPU access to textures anyway.
2957         (WebCore::tryCreateMtlTextureDescriptor):
2958         (WebCore::GPUTexture::create):
2959         (WebCore::GPUTexture::GPUTexture):
2960         (WebCore::GPUTexture::tryCreateDefaultTextureView): Renamed from createDefaultTextureView.
2961
2962         Update files and symbols in project:
2963         * CMakeLists.txt:
2964         * DerivedSources-input.xcfilelist:
2965         * DerivedSources-output.xcfilelist:
2966         * DerivedSources.make:
2967         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Removed.
2968         * Modules/webgpu/GPUBindGroupLayoutBinding.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutBinding.h.
2969         * Modules/webgpu/GPUBindGroupLayoutBinding.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl.
2970         * Modules/webgpu/GPUBindGroupLayoutDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h.
2971         * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl.
2972         * Modules/webgpu/GPUShaderStageBit.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.h.
2973         * Modules/webgpu/GPUShaderStageBit.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.idl.
2974         * Sources.txt:
2975         * WebCore.xcodeproj/project.pbxproj:
2976         * bindings/js/WebCoreBuiltinNames.h:
2977
2978 2019-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
2979
2980         [WHLSL] Pack and unpack data at entry points and exit points
2981         https://bugs.webkit.org/show_bug.cgi?id=193877
2982
2983         Reviewed by Dean Jackson.
2984
2985         This implements the bulk of the rest of the Metal code generation piece.
2986         Specifically, this patch adds support for the packing and unpacking steps
2987         at the beginning of the entry point functions and all returns from those
2988         functions. It does this by creating an object, EntryPointScaffolding, that
2989         knows how to emit all the helper types, packing / unpacking code, and the
2990         function signature. This patch also accepts parts of the
2991         PipelineStateDescriptor so we know the data layout we should be packing and
2992         unpacking.
2993
2994         This is the last patch before enough of the compiler is present that we can
2995         start testing it. The next patch will start porting the test suite.
2996
2997         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2998         (WebCore::WHLSL::Metal::attributeForSemantic):
2999         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
3000         (WebCore::WHLSL::Metal::EntryPointScaffolding::mappedBindGroups const):
3001         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
3002         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
3003         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature):
3004         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
3005         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
3006         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
3007         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding):
3008         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
3009         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature):
3010         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
3011         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack):
3012         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding):
3013         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
3014         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature):
3015         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
3016         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack):
3017         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::ComputeEntryPointScaffolding):
3018         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::helperTypes):
3019         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature):
3020         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::unpack):
3021         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::pack):
3022         (WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes): Deleted.
3023         (WebCore::WHLSL::Metal::EntryPointScaffolding::signature): Deleted.
3024         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpack): Deleted.
3025         (WebCore::WHLSL::Metal::EntryPointScaffolding::pack): Deleted.
3026         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
3027         (WebCore::WHLSL::Metal::EntryPointScaffolding::parameterVariables):
3028         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3029         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
3030         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
3031         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
3032         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
3033         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
3034         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
3035         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter):
3036         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeVertexMappedBindGroups):
3037         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeFragmentMappedBindGroups):
3038         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
3039         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter):
3040         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::takeMappedBindGroups):
3041         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
3042         (WebCore::WHLSL::Metal::sharedMetalFunctions):
3043         (WebCore::WHLSL::Metal::metalFunctions):
3044         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
3045         * Modules/webgpu/WHLSL/Metal/WHLSLMappedBindings.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
3046         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
3047         (WebCore::WHLSL::Metal::generateMetalCodeShared):
3048         (WebCore::WHLSL::Metal::generateMetalCode):
3049         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
3050         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
3051         (WebCore::WHLSL::Intrinsics::float2Type const):
3052         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: Added.
3053         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: Added.
3054         (WebCore::WHLSL::prepareShared):
3055         (WebCore::WHLSL::prepare):
3056         * Modules/webgpu/WHLSL/WHLSLPrepare.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
3057         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: Added.
3058         (WebCore::WHLSL::findEntryPoint):
3059         (WebCore::WHLSL::matchMode):
3060         (WebCore::WHLSL::matchResources):
3061         (WebCore::WHLSL::matchInputsOutputs):
3062         (WebCore::WHLSL::isAcceptableFormat):
3063         (WebCore::WHLSL::matchVertexAttributes):
3064         (WebCore::WHLSL::matchColorAttachments):
3065         (WebCore::WHLSL::matchDepthAttachment):
3066         (WebCore::WHLSL::matchSemantics):
3067         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp.
3068         * Sources.txt:
3069         * WebCore.xcodeproj/project.pbxproj:
3070
3071 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3072
3073         Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
3074         https://bugs.webkit.org/show_bug.cgi?id=195300
3075
3076         Reviewed by Simon Fraser.
3077
3078         Move isTransparentOrFullyClippedRespectingParentFrames() from RenderObject to RenderLayer, since this function
3079         asks questions about RenderLayers rather than their renderers. No change in behavior.
3080
3081         * rendering/RenderLayer.cpp:
3082         (WebCore::enclosingFrameRenderLayer):
3083         (WebCore::parentLayerCrossFrame):
3084
3085         Some static helpers currently in RenderObject that walk up the layer hierarchy through subframes are redundant
3086         with static helpers in RenderLayer. Now that isTransparentOrFullyClippedRespectingParentFrames exists in
3087         RenderLayer, simply use this existing helper instead and split logic to grab the enclosing layer around the
3088         owner element of a frame into a separate helper.
3089
3090         * rendering/RenderLayer.h:
3091         * rendering/RenderObject.cpp:
3092         (WebCore::enclosingFrameRenderLayer): Deleted.
3093         (WebCore::parentLayerCrossingFrameBoundaries): Deleted.
3094         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const): Deleted.
3095
3096         Moved from RenderObject.
3097
3098         * rendering/RenderObject.h:
3099
3100 2019-03-06  Sihui Liu  <sihui_liu@apple.com>
3101
3102         Assertion Failed: m_databaseQueue.isKilled() in UniqueIDBDatabase::~UniqueIDBDatabase()
3103         https://bugs.webkit.org/show_bug.cgi?id=195073
3104         <rdar://problem/48285200>
3105
3106         Reviewed by Geoffrey Garen.
3107
3108         r240931 removed a retain cycle between IDBConnectionToServer and IDBConnectionToServerDelegate, so 
3109         IDBConnectionToServerDelegate, or InProcessIDBServer would not live forever. When IDBDatabase is gone, 
3110         InProcessIDBServer would schedule a notifification to IDBServer with databaseConnectionClosed. IDBServer would 
3111         then notify UniqueIDBDatabase. When UniqueIDBDatabase finds all database connections are gone, it would acquires
3112         its only reference pointer from IDBServer schedule and perform a shutdown that kills its database task queue.
3113
3114         The assertion failure tells us UniqueIDBDatabase was destructed at when IDBServer was destructed, which means 
3115         UniqueIDBDatabase had not acquired its pointer. It's probably because UniqueIDBDatabase had unfinished tasks or
3116         the operation timer function had not been executed. Since UniqueIDBDatabase needs to complete shutdown process,
3117         we should make IDBServer live as long as UniqueIDBDatabase by keeping a reference pointer of IDBServer in 
3118         UniqueIDBDatabase. 
3119
3120         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3121         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
3122         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
3123         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
3124         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
3125         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
3126         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
3127         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3128         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
3129         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3130         (WebCore::IDBServer::UniqueIDBDatabase::server):
3131
3132 2019-03-06  Rob Buis  <rbuis@igalia.com>
3133
3134         Consider supporting the `referrerpolicy` attribute.
3135         https://bugs.webkit.org/show_bug.cgi?id=179053
3136
3137         Reviewed by Darin Adler.
3138
3139         This patch adds 'referrerpolicy' attribute support for iframe.
3140         If set, the value is restricted to the ReferrerPolicy enum, and
3141         if valid it is used for the subframe load.
3142         If not set or invalid, the current behavior is kept.
3143
3144         Tests: http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http-http.html
3145                http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http.https.html
3146                http/tests/referrer-policy-iframe/no-referrer-when-downgrade/same-origin.html
3147                http/tests/referrer-policy-iframe/no-referrer/cross-origin-http-http.html
3148                http/tests/referrer-policy-iframe/no-referrer/cross-origin-http.https.html
3149                http/tests/referrer-policy-iframe/no-referrer/same-origin.html
3150                http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http-http.html
3151                http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http.https.html
3152                http/tests/referrer-policy-iframe/origin-when-cross-origin/same-origin.html
3153                http/tests/referrer-policy-iframe/origin/cross-origin-http-http.html
3154                http/tests/referrer-policy-iframe/origin/cross-origin-http.https.html
3155                http/tests/referrer-policy-iframe/origin/same-origin.html
3156                http/tests/referrer-policy-iframe/same-origin/cross-origin-http-http.html
3157                http/tests/referrer-policy-iframe/same-origin/cross-origin-http.https.html
3158                http/tests/referrer-policy-iframe/same-origin/same-origin.html
3159                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http-http.html
3160                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http.https.html
3161                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/same-origin.html
3162                http/tests/referrer-policy-iframe/strict-origin/cross-origin-http-http.html
3163                http/tests/referrer-policy-iframe/strict-origin/cross-origin-http.https.html
3164                http/tests/referrer-policy-iframe/strict-origin/same-origin.html
3165                http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http-http.html
3166                http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http.https.html
3167                http/tests/referrer-policy-iframe/unsafe-url/same-origin.html
3168
3169         * html/HTMLAttributeNames.in:
3170         * html/HTMLFrameOwnerElement.h:
3171         (WebCore::HTMLFrameOwnerElement::referrerPolicy const):
3172         * html/HTMLIFrameElement.cpp:
3173         (WebCore::HTMLIFrameElement::setReferrerPolicyForBindings):
3174         (WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
3175         (WebCore::HTMLIFrameElement::referrerPolicy const):
3176         * html/HTMLIFrameElement.h:
3177         * html/HTMLIFrameElement.idl:
3178         * loader/SubframeLoader.cpp:
3179         (WebCore::SubframeLoader::loadSubframe):
3180         * page/RuntimeEnabledFeatures.h:
3181         (WebCore::RuntimeEnabledFeatures::referrerPolicyAttributeEnabled const):
3182         (WebCore::RuntimeEnabledFeatures::setReferrerPolicyAttributeEnabled):
3183         * platform/ReferrerPolicy.cpp:
3184         (WebCore::parseReferrerPolicy):
3185         * platform/ReferrerPolicy.h:
3186
3187 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
3188
3189         [curl] Remove unnecessary file.
3190         https://bugs.webkit.org/show_bug.cgi?id=195350
3191
3192         Reviewed by Fujii Hironori.
3193
3194         Removed unused file.
3195
3196         No new tests. No change in behavior.
3197
3198         * platform/network/curl/CookieJarCurlDatabase.cpp: Removed.
3199
3200 2019-03-05  Eric Liang  <ericliang@apple.com>
3201
3202         AX: Add remote search support for keyboard focusable element search type
3203         https://bugs.webkit.org/show_bug.cgi?id=195336
3204
3205         Reviewed by Chris Fleizach.
3206
3207         Added AXKeyboardFocusable search key to return default keyboard-focusable elements for accessibility.
3208
3209         Test: accessibility/mac/search-predicate-keyboard-focusable.html
3210
3211         * accessibility/AccessibilityObject.cpp:
3212         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
3213         (WebCore::AccessibilityObject::isKeyboardFocusable const):
3214         * accessibility/AccessibilityObject.h:
3215         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3216         (createAccessibilitySearchKeyMap):
3217
3218 2019-03-05  Don Olmstead  <don.olmstead@sony.com>
3219
3220         [WinCairo] Enable CSS Typed OM
3221         https://bugs.webkit.org/show_bug.cgi?id=195340
3222
3223         Reviewed by Myles C. Maxfield.
3224
3225         * bindings/js/CallTracerTypes.h:
3226
3227 2019-03-05  Sihui Liu  <sihui_liu@apple.com>
3228
3229         Fix a typo in Web SQL quirk
3230         https://bugs.webkit.org/show_bug.cgi?id=195338
3231
3232         Reviewed by Geoffrey Garen.
3233
3234         * page/Quirks.cpp:
3235         (WebCore::Quirks::hasWebSQLSupportQuirk const):
3236
3237 2019-03-05  Daniel Bates  <dabates@apple.com>
3238
3239         [iOS] Should not scroll when checkbox, radio, submit, reset, or button is spacebar activated
3240         https://bugs.webkit.org/show_bug.cgi?id=195281
3241         <rdar://problem/48564347>
3242
3243         Reviewed by Simon Fraser.
3244
3245         Do not call the base class's default event handler (HTMLTextFormControlElement::defaultEventHandler())
3246         when WebCore sees a keydown of the spacebar as we consider such an event as handled.
3247         Otherwise, calling the base class's default event handler ultimately gives the embedding
3248         client a chance to wrongly handle the event. In the case of iOS, keydown of the spacebar
3249         causes the page to scroll.
3250
3251         WebCore implements spacebar activation on keydown for form controls. For IE compatibility
3252         WebCore does not mark such keydown events as handled so that a DOM keypress event will
3253         be subsequently dispatched. The current logic only skips calling the base class's default
3254         event handler if the DOM event was not marked handled. This is insufficient. We need to
3255         know whether WebCore handled the event. If asking the input type to handle the key down
3256         marks the DOM event as handled then, clearly, WebCore handled the event. However, if the
3257         event is not marked as handled, but WebCore actually accounted for this event then we need
3258         to know this so that we do not call the base class's default event handler and ultimately
3259         the embedding client asking for an interpretation of the key event. Towards this, have
3260         InputType::handleKeydownEvent() return a bit whether or not the base class's default
3261         event handler should be invoked.
3262
3263         Tests: fast/events/ios/activating-button-should-not-scroll-page.html
3264                fast/events/ios/activating-checkbox-should-not-scroll-page.html
3265                fast/events/ios/activating-radio-button-should-not-scroll-page.html
3266                fast/events/ios/activating-reset-button-should-not-scroll-page.html
3267                fast/events/ios/activating-submit-button-should-not-scroll-page.html
3268
3269         * html/BaseCheckableInputType.cpp:
3270         (WebCore::BaseCheckableInputType::handleKeydownEvent): Return ShouldCallBaseEventHandler::No
3271         if WebCore handled the spacebar activation. Otherewise, return ShouldCallBaseEventHandler::Yes.
3272         * html/BaseCheckableInputType.h:
3273         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
3274         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent): Ditto.
3275         * html/BaseChooserOnlyDateAndTimeInputType.h:
3276         * html/BaseClickableWithKeyInputType.cpp:
3277         (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
3278         * html/BaseClickableWithKeyInputType.h:
3279         * html/HTMLInputElement.cpp:
3280         (WebCore::HTMLInputElement::defaultEventHandler): Do not fallthrough and call the base class's default
3281         event handler if the input type told us it handled the event regardless of whether the event was handled
3282         from the perspective of the DOM.
3283         * html/InputType.cpp:
3284         (WebCore::InputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
3285         * html/InputType.h:
3286
3287         * html/NumberInputType.cpp:
3288         (WebCore::NumberInputType::handleKeydownEvent):
3289         * html/NumberInputType.h:
3290         * html/RadioInputType.cpp:
3291         (WebCore::RadioInputType::handleKeydownEvent):
3292         * html/RadioInputType.h:
3293         * html/RangeInputType.cpp:
3294         (WebCore::RangeInputType::handleKeydownEvent):
3295         * html/RangeInputType.h:
3296         * html/SearchInputType.cpp:
3297         (WebCore::SearchInputType::handleKeydownEvent):
3298         * html/SearchInputType.h:
3299         * html/TextFieldInputType.cpp:
3300         (WebCore::TextFieldInputType::handleKeydownEvent):
3301         * html/TextFieldInputType.h:
3302         Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
3303
3304 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
3305
3306         [Curl] Implement Cookie Accept Policy.
3307         https://bugs.webkit.org/show_bug.cgi?id=191645
3308
3309         Reviewed by Fujii Hironori.
3310
3311         Make Curl network layer respect to coookie accept policy.
3312         This patch fixes tests below on TestRunner, but doesn't fix tests on DumpRenderTree.
3313
3314         Tests: http/tests/cookies/only-accept-first-party-cookies.html
3315                http/tests/cookies/third-party-cookie-relaxing.html
3316                http/tests/security/cookies/third-party-cookie-blocking-redirect.html
3317                http/tests/security/cookies/third-party-cookie-blocking-user-action.html
3318                http/tests/security/cookies/third-party-cookie-blocking-xslt.xml
3319                http/tests/security/cookies/third-party-cookie-blocking.html
3320
3321         * platform/network/curl/CookieJarCurl.cpp:
3322         (WebCore::cookiesForSession):
3323         (WebCore::CookieJarCurl::setCookiesFromDOM const):
3324         (WebCore::CookieJarCurl::setCookiesFromHTTPResponse const):
3325         (WebCore::CookieJarCurl::setCookieAcceptPolicy const):
3326         (WebCore::CookieJarCurl::cookieAcceptPolicy const):
3327         (WebCore::CookieJarCurl::getRawCookies const):
3328         * platform/network/curl/CookieJarCurl.h:
3329         * platform/network/curl/CookieJarDB.cpp:
3330         (WebCore::CookieJarDB::openDatabase):
3331         (WebCore::CookieJarDB::isEnabled const):
3332         (WebCore::CookieJarDB::checkCookieAcceptPolicy):
3333         (WebCore::CookieJarDB::hasCookies):
3334         (WebCore::CookieJarDB::searchCookies):
3335         (WebCore::CookieJarDB::canAcceptCookie):
3336         (WebCore::CookieJarDB::setCookie):
3337         (WebCore::CookieJarDB::setEnabled): Deleted.
3338         * platform/network/curl/CookieJarDB.h:
3339         (WebCore::CookieJarDB::setAcceptPolicy):
3340         (WebCore::CookieJarDB::acceptPolicy const):
3341         * platform/network/curl/CookieUtil.cpp:
3342         (WebCore::CookieUtil::parseCookieAttributes):
3343         (WebCore::CookieUtil::parseCookieHeader):
3344         * platform/network/curl/CurlResourceHandleDelegate.cpp:
3345         (WebCore::handleCookieHeaders):
3346         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
3347
3348 2019-03-05  Zalan Bujtas  <zalan@apple.com>
3349
3350         [ContentChangeObserver] Assert on if notify content change is allowed
3351         https://bugs.webkit.org/show_bug.cgi?id=195332
3352         <rdar://problem/48603276>
3353
3354         Reviewed by Simon Fraser.
3355
3356         Assert we don't notify the client about the state change while in handleSyntheticClick().
3357
3358         * page/ios/ContentChangeObserver.cpp:
3359         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
3360         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
3361         (WebCore::ContentChangeObserver::adjustObservedState):
3362         * page/ios/ContentChangeObserver.h:
3363         (WebCore::ContentChangeObserver::isObservingContentChanges const):
3364         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
3365
3366 2019-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
3367
3368         SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
3369         https://bugs.webkit.org/show_bug.cgi?id=195333
3370         <rdar://problem/48475802>
3371
3372         Reviewed by Simon Fraser.
3373
3374         Because the SVG1.1 specs states that the newItem should be removed from
3375         its original list before adding it to another list,
3376         SVGPathSegList.insertItemBefore() should fail if the new item belongs to
3377         an animating animPathSegList since it is read-only.
3378
3379         Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg
3380
3381         * svg/SVGPathSegList.cpp:
3382         (WebCore::SVGPathSegList::processIncomingListItemValue):
3383
3384 2019-03-05  Zalan Bujtas  <zalan@apple.com>
3385
3386         [ContentChangeObserver] Send content change notification through adjustObservedState
3387         https://bugs.webkit.org/show_bug.cgi?id=195328
3388         <rdar://problem/48601143>
3389
3390         Reviewed by Simon Fraser.
3391
3392         Have a dedicated place for the notification logic.
3393
3394         * page/ios/ContentChangeObserver.cpp:
3395         (WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
3396         (WebCore::ContentChangeObserver::didInstallDOMTimer):
3397         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
3398         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
3399         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
3400         (WebCore::ContentChangeObserver::mouseMovedDidStart):
3401         (WebCore::ContentChangeObserver::adjustObservedState):
3402         (WebCore::ContentChangeObserver::registerDOMTimer): Deleted.
3403         (WebCore::ContentChangeObserver::unregisterDOMTimer): Deleted.
3404         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded): Deleted.
3405         * page/ios/ContentChangeObserver.h:
3406         (WebCore::ContentChangeObserver::registerDOMTimer):
3407         (WebCore::ContentChangeObserver::unregisterDOMTimer):
3408
3409 2019-03-05  Youenn Fablet  <youenn@apple.com>
3410
3411         MockLibWebRTCPeerConnection is leaking some session description
3412         https://bugs.webkit.org/show_bug.cgi?id=195315
3413         <rdar://problem/47840038>
3414
3415         Reviewed by David Kilzer.
3416
3417         Make sure to release raw pointers given from WebCore to mock libwebrtc layer.
3418         Covered by existing tests when run in leaks mode.
3419
3420         * testing/MockLibWebRTCPeerConnection.cpp:
3421         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
3422         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
3423
3424 2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
3425
3426         Unreviewed, rolling out r242403.
3427
3428         Caused layout test crashes on iOS simulator.
3429
3430         Reverted changeset:
3431
3432         "[ContentChangeObserver] Introduce fixed duration content
3433         observation"
3434         https://bugs.webkit.org/show_bug.cgi?id=195295
3435         https://trac.webkit.org/changeset/242403
3436
3437 2019-03-05  Frederic Wang  <fwang@igalia.com>
3438
3439         Web Inspector: Better categorize CPU usage per-thread / worker
3440         https://bugs.webkit.org/show_bug.cgi?id=194564
3441
3442         Unreviewed compilation fix.
3443
3444         * page/ResourceUsageData.h: Add missing headers.
3445
3446 2019-03-05  Frederic Wang  <fwang@igalia.com>
3447
3448         Share more code for updating the state of frame scrolling nodes
3449         https://bugs.webkit.org/show_bug.cgi?id=195254
3450
3451         Unreviewed compilation warning fix.
3452
3453         * page/scrolling/AsyncScrollingCoordinator.cpp:
3454         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Add UNUSED_PARAM on non-Cocoa
3455         platforms.
3456
3457 2019-03-05  Cathie Chen  <cathiechen@igalia.com>
3458
3459         The include file in ScrollingStateFrameHostingNode.h is wrong.
3460         https://bugs.webkit.org/show_bug.cgi?id=195280
3461
3462         Reviewed by Frédéric Wang.
3463
3464         * page/scrolling/ScrollingStateFrameHostingNode.h:
3465
3466 2019-03-04  Justin Fan  <justin_fan@apple.com>
3467
3468         Unreviewed build fix for High Sierra.
3469
3470         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Should fix "global constructor" error.
3471
3472 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
3473
3474         Use a SQLite database to hold the ResourceLoadStatistics data
3475         https://bugs.webkit.org/show_bug.cgi?id=194867
3476         <rdar://problem/24240854>
3477
3478         Reviewed by Chris Dumez.
3479
3480         Add a new runtime feature flag to support use of an experimental database
3481         back-end. Also expose some SQLite function calls for use outside of WebCore.
3482
3483         No change in functionality, so no new tests.
3484
3485         * page/RuntimeEnabledFeatures.h:
3486         (WebCore::RuntimeEnabledFeatures::setItpDatabaseModeEnabled):
3487         (WebCore::RuntimeEnabledFeatures::itpDatabaseModeEnabled const):
3488         * platform/sql/SQLiteDatabase.h:
3489         * platform/sql/SQLiteStatement.h:
3490
3491 2019-03-04  Justin Fan  <justin_fan@apple.com>
3492
3493         [Web GPU] Blitting function prototypes
3494         https://bugs.webkit.org/show_bug.cgi?id=195224
3495         <rdar://problem/48538902>
3496
3497         Reviewed by Dean Jackson.
3498
3499         Implement barebones GPUCommandBuffer::copy* prototypes while rounding out GPUTexture implementation details.
3500
3501         Test: webgpu/blit-commands.html
3502
3503         * Modules/webgpu/GPUOrigin3D.h: Added.
3504         * Modules/webgpu/GPUOrigin3D.idl: Added.
3505         * Modules/webgpu/WebGPUCommandBuffer.cpp: Add copy view struct implementations.
3506         (WebCore::WebGPUBufferCopyView::asGPUBufferCopyView const): Added.
3507         (WebCore::WebGPUTextureCopyView::asGPUTextureCopyView const): Added.
3508         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Added.
3509         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Added.
3510         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Added.
3511         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Added.
3512         * Modules/webgpu/WebGPUCommandBuffer.h: Add new functions and supporting structs.
3513         * Modules/webgpu/WebGPUCommandBuffer.idl: Ditto.
3514         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Refactor constructors to copy the entire base class.
3515         (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor):
3516         (WebCore::GPURenderPassDepthStencilAttachmentDescriptor::GPURenderPassDepthStencilAttachmentDescriptor):
3517         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
3518         (WebCore::attachment): Deleted.
3519         * Modules/webgpu/WebGPUTexture.h:
3520         (WebCore::WebGPUTexture::texture const): Added.
3521         * platform/graphics/gpu/GPUBuffer.h:
3522         (WebCore::GPUBuffer::byteLength const): Added.
3523         (WebCore::GPUBuffer::isTransferSource const): Added.
3524         (WebCore::GPUBuffer::isTransferDestination const): Renamed from isTransferDst. Refactored for OptionSet API.
3525         (WebCore::GPUBuffer::isVertex const): Ditto.
3526         (WebCore::GPUBuffer::isUniform const): Ditto.
3527         (WebCore::GPUBuffer::isStorage const): Ditto.
3528         (WebCore::GPUBuffer::isMappable const): Ditto.
3529         (WebCore::GPUBuffer::isMapWrite const): Ditto.
3530         (WebCore::GPUBuffer::isMapRead const): Ditto.
3531         * platform/graphics/gpu/GPUBufferUsage.h: Refactored for better bit flag style.
3532         * platform/graphics/gpu/GPUCommandBuffer.h:
3533         (WebCore::GPUCommandBuffer::blitEncoder const): Added.
3534         * platform/graphics/gpu/GPURenderPassDescriptor.h: 
3535         * platform/graphics/gpu/GPUTexture.h: Cache usage flags for reference.
3536         (WebCore::GPUTexture::isTransferSrc const): Added.
3537         (WebCore::GPUTexture::isTransferDst const): Added.
3538         (WebCore::GPUTexture::isOutputAttachment const): Added.
3539         * platform/graphics/gpu/GPUTextureUsage.h: Refactor to match GPUBufferUsage.h.
3540         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3541         (WebCore::GPUBuffer::validateBufferUsage): Renamed from validateBufferCreate, refactored for OptionSet.
3542         (WebCore::GPUBuffer::tryCreate):
3543         (WebCore::GPUBuffer::GPUBuffer):
3544         (WebCore::GPUBuffer::isReadOnly const):
3545         (WebCore::GPUBuffer::setSubData): Add alignment check according to Metal docs.
3546         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: 
3547         (WebCore::GPUCommandBuffer::create): No need to use this alias here.
3548         (WebCore::GPUCommandBuffer::GPUCommandBuffer): Ditto.
3549         (WebCore::GPUCommandBuffer::copyBufferToBuffer): Added.
3550         (WebCore::GPUCommandBuffer::copyBufferToTexture): Added.
3551         (WebCore::GPUCommandBuffer::copyTextureToBuffer): Added. 
3552         (WebCore::GPUCommandBuffer::copyTextureToTexture): Added. 
3553         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
3554         (WebCore::GPUQueue::submit): End encoding on the MTLCommandBuffer's blitCommandEncoder if it was used.
3555         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
3556         (WebCore::GPUSwapChain::getNextTexture): Now provide usage flags to texture creation.
3557         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
3558         (WebCore::mtlTextureUsageForGPUTextureUsageFlags): Refactor validation.
3559         (WebCore::tryCreateMtlTextureDescriptor): Ditto.
3560         (WebCore::GPUTexture::tryCreate): Now provide usage flags to texture creation.
3561         (WebCore::GPUTexture::create): Ditto.
3562         (WebCore::GPUTexture::GPUTexture): Ditto.
3563         (WebCore::GPUTexture::createDefaultTextureView): Ditto.
3564
3565 2019-03-04  Zalan Bujtas  <zalan@apple.com>
3566
3567         [ContentChangeObserver] Introduce fixed duration content observation
3568         https://bugs.webkit.org/show_bug.cgi?id=195295
3569         <rdar://problem/48579913>
3570
3571         Reviewed by Simon Fraser.
3572
3573         Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
3574         This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
3575         we stop observing for content changes before they even get fired.
3576
3577         Test: fast/events/touch/ios/visibility-change-happens-on-timer-hops.html
3578
3579         * page/ios/ContentChangeObserver.cpp:
3580         (WebCore::ContentChangeObserver::ContentChangeObserver):
3581         (WebCore::ContentChangeObserver::startContentObservationForDuration):
3582         (WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
3583         (WebCore::ContentChangeObserver::hasDeterminateState const):
3584         (WebCore::ContentChangeObserver::adjustObservedState):
3585         * page/ios/ContentChangeObserver.h:
3586         (WebCore::ContentChangeObserver::isObservingContentChanges const):
3587         (WebCore::ContentChangeObserver::hasPendingActivity const):
3588
3589 2019-03-04  Wenson Hsieh  <wenson_hsieh@apple.com>
3590
3591         Native text selection UI is incorrectly suppressed in Microsoft Visio
3592         https://bugs.webkit.org/show_bug.cgi?id=195178
3593         <rdar://problem/48519394>
3594
3595         Reviewed by Darin Adler.
3596
3597         Currently, our heuristics for detecting hidden editable areas attempt to search for empty parent renderers with
3598         "overflow: hidden". It does this by ascending the layer tree in search of renderers that have an empty content
3599         size, and whose renderers' styles indicate that they have overflow: hidden in the X or Y directions. This fails
3600         in the case where a child renderer is positioned out of flow, relative to one of its parent layers, since the
3601         child will be visible, but we'll incorrectly believe that it is hidden. This leads to selection UI unexpectedly
3602         disappearing in the online version of Microsoft Visio.
3603
3604         To fix this, we check whether the enclosing layer around the editable element has an empty clip rect; if the
3605         element is inside of a subframe, we additionally walk up to each enclosing frame's layer and check if that
3606         frame's layer has an empty clip rect.
3607
3608         Test: editing/selection/ios/do-not-hide-selection-in-visible-container.html
3609
3610         * rendering/RenderObject.cpp:
3611         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
3612
3613 2019-03-01  Ryosuke Niwa  <rniwa@webkit.org>
3614
3615         gPictureOwnerMap is unnecessary
3616         https://bugs.webkit.org/show_bug.cgi?id=195228
3617
3618         Reviewed by Zalan Bujtas.
3619
3620         Just store in HTMLImageElement. An extra pointer isn't going to affect the memory use here.
3621         If anything, we should worry about m_editableImage and m_pendingClonedAttachmentID instead.
3622
3623         * html/HTMLImageElement.cpp:
3624         (WebCore::HTMLImageElement::pictureElement const):
3625         (WebCore::HTMLImageElement::setPictureElement):
3626         * html/HTMLImageElement.h:
3627
3628 2019-03-04  Daniel Bates  <dabates@apple.com>
3629
3630         [iOS] Caret x-position in empty text area does not match text field
3631         https://bugs.webkit.org/show_bug.cgi?id=195125
3632         <rdar://problem/47161070>
3633
3634         Remove the word "use" in the added comment to make it read well.
3635
3636         * css/html.css:
3637         (textarea):
3638
3639 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
3640
3641         ITMLKit Inspector: Data Bindings / Associated Data for nodes
3642         https://bugs.webkit.org/show_bug.cgi?id=195290
3643         <rdar://problem/48304019>
3644
3645         Reviewed by Devin Rousso.
3646
3647         * inspector/agents/InspectorDOMAgent.h:
3648         * inspector/agents/InspectorDOMAgent.cpp:
3649         (WebCore::InspectorDOMAgent::getDataBindingsForNode):
3650         (WebCore::InspectorDOMAgent::getAssociatedDataForNode):
3651         Stub these for web pages, they will only be used for ITMLKit right now.
3652
3653 2019-03-04  Daniel Bates  <dabates@apple.com>
3654
3655         [iOS] Caret x-position in empty text area does not match text field
3656         https://bugs.webkit.org/show_bug.cgi?id=195125
3657         <rdar://problem/47161070>
3658
3659         Reviewed by Darin Adler.
3660
3661         Fix up User Agent styles for <textarea> on iOS such that they have the same left padding
3662         width and same text-indent as <input type="text">. This makes the x-position of the caret
3663         in an empty textarea match the position of the caret in an empty text field.
3664
3665         Test: fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html
3666
3667         * css/html.css:
3668         (textarea): For iOS Family, do not use the padding shorthand property. Instead explicitly specify
3669         padding-top and padding-bottom to be 2px to keep our current behavior (because it looks reasonable)
3670         and do not specify left and right padding so that we inherit the padding set earlier in this file.
3671         (textarea::placeholder): Deleted. This was added to "try" to make fix up the position of the placeholder
3672         text so as to match the position of the textarea's inner text and the position of a text field's inner
3673         text. This fix up may have worked out visually when it was added, but based on the discovery of the
3674         hardcoded 3px left and right padding (see below remark) it looks like it was always one pixel too short.
3675         * html/HTMLTextAreaElement.cpp:
3676         (WebCore::HTMLTextAreaElement::createInnerTextStyle): Remove hardcoded 3px left and right padding.
3677
3678 2019-03-04  Youenn Fablet  <youenn@apple.com>
3679
3680         Make sure to correctly notify of end of a ServiceWorkerJob when the context is stopped
3681         https://bugs.webkit.org/show_bug.cgi?id=195195
3682
3683         Reviewed by Chris Dumez.
3684
3685         Before the patch, we were notifying that some jobs were finished too aggressively at context stop time.
3686         This was confusing the Network Process.
3687         Only notify such jobs that have pending loads.
3688         Improve the tracking of jobs doing registration resolution to ensure the Network Process gets notified
3689         in case of a registration promise being resolved but the settling callback being not yet called while the context is stopped.
3690
3691         Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.
3692
3693         * workers/service/ServiceWorkerContainer.cpp:
3694         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3695         (WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
3696         (WebCore::ServiceWorkerContainer::stop):
3697         * workers/service/ServiceWorkerContainer.h:
3698         * workers/service/ServiceWorkerJob.cpp:
3699         (WebCore::ServiceWorkerJob::cancelPendingLoad):
3700         * workers/service/ServiceWorkerJob.h:
3701         (WebCore::ServiceWorkerJob::isLoading const):
3702
3703 2019-03-04  Chris Dumez  <cdumez@apple.com>
3704
3705         [iOS] Improve our file picker
3706         https://bugs.webkit.org/show_bug.cgi?id=195284
3707         <rdar://problem/45655856>
3708
3709         Reviewed by Tim Horton and Wenson Hsieh.
3710
3711         Export UTIUtilities.h so that it can be used from WebKit2.
3712
3713         * WebCore.xcodeproj/project.pbxproj:
3714
3715 2019-03-04  Zalan Bujtas  <zalan@apple.com>
3716
3717         [ContentChangeObserver] Decouple mouseMoved event and the "is observing content change" status.
3718         https://bugs.webkit.org/show_bug.cgi?id=195286
3719
3720         Reviewed by Simon Fraser.
3721
3722         Now isObservingContentChanges returns true only when we are actively observing content change during timer firing and/or style recalculating.
3723         This patch also renames a couple of functions to follow the didStart/didFinish pattern.
3724
3725         * page/ios/ContentChangeObserver.cpp:
3726         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
3727         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
3728         (WebCore::ContentChangeObserver::styleRecalcDidStart):
3729         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
3730         (WebCore::ContentChangeObserver::mouseMovedDidStart):
3731         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
3732         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
3733         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
3734         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
3735         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
3736         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
3737         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
3738         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
3739         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
3740         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute): Deleted.
3741         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute): Deleted.
3742         (WebCore::ContentChangeObserver::startObservingStyleRecalc): Deleted.
3743         (WebCore::ContentChangeObserver::stopObservingStyleRecalc): Deleted.
3744         (WebCore::ContentChangeObserver::startObservingMouseMoved): Deleted.
3745         (WebCore::ContentChangeObserver::stopObservingMouseMoved): Deleted.
3746         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
3747         * page/ios/ContentChangeObserver.h:
3748         (WebCore::ContentChangeObserver::setShouldObserveDOMTimerScheduling):
3749         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
3750         (WebCore::ContentChangeObserver::isObservingStyleRecalc const):
3751         (WebCore::ContentChangeObserver::isObservingContentChanges const):
3752         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
3753         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
3754         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const): Deleted.
3755
3756 2019-03-04  Yusuke Suzuki  <ysuzuki@apple.com>
3757
3758         [JSC] Offer @makeTypeError instead of exposing @TypeError
3759         https://bugs.webkit.org/show_bug.cgi?id=193858
3760
3761         Reviewed by Mark Lam.
3762
3763         Use @makeTypeError instead.
3764
3765         * Modules/mediastream/RTCPeerConnection.js:
3766         * Modules/mediastream/RTCPeerConnectionInternals.js:
3767         * Modules/streams/ReadableByteStreamInternals.js:
3768         (readableByteStreamControllerClose):
3769         (readableByteStreamControllerPullInto):
3770         * Modules/streams/ReadableStream.js:
3771         (cancel):
3772         (pipeTo):
3773         * Modules/streams/ReadableStreamBYOBReader.js:
3774         (cancel):
3775         (read):
3776         * Modules/streams/ReadableStreamDefaultReader.js:
3777         (cancel):
3778         (read):
3779         * Modules/streams/ReadableStreamInternals.js:
3780         (readableStreamReaderGenericRelease):
3781         * Modules/streams/WritableStream.js:
3782         (abort):
3783         (close):
3784         (write):
3785         (getter.closed):
3786         (getter.ready):
3787
3788 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
3789
3790         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
3791         https://bugs.webkit.org/show_bug.cgi?id=195258
3792
3793         Reviewed by Antti Koivisto.
3794
3795         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
3796         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
3797         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
3798         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
3799
3800         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
3801         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
3802         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
3803         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
3804         references to GraphicsLayers before that becomes safe).
3805         
3806         The actual fix that allows overflow scrollbars to show is the change in
3807         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
3808         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
3809
3810         * SourcesCocoa.txt:
3811         * WebCore.xcodeproj/project.pbxproj:
3812         * page/scrolling/AsyncScrollingCoordinator.cpp:
3813         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
3814         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
3815         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
3816         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
3817         * page/scrolling/ScrollingCoordinator.h:
3818         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3819         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3820         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
3821         (WebCore::ScrollingStateFrameScrollingNode::setVerticalScrollbarLayer): Deleted.
3822         (WebCore::ScrollingStateFrameScrollingNode::setHorizontalScrollbarLayer): Deleted.
3823         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars): Deleted.
3824         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3825         * page/scrolling/ScrollingStateScrollingNode.cpp:
3826         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
3827         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
3828         (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer):
3829         (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer):
3830         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
3831         * page/scrolling/ScrollingStateScrollingNode.h:
3832         (WebCore::ScrollingStateScrollingNode::horizontalScrollbarLayer const):
3833         (WebCore::ScrollingStateScrollingNode::verticalScrollbarLayer const):
3834         (WebCore::ScrollingStateScrollingNode::verticalScrollerImp const):
3835         (WebCore::ScrollingStateScrollingNode::horizontalScrollerImp const):
3836         * page/scrolling/ScrollingTree.cpp:
3837         (WebCore::ScrollingTree::setOrClearLatchedNode):
3838         (WebCore::ScrollingTree::handleWheelEvent):
3839         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
3840         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
3841         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3842         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3843         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
3844         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
3845         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
3846         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): Deleted.
3847         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread): Deleted.
3848         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
3849         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3850         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
3851         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
3852         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionRelatedLayers):
3853         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
3854         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3855         (WebCore::ScrollingTreeScrollingNodeDelegateMac::~ScrollingTreeScrollingNodeDelegateMac):
3856         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
3857         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
3858         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters):
3859         (WebCore::ScrollingTreeScrollingNodeDelegateMac::releaseReferencesToScrollerImpsOnTheMainThread):
3860         * platform/ScrollbarThemeComposite.h:
3861         * rendering/RenderLayerCompositor.cpp:
3862         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
3863         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
3864         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
3865         * rendering/RenderLayerCompositor.h:
3866
3867 2019-03-04  Jer Noble  <jer.noble@apple.com>
3868
3869         Remove HEVC as a codec requiring hardware support.
3870         https://bugs.webkit.org/show_bug.cgi?id=194960
3871         <rdar://problem/47741432>
3872
3873         Reviewed by Eric Carlson.
3874
3875         * page/cocoa/SettingsBaseCocoa.mm:
3876         (WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport):
3877
3878 2019-03-04  Jer Noble  <jer.noble@apple.com>
3879
3880         [iOS] Fullscreen "stay in page" option breaks video playback
3881         https://bugs.webkit.org/show_bug.cgi?id=195277
3882         <rdar://problem/48537317>
3883
3884         Reviewed by Eric Carlson.
3885
3886         Add a LOG entry when playback is rejected due to media playback suspension.
3887
3888         * html/MediaElementSession.cpp:
3889         (WebCore::MediaElementSession::playbackPermitted const):
3890
3891 2019-03-04  Tim Horton  <timothy_horton@apple.com>
3892
3893         Fix the build.
3894
3895         * dom/Document.h:
3896
3897 2019-03-03  Zalan Bujtas  <zalan@apple.com>
3898
3899         [ContentChangeObserver] Content observation should be limited to the current document.
3900         https://bugs.webkit.org/show_bug.cgi?id=195256
3901         <rdar://problem/48544402>
3902
3903         Move ContentChangeObserver from Page to Document.
3904         It limits content observation to the target node's owner document.
3905
3906         Reviewed by Simon Fraser.
3907
3908         * dom/Document.cpp:
3909         (WebCore::m_contentChangeObserver):
3910         (WebCore::Document::updateStyleIfNeeded):
3911         (WebCore::Document::willDetachPage):
3912         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
3913         (WebCore::m_undoManager): Deleted.
3914         * dom/Document.h:
3915         (WebCore::Document::contentChangeObserver):
3916         * page/DOMTimer.cpp:
3917         (WebCore::DOMTimer::install):
3918         (WebCore::DOMTimer::removeById):
3919         (WebCore::DOMTimer::fired):
3920         * page/Frame.cpp:
3921         (WebCore::Frame::willDetachPage):
3922         * page/Page.cpp:
3923         (WebCore::Page::Page):
3924         * page/Page.h:
3925         (WebCore::Page::pointerLockController const):
3926         (WebCore::Page::contentChangeObserver): Deleted.
3927         * page/ios/ContentChangeObserver.cpp:
3928         (WebCore::ContentChangeObserver::ContentChangeObserver):
3929         (WebCore::ContentChangeObserver::didInstallDOMTimer):
3930         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
3931         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
3932         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
3933         (WebCore::ContentChangeObserver::startObservingMouseMoved):
3934         (WebCore::ContentChangeObserver::hasDeterminateState const):
3935         (WebCore::ContentChangeObserver::adjustObservedState):
3936         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded):
3937         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
3938         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
3939         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
3940         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
3941         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
3942         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
3943         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
3944         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
3945         (WebCore::hasPendingStyleRecalc): Deleted.
3946</