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