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