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