Implement asynchronous frame scrolling for iOS
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-18  Antti Koivisto  <antti@apple.com>
2
3         Implement asynchronous frame scrolling for iOS
4         https://bugs.webkit.org/show_bug.cgi?id=193539
5         <rdar://problem/47379873>
6
7         Reviewed by Simon Fraser.
8
9         This patch implements UIScrollView based frame scrolling on iOS, enabled by the "Async Frame Scrolling"
10         internal setting (still off by default).
11
12         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
13         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
14         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
15         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
16
17         Export ScrollingTreeFrameScrollingNodeIOS.
18
19         * rendering/RenderLayerCompositor.cpp:
20         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
21         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
22         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
23
24         If we don't have a separate clip layer, just resize and position the scroll layer.
25
26         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
27         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
28         (WebCore::RenderLayerCompositor::ensureRootLayer):
29
30         Use GraphicsLayer::Type::Scrolling as the scroll layer type when async frame scrolling is enabled.
31         Don't create a separate clip layer since the scroll layer will handle clipping.
32
33         * rendering/RenderLayerCompositor.h:
34
35 2019-01-18  Ali Juma  <ajuma@chromium.org>
36
37         FetchResponse::url should return the empty string for tainted responses
38         https://bugs.webkit.org/show_bug.cgi?id=193553
39
40         Reviewed by Youenn Fablet.
41
42         Check whether the response is tainted in FetchResponse::url, to match
43         the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.
44
45         * Modules/fetch/FetchResponse.cpp:
46         (WebCore::FetchResponse::url const):
47
48 2019-01-18  Youenn Fablet  <youenn@apple.com>
49
50         A track source should be unmuted whenever reenabled after setDirection changes
51         https://bugs.webkit.org/show_bug.cgi?id=193554
52         <rdar://problem/47366196>
53
54         Reviewed by Eric Carlson.
55
56         Ensure that track gets unmuted after being fired as part of track event.
57         Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC.
58         Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track,
59         some enqueued samples might not be from the right active video track or there might be no active video track.
60
61         Test: webrtc/video-setDirection.html
62
63         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
64         (WebCore::LibWebRTCMediaEndpoint::fireTrackEvent):
65         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
66         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
67         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
68         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
69
70 2019-01-18  Charlie Turner  <cturner@igalia.com>
71
72         [GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via bus messages
73         https://bugs.webkit.org/show_bug.cgi?id=192229
74
75         Reviewed by Xabier Rodriguez-Calvar.
76
77         Covered by existing tests.
78
79         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
80         (WebCore::parseLicenseFormat): There is a defect in some C++11
81         compiles where they will copy this return value since the type
82         doesn't exactly match. Force a move with WTFMove.
83         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
84         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
85         Deleted. No longer used by anything.
86         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto.
87         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
88         Rename these methods to avoid "namespacing names".
89         (webkit_media_clear_key_decrypt_class_init):
90         (finalize):
91         (handleKeyResponse): This is a temporary fix, we need some more
92         reorganisation to be full driven by CDMInstance APIs for decryption.
93         (findAndSetKey):
94         (decrypt):
95         (webKitMediaClearKeyDecryptorFinalize): Deleted.
96         (webKitMediaClearKeyDecryptorHandleKeyResponse): Deleted.
97         (webKitMediaClearKeyDecryptorFindAndSetKey): Deleted.
98         (webKitMediaClearKeyDecryptorDecrypt): Deleted.
99         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Ditto.
100         (webkit_media_common_encryption_decrypt_class_init):
101         (finalize):
102         (transformCaps):
103         (transformInPlace):
104         (isCDMInstanceAvailable):
105         (sinkEventHandler):
106         (queryHandler):
107         (changeState):
108         (setContext):
109         (webKitMediaCommonEncryptionDecryptorFinalize): Deleted.
110         (webkitMediaCommonEncryptionDecryptTransformCaps): Deleted.
111         (webkitMediaCommonEncryptionDecryptTransformInPlace): Deleted.
112         (webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): Deleted.
113         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Deleted.
114         (webkitMediaCommonEncryptionDecryptorQueryHandler): Deleted.
115         (webKitMediaCommonEncryptionDecryptorChangeState): Deleted.
116         (webKitMediaCommonEncryptionDecryptorSetContext): Deleted.
117         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
118         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
119         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
120         Deleted. No longer passing key information over bus messages.
121         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
122
123 2019-01-18  Zalan Bujtas  <zalan@apple.com>
124
125         [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
126         https://bugs.webkit.org/show_bug.cgi?id=193564
127
128         Reviewed by Antti Koivisto.
129
130         Float boxes prevent collapsing through.
131
132         Test: fast/block/float/float-in-descendant-formatting-context.html
133
134         * layout/blockformatting/BlockMarginCollapse.cpp:
135         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
136
137 2019-01-18  Zalan Bujtas  <zalan@apple.com>
138
139         [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom.
140         https://bugs.webkit.org/show_bug.cgi?id=193562
141
142         Reviewed by Antti Koivisto.
143
144         The current floating context's (float) boxes could belong to descendant formatting contexts.
145         We need to include them as well when computing height (bottom) (we essentially need to skip ancestor floats only).
146
147         <div id=container style="overflow: hidden"><div>foo<div style="float: left">bar</div></div></div>
148         While computing the height for "container", the float box needs to be taken into account even though
149         it is part of another (descendant) formatting context (the inline formatting context established by its parent div).
150
151         * layout/floats/FloatingState.cpp:
152         (WebCore::Layout::FloatingState::bottom const):
153         * layout/floats/FloatingState.h:
154         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
155         (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): Deleted.
156
157 2019-01-18  Zalan Bujtas  <zalan@apple.com>
158
159         [LFC][BFC] Check for inflow children while computing height for block formatting context roots.
160         https://bugs.webkit.org/show_bug.cgi?id=193555
161
162         Reviewed by Antti Koivisto.
163
164         This patch also extends areEssentiallyEqual to 0.125px to be able to match (essentially equal) inline runs. 
165
166         * layout/FormattingContextGeometry.cpp:
167         (WebCore::Layout::contentHeightForFormattingContextRoot):
168         * layout/Verification.cpp:
169         (WebCore::Layout::areEssentiallyEqual):
170         * page/FrameViewLayoutContext.cpp:
171         (WebCore::layoutUsingFormattingContext):
172
173 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
174
175         [WebAudio] Release the AudioDestination when uninitializing DefaultAudioDestinationNode
176         https://bugs.webkit.org/show_bug.cgi?id=192590
177
178         Reviewed by Philippe Normand.
179
180         When we uninitialize DefaultAudioDestinationNode, the AudioDestination is stopped but not destroyed.
181
182         On some platforms the resources are allocated and released with the AudioDestination, thus when we uninitialize
183         DefaultAudioDestinationNode we don't release resources because the AudioDestination is not destroyed.
184
185         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
186         (WebCore::DefaultAudioDestinationNode::uninitialize):
187
188 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
189
190         [WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
191         https://bugs.webkit.org/show_bug.cgi?id=192586
192
193         Reviewed by Philippe Normand.
194
195         When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
196         the AudioDestinationNode is not destroyed.
197
198         In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
199         is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
200         the resources leak.
201
202         AudioContext::uninitialize() is not called immediately since r94608.
203         This modification can now be reverted without regression in WebAudio tests.
204
205         Test: webaudio/mediaelementaudiosourcenode-gc.html
206
207         * Modules/webaudio/AudioContext.cpp:
208         (WebCore::AudioContext::stop):
209
210 2019-01-18  Simon Fraser  <simon.fraser@apple.com>
211
212         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed
213         https://bugs.webkit.org/show_bug.cgi?id=193559
214
215         Reviewed by Antti Koivisto.
216
217         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() existed for CoordinatedGraphics,
218         but the code that used it was removed in webkit.org/r229318 so we can remove it and
219         code that calls it.
220
221         * page/scrolling/ScrollingCoordinator.h:
222         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
223         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange): Deleted.
224         * rendering/RenderLayerBacking.cpp:
225         (WebCore::RenderLayerBacking::updateGeometry):
226         * rendering/RenderLayerCompositor.cpp:
227         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
228         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
229         (WebCore::RenderLayerCompositor::scrollingLayerDidChange): Deleted.
230         * rendering/RenderLayerCompositor.h:
231
232 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
233
234         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
235         https://bugs.webkit.org/show_bug.cgi?id=193494
236         <rdar://problem/46859627>
237
238         Reviewed by Simon Fraser and Tim Horton.
239
240         When computing the content offset to scroll to when revealing a given rect in content coordinates, we currently
241         just use the unobscured content rect. As a result, when scrolling to reveal a rect, we'll clamp the final scroll
242         position such that only content is visible. For example, when asked to reveal the rect `(0, 0, 1, 1)`, we adjust
243         the scroll position to be the origin.
244
245         However, consider the case where a client (e.g. Mail on iOS) has added a content inset to the web view's scroll
246         view. If we're asked to reveal a rect that is outside the content area but within a content inset, we will still
247         end up clamping the scroll position to the unobscured rect. This manifests in a bug where selecting text and
248         autoscrolling in iOS Mail compose while the scroll view is scrolled all the way to the top to reveal the To/Cc/
249         Subject fields causes the content offset to jump to the origin, rather than staying at (0, -topContentInset).
250
251         To fix this, we teach `RenderLayer::scrollRectToVisible` about content insets that are visible. Rather than use
252         the content rects as-is, expand to encompass visible content insets as well. This ensures that revealing a
253         position which is already visible won't cause us to scroll away the content inset area and only show the
254         unobscured rect.
255
256         Tests:  editing/selection/ios/autoscroll-with-top-content-inset.html
257                 fast/scrolling/ios/scroll-into-view-with-top-content-inset.html
258
259         * page/FrameView.cpp:
260         (WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
261
262         Introduce a helper method that expands the unobscured content rect to include surrounding content insets.
263
264         * page/FrameView.h:
265         * page/Page.h:
266         (WebCore::Page::contentInsets const):
267         (WebCore::Page::setContentInsets):
268         * rendering/RenderLayer.cpp:
269         (WebCore::RenderLayer::scrollRectToVisible):
270         (WebCore::RenderLayer::getRectToExpose const):
271
272 2019-01-17  Truitt Savell  <tsavell@apple.com>
273
274         Unreviewed, rolling out r240124.
275
276         This commit broke an internal build.
277
278         Reverted changeset:
279
280         "SDK_VARIANT build destinations should be separate from non-
281         SDK_VARIANT builds"
282         https://bugs.webkit.org/show_bug.cgi?id=189553
283         https://trac.webkit.org/changeset/240124
284
285 2019-01-17  Devin Rousso  <drousso@apple.com>
286
287         Web Inspector: fix Xcode project file list after r239976
288         https://bugs.webkit.org/show_bug.cgi?id=193474
289
290         Reviewed by Timothy Hatcher.
291
292         * WebCore.xcodeproj/project.pbxproj:
293
294 2019-01-17  Ross Kirsling  <ross.kirsling@sony.com>
295
296         Unreviewed WinCairo fix -- hundreds of tests crash after r240031.
297
298         * platform/network/curl/ResourceHandleCurl.cpp:
299         (WebCore::ResourceHandle::createCurlRequest):
300         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
301         (WebCore::ResourceHandle::receivedCredential):
302         (WebCore::ResourceHandle::getCredential):
303
304 2019-01-17  John Wilander  <wilander@apple.com>
305
306         Add infrastructure to enable/disable ITP Debug Mode through Preferences
307         https://bugs.webkit.org/show_bug.cgi?id=193510
308         <rdar://problem/47330969>
309
310         Reviewed by Dean Jackson.
311
312         No new tests. These changes are purely for settings/preferences.
313
314         * page/RuntimeEnabledFeatures.h:
315         (WebCore::RuntimeEnabledFeatures::setItpDebugModeEnabled):
316         (WebCore::RuntimeEnabledFeatures::itpDebugModeEnabled const):
317         (WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode): Deleted.
318         (WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const): Deleted.
319             Renamed.
320         * page/Settings.yaml:
321             Removed since this particular setting should not be persisted for privacy
322             reasons.
323
324 2019-01-17  Jer Noble  <jer.noble@apple.com>
325
326         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
327         https://bugs.webkit.org/show_bug.cgi?id=189553
328
329         Reviewed by Tim Horton.
330
331         * Configurations/Base.xcconfig:
332         * Configurations/SDKVariant.xcconfig: Added.
333         * Configurations/WebCore.xcconfig:
334
335 2019-01-17  Jer Noble  <jer.noble@apple.com>
336
337         MediaPlayerPrivateAVFoundationObjC can return incorrect paused information
338         https://bugs.webkit.org/show_bug.cgi?id=193499
339
340         Reviewed by Eric Carlson.
341
342         MediaPlayerPrivateAVFoundation uses rate() as an indicator of whether the player
343         is paused or not. This is incorrect when playback is stalled waiting for more data.
344         For MPPAVFObjC, use the timeControlStatus as a more accurate indicator of whether
345         the player is playing.
346
347         Now that we have correct play state information, we can remove the handlePlaybackCommand()
348         path when playing remotely for a more direct approach of notifying the HTMLMediaElement
349         that the play state has changed.
350
351         Drive-by fix: Before throwing away the AVPlayer, clear its output context. This keeps
352         remote devices from keeping the AVPlayer alive.
353
354         Drive-by fix #2: The NullMediaPlayer should always return "true" for paused(), not "false",
355         since it can't possibly play anything.
356
357         * platform/graphics/MediaPlayer.cpp:
358         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
359         (WebCore::MediaPlayerPrivateAVFoundation::paused const):
360         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
361         (WebCore::MediaPlayerPrivateAVFoundation::platformPaused const):
362         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
363         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
364         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
365         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPaused const):
366         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
367
368 2019-01-17  Jiewen Tan  <jiewen_tan@apple.com>
369
370         [Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable
371         https://bugs.webkit.org/show_bug.cgi?id=193478
372         <rdar://problem/34368591>
373
374         Reviewed by Brent Fulgham.
375
376         By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention
377         as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This
378         is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only
379         website that assumes submit buttons are focusable, and will prohibit users from completing immigration
380         forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to
381         HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable.
382
383         This quirk is for ceac.state.gov specifically, and therefore no tests.
384
385         * html/HTMLFormControlElement.cpp:
386         (WebCore::HTMLFormControlElement::isMouseFocusable const):
387         (WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const):
388         * html/HTMLFormControlElement.h:
389
390 2019-01-17  Alex Christensen  <achristensen@webkit.org>
391
392         Fix WinCairo build after r240117
393         https://bugs.webkit.org/show_bug.cgi?id=193529
394
395         * PlatformWin.cmake:
396         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
397
398 2019-01-17  Youenn Fablet  <youenn@apple.com>
399
400         Add release logging for incoming and outgoing webrtc audio tracks
401         https://bugs.webkit.org/show_bug.cgi?id=185545
402
403         Reviewed by Eric Carlson.
404
405         Add logging of audio tracks. When doing a WebRTC call,
406         one log line is added each second for each audio track.
407         Validated that logging is done through manual testing.
408
409         Refactored code to use LogHelper and apply it to video sources as well.
410
411         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
412         (WebCore::LibWebRTCMediaEndpoint::addTrack):
413         (WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
414         (WebCore::sourceFromNewReceiver): Deleted.
415         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
416         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
417         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
418         (WebCore::RealtimeIncomingAudioSource::logChannel const):
419         (WebCore::RealtimeIncomingAudioSource::logger const):
420         * platform/mediastream/RealtimeIncomingAudioSource.h:
421         (WebCore::RealtimeIncomingAudioSource::setLogger):
422         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
423         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
424         (WebCore::RealtimeIncomingVideoSource::logChannel const):
425         (WebCore::RealtimeIncomingVideoSource::logger const):
426         * platform/mediastream/RealtimeIncomingVideoSource.h:
427         (WebCore::RealtimeIncomingVideoSource::setLogger):
428         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
429         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
430         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
431         (WebCore::RealtimeOutgoingAudioSource::logChannel const):
432         (WebCore::RealtimeOutgoingAudioSource::logger const):
433         * platform/mediastream/RealtimeOutgoingAudioSource.h:
434         (WebCore::RealtimeOutgoingAudioSource::setLogger):
435         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
436         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
437         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
438         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
439         (WebCore::RealtimeOutgoingVideoSource::logChannel const):
440         (WebCore::RealtimeOutgoingVideoSource::logger const):
441         * platform/mediastream/RealtimeOutgoingVideoSource.h:
442         (WebCore::RealtimeOutgoingVideoSource::setLogger):
443         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
444         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
445         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h:
446         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
447         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
448         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
449         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
450         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
451         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
452         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
453         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
454         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
455
456 2019-01-17  Alex Christensen  <achristensen@webkit.org>
457
458         Stop using NetworkStorageSession::storageSession in WebCore
459         https://bugs.webkit.org/show_bug.cgi?id=193529
460
461         Reviewed by Tim Horton.
462
463         Ownership of the map that NetworkStorageSession::storageSession searches needs to move to the WebKit/WebKitLegacy layer,
464         so when WebCore used to look in this map it needs to call a client function to ask the layer above it for the storage object.
465         I've called this client StorageSessionProvider::storageSession.  Right now it just looks in NetworkStorageSession::storageSession,
466         but this added abstraction makes it possible to move the currently process-global map to be a member of the NetworkProcess object.
467
468         * Modules/websockets/WebSocketChannel.cpp:
469         (WebCore::WebSocketChannel::connect):
470         * WebCore.xcodeproj/project.pbxproj:
471         * loader/CookieJar.cpp:
472         (WebCore::CookieJar::create):
473         (WebCore::CookieJar::CookieJar):
474         (WebCore::CookieJar::cookies const):
475         (WebCore::CookieJar::setCookies):
476         (WebCore::CookieJar::cookiesEnabled const):
477         (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
478         (WebCore::CookieJar::getRawCookies const):
479         (WebCore::CookieJar::deleteCookie):
480         * loader/CookieJar.h:
481         * loader/EmptyClients.cpp:
482         (WebCore::pageConfigurationWithEmptyClients):
483         * page/Page.h:
484         * page/SocketProvider.cpp:
485         (WebCore::SocketProvider::createSocketStreamHandle):
486         * page/SocketProvider.h:
487         * platform/network/NetworkingContext.h:
488         * platform/network/SocketStreamHandleImpl.cpp:
489         (WebCore::cookieDataForHandshake):
490         (WebCore::SocketStreamHandleImpl::platformSendHandshake):
491         * platform/network/StorageSessionProvider.h: Added.
492         (WebCore::StorageSessionProvider::~StorageSessionProvider):
493         * platform/network/cf/SocketStreamHandleImpl.h:
494         (WebCore::SocketStreamHandleImpl::create):
495         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
496         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
497         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
498         * platform/network/curl/SocketStreamHandleImpl.h:
499         (WebCore::SocketStreamHandleImpl::create):
500         * platform/network/soup/SocketStreamHandleImpl.h:
501         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
502         (WebCore::SocketStreamHandleImpl::create):
503
504 2019-01-17  Jon Lee  <jonlee@apple.com>
505
506         [EME] Remove Amazon Prime Video from quirks list
507         https://bugs.webkit.org/show_bug.cgi?id=193514
508         rdar://problem/47295330
509
510         Reviewed by Jer Noble.
511
512         * page/Quirks.cpp:
513         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
514
515 2019-01-17  Zalan Bujtas  <zalan@apple.com>
516
517         [LFC][BFC] An element with transform is a containing block for positioned descendants.
518         https://bugs.webkit.org/show_bug.cgi?id=193534
519
520         Reviewed by Antti Koivisto.
521
522         "For elements whose layout is governed by the CSS box model, any value other than none for the transform
523         property also causes the element to establish a containing block for all descendants."
524         https://www.w3.org/TR/css-transforms-1/
525
526         * layout/layouttree/LayoutBox.cpp:
527         (WebCore::Layout::Box::containingBlock const):
528
529 2019-01-17  Simon Fraser  <simon.fraser@apple.com>
530
531         ScrollingCoordinator: separate updating node geometry from node layers
532         https://bugs.webkit.org/show_bug.cgi?id=193527
533
534         Reviewed by Antti Koivisto.
535
536         Updating scrolling tree node layers happens in a different code path from updating geometry;
537         the former has to be post-flush, when GraphicsLayer has made tiled or structural layers.
538         Geometry only needs to be updated after layout, and soon we'll do this via compositing updates.
539         
540         We can also clean up the ScrollingCoordinator API and have a single function that updates
541         node layers (handling different node types), and separate functions for pushing viewport-constrained
542         and scrolling node geometry.
543
544         No observable behavior change.
545
546         * page/scrolling/AsyncScrollingCoordinator.cpp:
547         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
548         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
549         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry):
550         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): Deleted.
551         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Deleted.
552         (WebCore::AsyncScrollingCoordinator::updateNodeLayer): Deleted.
553         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
554         * page/scrolling/AsyncScrollingCoordinator.h:
555         * page/scrolling/ScrollingCoordinator.h:
556         (WebCore::ScrollingCoordinator::setNodeLayers):
557         (WebCore::ScrollingCoordinator::setScrollingNodeGeometry):
558         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry):
559         (WebCore::ScrollingCoordinator::updateNodeLayer): Deleted.
560         (WebCore::ScrollingCoordinator::updateNodeViewportConstraints): Deleted.
561         (WebCore::ScrollingCoordinator::updateFrameScrollingNode): Deleted.
562         (WebCore::ScrollingCoordinator::updateOverflowScrollingNode): Deleted.
563         * rendering/RenderLayerCompositor.cpp:
564         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
565         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
566         * rendering/RenderLayerCompositor.h:
567
568 2019-01-17  Zalan Bujtas  <zalan@apple.com>
569
570         [LFC][BFC][Quirk] Take body padding and border into account when stretching height.
571         https://bugs.webkit.org/show_bug.cgi?id=193528
572
573         Reviewed by Antti Koivisto.
574
575         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
576         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
577         * layout/displaytree/DisplayBox.h:
578         (WebCore::Display::Box::verticalBorder const):
579         (WebCore::Display::Box::horizontalBorder const):
580         (WebCore::Display::Box::verticalPadding const):
581         (WebCore::Display::Box::horizontalPadding const):
582         * page/FrameViewLayoutContext.cpp:
583         (WebCore::layoutUsingFormattingContext):
584
585 2019-01-17  Zalan Bujtas  <zalan@apple.com>
586
587         [LFC][BFC] For height computation, the bottom edge of the last line box value should not include top border/padding
588         https://bugs.webkit.org/show_bug.cgi?id=193520
589
590         Reviewed by Antti Koivisto.
591
592         This is similar to the other "10.6.3" cases. The bottom edge of the last inline box is in the coordinate systyem
593         of the containing block's border box (and for content height computation it needs to be mapped to the containing block's content box instead).
594
595         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
596         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
597
598 2019-01-16  Simon Fraser  <simon.fraser@apple.com>
599
600         Stub out scrolling tree classes for overflow scrolling nodes on macOS
601         https://bugs.webkit.org/show_bug.cgi?id=193524
602
603         Reviewed by Antti Koivisto.
604
605         Add an empty implementation of ScrollingTreeOverflowScrollingNodeMac for macOS. Change
606         ScrollingTreeMac::createScrollingTreeNode() to create these nodes.
607         
608         Minor refactor of RenderLayerCompositor::useCoordinatedScrollingForLayer() code to ask
609         the scrolling coordinator if it can coordinate scrolling for this layer; no behavior
610         change for existing code paths.
611
612         * SourcesCocoa.txt:
613         * WebCore.xcodeproj/project.pbxproj:
614         * page/scrolling/ScrollingCoordinator.cpp:
615         (WebCore::ScrollingCoordinator::coordinatesScrollingForOverflowLayer const):
616         * page/scrolling/ScrollingCoordinator.h:
617         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
618         * page/scrolling/mac/ScrollingTreeMac.cpp:
619         (ScrollingTreeMac::createScrollingTreeNode):
620         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
621         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: Added.
622         (WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
623         (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
624         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac):
625         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
626         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
627         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
628         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
629         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
630         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll):
631         * rendering/RenderLayer.cpp:
632         (WebCore::RenderLayer::usesAsyncScrolling const):
633         * rendering/RenderLayerCompositor.cpp:
634         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
635         * rendering/RenderLayerCompositor.h:
636
637 2019-01-16  Justin Fan  <justin_fan@apple.com>
638
639         [WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
640         https://bugs.webkit.org/show_bug.cgi?id=193473
641
642         Reviewed by Dean Jackson and Myles Maxfield.
643
644         Also, switch to using the inputSlot instead of the shaderLocation field, as this seems more correct. 
645         As of now I cannot determine an analog for WebGPU's shaderLocation in Metal. 
646
647         Test: Covered by vertex-buffer-triangle-strip.html. No change in behavior.
648
649         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
650         (WebCore::setInputStateForPipelineDescriptor): Use the inputSlot instead of shaderLocation as bufferIndex. 
651
652 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
653
654         [WHLSL] Add the function stage checker
655         https://bugs.webkit.org/show_bug.cgi?id=193479
656
657         Reviewed by Dean Jackson and Robin Morisset.
658
659         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/CheckNativeFuncStages.mjs into C++.
660
661         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
662         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
663
664         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
665         (WebCore::WHLSL::AST::CallExpression::function):
666         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp: Added.
667         (WebCore::WHLSL::FunctionStageChecker::FunctionStageChecker):
668         (WebCore::WHLSL::checkFunctionStages):
669         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h: Added.
670         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
671         (WebCore::WHLSL::Intrinsics::add):
672         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
673         (WebCore::WHLSL::Intrinsics::ddx const):
674         (WebCore::WHLSL::Intrinsics::ddy const):
675         (WebCore::WHLSL::Intrinsics::allMemoryBarrier const):
676         (WebCore::WHLSL::Intrinsics::deviceMemoryBarrier const):
677         (WebCore::WHLSL::Intrinsics::groupMemoryBarrier const):
678         (WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
679         * Sources.txt:
680         * WebCore.xcodeproj/project.pbxproj:
681
682 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
683
684         [WHLSL] Delete the 'restricted' keyword
685         https://bugs.webkit.org/show_bug.cgi?id=193469
686
687         Reviewed by Dean Jackson and Robin Morisset.
688
689         This change mirrors https://github.com/gpuweb/WHLSL/pull/304 in the reference implementation.
690
691         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
692         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
693
694         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
695         (WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
696         (WebCore::WHLSL::AST::FunctionDefinition::block):
697         (WebCore::WHLSL::AST::FunctionDefinition::restricted const): Deleted.
698         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
699         (WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
700         (WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const): Deleted.
701         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
702         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
703         (WebCore::WHLSL::resolveWithOperatorLength):
704         (WebCore::WHLSL::resolveWithReferenceComparator):
705         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
706         (WebCore::WHLSL::resolveFunctionOverloadImpl):
707         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
708         (WebCore::WHLSL::synthesizeArrayOperatorLength):
709         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
710         (WebCore::WHLSL::synthesizeConstructors):
711         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
712         (WebCore::WHLSL::synthesizeEnumerationFunctions):
713         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
714         (WebCore::WHLSL::synthesizeStructureAccessors):
715
716 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
717
718         [WHLSL] Implement the recursion checker
719         https://bugs.webkit.org/show_bug.cgi?id=193436
720
721         Reviewed by Saam Barati.
722
723         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/RecursionChecker.mjs into C++.
724
725         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
726         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
727
728         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
729         (WebCore::WHLSL::AST::CallExpression::function):
730         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp.
731         (WebCore::WHLSL::checkRecursion):
732         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h: Added.
733         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
734         * Sources.txt:
735         * WebCore.xcodeproj/project.pbxproj:
736
737 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
738
739         [WHLSL] Add the literal type checker
740         https://bugs.webkit.org/show_bug.cgi?id=193430
741
742         Reviewed by Dean Jackson.
743
744         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LiteralTypeChecker.mjs into C++.
745
746         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
747         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
748
749         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
750         (WebCore::WHLSL::AST::FloatLiteralType::value const):
751         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
752         (WebCore::WHLSL::AST::IntegerLiteralType::value const):
753         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
754         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const):
755         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: Added.
756         (WebCore::WHLSL::getNativeTypeDeclaration):
757         (WebCore::WHLSL::LiteralTypeChecker::visit):
758         (WebCore::WHLSL::checkLiteralTypes):
759         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
760         * Sources.txt:
761         * WebCore.xcodeproj/project.pbxproj:
762
763 2019-01-16  Zalan Bujtas  <zalan@apple.com>
764
765         [LFC][BFC] Inflow non-replaced used width should not be negative.
766         https://bugs.webkit.org/show_bug.cgi?id=193495
767
768         Reviewed by Antti Koivisto.
769
770         min-width (initial value 0) enforces non-negative used width. 
771
772         * layout/blockformatting/BlockFormattingContext.cpp:
773         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
774
775 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
776
777         [WHLSL] Add a handwritten parser
778         https://bugs.webkit.org/show_bug.cgi?id=192355
779
780         Reviewed by Dean Jackson.
781
782         The parser is a mechanical representation of WHLSL's ANTLR grammar at
783         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4. The parser
784         uses Expected<> to return an appropriate Error string when parsing fails.
785
786         This patch doesn't include the AST nodes themselves - those are in
787         https://bugs.webkit.org/show_bug.cgi?id=192991. I split up the patch to
788         aid easier reviewing.
789
790         No new tests because the parser isn't hooked up yet.
791
792         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
793         (WebCore::WHLSL::Parser::Parser):
794         (WebCore::WHLSL::Parser::parse):
795         (WebCore::WHLSL::Parser::fail):
796         (WebCore::WHLSL::Parser::peek):
797         (WebCore::WHLSL::Parser::tryType):
798         (WebCore::WHLSL::Parser::tryTypes):
799         (WebCore::WHLSL::Parser::consumeType):
800         (WebCore::WHLSL::Parser::consumeTypes):
801         (WebCore::WHLSL::digitValue):
802         (WebCore::WHLSL::intLiteralToInt):
803         (WebCore::WHLSL::uintLiteralToUint):
804         (WebCore::WHLSL::floatLiteralToFloat):
805         (WebCore::WHLSL::Parser::consumeIntegralLiteral):
806         (WebCore::WHLSL::Parser::consumeNonNegativeIntegralLiteral):
807         (WebCore::WHLSL::recognizeSimpleUnsignedInteger):
808         (WebCore::WHLSL::Parser::parseConstantExpression):
809         (WebCore::WHLSL::Parser::parseTypeArgument):
810         (WebCore::WHLSL::Parser::parseTypeArguments):
811         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
812         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
813         (WebCore::WHLSL::Parser::parseAddressSpaceType):
814         (WebCore::WHLSL::Parser::parseNonAddressSpaceType):
815         (WebCore::WHLSL::Parser::parseType):
816         (WebCore::WHLSL::Parser::parseTypeDefinition):
817         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
818         (WebCore::WHLSL::Parser::parseResourceSemantic):
819         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
820         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
821         (WebCore::WHLSL::Parser::parseSemantic):
822         (WebCore::WHLSL::Parser::parseQualifiers):
823         (WebCore::WHLSL::Parser::parseStructureElement):
824         (WebCore::WHLSL::Parser::parseStructureDefinition):
825         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
826         (WebCore::WHLSL::Parser::parseEnumerationMember):
827         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
828         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
829         (WebCore::WHLSL::Parser::parseAttributeBlock):
830         (WebCore::WHLSL::Parser::parseParameter):
831         (WebCore::WHLSL::Parser::parseParameters):
832         (WebCore::WHLSL::Parser::parseFunctionDefinition):
833         (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration):
834         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
835         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
836         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
837         (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration):
838         (WebCore::WHLSL::Parser::parseBlock):
839         (WebCore::WHLSL::Parser::parseBlockBody):
840         (WebCore::WHLSL::Parser::parseIfStatement):
841         (WebCore::WHLSL::Parser::parseSwitchStatement):
842         (WebCore::WHLSL::Parser::parseSwitchCase):
843         (WebCore::WHLSL::Parser::parseForLoop):
844         (WebCore::WHLSL::Parser::parseWhileLoop):
845         (WebCore::WHLSL::Parser::parseDoWhileLoop):
846         (WebCore::WHLSL::Parser::parseVariableDeclaration):
847         (WebCore::WHLSL::Parser::parseVariableDeclarations):
848         (WebCore::WHLSL::Parser::parseStatement):
849         (WebCore::WHLSL::Parser::parseEffectfulExpression):
850         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
851         (WebCore::WHLSL::Parser::parseEffectfulPrefix):
852         (WebCore::WHLSL::Parser::parseEffectfulSuffix):
853         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
854         (WebCore::WHLSL::Parser::parseSuffixOperator):
855         (WebCore::WHLSL::Parser::parseExpression):
856         (WebCore::WHLSL::Parser::parseTernaryConditional):
857         (WebCore::WHLSL::Parser::parseAssignment):
858         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
859         (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
860         (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
861         (WebCore::WHLSL::Parser::parsePossibleShift):
862         (WebCore::WHLSL::Parser::parsePossibleAdd):
863         (WebCore::WHLSL::Parser::parsePossibleMultiply):
864         (WebCore::WHLSL::Parser::parsePossiblePrefix):
865         (WebCore::WHLSL::Parser::parsePossibleSuffix):
866         (WebCore::WHLSL::Parser::parseCallExpression):
867         (WebCore::WHLSL::Parser::parseTerm):
868         * Modules/webgpu/WHLSL/WHLSLParser.h:
869         (WebCore::WHLSL::Parser::Error::Error):
870         (WebCore::WHLSL::Parser::backtrackingScope):
871         (WebCore::WHLSL::Parser::SuffixExpression::SuffixExpression):
872         (WebCore::WHLSL::Parser::SuffixExpression::operator bool const):
873
874 2019-01-16  Sihui Liu  <sihui_liu@apple.com>
875
876         IndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not empty.
877         https://bugs.webkit.org/show_bug.cgi?id=193093
878
879         Reviewed by Brady Eidson.
880
881         performUnconditionalDeleteBackingStore killed the database task queue immediately, but performPrefetchCursor
882         task may be scheduled behind performUnconditionalDeleteBackingStore on database thread.
883
884         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
885         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
886         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
887         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
888
889 2019-01-16  Alex Christensen  <achristensen@webkit.org>
890
891         Internal build fix.
892
893         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
894         (WebCore::layerContentsFormat):
895
896 2019-01-16  Youenn Fablet  <youenn@apple.com>
897
898         ServiceWorkerContainer is leaking due to a ref cycle
899         https://bugs.webkit.org/show_bug.cgi?id=193462
900         <rdar://problem/47026303>
901
902         Reviewed by Brady Eidson.
903
904         ServiceWorkerContainer keeps a reference to its ready promise.
905         The ready promise keeps a ref to its value which is a ServiceWorkerRegistration.
906         ServiceWorkerRegistration keeps a ref to ServiceWorkerContainer.
907
908         To break the reference cycle, set the ready promise to zero when ServiceWorkerContainer is stopped.
909
910         Covered by imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html no longer leaking.
911
912         * workers/service/ServiceWorkerContainer.cpp:
913         (WebCore::ServiceWorkerContainer::stop):
914
915 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
916
917         Make didCommitChangesForLayer() explicitly about the platform layer changing because of tile/non-tile swapping
918         https://bugs.webkit.org/show_bug.cgi?id=193290
919
920         Reviewed by Tim Horton.
921
922         RenderLayerCompositor::didFlushChangesForLayer() triggers updates scrolling tree nodes for
923         the flushed layer, but it's not clear what has changed at this point.
924
925         didCommitChangesForLayer()/didFlushChangesForLayer() were added to explicitly handle the
926         case where the underlying platform layer for a GraphicsLayer changes because the layer swaps
927         between tiled and non-tiled, and structural layer changes; we need to push the new layer to
928         the scrolling tree because it operates on platform layers. So the only work that
929         didFlushChangesForLayer() should do is to update layers on scrolling tree nodes; it doesn't
930         need to do any geometry updating. Move towards that goal by renaming this callback to
931         didChangePlatformLayerForLayer() to make its function more explicit.
932
933         * platform/graphics/GraphicsLayerClient.h:
934         (WebCore::GraphicsLayerClient::didChangePlatformLayerForLayer):
935         (WebCore::GraphicsLayerClient::didCommitChangesForLayer const): Deleted.
936         * platform/graphics/ca/GraphicsLayerCA.cpp:
937         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
938         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
939         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
940         * platform/graphics/ca/GraphicsLayerCA.h:
941         * rendering/RenderLayerBacking.cpp:
942         (WebCore::RenderLayerBacking::didChangePlatformLayerForLayer):
943         (WebCore::RenderLayerBacking::didCommitChangesForLayer const): Deleted.
944         * rendering/RenderLayerBacking.h:
945         * rendering/RenderLayerCompositor.cpp:
946         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
947         (WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer):
948         (WebCore::RenderLayerCompositor::didFlushChangesForLayer): Deleted.
949         (WebCore::RenderLayerCompositor::didCommitChangesForLayer const): Deleted.
950         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer): Deleted.
951         * rendering/RenderLayerCompositor.h:
952
953 2019-01-16  Chris Dumez  <cdumez@apple.com>
954
955         Regression(PSON) View becomes blank after click a cross-site download link
956         https://bugs.webkit.org/show_bug.cgi?id=193361
957         <rdar://problem/47099573>
958
959         Reviewed by Geoffrey Garen.
960
961         * loader/FrameLoader.cpp:
962         (WebCore::FrameLoader::commitProvisionalLoad):
963         When restoring from PageCache, make sure we notify the client that the load was committed
964         *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
965         logic in the UIProcess.
966
967 2019-01-16  Devin Rousso  <drousso@apple.com>
968
969         Web Inspector: extend overlay element bounds lines to the right/below as well
970         https://bugs.webkit.org/show_bug.cgi?id=193336
971
972         Reviewed by Matt Baker.
973
974         This patch is purely a visual change for WebInspector, and doesn't affect anything else.
975
976         * inspector/InspectorOverlayPage.js:
977         (_drawBounds):
978
979 2019-01-16  Youenn Fablet  <youenn@apple.com>
980
981         Prevent WorkerRunLoop::runInMode from spinning in nested cases
982         https://bugs.webkit.org/show_bug.cgi?id=193359
983         <rdar://problem/46345353>
984
985         Reviewed by Joseph Pecoraro.
986
987         Speculative fix for some cases where service worker is spinning and consuming a lot of CPU.
988         The hypothesis is that:
989         - Service Worker is checking for its script freshness through WorkerScriptLoader.
990         This triggers the worker run loop to be nested.
991         - The run loop timer is active and needs to fire immediately.
992         The hypothesis is that this happens in some cases like restarting a device after sleep mode.
993
994         WorkerRunLoop::runInMode will then compute a 0 timeout value for getting a message.
995         This will trigger a timeout while waiting for the message queue.
996         Since the run loop is nested,  the run loop timer will not be able to fire,
997         and it will keep ask to fire immediately.
998         runInMode will return timeout as a result and WorkerRunLoop::run will call it immediately.
999
1000         The fix is to prevent the shared timer to fire only when the run loop is being debugged through the web inspector.
1001         We compute this by checking the run loop mode as debuggerMode().
1002         Did some refactoring by introducing helper routines for running the loop and posting task in debugger mode.
1003
1004         * inspector/WorkerScriptDebugServer.cpp:
1005         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
1006         * workers/WorkerInspectorProxy.cpp:
1007         (WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
1008         (WebCore::WorkerInspectorProxy::connectToWorkerInspectorController):
1009         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
1010         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspectorController):
1011         * workers/WorkerRunLoop.cpp:
1012         (WebCore::ModePredicate::ModePredicate):
1013         (WebCore::WorkerRunLoop::WorkerRunLoop):
1014         (WebCore::debuggerMode):
1015         (WebCore::RunLoopSetup::RunLoopSetup):
1016         (WebCore::RunLoopSetup::~RunLoopSetup):
1017         (WebCore::WorkerRunLoop::run):
1018         (WebCore::WorkerRunLoop::runInDebuggerMode):
1019         (WebCore::WorkerRunLoop::runInMode):
1020         (WebCore::WorkerRunLoop::Task::performTask):
1021         * workers/WorkerRunLoop.h:
1022         (WebCore::WorkerRunLoop::isBeingDebugged const):
1023         * workers/WorkerThread.cpp:
1024         (WebCore::WorkerThread::startRunningDebuggerTasks):
1025         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
1026         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
1027         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
1028         (WebCore::ServiceWorkerInspectorProxy::sendMessageToWorker):
1029
1030 2019-01-16  Sihui Liu  <sihui_liu@apple.com>
1031
1032         IndexedDB: leak WebIDBConnectionToClient for retain cycle
1033         https://bugs.webkit.org/show_bug.cgi?id=193097
1034         <rdar://problem/46899601>
1035
1036         Reviewed by David Kilzer.
1037
1038         Fix API test failure after r239887. After removing the retain cycle, IDBConnectionToClient will no longer live 
1039         forever so make sure it is not destructed before UniqueIDBDatabaseConnection unregisters itself.
1040
1041         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1042         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
1043         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
1044         (WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent):
1045         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
1046         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
1047         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateObjectStore):
1048         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore):
1049         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
1050         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore):
1051         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex):
1052         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex):
1053         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
1054         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
1055
1056 2019-01-16  Antti Koivisto  <antti@apple.com>
1057
1058         Add more assertions to find root cause for release assert hit in StyleResolver
1059         https://bugs.webkit.org/show_bug.cgi?id=193488
1060         <rdar://problem/30983040>
1061
1062         Reviewed by Zalan Bujtas.
1063
1064         * css/StyleResolver.cpp:
1065         (WebCore::StyleResolver::~StyleResolver):
1066
1067         Release assert we are not resolving tree style.
1068
1069         * dom/Document.cpp:
1070         (WebCore::Document::setIsResolvingTreeStyle):
1071         * dom/Document.h:
1072         (WebCore::Document::isResolvingTreeStyle const):
1073         * style/StyleTreeResolver.cpp:
1074         (WebCore::Style::TreeResolver::Scope::Scope):
1075         (WebCore::Style::TreeResolver::Scope::~Scope):
1076
1077         Set isResolvingTreeStyle bit when we have a tree resolver scope.
1078
1079 2019-01-16  Zalan Bujtas  <zalan@apple.com>
1080
1081         [LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
1082         https://bugs.webkit.org/show_bug.cgi?id=193470
1083
1084         Reviewed by Antti Koivisto.
1085
1086         Non-auto vertical margin values (which is mostly the case) should be set as used values.
1087
1088         Test: fast/block/block-only/non-auto-top-bottom-height-with-margins.html
1089
1090         * layout/FormattingContextGeometry.cpp:
1091         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1092
1093 2019-01-16  Alan Kinsley  <zalan@apple.com>
1094
1095         [LFC] Adjust margin box verification.
1096         https://bugs.webkit.org/show_bug.cgi?id=193482
1097
1098         Reviewed by Antti Koivisto.
1099
1100         In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
1101         so let's check the individual margin values instead (and at this point we know that all other boxes match).
1102
1103         Test: fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html
1104
1105         * layout/Verification.cpp:
1106         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1107
1108 2019-01-16  Zan Dobersek  <zdobersek@igalia.com>
1109
1110         [FreeType] Cache the zero-width space glyph in GlyphPage::fill()
1111         https://bugs.webkit.org/show_bug.cgi?id=193485
1112
1113         Reviewed by Carlos Garcia Campos.
1114
1115         In FreeType's implementation of GlyphPage::fill(), we can cache the
1116         zero-width space glyph upon first retrieval through the
1117         FcFreeTypeCharIndex() entrypoint, avoiding any subsequent calls
1118         for other ignorable characters.
1119
1120         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
1121         (WebCore::GlyphPage::fill):
1122
1123 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
1124
1125         [WHLSL] Add the high zombie finder
1126         https://bugs.webkit.org/show_bug.cgi?id=193432
1127
1128         Reviewed by Robin Morisset and Saam Barati.
1129
1130         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/HighZombieFinder.mjs into C++.
1131
1132         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
1133         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
1134
1135         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: Added.
1136         (WebCore::WHLSL::findHighZombies):
1137         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: Added.
1138         * Sources.txt:
1139         * WebCore.xcodeproj/project.pbxproj:
1140
1141 2019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
1142
1143         Unreviewed WinCairo build fix.
1144
1145         * platform/network/curl/ResourceHandleCurl.cpp:
1146         (WebCore::ResourceHandle::createCurlRequest):
1147         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1148         (WebCore::ResourceHandle::receivedCredential):
1149         (WebCore::ResourceHandle::getCredential):
1150
1151 2019-01-15  Alex Christensen  <achristensen@webkit.org>
1152
1153         Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
1154         https://bugs.webkit.org/show_bug.cgi?id=193368
1155
1156         Reviewed by Geoff Garen.
1157
1158         The NetworkStorageSession ownership needs to move to the WebKit/WebKitLegacy layer instead of being a process-global static map.
1159
1160         * loader/EmptyClients.cpp:
1161         * platform/network/CredentialStorage.cpp:
1162         (WebCore::CredentialStorage::defaultCredentialStorage): Deleted.
1163         * platform/network/CredentialStorage.h:
1164         * platform/network/NetworkStorageSession.h:
1165         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1166         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1167         (WebCore::NetworkStorageSession::ensureSession):
1168         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
1169         (WebCore::createPrivateStorageSession):
1170         * platform/network/curl/ResourceHandleCurl.cpp:
1171         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1172         (WebCore::ResourceHandle::receivedCredential):
1173         (WebCore::ResourceHandle::getCredential):
1174
1175 2019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
1176
1177         VisualViewport API should be updated upon opening of keyboard
1178         https://bugs.webkit.org/show_bug.cgi?id=193475
1179
1180         Reviewed by Simon Fraser.
1181
1182         Added a function to update the visual viewport API and schedule a resize event to FrameView.
1183
1184         Test: fast/visual-viewport/ios/resize-event-for-keyboard.html
1185
1186         * page/FrameView.cpp:
1187         (WebCore::FrameView::didUpdateViewportOverrideRects):
1188         * page/FrameView.h:
1189
1190 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1191
1192         Fix build after r240018
1193         https://bugs.webkit.org/show_bug.cgi?id=193434
1194
1195         Unreviewed.
1196
1197         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
1198         (WebCore::WHLSL::checkLoops):
1199         (WebCore::WHLSL::findHighZombies): Deleted.
1200         * Modules/webgpu/WHLSL/WHLSLLoopChecker.h:
1201
1202 2019-01-15  Megan Gardner  <megan_gardner@apple.com>
1203
1204         Add Reveal support in iOSMac
1205         https://bugs.webkit.org/show_bug.cgi?id=193408
1206         <rdar://problem/47300699>
1207
1208         Reviewed by Tim Horton.
1209
1210         iOSMac and Reveal are currently not testable.
1211
1212         Add support for the reveal SPI specifically for iOSMac.
1213         Show the controller when called, and implement the delegate to 
1214         correctly re-paint the content with the auto-generated highlight from
1215         the reveal framework.
1216
1217         * Configurations/WebCore.xcconfig:
1218         * editing/cocoa/DictionaryLookup.mm:
1219         (-[WebRevealHighlight initWithHighlightRect:view:]):
1220         (-[WebRevealHighlight setImage:]):
1221         (-[WebRevealHighlight highlightRectsForItem:]):
1222         (-[WebRevealHighlight startHighlightingItem:]):
1223         (-[WebRevealHighlight highlightItem:withProgress:]):
1224         (-[WebRevealHighlight completeHighlightingItem:]):
1225         (-[WebRevealHighlight stopHighlightingItem:]):
1226         (-[WebRevealHighlight highlightRangeChangedForItem:]):
1227         (-[WebRevealHighlight highlighting]):
1228         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
1229         (WebCore::showPopupOrCreateAnimationController):
1230         (WebCore::DictionaryLookup::showPopup):
1231         * editing/mac/DictionaryLookup.h:
1232
1233 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1234
1235         [WHLSL] Add ending namespace comments to make namespace boundaries more clear
1236         https://bugs.webkit.org/show_bug.cgi?id=193471
1237
1238         Reviewed by Saam Barati.
1239
1240         This patch only adds the comments to the files that are too long to fit on a single screen in my editor.
1241
1242         No new tests because there is no behavior change.
1243
1244         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
1245         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1246         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
1247         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
1248         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
1249         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
1250         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
1251         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1252         * Modules/webgpu/WHLSL/WHLSLLexer.h:
1253         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
1254         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
1255         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
1256         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1257         * Modules/webgpu/WHLSL/WHLSLParser.h:
1258         * Modules/webgpu/WHLSL/WHLSLProgram.h:
1259         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
1260         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
1261         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
1262         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
1263         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
1264         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
1265         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1266         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
1267
1268 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1269
1270         [WHLSL] Implement the loop checker
1271         https://bugs.webkit.org/show_bug.cgi?id=193434
1272
1273         Reviewed by Saam Barati.
1274
1275         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LoopChecker.mjs into C++.
1276
1277         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
1278         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
1279
1280         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Added.
1281         (WebCore::WHLSL::findHighZombies):
1282         * Modules/webgpu/WHLSL/WHLSLLoopChecker.h: Added.
1283         * Sources.txt:
1284         * WebCore.xcodeproj/project.pbxproj:
1285
1286 2019-01-15  Chris Dumez  <cdumez@apple.com>
1287
1288         Unreviewed, rolling out r239993, r239995, r239997, and
1289         r239999.
1290
1291         Caused assertions under
1292         ViewGestureController::disconnectFromProcess()
1293
1294         Reverted changesets:
1295
1296         "Regression(PSON) View becomes blank after click a cross-site
1297         download link"
1298         https://bugs.webkit.org/show_bug.cgi?id=193361
1299         https://trac.webkit.org/changeset/239993
1300
1301         "Unreviewed iOS build fix after r239993."
1302         https://trac.webkit.org/changeset/239995
1303
1304         "Fix iOS build after r239993"
1305         https://bugs.webkit.org/show_bug.cgi?id=193361
1306         https://trac.webkit.org/changeset/239997
1307
1308         "Unreviewed, revert part of r239997 as it is not needed to fix
1309         the build."
1310         https://trac.webkit.org/changeset/239999
1311
1312 2019-01-15  Alex Christensen  <achristensen@webkit.org>
1313
1314         Stop using CookiesStrategy
1315         https://bugs.webkit.org/show_bug.cgi?id=161106
1316
1317         Reviewed by Don Olmstead and Antti Koivisto.
1318
1319         CookiesStrategy is process-global and makes it difficult to switch NetworkStorageSession from having a process-global map.
1320         Instead, use a CookieJar object in the WebProcess.  This has the additional benefit of making it more clear which code
1321         is used in the WebProcess and which code is used in the NetworkProcess.
1322
1323         * Modules/beacon/NavigatorBeacon.cpp:
1324         * Modules/websockets/WebSocketChannel.cpp:
1325         (WebCore::WebSocketChannel::processBuffer):
1326         * Modules/websockets/WebSocketHandshake.cpp:
1327         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
1328         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
1329         * WebCore.xcodeproj/project.pbxproj:
1330         * css/StyleRuleImport.cpp:
1331         (WebCore::StyleRuleImport::requestStyleSheet):
1332         * dom/Document.cpp:
1333         (WebCore::Document::cookie):
1334         (WebCore::Document::setCookie):
1335         * html/HTMLMediaElement.cpp:
1336         (WebCore::HTMLMediaElement::mediaPlayerGetRawCookies const):
1337         * inspector/agents/InspectorPageAgent.cpp:
1338         (WebCore::InspectorPageAgent::getCookies):
1339         (WebCore::InspectorPageAgent::deleteCookie):
1340         * loader/CookieJar.cpp:
1341         (WebCore::CookieJar::shouldIncludeSecureCookies):
1342         (WebCore::CookieJar::sameSiteInfo):
1343         (WebCore::CookieJar::create):
1344         (WebCore::CookieJar::cookies const):
1345         (WebCore::CookieJar::cookieRequestHeaderFieldProxy):
1346         (WebCore::CookieJar::setCookies):
1347         (WebCore::CookieJar::cookiesEnabled const):
1348         (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
1349         (WebCore::CookieJar::getRawCookies const):
1350         (WebCore::CookieJar::deleteCookie):
1351         (WebCore::shouldIncludeSecureCookies): Deleted.
1352         (WebCore::sameSiteInfo): Deleted.
1353         (WebCore::cookies): Deleted.
1354         (WebCore::cookieRequestHeaderFieldProxy): Deleted.
1355         (WebCore::setCookies): Deleted.
1356         (WebCore::cookiesEnabled): Deleted.
1357         (WebCore::cookieRequestHeaderFieldValue): Deleted.
1358         (WebCore::getRawCookies): Deleted.
1359         (WebCore::deleteCookie): Deleted.
1360         * loader/CookieJar.h:
1361         * loader/EmptyClients.cpp:
1362         (WebCore::pageConfigurationWithEmptyClients):
1363         * loader/ImageLoader.cpp:
1364         (WebCore::ImageLoader::updateFromElement):
1365         * loader/cache/CachedApplicationManifest.cpp:
1366         (WebCore::CachedApplicationManifest::CachedApplicationManifest):
1367         * loader/cache/CachedApplicationManifest.h:
1368         * loader/cache/CachedCSSStyleSheet.cpp:
1369         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
1370         * loader/cache/CachedCSSStyleSheet.h:
1371         * loader/cache/CachedFont.cpp:
1372         (WebCore::CachedFont::CachedFont):
1373         * loader/cache/CachedFont.h:
1374         * loader/cache/CachedImage.cpp:
1375         (WebCore::CachedImage::CachedImage):
1376         * loader/cache/CachedImage.h:
1377         * loader/cache/CachedRawResource.cpp:
1378         (WebCore::CachedRawResource::CachedRawResource):
1379         * loader/cache/CachedRawResource.h:
1380         * loader/cache/CachedResource.cpp:
1381         (WebCore::CachedResource::CachedResource):
1382         (WebCore::CachedResource::setResponse):
1383         (WebCore::CachedResource::varyHeaderValuesMatch):
1384         * loader/cache/CachedResource.h:
1385         (WebCore::CachedResource::cookieJar const):
1386         * loader/cache/CachedResourceLoader.cpp:
1387         (WebCore::createResource):
1388         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1389         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
1390         (WebCore::CachedResourceLoader::requestResource):
1391         (WebCore::CachedResourceLoader::revalidateResource):
1392         (WebCore::CachedResourceLoader::loadResource):
1393         * loader/cache/CachedResourceLoader.h:
1394         * loader/cache/CachedSVGDocument.cpp:
1395         (WebCore::CachedSVGDocument::CachedSVGDocument):
1396         * loader/cache/CachedSVGDocument.h:
1397         * loader/cache/CachedSVGFont.cpp:
1398         (WebCore::CachedSVGFont::CachedSVGFont):
1399         * loader/cache/CachedSVGFont.h:
1400         * loader/cache/CachedScript.cpp:
1401         (WebCore::CachedScript::CachedScript):
1402         * loader/cache/CachedScript.h:
1403         * loader/cache/CachedTextTrack.cpp:
1404         (WebCore::CachedTextTrack::CachedTextTrack):
1405         * loader/cache/CachedTextTrack.h:
1406         * loader/cache/CachedXSLStyleSheet.cpp:
1407         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
1408         * loader/cache/CachedXSLStyleSheet.h:
1409         * loader/cache/MemoryCache.cpp:
1410         (WebCore::MemoryCache::addImageToCache):
1411         * loader/cache/MemoryCache.h:
1412         * page/Navigator.cpp:
1413         (WebCore::Navigator::cookieEnabled const):
1414         * page/Page.cpp:
1415         (WebCore::Page::Page):
1416         * page/Page.h:
1417         (WebCore::Page::cookieJar):
1418         * page/PageConfiguration.cpp:
1419         (WebCore::PageConfiguration::PageConfiguration):
1420         * page/PageConfiguration.h:
1421         * platform/CookiesStrategy.h: Removed.
1422         * platform/PlatformStrategies.h:
1423         (WebCore::PlatformStrategies::cookiesStrategy): Deleted.
1424         * platform/network/CacheValidation.cpp:
1425         (WebCore::cookieRequestHeaderFieldValue):
1426         (WebCore::collectVaryingRequestHeaders):
1427         (WebCore::verifyVaryingRequestHeaders):
1428         * platform/network/CacheValidation.h:
1429         * platform/network/CookieRequestHeaderFieldProxy.h:
1430         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
1431         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1432         * platform/network/curl/ResourceHandleCurl.cpp:
1433         * rendering/RenderSnapshottedPlugIn.cpp:
1434         (WebCore::RenderSnapshottedPlugIn::updateSnapshot):
1435         * testing/Internals.cpp:
1436         (WebCore::Internals::getCookies const):
1437
1438 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
1439
1440         Animations should only trigger layer recomposite when necessary
1441         https://bugs.webkit.org/show_bug.cgi?id=193450
1442
1443         Reviewed by Antoine Quint.
1444
1445         Animations only need to trigger compositing updates when their states change in a way
1446         that affects compositing. RenderLayerCompositor::requiresCompositingForAnimation() checks for
1447         running animations of properties that can be accelerated, so this patch fixes the legacy
1448         animation logic to only set 'shouldRecompositeLayer' in TreeResolver::createAnimatedElementUpdate()
1449         when the running state of such an animation changes.
1450
1451         ImplicitAnimation::animate() and KeyframeAnimation::animate() now return OptionSet<AnimateChange>.
1452         This contains information about whether the running state changed, so CompositeAnimation::animate()
1453         asks about whether the running state of an accelerated property changed, and returns this in
1454         the AnimationUpdate result.
1455
1456         * page/animation/AnimationBase.h:
1457         (WebCore::AnimationBase::isPausedState):
1458         (WebCore::AnimationBase::isRunningState):
1459         (WebCore::AnimationBase::inPausedState const):
1460         (WebCore::AnimationBase::inRunningState const):
1461         (WebCore::AnimationBase::isAnimatingProperty const):
1462         * page/animation/CSSAnimationController.h:
1463         * page/animation/CompositeAnimation.cpp:
1464         (WebCore::CompositeAnimation::animate):
1465         * page/animation/ImplicitAnimation.cpp:
1466         (WebCore::ImplicitAnimation::animate):
1467         (WebCore::ImplicitAnimation::affectsAcceleratedProperty const):
1468         * page/animation/ImplicitAnimation.h:
1469         * page/animation/KeyframeAnimation.cpp:
1470         (WebCore::KeyframeAnimation::KeyframeAnimation):
1471         (WebCore::KeyframeAnimation::animate):
1472         (WebCore::KeyframeAnimation::computeStackingContextImpact): Deleted.
1473         * page/animation/KeyframeAnimation.h:
1474         * style/StyleTreeResolver.cpp:
1475         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1476
1477 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
1478
1479         Clean up code related to the updating of Dashboard and touch event regions
1480         https://bugs.webkit.org/show_bug.cgi?id=193460
1481
1482         Reviewed by Zalan Bujtas.
1483
1484         In preparation for layout testing that can count the number of event region
1485         updates, move the code related to updating "annotated" (Dashboard) regions, and
1486         touch event regions into bottleneck functions in Document.
1487         
1488         Updating these two kinds of regions is generally similar, but there are some code paths
1489         that eagerly update annotated regions.
1490
1491         No behavior change.
1492
1493         * dom/Document.cpp:
1494         (WebCore::Document::updateAnnotatedRegions): Moved from FrameView.
1495         (WebCore::Document::invalidateRenderingDependentRegions):
1496         (WebCore::Document::invalidateScrollbarDependentRegions):
1497         (WebCore::Document::updateZOrderDependentRegions):
1498         * dom/Document.h:
1499         (WebCore::Document::setAnnotatedRegionsDirty):
1500         (WebCore::Document::annotatedRegionsDirty const):
1501         (WebCore::Document::hasAnnotatedRegions const):
1502         * page/FrameView.cpp:
1503         (WebCore::FrameView::didLayout):
1504         (WebCore::FrameView::didPaintContents):
1505         (WebCore::FrameView::updateAnnotatedRegions): Deleted.
1506         * page/FrameView.h:
1507         * rendering/RenderElement.cpp: Drive-by header cleanup.
1508         (WebCore::RenderElement::styleWillChange):
1509         * rendering/RenderLayer.cpp:
1510         (WebCore::RenderLayer::scrollTo):
1511         (WebCore::RenderLayer::setHasHorizontalScrollbar):
1512         (WebCore::RenderLayer::setHasVerticalScrollbar):
1513         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
1514         (WebCore::RenderLayer::calculateClipRects const):
1515         * rendering/RenderListBox.cpp:
1516         (WebCore::RenderListBox::setHasVerticalScrollbar):
1517
1518 2019-01-15  David Kilzer  <ddkilzer@apple.com>
1519
1520         Let Xcode have its way with the WebCore project
1521
1522         * WebCore.xcodeproj/project.pbxproj:
1523         - Change the lastKnownFileType for *.gperf and *.idl files from
1524           "file" to "text".
1525         - Resort source files into UUID order.
1526
1527 2019-01-15  Youenn Fablet  <youenn@apple.com>
1528
1529         Correctly handle rotation for local video playback
1530         https://bugs.webkit.org/show_bug.cgi?id=193412
1531
1532         Reviewed by Eric Carlson.
1533
1534         Update AVVideoCaptureSource to compute the size given to settings after rotating the sample.
1535         This ensures computing the size of video elements appropriately.
1536         Also makes sure to notify observers of size change whenever rotation happens as settings() call will provide a different size.
1537         Covered by manual testing as we do not have yet emulation of local capture with rotation.
1538
1539         * platform/mediastream/RealtimeMediaSource.cpp:
1540         (WebCore::RealtimeMediaSource::setIntrinsicSize):
1541         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1542         (WebCore::AVVideoCaptureSource::settings):
1543         (WebCore::AVVideoCaptureSource::computeSampleRotation):
1544
1545 2019-01-15  Chris Dumez  <cdumez@apple.com>
1546
1547         Regression(PSON) View becomes blank after click a cross-site download link
1548         https://bugs.webkit.org/show_bug.cgi?id=193361
1549         <rdar://problem/47099573>
1550
1551         Reviewed by Geoff Garen.
1552
1553         * loader/FrameLoader.cpp:
1554         (WebCore::FrameLoader::commitProvisionalLoad):
1555         When restoring from PageCache, make sure we notify the client that the load was committed
1556         *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
1557         logic in the UIProcess.
1558
1559 2019-01-15  Zalan Bujtas  <zalan@apple.com>
1560
1561         [LFC][Out-of-flow] Ignore bottom when the vertical values are over-constrained
1562         https://bugs.webkit.org/show_bug.cgi?id=193448
1563
1564         Reviewed by Antti Koivisto.
1565
1566         Add missing check. We should only resolve auto values. 
1567
1568         Test: fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html
1569
1570         * layout/FormattingContextGeometry.cpp:
1571         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1572
1573 2019-01-15  Devin Rousso  <drousso@apple.com>
1574
1575         Web Inspector: Audit: provide a way to determine whether a give node has event listeners
1576         https://bugs.webkit.org/show_bug.cgi?id=193226
1577         <rdar://problem/46800005>
1578
1579         Reviewed by Joseph Pecoraro.
1580
1581         Test: inspector/audit/run-dom.html
1582
1583         * inspector/InspectorAuditDOMObject.idl:
1584         * inspector/InspectorAuditDOMObject.h:
1585         * inspector/InspectorAuditDOMObject.cpp:
1586         (WebCore::InspectorAuditDOMObject::hasEventListeners): Added.
1587
1588 2019-01-15  Devin Rousso  <drousso@apple.com>
1589
1590         Web Inspector: Audit: provide a way to query for all nodes with a given computed Accessibility role
1591         https://bugs.webkit.org/show_bug.cgi?id=193228
1592         <rdar://problem/46787787>
1593
1594         Reviewed by Joseph Pecoraro.
1595
1596         Test: inspector/audit/run-accessibility.html
1597
1598         * inspector/InspectorAuditAccessibilityObject.idl:
1599         * inspector/InspectorAuditAccessibilityObject.h:
1600         * inspector/InspectorAuditAccessibilityObject.cpp:
1601         (WebCore::accessiblityObjectForNode): Added.
1602         (WebCore::InspectorAuditAccessibilityObject::getElementsByComputedRole): Added.
1603
1604 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
1605
1606         Simplify isRunningAnimationOnRenderer()
1607         https://bugs.webkit.org/show_bug.cgi?id=193435
1608
1609         Reviewed by Darin Adler.
1610
1611         All callers of CSSAnimationController::isRunningAnimationOnRenderer() pass AnimationBase::Running | AnimationBase::Paused,
1612         so we can remove the parameter and just hardcode this behavior.
1613         
1614         This will simplify a later patch that needs to consider state changes between running and not running.
1615         
1616         No behavior change.
1617
1618         * page/animation/AnimationBase.h:
1619         (WebCore::AnimationBase::isAnimatingProperty const):
1620         * page/animation/CSSAnimationController.cpp:
1621         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
1622         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
1623         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
1624         (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
1625         (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):
1626         * page/animation/CSSAnimationController.h:
1627         * page/animation/CSSAnimationControllerPrivate.h:
1628         * page/animation/CompositeAnimation.cpp:
1629         (WebCore::CompositeAnimation::isAnimatingProperty const):
1630         * page/animation/CompositeAnimation.h:
1631         * rendering/RenderLayer.cpp:
1632         (WebCore::RenderLayer::currentTransform const):
1633         * rendering/RenderLayerBacking.cpp:
1634         (WebCore::RenderLayerBacking::updateGeometry):
1635         * rendering/RenderLayerCompositor.cpp:
1636         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
1637         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
1638
1639 2019-01-15  Antti Koivisto  <antti@apple.com>
1640
1641         Remove unused fields from Scrollbar
1642         https://bugs.webkit.org/show_bug.cgi?id=193442
1643
1644         Reviewed by Zalan Bujtas.
1645
1646         * platform/Scrollbar.cpp:
1647         (WebCore::Scrollbar::Scrollbar):
1648         * platform/Scrollbar.h:
1649         (WebCore::Scrollbar::isCustomScrollbar const):
1650
1651         Make virtual so it doesn't need a bit.
1652
1653         (WebCore::Scrollbar::isAlphaLocked const): Deleted.
1654         (WebCore::Scrollbar::setIsAlphaLocked): Deleted.
1655         * platform/mac/ScrollAnimatorMac.mm:
1656         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
1657         * rendering/RenderScrollbar.cpp:
1658         (WebCore::RenderScrollbar::RenderScrollbar):
1659         * rendering/RenderScrollbar.h:
1660
1661 2019-01-15  Zalan Bujtas  <zalan@apple.com>
1662
1663         [LFC] Use the containing block's padding box to position out-of-flow elements.
1664         https://bugs.webkit.org/show_bug.cgi?id=193431
1665
1666         Reviewed by Antti Koivisto.
1667
1668         If the element has 'position: absolute', the containing block is established by the nearest ancestor
1669         with a 'position' of 'absolute', 'relative' or 'fixed', in the following way:
1670
1671         1. In the case that the ancestor is an inline element, the containing block is the bounding box around the padding
1672         boxes of the first and the last inline boxes generated for that element. In CSS 2.2, if the inline element is split
1673         across multiple lines, the containing block is undefined.
1674
1675         2. Otherwise, the containing block is formed by the padding edge of the ancestor.
1676
1677         This patch covers #2. 
1678
1679         Test: fast/block/block-only/out-of-flow-with-containing-block-border-padding.html
1680
1681         * layout/displaytree/DisplayBox.h:
1682         (WebCore::Display::Box::width const):
1683         (WebCore::Display::Box::height const):
1684         (WebCore::Display::Box::contentBoxTop const):
1685         (WebCore::Display::Box::contentBoxLeft const):
1686         (WebCore::Display::Box::paddingBoxTop const):
1687         (WebCore::Display::Box::paddingBoxLeft const):
1688         (WebCore::Display::Box::paddingBoxBottom const):
1689         (WebCore::Display::Box::paddingBoxRight const):
1690         (WebCore::Display::Box::paddingBoxHeight const):
1691         (WebCore::Display::Box::paddingBoxWidth const):
1692         * page/FrameViewLayoutContext.cpp:
1693         (WebCore::layoutUsingFormattingContext):
1694
1695 2019-01-11  Antoine Quint  <graouts@apple.com>
1696
1697         Support parsing of additional values for the touch-action property
1698         https://bugs.webkit.org/show_bug.cgi?id=193314
1699         <rdar://problem/47176519>
1700
1701         Reviewed by Dean Jackson.
1702
1703         We add parsing support for the "none", "pan-x", "pan-y" and "pinch-zoom" values of the CSS "touch-action" property.
1704
1705         * WebCore.xcodeproj/project.pbxproj:
1706         * css/CSSComputedStyleDeclaration.cpp:
1707         (WebCore::touchActionFlagsToCSSValue):
1708         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1709         * css/CSSPrimitiveValueMappings.h:
1710         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1711         (WebCore::CSSPrimitiveValue::operator OptionSet<TouchAction> const):
1712         (WebCore::CSSPrimitiveValue::operator TouchAction const): Deleted.
1713         * css/CSSProperties.json:
1714         * css/CSSValueKeywords.in:
1715         * css/StyleBuilderConverter.h:
1716         (WebCore::StyleBuilderConverter::convertTouchAction):
1717         * css/parser/CSSParserFastPaths.cpp:
1718         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1719         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1720         * css/parser/CSSPropertyParser.cpp:
1721         (WebCore::consumeTouchAction):
1722         * dom/Element.cpp:
1723         (WebCore::Element::allowsDoubleTapGesture const):
1724         * platform/TouchAction.h: Added.
1725         * rendering/style/RenderStyle.h:
1726         (WebCore::RenderStyle::touchActions const):
1727         (WebCore::RenderStyle::setTouchActions):
1728         (WebCore::RenderStyle::initialTouchActions):
1729         (WebCore::RenderStyle::touchAction const): Deleted.
1730         (WebCore::RenderStyle::setTouchAction): Deleted.
1731         (WebCore::RenderStyle::initialTouchAction): Deleted.
1732         * rendering/style/RenderStyleConstants.h:
1733         * rendering/style/StyleRareNonInheritedData.cpp:
1734         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1735         (WebCore::StyleRareNonInheritedData::operator== const):
1736         * rendering/style/StyleRareNonInheritedData.h:
1737
1738 2019-01-15  Devin Rousso  <drousso@apple.com>
1739
1740         Web Inspector: Audit: create new IDL type for exposing special functionality in test context
1741         https://bugs.webkit.org/show_bug.cgi?id=193149
1742         <rdar://problem/46801218>
1743
1744         Reviewed by Joseph Pecoraro.
1745
1746         Tests: inspector/audit/run.html
1747                inspector/audit/setup.html
1748                inspector/audit/teardown.html
1749
1750         Create a new `AuditAgent` (and various subclasses for different inspection targets), as well
1751         as `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject` objects that will
1752         be injected into the test function to allow for more advanced testing.
1753
1754         * inspector/InspectorAuditAccessibilityObject.idl: Added.
1755         * inspector/InspectorAuditAccessibilityObject.h: Added.
1756         (WebCore::InspectorAuditAccessibilityObject::create):
1757         * inspector/InspectorAuditAccessibilityObject.cpp: Added.
1758         (WebCore::InspectorAuditAccessibilityObject::InspectorAuditAccessibilityObject):
1759
1760         * inspector/InspectorAuditDOMObject.idl: Added.
1761         * inspector/InspectorAuditDOMObject.h: Added.
1762         (WebCore::InspectorAuditDOMObject::create):
1763         * inspector/InspectorAuditDOMObject.cpp: Added.
1764         (WebCore::InspectorAuditDOMObject::InspectorAuditDOMObject):
1765
1766         * inspector/agents/page/PageAuditAgent.h: Added.
1767         * inspector/agents/page/PageAuditAgent.cpp: Added.
1768         (WebCore::PageAuditAgent::PageAuditAgent):
1769         (WebCore::PageAuditAgent::injectedScriptForEval):
1770         (WebCore::PageAuditAgent::populateAuditObject):
1771         (WebCore::PageAuditAgent::muteConsole):
1772         (WebCore::PageAuditAgent::unmuteConsole):
1773
1774         * inspector/agents/worker/WorkerAuditAgent.h: Added.
1775         * inspector/agents/worker/WorkerAuditAgent.cpp: Added.
1776         (WebCore::WorkerAuditAgent::WorkerAuditAgent):
1777         (WebCore::WorkerAuditAgent::injectedScriptForEval):
1778
1779         * inspector/InspectorController.cpp:
1780         (WebCore::InspectorController::createLazyAgents):
1781
1782         * inspector/WorkerInspectorController.cpp:
1783         (WebCore::WorkerInspectorController::createLazyAgents):
1784
1785         * CMakeLists.txt:
1786         * DerivedSources-input.xcfilelist:
1787         * DerivedSources-output.xcfilelist:
1788         * DerivedSources.make:
1789         * Sources.txt:
1790         * UnifiedSources-input.xcfilelist:
1791         * WebCore.xcodeproj/project.pbxproj:
1792
1793 2019-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
1794
1795         [WHLSL] Implement the Type Checker
1796         https://bugs.webkit.org/show_bug.cgi?id=193080
1797
1798         Reviewed by Dean Jackson.
1799
1800         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/Checker.mjs into C++.
1801
1802         The Checker passes types between nested expressions. An inner expression figures out what type it is, and
1803         passes that information up to an outer expression. This is done via reading/writing into a HashMap,
1804         because all the type information needs to be saved so that the Metal codegen can emit the correct types.
1805
1806         These types can have two forms: A regular type (like "int[]") or a ResolvableType. ResolvableTypes
1807         represent literals, since a literal needs to know its context before it knows what type it should be. So,
1808         if you have a function like "void foo(int x)" and you have a call like "foo(3)", the 3's ResolvableType
1809         gets passed to the CallExpression, which then unifies it with the function's parameter type, thereby
1810         resolving the 3 to be an int.
1811
1812         There are a few examples where multiple expressions will have the same type: "return (foo, 3)." If those
1813         types are regular types, then it's no problem; we can just clone() the type and stick both in the HashMap.
1814         However, if the type is a ResolvableType, an outer expression will only resolve that type once, so the two
1815         ResolvableTypes can't be distinct. The Checker solves this problem by making a reference-counted wrapper
1816         around ResolvableTypes and using that in the HashMap instead.
1817
1818         Once all the ResolvableTypes have been resolved, a second pass runs through the entire HashMap and assigns
1819         the known types to all the expressions. LValues and their associated address spaces are held in a parallel
1820         HashMap, and are assigned to the expression at the same time. The type is an Optional<AddressSpace> because
1821         address spaces are only relevant if the value is an lvalue; if it's nullopt then that means the expression
1822         is an rvalue.
1823
1824         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
1825         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
1826
1827         * Modules/webgpu/WHLSL/WHLSLChecker.cpp: Added.
1828         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
1829         (WebCore::WHLSL::resolveWithOperatorLength):
1830         (WebCore::WHLSL::resolveWithReferenceComparator):
1831         (WebCore::WHLSL::resolveByInstantiation):
1832         (WebCore::WHLSL::checkSemantics):
1833         (WebCore::WHLSL::checkOperatorOverload):
1834         (WebCore::WHLSL::Checker::Checker):
1835         (WebCore::WHLSL::Checker::visit):
1836         (WebCore::WHLSL::Checker::assignTypes):
1837         (WebCore::WHLSL::Checker::checkShaderType):
1838         (WebCore::WHLSL::matchAndCommit):
1839         (WebCore::WHLSL::Checker::recurseAndGetInfo):
1840         (WebCore::WHLSL::Checker::getInfo):
1841         (WebCore::WHLSL::Checker::assignType):
1842         (WebCore::WHLSL::Checker::forwardType):
1843         (WebCore::WHLSL::getUnnamedType):
1844         (WebCore::WHLSL::Checker::finishVisitingPropertyAccess):
1845         (WebCore::WHLSL::Checker::recurseAndWrapBaseType):
1846         (WebCore::WHLSL::Checker::isBoolType):
1847         (WebCore::WHLSL::Checker::recurseAndRequireBoolType):
1848         (WebCore::WHLSL::check):
1849         * Modules/webgpu/WHLSL/WHLSLChecker.h: Added.
1850         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp: Added.
1851         (WebCore::WHLSL::Gatherer::Gatherer):
1852         (WebCore::WHLSL::Gatherer::reset):
1853         (WebCore::WHLSL::Gatherer::takeEntryPointItems):
1854         (WebCore::WHLSL::Gatherer::visit):
1855         (WebCore::WHLSL::gatherEntryPointItems):
1856         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h: Added.
1857         (WebCore::WHLSL::EntryPointItem::EntryPointItem):
1858         * Sources.txt:
1859         * WebCore.xcodeproj/project.pbxproj:
1860
1861 2019-01-14  Alex Christensen  <achristensen@webkit.org>
1862
1863         Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy
1864         https://bugs.webkit.org/show_bug.cgi?id=193429
1865
1866         Reviewed by Joseph Pecoraro.
1867
1868         headerValueForVary is a strange function that is causing trouble with my NetworkProcess global state removal project.
1869         It currently accesses the cookie storage to see if there's a match in two different ways currently written as fallbacks.
1870         In the WebProcess or in WebKitLegacy, it uses cookiesStrategy to access cookies via IPC or directly, respectively,
1871         depending on the PlatformStrategies implementation of cookiesStrategy for that process.
1872         In the NetworkProcess, it uses WebCore::NetworkStorageSession to access cookies directly.
1873         Both of these cookie accessing methods use global state in the process, and I must split them to refactor them separately.
1874         This patch does the split by passing in the method of cookie access: a CookiesStrategy& or a NetworkStorageSession&.
1875         Further refactoring will be done in bug 193368 and bug 161106 to build on this and replace the global state with
1876         member variables of the correct containing objects.
1877
1878         * loader/cache/CachedResource.cpp:
1879         (WebCore::CachedResource::setResponse):
1880         (WebCore::CachedResource::varyHeaderValuesMatch):
1881         * platform/network/CacheValidation.cpp:
1882         (WebCore::cookieRequestHeaderFieldValue):
1883         (WebCore::headerValueForVary):
1884         (WebCore::collectVaryingRequestHeaders):
1885         (WebCore::verifyVaryingRequestHeaders):
1886         * platform/network/CacheValidation.h:
1887
1888 2019-01-14  Simon Fraser  <simon.fraser@apple.com>
1889
1890         Only run the node comparison code in FrameSelection::respondToNodeModification() for range selections
1891         https://bugs.webkit.org/show_bug.cgi?id=193416
1892
1893         Reviewed by Wenson Hsieh.
1894
1895         The code inside the m_selection.firstRange() clause needs to only run for non-collapsed selections, and
1896         it shows up on Speedometer profiles so optimize to only run this code if we have a selection range.
1897
1898         * editing/FrameSelection.cpp:
1899         (WebCore::FrameSelection::respondToNodeModification):
1900
1901 2019-01-14  Simon Fraser  <simon.fraser@apple.com>
1902
1903         Animation and other code is too aggressive about invalidating layer composition
1904         https://bugs.webkit.org/show_bug.cgi?id=193343
1905
1906         Reviewed by Antoine Quint.
1907         
1908         We used to have the concept of a "SyntheticStyleChange", which was used to trigger
1909         style updates for animation, and also to get compositing updated.
1910         
1911         That morphed into a call to Element::invalidateStyleAndLayerComposition(), which causes
1912         a style update to result in a "RecompositeLayer" diff, which in turn triggers compositing work,
1913         and dirties DOM touch event regions (which can be expensive to update).
1914         
1915         However, not all the callers of Element::invalidateStyleAndLayerComposition() need to trigger
1916         compositing, and doing so from animations caused excessive touch event regions on yahoo.com,
1917         which has several visibility:hidden elements with background-position animation.
1918         
1919         So fix callers of invalidateStyleAndLayerComposition() which don't care about compositing to instead
1920         call just invalidateStyle().
1921         
1922         Also fix KeyframeAnimation::animate to correctly return true when animation state changes—it failed to
1923         do so, because fireAnimationEventsIfNeeded() can run the state machine and change state.
1924
1925         * animation/KeyframeEffect.cpp:
1926         (WebCore::invalidateElement):
1927         * page/animation/AnimationBase.cpp:
1928         (WebCore::AnimationBase::setNeedsStyleRecalc):
1929         * page/animation/CSSAnimationController.cpp:
1930         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
1931         (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
1932         (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
1933         (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
1934         (WebCore::CSSAnimationController::cancelAnimations):
1935         * page/animation/KeyframeAnimation.cpp:
1936         (WebCore::KeyframeAnimation::animate):
1937         * rendering/RenderImage.cpp:
1938         (WebCore::RenderImage::imageChanged):
1939         * rendering/RenderLayer.cpp:
1940         (WebCore::RenderLayer::calculateClipRects const):
1941         * rendering/svg/SVGResourcesCache.cpp:
1942         (WebCore::SVGResourcesCache::clientStyleChanged):
1943         * style/StyleTreeResolver.cpp:
1944         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1945         * svg/SVGAnimateElementBase.cpp:
1946         (WebCore::applyCSSPropertyToTarget):
1947         (WebCore::removeCSSPropertyFromTarget):
1948
1949 2019-01-14  Sihui Liu  <sihui_liu@apple.com>
1950
1951         IndexedDB: When deleting databases, some open databases might be missed
1952         https://bugs.webkit.org/show_bug.cgi?id=193090
1953
1954         Reviewed by Brady Eidson.
1955
1956         We should close all databases with an open backing store instead of looking at which ones have an open database
1957         connection. This is because a database might be in the process of getting a backing store before its connection
1958         has been created.
1959
1960         * Modules/indexeddb/server/IDBServer.cpp:
1961         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
1962         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
1963
1964 2019-01-14  Ryosuke Niwa  <rniwa@webkit.org>
1965
1966         Remove redundant check for alignAttr and hiddenAttr in various isPresentationAttribute overrides
1967         https://bugs.webkit.org/show_bug.cgi?id=193410
1968
1969         Reviewed by Simon Fraser.
1970
1971         Removed redundant checks for check for alignAttr and hiddenAttr in isPresentationAttribute overrides
1972         in HTMLElement subclasses since HTMLElement::isPresentationAttribute already checks for those attributes.
1973
1974         * html/HTMLDivElement.cpp:
1975         (WebCore::HTMLDivElement::isPresentationAttribute const): Deleted.
1976         * html/HTMLDivElement.h:
1977         * html/HTMLEmbedElement.cpp:
1978         (WebCore::HTMLEmbedElement::isPresentationAttribute const): Deleted.
1979         * html/HTMLEmbedElement.h:
1980         * html/HTMLHRElement.cpp:
1981         (WebCore::HTMLHRElement::isPresentationAttribute const):
1982         * html/HTMLIFrameElement.cpp:
1983         (WebCore::HTMLIFrameElement::isPresentationAttribute const):
1984         * html/HTMLImageElement.cpp:
1985         (WebCore::HTMLImageElement::isPresentationAttribute const):
1986         * html/HTMLInputElement.cpp:
1987         (WebCore::HTMLInputElement::isPresentationAttribute const):
1988         * html/HTMLParagraphElement.cpp:
1989         (WebCore::HTMLParagraphElement::isPresentationAttribute const): Deleted.
1990         * html/HTMLParagraphElement.h:
1991         * html/HTMLTableCaptionElement.cpp:
1992         (WebCore::HTMLTableCaptionElement::isPresentationAttribute const): Deleted.
1993         * html/HTMLTableCaptionElement.h:
1994         * html/HTMLTableElement.cpp:
1995         (WebCore::HTMLTableElement::isPresentationAttribute const):
1996         * html/HTMLTablePartElement.cpp:
1997         (WebCore::HTMLTablePartElement::isPresentationAttribute const):
1998
1999 2019-01-14  Commit Queue  <commit-queue@webkit.org>
2000
2001         Unreviewed, rolling out r239901, r239909, r239910, r239912,
2002         r239913, and r239914.
2003         https://bugs.webkit.org/show_bug.cgi?id=193407
2004
2005         These revisions caused an internal failure (Requested by
2006         Truitt on #webkit).
2007
2008         Reverted changesets:
2009
2010         "[Cocoa] Avoid importing directly from subumbrella frameworks"
2011         https://bugs.webkit.org/show_bug.cgi?id=186016
2012         https://trac.webkit.org/changeset/239901
2013
2014         "Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901."
2015         https://trac.webkit.org/changeset/239909
2016
2017         "Tried to fix the build."
2018         https://trac.webkit.org/changeset/239910
2019
2020         "Fixed iOS builds after r239910."
2021         https://trac.webkit.org/changeset/239912
2022
2023         "More build fixing."
2024         https://trac.webkit.org/changeset/239913
2025
2026         "Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds."
2027         https://trac.webkit.org/changeset/239914
2028
2029 2019-01-14  Mark Lam  <mark.lam@apple.com>
2030
2031         Re-enable ability to build --cloop builds.
2032         https://bugs.webkit.org/show_bug.cgi?id=192955
2033
2034         Reviewed by Saam barati and Keith Miller.
2035
2036         * Configurations/FeatureDefines.xcconfig:
2037
2038 2019-01-14  Jer Noble  <jer.noble@apple.com>
2039
2040         https://bugs.webkit.org/show_bug.cgi?id=193403
2041         <rdar://problem/46750743>
2042
2043         Continue fix in r239711 by using WeakPtr in SourceBufferPrivateAVFObjC.
2044
2045         Reviewed by Eric Carlson.
2046
2047         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2048         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2049         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
2050
2051 2019-01-14  Justin Fan  <justin_fan@apple.com>
2052
2053         [WebGPU] Map WebGPUBindGroupLayoutBindings from the BindGroupLayoutDescriptor for error checking and later referencing
2054         https://bugs.webkit.org/show_bug.cgi?id=193405
2055
2056         Reviewed by Dean Jackson.
2057
2058         When creating a WebGPUBindGroupLayout, cache the WebGPUBindGroupLayoutDescriptor's list of BindGroupLayoutBindings
2059         in a HashMap, keyed by binding number, for quick reference during the WebGPUProgrammablePassEncoder::setBindGroups 
2060         implementation to follow. Also add error-checking e.g. detecting duplicate binding numbers in the same WebGPUBindGroupLayout
2061         and non-existent binding numbers when creating the WebGPUBindGroup.
2062
2063         No new tests. BindGroups and BindGroupLayouts reflect the (canonical?) strategy of returning empty 
2064         objects upon creation failure and reporting errors elswhere. Since error reporting is not yet implemented, 
2065         the error checks aren't testable from LayoutTests right now. Expected behavior unchanged and covered by existing tests.
2066
2067         * Modules/webgpu/WebGPUDevice.cpp:
2068         (WebCore::WebGPUDevice::createBindGroup const): 
2069                 Number of bindings must be consistent between bindings and layout bindings.
2070                 BindGroupBindings should only refer to existing BindGroupLayoutBindings.
2071         * platform/graphics/gpu/GPUBindGroup.h: 
2072         * platform/graphics/gpu/GPUBindGroupLayout.h:
2073         (WebCore::GPUBindGroupLayout::bindingsMap const): Added. Cache map of BindGroupLayoutBindings.
2074         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Disallow duplicate binding numbers in BindGroupLayoutBindings.
2075         (WebCore::GPUBindGroupLayout::tryCreate):
2076         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2077
2078 2019-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
2079
2080         [WHLSL] Assorted cleanup
2081         https://bugs.webkit.org/show_bug.cgi?id=193389
2082
2083         Reviewed by Dean Jackson.
2084
2085         This is a bunch of non-behavior-changing cleanup.
2086
2087         - The compiler uses UniqueRef all over the place, and UniqueRef has an implicit operator T&. Therefore,
2088           we don't need to static_cast<T&> everywhere.
2089         - ConstantExpressionEnumerationMemberReference is the exact same thing as EnumerationMemberLiteral, so
2090           this patch deletes the longer-named class in favor of the shorter-named class.
2091         - Because of the header dependency tree, this patch moves EntryPointType into its own file so it can be
2092           used by files that FunctionDeclaration depends on. Same thing for AddressSpace.
2093         - EnumTypes have to have non-null base types. The parser will make sure this is always true.
2094
2095         No new tests because there is no behavior change.
2096
2097         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
2098         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
2099         (WebCore::WHLSL::AST::ArrayType::type const):
2100         (WebCore::WHLSL::AST::ArrayType::type):
2101         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
2102         (WebCore::WHLSL::AST::AssignmentExpression::left):
2103         (WebCore::WHLSL::AST::AssignmentExpression::right):
2104         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
2105         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
2106         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
2107         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
2108         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
2109         (WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
2110         (WebCore::WHLSL::AST::ConstantExpression::clone const):
2111         (WebCore::WHLSL::AST::ConstantExpression::matches const):
2112         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Removed.
2113         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
2114         (WebCore::WHLSL::AST::DereferenceExpression::pointer):
2115         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
2116         (WebCore::WHLSL::AST::DoWhileLoop::body):
2117         (WebCore::WHLSL::AST::DoWhileLoop::conditional):
2118         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
2119         (WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
2120         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
2121         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
2122         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
2123         (WebCore::WHLSL::AST::EnumerationDefinition::type):
2124         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
2125         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
2126         (WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
2127         (WebCore::WHLSL::AST::EnumerationMemberLiteral::left const):
2128         (WebCore::WHLSL::AST::EnumerationMemberLiteral::right const):
2129         (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
2130         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition):
2131         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition const):
2132         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
2133         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember const):
2134         (WebCore::WHLSL::AST::EnumerationMemberLiteral::setEnumerationMember):
2135         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2136         (WebCore::WHLSL::AST::Expression::type):
2137         (WebCore::WHLSL::AST::Expression::setType):
2138         (WebCore::WHLSL::AST::Expression::addressSpace const):
2139         (WebCore::WHLSL::AST::Expression::setAddressSpace):
2140         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
2141         (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
2142         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
2143         (WebCore::WHLSL::AST::FloatLiteralType::preferredType):
2144         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
2145         (WebCore::WHLSL::AST::ForLoop::condition):
2146         (WebCore::WHLSL::AST::ForLoop::increment):
2147         (WebCore::WHLSL::AST::ForLoop::body):
2148         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
2149         (WebCore::WHLSL::AST::FunctionDeclaration::type const):
2150         (WebCore::WHLSL::AST::FunctionDeclaration::type):
2151         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
2152         (WebCore::WHLSL::AST::IfStatement::conditional):
2153         (WebCore::WHLSL::AST::IfStatement::body):
2154         (WebCore::WHLSL::AST::IfStatement::elseBody):
2155         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
2156         (WebCore::WHLSL::AST::IndexExpression::indexExpression):
2157         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
2158         (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
2159         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
2160         (WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
2161         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
2162         (WebCore::WHLSL::AST::LogicalExpression::left):
2163         (WebCore::WHLSL::AST::LogicalExpression::right):
2164         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
2165         (WebCore::WHLSL::AST::LogicalNotExpression::operand):
2166         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
2167         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
2168         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
2169         (WebCore::WHLSL::AST::MakePointerExpression::lValue):
2170         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
2171         (WebCore::WHLSL::AST::PropertyAccessExpression::base):
2172         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
2173         (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
2174         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
2175         (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
2176         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2177         (WebCore::WHLSL::AST::ReferenceType::elementType const):
2178         (WebCore::WHLSL::AST::ReferenceType::elementType):
2179         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
2180         (WebCore::WHLSL::AST::ResolvableType::resolvedType const):
2181         (WebCore::WHLSL::AST::ResolvableType::resolvedType):
2182         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
2183         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
2184         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
2185         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
2186         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
2187         (WebCore::WHLSL::AST::Return::value):
2188         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
2189         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
2190         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
2191         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
2192         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
2193         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
2194         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
2195         (WebCore::WHLSL::AST::StructureElement::type):
2196         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
2197         (WebCore::WHLSL::AST::SwitchStatement::value):
2198         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
2199         (WebCore::WHLSL::AST::TernaryExpression::predicate):
2200         (WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
2201         (WebCore::WHLSL::AST::TernaryExpression::elseExpression):
2202         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
2203         (WebCore::WHLSL::AST::TypeDefinition::type):
2204         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
2205         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
2206         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
2207         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
2208         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
2209         (WebCore::WHLSL::AST::VariableDeclaration::type):
2210         (WebCore::WHLSL::AST::VariableDeclaration::initializer):
2211         (WebCore::WHLSL::AST::VariableDeclaration::isAnonymous const):
2212         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
2213         (WebCore::WHLSL::AST::WhileLoop::conditional):
2214         (WebCore::WHLSL::AST::WhileLoop::body):
2215         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
2216         (WebCore::WHLSL::checkDuplicateFunctions):
2217         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
2218         (WebCore::WHLSL::commit):
2219         (WebCore::WHLSL::inferTypesForTypeArguments):
2220         (WebCore::WHLSL::inferTypesForCall):
2221         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2222         (WebCore::WHLSL::NameResolver::visit):
2223         (WebCore::WHLSL::resolveNamesInTypes):
2224         (WebCore::WHLSL::resolveNamesInFunctions):
2225         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
2226         * Modules/webgpu/WHLSL/WHLSLParser.h:
2227         * Modules/webgpu/WHLSL/WHLSLProgram.h:
2228         (WebCore::WHLSL::Program::append):
2229         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
2230         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2231         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
2232         (WebCore::WHLSL::synthesizeStructureAccessors):
2233         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2234         (WebCore::WHLSL::Visitor::visit):
2235         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
2236         * WebCore.xcodeproj/project.pbxproj:
2237
2238 2019-01-14  Zan Dobersek  <zdobersek@igalia.com>
2239
2240         DOMCacheStorage: use-after-move in doSequentialMatch()
2241         https://bugs.webkit.org/show_bug.cgi?id=193396
2242
2243         Reviewed by Youenn Fablet.
2244
2245         Depending on the platform- and compiler-specific calling conventions,
2246         the doSequentialMatch() code can move out the Vector<Ref<DOMCache>>
2247         object into the callback lambda before the DOMCache object at the
2248         specified index is retrieved for the DOMCache::doMatch() invocation.
2249
2250         This problem is now avoided by retrieving reference to the target
2251         DOMCache object in an earlier expression.
2252
2253         * Modules/cache/DOMCacheStorage.cpp:
2254         (WebCore::doSequentialMatch):
2255
2256 2019-01-14  Zalan Bujtas  <zalan@apple.com>
2257
2258         [LFC][BFC] Add basic box-sizing support.
2259         https://bugs.webkit.org/show_bug.cgi?id=193392
2260
2261         Reviewed by Antti Koivisto.
2262
2263         No min/max support yet.
2264
2265         Test: fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html
2266
2267         * layout/FormattingContextGeometry.cpp:
2268         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2269         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2270         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2271         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2272         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2273         * page/FrameViewLayoutContext.cpp:
2274         (WebCore::layoutUsingFormattingContext):
2275
2276 2019-01-14  Thibault Saunier  <tsaunier@igalia.com>
2277
2278         [GStreamer][WebRTC] Override DeviceType() in RealtimeMediaSource implementations
2279         https://bugs.webkit.org/show_bug.cgi?id=193397
2280
2281         This was necessary but wasn't done.
2282
2283         Reviewed by Philippe Normand.
2284
2285         No test required as this fixes a regression in all WebRTC tests when built in debug mode.
2286
2287         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
2288         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
2289
2290 2019-01-14  Zan Dobersek  <zdobersek@igalia.com>
2291
2292         Unreviewed WPE debug build fix after r239921.
2293
2294         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2295         (webKitMediaClearKeyDecryptorDecrypt): Fix the assert that checks the
2296         size of the mapped buffer containing IV data.
2297
2298 2019-01-14  Charlie Turner  <cturner@igalia.com>
2299
2300         [GStreamer] Add sharedBuffer utility to GstMappedBuffer, and a testsuite
2301         https://bugs.webkit.org/show_bug.cgi?id=192977
2302
2303         Reviewed by Carlos Garcia Campos.
2304
2305         Add a utility method on GstMappedBuffer to return a SharedBuffer
2306         view over the mapped data with no copies.
2307
2308         This patch also introduces a new gstreamer port API test
2309         directory, and includes some tests for GstMappedBuffer.
2310
2311         New tests in the API section.
2312
2313         * platform/SharedBuffer.cpp: Add a new overload for
2314         GstMappedBuffer that allows sharing the mapped GStreamer buffers
2315         with zero copies.
2316         (WebCore::SharedBuffer::create):
2317         (WebCore::SharedBuffer::SharedBuffer):
2318         (WebCore::SharedBuffer::DataSegment::data const):
2319         (WebCore::SharedBuffer::DataSegment::size const):
2320         * platform/SharedBuffer.h:
2321         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
2322         (webKitWebAudioSrcAllocateBuffersAndRenderAudio): Update to new
2323         API.
2324         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2325         (WebCore::GstMappedBuffer::createSharedBuffer): Return a shared
2326         buffer sharing this mapped buffer. The buffer must be shareable to
2327         use this method.
2328         * platform/graphics/gstreamer/GStreamerCommon.h:
2329         (WebCore::GstMappedBuffer::create): Make GstMappedBuffer RefCounted
2330         (WebCore::GstMappedBuffer::~GstMappedBuffer):
2331         (WebCore::GstMappedBuffer::data):
2332         (WebCore::GstMappedBuffer::data const):
2333         (WebCore::GstMappedBuffer::size const):
2334         (WebCore::GstMappedBuffer::isSharable const): New predicate to
2335         check whether this buffer can be shared (i.e., is not writable)
2336         (WebCore::GstMappedBuffer::GstMappedBuffer):
2337         (WebCore::GstMappedBuffer::operator bool const): Deleted.
2338         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
2339         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
2340         Update to use new API.
2341         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
2342         (WebCore::InitData::InitData): Ditto.
2343         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2344         (webKitMediaClearKeyDecryptorFindAndSetKey): Ditto.
2345         (webKitMediaClearKeyDecryptorDecrypt): Ditto.
2346         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2347         (WebCore::WrappedMockRealtimeAudioSource::render): Ditto.
2348         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
2349         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Ditto.
2350         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
2351         (WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame): Ditto.
2352         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2353         (WebCore::GStreamerVideoEncoder::Fragmentize): Ditto.
2354
2355 2019-01-14  Karl Leplat  <karl.leplat_ext@softathome.com>
2356
2357         [GTK][WPE] Graphic issue with invalidations on composited layers with subpixel positions
2358         https://bugs.webkit.org/show_bug.cgi?id=193239
2359
2360         Reviewed by Žan Doberšek.
2361
2362         Test: compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html
2363
2364         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2365         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers): Use enclosed dirty rect values
2366         when invalidating the CoordinatedBackingStore areas.
2367
2368 2019-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2369
2370         [FreeType] Support emoji modifiers
2371         https://bugs.webkit.org/show_bug.cgi?id=177040
2372
2373         Reviewed by Myles C. Maxfield.
2374
2375         The problem only happens with emojis having the zero with joiner (U+200D) in the sequence. The sequence is
2376         broken because createAndFillGlyphPage() in Font.cpp overwrites zero with joiner with zero width space (U+200B),
2377         but the emoji font actually supports zero with joiner. This patch moves the control characters override from
2378         createAndFillGlyphPage() to GlyphPage::fill() only for FreeType based ports. This way we can do the override
2379         only for the cases where the code point is not supported by the font.
2380
2381         * platform/graphics/Font.cpp:
2382         (WebCore::overrideControlCharacters): Helper function to override the control characters.
2383         (WebCore::createAndFillGlyphPage): Call overrideControlCharacters() only when not using FreeType.
2384         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2385         (WebCore::GlyphPage::fill): Use zero width space as fallback when the font doesn't support characters with
2386         Default_Ignorable Unicode property.
2387
2388 2019-01-13  Dan Bernstein  <mitz@apple.com>
2389
2390         More build fixing.
2391
2392         * editing/cocoa/DictionaryLookup.mm:
2393
2394 2019-01-13  Simon Fraser  <simon.fraser@apple.com>
2395
2396         Minor optimization to RenderText::setRenderedText()
2397         https://bugs.webkit.org/show_bug.cgi?id=193388
2398
2399         Reviewed by Ryosuke Niwa.
2400
2401         Avoid the call to applyTextTransform() if TextTransform is None, so that we don't
2402         have to call previousCharacter() and reassign m_text.
2403         
2404         Similar optimization in RenderText::textWithoutConvertingBackslashToYenSymbol().
2405
2406         Speedometer profiles show a few samples here, but this isn't going to win any prizes.
2407
2408         * rendering/RenderText.cpp:
2409         (WebCore::RenderText::setRenderedText):
2410         (WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const):
2411
2412 2019-01-13  Dan Bernstein  <mitz@apple.com>
2413
2414         Tried to fix the build.
2415
2416         * editing/cocoa/DictionaryLookup.mm:
2417
2418 2019-01-13  Dan Bernstein  <mitz@apple.com>
2419
2420         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
2421
2422         Patch by Keith Rollin.
2423
2424         * accessibility/mac/AXObjectCacheMac.mm:
2425
2426 2019-01-13  Zalan Bujtas  <zalan@apple.com>
2427
2428         [LFC] Adjust assert for statically positioned fixed elements
2429         https://bugs.webkit.org/show_bug.cgi?id=193385
2430
2431         Reviewed by Antti Koivisto.
2432
2433         While computing the static position and traversing the ancestor chain, we can surely hit a positioned container
2434         (since we need to go all the way up to the initial containing block).
2435
2436         * layout/FormattingContextGeometry.cpp:
2437         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
2438         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
2439
2440 2019-01-13  Antti Koivisto  <antti@apple.com>
2441
2442         Release assert with <img usemap> in shadow tree
2443         https://bugs.webkit.org/show_bug.cgi?id=193378
2444
2445         Reviewed by Ryosuke Niwa.
2446
2447         When a shadow host that has <img usemap> in the shadow tree is removed from the document, we try
2448         to remove the map from the scope of the host.
2449
2450         * html/HTMLImageElement.cpp:
2451         (WebCore::HTMLImageElement::parseAttribute):
2452         (WebCore::HTMLImageElement::insertedIntoAncestor):
2453         (WebCore::HTMLImageElement::removedFromAncestor):
2454
2455         Tree scope changes are relevant, not the connection to the document.
2456
2457 2019-01-12  Timothy Hatcher  <timothy@apple.com>
2458
2459         Have prefers-color-scheme: light always match on macOS versions before Mojave.
2460         https://bugs.webkit.org/show_bug.cgi?id=191655
2461         rdar://problem/46074680
2462
2463         Reviewed by Megan Gardner.
2464
2465         Tests: css-dark-mode/older-systems/prefers-color-scheme.html
2466                css-dark-mode/older-systems/supported-color-schemes-css.html
2467                css-dark-mode/older-systems/supported-color-schemes.html
2468
2469         Use new HAVE(OS_DARK_MODE_SUPPORT) to make it easier to find code.
2470         Added HAVE(OS_DARK_MODE_SUPPORT) around more bits to make it work on older systems.
2471
2472         * Configurations/FeatureDefines.xcconfig:
2473         * dom/Document.cpp:
2474         (WebCore::Document::useDarkAppearance const):
2475         * inspector/agents/InspectorPageAgent.cpp:
2476         (WebCore::InspectorPageAgent::enable):
2477         * page/Page.cpp:
2478         (WebCore::Page::setUseDarkAppearance):
2479         (WebCore::Page::useDarkAppearance const):
2480         (WebCore::Page::setUseDarkAppearanceOverride):
2481         * platform/mac/LocalDefaultSystemAppearance.h:
2482         (WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const):
2483         * platform/mac/LocalDefaultSystemAppearance.mm:
2484         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2485         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
2486         * platform/mac/ScrollAnimatorMac.mm:
2487         * rendering/RenderThemeMac.mm:
2488         (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
2489         (-[WebListButtonCell drawWithFrame:inView:]):
2490         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
2491         (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
2492         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
2493         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
2494         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
2495         (WebCore::RenderThemeMac::systemColor const):
2496
2497 2019-01-12  Zalan Bujtas  <zalan@apple.com>
2498
2499         [LFC] Block/InlinFormattingContext should take Block/InlineFormattingState
2500         https://bugs.webkit.org/show_bug.cgi?id=193383
2501
2502         Reviewed by Antti Koivisto.
2503
2504         This is just a downcast really.
2505
2506         * layout/FormattingContext.cpp:
2507         (WebCore::Layout::FormattingContext::FormattingContext):
2508         (WebCore::Layout::FormattingContext::formattingState const): Deleted.
2509         * layout/FormattingContext.h:
2510         * layout/LayoutState.cpp:
2511         (WebCore::Layout::LayoutState::createFormattingContext):
2512         * layout/blockformatting/BlockFormattingContext.cpp:
2513         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
2514         * layout/blockformatting/BlockFormattingContext.h:
2515         (WebCore::Layout::BlockFormattingContext::formattingState const):
2516         (WebCore::Layout::BlockFormattingContext::blockFormattingState const): Deleted.
2517         * layout/inlineformatting/InlineFormattingContext.cpp:
2518         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
2519         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2520         (WebCore::Layout::InlineFormattingContext::createFinalRuns const):
2521         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
2522         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2523         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
2524         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2525         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2526         * layout/inlineformatting/InlineFormattingContext.h:
2527         (WebCore::Layout::InlineFormattingContext::formattingState const):
2528         (WebCore::Layout::InlineFormattingContext::inlineFormattingState const): Deleted.
2529         * page/FrameViewLayoutContext.cpp:
2530         (WebCore::layoutUsingFormattingContext):
2531
2532 2019-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
2533
2534         [WHLSL] Add native function synthesis passes
2535         https://bugs.webkit.org/show_bug.cgi?id=193360
2536
2537         Reviewed by Dean Jackson.
2538
2539         This patch includes all the passes in prepare() that are between the name resolver and the
2540         type checker. It involves a few small pieces:
2541
2542         - CheckDuplicateFunctions which makes sure the same function isn't defined twice
2543         - Intrinsics, which remembers all of the native types so they can be referred to by the
2544           rest of the compiler
2545         - RecursiveTypeChecker which makes sure types don't refer to themselves
2546         - SynthesizeArrayOperatorLength which creates operator.length() functions for arrays
2547         - SynthesizeConstructors which creates copy constructors and default constructors for all
2548           types
2549         - SynthesizeEnumerationFunctions which provides cast operators between enum types and their
2550           base types
2551         - SynthesizeStructureAccessors which provides getters, setters, and anders for each member
2552           of a struct
2553
2554         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2555         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2556
2557         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
2558         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
2559         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
2560         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
2561         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: Added.
2562         (WebCore::WHLSL::checkDuplicateFunctions):
2563         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2564         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Added.
2565         (WebCore::WHLSL::Intrinsics::Intrinsics):
2566         (WebCore::WHLSL::Intrinsics::add):
2567         (WebCore::WHLSL::Intrinsics::addPrimitive):
2568         (WebCore::WHLSL::Intrinsics::addVector):
2569         (WebCore::WHLSL::Intrinsics::addMatrix):
2570         (WebCore::WHLSL::Intrinsics::addFullTexture):
2571         (WebCore::WHLSL::Intrinsics::addDepthTexture):
2572         (WebCore::WHLSL::Intrinsics::addTexture):
2573         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h: Added.
2574         (WebCore::WHLSL::Intrinsics::voidType const):
2575         (WebCore::WHLSL::Intrinsics::boolType const):
2576         (WebCore::WHLSL::Intrinsics::intType const):
2577         (WebCore::WHLSL::Intrinsics::uintType const):
2578         (WebCore::WHLSL::Intrinsics::samplerType const):
2579         (WebCore::WHLSL::Intrinsics::floatType const):
2580         (WebCore::WHLSL::Intrinsics::float3Type const):
2581         (WebCore::WHLSL::Intrinsics::float4Type const):
2582         * Modules/webgpu/WHLSL/WHLSLProgram.h:
2583         (WebCore::WHLSL::Program::append):
2584         (WebCore::WHLSL::Program::intrinsics):
2585         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Added.
2586         (WebCore::WHLSL::checkRecursiveTypes):
2587         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2588         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp: Added.
2589         (WebCore::WHLSL::FindArrayTypes::takeArrayTypes):
2590         (WebCore::WHLSL::synthesizeArrayOperatorLength):
2591         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2592         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Added.
2593         (WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
2594         (WebCore::WHLSL::FindAllTypes::takeNamedTypes):
2595         (WebCore::WHLSL::synthesizeConstructors):
2596         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2597         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Added.
2598         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2599         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2600         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: Added.
2601         (WebCore::WHLSL::synthesizeStructureAccessors):
2602         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2603         * Sources.txt:
2604         * WebCore.xcodeproj/project.pbxproj:
2605
2606 2019-01-12  Dan Bernstein  <mitz@apple.com>
2607
2608         [Cocoa] Avoid importing directly from subumbrella frameworks
2609         https://bugs.webkit.org/show_bug.cgi?id=186016
2610         <rdar://problem/40591038>
2611
2612         Reviewed by Sam Weinig.
2613
2614         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
2615           OTHER_CPLUSPLUSFLAGS.
2616         * editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
2617         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
2618         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
2619
2620 2019-01-12  Zalan Bujtas  <zalan@apple.com>
2621
2622         [LFC] Move formatting context creation from FormattingState to LayoutState
2623         https://bugs.webkit.org/show_bug.cgi?id=193381
2624
2625         Reviewed by Antti Koivisto.
2626
2627         layoutState().createFormattingStateForFormattingRootIfNeeded(root).createFormattingContext(root) is not only mouthful
2628         but also feels unintuitive. Use layoutState().createFormattingContext(root) instead.
2629
2630         * layout/FormattingContext.cpp:
2631         (WebCore::Layout::FormattingContext::FormattingContext):
2632         (WebCore::Layout::FormattingContext::~FormattingContext):
2633         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2634         * layout/FormattingContextGeometry.cpp:
2635         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2636         * layout/FormattingState.h:
2637         * layout/LayoutState.cpp:
2638         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
2639         (WebCore::Layout::LayoutState::createFormattingContext):
2640         * layout/LayoutState.h:
2641         (WebCore::Layout::LayoutState::deregisterFormattingContext):
2642         (WebCore::Layout::LayoutState::registerFormattingContext):
2643         * layout/blockformatting/BlockFormattingContext.cpp:
2644         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2645         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2646         * layout/blockformatting/BlockFormattingState.cpp:
2647         (WebCore::Layout::BlockFormattingState::createFormattingContext): Deleted.
2648         * layout/blockformatting/BlockFormattingState.h:
2649         * layout/inlineformatting/InlineFormattingContext.cpp:
2650         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2651         * layout/inlineformatting/InlineFormattingState.cpp:
2652         (WebCore::Layout::InlineFormattingState::createFormattingContext): Deleted.
2653         * layout/inlineformatting/InlineFormattingState.h:
2654
2655 2019-01-12  Zalan Bujtas  <zalan@apple.com>
2656
2657         [LFC][BFC][MarginCollapsing] Move estimatedMarginBefore flag from state/display box to BlockFormattingContext
2658         https://bugs.webkit.org/show_bug.cgi?id=193375
2659
2660         Reviewed by Antti Koivisto.
2661
2662         The estimated marginBefore is a pre-computed, temporary value. We need to keep it around until the final vertical margin value is computed.
2663         Neither BlockFormattingState nor Display should hold temporary values.
2664
2665         * layout/blockformatting/BlockFormattingContext.cpp:
2666         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
2667         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
2668         (WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const):
2669         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2670         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2671         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2672         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2673         (WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore const):
2674         (WebCore::Layout::BlockFormattingContext::hasEstimatedMarginBefore const):
2675         (WebCore::Layout::hasPrecomputedMarginBefore): Deleted.
2676         * layout/blockformatting/BlockFormattingContext.h:
2677         (WebCore::Layout::BlockFormattingContext::removeEstimatedMarginBefore const):
2678         (WebCore::Layout::BlockFormattingContext::estimatedMarginBefore const):
2679         * layout/blockformatting/BlockFormattingState.h:
2680         (WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore): Deleted.
2681         (WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore): Deleted.
2682         (WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const): Deleted.
2683         * layout/displaytree/DisplayBox.cpp:
2684         (WebCore::Display::Box::Box):
2685         * layout/displaytree/DisplayBox.h:
2686         (WebCore::Display::Box::setHasEstimatedMarginBefore):
2687         (WebCore::Display::Box::invalidateEstimatedMarginBefore):
2688         (WebCore::Display::Box::top const):
2689         (WebCore::Display::Box::topLeft const):
2690         (WebCore::Display::Box::setEstimatedMarginBefore): Deleted.
2691         (WebCore::Display::Box::estimatedMarginBefore const): Deleted.
2692         * page/FrameViewLayoutContext.cpp:
2693         (WebCore::layoutUsingFormattingContext):
2694
2695 2019-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
2696
2697         [WHLSL] Implement the NameResolver
2698         https://bugs.webkit.org/show_bug.cgi?id=193007
2699
2700         Reviewed by Dean Jackson.
2701
2702         This is the base implementation for WHLSL's name resolver. The name resolver matches three kinds of things:
2703         1. It matches VariableRefs to VariableDecls
2704         2. It matches TypeRefs to NamedTypes
2705         3. It matches CallExpressions to FunctionDeclarations
2706
2707         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2708         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2709
2710         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Now that InferTypes.h exists, we can implement these
2711         functions.
2712         (WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
2713         (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
2714         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Remove unnecessary function.
2715         (WebCore::WHLSL::AST::FloatLiteralType::value const): Deleted.
2716         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement these
2717         functions.
2718         (WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
2719         (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
2720         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Remove unnecessary function.
2721         (WebCore::WHLSL::AST::IntegerLiteralType::value const): Deleted.
2722         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Modifying Sources.txt caused the sources
2723         to get shuffled around, so the #includes need to be fixed.
2724         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement
2725         these functions.
2726         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
2727         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
2728         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Remove unnecessary function.
2729         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const): Deleted.
2730         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: Added. This is the replacement for UnificationContext in the
2731         reference compiler. It's much simpler (and we should remove UnificationContext in the reference compiler in
2732         favor of this design). It has three sets of functions: Tell if two types are the same, tell if two types are
2733         the same and commit the resolvable type, and run the above functions on type references or function arguments.
2734         (WebCore::WHLSL::matches):
2735         (WebCore::WHLSL::matchAndCommit):
2736         (WebCore::WHLSL::commit):
2737         (WebCore::WHLSL::inferTypesForTypeArguments):
2738         (WebCore::WHLSL::inferTypesForCall):
2739         * Modules/webgpu/WHLSL/WHLSLInferTypes.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
2740         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp: Added. This is the data structure that remembers NamedTypes,
2741         FunctionDeclarations, and VariableDeclarations so NameResolver can work.
2742         (WebCore::WHLSL::NameContext::NameContext):
2743         (WebCore::WHLSL::NameContext::add):
2744         (WebCore::WHLSL::NameContext::getTypes):
2745         (WebCore::WHLSL::NameContext::getFunctions):
2746         (WebCore::WHLSL::NameContext::getVariable):
2747         (WebCore::WHLSL::NameContext::exists):
2748         * Modules/webgpu/WHLSL/WHLSLNameContext.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
2749         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Added. Use the NameContext to match up the three types of names.
2750         (WebCore::WHLSL::NameResolver::NameResolver):
2751         (WebCore::WHLSL::NameResolver::visit):
2752         (WebCore::WHLSL::resolveNamesInTypes):
2753         (WebCore::WHLSL::resolveNamesInFunctions):
2754         * Modules/webgpu/WHLSL/WHLSLNameResolver.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
2755         (WebCore::WHLSL::NameResolver::setCurrentFunctionDefinition):
2756         * Modules/webgpu/WHLSL/WHLSLProgram.h:
2757         (WebCore::WHLSL::Program::append): The parser needs to add all global declarations to the name context so the
2758         name resolver is ready to go as soon as parsing is finished.
2759         (WebCore::WHLSL::Program::nameContext):
2760         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp: Added. Pick the appropriate FunctionDeclaration or
2761         NamedType for a particular CallExpression or TypeReference.
2762         (WebCore::WHLSL::conversionCost):
2763         (WebCore::WHLSL::resolveFunctionOverloadImpl):
2764         (WebCore::WHLSL::resolveTypeOverloadImpl):
2765         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
2766         * Modules/webgpu/WHLSL/WHLSLResolvingType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp. This describes the two states that a type in the type resolver can be in: either an owned
2767         UnnamedType, or a reference to a ResolvableType. This is because every expression needs to have a type
2768         associated with it, but those types might be the type of a literal (aka a ResolvableType). Multiple
2769         expressions might need to reference the same ResolvableType so when it gets resolved, all the expressions
2770         get the result.
2771         (WebCore::WHLSL::ResolvableTypeReference::ResolvableTypeReference):
2772         (WebCore::WHLSL::ResolvableTypeReference::resolvableType):
2773         * Sources.txt:
2774         * WebCore.xcodeproj/project.pbxproj:
2775
2776 2019-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
2777
2778         [WHLSL] Add a Visitor class
2779         https://bugs.webkit.org/show_bug.cgi?id=192826
2780
2781         Reviewed by Dean Jackson.
2782
2783         This patch exposes a bunch of the private members of WHLSL's AST nodes so that Visitor can recurse on constituent nodes.
2784         It also writes the recursion in Visitor.h. This is a virtual base class that gets subclassed for compiler passes.
2785
2786         I've split this part into its own patch to aid reviewing of the compiler.
2787
2788         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
2789         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: Added.
2790         (WebCore::WHLSL::Visitor::visit):
2791         (WebCore::WHLSL::Visitor::checkErrorAndVisit):
2792         * Modules/webgpu/WHLSL/WHLSLVisitor.h: Added.
2793         (WebCore::WHLSL::Visitor::setError):
2794         (WebCore::WHLSL::Visitor::error const):
2795         * Sources.txt:
2796         * WebCore.xcodeproj/project.pbxproj:
2797
2798 2019-01-11  Jer Noble  <jer.noble@apple.com>
2799
2800         REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
2801         https://bugs.webkit.org/show_bug.cgi?id=193342
2802         <rdar://problem/47119836>
2803
2804         Reviewed by Eric Carlson.
2805
2806         Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.
2807
2808         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
2809         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2810         (WebCore::AudioSourceProviderAVFObjC::initCallback):
2811         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
2812
2813 2019-01-11  John Wilander  <wilander@apple.com>
2814
2815         Compile out Web API Statistics Collection
2816         https://bugs.webkit.org/show_bug.cgi?id=193370
2817         <rdar://problem/45388584>
2818
2819         Reviewed by Brent Fulgham.
2820
2821         No new tests. This patch disables functionality. The associated tests
2822         are skipped.
2823
2824         These functions are now no-ops unless web API statistics is enabled.
2825
2826         * Configurations/FeatureDefines.xcconfig:
2827         * loader/ResourceLoadObserver.cpp:
2828         (WebCore::ResourceLoadObserver::logFontLoad):
2829         (WebCore::ResourceLoadObserver::logCanvasRead):
2830         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
2831         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
2832         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
2833         * loader/ResourceLoadStatistics.cpp:
2834         (WebCore::ResourceLoadStatistics::encode const):
2835         (WebCore::ResourceLoadStatistics::decode):
2836         (WebCore::ResourceLoadStatistics::toString const):
2837         (WebCore::ResourceLoadStatistics::merge):
2838         * loader/ResourceLoadStatistics.h:
2839             The associated struct members are skipped unless web API
2840             statistics is enabled.
2841
2842 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
2843
2844         IndexedDB: leak WebIDBConnectionToClient for retain cycle
2845         https://bugs.webkit.org/show_bug.cgi?id=193097
2846         <rdar://problem/46899601>
2847
2848         Reviewed by Brady Eidson.
2849
2850         Let IDBConnectionToClient hold a WeakPtr of IDBConnectionToClientDelegate.
2851
2852         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2853         (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
2854         (WebCore::IDBServer::IDBConnectionToClient::identifier const):
2855         (WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase):
2856         (WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase):
2857         (WebCore::IDBServer::IDBConnectionToClient::didAbortTransaction):
2858         (WebCore::IDBServer::IDBConnectionToClient::didCreateObjectStore):
2859         (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
2860         (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
2861         (WebCore::IDBServer::IDBConnectionToClient::didClearObjectStore):
2862         (WebCore::IDBServer::IDBConnectionToClient::didCreateIndex):
2863         (WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex):
2864         (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
2865         (WebCore::IDBServer::IDBConnectionToClient::didPutOrAdd):
2866         (WebCore::IDBServer::IDBConnectionToClient::didGetRecord):
2867         (WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
2868         (WebCore::IDBServer::IDBConnectionToClient::didGetCount):
2869         (WebCore::IDBServer::IDBConnectionToClient::didDeleteRecord):
2870         (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
2871         (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
2872         (WebCore::IDBServer::IDBConnectionToClient::didCommitTransaction):
2873         (WebCore::IDBServer::IDBConnectionToClient::fireVersionChangeEvent):
2874         (WebCore::IDBServer::IDBConnectionToClient::didStartTransaction):
2875         (WebCore::IDBServer::IDBConnectionToClient::didCloseFromServer):
2876         (WebCore::IDBServer::IDBConnectionToClient::notifyOpenDBRequestBlocked):
2877         (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames):
2878         * Modules/indexeddb/server/IDBConnectionToClient.h:
2879         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2880
2881 2019-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
2882
2883         Fix the build after r239844
2884         https://bugs.webkit.org/show_bug.cgi?id=192991
2885
2886         Unreviewed.
2887
2888         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
2889         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
2890         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
2891         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
2892
2893 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2894
2895         [iOS] Precision drop state thrashes when dragging near the top edge of an editable element
2896         https://bugs.webkit.org/show_bug.cgi?id=193364
2897         <rdar://problem/47214117>
2898
2899         Reviewed by Tim Horton.
2900
2901         Add a new helper method on DragCaretController to compute the bounds of the editable element around the drop
2902         caret position. This is either the enclosing form control (in the case of text fields and text areas), or the
2903         highest editable root. See WebKit ChangeLog for more details.
2904
2905         Test: DragAndDropTests.AvoidPreciseDropNearTopOfTextArea
2906
2907         * editing/FrameSelection.cpp:
2908         (WebCore::DragCaretController::editableElementRectInRootViewCoordinates const):
2909         * editing/FrameSelection.h:
2910
2911 2019-01-11  Tim Horton  <timothy_horton@apple.com>
2912
2913         REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
2914         https://bugs.webkit.org/show_bug.cgi?id=193366
2915         <rdar://problem/46097212>
2916
2917         Reviewed by Simon Fraser.
2918
2919         * platform/RuntimeApplicationChecks.h:
2920         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2921         (WebCore::IOSApplication::isFirefox):
2922         Add a Firefox Mobile bundle check.
2923
2924 2019-01-11  Antti Koivisto  <antti@apple.com>
2925
2926         Release assert when removing element with a map element in the shadow tree
2927         https://bugs.webkit.org/show_bug.cgi?id=193351
2928         <rdar://problem/47208807>
2929
2930         Reviewed by Ryosuke Niwa.
2931
2932         When a shadow host that has a map element in the shadow tree is removed from the document, we try
2933         to remove the map from the scope of the host.
2934
2935         Test: fast/shadow-dom/image-map-tree-scope.html
2936
2937         * html/HTMLMapElement.cpp:
2938         (WebCore::HTMLMapElement::insertedIntoAncestor):
2939         (WebCore::HTMLMapElement::removedFromAncestor):
2940
2941         Add and remove image maps when the scope changes, not when the document changes.
2942         This matches how id/name/etc updates work in the HTMLElement.
2943
2944 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
2945
2946         Fix an assertion in UniqueIDBDatabase
2947         https://bugs.webkit.org/show_bug.cgi?id=193096
2948
2949         Reviewed by Brady Eidson.
2950
2951         m_objectStoreTransactionCounts.count(objectStore) == 1 in UniqueIDBDatabase::operationAndTransactionTimerFired()
2952         is not necessarily true because m_objectStoreTransactionCounts may be cleared in immediateCloseForUserDelete.
2953
2954         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2955         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
2956
2957 2019-01-11  Miguel Gomez  <magomez@igalia.com>
2958
2959         [GTK] Garbled rendering on Youtube while scrolling under X11.
2960         https://bugs.webkit.org/show_bug.cgi?id=192982
2961
2962         Reviewed by Carlos Garcia Campos.
2963
2964         When creating a GLX window context, try to get a GLXFBConfig that has depth and stencil buffers for
2965         the default framebuffer.
2966
2967         * platform/graphics/glx/GLContextGLX.cpp:
2968         (WebCore::compatibleVisuals):
2969         (WebCore::GLContextGLX::createWindowContext):
2970
2971 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
2972
2973         IndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests
2974         https://bugs.webkit.org/show_bug.cgi?id=193167
2975         <rdar://problem/46891688>
2976
2977         Reviewed by Geoffrey Garen.
2978
2979         Do some cleanup to break retain cycle when context is stopped. 
2980
2981         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2982         (WebCore::IDBOpenDBRequest::cancelForStop):
2983         * Modules/indexeddb/IDBTransaction.cpp:
2984         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
2985         (WebCore::IDBTransaction::stop):
2986         (WebCore::IDBTransaction::removeRequest):
2987         * Modules/indexeddb/client/TransactionOperation.h:
2988         (WebCore::IDBClient::TransactionOperation::doComplete):
2989
2990 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2991
2992         Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
2993         https://bugs.webkit.org/show_bug.cgi?id=193109
2994         <rdar://problem/44807048>
2995
2996         Reviewed by Ryosuke Niwa.
2997
2998         Adds new IDL files and stubs for UndoManager and UndoItem. This is an experimental DOM API that (in the near
2999         future) is intended only for use in internal WebKit text editing clients. This API allows the page to
3000         participate in the processes of undoing and redoing by defining custom undo and redo handlers, to be executed
3001         when undo or redo is triggered.
3002
3003         Tests: editing/undo-manager/undo-manager-interfaces.html
3004                editing/undo-manager/undo-manager-keeps-wrapper-alive.html
3005
3006         * CMakeLists.txt:
3007         * DerivedSources-input.xcfilelist:
3008         * DerivedSources-output.xcfilelist:
3009         * DerivedSources.make:
3010         * Sources.txt:
3011         * UnifiedSources-input.xcfilelist:
3012         * WebCore.xcodeproj/project.pbxproj:
3013
3014         Add new source files.
3015
3016         * bindings/js/WebCoreBuiltinNames.h:
3017
3018         Add "UndoManager" and "UndoItem" names.
3019
3020         * dom/Document.cpp:
3021         (WebCore::m_undoManager):
3022
3023         Have the document own a UndoManager.
3024
3025         * dom/Document.h:
3026         (WebCore::Document::undoManager const):
3027         * dom/Document.idl:
3028         * page/RuntimeEnabledFeatures.h:
3029         (WebCore::RuntimeEnabledFeatures::setUndoManagerAPIEnabled):
3030         (WebCore::RuntimeEnabledFeatures::undoManagerAPIEnabled const):
3031
3032         Guard the new bindings behind a runtime-enabled feature flag.
3033
3034         * page/UndoItem.h: Added.
3035         (WebCore::UndoItem::create):
3036         (WebCore::UndoItem::label const):
3037         (WebCore::UndoItem::undoHandler const):
3038         (WebCore::UndoItem::redoHandler const):
3039         (WebCore::UndoItem::UndoItem):
3040         * page/UndoItem.idl: Added.
3041         * page/UndoManager.cpp: Added.
3042         (WebCore::UndoManager::addItem):
3043         * page/UndoManager.h: Added.
3044         (WebCore::UndoManager::create):
3045         (WebCore::UndoManager::document):
3046         (WebCore::UndoManager::UndoManager):
3047         * page/UndoManager.idl: Added.
3048         * page/mac/WheelEventDeltaFilterMac.h:
3049
3050         Necessary (albeit unrelated) build fix to appease unified sources.
3051
3052 2019-01-11  Zalan Bujtas  <zalan@apple.com>
3053
3054         [LFC][BFC][MarginCollapsing] Adjust vertical position when box margin collapses through.
3055         https://bugs.webkit.org/show_bug.cgi?id=193346
3056
3057         Reviewed by Antti Koivisto.
3058
3059         If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it.
3060         In this case, the position of the element depends on its relationship with the other elements whose margins are being collapsed.
3061
3062         1. If the element's margins are collapsed with its parent's top margin, the top border edge of the box is defined to be the same as the parent's.
3063         2. Otherwise, either the element's parent is not taking part in the margin collapsing, or only the parent's bottom margin is involved.
3064            The position of the element's top border edge is the same as it would have been if the element had a non-zero bottom border.
3065
3066         Test: fast/block/block-only/collapsed-through-with-parent.html
3067
3068         * layout/MarginTypes.h:
3069         (WebCore::Layout::EstimatedMarginBefore::usedValue const):
3070         * layout/blockformatting/BlockFormattingContext.cpp:
3071         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
3072         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3073         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
3074         * layout/blockformatting/BlockFormattingContext.h:
3075         * layout/blockformatting/BlockMarginCollapse.cpp:
3076         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
3077         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
3078
3079 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
3080
3081         [WHLSL] Include the standard library
3082         https://bugs.webkit.org/show_bug.cgi?id=192994
3083
3084         Reviewed by Jon Lee.
3085
3086         A small section of the standard library is present in WHLSLStandardLibrary.txt. This gets turned into a header file containing
3087         its raw data at build time by invoking our xxd.pl script (which WebCore already uses for other purposes). The standard
3088         library is generated by running a JavaScript script, but currently there is no way to invoke JavaScript from our build
3089         process, so this patch includes in the standard library's raw text instead. Once the parser is faster, we can include the
3090         entire standard library.
3091
3092         No new tests because it isn't hooked up yet.
3093
3094         * DerivedSources.make:
3095         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Added.
3096         * WebCore.xcodeproj/project.pbxproj:
3097
3098 2019-01-10  Jer Noble  <jer.noble@apple.com>
3099
3100         <video> elements do not enter 'paused' state when playing to end over AirPlay
3101         https://bugs.webkit.org/show_bug.cgi?id=193295
3102         <rdar://problem/46708670>
3103
3104         Reviewed by Eric Carlson.
3105
3106         Adopt the -[AVPlayer timeControlStatus] API, which reports whether the AVPlayer is paused, playing, or blocked waiting
3107         for more data before playing. AirPlay devices report this state back from the remote device, and this allows the
3108         MediaPlayerPrivateAVFoundationObjC to differentiate between user-generated pauses and simple stalling.
3109
3110         Adopting this API allows us to remove the heuristic from rateChanged() which inteprets a rate change when the
3111         readyState > HAVE_ENOUGH as an intentional pause.
3112
3113         Drive-by fix: MediaPlayerPrivateAVFoundation had some code to delay calling platformPlay()
3114         until the first frame became available. But this code was entirely undermined by the previous
3115         behavior of setRate(). Fixing setRate()/setRateDouble() to only start playback if playback was
3116         actually requested started making this code work for the first time, and broke some API tests.
3117         Thus, we're removing this previously dead code.
3118
3119         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3120         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
3121         (WebCore::MediaPlayerPrivateAVFoundation::play):
3122         (WebCore::MediaPlayerPrivateAVFoundation::pause):
3123         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
3124         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
3125         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3126         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3127         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3128         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
3129         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3130         (WebCore::MediaPlayerPrivateAVFoundationObjC::didEnd):
3131         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
3132         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
3133         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
3134         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble):
3135         (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate):
3136         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
3137         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
3138         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3139
3140 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
3141
3142         Fix the build after r239844
3143         https://bugs.webkit.org/show_bug.cgi?id=192991
3144
3145         Unreviewed.
3146
3147         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
3148         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
3149         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
3150         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
3151         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
3152         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
3153         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
3154         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
3155         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
3156         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
3157         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
3158         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
3159
3160 2019-01-10  Justin Fan  <justin_fan@apple.com>
3161
3162         [WebGPU] WebGPUBindGroup and device::createBindGroup prototype
3163         https://bugs.webkit.org/show_bug.cgi?id=193341
3164
3165         Reviewed by Myles C. Maxfield.
3166
3167         Add *GPUBindGroup class stubs and the ability to create WebGPUBindGroups via the API.
3168
3169         Test: bind-groups.html
3170
3171         * CMakeLists.txt:
3172         * DerivedSources.make:
3173         * Sources.txt:
3174         * WebCore.xcodeproj/project.pbxproj:
3175         * bindings/js/WebCoreBuiltinNames.h:
3176
3177         * Modules/webgpu/WebGPUBindGroup.cpp:
3178         (WebCore::WebGPUBindGroup::create):
3179         (WebCore::WebGPUBindGroup::WebGPUBindGroup):
3180         * Modules/webgpu/WebGPUBindGroup.h:
3181         * Modules/webgpu/WebGPUBindGroup.idl: Enable createBindGroup().
3182         * Modules/webgpu/WebGPUDevice.cpp:
3183         (WebCore::BindingResourceVisitor::operator() const): Added. Validate and convert WebGPUBindGroupDescriptor to GPU* version.
3184         (WebCore::WebGPUDevice::createBindGroup const): Added.
3185         * Modules/webgpu/WebGPUDevice.h:
3186         * platform/graphics/gpu/GPUBindGroup.cpp:
3187         (WebCore::GPUBindGroup::create):
3188         (WebCore::GPUBindGroup::GPUBindGroup):
3189         * platform/graphics/gpu/GPUBindGroup.h:
3190         * platform/graphics/gpu/GPUBufferBinding.h:
3191         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3192         (WebCore::appendArgumentToArray): Pass RetainPtr by reference to actually update descriptor.
3193
3194 2019-01-10  Simon Fraser  <simon.fraser@apple.com>
3195
3196         Fix rare crash under ScrollbarThemeMac::paintScrollCorner()
3197         https://bugs.webkit.org/show_bug.cgi?id=193337
3198         rdar://problem/47179993
3199
3200         Reviewed by Zalan Bujtas.
3201         
3202         Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint,
3203         which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars()
3204         which tried to get at the platform context, and then crashed.
3205         
3206         So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified
3207         that other scrollbar-related painting code paths were already protected.
3208
3209         Hard to test because it depends on async image decoding timing.
3210
3211         * platform/mac/ScrollbarThemeMac.mm:
3212         (WebCore::ScrollbarThemeMac::paint):
3213         (WebCore::ScrollbarThemeMac::paintScrollCorner):
3214
3215 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
3216
3217         [WHLSL] Implement parser AST nodes
3218         https://bugs.webkit.org/show_bug.cgi?id=192991
3219
3220         Reviewed by Alex Christensen.
3221
3222         This patch creates all the AST nodes which will be the result of running the parser.
3223         This patch used to be a part of the "create a WHLSL parser" patch but I split them
3224         out in order to aid reviewing.
3225
3226         The classes were mechanically created to match the result of the parser. There are
3227         nodes for things like ForLoops, LogicalNotExpressions, DereferenceExpressions,
3228         StructureDefinitions, and things like that. The classes don't actually have any logic
3229         in them - they are currently just containers to hold the structure of the parsed
3230         program. Some of these nodes (like constexprs) are just Variants of the various things
3231         they can in the form of.
3232
3233         No new tests because the parser doesn't exist to create the new AST nodes yet.
3234
3235         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: Added.
3236         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
3237         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: Added.
3238         (WebCore::WHLSL::AST::ArrayType::ArrayType):
3239         (WebCore::WHLSL::AST::ArrayType::type const):
3240         (WebCore::WHLSL::AST::ArrayType::type):
3241         (WebCore::WHLSL::AST::ArrayType::numElements const):
3242         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: Added.
3243         (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
3244         (WebCore::WHLSL::AST::AssignmentExpression::left):
3245         (WebCore::WHLSL::AST::AssignmentExpression::right):
3246         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h: Added.
3247         (WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
3248         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h: Added.
3249         (WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
3250         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h: Added.
3251         (WebCore::WHLSL::AST::Block::Block):
3252         (WebCore::WHLSL::AST::Block::statements):
3253         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h: Added.
3254         (WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
3255         (WebCore::WHLSL::AST::BooleanLiteral::value const):
3256         (WebCore::WHLSL::AST::BooleanLiteral::clone const):
3257         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h: Added.
3258         (WebCore::WHLSL::AST::Break::Break):
3259         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp: Added.
3260         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
3261         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
3262         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: Added.
3263         (WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
3264         (WebCore::WHLSL::AST::BuiltInSemantic::variable const):
3265         (WebCore::WHLSL::AST::BuiltInSemantic::operator== const):
3266         (WebCore::WHLSL::AST::BuiltInSemantic::operator!= const):
3267         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Added.
3268         (WebCore::WHLSL::AST::CallExpression::CallExpression):
3269         (WebCore::WHLSL::AST::CallExpression::arguments):
3270         (WebCore::WHLSL::AST::CallExpression::name):
3271         (WebCore::WHLSL::AST::CallExpression::setCastData):
3272         (WebCore::WHLSL::AST::CallExpression::isCast):
3273         (WebCore::WHLSL::AST::CallExpression::castReturnType):
3274         (WebCore::WHLSL::AST::CallExpression::hasOverloads const):
3275         (WebCore::WHLSL::AST::CallExpression::overloads):
3276         (WebCore::WHLSL::AST::CallExpression::setOverloads):
3277         (WebCore::WHLSL::AST::CallExpression::setFunction):
3278         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h: Added.
3279         (WebCore::WHLSL::AST::CommaExpression::CommaExpression):
3280         (WebCore::WHLSL::AST::CommaExpression::list):
3281         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: Added.
3282         (WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
3283         (WebCore::WHLSL::AST::ConstantExpression::integerLiteral):
3284         (WebCore::WHLSL::AST::ConstantExpression::visit):
3285         (WebCore::WHLSL::AST::ConstantExpression::visit const):
3286         (WebCore::WHLSL::AST::ConstantExpression::clone const):
3287         (WebCore::WHLSL::AST::ConstantExpression::matches const):
3288         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Added.
3289         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::ConstantExpressionEnumerationMemberReference):
3290         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::left const):
3291         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::right const):
3292         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::clone const):
3293         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition):
3294         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition const):
3295         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember):
3296         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember const):
3297         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::setEnumerationMember):
3298         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h: Added.
3299         (WebCore::WHLSL::AST::Continue::Continue):
3300         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h: Added.
3301         (WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
3302         (WebCore::WHLSL::AST::DereferenceExpression::pointer):
3303         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h: Added.
3304         (WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
3305         (WebCore::WHLSL::AST::DoWhileLoop::body):
3306         (WebCore::WHLSL::AST::DoWhileLoop::conditional):
3307         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h: Added.
3308         (WebCore::WHLSL::AST::DotExpression::DotExpression):
3309         (WebCore::WHLSL::AST::DotExpression::fieldName):
3310         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h: Added.
3311         (WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
3312         (WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
3313         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: Added.
3314         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
3315         (WebCore::WHLSL::AST::EnumerationDefinition::type):
3316         (WebCore::WHLSL::AST::EnumerationDefinition::add):
3317         (WebCore::WHLSL::AST::EnumerationDefinition::memberByName):
3318         (WebCore::WHLSL::AST::EnumerationDefinition::enumerationMembers):
3319         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: Added.
3320         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
3321         (WebCore::WHLSL::AST::EnumerationMember::origin const):
3322         (WebCore::WHLSL::AST::EnumerationMember::name):
3323         (WebCore::WHLSL::AST::EnumerationMember::value):
3324         (WebCore::WHLSL::AST::EnumerationMember::setValue):
3325         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h: Added.
3326         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
3327         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
3328         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h: Added.
3329         (WebCore::WHLSL::AST::Expression::Expression):
3330         (WebCore::WHLSL::AST::Expression::origin const):
3331         (WebCore::WHLSL::AST::Expression::isAssignmentExpression const):
3332         (WebCore::WHLSL::AST::Expression::isBooleanLiteral const):
3333         (WebCore::WHLSL::AST::Expression::isCallExpression const):
3334         (WebCore::WHLSL::AST::Expression::isCommaExpression const):
3335         (WebCore::WHLSL::AST::Expression::isDereferenceExpression const):
3336         (WebCore::WHLSL::AST::Expression::isDotExpression const):
3337         (WebCore::WHLSL::AST::Expression::isFloatLiteral const):
3338         (WebCore::WHLSL::AST::Expression::isIndexExpression const):
3339         (WebCore::WHLSL::AST::Expression::isIntegerLiteral const):
3340         (WebCore::WHLSL::AST::Expression::isLogicalExpression const):
3341         (WebCore::WHLSL::AST::Expression::isLogicalNotExpression const):
3342         (WebCore::WHLSL::AST::Expression::isMakeArrayReferenceExpression const):
3343         (WebCore::WHLSL::AST::Expression::isMakePointerExpression const):
3344         (WebCore::WHLSL::AST::Expression::isNullLiteral const):
3345         (WebCore::WHLSL::AST::Expression::isPropertyAccessExpression const):
3346         (WebCore::WHLSL::AST::Expression::isReadModifyWriteExpression const):
3347         (WebCore::WHLSL::AST::Expression::isTernaryExpression const):
3348         (WebCore::WHLSL::AST::Expression::isUnsignedIntegerLiteral const):
3349         (WebCore::WHLSL::AST::Expression::isVariableReference const):
3350         (WebCore::WHLSL::AST::Expression::isEnumerationMemberLiteral const):
3351         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h: Added.
3352         (WebCore::WHLSL::AST::Fallthrough::Fallthrough):
3353         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h: Added.
3354         (WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
3355         (WebCore::WHLSL::AST::FloatLiteral::type):
3356         (WebCore::WHLSL::AST::FloatLiteral::value const):
3357         (WebCore::WHLSL::AST::FloatLiteral::clone const):
3358         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Added.
3359         (WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
3360         (WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
3361         (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
3362         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Added.
3363         (WebCore::WHLSL::AST::FloatLiteralType::preferredType):
3364         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: Added.
3365         (WebCore::WHLSL::AST::ForLoop::ForLoop):
3366         (WebCore::WHLSL::AST::ForLoop::~ForLoop):
3367         (WebCore::WHLSL::AST::ForLoop::initialization):
3368         (WebCore::WHLSL::AST::ForLoop::condition):
3369         (WebCore::WHLSL::AST::ForLoop::increment):
3370         (WebCore::WHLSL::AST::ForLoop::body):
3371         * Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h: Added.
3372         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: Added.
3373         (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
3374         (WebCore::WHLSL::AST::FunctionDeclaration::isFunctionDefinition const):
3375         (WebCore::WHLSL::AST::FunctionDeclaration::isNativeFunctionDeclaration const):
3376         (WebCore::WHLSL::AST::FunctionDeclaration::attributeBlock):
3377         (WebCore::WHLSL::AST::FunctionDeclaration::entryPointType const):
3378         (WebCore::WHLSL::AST::FunctionDeclaration::type const):
3379         (WebCore::WHLSL::AST::FunctionDeclaration::type):
3380         (WebCore::WHLSL::AST::FunctionDeclaration::name const):
3381         (WebCore::WHLSL::AST::FunctionDeclaration::isCast const):
3382         (WebCore::WHLSL::AST::FunctionDeclaration::parameters const):
3383         (WebCore::WHLSL::AST::FunctionDeclaration::parameters):
3384         (WebCore::WHLSL::AST::FunctionDeclaration::semantic):
3385         (WebCore::WHLSL::AST::FunctionDeclaration::isOperator const):
3386         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h: Added.
3387         (WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
3388         (WebCore::WHLSL::AST::FunctionDefinition::block):
3389         (WebCore::WHLSL::AST::FunctionDefinition::restricted const):
3390         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h: Added.
3391         (WebCore::WHLSL::AST::IfStatement::IfStatement):
3392         (WebCore::WHLSL::AST::IfStatement::conditional):
3393         (WebCore::WHLSL::AST::IfStatement::body):
3394         (WebCore::WHLSL::AST::IfStatement::elseBody):
3395         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: Added.
3396         (WebCore::WHLSL::AST::IndexExpression::IndexExpression):
3397         (WebCore::WHLSL::AST::IndexExpression::indexExpression):
3398         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp: Added.
3399         (WebCore::WHLSL::AST::IntegerLiteral::valueForSelectedType const):
3400         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h: Added.
3401         (WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
3402         (WebCore::WHLSL::AST::IntegerLiteral::type):
3403         (WebCore::WHLSL::AST::IntegerLiteral::value const):
3404         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
3405         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Added.
3406         (WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
3407         (WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
3408         (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
3409         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Added.
3410         (WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
3411         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h: Added.
3412         (WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
3413         (WebCore::WHLSL::AST::LogicalExpression::type const):
3414         (WebCore::WHLSL::AST::LogicalExpression::left):
3415         (WebCore::WHLSL::AST::LogicalExpression::right):
3416         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h: Added.
3417         (WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
3418         (WebCore::WHLSL::AST::LogicalNotExpression::operand):
3419         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: Added.
3420         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
3421         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
3422         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: Added.
3423         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
3424         (WebCore::WHLSL::AST::MakePointerExpression::lValue):
3425         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h: Added.
3426         (WebCore::WHLSL::AST::NamedType::NamedType):
3427         (WebCore::WHLSL::AST::NamedType::origin const):
3428         (WebCore::WHLSL::AST::NamedType::name):
3429         (WebCore::WHLSL::AST::NamedType::isTypeDefinition const):
3430         (WebCore::WHLSL::AST::NamedType::isStructureDefinition const):
3431         (WebCore::WHLSL::AST::NamedType::isEnumerationDefinition const):
3432         (WebCore::WHLSL::AST::NamedType::isNativeTypeDeclaration const):
3433         (WebCore::WHLSL::AST::NamedType::unifyNode const):
3434         (WebCore::WHLSL::AST::NamedType::unifyNode):
3435         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h: Added.
3436         (WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
3437         (WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const):
3438         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Added.
3439         (WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
3440         (WebCore::WHLSL::AST::NativeTypeDeclaration::name const):
3441         (WebCore::WHLSL::AST::NativeTypeDeclaration::name):
3442         (WebCore::WHLSL::AST::NativeTypeDeclaration::typeArguments):
3443         (WebCore::WHLSL::AST::NativeTypeDeclaration::isInt const):
3444         (WebCore::WHLSL::AST::NativeTypeDeclaration::isNumber const):
3445         (WebCore::WHLSL::AST::NativeTypeDeclaration::isFloating const):
3446         (WebCore::WHLSL::AST::NativeTypeDeclaration::isVector const):
3447         (WebCore::WHLSL::AST::NativeTypeDeclaration::isMatrix const):
3448         (WebCore::WHLSL::AST::NativeTypeDeclaration::isTexture const):
3449         (WebCore::WHLSL::AST::NativeTypeDeclaration::isSigned const):
3450         (WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<bool const):
3451         (WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<int64_t const):
3452         (WebCore::WHLSL::AST::NativeTypeDeclaration::iterateAllValues):
3453         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsInt):
3454         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsNumber):
3455         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsFloating):
3456         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsVector):
3457         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsMatrix):
3458         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTexture):
3459         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsSigned):
3460         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentInteger):
3461         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentUnsignedInteger):
3462         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentFloat):
3463         (WebCore::WHLSL::AST::NativeTypeDeclaration::setSuccessor):
3464         (WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromInteger):
3465         (WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromUnsignedInteger):
3466         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIterateAllValues):
3467         * Modules/webgpu/WHLSL/AST/WHLSLNode.h: Added.
3468         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h: Added.
3469         (WebCore::WHLSL::AST::NullLiteral::NullLiteral):
3470         (WebCore::WHLSL::AST::NullLiteral::type):
3471         (WebCore::WHLSL::AST::NullLiteral::clone const):
3472         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.cpp: Added.
3473         (WebCore::WHLSL::AST::NullLiteralType::canResolve const):
3474         (WebCore::WHLSL::AST::NullLiteralType::conversionCost const):
3475         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h: Added.
3476         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h: Added.
3477         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
3478         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::width const):
3479         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::height const):
3480         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::depth const):
3481         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h: Added.
3482         (WebCore::WHLSL::AST::PointerType::PointerType):
3483         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: Added.
3484         (WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
3485         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetOverloads):
3486         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetOverloads):
3487         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAndOverloads):
3488         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetOverloads):
3489         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetOverloads):
3490         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAndOverloads):
3491         (WebCore::WHLSL::AST::PropertyAccessExpression::base):
3492         * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h: Added.
3493         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: Added.
3494         (WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
3495         (WebCore::WHLSL::AST::ReadModifyWriteExpression::setNewValueExpression):
3496         (WebCore::WHLSL::AST::ReadModifyWriteExpression::setResultExpression):
3497         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference):
3498         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference):
3499         (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
3500         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldValue):
3501         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValue):
3502         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
3503         (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
3504         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
3505         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: Added.
3506         (WebCore::WHLSL::AST::ReferenceType::ReferenceType):
3507         (WebCore::WHLSL::AST::ReferenceType::addressSpace const):
3508         (WebCore::WHLSL::AST::ReferenceType::elementType const):
3509         (WebCore::WHLSL::AST::ReferenceType::elementType):
3510         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: Added.
3511         (WebCore::WHLSL::AST::ResolvableType::isFloatLiteralType const):
3512         (WebCore::WHLSL::AST::ResolvableType::isIntegerLiteralType const):
3513         (WebCore::WHLSL::AST::ResolvableType::isNullLiteralType const):
3514         (WebCore::WHLSL::AST::ResolvableType::isUnsignedIntegerLiteralType const):
3515         (WebCore::WHLSL::AST::ResolvableType::resolvedType const):
3516         (WebCore::WHLSL::AST::ResolvableType::resolvedType):
3517         (WebCore::WHLSL::AST::ResolvableType::resolve):
3518         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: Added.
3519         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
3520         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
3521         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: Added.
3522         (WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
3523         (WebCore::WHLSL::AST::ResourceSemantic::mode const):
3524         (WebCore::WHLSL::AST::ResourceSemantic::index const):
3525         (WebCore::WHLSL::AST::ResourceSemantic::space const):
3526         (WebCore::WHLSL::AST::ResourceSemantic::operator== const):
3527         (WebCore::WHLSL::AST::ResourceSemantic::operator!= const):
3528         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h: Added.
3529         (WebCore::WHLSL::AST::Return::Return):
3530         (WebCore::WHLSL::AST::Return::value):
3531         (WebCore::WHLSL::AST::Return::function):
3532         (WebCore::WHLSL::AST::Return::setFunction):
3533         * Modules/webgpu/WHLSL/AST/WHLSLSemantic.h: Added.
3534         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Added.
3535         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
3536         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
3537         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h: Added.
3538         (WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
3539         (WebCore::WHLSL::AST::SpecializationConstantSemantic::operator== const):
3540         (WebCore::WHLSL::AST::SpecializationConstantSemantic::operator!= const):
3541         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: Added.
3542         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
3543         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
3544         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h: Added.
3545         (WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
3546         (WebCore::WHLSL::AST::StageInOutSemantic::index const):
3547         (WebCore::WHLSL::AST::StageInOutSemantic::operator== const):
3548         (WebCore::WHLSL::AST::StageInOutSemantic::operator!= const):
3549         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h: Added.
3550         (WebCore::WHLSL::AST::Statement::Statement):
3551         (WebCore::WHLSL::AST::Statement::isBlock const):
3552         (WebCore::WHLSL::AST::Statement::isBreak const):
3553         (WebCore::WHLSL::AST::Statement::isContinue const):
3554         (WebCore::WHLSL::AST::Statement::isDoWhileLoop const):
3555         (WebCore::WHLSL::AST::Statement::isEffectfulExpressionStatement const):
3556         (WebCore::WHLSL::AST::Statement::isFallthrough const):
3557         (WebCore::WHLSL::AST::Statement::isForLoop const):
3558         (WebCore::WHLSL::AST::Statement::isIfStatement const):
3559         (WebCore::WHLSL::AST::Statement::isReturn const):
3560         (WebCore::WHLSL::AST::Statement::isSwitchCase const):
3561         (WebCore::WHLSL::AST::Statement::isSwitchStatement const):
3562         (WebCore::WHLSL::AST::Statement::isTrap const):
3563         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
3564         (WebCore::WHLSL::AST::Statement::isWhileLoop const):
3565         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h: Added.
3566         (WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
3567         (WebCore::WHLSL::AST::StructureDefinition::structureElements):
3568         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h: Added.
3569         (WebCore::WHLSL::AST::StructureElement::StructureElement):
3570         (WebCore::WHLSL::AST::StructureElement::origin const):
3571         (WebCore::WHLSL::AST::StructureElement::type):
3572         (WebCore::WHLSL::AST::StructureElement::name):
3573         (WebCore::WHLSL::AST::StructureElement::semantic):
3574         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h: Added.
3575         (WebCore::WHLSL::AST::SwitchCase::SwitchCase):
3576         (WebCore::WHLSL::AST::SwitchCase::value):
3577         (WebCore::WHLSL::AST::SwitchCase::block):
3578         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h: Added.
3579         (WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
3580         (WebCore::WHLSL::AST::SwitchStatement::value):
3581         (WebCore::WHLSL::AST::SwitchStatement::switchCases):
3582         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h: Added.
3583         (WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
3584         (WebCore::WHLSL::AST::TernaryExpression::predicate):
3585         (WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
3586         (WebCore::WHLSL::AST::TernaryExpression::elseExpression):
3587         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Added.
3588         (WebCore::WHLSL::AST::Trap::Trap):
3589         * Modules/webgpu/WHLSL/AST/WHLSLType.h: Added.
3590         (WebCore::WHLSL::AST::Type::isNamedType const):
3591         (WebCore::WHLSL::AST::Type::isUnnamedType const):
3592         (WebCore::WHLSL::AST::Type::isResolvableType const):
3593         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp: Added.
3594         (WebCore::WHLSL::AST::clone):
3595         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h: Added.
3596         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h: Added.
3597         (WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
3598         (WebCore::WHLSL::AST::TypeDefinition::type):
3599         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp: Added.
3600         (WebCore::WHLSL::AST::TypeReference::wrap):
3601         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: Added.
3602         (WebCore::WHLSL::AST::TypeReference::TypeReference):
3603         (WebCore::WHLSL::AST::TypeReference::name):
3604         (WebCore::WHLSL::AST::TypeReference::typeArguments):
3605         (WebCore::WHLSL::AST::TypeReference::resolvedType const):
3606         (WebCore::WHLSL::AST::TypeReference::setResolvedType):
3607         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
3608         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h: Added.
3609         (WebCore::WHLSL::AST::UnnamedType::UnnamedType):
3610         (WebCore::WHLSL::AST::UnnamedType::isTypeReference const):
3611         (WebCore::WHLSL::AST::UnnamedType::isPointerType const):
3612         (WebCore::WHLSL::AST::UnnamedType::isArrayReferenceType const):
3613         (WebCore::WHLSL::AST::UnnamedType::isArrayType const):
3614         (WebCore::WHLSL::AST::UnnamedType::isReferenceType const):
3615         (WebCore::WHLSL::AST::UnnamedType::unifyNode const):
3616         (WebCore::WHLSL::AST::UnnamedType::unifyNode):
3617         (WebCore::WHLSL::AST::UnnamedType::origin const):
3618         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp: Added.
3619         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::valueForSelectedType const):
3620         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h: Added.
3621         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
3622         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::type):
3623         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::value const):
3624         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
3625         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Added.
3626         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
3627         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
3628         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
3629         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Added.
3630         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
3631         * Modules/webgpu/WHLSL/AST/WHLSLValue.h: Added.
3632         (WebCore::WHLSL::AST::Value::Value):
3633         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: Added.
3634         (WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
3635         (WebCore::WHLSL::AST::VariableDeclaration::origin const):
3636         (WebCore::WHLSL::AST::VariableDeclaration::name):
3637         (WebCore::WHLSL::AST::VariableDeclaration::type const):
3638         (WebCore::WHLSL::AST::VariableDeclaration::type):
3639         (WebCore::WHLSL::AST::VariableDeclaration::semantic):
3640         (WebCore::WHLSL::AST::VariableDeclaration::initializer):
3641         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h: Added.
3642         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
3643         (WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations):
3644         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h: Added.
3645         (WebCore::WHLSL::AST::VariableReference::VariableReference):
3646         (WebCore::WHLSL::AST::VariableReference::wrap):
3647         (WebCore::WHLSL::AST::VariableReference::name):
3648         (WebCore::WHLSL::AST::VariableReference::variable):
3649         (WebCore::WHLSL::AST::VariableReference::setVariable):
3650         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Added.
3651         (WebCore::WHLSL::AST::WhileLoop::WhileLoop):
3652         (WebCore::WHLSL::AST::WhileLoop::conditional):
3653         (WebCore::WHLSL::AST::WhileLoop::body):
3654         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
3655         * Modules/webgpu/WHLSL/WHLSLParser.cpp: Added.
3656         * Modules/webgpu/WHLSL/WHLSLParser.h: Added.
3657         * Modules/webgpu/WHLSL/WHLSLProgram.h: Added.
3658         (WebCore::WHLSL::Program::append):
3659         (WebCore::WHLSL::Program::nameContext):
3660         (WebCore::WHLSL::Program::intrinsics):
3661         (WebCore::WHLSL::Program::typeDefinitions):
3662         (WebCore::WHLSL::Program::structureDefinitions):
3663         (WebCore::WHLSL::Program::enumerationDefinitions):
3664         (WebCore::WHLSL::Program::functionDefinitions const):
3665         (WebCore::WHLSL::Program::functionDefinitions):
3666         (WebCore::WHLSL::Program::nativeFunctionDeclarations const):
3667         (WebCore::WHLSL::Program::nativeFunctionDeclarations):
3668         (WebCore::WHLSL::Program::nativeTypeDeclarations):
3669
3670 2019-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3671
3672         Bindings generator emits incorrect code when using VoidCallback as an IDL dictionary attribute
3673         https://bugs.webkit.org/show_bug.cgi?id=193328
3674
3675         Reviewed by Chris Dumez.
3676
3677         Currently, when generating the function body of `convertDictionary`, our bindings generator does not pass in an
3678         argument to use as the `$globalObjectReference` in `JSValueToNative`, when generating code to convert a wrapped
3679         attribute value to the native value. As a result, if the generated IDL type returns `true` from
3680         `JSValueToNativeDOMConvertNeedsGlobalObject` (i.e. for callback function types), we will end up using the empty
3681         string as the generated expression for the global object. This emits syntactically incorrect code:
3682
3683             `convert<IDLCallbackFunction<JSVoidCallback>>(state, someValue, );`
3684
3685         To fix this, we pass in a string to use as the global object, which uses the given ExecState to grab the global
3686         object. Tested by augmenting TestStandaloneDictionary.idl and its generated expectation.
3687
3688         * bindings/scripts/CodeGeneratorJS.pm:
3689         (GenerateDictionaryImplementationContent):
3690         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
3691         (WebCore::convertDictionary<DictionaryImplName>):
3692         * bindings/scripts/test/TestStandaloneDictionary.idl:
3693
3694 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
3695
3696         Define page media state flags for display capture.
3697         https://bugs.webkit.org/show_bug.cgi?id=193230
3698         <rdar://problem/47095142>
3699
3700         Reviewed by Youenn Fablet.
3701
3702         Test: fast/mediastream/get-display-media-muted.html
3703
3704         * Modules/mediastream/MediaStreamTrack.cpp:
3705         (WebCore::MediaStreamTrack::mediaState const):
3706         * page/MediaProducer.h:
3707         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
3708         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
3709         * platform/mediastream/RealtimeMediaSource.h:
3710         * platform/mediastream/mac/AVVideoCaptureSource.h:
3711         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
3712         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
3713         * platform/mock/MockRealtimeAudioSource.h:
3714         * platform/mock/MockRealtimeVideoSource.h:
3715         * testing/Internals.cpp:
3716         (WebCore::Internals::pageMediaState):
3717
3718 2019-01-10  Justin Fan  <justin_fan@apple.com>
3719
3720         [WebGPU] Add BindGroupBinding, BindGroupDescriptor, and BufferBinding dictionaries from API
3721         https://bugs.webkit.org/show_bug.cgi?id=193298
3722
3723         Reviewed by Dean Jackson.
3724
3725         No new tests. No change in behavior.
3726
3727         * CMakeLists.txt:
3728         * DerivedSources.make:
3729         * Modules/webgpu/WebGPUBindGroupBinding.h: Added.
3730         * Modules/webgpu/WebGPUBindGroupBinding.idl: Added.
3731         * Modules/webgpu/WebGPUBindGroupDescriptor.h: Added.
3732         * Modules/webgpu/WebGPUBindGroupDescriptor.idl: Added.
3733         * Modules/webgpu/WebGPUBufferBinding.h: Added.
3734         * Modules/webgpu/WebGPUBufferBinding.idl: Added.
3735         * Sources.txt:
3736         * WebCore.xcodeproj/project.pbxproj:
3737         * platform/graphics/gpu/GPUBindGroupBinding.h: Added.
3738         * platform/graphics/gpu/GPUBindGroupDescriptor.h: Added.
3739         * platform/graphics/gpu/GPUBufferBinding.h: Added.
3740
3741 2019-01-09  Justin Fan  <justin_fan@apple.com>
3742
3743         [WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
3744         https://bugs.webkit.org/show_bug.cgi?id=193289
3745
3746         Reviewed by Dean Jackson.
3747
3748         Fix broken test after pipeline layouts were added, and a small refactoring to GPURenderPipeline to avoid
3749         retaining its descriptor after creation.
3750
3751         * platform/graphics/gpu/GPURenderPipeline.h:
3752         (WebCore::GPURenderPipeline::primitiveTopology const):
3753         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3754         (WebCore::GPURenderPipeline::GPURenderPipeline):
3755
3756 2019-01-09  Dean Jackson  <dino@apple.com>
3757
3758         Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters
3759         https://bugs.webkit.org/show_bug.cgi?id=193309
3760         <rdar://problem/45279224>
3761
3762         Reviewed by Antoine Quint.
3763
3764         A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters.
3765
3766         The crash log indicates we crash in a Checked<> class that is not recording
3767         overflow i.e. it is crashing due to an overflow. The only place in this function
3768         where that could happen is when we convert the FloatRect for the backdrop
3769         region into a Checked<unsigned> for width and height. This suggests that either
3770         the width or height are negative, or the float values are too large for integers,
3771         or the product of the two overflows.
3772
3773         Avoid this by using RecordOverflow, but also changing the code a little to
3774         bail if the rectangle is incorrect.
3775
3776         * platform/graphics/ca/GraphicsLayerCA.cpp:
3777         (WebCore::GraphicsLayerCA::updateBackdropFilters):
3778
3779 2019-01-10  Oriol Brufau  <obrufau@igalia.com>
3780
3781         [css-grid] Let abspos items reference implicit grid lines
3782         https://bugs.webkit.org/show_bug.cgi?id=193313
3783
3784         Reviewed by Manuel Rego Casasnovas.
3785
3786         While they can't create new implicit grid lines, abspos items
3787         can reference existing ones as clarified in
3788         https://github.com/w3c/csswg-drafts/commit/511bb63
3789
3790         This patch makes WebKit match Blink, Firefox and Edge.
3791
3792         Tests: web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html
3793                web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html
3794
3795         * rendering/RenderGrid.cpp:
3796         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator const):
3797         Remove argument from spanSizeForAutoPlacedItem call.
3798         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid const):
3799         Remove argument from spanSizeForAutoPlacedItem call.
3800         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const):
3801         Remove argument from spanSizeForAutoPlacedItem call.
3802         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid const):
3803         Remove argument from spanSizeForAutoPlacedItem call.
3804         (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
3805         Don't treat implicit grid lines as 'auto'.
3806         * rendering/RenderGrid.h:
3807         Remove unused gridPositionIsAutoForOutOfFlow.
3808         * rendering/style/GridPositionsResolver.cpp:
3809         (WebCore::adjustGridPositionsFromStyle):
3810         Don't treat implicit grid lines as 'auto'.
3811         Remove unused gridContainerStyle parameter.
3812         (WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem):
3813         Remove argument from adjustGridPositionsFromStyle call.
3814         Remove unused gridContainerStyle parameter.
3815         (WebCore::resolveGridPositionFromStyle):
3816         Remove unnecessary assert that uses isValidNamedLineOrArea.
3817         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
3818         Remove argument from adjustGridPositionsFromStyle call.
3819         * rendering/style/GridPositionsResolver.h:
3820         Remove unused isValidNamedLineOrArea.
3821         Remove unused parameter from spanSizeForAutoPlacedItem.
3822
3823 2019-01-09  Matt Rajca  <mrajca@apple.com>
3824
3825         Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
3826         https://bugs.webkit.org/show_bug.cgi?id=193301
3827
3828         Reviewed by Jer Noble.
3829
3830         Instead of unconditionally enabling this with a compile-time flag, let clients
3831         enable the quirk on a per-load basis.
3832
3833         Tests: added API tests in favor of the current layout test as this behavior is no
3834                longer on by default unless a client opts in.
3835
3836         * html/MediaElementSession.cpp:
3837         (WebCore::needsPerDocumentAutoplayBehaviorQuirk):
3838         (WebCore::MediaElementSession::playbackPermitted const):
3839         * loader/DocumentLoader.h:
3840
3841 2019-01-10  Zalan Bujtas  <zalan@apple.com>
3842
3843         [LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position
3844         https://bugs.webkit.org/show_bug.cgi?id=193310
3845
3846         Reviewed by Antti Koivisto.
3847
3848         If the block inflow element has previous siblings with collapsed through vertical margins,
3849         then this box's before margin could _indirectly_ collapse with the parent. Use the previous siblings
3850         to check for margin collapsing.
3851
3852         Test: fast/block/block-only/collapsed-through-siblings.html
3853
3854         * layout/blockformatting/BlockFormattingContext.cpp:
3855         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
3856         * page/FrameViewLayoutContext.cpp:
3857         (WebCore::layoutUsingFormattingContext):
3858
3859 2019-01-10  Alicia Boya García  <aboya@igalia.com>
3860
3861         [MSE][GStreamer] Use GRefPtr in AppendPipeline::pushNewBuffer()
3862         https://bugs.webkit.org/show_bug.cgi?id=192934
3863
3864         Reviewed by Xabier Rodriguez-Calvar.
3865
3866         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3867         (WebCore::AppendPipeline::pushNewBuffer):
3868         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3869         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3870         (WebCore::MediaSourceClientGStreamerMSE::append):
3871
3872 2019-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3873
3874         [FreeType] Color emoji not properly supported
3875         https://bugs.webkit.org/show_bug.cgi?id=191976
3876
3877         Reviewed by Michael Catanzaro.
3878
3879         Always try to fallback to a colored font for emojis.
3880
3881         Test: platform/gtk/fonts/font-emoji-system-fallback.html
3882
3883         * platform/graphics/ComplexTextController.cpp:
3884         (WebCore::advanceByCombiningCharacterSequence): Group regional indicators in pairs.
3885         * platform/graphics/Font.cpp:
3886         (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
3887         (WebCore::Font::systemFallbackFontForCharacter const): Pass PreferColoredFont::No to FontCache::systemFallbackForCharacters.
3888         * platform/graphics/Font.h: Add IsForPlatformFont enum to replace the bool parameter in systemFallbackFontForCharacter().
3889         * platform/graphics/FontCache.h:
3890         * platform/graphics/FontCascadeFonts.cpp:
3891         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
3892         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3893         (WebCore::characterSequenceIsEmoji): Check whether the character sequence is an emoji.
3894         (WebCore::FontCascade::fontForCombiningCharacterSequence const): In case of emojis try to fallback to a colored
3895         font even if base font can render the emoji in black and white.
3896         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3897         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.
3898         * platform/graphics/freetype/FontCacheFreeType.cpp:
3899         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter.
3900         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3901         (WebCore::FontPlatformData::FontPlatformData): Initialize m_isColorBitmapFont.
3902         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
3903         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Moved from cross-platform file.
3904         (WebCore::Font::platformSupportsCodePoint const): Add freetype implementation.
3905         * platform/graphics/win/FontCacheWin.cpp:
3906         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.