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