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