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