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