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