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