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