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