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