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