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