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