Storage Access API: Cap the number of times an iframe document can request access
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-06-20  John Wilander  <wilander@apple.com>
2
3         Storage Access API: Cap the number of times an iframe document can request access
4         https://bugs.webkit.org/show_bug.cgi?id=199074
5         <rdar://problem/51857195>
6
7         Reviewed by Brent Fulgham.
8
9         Tested manually.
10
11         This change just adds a counter to the number of times the user explicitly
12         denies storage access and returns early if the counter has reached the limit
13         of 2.
14
15         We hoped that iframes that request storage access would count the number
16         of times the user has been asked and not repeat the request over and over.
17         However, we're seeing pretty aggressive use of the API and users are
18         complaining. Therefore, we need a cap on how many times an iframed
19         document can ask if it is explicitly denied access by the user.
20
21         This is a first measure. If we see continued aggressive use of the API,
22         we'll have to consider more drastic measures.
23
24         * dom/DocumentStorageAccess.cpp:
25         (WebCore::DocumentStorageAccess::requestStorageAccess):
26         * dom/DocumentStorageAccess.h:
27
28 2019-06-20  Youenn Fablet  <youenn@apple.com>
29
30         Changing settings of a MediaStreamTrack clone should not alter the settings of the original track
31         https://bugs.webkit.org/show_bug.cgi?id=198840
32
33         Reviewed by Eric Carlson.
34
35         Rename RealtimeVideoSource in RealtimeVideoCaptureSource.
36         Introduce RealtimeVideoSource as a class wrapping RealtimeVideoCaptureSource.
37         Its goal is to be able to have independent settings from its underlying RealtimeVideoCaptureSource.
38         It can also adapt size based on its settings if different than its RealtimeVideoCaptureSource.
39         Apply this wrapping for AV video sources as well as mock video sources.
40         Test: fast/mediastream/mediastreamtrack-video-clone.html
41
42         * Sources.txt:
43         * WebCore.xcodeproj/project.pbxproj:
44         * platform/mediastream/MediaStreamTrackPrivate.cpp:
45         (WebCore::MediaStreamTrackPrivate::clone):
46         * platform/mediastream/RealtimeMediaSource.h:
47         * platform/mediastream/RealtimeVideoCaptureSource.cpp: Added.
48         (WebCore::RealtimeVideoCaptureSource::RealtimeVideoCaptureSource):
49         (WebCore::RealtimeVideoCaptureSource::~RealtimeVideoCaptureSource):
50         (WebCore::RealtimeVideoCaptureSource::prepareToProduceData):
51         (WebCore::RealtimeVideoCaptureSource::presets):
52         (WebCore::RealtimeVideoCaptureSource::setSupportedPresets):
53         (WebCore::RealtimeVideoCaptureSource::standardVideoSizes):
54         (WebCore::updateMinMax):
55         (WebCore::RealtimeVideoCaptureSource::updateCapabilities):
56         (WebCore::RealtimeVideoCaptureSource::supportsSizeAndFrameRate):
57         (WebCore::RealtimeVideoCaptureSource::frameRateRangeIncludesRate):
58         (WebCore::RealtimeVideoCaptureSource::presetSupportsFrameRate):
59         (WebCore::RealtimeVideoCaptureSource::supportsCaptureSize):
60         (WebCore::RealtimeVideoCaptureSource::shouldUsePreset):
61         (WebCore::RealtimeVideoCaptureSource::bestSupportedSizeAndFrameRate):
62         (WebCore::RealtimeVideoCaptureSource::setSizeAndFrameRate):
63         (WebCore::RealtimeVideoCaptureSource::adaptVideoSample):
64         (WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
65         (WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate):
66         (WebCore::SizeAndFrameRate::toJSONObject const):
67         (WebCore::SizeAndFrameRate::toJSONString const):
68         * platform/mediastream/RealtimeVideoCaptureSource.h: Added.
69         (WebCore::RealtimeVideoCaptureSource::sampleRotation const):
70         (WebCore::RealtimeVideoCaptureSource::prefersPreset):
71         (WebCore::RealtimeVideoCaptureSource::setFrameRateWithPreset):
72         (WebCore::RealtimeVideoCaptureSource::canResizeVideoFrames const):
73         (WebCore::RealtimeVideoCaptureSource::setDefaultSize):
74         (WebCore::RealtimeVideoCaptureSource::observedFrameRate const):
75         (WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
76         * platform/mediastream/RealtimeVideoSource.cpp:
77         (WebCore::RealtimeVideoSource::RealtimeVideoSource):
78         (WebCore::m_source):
79         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
80         (WebCore::RealtimeVideoSource::startProducingData):
81         (WebCore::RealtimeVideoSource::stopProducingData):
82         (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate):
83         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
84         (WebCore::RealtimeVideoSource::sourceMutedChanged):
85         (WebCore::RealtimeVideoSource::sourceSettingsChanged):
86         (WebCore::RealtimeVideoSource::preventSourceFromStopping):
87         (WebCore::RealtimeVideoSource::sourceStopped):
88         (WebCore::RealtimeVideoSource::videoSampleAvailable):
89         (WebCore::RealtimeVideoSource::clone):
90         * platform/mediastream/RealtimeVideoSource.h:
91         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
92         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
93         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
94         * platform/mediastream/mac/AVVideoCaptureSource.h:
95         * platform/mediastream/mac/AVVideoCaptureSource.mm:
96         (WebCore::AVVideoCaptureSource::create):
97         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
98         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
99         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
100         (WebCore::MockRealtimeVideoSource::create):
101         * platform/mock/MockRealtimeVideoSource.cpp:
102         (WebCore::MockRealtimeVideoSource::create):
103         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
104         (WebCore::MockRealtimeVideoSource::supportsSizeAndFrameRate):
105         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate):
106         * platform/mock/MockRealtimeVideoSource.h:
107
108 2019-06-20  Saam Barati  <sbarati@apple.com>
109
110         Unreviewed. More speculative build fixing for watchOS after r246631.
111
112         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
113
114 2019-06-20  Saam Barati  <sbarati@apple.com>
115
116         Unreviewed. Speculative build fix for watchOS after r246631.
117
118         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
119
120 2019-06-18  Darin Adler  <darin@apple.com>
121
122         Tidy up the remaining bits of the AtomicString to AtomString rename
123         https://bugs.webkit.org/show_bug.cgi?id=198990
124
125         Reviewed by Michael Catanzaro.
126
127         * bindings/scripts/test/JS/JSTestObj.cpp: Updated names.
128         * bindings/scripts/test/TestObj.idl: Ditto.
129
130         * css/makeprop.pl: Updated comment.
131         * css/makevalues.pl: Ditto.
132         * html/FormController.cpp:
133         (WebCore::FormKeyGenerator::formKey): Ditto.
134
135 2019-06-20  Zalan Bujtas  <zalan@apple.com>
136
137         [LFC][IFC] Make the initial strut explicit
138         https://bugs.webkit.org/show_bug.cgi?id=199057
139         <rdar://problem/51927864>
140
141         Reviewed by Antti Koivisto.
142
143         The strut always sets the initial vertical constraints on the new line in strict mode. However in quirks mode
144         we can ignore it as long as there's no baseline type content on the line.  
145
146         * layout/inlineformatting/InlineFormattingContext.h:
147         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
148         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
149         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
150         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints):
151         * layout/inlineformatting/InlineLine.cpp:
152         (WebCore::Layout::Line::appendTextContent):
153         (WebCore::Layout::Line::appendHardLineBreak):
154         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
155         * layout/inlineformatting/InlineLine.h:
156
157 2019-06-20  Zalan Bujtas  <zalan@apple.com>
158
159         [LFC][IFC] Introduce Line::InitialConstraints
160         https://bugs.webkit.org/show_bug.cgi?id=199056
161         <rdar://problem/51927597>
162
163         Reviewed by Antti Koivisto.
164
165         Line::InitialConstraints, as the name suggests, holds the initial constraint values for the new line. 
166
167         * layout/inlineformatting/InlineFormattingContext.h:
168         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
169         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput):
170         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
171         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
172         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
173         * layout/inlineformatting/InlineLine.cpp:
174         (WebCore::Layout::Line::Line):
175         (WebCore::Layout::m_skipVerticalAligment):
176         (WebCore::Layout::m_lineLogicalWidth): Deleted.
177         * layout/inlineformatting/InlineLine.h:
178
179 2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
180
181         [GTK] Remove support for GTK2 plugins
182         https://bugs.webkit.org/show_bug.cgi?id=199065
183
184         Reviewed by Sergio Villar Senin.
185
186         * PlatformGTK.cmake:
187         * SourcesGTK.txt:
188         * SourcesWPE.txt:
189         * platform/FreeType.cmake:
190         * platform/SourcesGLib.txt:
191         * platform/graphics/Color.h:
192         * platform/graphics/PlatformDisplay.cpp:
193         (WebCore::PlatformDisplay::createPlatformDisplay):
194         * platform/graphics/gtk/ColorGtk.cpp:
195         (WebCore::Color::operator GdkRGBA const):
196         * platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp:
197         (WebCore::onFrameClockUpdate):
198         (WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback):
199         * platform/graphics/gtk/DisplayRefreshMonitorGtk.h:
200         (WebCore::DisplayRefreshMonitorGtk::create):
201         * platform/graphics/gtk/GdkCairoUtilities.cpp:
202         * platform/gtk/GRefPtrGtk.cpp:
203         * platform/gtk/GRefPtrGtk.h:
204         * platform/gtk/GtkVersioning.c: Removed.
205         * platform/gtk/GtkVersioning.h: Removed.
206         * platform/gtk/PasteboardHelper.cpp:
207         (WebCore::PasteboardHelper::getClipboardContents):
208         * platform/gtk/PlatformKeyboardEventGtk.cpp:
209         (WebCore::modifiersForGdkKeyEvent):
210         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
211         * platform/gtk/PlatformMouseEventGtk.cpp:
212         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
213         * platform/gtk/PlatformScreenGtk.cpp:
214         (WebCore::screenIsTouchPrimaryInputDevice):
215         * platform/gtk/PlatformWheelEventGtk.cpp:
216         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
217         * platform/gtk/ScrollbarThemeGtk.cpp:
218         * platform/gtk/ScrollbarThemeGtk.h:
219         * platform/gtk/WidgetGtk.cpp:
220         * rendering/RenderThemeGtk.cpp:
221         * rendering/RenderThemeGtk.h:
222
223 2019-06-19  Myles C. Maxfield  <mmaxfield@apple.com>
224
225         [WHLSL] Hook up common texture functions
226         https://bugs.webkit.org/show_bug.cgi?id=198704
227         <rdar://problem/51668841>
228
229         Reviewed by Saam Barati.
230
231         This patch adds the Metal implementation of the Sample(), Load(), and GetDimensions()
232         texture functions. The implementation simply performs string concatenation to produce the 
233         correct results, and adds many new native functions to the standard library.
234
235         We can't zero-fill texture types or sampler types, so this patch forbids default
236         constructors for those types. It also forbids those types to exist within arrays, array
237         references, or pointers, becuase an out-of-bounds access may cause us to try to zero-fill
238         them.
239
240         Tests: webgpu/whlsl-textures-getdimensions.html
241                webgpu/whlsl-textures-load.html
242                webgpu/whlsl-textures-sample.html
243
244         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Add some more introspection functions
245         so we can generate the necessary Metal functions for the appropriate texture types.
246         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const):
247         (WebCore::WHLSL::AST::NativeTypeDeclaration::isTextureArray const):
248         (WebCore::WHLSL::AST::NativeTypeDeclaration::isDepthTexture const):
249         (WebCore::WHLSL::AST::NativeTypeDeclaration::isWritableTexture const):
250         (WebCore::WHLSL::AST::NativeTypeDeclaration::textureDimension const):
251         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTextureArray):
252         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsDepthTexture):
253         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsWritableTexture):
254         (WebCore::WHLSL::AST::NativeTypeDeclaration::setTextureDimension):
255         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtom const): Deleted.
256         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Native types can be passed into 
257         entry points, too.
258         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
259         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Entry points that return void don't need a
260         semantic.
261         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
262         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Implement the functions.
263         (WebCore::WHLSL::Metal::vectorLength):
264         (WebCore::WHLSL::Metal::vectorInnerType):
265         (WebCore::WHLSL::Metal::vectorSuffix):
266         (WebCore::WHLSL::Metal::writeNativeFunction):
267         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp: Textures come in two flavors: sample-able
268         and read/write-able. Make sure we produce the correct Metal types for them.
269         (WebCore::WHLSL::Metal::writeNativeType):
270         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp: We can't auto-initialize textures and 
271         samplers. Therefore, this function needs to be able to fail.
272         (WebCore::WHLSL::AutoInitialize::visit):
273         (WebCore::WHLSL::autoInitializeVariables):
274         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h:
275         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: We can't auto-initialize textures, so users
276         shouldn't be able to either.
277         (WebCore::WHLSL::checkDuplicateFunctions):
278         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp: Added. Make sure textures and samplers can't
279         exist inside arrays, array references, or pointers. This is because out-of-bounds accesses may cause
280         us to attempt to zero-fill the inner type, but we can't zero-fill textures and samplers.
281         (WebCore::WHLSL::TextureReferencesChecker::TextureReferencesChecker):
282         (WebCore::WHLSL::Searcher::Searcher):
283         (WebCore::WHLSL::Searcher::found const):
284         (WebCore::WHLSL::Searcher::visit):
285         (WebCore::WHLSL::TextureReferencesChecker::containsTextureOrSampler):
286         (WebCore::WHLSL::TextureReferencesChecker::visit):
287         (WebCore::WHLSL::checkTextureReferences):
288         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h.
289         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
290         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Record more detailed information about texture types,
291         so we can emit correct Metal code.
292         (WebCore::WHLSL::Intrinsics::addFullTexture):
293         (WebCore::WHLSL::Intrinsics::addDepthTexture):
294         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
295         (WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
296         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Nested NameResolvers need to propagate their error. Also,
297         native functions with named arguments shouldn't be adding their arguments to the global scope.
298         (WebCore::WHLSL::NameResolver::visit):
299         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
300         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
301         (WebCore::WHLSL::prepareShared):
302         * Modules/webgpu/WHLSL/WHLSLProgram.h:
303         (WebCore::WHLSL::Program::intrinsics const):
304         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
305         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Metal doesn't have writable depth textures.
306         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
307         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Don't generate default constructors for textures
308         or samplers.
309         (WebCore::WHLSL::synthesizeConstructors):
310         * Sources.txt:
311         * WebCore.xcodeproj/project.pbxproj:
312         * platform/graphics/gpu/GPUTexture.h: Make texture usages more clear.
313         (WebCore::GPUTexture::isSampled const):
314         (WebCore::GPUTexture::isStorage const):
315         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Ditto.
316         (WebCore::GPUBindGroup::tryCreate):
317         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Ditto.
318         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
319         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Ditto.
320         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
321
322 2019-06-19  Justin Fan  <justin_fan@apple.com>
323
324         [WHLSL] Create a shading language test harness
325         https://bugs.webkit.org/show_bug.cgi?id=198978
326
327         Reviewed by Myles C. Maxfield.
328
329         When creating MTLArgumentEncoders for argument buffers, the user's arguments
330         must match the order that they are declared in the shader. Move back-end information
331         such as buffer lengths to the end of the argument arrays.
332
333         Test: webgpu/whlsl-harness-test.html
334
335         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
336         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
337         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
338         (WebCore::GPUBindGroupLayout::tryCreate):
339
340 2019-06-19  Saam Barati  <sbarati@apple.com>
341
342         [WHLSL] The checker needs to resolve types for the anonymous variables in ReadModifyWrite expressions
343         https://bugs.webkit.org/show_bug.cgi?id=198988
344
345         Reviewed by Dean Jackson and Myles C. Maxfield.
346
347         This patch makes it so that the Checker assigns types to the internal variables
348         in a read modify write expression. These were the only variables that didn't have
349         types ascribed to them.
350
351         This patch also does a fly by fix where we kept pointers to value types
352         in a HashMap in the checker. This is wrong precisely when the HashMap gets
353         resized. Instead, we now just store the value itself since we're just
354         dealing with a simple Variant that wraps either an empty struct or an
355         enum.
356
357         Test: webgpu/whlsl-checker-should-set-type-of-read-modify-write-variables.html
358
359         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
360         (WebCore::WHLSL::AST::VariableDeclaration::setType):
361         (WebCore::WHLSL::AST::VariableDeclaration::type const):
362         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Make it obvious that read
363         modify write expressions are such by prefixing them with "RMW".
364         (WebCore::WHLSL::ASTDumper::visit):
365         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
366         (WebCore::WHLSL::Checker::visit):
367
368 2019-06-19  Devin Rousso  <drousso@apple.com>
369
370         Web Inspector: Network: replace CFNetwork SPI with new API where able
371         https://bugs.webkit.org/show_bug.cgi?id=198762
372
373         Reviewed by Timothy Hatcher.
374
375         * platform/network/NetworkLoadMetrics.h:
376
377 2019-06-19  Jer Noble  <jer.noble@apple.com>
378
379         iOS 12.2 Drawing portrait video to canvas is sideways
380         https://bugs.webkit.org/show_bug.cgi?id=196772
381         <rdar://problem/49781802>
382
383         Reviewed by Eric Carlson.
384
385         Test: media/video-orientation-canvas.html
386
387         Move rotation code into its own ImageRotationSessionVT class for re-use across
388         all existing classes with rotation operations. Should slightly increase performance
389         for painting rotated media files, as the rotation only occurs once per frame, rather
390         than once per drawing operation.
391
392         * WebCore.xcodeproj/project.pbxproj:
393         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
394         (WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const): Deleted.
395         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
396         (WebCore::ImageDecoderAVFObjC::readTrackMetadata):
397         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
398         (WebCore::ImageDecoderAVFObjC::setTrack):
399         (WebCore::transformToRotationProperties): Deleted.
400         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
401         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
402         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
403         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
404         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
405         * platform/graphics/cv/ImageRotationSessionVT.h: Added.
406         (WebCore::ImageRotationSessionVT::RotationProperties::isIdentity const):
407         (WebCore::ImageRotationSessionVT::rotationProperties const):
408         (WebCore::ImageRotationSessionVT::rotatedSize):
409         * platform/graphics/cv/ImageRotationSessionVT.mm: Added.
410         (WebCore::transformToRotationProperties):
411         (WebCore::ImageRotationSessionVT::ImageRotationSessionVT):
412         (WebCore::ImageRotationSessionVT::rotate):
413         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
414         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
415         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
416         (WebCore::rotationToAngle):
417         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
418         (WebCore::computeRotatedWidthAndHeight): Deleted.
419
420 2019-06-19  Simon Fraser  <simon.fraser@apple.com>
421
422         REGRESSION (246538): Newyorker.com header scrolls on page
423         
424         Revert parts of r246538 so that frame scrolling is reverted to using layer positions.
425         Overflow scroll will still scroll by changing boundsOrigin.
426         
427         The bug was caused by confusion about insetClipLayer and scrollContainerLayer; macOS
428         positions the clip layer using FrameView::yPositionForInsetClipLayer(), so it's not just
429         a simple scroll container, and this change broke positioning for fixed position layers.
430
431         * page/scrolling/AsyncScrollingCoordinator.cpp:
432         (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
433         * page/scrolling/ScrollingCoordinator.cpp:
434         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
435         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
436         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
437         * rendering/RenderLayerCompositor.cpp:
438         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
439         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
440         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
441         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
442         (WebCore::RenderLayerCompositor::frameViewDidScroll):
443         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
444         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
445         (WebCore::RenderLayerCompositor::ensureRootLayer):
446         (WebCore::RenderLayerCompositor::destroyRootLayer):
447         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
448         (WebCore::RenderLayerCompositor::updateLayersForScrollPosition): Deleted.
449         (WebCore::RenderLayerCompositor::updateScrollContainerGeometry): Deleted.
450         * rendering/RenderLayerCompositor.h:
451
452 2019-06-19  Adrian Perez de Castro  <aperez@igalia.com>
453
454         [WPE][GTK] Fix build with unified sources disabled
455         https://bugs.webkit.org/show_bug.cgi?id=198752
456
457         Reviewed by Michael Catanzaro.
458
459         No new tests needed.
460
461         * Modules/indexeddb/server/UniqueIDBDatabase.h: Add missing forward declaration for IDBGetRecordData,
462         replace inclusion of UniqueIDBDatabaseConnection.h with a forward declaration.
463         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: Remove unneeded inclusion of
464         UniqueIDBDatabaseTransaction.h, add missing inclusion of UniqueIDBDatabase.h
465         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h: Remove unneeded inclusion of
466         UniqueIDBDatabaseConnection.h inclusion.
467         * bridge/c/c_class.cpp: Add inclusion of JSCJSValueInlines.h to avoid linker errors due
468         to missing JSValue inline functions.
469         * dom/DocumentParser.h: Replace forward declaration of Document with inclusion of Document.h,
470         to avoid error due to usage of incomplete type in template expansion.
471         * dom/Microtasks.h: Add missing forward declaration of JSC::VM
472         * editing/markup.cpp: Add missing inclusion of PasteboardItemInfo.h
473         * page/Quirks.h: Add missing forward declaration of WebCore::EventTarget
474         * page/RuntimeEnabledFeatures.h: Add missing inclusion of wtf/Optional.h to avoid error due to
475         expansion of undefined template.
476         * page/SocketProvider.h: Add missing forward declaration for Document.
477         * platform/graphics/GraphicsLayerClient.h: Add missing inclusion of wtf/OptionSet.h to avoid
478         error due to expansion of undefined template.
479         * rendering/RenderMultiColumnSpannerPlaceholder.h: Replace forward declaration of RenderMultiColumnFlow
480         with inclusion of RenderMultiColumnFlow.h to avoid error due to usage of undefined class.
481
482 2019-06-19  Antti Koivisto  <antti@apple.com>
483
484         RequestedScrollPosition shouldn't be applied after node reattach
485         https://bugs.webkit.org/show_bug.cgi?id=198994
486         <rdar://problem/51439685>
487
488         Reviewed by Simon Fraser.
489
490         Test: scrollingcoordinator/ios/scroll-position-after-reattach.html
491
492         If a scrolling node gets reattached, its scroll position resets to (0,0) or whatever the previous
493         requestedScrollPosition was, and the current position is lost.
494
495         * page/scrolling/ScrollingStateFixedNode.cpp:
496         (WebCore::ScrollingStateFixedNode::setPropertyChangedBitsAfterReattach):
497         (WebCore::ScrollingStateFixedNode::setAllPropertiesChanged): Deleted.
498
499         Rename to better reflect what this is for.
500
501         * page/scrolling/ScrollingStateFixedNode.h:
502         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
503         (WebCore::ScrollingStateFrameHostingNode::setPropertyChangedBitsAfterReattach):
504         (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged): Deleted.
505         * page/scrolling/ScrollingStateFrameHostingNode.h:
506         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
507         (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
508         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged): Deleted.
509         * page/scrolling/ScrollingStateFrameScrollingNode.h:
510         * page/scrolling/ScrollingStateNode.cpp:
511         (WebCore::ScrollingStateNode::setPropertyChangedBitsAfterReattach):
512         (WebCore::ScrollingStateNode::setAllPropertiesChanged): Deleted.
513         * page/scrolling/ScrollingStateNode.h:
514         * page/scrolling/ScrollingStatePositionedNode.cpp:
515         (WebCore::ScrollingStatePositionedNode::setPropertyChangedBitsAfterReattach):
516         (WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged): Deleted.
517         * page/scrolling/ScrollingStatePositionedNode.h:
518         * page/scrolling/ScrollingStateScrollingNode.cpp:
519         (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
520
521         Don't set RequestedScrollPosition. It is a special property that is applied only once on request
522         and shouldn't get reapplied. Nodes should keep their existing scroll position on reattach.
523
524         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged): Deleted.
525         * page/scrolling/ScrollingStateScrollingNode.h:
526         * page/scrolling/ScrollingStateStickyNode.cpp:
527         (WebCore::ScrollingStateStickyNode::setPropertyChangedBitsAfterReattach):
528         (WebCore::ScrollingStateStickyNode::setAllPropertiesChanged): Deleted.
529         * page/scrolling/ScrollingStateStickyNode.h:
530         * page/scrolling/ScrollingStateTree.cpp:
531         (WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
532
533 2019-06-18  Saam Barati  <sbarati@apple.com>
534
535         [WHLSL] Support matrices
536         https://bugs.webkit.org/show_bug.cgi?id=198876
537         <rdar://problem/51768882>
538
539         Reviewed by Dean Jackson and Myles Maxfield.
540
541         This patch adds in support for matrices to WHLSL. Most matrix related code
542         is defined by the standard library. This patch just needed to add support
543         for the native functions operator[] and operator[]= on matrix types. The only
544         native functions that are named operator[] and operator[]= are for matrix
545         operations, so we strongly assume when generating code for native operator[] and
546         operator[]= that we're dealing with matrix types.
547         
548         operator[]= ignores the write if the index is out of bounds. operator[]
549         returns a zeroed vector if the index is out of bounds.  
550         
551         This patch also incorporates two bug fixes:
552         1. This patch takes Robin's patch in https://bugs.webkit.org/show_bug.cgi?id=198313 to ensure
553         we don't have pointers to values in a hash map. This was needed in this patch
554         otherwise we'd crash parsing the standard library.
555         
556         2. This patch fixes how we handle "break" in metal codegen. When I first
557         implemented break, I strongly assumed we were in a loop. However, break
558         can be either from a loop or from switch. This patch teaches the metal code
559         generator to track which context we're in and to emit code accordingly.
560
561         Tests: webgpu/whlsl-matrix-2.html
562                webgpu/whlsl-matrix.html
563
564         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
565         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
566         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
567         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
568         (WebCore::WHLSL::Metal::generateMetalCodeShared):
569         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
570         (WebCore::WHLSL::Metal::writeNativeFunction):
571         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
572         (WebCore::WHLSL::Checker::assignTypes):
573         (WebCore::WHLSL::Checker::getInfo):
574         (WebCore::WHLSL::Checker::assignType):
575         (WebCore::WHLSL::Checker::forwardType):
576         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
577
578 2019-06-18  Yusuke Suzuki  <ysuzuki@apple.com>
579
580         [JSC] JSLock should be WebThread aware
581         https://bugs.webkit.org/show_bug.cgi?id=198911
582
583         Reviewed by Geoffrey Garen.
584
585         * bindings/js/CommonVM.cpp:
586         (WebCore::commonVMSlow):
587
588 2019-06-18  Joseph Pecoraro  <pecoraro@apple.com>
589
590         WebSocketDeflater uses an unnecessarily constrained compression memory level
591         https://bugs.webkit.org/show_bug.cgi?id=198973
592
593         Reviewed by Alex Christensen.
594
595         * Modules/websockets/WebSocketDeflater.cpp:
596         Set the memLevel to the deflateInit2 default value, not a minimum value.
597
598 2019-06-18  Keith Miller  <keith_miller@apple.com>
599
600         Add support for WeakRef
601         https://bugs.webkit.org/show_bug.cgi?id=198710
602
603         Reviewed by Yusuke Suzuki.
604
605         We need to make sure the Web MicrotaskQueue notifies the JSC VM
606         that it has finished performing a microtask checkpoint. This lets
607         the JSC VM know it is safe to collect referenced WeakRefs. Since
608         there was no way to get the VM from the MicrotaskQueue I have
609         added a RefPtr to the queue's VM. For the main thread the VM lives
610         forever so is fine. For workers the queue and the VM share an
611         owner so this shouldn't matter either.
612
613         Tests: js/weakref-async-is-collected.html
614                js/weakref-eventually-collects-values.html
615                js/weakref-microtasks-dont-collect.html
616                js/weakref-weakset-consistency.html
617
618         * dom/Microtasks.cpp:
619         (WebCore::MicrotaskQueue::MicrotaskQueue):
620         (WebCore::MicrotaskQueue::mainThreadQueue):
621         (WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
622         * dom/Microtasks.h:
623         (WebCore::MicrotaskQueue::vm const):
624         * workers/WorkerGlobalScope.cpp:
625         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
626
627 2019-06-18  Kenneth Russell  <kbr@chromium.org>
628
629         Add preliminary ANGLE backend to WebCore
630         https://bugs.webkit.org/show_bug.cgi?id=197755
631
632         Reviewed by Dean Jackson.
633
634         Add new files supplying an ANGLE version of GraphicsContext3D and
635         Extensions3D, conditionalized under USE_ANGLE. Update Xcode project to
636         build these files. This option compiles and links successfully.
637
638         FIXMEs remain in several common files which will be addressed in
639         subsequent patches.
640
641         This work will be tested with the preexisting WebGL conformance
642         suite.
643
644         * SourcesCocoa.txt:
645         * WebCore.xcodeproj/project.pbxproj:
646         * platform/graphics/ANGLEWebKitBridge.h:
647         * platform/graphics/GraphicsContext3D.h:
648         * platform/graphics/GraphicsContext3DManager.cpp:
649         (WebCore::GraphicsContext3DManager::updateAllContexts):
650         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
651         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
652         * platform/graphics/angle/Extensions3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp.
653         (WebCore::Extensions3DANGLE::Extensions3DANGLE):
654         (WebCore::Extensions3DANGLE::supports):
655         (WebCore::Extensions3DANGLE::ensureEnabled):
656         (WebCore::Extensions3DANGLE::isEnabled):
657         (WebCore::Extensions3DANGLE::getGraphicsResetStatusARB):
658         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
659         (WebCore::Extensions3DANGLE::initializeAvailableExtensions):
660         (WebCore::Extensions3DANGLE::readnPixelsEXT):
661         (WebCore::Extensions3DANGLE::getnUniformfvEXT):
662         (WebCore::Extensions3DANGLE::getnUniformivEXT):
663         (WebCore::Extensions3DANGLE::blitFramebuffer):
664         (WebCore::Extensions3DANGLE::renderbufferStorageMultisample):
665         (WebCore::Extensions3DANGLE::createVertexArrayOES):
666         (WebCore::Extensions3DANGLE::deleteVertexArrayOES):
667         (WebCore::Extensions3DANGLE::isVertexArrayOES):
668         (WebCore::Extensions3DANGLE::bindVertexArrayOES):
669         (WebCore::Extensions3DANGLE::insertEventMarkerEXT):
670         (WebCore::Extensions3DANGLE::pushGroupMarkerEXT):
671         (WebCore::Extensions3DANGLE::popGroupMarkerEXT):
672         (WebCore::Extensions3DANGLE::supportsExtension):
673         (WebCore::Extensions3DANGLE::drawBuffersEXT):
674         (WebCore::Extensions3DANGLE::drawArraysInstanced):
675         (WebCore::Extensions3DANGLE::drawElementsInstanced):
676         (WebCore::Extensions3DANGLE::vertexAttribDivisor):
677         (WebCore::Extensions3DANGLE::getExtensions):
678         * platform/graphics/angle/Extensions3DANGLE.h: Added.
679         * platform/graphics/angle/GraphicsContext3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp.
680         (WebCore::GraphicsContext3D::releaseShaderCompiler):
681         (WebCore::wipeAlphaChannelFromPixels):
682         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
683         (WebCore::GraphicsContext3D::validateAttributes):
684         (WebCore::GraphicsContext3D::reshapeFBOs):
685         (WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
686         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
687         (WebCore::GraphicsContext3D::renderbufferStorage):
688         (WebCore::GraphicsContext3D::getIntegerv):
689         (WebCore::GraphicsContext3D::getShaderPrecisionFormat):
690         (WebCore::GraphicsContext3D::texImage2D):
691         (WebCore::GraphicsContext3D::depthRange):
692         (WebCore::GraphicsContext3D::clearDepth):
693         (WebCore::GraphicsContext3D::getExtensions):
694         (WebCore::GraphicsContext3D::readPixels):
695         (WebCore::setCurrentNameHashMapForShader):
696         (WebCore::nameHashForShader):
697         (WebCore::GraphicsContext3D::validateDepthStencil):
698         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
699         (WebCore::GraphicsContext3D::paintCompositedResultsToCanvas):
700         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
701         (WebCore::GraphicsContext3D::prepareTexture):
702         (WebCore::GraphicsContext3D::readRenderingResults):
703         (WebCore::GraphicsContext3D::reshape):
704         (WebCore::GraphicsContext3D::checkVaryingsPacking const):
705         (WebCore::GraphicsContext3D::precisionsMatch const):
706         (WebCore::GraphicsContext3D::getInternalFramebufferSize const):
707         (WebCore::GraphicsContext3D::activeTexture):
708         (WebCore::GraphicsContext3D::attachShader):
709         (WebCore::GraphicsContext3D::bindAttribLocation):
710         (WebCore::GraphicsContext3D::bindBuffer):
711         (WebCore::GraphicsContext3D::bindFramebuffer):
712         (WebCore::GraphicsContext3D::bindRenderbuffer):
713         (WebCore::GraphicsContext3D::bindTexture):
714         (WebCore::GraphicsContext3D::blendColor):
715         (WebCore::GraphicsContext3D::blendEquation):
716         (WebCore::GraphicsContext3D::blendEquationSeparate):
717         (WebCore::GraphicsContext3D::blendFunc):
718         (WebCore::GraphicsContext3D::blendFuncSeparate):
719         (WebCore::GraphicsContext3D::bufferData):
720         (WebCore::GraphicsContext3D::bufferSubData):
721         (WebCore::GraphicsContext3D::mapBufferRange):
722         (WebCore::GraphicsContext3D::unmapBuffer):
723         (WebCore::GraphicsContext3D::copyBufferSubData):
724         (WebCore::GraphicsContext3D::getInternalformativ):
725         (WebCore::GraphicsContext3D::renderbufferStorageMultisample):
726         (WebCore::GraphicsContext3D::texStorage2D):
727         (WebCore::GraphicsContext3D::texStorage3D):
728         (WebCore::GraphicsContext3D::getActiveUniforms):
729         (WebCore::GraphicsContext3D::checkFramebufferStatus):
730         (WebCore::GraphicsContext3D::clearColor):
731         (WebCore::GraphicsContext3D::clear):
732         (WebCore::GraphicsContext3D::clearStencil):
733         (WebCore::GraphicsContext3D::colorMask):
734         (WebCore::GraphicsContext3D::compileShader):
735         (WebCore::GraphicsContext3D::compileShaderDirect):
736         (WebCore::GraphicsContext3D::copyTexImage2D):
737         (WebCore::GraphicsContext3D::copyTexSubImage2D):
738         (WebCore::GraphicsContext3D::cullFace):
739         (WebCore::GraphicsContext3D::depthFunc):
740         (WebCore::GraphicsContext3D::depthMask):
741         (WebCore::GraphicsContext3D::detachShader):
742         (WebCore::GraphicsContext3D::disable):
743         (WebCore::GraphicsContext3D::disableVertexAttribArray):
744         (WebCore::GraphicsContext3D::drawArrays):
745         (WebCore::GraphicsContext3D::drawElements):
746         (WebCore::GraphicsContext3D::enable):
747         (WebCore::GraphicsContext3D::enableVertexAttribArray):
748         (WebCore::GraphicsContext3D::finish):
749         (WebCore::GraphicsContext3D::flush):
750         (WebCore::GraphicsContext3D::framebufferRenderbuffer):
751         (WebCore::GraphicsContext3D::framebufferTexture2D):
752         (WebCore::GraphicsContext3D::frontFace):
753         (WebCore::GraphicsContext3D::generateMipmap):
754         (WebCore::GraphicsContext3D::getActiveAttribImpl):
755         (WebCore::GraphicsContext3D::getActiveAttrib):
756         (WebCore::GraphicsContext3D::getActiveUniformImpl):
757         (WebCore::GraphicsContext3D::getActiveUniform):
758         (WebCore::GraphicsContext3D::getAttachedShaders):
759         (WebCore::generateHashedName):
760         (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap):
761         (WebCore::GraphicsContext3D::mappedSymbolName):
762         (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap):
763         (WebCore::GraphicsContext3D::originalSymbolName):
764         (WebCore::GraphicsContext3D::getAttribLocation):
765         (WebCore::GraphicsContext3D::getAttribLocationDirect):
766         (WebCore::GraphicsContext3D::getContextAttributes):
767         (WebCore::GraphicsContext3D::moveErrorsToSyntheticErrorList):
768         (WebCore::GraphicsContext3D::getError):
769         (WebCore::GraphicsContext3D::getString):
770         (WebCore::GraphicsContext3D::hint):
771         (WebCore::GraphicsContext3D::isBuffer):
772         (WebCore::GraphicsContext3D::isEnabled):
773         (WebCore::GraphicsContext3D::isFramebuffer):
774         (WebCore::GraphicsContext3D::isProgram):
775         (WebCore::GraphicsContext3D::isRenderbuffer):
776         (WebCore::GraphicsContext3D::isShader):
777         (WebCore::GraphicsContext3D::isTexture):
778         (WebCore::GraphicsContext3D::lineWidth):
779         (WebCore::GraphicsContext3D::linkProgram):
780         (WebCore::GraphicsContext3D::pixelStorei):
781         (WebCore::GraphicsContext3D::polygonOffset):
782         (WebCore::GraphicsContext3D::sampleCoverage):
783         (WebCore::GraphicsContext3D::scissor):
784         (WebCore::GraphicsContext3D::shaderSource):
785         (WebCore::GraphicsContext3D::stencilFunc):
786         (WebCore::GraphicsContext3D::stencilFuncSeparate):
787         (WebCore::GraphicsContext3D::stencilMask):
788         (WebCore::GraphicsContext3D::stencilMaskSeparate):
789         (WebCore::GraphicsContext3D::stencilOp):
790         (WebCore::GraphicsContext3D::stencilOpSeparate):
791         (WebCore::GraphicsContext3D::texParameterf):
792         (WebCore::GraphicsContext3D::texParameteri):
793         (WebCore::GraphicsContext3D::uniform1f):
794         (WebCore::GraphicsContext3D::uniform1fv):
795         (WebCore::GraphicsContext3D::uniform2f):
796         (WebCore::GraphicsContext3D::uniform2fv):
797         (WebCore::GraphicsContext3D::uniform3f):
798         (WebCore::GraphicsContext3D::uniform3fv):
799         (WebCore::GraphicsContext3D::uniform4f):
800         (WebCore::GraphicsContext3D::uniform4fv):
801         (WebCore::GraphicsContext3D::uniform1i):
802         (WebCore::GraphicsContext3D::uniform1iv):
803         (WebCore::GraphicsContext3D::uniform2i):
804         (WebCore::GraphicsContext3D::uniform2iv):
805         (WebCore::GraphicsContext3D::uniform3i):
806         (WebCore::GraphicsContext3D::uniform3iv):
807         (WebCore::GraphicsContext3D::uniform4i):
808         (WebCore::GraphicsContext3D::uniform4iv):
809         (WebCore::GraphicsContext3D::uniformMatrix2fv):
810         (WebCore::GraphicsContext3D::uniformMatrix3fv):
811         (WebCore::GraphicsContext3D::uniformMatrix4fv):
812         (WebCore::GraphicsContext3D::useProgram):
813         (WebCore::GraphicsContext3D::validateProgram):
814         (WebCore::GraphicsContext3D::vertexAttrib1f):
815         (WebCore::GraphicsContext3D::vertexAttrib1fv):
816         (WebCore::GraphicsContext3D::vertexAttrib2f):
817         (WebCore::GraphicsContext3D::vertexAttrib2fv):
818         (WebCore::GraphicsContext3D::vertexAttrib3f):
819         (WebCore::GraphicsContext3D::vertexAttrib3fv):
820         (WebCore::GraphicsContext3D::vertexAttrib4f):
821         (WebCore::GraphicsContext3D::vertexAttrib4fv):
822         (WebCore::GraphicsContext3D::vertexAttribPointer):
823         (WebCore::GraphicsContext3D::viewport):
824         (WebCore::GraphicsContext3D::createVertexArray):
825         (WebCore::GraphicsContext3D::deleteVertexArray):
826         (WebCore::GraphicsContext3D::isVertexArray):
827         (WebCore::GraphicsContext3D::bindVertexArray):
828         (WebCore::GraphicsContext3D::getBooleanv):
829         (WebCore::GraphicsContext3D::getBufferParameteriv):
830         (WebCore::GraphicsContext3D::getFloatv):
831         (WebCore::GraphicsContext3D::getInteger64v):
832         (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
833         (WebCore::GraphicsContext3D::getProgramiv):
834         (WebCore::GraphicsContext3D::getNonBuiltInActiveSymbolCount):
835         (WebCore::GraphicsContext3D::getUnmangledInfoLog):
836         (WebCore::GraphicsContext3D::getProgramInfoLog):
837         (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
838         (WebCore::GraphicsContext3D::getShaderiv):
839         (WebCore::GraphicsContext3D::getShaderInfoLog):
840         (WebCore::GraphicsContext3D::getShaderSource):
841         (WebCore::GraphicsContext3D::getTexParameterfv):
842         (WebCore::GraphicsContext3D::getTexParameteriv):
843         (WebCore::GraphicsContext3D::getUniformfv):
844         (WebCore::GraphicsContext3D::getUniformiv):
845         (WebCore::GraphicsContext3D::getUniformLocation):
846         (WebCore::GraphicsContext3D::getVertexAttribfv):
847         (WebCore::GraphicsContext3D::getVertexAttribiv):
848         (WebCore::GraphicsContext3D::getVertexAttribOffset):
849         (WebCore::GraphicsContext3D::texSubImage2D):
850         (WebCore::GraphicsContext3D::compressedTexImage2D):
851         (WebCore::GraphicsContext3D::compressedTexSubImage2D):
852         (WebCore::GraphicsContext3D::createBuffer):
853         (WebCore::GraphicsContext3D::createFramebuffer):
854         (WebCore::GraphicsContext3D::createProgram):
855         (WebCore::GraphicsContext3D::createRenderbuffer):
856         (WebCore::GraphicsContext3D::createShader):
857         (WebCore::GraphicsContext3D::createTexture):
858         (WebCore::GraphicsContext3D::deleteBuffer):
859         (WebCore::GraphicsContext3D::deleteFramebuffer):
860         (WebCore::GraphicsContext3D::deleteProgram):
861         (WebCore::GraphicsContext3D::deleteRenderbuffer):
862         (WebCore::GraphicsContext3D::deleteShader):
863         (WebCore::GraphicsContext3D::deleteTexture):
864         (WebCore::GraphicsContext3D::synthesizeGLError):
865         (WebCore::GraphicsContext3D::markContextChanged):
866         (WebCore::GraphicsContext3D::markLayerComposited):
867         (WebCore::GraphicsContext3D::layerComposited const):
868         (WebCore::GraphicsContext3D::forceContextLost):
869         (WebCore::GraphicsContext3D::recycleContext):
870         (WebCore::GraphicsContext3D::dispatchContextChangedNotification):
871         (WebCore::GraphicsContext3D::texImage2DDirect):
872         (WebCore::GraphicsContext3D::drawArraysInstanced):
873         (WebCore::GraphicsContext3D::drawElementsInstanced):
874         (WebCore::GraphicsContext3D::vertexAttribDivisor):
875         * platform/graphics/angle/TemporaryANGLESetting.cpp: Added.
876         (WebCore::TemporaryANGLESetting::TemporaryANGLESetting):
877         (WebCore::TemporaryANGLESetting::~TemporaryANGLESetting):
878         * platform/graphics/angle/TemporaryANGLESetting.h: Added.
879         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
880         (WebCore::GraphicsContext3D::GraphicsContext3D):
881         (WebCore::GraphicsContext3D::~GraphicsContext3D):
882         (WebCore::GraphicsContext3D::makeContextCurrent):
883         (WebCore::GraphicsContext3D::checkGPUStatus):
884         (WebCore::GraphicsContext3D::screenDidChange):
885         * platform/graphics/cocoa/WebGLLayer.h:
886         * platform/graphics/cocoa/WebGLLayer.mm:
887         (-[WebGLLayer display]):
888         * platform/graphics/cv/TextureCacheCV.mm:
889         (WebCore::TextureCacheCV::create):
890         (WebCore::TextureCacheCV::textureFromImage):
891         * platform/graphics/cv/VideoTextureCopierCV.cpp:
892         (WebCore::enumToStringMap):
893         (WebCore::VideoTextureCopierCV::initializeContextObjects):
894         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
895         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
896         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
897         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
898         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
899         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
900         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
901         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
902
903 2019-06-18  Saam Barati  <sbarati@apple.com>
904
905         [WHLSL] Do not generate duplicate constructors/copy constructors in synthesizeConstructors
906         https://bugs.webkit.org/show_bug.cgi?id=198580
907
908         Reviewed by Robin Morisset.
909
910         Prior to this patch, we were generating duplicate constructors 
911         for unnamed types. This is bad for two reasons:
912         1. It's inefficient, since we'd generate a constructor for every place in
913         the AST where we'd visit this unnamed type.
914         2. It made it impossible to resolve function overloads to call
915         the default constructor. This made it so that the autoInitializeVariables
916         pass would crash if we ever generated more than one of these functions
917         for the same type.
918         
919         To make this work, this patch splits up what used to be the resolveNamesInFunctions
920         pass. Previously, this pass would both resolve calls and resolve type names.
921         Synthesize constructors would run before this, since resolving calls meant we
922         may resolve a call to one of these synthesized constructors. However, synthesize
923         constructors now needs to test for the equality unnamed types, so it now requires
924         running the type resolution part of resolveNamesInFunctions before it runs.
925         
926         This patch splits resolveNamesInFunctions into two parts:
927         resolveTypeNamesInFunctions and resolveCallsInFunctions.
928         
929         So we used to run:
930         synthesizeConstructors
931         resolveNamesInFunctions
932         
933         And now we run:
934         resolveTypeNamesInFunctions 
935         synthesizeConstructors
936         resolveCallsInFunctions
937
938         Test: webgpu/whlsl-duplicate-types-should-not-produce-duplicate-ctors.html
939
940         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
941         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
942         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
943         (WebCore::WHLSL::AST::BooleanLiteral::clone const):
944         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
945         (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
946         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
947         (WebCore::WHLSL::AST::Expression::copyTypeTo const):
948         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
949         (WebCore::WHLSL::AST::FloatLiteral::clone const):
950         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
951         (WebCore::WHLSL::AST::FloatLiteralType::clone const):
952         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
953         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
954         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
955         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
956         (WebCore::WHLSL::AST::IntegerLiteralType::clone const):
957         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
958         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
959         (WebCore::WHLSL::AST::NullLiteral::clone const):
960         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
961         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
962         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
963         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
964         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
965         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
966         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
967         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
968         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
969         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
970         (WebCore::WHLSL::matches):
971         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
972         (WebCore::WHLSL::NameResolver::NameResolver):
973         (WebCore::WHLSL::NameResolver::visit):
974         (WebCore::WHLSL::resolveTypeNamesInFunctions):
975         (WebCore::WHLSL::resolveCallsInFunctions):
976         (WebCore::WHLSL::resolveNamesInFunctions): Deleted.
977         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
978         (WebCore::WHLSL::NameResolver::setIsResolvingCalls):
979         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
980         (WebCore::WHLSL::prepareShared):
981         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
982         (WebCore::WHLSL::UnnamedTypeKey::UnnamedTypeKey):
983         (WebCore::WHLSL::UnnamedTypeKey::isEmptyValue const):
984         (WebCore::WHLSL::UnnamedTypeKey::isHashTableDeletedValue const):
985         (WebCore::WHLSL::UnnamedTypeKey::hash const):
986         (WebCore::WHLSL::UnnamedTypeKey::operator== const):
987         (WebCore::WHLSL::UnnamedTypeKey::unnamedType const):
988         (WebCore::WHLSL::UnnamedTypeKey::Hash::hash):
989         (WebCore::WHLSL::UnnamedTypeKey::Hash::equal):
990         (WebCore::WHLSL::UnnamedTypeKey::Traits::isEmptyValue):
991         (WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
992         (WebCore::WHLSL::FindAllTypes::appendNamedType):
993         (WebCore::WHLSL::synthesizeConstructors):
994
995 2019-06-18  Truitt Savell  <tsavell@apple.com>
996
997         Unreviewed, rolling out r246524.
998
999         Caused 45 webgpu/ crashes.
1000
1001         Reverted changeset:
1002
1003         "[WHLSL] The name resolver does not deal with
1004         nativeFunctionDeclaration"
1005         https://bugs.webkit.org/show_bug.cgi?id=198306
1006         https://trac.webkit.org/changeset/246524
1007
1008 2019-06-18  Zalan Bujtas  <zalan@apple.com>
1009
1010         [LFC][IFC] Inline quirks should have their dedicated class.
1011         https://bugs.webkit.org/show_bug.cgi?id=198962
1012         <rdar://problem/51848170>
1013
1014         Reviewed by Antti Koivisto.
1015
1016         * Sources.txt:
1017         * WebCore.xcodeproj/project.pbxproj:
1018         * layout/LayoutState.h:
1019         * layout/inlineformatting/InlineFormattingContext.h:
1020         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1021         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
1022         * layout/inlineformatting/InlineFormattingContextQuirks.cpp: Added.
1023         (WebCore::Layout::InlineFormattingContext::Quirks::collapseLineDescent):
1024         * layout/inlineformatting/InlineLine.cpp:
1025         (WebCore::Layout::Line::close):
1026         * layout/inlineformatting/InlineLineBreaker.cpp:
1027         * layout/inlineformatting/InlineLineBreaker.h:
1028
1029 2019-06-18  Zalan Bujtas  <zalan@apple.com>
1030
1031         [LFC][IFC] Line::append() should take care of all the inline types.
1032         https://bugs.webkit.org/show_bug.cgi?id=198961
1033         <rdar://problem/51847712>
1034
1035         Reviewed by Antti Koivisto.
1036
1037         Make all the existing Line::append* functions private.
1038
1039         * layout/FormattingContextGeometry.cpp:
1040         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned): fix a typo.
1041         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1042         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
1043         * layout/inlineformatting/InlineLine.cpp:
1044         (WebCore::Layout::Line::append):
1045         * layout/inlineformatting/InlineLine.h:
1046
1047 2019-06-18  Simon Fraser  <simon.fraser@apple.com>
1048
1049         Convert macOS to scroll by changing layer boundsOrigin
1050         https://bugs.webkit.org/show_bug.cgi?id=198917
1051
1052         Reviewed by Antti Koivisto.
1053
1054         macOS did frame and overflow scrolling by changing the position of the scrolled
1055         contents layer. iOS scrolls by changing the boundsOrigin of the scrollContainer layer
1056         (which it has to, to match how UIScrollView works).
1057
1058         The iOS approach removes the need for an extra layer whose only role is for
1059         scroll positioning, so migrate macOS to the same approach. A later patch can remove
1060         m_scrolledContentsLayer.
1061         
1062         We can remove RenderLayerCompositor::m_clipLayer since m_scrollContainerLayer has exactly
1063         the same role now.
1064
1065         * page/scrolling/AsyncScrollingCoordinator.cpp:
1066         (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
1067         * page/scrolling/ScrollingCoordinator.cpp:
1068         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
1069         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1070         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
1071         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1072         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
1073         * platform/graphics/cocoa/WebCoreCALayerExtras.h:
1074         * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
1075         (-[CALayer _web_setLayerBoundsOrigin:]):
1076         * rendering/RenderLayerBacking.cpp:
1077         (WebCore::RenderLayerBacking::updateGeometry):
1078         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
1079         (WebCore::RenderLayerBacking::updateScrollOffset):
1080         * rendering/RenderLayerCompositor.cpp:
1081         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
1082         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1083         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1084         (WebCore::RenderLayerCompositor::updateLayersForScrollPosition):
1085         (WebCore::RenderLayerCompositor::updateScrollContainerGeometry):
1086         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1087         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1088         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1089         (WebCore::RenderLayerCompositor::ensureRootLayer):
1090         (WebCore::RenderLayerCompositor::destroyRootLayer):
1091         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
1092         (WebCore::RenderLayerCompositor::updateScrollLayerPosition): Deleted.
1093         (WebCore::RenderLayerCompositor::updateScrollLayerClipping): Deleted.
1094         * rendering/RenderLayerCompositor.h:
1095
1096 2019-06-18  Philippe Normand  <pnormand@igalia.com>
1097
1098         [GStreamer] Identify elements with monotonically increasing counters
1099         https://bugs.webkit.org/show_bug.cgi?id=198916
1100
1101         Reviewed by Xabier Rodriguez-Calvar.
1102
1103         Those ids tend to be shorter, easier to read for humans and for
1104         diff tools :) Underscores were also replaced by dashes, for
1105         consistency with the usual GStreamer element naming untold
1106         conventions.
1107
1108         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1109         (WebCore::MediaPlayerPrivateGStreamer::load):
1110         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1111         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1112         (WebCore::GStreamerVideoEncoder::makeElement):
1113         (WebCore::GStreamerVideoEncoder::InitEncode):
1114
1115 2019-06-18  Zan Dobersek  <zdobersek@igalia.com>
1116
1117         [WebGL] Extensions3DOpenGLES::bindVertexArrayOES() should allow zero array object
1118         https://bugs.webkit.org/show_bug.cgi?id=198929
1119
1120         Reviewed by Carlos Garcia Campos.
1121
1122         A 0 object parameter for the glBindVertexArrayOES() call is a valid
1123         value since it binds the default vertex array object for any updates and
1124         draws. As such the Extensions3DOpenGLES implementation shouldn't return
1125         early if the object value is 0.
1126
1127         No new tests -- covered by existing tests.
1128
1129         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
1130         (WebCore::Extensions3DOpenGLES::bindVertexArrayOES):
1131
1132 2019-06-17  Sihui Liu  <sihui_liu@apple.com>
1133
1134         -[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
1135         https://bugs.webkit.org/show_bug.cgi?id=198854
1136         <rdar://problem/51386058>
1137
1138         Reviewed by Geoffrey Garen.
1139
1140         Add option NSURLCredentialStorageRemoveSynchronizableCredentials when removing persistent credential so 
1141         credentials from same account will be removed from all devices.
1142
1143         Test: WKWebsiteDataStore.RemoveAllPersistentCredentials
1144
1145         * platform/network/CredentialStorage.cpp:
1146         (WebCore::CredentialStorage::originsWithPersistentCredentials):
1147         (WebCore::CredentialStorage::removePersistentCredentialsWithOrigins):
1148         (WebCore::CredentialStorage::clearPersistentCredentials):
1149         * platform/network/CredentialStorage.h:
1150         * platform/network/mac/CredentialStorageMac.mm:
1151         (WebCore::CredentialStorage::originsWithPersistentCredentials):
1152         (WebCore::CredentialStorage::removePersistentCredentialsWithOrigins):
1153         (WebCore::CredentialStorage::clearPersistentCredentials):
1154
1155 2019-06-17  Ryosuke Niwa  <rniwa@webkit.org>
1156
1157         m_disconnectedFrame can be null in DOMWindowExtension::willDestroyGlobalObjectInCachedFrame()
1158         https://bugs.webkit.org/show_bug.cgi?id=198943
1159
1160         Reviewed by Brady Eidson.
1161
1162         Apparently it's possible for m_disconnectedFrame to be null in this function even though this should never happen.
1163
1164         We've been trying to diagnose a class of issues in this area (e.g. r246187, r244971, r242797, r242677, r242676, r241848)
1165         but at some point, we need to stop crashing for the sake of user.
1166
1167         Worked around the bug by adding a null pointer check here.
1168
1169         * page/DOMWindowExtension.cpp:
1170         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
1171
1172 2019-06-17  Alex Christensen  <achristensen@webkit.org>
1173
1174         Fix iOS crash when starting loads with no active DocumentLoader
1175         https://bugs.webkit.org/show_bug.cgi?id=187360
1176         <rdar://problem/29389084>
1177
1178         Reviewed by Geoff Garen.
1179
1180         When FrameLoader::activeDocumentLoader returns null in the ResourceLoader constructor,
1181         on iOS we will dereference it to ask if it has a frame in an early return in init.
1182         Let's not.  If we don't have a DocumentLoader, we don't have a frame and should fail.
1183
1184         Crash reports indicate this crash is related to Beacon and other uses of LoaderStrategy::startPingLoad,
1185         but attempts to make a unit test to reproduce the crash were unsuccessful.
1186
1187         * loader/ResourceLoader.cpp:
1188         (WebCore::ResourceLoader::init):
1189
1190 2019-06-17  Robin Morisset  <rmorisset@apple.com>
1191
1192         [WHLSL] The name resolver does not deal with nativeFunctionDeclaration
1193         https://bugs.webkit.org/show_bug.cgi?id=198306
1194
1195         Reviewed by Saam Barati.
1196
1197         We currently have a crash in the nameResolver when trying to use the full standard library.
1198         What is happening is that because we don't specify anything to do to nativeFunctionDeclarations, names in their parameters
1199         are added to the global environment. And so as soon as we have two such parameters with the same name, the name resolver fails.
1200
1201         Tested by adding two native functions that share a parameter name to the standard library.
1202
1203         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
1204         (WebCore::WHLSL::NameResolver::visit):
1205         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1206
1207 2019-06-17  Robin Morisset  <rmorisset@apple.com>
1208
1209         [WHLSL] Remove backtracking from parseAttributeBlock
1210         https://bugs.webkit.org/show_bug.cgi?id=198934
1211
1212         Reviewed by Myles C. Maxfield.
1213
1214         No functional change intended.
1215
1216         Tested by running LayoutTests/webgpu/whlsl-compute.html
1217
1218         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1219         (WebCore::WHLSL::Parser::parseAttributeBlock):
1220
1221 2019-06-17  Saam Barati  <sbarati@apple.com>
1222
1223         [WHLSL] Make .length work
1224         https://bugs.webkit.org/show_bug.cgi?id=198890
1225
1226         Reviewed by Myles Maxfield.
1227
1228         This patch makes accessing .length on buffers work. To make this work as
1229         expected, I've fixed a handful of small bugs:
1230         
1231         - The checker was not calling resolveByInstantiation for getters. This patch
1232           modifies the checker to do that, so we can now resolve a getter to
1233           "operator.length". I also refactored the checker to have a helper method
1234           that both does overload resolution and resolveByInstantiation to make it
1235           difficult to forget to call resolveByInstantiation.
1236         - The property resolver had a bug where it would return a non-null value
1237           in anderCallArgument for array references even when there was no ander and
1238           no thread ander function. This patch makes it now return null if there is
1239           neither an ander nor a thread ander.
1240         - The metal codegen incorrectly unpacked the length of buffers. It swapped the
1241           bottom four bytes and the top four bytes of the size_t value. This patch
1242           corrects that. This was also a cause of flakiness in various tests since
1243           we ended up with a length much larger than expected, leading to bounds
1244           checks always passing in our tests.
1245         - This patch also fixes our tests to specify the output buffer length
1246           properly for various programs.
1247
1248         Test: webgpu/whlsl-buffer-length.html
1249
1250         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
1251         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
1252         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1253         (WebCore::WHLSL::resolveFunction):
1254         (WebCore::WHLSL::Checker::finishVisiting):
1255         (WebCore::WHLSL::Checker::visit):
1256         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1257         (WebCore::WHLSL::anderCallArgument):
1258
1259 2019-06-17  Ryan Haddad  <ryanhaddad@apple.com>
1260
1261         Unreviewed, rolling out r246501.
1262
1263         Breaks Apple internal builds.
1264
1265         Reverted changeset:
1266
1267         "Support using ANGLE as the backend for the WebGL
1268         implementation"
1269         https://bugs.webkit.org/show_bug.cgi?id=197755
1270         https://trac.webkit.org/changeset/246501
1271
1272 2019-06-17  Kenneth Russell  <kbr@chromium.org>
1273
1274         Support using ANGLE as the backend for the WebGL implementation
1275         https://bugs.webkit.org/show_bug.cgi?id=197755
1276
1277         Reviewed by Dean Jackson.
1278
1279         Add new files supplying an ANGLE version of GraphicsContext3D and
1280         Extensions3D, conditionalized under USE_ANGLE. Update Xcode project to
1281         build these files. This option compiles and links successfully.
1282
1283         FIXMEs remain in several common files which will be addressed in
1284         subsequent patches.
1285
1286         This work will be tested with the preexisting WebGL conformance
1287         suite.
1288
1289         * SourcesCocoa.txt:
1290         * WebCore.xcodeproj/project.pbxproj:
1291         * platform/graphics/ANGLEWebKitBridge.h:
1292         * platform/graphics/GraphicsContext3D.h:
1293         * platform/graphics/GraphicsContext3DManager.cpp:
1294         (WebCore::GraphicsContext3DManager::updateAllContexts):
1295         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
1296         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
1297         * platform/graphics/angle/Extensions3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp.
1298         (WebCore::Extensions3DANGLE::Extensions3DANGLE):
1299         (WebCore::Extensions3DANGLE::supports):
1300         (WebCore::Extensions3DANGLE::ensureEnabled):
1301         (WebCore::Extensions3DANGLE::isEnabled):
1302         (WebCore::Extensions3DANGLE::getGraphicsResetStatusARB):
1303         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
1304         (WebCore::Extensions3DANGLE::initializeAvailableExtensions):
1305         (WebCore::Extensions3DANGLE::readnPixelsEXT):
1306         (WebCore::Extensions3DANGLE::getnUniformfvEXT):
1307         (WebCore::Extensions3DANGLE::getnUniformivEXT):
1308         (WebCore::Extensions3DANGLE::blitFramebuffer):
1309         (WebCore::Extensions3DANGLE::renderbufferStorageMultisample):
1310         (WebCore::Extensions3DANGLE::createVertexArrayOES):
1311         (WebCore::Extensions3DANGLE::deleteVertexArrayOES):
1312         (WebCore::Extensions3DANGLE::isVertexArrayOES):
1313         (WebCore::Extensions3DANGLE::bindVertexArrayOES):
1314         (WebCore::Extensions3DANGLE::insertEventMarkerEXT):
1315         (WebCore::Extensions3DANGLE::pushGroupMarkerEXT):
1316         (WebCore::Extensions3DANGLE::popGroupMarkerEXT):
1317         (WebCore::Extensions3DANGLE::supportsExtension):
1318         (WebCore::Extensions3DANGLE::drawBuffersEXT):
1319         (WebCore::Extensions3DANGLE::drawArraysInstanced):
1320         (WebCore::Extensions3DANGLE::drawElementsInstanced):
1321         (WebCore::Extensions3DANGLE::vertexAttribDivisor):
1322         (WebCore::Extensions3DANGLE::getExtensions):
1323         * platform/graphics/angle/Extensions3DANGLE.h: Added.
1324         * platform/graphics/angle/GraphicsContext3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp.
1325         (WebCore::GraphicsContext3D::releaseShaderCompiler):
1326         (WebCore::wipeAlphaChannelFromPixels):
1327         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
1328         (WebCore::GraphicsContext3D::validateAttributes):
1329         (WebCore::GraphicsContext3D::reshapeFBOs):
1330         (WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
1331         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
1332         (WebCore::GraphicsContext3D::renderbufferStorage):
1333         (WebCore::GraphicsContext3D::getIntegerv):
1334         (WebCore::GraphicsContext3D::getShaderPrecisionFormat):
1335         (WebCore::GraphicsContext3D::texImage2D):
1336         (WebCore::GraphicsContext3D::depthRange):
1337         (WebCore::GraphicsContext3D::clearDepth):
1338         (WebCore::GraphicsContext3D::getExtensions):
1339         (WebCore::GraphicsContext3D::readPixels):
1340         (WebCore::setCurrentNameHashMapForShader):
1341         (WebCore::nameHashForShader):
1342         (WebCore::GraphicsContext3D::validateDepthStencil):
1343         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
1344         (WebCore::GraphicsContext3D::paintCompositedResultsToCanvas):
1345         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
1346         (WebCore::GraphicsContext3D::prepareTexture):
1347         (WebCore::GraphicsContext3D::readRenderingResults):
1348         (WebCore::GraphicsContext3D::reshape):
1349         (WebCore::GraphicsContext3D::checkVaryingsPacking const):
1350         (WebCore::GraphicsContext3D::precisionsMatch const):
1351         (WebCore::GraphicsContext3D::getInternalFramebufferSize const):
1352         (WebCore::GraphicsContext3D::activeTexture):
1353         (WebCore::GraphicsContext3D::attachShader):
1354         (WebCore::GraphicsContext3D::bindAttribLocation):
1355         (WebCore::GraphicsContext3D::bindBuffer):
1356         (WebCore::GraphicsContext3D::bindFramebuffer):
1357         (WebCore::GraphicsContext3D::bindRenderbuffer):
1358         (WebCore::GraphicsContext3D::bindTexture):
1359         (WebCore::GraphicsContext3D::blendColor):
1360         (WebCore::GraphicsContext3D::blendEquation):
1361         (WebCore::GraphicsContext3D::blendEquationSeparate):
1362         (WebCore::GraphicsContext3D::blendFunc):
1363         (WebCore::GraphicsContext3D::blendFuncSeparate):
1364         (WebCore::GraphicsContext3D::bufferData):
1365         (WebCore::GraphicsContext3D::bufferSubData):
1366         (WebCore::GraphicsContext3D::mapBufferRange):
1367         (WebCore::GraphicsContext3D::unmapBuffer):
1368         (WebCore::GraphicsContext3D::copyBufferSubData):
1369         (WebCore::GraphicsContext3D::getInternalformativ):
1370         (WebCore::GraphicsContext3D::renderbufferStorageMultisample):
1371         (WebCore::GraphicsContext3D::texStorage2D):
1372         (WebCore::GraphicsContext3D::texStorage3D):
1373         (WebCore::GraphicsContext3D::getActiveUniforms):
1374         (WebCore::GraphicsContext3D::checkFramebufferStatus):
1375         (WebCore::GraphicsContext3D::clearColor):
1376         (WebCore::GraphicsContext3D::clear):
1377         (WebCore::GraphicsContext3D::clearStencil):
1378         (WebCore::GraphicsContext3D::colorMask):
1379         (WebCore::GraphicsContext3D::compileShader):
1380         (WebCore::GraphicsContext3D::compileShaderDirect):
1381         (WebCore::GraphicsContext3D::copyTexImage2D):
1382         (WebCore::GraphicsContext3D::copyTexSubImage2D):
1383         (WebCore::GraphicsContext3D::cullFace):
1384         (WebCore::GraphicsContext3D::depthFunc):
1385         (WebCore::GraphicsContext3D::depthMask):
1386         (WebCore::GraphicsContext3D::detachShader):
1387         (WebCore::GraphicsContext3D::disable):
1388         (WebCore::GraphicsContext3D::disableVertexAttribArray):
1389         (WebCore::GraphicsContext3D::drawArrays):
1390         (WebCore::GraphicsContext3D::drawElements):
1391         (WebCore::GraphicsContext3D::enable):
1392         (WebCore::GraphicsContext3D::enableVertexAttribArray):
1393         (WebCore::GraphicsContext3D::finish):
1394         (WebCore::GraphicsContext3D::flush):
1395         (WebCore::GraphicsContext3D::framebufferRenderbuffer):
1396         (WebCore::GraphicsContext3D::framebufferTexture2D):
1397         (WebCore::GraphicsContext3D::frontFace):
1398         (WebCore::GraphicsContext3D::generateMipmap):
1399         (WebCore::GraphicsContext3D::getActiveAttribImpl):
1400         (WebCore::GraphicsContext3D::getActiveAttrib):
1401         (WebCore::GraphicsContext3D::getActiveUniformImpl):
1402         (WebCore::GraphicsContext3D::getActiveUniform):
1403         (WebCore::GraphicsContext3D::getAttachedShaders):
1404         (WebCore::generateHashedName):
1405         (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap):
1406         (WebCore::GraphicsContext3D::mappedSymbolName):
1407         (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap):
1408         (WebCore::GraphicsContext3D::originalSymbolName):
1409         (WebCore::GraphicsContext3D::getAttribLocation):
1410         (WebCore::GraphicsContext3D::getAttribLocationDirect):
1411         (WebCore::GraphicsContext3D::getContextAttributes):
1412         (WebCore::GraphicsContext3D::moveErrorsToSyntheticErrorList):
1413         (WebCore::GraphicsContext3D::getError):
1414         (WebCore::GraphicsContext3D::getString):
1415         (WebCore::GraphicsContext3D::hint):
1416         (WebCore::GraphicsContext3D::isBuffer):
1417         (WebCore::GraphicsContext3D::isEnabled):
1418         (WebCore::GraphicsContext3D::isFramebuffer):
1419         (WebCore::GraphicsContext3D::isProgram):
1420         (WebCore::GraphicsContext3D::isRenderbuffer):
1421         (WebCore::GraphicsContext3D::isShader):
1422         (WebCore::GraphicsContext3D::isTexture):
1423         (WebCore::GraphicsContext3D::lineWidth):
1424         (WebCore::GraphicsContext3D::linkProgram):
1425         (WebCore::GraphicsContext3D::pixelStorei):
1426         (WebCore::GraphicsContext3D::polygonOffset):
1427         (WebCore::GraphicsContext3D::sampleCoverage):
1428         (WebCore::GraphicsContext3D::scissor):
1429         (WebCore::GraphicsContext3D::shaderSource):
1430         (WebCore::GraphicsContext3D::stencilFunc):
1431         (WebCore::GraphicsContext3D::stencilFuncSeparate):
1432         (WebCore::GraphicsContext3D::stencilMask):
1433         (WebCore::GraphicsContext3D::stencilMaskSeparate):
1434         (WebCore::GraphicsContext3D::stencilOp):
1435         (WebCore::GraphicsContext3D::stencilOpSeparate):
1436         (WebCore::GraphicsContext3D::texParameterf):
1437         (WebCore::GraphicsContext3D::texParameteri):
1438         (WebCore::GraphicsContext3D::uniform1f):
1439         (WebCore::GraphicsContext3D::uniform1fv):
1440         (WebCore::GraphicsContext3D::uniform2f):
1441         (WebCore::GraphicsContext3D::uniform2fv):
1442         (WebCore::GraphicsContext3D::uniform3f):
1443         (WebCore::GraphicsContext3D::uniform3fv):
1444         (WebCore::GraphicsContext3D::uniform4f):
1445         (WebCore::GraphicsContext3D::uniform4fv):
1446         (WebCore::GraphicsContext3D::uniform1i):
1447         (WebCore::GraphicsContext3D::uniform1iv):
1448         (WebCore::GraphicsContext3D::uniform2i):
1449         (WebCore::GraphicsContext3D::uniform2iv):
1450         (WebCore::GraphicsContext3D::uniform3i):
1451         (WebCore::GraphicsContext3D::uniform3iv):
1452         (WebCore::GraphicsContext3D::uniform4i):
1453         (WebCore::GraphicsContext3D::uniform4iv):
1454         (WebCore::GraphicsContext3D::uniformMatrix2fv):
1455         (WebCore::GraphicsContext3D::uniformMatrix3fv):
1456         (WebCore::GraphicsContext3D::uniformMatrix4fv):
1457         (WebCore::GraphicsContext3D::useProgram):
1458         (WebCore::GraphicsContext3D::validateProgram):
1459         (WebCore::GraphicsContext3D::vertexAttrib1f):
1460         (WebCore::GraphicsContext3D::vertexAttrib1fv):
1461         (WebCore::GraphicsContext3D::vertexAttrib2f):
1462         (WebCore::GraphicsContext3D::vertexAttrib2fv):
1463         (WebCore::GraphicsContext3D::vertexAttrib3f):
1464         (WebCore::GraphicsContext3D::vertexAttrib3fv):
1465         (WebCore::GraphicsContext3D::vertexAttrib4f):
1466         (WebCore::GraphicsContext3D::vertexAttrib4fv):
1467         (WebCore::GraphicsContext3D::vertexAttribPointer):
1468         (WebCore::GraphicsContext3D::viewport):
1469         (WebCore::GraphicsContext3D::createVertexArray):
1470         (WebCore::GraphicsContext3D::deleteVertexArray):
1471         (WebCore::GraphicsContext3D::isVertexArray):
1472         (WebCore::GraphicsContext3D::bindVertexArray):
1473         (WebCore::GraphicsContext3D::getBooleanv):
1474         (WebCore::GraphicsContext3D::getBufferParameteriv):
1475         (WebCore::GraphicsContext3D::getFloatv):
1476         (WebCore::GraphicsContext3D::getInteger64v):
1477         (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
1478         (WebCore::GraphicsContext3D::getProgramiv):
1479         (WebCore::GraphicsContext3D::getNonBuiltInActiveSymbolCount):
1480         (WebCore::GraphicsContext3D::getUnmangledInfoLog):
1481         (WebCore::GraphicsContext3D::getProgramInfoLog):
1482         (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
1483         (WebCore::GraphicsContext3D::getShaderiv):
1484         (WebCore::GraphicsContext3D::getShaderInfoLog):
1485         (WebCore::GraphicsContext3D::getShaderSource):
1486         (WebCore::GraphicsContext3D::getTexParameterfv):
1487         (WebCore::GraphicsContext3D::getTexParameteriv):
1488         (WebCore::GraphicsContext3D::getUniformfv):
1489         (WebCore::GraphicsContext3D::getUniformiv):
1490         (WebCore::GraphicsContext3D::getUniformLocation):
1491         (WebCore::GraphicsContext3D::getVertexAttribfv):
1492         (WebCore::GraphicsContext3D::getVertexAttribiv):
1493         (WebCore::GraphicsContext3D::getVertexAttribOffset):
1494         (WebCore::GraphicsContext3D::texSubImage2D):
1495         (WebCore::GraphicsContext3D::compressedTexImage2D):
1496         (WebCore::GraphicsContext3D::compressedTexSubImage2D):
1497         (WebCore::GraphicsContext3D::createBuffer):
1498         (WebCore::GraphicsContext3D::createFramebuffer):
1499         (WebCore::GraphicsContext3D::createProgram):
1500         (WebCore::GraphicsContext3D::createRenderbuffer):
1501         (WebCore::GraphicsContext3D::createShader):
1502         (WebCore::GraphicsContext3D::createTexture):
1503         (WebCore::GraphicsContext3D::deleteBuffer):
1504         (WebCore::GraphicsContext3D::deleteFramebuffer):
1505         (WebCore::GraphicsContext3D::deleteProgram):
1506         (WebCore::GraphicsContext3D::deleteRenderbuffer):
1507         (WebCore::GraphicsContext3D::deleteShader):
1508         (WebCore::GraphicsContext3D::deleteTexture):
1509         (WebCore::GraphicsContext3D::synthesizeGLError):
1510         (WebCore::GraphicsContext3D::markContextChanged):
1511         (WebCore::GraphicsContext3D::markLayerComposited):
1512         (WebCore::GraphicsContext3D::layerComposited const):
1513         (WebCore::GraphicsContext3D::forceContextLost):
1514         (WebCore::GraphicsContext3D::recycleContext):
1515         (WebCore::GraphicsContext3D::dispatchContextChangedNotification):
1516         (WebCore::GraphicsContext3D::texImage2DDirect):
1517         (WebCore::GraphicsContext3D::drawArraysInstanced):
1518         (WebCore::GraphicsContext3D::drawElementsInstanced):
1519         (WebCore::GraphicsContext3D::vertexAttribDivisor):
1520         * platform/graphics/angle/TemporaryANGLESetting.cpp: Added.
1521         (WebCore::TemporaryANGLESetting::TemporaryANGLESetting):
1522         (WebCore::TemporaryANGLESetting::~TemporaryANGLESetting):
1523         * platform/graphics/angle/TemporaryANGLESetting.h: Added.
1524         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1525         (WebCore::GraphicsContext3D::GraphicsContext3D):
1526         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1527         (WebCore::GraphicsContext3D::makeContextCurrent):
1528         (WebCore::GraphicsContext3D::checkGPUStatus):
1529         (WebCore::GraphicsContext3D::screenDidChange):
1530         * platform/graphics/cocoa/WebGLLayer.h:
1531         * platform/graphics/cocoa/WebGLLayer.mm:
1532         (-[WebGLLayer display]):
1533         * platform/graphics/cv/TextureCacheCV.mm:
1534         (WebCore::TextureCacheCV::create):
1535         (WebCore::TextureCacheCV::textureFromImage):
1536         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1537         (WebCore::enumToStringMap):
1538         (WebCore::VideoTextureCopierCV::initializeContextObjects):
1539         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
1540         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
1541         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
1542         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1543         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1544         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1545         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1546         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1547
1548 2019-06-17  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1549
1550         [GTK] Stop accessing GdkEvent fields when possible
1551         https://bugs.webkit.org/show_bug.cgi?id=198829
1552
1553         Reviewed by Michael Catanzaro.
1554
1555         Direct access to GdkEvent structs is no longer possible in GTK 4.
1556
1557         No behaviour changes.
1558
1559         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1560         (WebCore::eventTypeForGdkKeyEvent):
1561         (WebCore::modifiersForGdkKeyEvent):
1562         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1563         * platform/gtk/PlatformMouseEventGtk.cpp:
1564         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1565         * platform/gtk/PlatformWheelEventGtk.cpp:
1566         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1567
1568 2019-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1569
1570         Unreviewed, rolling out r246467.
1571
1572         It broke scrolling with mouse wheel
1573
1574         Reverted changeset:
1575
1576         "[GTK] Stop accessing GdkEvent fields when possible"
1577         https://bugs.webkit.org/show_bug.cgi?id=198829
1578         https://trac.webkit.org/changeset/246467
1579
1580 2019-06-16  Darin Adler  <darin@apple.com>
1581
1582         Convert some uses of fixed width and fixed precision floating point formatting to use shortest instead
1583         https://bugs.webkit.org/show_bug.cgi?id=198896
1584
1585         Reviewed by Sam Weinig.
1586
1587         * Modules/indexeddb/IDBKeyData.cpp:
1588         (WebCore::IDBKeyData::loggingString const): Removed unneeded use of
1589         FormattedNumber::fixedWidth to override the default shortest-form formatting.
1590         * page/History.cpp:
1591         (WebCore::History::stateObjectAdded): Ditto.
1592
1593         * page/PrintContext.cpp:
1594         (WebCore::PrintContext::pageProperty): Use String::number instead of
1595         String::numberToStringFixedPrecision. Also removed some uses of
1596         FormattedNumber::fixedPrecision.
1597         * platform/graphics/FloatPolygon.cpp:
1598         (WebCore::FloatPolygonEdge::debugString const): Ditto.
1599
1600 2019-06-16  Darin Adler  <darin@apple.com>
1601
1602         Rename AtomicString to AtomString
1603         https://bugs.webkit.org/show_bug.cgi?id=195276
1604
1605         Reviewed by Michael Catanzaro.
1606
1607         * many files: Let do-webcore-rename do the renaming.
1608
1609 2019-06-16  Eric Carlson  <eric.carlson@apple.com>
1610
1611         [MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
1612         https://bugs.webkit.org/show_bug.cgi?id=198875
1613         <rdar://problem/51768374>
1614
1615         Reviewed by Youenn Fablet.
1616
1617         * platform/graphics/MediaPlayer.h:
1618         (WTF::LogArgument<MediaTime>::toString): Deleted, moved to MediaTime.h.
1619         (WTF::LogArgument<MediaTimeRange>::toString): Deleted, moved to MediaTime.h.
1620
1621         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1622         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate): Avoid roundoff error.
1623
1624 2019-06-16  Simon Fraser  <simon.fraser@apple.com>
1625
1626         Implement ScrollableArea::scrollOffset()
1627         https://bugs.webkit.org/show_bug.cgi?id=198895
1628
1629         Reviewed by Antti Koivisto.
1630
1631         Remove from ScrollableArea the following:
1632             virtual int scrollSize(ScrollbarOrientation) const = 0;
1633             virtual int scrollOffset(ScrollbarOrientation) const = 0;
1634         and instead implement ScrollOffset scrollOffset() const.
1635
1636         Also make scrollPosition() pure virtual, avoiding the reverse dependency where
1637         this base class implementation got values from scrollbars.
1638         
1639         scrollSize(ScrollbarOrientation) was only used by ScrollAnimatorIOS and we can
1640         do the same computation via min/max scroll positions.
1641         
1642         RenderListBox and PopupMenuWin need implementations of scrollPosition().
1643         
1644         Remove some PLATFORM(IOS_FAMILY) #ifdefs from ScrollableArea for code that compiles
1645         on all platforms.
1646
1647         * page/FrameView.h:
1648         * platform/ScrollView.cpp:
1649         (WebCore::ScrollView::overhangAmount const):
1650         (WebCore::ScrollView::scrollSize const): Deleted.
1651         (WebCore::ScrollView::scrollOffset const): Deleted.
1652         * platform/ScrollView.h:
1653         * platform/ScrollableArea.cpp:
1654         (WebCore::ScrollableArea::isPinnedVerticallyInDirection const):
1655         (WebCore::ScrollableArea::scrollOffset const):
1656         (WebCore::ScrollableArea::scrollPosition const): Deleted.
1657         * platform/ScrollableArea.h:
1658         (WebCore::offsetForOrientation):
1659         (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMinimumPosition const):
1660         (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMaximumPosition const):
1661         (WebCore::ScrollableArea::isVerticalScrollerPinnedToMinimumPosition const):
1662         (WebCore::ScrollableArea::isVerticalScrollerPinnedToMaximumPosition const):
1663         (WebCore::ScrollableArea::tiledBacking const): Deleted.
1664         * platform/Scrollbar.cpp:
1665         (WebCore::Scrollbar::Scrollbar):
1666         (WebCore::Scrollbar::offsetDidChange):
1667         * platform/ios/ScrollAnimatorIOS.mm:
1668         (WebCore::ScrollAnimatorIOS::handleTouchEvent):
1669         * platform/win/PopupMenuWin.cpp:
1670         (WebCore::PopupMenuWin::scrollPosition const):
1671         (WebCore::PopupMenuWin::wndProc):
1672         (WebCore::PopupMenuWin::scrollSize const): Deleted.
1673         (WebCore::PopupMenuWin::scrollOffset const): Deleted.
1674         * platform/win/PopupMenuWin.h:
1675         (WebCore::PopupMenuWin::scrollOffset const): Deleted.
1676         * rendering/RenderLayer.cpp:
1677         (WebCore::RenderLayer::scrollSize const): Deleted.
1678         (WebCore::RenderLayer::scrollOffset const): Deleted.
1679         * rendering/RenderLayer.h:
1680         * rendering/RenderListBox.cpp:
1681         (WebCore::RenderListBox::scrollPosition const):
1682         (WebCore::RenderListBox::scrollSize const): Deleted.
1683         (WebCore::RenderListBox::scrollOffset const): Deleted.
1684         * rendering/RenderListBox.h:
1685
1686 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1687
1688         Address Sam's post-landing review of r246234.
1689
1690         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1691         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
1692
1693 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1694
1695         [LFC][IFC] Decouple baseline ascent/descent and baseline offset.
1696         https://bugs.webkit.org/show_bug.cgi?id=198901
1697         <rdar://problem/51782393>
1698
1699         Reviewed by Antti Koivisto.
1700
1701         Baseline offset is the baseline's distance from the line's logical top -and it is not necessarily the same as the baseline's ascent.
1702         It's easier to track the baseline and its top separately since certain properties only change one or the other.
1703
1704         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1705         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
1706         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
1707         * layout/inlineformatting/InlineLine.cpp:
1708         (WebCore::Layout::Line::Line):
1709         (WebCore::Layout::Line::close):
1710         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
1711         (WebCore::Layout::Line::halfLeadingMetrics):
1712         * layout/inlineformatting/InlineLine.h:
1713         (WebCore::Layout::Line::Content::baselineOffset const):
1714         (WebCore::Layout::Line::Content::setBaselineOffset):
1715         (WebCore::Layout::Line::baselineOffset const):
1716         * layout/inlineformatting/InlineLineBox.h:
1717         (WebCore::Layout::LineBox::baselineOffset const):
1718         (WebCore::Layout::LineBox::LineBox):
1719
1720 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1721
1722         [LFC][IFC] Intruding float may prevent adding any inline box
1723         https://bugs.webkit.org/show_bug.cgi?id=198891
1724         <rdar://problem/51779956>
1725
1726         Reviewed by Antti Koivisto.
1727
1728         Take the intruding left/right float pair and find the vertical position where the next line might go
1729         if these floats prevent us from adding even one inline box to the current line.
1730
1731         * layout/FormattingContext.cpp:
1732         (WebCore::Layout::FormattingContext::mapPointToAncestor):
1733         (WebCore::Layout::FormattingContext::mapPointToDescendent):
1734         * layout/FormattingContext.h:
1735         * layout/LayoutUnits.h:
1736         (WebCore::Layout::Point::max):
1737         * layout/inlineformatting/InlineFormattingContext.h:
1738         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1739         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
1740         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
1741
1742 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1743
1744         [LFC][Floats] Add bottom value to FloatingState::Constraints
1745         https://bugs.webkit.org/show_bug.cgi?id=198889
1746         <rdar://problem/51776730>
1747
1748         Reviewed by Antti Koivisto.
1749
1750         Constraints::left/right->y indicates where this particular constrain ends. This is going to be used by inline layout to figure where
1751         the next line should go (vertical position).
1752
1753         * layout/floats/FloatingState.cpp:
1754         (WebCore::Layout::FloatingState::constraints const):
1755         * layout/floats/FloatingState.h:
1756
1757 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1758
1759         [LFC][IFC] Ignore descent when in limited/full quirks mode
1760         https://bugs.webkit.org/show_bug.cgi?id=198893
1761         <rdar://problem/51780634>
1762
1763         Reviewed by Antti Koivisto.
1764
1765         In limited/full quirks mode, line's descent should be ignored when computing the final line height when
1766         1. the line has baseline aligned content only and
1767         2. these baseline aligned boxes don't have descent.
1768
1769         * layout/inlineformatting/InlineLine.cpp:
1770         (WebCore::Layout::Line::isVisuallyEmpty const):
1771         (WebCore::Layout::Line::close):
1772
1773 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1774
1775         [LFC][IFC] Line::isVisuallyEmpty should check inline-block boxes.
1776         https://bugs.webkit.org/show_bug.cgi?id=198894
1777         <rdar://problem/51780886>
1778
1779         Reviewed by Antti Koivisto.
1780
1781         Non-zero width/height inline-block boxes make the line visually non-empty.
1782
1783         * layout/inlineformatting/InlineLine.cpp:
1784         (WebCore::Layout::Line::isVisuallyEmpty const):
1785
1786 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1787
1788         [LFC] Add Layout::Box::isContainingBlockDescendantOf
1789         https://bugs.webkit.org/show_bug.cgi?id=198888
1790         <rdar://problem/51776466>
1791
1792         Reviewed by Antti Koivisto.
1793
1794         Box::isDescendantOf indicates simple ancestor - descendant relationship, while
1795         isContainingBlockDescendantOf checks the containing block chain.
1796
1797         * layout/FormattingContext.cpp:
1798         (WebCore::Layout::mapHorizontalPositionToAncestor):
1799         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
1800         (WebCore::Layout::FormattingContext::mapTopToAncestor):
1801         (WebCore::Layout::FormattingContext::mapPointToAncestor):
1802         * layout/floats/FloatingState.h:
1803         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
1804         * layout/layouttree/LayoutBox.cpp:
1805         (WebCore::Layout::Box::isDescendantOf const):
1806         (WebCore::Layout::Box::isContainingBlockDescendantOf const):
1807         * layout/layouttree/LayoutBox.h:
1808
1809 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1810
1811         [LFC][IFC] Remove Line::Content::isVisuallyEmpty
1812         https://bugs.webkit.org/show_bug.cgi?id=198892
1813         <rdar://problem/51780345>
1814
1815         Reviewed by Antti Koivisto.
1816
1817         Instead of setting the isVisuallyEmpty flag, reset the line height to 0. 
1818
1819         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1820         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
1821         * layout/inlineformatting/InlineLine.cpp:
1822         (WebCore::Layout::Line::close):
1823         * layout/inlineformatting/InlineLine.h:
1824         (WebCore::Layout::Line::Content::isEmpty const):
1825         (WebCore::Layout::Line::Content::setBaseline):
1826         (WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
1827         (WebCore::Layout::Line::Content::setIsVisuallyEmpty): Deleted.
1828
1829 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1830
1831         [LFC] Add limited quirks mode to LayoutState.
1832         https://bugs.webkit.org/show_bug.cgi?id=198881
1833         <rdar://problem/51773229>
1834
1835         Reviewed by Antti Koivisto.
1836
1837         This is in preparation for introducing limited quirks mode to inline layout.
1838
1839         * layout/LayoutState.h:
1840         (WebCore::Layout::LayoutState::setQuirksMode):
1841         (WebCore::Layout::LayoutState::inQuirksMode const):
1842         (WebCore::Layout::LayoutState::inLimitedQuirksMode const):
1843         (WebCore::Layout::LayoutState::inNoQuirksMode const):
1844         (WebCore::Layout::LayoutState::setInQuirksMode): Deleted.
1845         * page/FrameViewLayoutContext.cpp:
1846         (WebCore::layoutUsingFormattingContext):
1847
1848 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1849
1850         [LFC][IFC] Completely collapsed runs should not go to the trimmable run list.
1851         https://bugs.webkit.org/show_bug.cgi?id=198900
1852         <rdar://problem/51782156>
1853
1854         Reviewed by Antti Koivisto.
1855
1856         * layout/inlineformatting/InlineLine.cpp:
1857         (WebCore::Layout::Line::trailingTrimmableWidth const):
1858         (WebCore::Layout::Line::appendTextContent):
1859
1860 2019-06-16  Zalan Bujtas  <zalan@apple.com>
1861
1862         [LFC][IFC] Use the borderBox rect consistently to size the inline box.
1863         https://bugs.webkit.org/show_bug.cgi?id=198899
1864
1865         Reviewed by Antti Koivisto.
1866         <rdar://problem/51781969>
1867
1868         Use the margin box height (when applicable) to adjust the line height and use the borderBox rect (or font size) height to size the inline box.
1869
1870         * layout/displaytree/DisplayBox.h:
1871         (WebCore::Display::Box::borderBoxHeight const):
1872         (WebCore::Display::Box::marginBoxHeight const):
1873         * layout/inlineformatting/InlineLine.cpp:
1874         (WebCore::Layout::Line::appendInlineContainerStart):
1875         (WebCore::Layout::Line::appendTextContent):
1876         (WebCore::Layout::Line::appendNonReplacedInlineBox):
1877         (WebCore::Layout::Line::inlineItemContentHeight const):
1878         (WebCore::Layout::Line::inlineItemHeight const): Deleted.
1879         * layout/inlineformatting/InlineLine.h:
1880
1881 2019-06-15  Simon Fraser  <simon.fraser@apple.com>
1882
1883         Make layerTreeAsText() output a bit less verbose
1884         https://bugs.webkit.org/show_bug.cgi?id=198870
1885
1886         Reviewed by Tim Horton.
1887
1888         "accelerates drawing" was getting dumped twice for debug dumps.
1889         Only dump the non-default state for "uses display-list drawing".
1890         Use the new OptionSet<> dumping for GraphicsLayerPaintingPhases.
1891
1892         * platform/graphics/GraphicsLayer.cpp:
1893         (WebCore::GraphicsLayer::dumpProperties const):
1894         (WebCore::operator<<):
1895         * platform/graphics/GraphicsLayer.h:
1896         * platform/graphics/ca/GraphicsLayerCA.cpp:
1897         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1898
1899 2019-06-15  Youenn Fablet  <youenn@apple.com>
1900
1901         Make MediaStream constructor take a Document instead of a ScriptExecutionContext
1902         https://bugs.webkit.org/show_bug.cgi?id=198873
1903
1904         Reviewed by Darin Adler.
1905
1906         Update MediaStream constructors and call site to take a Document&.
1907         Make the same for creation of CanvasCaptureMediaStreamTrack.
1908         No observable change of behavior.
1909
1910         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1911         (WebCore::CanvasCaptureMediaStreamTrack::create):
1912         (WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
1913         (WebCore::loggerFromContext): Deleted.
1914         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
1915         * Modules/mediastream/MediaStream.cpp:
1916         (WebCore::MediaStream::create):
1917         (WebCore::MediaStream::MediaStream):
1918         (WebCore::MediaStream::clone):
1919         (WebCore::loggerFromContext): Deleted.
1920         * Modules/mediastream/MediaStream.h:
1921         * Modules/mediastream/MediaStream.idl:
1922         * Modules/mediastream/UserMediaRequest.cpp:
1923         (WebCore::UserMediaRequest::allow):
1924         * html/HTMLCanvasElement.cpp:
1925         (WebCore::HTMLCanvasElement::captureStream):
1926         * html/HTMLCanvasElement.h:
1927         * html/HTMLCanvasElement.idl:
1928
1929 2019-06-15  Zalan Bujtas  <zalan@apple.com>
1930
1931         [LFC][BFC] Fix available width for non-floating positioned float avoiders.
1932         https://bugs.webkit.org/show_bug.cgi?id=198886
1933         <rdar://problem/51773643>
1934
1935         Reviewed by Antti Koivisto.
1936
1937         Normally the available width for an in-flow block level box is the width of the containing block's content box.
1938         However a non-floating positioned float avoider box might be constrained by existing floats.
1939         The idea here is that we pre-compute(estimate) the vertical position and check the current floating context for
1940         left and right floats. These floats contrain the available width and this computed value should be used instead of the containing block's
1941         content box's width whe calculating the used width for width: auto.
1942
1943         * layout/FormattingContext.cpp:
1944         (WebCore::Layout::mapHorizontalPositionToAncestor):
1945         (WebCore::Layout::FormattingContext::mapLeftToAncestor):
1946         (WebCore::Layout::FormattingContext::mapRightToAncestor):
1947         (WebCore::Layout::FormattingContext::mapPointToAncestor):
1948         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): Deleted.
1949         * layout/FormattingContext.h:
1950         * layout/blockformatting/BlockFormattingContext.cpp:
1951         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
1952         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1953         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition const):
1954         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition const):
1955         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1956         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
1957         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1958         * layout/blockformatting/BlockFormattingContext.h:
1959         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
1960         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1961         (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition):
1962         (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition):
1963         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1964         * layout/floats/FloatingState.cpp:
1965         (WebCore::Layout::FloatingState::constraints const):
1966         * layout/layouttree/LayoutBlockContainer.cpp:
1967         (WebCore::Layout::BlockContainer::establishesInlineFormattingContextOnly const):
1968         * layout/layouttree/LayoutBlockContainer.h:
1969         * layout/layouttree/LayoutBox.cpp:
1970         (WebCore::Layout::Box::isFloatAvoider const):
1971         * layout/layouttree/LayoutBox.h:
1972         (WebCore::Layout::Box::establishesInlineFormattingContextOnly const):
1973
1974 2019-06-15  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1975
1976         [GTK] Stop accessing GdkEvent fields when possible
1977         https://bugs.webkit.org/show_bug.cgi?id=198829
1978
1979         Reviewed by Michael Catanzaro.
1980
1981         Direct access to GdkEvent structs is no longer possible in GTK 4.
1982
1983         No behaviour changes.
1984
1985         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1986         (WebCore::eventTypeForGdkKeyEvent):
1987         (WebCore::modifiersForGdkKeyEvent):
1988         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1989         * platform/gtk/PlatformMouseEventGtk.cpp:
1990         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1991         * platform/gtk/PlatformWheelEventGtk.cpp:
1992         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1993
1994 2019-06-15  Rob Buis  <rbuis@igalia.com>
1995
1996         Add tests for prefetch redirects
1997         https://bugs.webkit.org/show_bug.cgi?id=197371
1998
1999         Reviewed by Youenn Fablet.
2000
2001         Test: http/wpt/prefetch/link-prefetch-main-resource-redirect.html
2002
2003         Allow clearing of the Purpose request header field.
2004
2005         * platform/network/ResourceRequestBase.cpp:
2006         (WebCore::ResourceRequestBase::clearPurpose):
2007         * platform/network/ResourceRequestBase.h:
2008
2009 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2010
2011         [LFC][MarginCollapsing] Remove redundant checks in MarginCollapse::marginBefore/AfterCollapsesWith*
2012         https://bugs.webkit.org/show_bug.cgi?id=198882
2013         <rdar://problem/51773334>
2014
2015         Reviewed by Antti Koivisto.
2016
2017         In-flow child can neither be floating nor out-of-flow positioned.
2018
2019         * layout/blockformatting/BlockMarginCollapse.cpp:
2020         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
2021         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
2022
2023 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2024
2025         [LFC][MarginCollapsing] Collapsed through margin values preserve quirk state.
2026         https://bugs.webkit.org/show_bug.cgi?id=198885
2027         <rdar://problem/51773568>
2028
2029         Reviewed by Antti Koivisto.
2030
2031         The collapsed through margin becomes a quirk margin if either of the vertical(before/after) margins have quirk value.
2032
2033         * layout/blockformatting/BlockMarginCollapse.cpp:
2034         (WebCore::Layout::computedPositiveAndNegativeMargin):
2035
2036 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2037
2038         [LFC[MarginCollapsing] Anonymous boxes never collapse their margins with siblings.
2039         https://bugs.webkit.org/show_bug.cgi?id=198884
2040         <rdar://problem/51773509>
2041
2042         Reviewed by Antti Koivisto.
2043
2044         * layout/blockformatting/BlockMarginCollapse.cpp:
2045         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
2046
2047 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2048
2049         [LFC][MarginCollapsing] Add check for computed height value in MarginCollapse::marginsCollapseThrough
2050         https://bugs.webkit.org/show_bug.cgi?id=198883
2051         <rdar://problem/51773395>
2052
2053         Reviewed by Antti Koivisto.
2054
2055         "A box's own margins collapse if... ...and it has a 'height' of either 0 or 'auto"
2056         https://www.w3.org/TR/CSS22/box.html#collapsing-margins
2057
2058         * layout/blockformatting/BlockMarginCollapse.cpp:
2059         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
2060
2061 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2062
2063         [LFC] Fix available width for shrink-to-fit (for out-of-flow non-replaced box)
2064         https://bugs.webkit.org/show_bug.cgi?id=198880
2065         <rdar://problem/51773118>
2066
2067         Reviewed by Antti Koivisto.
2068
2069         This patch fixes the cases when the available width for the out-of-flow positioned box is not the same as the containing block's (padding)width.  
2070
2071         * layout/FormattingContextGeometry.cpp:
2072         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2073
2074 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2075
2076         [LFC] Fix over-constrained logic for out-of-flow non-replaced horizontal geometry.
2077         https://bugs.webkit.org/show_bug.cgi?id=198879
2078         <rdar://problem/51772995>
2079
2080         Reviewed by Antti Koivisto.
2081
2082         The over-constrained logic applies to the case when all the horizontal properties are set.
2083
2084         * layout/FormattingContextGeometry.cpp:
2085         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2086
2087 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2088
2089         [LFC] Convert both the absolutely and statically positioned out-of-flow block level boxes positions relative to the containing block's padding box
2090         https://bugs.webkit.org/show_bug.cgi?id=198878
2091         <rdar://problem/51772882>
2092
2093         Reviewed by Antti Koivisto.
2094
2095         This patch ensures that while we compute the vertical/horizontal geometry for an out-of-flow block level box,
2096         the static and the absolute positioned values are in the same coordinate system (relative to the containing block's padding box).
2097
2098         * layout/FormattingContextGeometry.cpp:
2099         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
2100         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
2101         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2102         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2103         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2104         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2105
2106 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2107
2108         [LFC][IFC] Add support for vertical-align: top and bottom
2109         https://bugs.webkit.org/show_bug.cgi?id=198697
2110         <rdar://problem/51556188>
2111
2112         Reviewed by Antti Koivisto.
2113
2114         Use the layout box's vertical alignment to adjust line baseline and height and set the run's logical top when the line is being closed.
2115
2116         * layout/inlineformatting/InlineLine.cpp:
2117         (WebCore::Layout::Line::isVisuallyEmpty const):
2118         (WebCore::Layout::Line::close):
2119         (WebCore::Layout::Line::appendInlineContainerStart):
2120         (WebCore::Layout::Line::appendTextContent):
2121         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2122         (WebCore::Layout::Line::appendHardLineBreak):
2123         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2124         (WebCore::Layout::Line::inlineItemHeight const):
2125         (WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
2126         * layout/inlineformatting/InlineLine.h:
2127         (WebCore::Layout::Line::Content::isVisuallyEmpty const):
2128         (WebCore::Layout::Line::Content::setIsVisuallyEmpty):
2129         (WebCore::Layout::Line::hasContent const):
2130
2131 2019-06-14  Antoine Quint  <graouts@apple.com>
2132
2133         [Pointer Events] button property is -1 for pointerdown and pointerup
2134         https://bugs.webkit.org/show_bug.cgi?id=198868
2135         <rdar://problem/51758109>
2136
2137         Reviewed by Dean Jackson.
2138
2139         A value of -1 for "button", which means there was no change of pressed button since the last event, should only ever be used for "pointermove" events.
2140
2141         Test: pointerevents/mouse/pointer-button-and-buttons.html
2142
2143         * page/PointerCaptureController.cpp:
2144         (WebCore::PointerCaptureController::pointerEventForMouseEvent):
2145
2146 2019-06-14  Megan Gardner  <megan_gardner@apple.com>
2147
2148         Move Synthetic Editing Commands to behind an experimental feature flag
2149         https://bugs.webkit.org/show_bug.cgi?id=198842
2150         <rdar://problem/50594700>
2151
2152         Reviewed by Simon Fraser.
2153
2154         Moving from a quirk to a feature flag.
2155
2156         * page/Quirks.cpp:
2157         (WebCore::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost): Deleted.
2158         (WebCore::Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas const): Deleted.
2159         * page/Quirks.h:
2160         * page/RuntimeEnabledFeatures.h:
2161         (WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled):
2162         (WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const):
2163
2164 2019-06-14  Jer Noble  <jer.noble@apple.com>
2165
2166         REGRESSION(244439): platform/mac/media/encrypted-media/fps-* tests are crashing
2167         https://bugs.webkit.org/show_bug.cgi?id=198612
2168         <rdar://problem/51078978>
2169
2170         Reviewed by Eric Carlson.
2171
2172         There are two implementations of a 'cenc' initialiation data factory; an ASSERT fires when
2173         the second one is added to the registry. Unify them.
2174
2175         * Modules/encryptedmedia/InitDataRegistry.cpp:
2176         (WebCore::extractKeyIDsCenc):
2177         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
2178         (WebCore::CDMPrivateFairPlayStreaming::validFairPlayStreamingSchemes):
2179         (WebCore::CDMPrivateFairPlayStreaming::fairPlaySystemID):
2180         (WebCore::validInitDataTypes):
2181         (WebCore::CDMFactory::platformRegisterFactories):
2182         (WebCore::validFairPlayStreamingSchemes): Deleted.
2183         (WebCore::CDMPrivateFairPlayStreaming::cencName): Deleted.
2184         (WebCore::fairPlaySystemID): Deleted.
2185         (WebCore::extractSchemeAndKeyIdFromCenc): Deleted.
2186         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsCenc): Deleted.
2187         (WebCore::CDMPrivateFairPlayStreaming::sanitizeCenc): Deleted.
2188         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
2189
2190 2019-06-14  Saam Barati  <sbarati@apple.com>
2191
2192         Unreviewed. Follow up to r246438. This removes a debug assert until
2193         we do further compiler work in: https://bugs.webkit.org/show_bug.cgi?id=198861
2194
2195         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
2196         (WebCore::WHLSL::checkDuplicateFunctions):
2197         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
2198
2199 2019-06-14  Saam Barati  <sbarati@apple.com>
2200
2201         [WHLSL] Implement out-of-bounds and nullptr behavior
2202         https://bugs.webkit.org/show_bug.cgi?id=198600
2203         <rdar://problem/51668853>
2204
2205         Reviewed by Robin Morisset.
2206
2207         The behavior we're implementing is:
2208         - OOB writes are ignored.
2209         - OOB reads return zero.
2210         - Writes to null are ignored.
2211         - Reads from null return zero.
2212         - &*x == x, including &*null == null.
2213         
2214         We implement this like so:
2215         - The value stack in FunctionWriter turns into a stack of pairs: rvalues and lvalues.
2216           rvalues are represented the same as before. Lvalues are always pointers.
2217         - Anything that produces an lvalue must push a pointer to the stack. Not
2218           all things produce lvalues, so that entry in the stack may be empty.
2219           However, all things that produce lvalues also produce rvalues. So, "*x = 42" works,
2220           and so does "foo(*x)". Nodes that produce lvalues are responsible for also producing
2221           an rvalue, which should be the value as if the lvalue was dereferenced at that point
2222           in program execution. So the "*x" in "thread int* x = null; *x" produces the int zero
2223           for its rvalue, and null for its lvalue.
2224         - Dereference just works, as dereference produces both an lvalue and rvalue. Dereference
2225           node's child must also be an lvalue. So we just forward that value along on
2226           the stack. For the rvalue, if we try to dereference nullptr, we just fill in
2227           zero bytes instead. Otherwise, the rvalue is the result of dereferencing the
2228           non-null pointer.
2229         - Assignment expressions check if the incoming lvalue is null. If it is, it
2230           skips the assignment.
2231         - operator&[] returns nullptr on an OOB access. Then, based on the above
2232           behavior, we get the desired OOB reads return zero, and OOB writes are
2233           ignored.
2234         - MakePointerExpression just takes the last lvalue off the stack (which must
2235           be a pointer) and returns it as an rvalue.
2236         - VariableReference will push both the variable value and a pointer to the variable
2237           onto the stack.
2238
2239         This patch also fixes a few bugs where we weren't giving certain AST nodes the
2240         proper address space values.
2241
2242         This patch also removes code to generate native functions for operators
2243         "operator[]" and "operator[]=" as we should never be generating these
2244         ourselves. We should only be generating the "operator&[]" ander.
2245
2246         Tests: webgpu/whlsl-null-dereference.html
2247                webgpu/whlsl-oob-access.html
2248
2249         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2250         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
2251         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValue):
2252         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue):
2253         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValue):
2254         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue):
2255         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2256         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
2257         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
2258         (WebCore::WHLSL::Metal::writeNativeFunction):
2259         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
2260         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
2261         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
2262         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
2263         (WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
2264         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2265         (WebCore::WHLSL::PropertyResolver::visit):
2266         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
2267         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
2268         (WebCore::trySetFunctions):
2269         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2270         (WebCore::trySetFunctions):
2271
2272 2019-06-14  Jer Noble  <jer.noble@apple.com>
2273
2274         CRASH(nullptr) in WebCore::jsAudioContextCurrentTime()
2275         https://bugs.webkit.org/show_bug.cgi?id=198859
2276         <rdar://problem/27986991>
2277
2278         Reviewed by Eric Carlson.
2279
2280         AudioContext's m_destinationNode can become null during iframe teardown,
2281         but can AudioContext methods can still be called by JavaScript. Add null-checks
2282         to all (remaing) unprotected dereferences of m_destinationNode.
2283
2284         * Modules/webaudio/AudioContext.cpp:
2285         (WebCore::AudioContext::uninitialize):
2286         (WebCore::AudioContext::createBufferSource):
2287         (WebCore::AudioContext::createScriptProcessor):
2288         (WebCore::AudioContext::createBiquadFilter):
2289         (WebCore::AudioContext::createPanner):
2290         (WebCore::AudioContext::createConvolver):
2291         (WebCore::AudioContext::createDynamicsCompressor):
2292         (WebCore::AudioContext::createAnalyser):
2293         (WebCore::AudioContext::createGain):
2294         (WebCore::AudioContext::createDelay):
2295         (WebCore::AudioContext::createChannelSplitter):
2296         (WebCore::AudioContext::createChannelMerger):
2297         (WebCore::AudioContext::createOscillator):
2298         * Modules/webaudio/AudioContext.h:
2299         (WebCore::AudioContext::currentSampleFrame const):
2300         (WebCore::AudioContext::currentTime const):
2301         (WebCore::AudioContext::sampleRate const):
2302
2303 2019-06-14  Youenn Fablet  <youenn@apple.com>
2304
2305         Cloning a MediaStreamTrack does not clone the logger
2306         https://bugs.webkit.org/show_bug.cgi?id=198844
2307
2308         Reviewed by Eric Carlson.
2309
2310         Make MediaStream and MediaStreamTrack rely on their private versions for logging.
2311         Move from a RefPtr version to a Ref so as to forbid nullptr crashes.
2312         Make sure that RealtimeIncomingAudioSource and RealtimeIncomingVideoSource check for their logger before logging.
2313         Covered by existing tests and updated test.
2314
2315         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2316         (WebCore::loggerFromContext):
2317         (WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
2318         * Modules/mediastream/MediaStream.cpp:
2319         (WebCore::loggerFromContext):
2320         (WebCore::MediaStream::create):
2321         (WebCore::MediaStream::MediaStream):
2322         * Modules/mediastream/MediaStream.h:
2323         * Modules/mediastream/MediaStreamTrack.cpp:
2324         (WebCore::MediaStreamTrack::MediaStreamTrack):
2325         * Modules/mediastream/MediaStreamTrack.h:
2326         * Modules/mediastream/UserMediaRequest.cpp:
2327         (WebCore::UserMediaRequest::allow):
2328         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2329         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
2330         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2331         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource):
2332         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
2333         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
2334         * platform/mediastream/MediaStreamPrivate.cpp:
2335         (WebCore::MediaStreamPrivate::create):
2336         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
2337         (WebCore::MediaStreamPrivate::setLogger): Deleted.
2338         * platform/mediastream/MediaStreamPrivate.h:
2339         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2340         (WebCore::MediaStreamTrackPrivate::create):
2341         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
2342         (WebCore::MediaStreamTrackPrivate::clone):
2343         (WebCore::MediaStreamTrackPrivate::setLogger): Deleted.
2344         * platform/mediastream/MediaStreamTrackPrivate.h:
2345         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2346         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
2347         * platform/mediastream/RealtimeMediaSourceCenter.h:
2348         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
2349         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
2350         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2351         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
2352         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
2353         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2354
2355 2019-06-14  Ali Juma  <ajuma@chromium.org>
2356
2357         IntersectionObserver rootMargin detection fails when `root` is an element
2358         https://bugs.webkit.org/show_bug.cgi?id=198784
2359
2360         Reviewed by Simon Fraser.
2361
2362         When computing a target's bounds in root space, we were applying the root's
2363         clip rect (if any), and then intersecting with the root rect expanded by the
2364         root margin. This meant that if a target did not intersect the non-expanded root
2365         rect, we would get an empty intersection even if the target did intersect the
2366         expanded root rect. Fix this by not applying the root's clip rect when computing
2367         a target's bounds in root space. Add a new VisibleRectContextOption::ApplyContainerClip
2368         that determines whether RenderObject::computeVisibleRectInContainer should apply
2369         the container's clip.
2370
2371         Test: imported/w3c/web-platform-tests/intersection-observer/root-margin-root-element.html
2372
2373         * rendering/RenderBox.cpp:
2374         (WebCore::RenderBox::applyCachedClipAndScrollPosition const):
2375         * rendering/RenderObject.cpp:
2376         (WebCore::RenderObject::visibleRectContextForRepaint):
2377         * rendering/RenderObject.h:
2378
2379 2019-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2380
2381         [cairo] Entering text into forms on github.com creates a trapezoid artifact
2382         https://bugs.webkit.org/show_bug.cgi?id=126124
2383
2384         Reviewed by Michael Catanzaro.
2385
2386         Mixing antialiasing modes in the same clip is not actually supported by cairo. In the case of rectangle clips we
2387         are already ignoring the current antialiasing to not do any antialiasing. We could do the opposite for clips
2388         receiving a path, we want to enforce antialiasing in that case since the paths might contain curves. Doing that
2389         we ensure all calls to clip with a path use the same antialiasing, which is the case of the github bug.
2390
2391         * platform/graphics/cairo/CairoOperations.cpp:
2392         (WebCore::Cairo::doClipWithAntialias): Helper to call cairo_clip() with the given antialising mode.
2393         (WebCore::Cairo::clip): Use doClipWithAntialias().
2394         (WebCore::Cairo::clipOut): Ditto.
2395         (WebCore::Cairo::clipPath): Ditto.
2396
2397 2019-06-13  Myles C. Maxfield  <mmaxfield@apple.com>
2398
2399         [WHLSL] Remove unnecessary ASSERT()s and clean up visitor lambdas
2400         https://bugs.webkit.org/show_bug.cgi?id=198706
2401
2402         Reviewed by Dean Jackson, Saam Barati, and Robin Morisset.
2403
2404         Some minor refactoring.
2405
2406         If the code is going to unconditionally downcast<Foo>(bar), there's no need
2407         to guard that with an ASSERT(is<Foo>(bar)) because the downcast() call will
2408         do that automatically.
2409
2410         No new tests because there is no behavior change.
2411
2412         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
2413         (WebCore::WHLSL::AST::ConstantExpression::visit):
2414         (WebCore::WHLSL::AST::ConstantExpression::visit const):
2415         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2416         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
2417         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
2418         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
2419         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2420         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2421         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
2422         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
2423         (WebCore::WHLSL::Metal::writeNativeFunction):
2424         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
2425         (WebCore::WHLSL::Metal::writeNativeType):
2426         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
2427         (WebCore::WHLSL::Metal::find):
2428         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
2429         (WebCore::WHLSL::Metal::TypeNamer::insert):
2430         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
2431         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
2432         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2433         (WebCore::WHLSL::Checker::visit):
2434         (WebCore::WHLSL::argumentTypeForAndOverload):
2435         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
2436         (WebCore::WHLSL::inferTypesForTypeArguments):
2437         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
2438         (WebCore::WHLSL::Intrinsics::addFullTexture):
2439         (WebCore::WHLSL::Intrinsics::addDepthTexture):
2440         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2441         (WebCore::WHLSL::modify):
2442         (WebCore::WHLSL::PropertyResolver::visit):
2443         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2444         (WebCore::WHLSL::Visitor::visit):
2445
2446 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
2447
2448         [WHLSL] Hook up compute
2449         https://bugs.webkit.org/show_bug.cgi?id=198644
2450
2451         Reviewed by Saam Barati.
2452
2453         This patch hooks up compute shaders in exactly the same way that vertex and fragment shaders
2454         are hooked up. I've modified the two patchs (compute and rendering) to be almost exactly the
2455         same code.
2456
2457         This patch also adds support for the WHLSL compiler to determine what the numthreads()
2458         attribute in the shader says so that it can be hooked up to Metal's threads-per-threadgroup
2459         argument in the dispatch call. There is some logic to make sure that there aren't two
2460         numthreads() attributes on the same compute shader.
2461
2462         It also adds a little bit of type renaming. For built-in variables, sometimes Metal's type
2463         doesn't always match WHLSL's (and HLSL's type). For example, in WHLSL and HLSL,        SV_DispatchThreadID variables have to be a float3, but in Metal, they are a uint3.
2464         Therefore, I've added a little bit of code during each entry point's pack and unpack stages
2465         to handle this type conversion.
2466
2467         Test: webgpu/whlsl-compute.html
2468
2469         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2470         (WebCore::WHLSL::Metal::internalTypeForSemantic): Determine which Metal type corresponds to
2471         each built-in variable.
2472         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature): Perform the type
2473         conversion.
2474         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Ditto.
2475         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding): Ditto.
2476         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes): Ditto.
2477         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Ditto.
2478         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding): Ditto.
2479         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes): Ditto.
2480         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
2481         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature): Ditto.
2482         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
2483         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp: Added. Add a pass to determine whether
2484         or not any entry point has duplicate numthreads() attribute, and to determine what the
2485         appropriate numthreads() values should be for the current entry point.
2486         (WebCore::WHLSL::ComputeDimensionsVisitor::ComputeDimensionsVisitor):
2487         (WebCore::WHLSL::ComputeDimensionsVisitor::computeDimensions const):
2488         (WebCore::WHLSL::computeDimensions):
2489         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
2490         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
2491         (WebCore::WHLSL::gatherEntryPointItems): Compute shaders don't need to have a semantic for their return type.
2492         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2493         (WebCore::WHLSL::prepare): Run the computeDimensions() pass.
2494         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
2495         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: In a left-value propertyAccessExpression,
2496         the index expression can be a right-value. Treat it as such.
2497         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
2498         (WebCore::WHLSL::LeftValueSimplifier::visit):
2499         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: We need support for multiplication (for a
2500         test) and float3 for SV_DispatchThreadID.
2501         * Sources.txt:
2502         * SourcesCocoa.txt:
2503         * WebCore.xcodeproj/project.pbxproj:
2504         * platform/graphics/gpu/GPUComputePipeline.h: Associate a compute dimensions with a particular
2505         compute pipeline. This is how Metal knows what values to use for a dispatch.
2506         (WebCore::GPUComputePipeline::computeDimensions const):
2507         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Use the saved compute dimensions.
2508         (WebCore::GPUComputePassEncoder::dispatch):
2509         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Make the code match GPURenderPipelineMetal.
2510         (WebCore::trySetMetalFunctions):
2511         (WebCore::trySetFunctions):
2512         (WebCore::convertComputePipelineDescriptor):
2513         (WebCore::tryCreateMTLComputePipelineState):
2514         (WebCore::GPUComputePipeline::tryCreate):
2515         (WebCore::GPUComputePipeline::GPUComputePipeline):
2516         (WebCore::tryCreateMtlComputeFunction): Deleted.
2517         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.cpp: Added. Moved shared helper
2518         functions to a file where they can be accessed by multiple places.
2519         (WebCore::convertShaderStageFlags):
2520         (WebCore::convertBindingType):
2521         (WebCore::convertLayout):
2522         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
2523         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Delete the functions that were moved to GPUPipelineMetalConvertLayout.
2524         (WebCore::trySetFunctions):
2525         (WebCore::tryCreateMtlRenderPipelineState):
2526         (WebCore::convertShaderStageFlags): Deleted.
2527         (WebCore::convertBindingType): Deleted.
2528         (WebCore::convertLayout): Deleted.
2529
2530 2019-06-13  Jer Noble  <jer.noble@apple.com>
2531
2532         AVKit play button bypasses MediaElementSession playbackPermitted() checks.
2533         https://bugs.webkit.org/show_bug.cgi?id=198813
2534
2535         Reviewed by Eric Carlson.
2536
2537         HTMLMediaElement::togglePlayState() is an internal-only method that doesn't
2538         run playbackPermitted() checks. For our imitation AVPlayerController, translate
2539         requests to -togglePlayback: into calls to play() and pause() depending on
2540         playback state.
2541
2542         * platform/ios/WebAVPlayerController.mm:
2543         (-[WebAVPlayerController togglePlayback:]):
2544
2545 2019-06-13  Commit Queue  <commit-queue@webkit.org>
2546
2547         Unreviewed, rolling out r246396 and r246397.
2548         https://bugs.webkit.org/show_bug.cgi?id=198837
2549
2550         Breaks internal builds (Requested by ShawnRoberts on #webkit).
2551
2552         Reverted changesets:
2553
2554         "[WHLSL] Hook up compute"
2555         https://bugs.webkit.org/show_bug.cgi?id=198644
2556         https://trac.webkit.org/changeset/246396
2557
2558         "[WHLSL] Hook up compute"
2559         https://bugs.webkit.org/show_bug.cgi?id=198644
2560         https://trac.webkit.org/changeset/246397
2561
2562 2019-06-13  Antti Koivisto  <antti@apple.com>
2563
2564         twitch.tv: embedded video hovers down the screen when scrolling on iPad
2565         https://bugs.webkit.org/show_bug.cgi?id=198832
2566         <rdar://problem/51541439>
2567
2568         Reviewed by Simon Fraser.
2569
2570         Test: compositing/scrolling/async-overflow-scrolling/overflow-scroll-paint-order-sibling.html
2571
2572         * rendering/RenderLayer.cpp:
2573         (WebCore::RenderLayer::scrollTo):
2574
2575         Overflow scroll layer may have composited descendants that are its paint order siblings. We need to invalidate
2576         the tree of the paint order parent for compositing update (instead of just the tree of the overflow scroll layer).
2577
2578         This matches what RenderLayer::updateLayerPosition() does.
2579
2580 2019-06-13  Youenn Fablet  <youenn@apple.com>
2581
2582         SocketStreamHandle should not be destroyed in a background thread
2583         https://bugs.webkit.org/show_bug.cgi?id=198781
2584
2585         Reviewed by Geoffrey Garen.
2586
2587         Make sure to destroy SocketStreamHandle on the main thread since it owns an URL created on the main thread.
2588         Covered by WPT websocket tests from https://bugs.webkit.org/show_bug.cgi?id=198774.
2589
2590         * platform/network/SocketStreamHandle.cpp:
2591         (WebCore::SocketStreamHandle::SocketStreamHandle):
2592         * platform/network/SocketStreamHandle.h:
2593
2594 2019-06-13  Antoine Quint  <graouts@apple.com>
2595
2596         "display: contents" Content click does not trigger
2597         https://bugs.webkit.org/show_bug.cgi?id=198559
2598         <rdar://problem/51488524>
2599
2600         Reviewed by Antti Koivisto.
2601
2602         Test: fast/events/ios/click-event-and-display-contents.html
2603
2604         * dom/Element.h:
2605
2606 2019-06-13  Takashi Komori  <Takashi.Komori@sony.com>
2607
2608         [curl] Remove member objects of CurlRequest not to share by different threads.
2609         https://bugs.webkit.org/show_bug.cgi?id=198747
2610
2611         Reviewed by Fujii Hironori.
2612
2613         Removed m_certificateInfo and m_networkLoadMetrics.
2614         Before patch those objects were updated by different threads.
2615
2616         No tests needed, no functionality changes.
2617
2618         * platform/network/curl/CurlDownload.cpp:
2619         (WebCore::CurlDownload::curlDidReceiveResponse):
2620         (WebCore::CurlDownload::curlDidReceiveBuffer):
2621         (WebCore::CurlDownload::curlDidComplete):
2622         (WebCore::CurlDownload::curlDidFailWithError):
2623         * platform/network/curl/CurlDownload.h:
2624         * platform/network/curl/CurlRequest.cpp:
2625         (WebCore::CurlRequest::start):
2626         (WebCore::CurlRequest::didReceiveHeader):
2627         (WebCore::CurlRequest::didCompleteTransfer):
2628         (WebCore::CurlRequest::invokeDidReceiveResponse):
2629         (WebCore::CurlRequest::networkLoadMetrics):
2630         (WebCore::CurlRequest::updateNetworkLoadMetrics): Deleted.
2631         * platform/network/curl/CurlRequest.h:
2632         (WebCore::CurlRequest::setStartTime):
2633         (WebCore::CurlRequest::certificateInfo const): Deleted.
2634         (WebCore::CurlRequest::networkLoadMetrics const): Deleted.
2635         * platform/network/curl/CurlRequestClient.h:
2636         * platform/network/curl/CurlResourceHandleDelegate.cpp:
2637         (WebCore::CurlResourceHandleDelegate::curlDidSendData):
2638         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
2639         (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
2640         (WebCore::CurlResourceHandleDelegate::curlDidComplete):
2641         (WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
2642         * platform/network/curl/CurlResourceHandleDelegate.h:
2643         * platform/network/curl/CurlResponse.h:
2644         (WebCore::CurlResponse::isolatedCopy const):
2645         * platform/network/curl/ResourceResponseCurl.cpp:
2646         (WebCore::ResourceResponse::ResourceResponse):
2647
2648 2019-06-13  Zan Dobersek  <zdobersek@igalia.com>
2649
2650         [Nicosia] Add SceneIntegration
2651         https://bugs.webkit.org/show_bug.cgi?id=198791
2652
2653         Reviewed by Carlos Garcia Campos.
2654
2655         Add the SceneIntegration class to the Nicosia namespace, primarily for
2656         the purpose of being able to conveniently trigger scene updates whenever
2657         changes are done to the state of layers that are included in that scene.
2658         Initially this would be used for layer changes done on a
2659         scrolling-dedicated thread.
2660
2661         Each Nicosia::PlatformLayer can have a SceneIntegration object reference
2662         associated. Helper createUpdateScope() method returns a
2663         SceneIntegration::UpdateScope instance that triggers an update for the
2664         scene when that instance is destroyed (normally when it goes out of the
2665         scope).
2666
2667         * platform/TextureMapper.cmake:
2668         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
2669         (Nicosia::PlatformLayer::setSceneIntegration):
2670         (Nicosia::PlatformLayer::createUpdateScope):
2671         * platform/graphics/nicosia/NicosiaSceneIntegration.cpp: Added.
2672         (Nicosia::SceneIntegration::SceneIntegration):
2673         (Nicosia::SceneIntegration::~SceneIntegration):
2674         (Nicosia::SceneIntegration::setClient):
2675         (Nicosia::SceneIntegration::invalidate):
2676         (Nicosia::SceneIntegration::requestUpdate):
2677         (Nicosia::SceneIntegration::createUpdateScope):
2678         (Nicosia::SceneIntegration::UpdateScope::UpdateScope):
2679         (Nicosia::SceneIntegration::UpdateScope::~UpdateScope):
2680         * platform/graphics/nicosia/NicosiaSceneIntegration.h: Added.
2681
2682 2019-06-13  Philippe Normand  <pnormand@igalia.com>
2683
2684         [GStreamer] HLS stream slow start
2685         https://bugs.webkit.org/show_bug.cgi?id=198377
2686
2687         Reviewed by Xabier Rodriguez-Calvar.
2688
2689         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2690         (webKitWebSrcCreate): Cut down the adapter condition to 200 ms to
2691         improve start-up times for HLS playback.
2692
2693 2019-06-13  Ludovico de Nittis  <ludovico.denittis@collabora.com>
2694
2695         [GTK] gdk_display_get_device_manager and gdk_screen_get_width/height are deprecated
2696         https://bugs.webkit.org/show_bug.cgi?id=198822
2697
2698         Reviewed by Carlos Garcia Campos.
2699
2700         GdkSeat and GdkRectangle should be used, respectively.
2701
2702         No behaviour changes.
2703
2704         * platform/gtk/GtkVersioning.c:
2705         (getDefaultGDKPointerDevice):
2706         (getScreenWorkArea):
2707
2708 2019-06-12  Antoine Quint  <graouts@apple.com>
2709
2710         [WHLSL] Hook up compute
2711         https://bugs.webkit.org/show_bug.cgi?id=198644
2712
2713         Unreviewed build fix. Release iOS build would complain that pipelineState was unused.
2714
2715         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
2716         (WebCore::GPUComputePassEncoder::dispatch):
2717
2718 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
2719
2720         [WHLSL] Hook up compute
2721         https://bugs.webkit.org/show_bug.cgi?id=198644
2722
2723         Reviewed by Saam Barati.
2724
2725         This patch hooks up compute shaders in exactly the same way that vertex and fragment shaders
2726         are hooked up. I've modified the two patchs (compute and rendering) to be almost exactly the
2727         same code.
2728
2729         This patch also adds support for the WHLSL compiler to determine what the numthreads()
2730         attribute in the shader says so that it can be hooked up to Metal's threads-per-threadgroup
2731         argument in the dispatch call. There is some logic to make sure that there aren't two
2732         numthreads() attributes on the same compute shader.
2733
2734         It also adds a little bit of type renaming. For built-in variables, sometimes Metal's type
2735         doesn't always match WHLSL's (and HLSL's type). For example, in WHLSL and HLSL,        SV_DispatchThreadID variables have to be a float3, but in Metal, they are a uint3.
2736         Therefore, I've added a little bit of code during each entry point's pack and unpack stages
2737         to handle this type conversion.
2738
2739         Test: webgpu/whlsl-compute.html
2740
2741         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2742         (WebCore::WHLSL::Metal::internalTypeForSemantic): Determine which Metal type corresponds to
2743         each built-in variable.
2744         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature): Perform the type
2745         conversion.
2746         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Ditto.
2747         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding): Ditto.
2748         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes): Ditto.
2749         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Ditto.
2750         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding): Ditto.
2751         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes): Ditto.
2752         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
2753         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature): Ditto.
2754         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
2755         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp: Added. Add a pass to determine whether
2756         or not any entry point has duplicate numthreads() attribute, and to determine what the
2757         appropriate numthreads() values should be for the current entry point.
2758         (WebCore::WHLSL::ComputeDimensionsVisitor::ComputeDimensionsVisitor):
2759         (WebCore::WHLSL::ComputeDimensionsVisitor::computeDimensions const):
2760         (WebCore::WHLSL::computeDimensions):
2761         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
2762         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
2763         (WebCore::WHLSL::gatherEntryPointItems): Compute shaders don't need to have a semantic for their return type.
2764         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2765         (WebCore::WHLSL::prepare): Run the computeDimensions() pass.
2766         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
2767         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: In a left-value propertyAccessExpression,
2768         the index expression can be a right-value. Treat it as such.
2769         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
2770         (WebCore::WHLSL::LeftValueSimplifier::visit):
2771         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: We need support for multiplication (for a
2772         test) and float3 for SV_DispatchThreadID.
2773         * Sources.txt:
2774         * SourcesCocoa.txt:
2775         * WebCore.xcodeproj/project.pbxproj:
2776         * platform/graphics/gpu/GPUComputePipeline.h: Associate a compute dimensions with a particular
2777         compute pipeline. This is how Metal knows what values to use for a dispatch.
2778         (WebCore::GPUComputePipeline::computeDimensions const):
2779         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Use the saved compute dimensions.
2780         (WebCore::GPUComputePassEncoder::dispatch):
2781         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Make the code match GPURenderPipelineMetal.
2782         (WebCore::trySetMetalFunctions):
2783         (WebCore::trySetFunctions):
2784         (WebCore::convertComputePipelineDescriptor):
2785         (WebCore::tryCreateMTLComputePipelineState):
2786         (WebCore::GPUComputePipeline::tryCreate):
2787         (WebCore::GPUComputePipeline::GPUComputePipeline):
2788         (WebCore::tryCreateMtlComputeFunction): Deleted.
2789         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.cpp: Added. Moved shared helper
2790         functions to a file where they can be accessed by multiple places.
2791         (WebCore::convertShaderStageFlags):
2792         (WebCore::convertBindingType):
2793         (WebCore::convertLayout):
2794         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
2795         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Delete the functions that were moved to GPUPipelineMetalConvertLayout.
2796         (WebCore::trySetFunctions):
2797         (WebCore::tryCreateMtlRenderPipelineState):
2798         (WebCore::convertShaderStageFlags): Deleted.
2799         (WebCore::convertBindingType): Deleted.
2800         (WebCore::convertLayout): Deleted.
2801
2802 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
2803
2804         [WHLSL] Implement array references
2805         https://bugs.webkit.org/show_bug.cgi?id=198163
2806
2807         Reviewed by Saam Barati.
2808
2809         The compiler automatically generates anders for every array reference. Luckily, the infrastructure
2810         to generate those anders and emit Metal code to represent them already exists in the compiler.
2811         There are two pieces remaining (which this patch implements):
2812
2813         1. The JavaScript compiler has a behavior where anders that are called with an array reference
2814            as an argument don't wrap the argument in a MakePointerExpression. This is because the array
2815            reference is already a reference type, so it's silly to operate on a pointer to a reference.
2816            This patch implements this by teaching the type checker about which types should be passed
2817            to the ander call, and by actually constructing those types in the property resolver.
2818            The property resolver does this by placing the logic to construct an ander argument in a
2819            single function which also has logic to save the argument in a temporary if the thread ander
2820            will be called. The semantics about which functions are called in which situations are not
2821            changed; instead, we just simply don't wrap array references with MakePointerExpressions.
2822
2823         2. Creating a bind group from the WebGPU API has to retain information about buffer lengths for
2824            each buffer so the shader can properly perform bounds checks. This can be broken down into a
2825            few pieces:
2826            - Creating a bind group layout has to assign extra id indexes for each buffer which will be
2827              filled in to represent the buffer's length
2828            - Creating the bind group itself needs to fill in the buffer length into the Metal argument
2829              buffer
2830            - The shader compiler needs to emit code at the beginning of entry point to find the buffer
2831              lengths and pack them together into the array reference (array references correspond to
2832              a Metal struct with two fields: a pointer and a length).
2833
2834         This patch doesn't actually implement bounds checks themselves; it just hooks up the buffer
2835         lengths so https://bugs.webkit.org/show_bug.cgi?id=198600 can implement it.
2836
2837         The shader compiler's API is modified to allow for this extra buffer length information to be
2838         passed in from the WebGPU implementation.
2839
2840         Unfortunately, I don't think I could split this patch up into two pieces because both are
2841         required to test the compiler with buffers.
2842
2843         Tests: webgpu/whlsl-buffer-fragment.html
2844                webgpu/whlsl-buffer-vertex.html
2845
2846         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
2847         (WebCore::WHLSL::AST::PropertyAccessExpression::baseReference):
2848         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
2849         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const): Arrays can't be resources
2850         because the compiler has no way of guaranteeing if the resource is long enough to hold the
2851         array at compile time.
2852         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2853         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding): Generate an extra
2854         variable name to represent the buffer length. Only do it for resources which have lengths.
2855         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
2856         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Perform
2857         the appropriate math to turn byte lengths into element counts and store the element count
2858         in the array reference.
2859         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
2860         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2861         (WebCore::WHLSL::resolveWithOperatorAnderIndexer): Refactor.
2862         (WebCore::WHLSL::resolveWithOperatorLength): Ditto.
2863         (WebCore::WHLSL::resolveWithReferenceComparator): Ditto.
2864         (WebCore::WHLSL::resolveByInstantiation): Ditto.
2865         (WebCore::WHLSL::argumentTypeForAndOverload): Given an ander, what should the type of the
2866         argument be?
2867         (WebCore::WHLSL::Checker::finishVisiting): Call argumentTypeForAndOverload(). Also, if
2868         we couldn't find an ander, try automatically generating it, the same way that function
2869         calls do. (This is how array references get their anders.)
2870         (WebCore::WHLSL::Checker::visit):
2871         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: New WHLSL API to provide the length
2872         information.
2873         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2874         (WebCore::WHLSL::PropertyResolver::visit): SimplifyRightValue() can't fail any more.
2875         (WebCore::WHLSL::wrapAnderCallArgument): If the ander argument should be wrapped in a
2876         MakePointer or a MakeArrayReference, do that. Also, if the ander is a thread ander, save
2877         the argument in a local variable and use that.
2878         (WebCore::WHLSL::anderCallArgument): The equivalent of argumentTypeForAndOverload().
2879         (WebCore::WHLSL::setterCall): Call anderCallArgument().
2880         (WebCore::WHLSL::getterCall): Ditto.
2881         (WebCore::WHLSL::modify): We used to have special-case code for handling pointer-to-argument
2882         values as distinct from just the argument values themselves. However, emitting
2883         chains of &* operators is valid and won't even make it through the Metal code generator
2884         after https://bugs.webkit.org/show_bug.cgi?id=198600 is fixed. So, in order to simplify
2885         wrapAnderCallArgument(), don't special case these values and just create &* chains instead.
2886         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
2887         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting): Call anderCallArgument().
2888         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: Update to support the new compiler API.
2889         (WebCore::WHLSL::matchMode):
2890         (WebCore::WHLSL::matchResources):
2891         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Ditto.
2892         (WebCore::WebGPUBindGroupDescriptor::tryCreateGPUBindGroupDescriptor const):
2893         * platform/graphics/gpu/GPUBindGroupLayout.h: Add some internal implementation data inside
2894         the bindings object. Use a Variant to differentiate between the various bindings types, and
2895         put the extra length field on just those members of the variant that represent buffers.
2896         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Update to support the new compiler API.
2897         (WebCore::argumentDescriptor):
2898         (WebCore::GPUBindGroupLayout::tryCreate):
2899         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Ditto.
2900         (WebCore::setBufferOnEncoder):
2901         (WebCore::GPUBindGroup::tryCreate):
2902         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Ditto.
2903         (WebCore::convertBindingType):
2904         (WebCore::convertLayout):
2905
2906 2019-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2907
2908         [cairo][SVG] If clipPath has multiple elements, clip-path doesn't work with transform
2909         https://bugs.webkit.org/show_bug.cgi?id=198746
2910
2911         Reviewed by Don Olmstead.
2912
2913         We need to save the current transformation matrix at the moment the image mask is set and set it again on
2914         restore right before applying the mask. This patch also creates a pattern for the image mask surface and set its
2915         transformation matrix according to the mask position, so that we don't need to save the mask rectangle too.
2916
2917         Tests: svg/clip-path/clip-hidpi-expected.svg
2918                svg/clip-path/clip-hidpi.svg
2919                svg/clip-path/clip-opacity-translate-expected.svg
2920                svg/clip-path/clip-opacity-translate.svg
2921
2922         * platform/graphics/cairo/PlatformContextCairo.cpp:
2923         (WebCore::PlatformContextCairo::restore):
2924         (WebCore::PlatformContextCairo::pushImageMask):
2925
2926 2019-06-12  Simon Fraser  <simon.fraser@apple.com>
2927
2928         paddingBoxRect() is wrong with RTL scrollbars on the left
2929         https://bugs.webkit.org/show_bug.cgi?id=198816
2930
2931         Reviewed by Jon Lee.
2932
2933         RenderBox::paddingBoxRect() needs to offset the left side of the box for the
2934         vertical scrollbar, if it's placed on the left.
2935
2936         Test: compositing/geometry/rtl-overflow-scroll.html
2937
2938         * rendering/RenderBox.cpp:
2939         (WebCore::RenderBox::paddingBoxRect const):
2940         * rendering/RenderBox.h:
2941         (WebCore::RenderBox::paddingBoxRect const): Deleted.
2942         * rendering/RenderLayerBacking.cpp:
2943         (WebCore::RenderLayerBacking::updateGeometry):
2944         * rendering/RenderListBox.cpp:
2945         (WebCore::RenderListBox::controlClipRect const):
2946
2947 2019-06-12  Youenn Fablet  <youenn@apple.com>
2948
2949         Use NSURLSession for WebSocket
2950         https://bugs.webkit.org/show_bug.cgi?id=198568
2951
2952         Reviewed by Geoffrey Garen.
2953
2954         Add a runtime flag to either choose the new WebSocket code path or the previously existing one.
2955         The switch is done at WebSocket channel API level which offers the necessary high level API to abstract the two code paths.
2956         By default, we continue using the current WebSocket implementation.
2957         Covered by manual testing on current WebSocket tests.
2958
2959         * Modules/websockets/ThreadableWebSocketChannel.cpp:
2960         (WebCore::ThreadableWebSocketChannel::create):
2961         * Modules/websockets/WebSocketChannel.cpp:
2962         (WebCore::WebSocketChannel::document):
2963         * Modules/websockets/WebSocketChannel.h:
2964         * WebCore.xcodeproj/project.pbxproj:
2965         * page/RuntimeEnabledFeatures.h:
2966         (WebCore::RuntimeEnabledFeatures::isNSURLSessionWebSocketEnabled const):
2967         (WebCore::RuntimeEnabledFeatures::setIsNSURLSessionWebSocketEnabled):
2968         * page/SocketProvider.cpp:
2969         (WebCore::SocketProvider::createWebSocketChannel):
2970         * page/SocketProvider.h:
2971
2972 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
2973
2974         [WHLSL] Educate the property resolver about IndexExpressions
2975         https://bugs.webkit.org/show_bug.cgi?id=198399
2976
2977         Reviewed by Saam Barati.
2978
2979         This is part one of two patches which will allow buffers to work. This patch
2980         adds support in the property resolver for index expressions. Index expressions
2981         get turned into calls to "getter indexers", "setter indexers", or "ander
2982         indexers". They work almost identically to dot expressions, except there is an
2983         extra "index" expression which gets turned into an extra argument to those
2984         functions.
2985
2986         There's actually a bit of a trick here. Let's say we need to run a getter and
2987         a setter separately (e.g. "foo[3]++;"). The index expression can't be duplicated
2988         for both the getter and the setter (e.g. the functions are
2989         int operator[](Foo, uint) and Foo operator[]=(Foo, uint, int), and we aren't
2990         allowed to execute the index expression multiple times. Consider if that "3"
2991         in the example is actually "bar()" with some side effect. So, we have to run
2992         the index expression once at the correct time, and save its result to a temporary
2993         variable, and then pass in the temporary variable into the getter and setter.
2994
2995         So, if the code says "foo[bar()][baz()] = quux();" the following sequence of
2996         functions get run:
2997
2998         - bar()
2999         - operator[](Foo, uint)
3000         - baz()
3001         - quux()
3002         - operator[]=(OtherType, uint, OtherOtherType)
3003         - operator[]=(Foo, uint, OtherType)
3004
3005         The next patch will modify the WebGPU JavaScript implementation to send buffer
3006         lengths to the shader, and for the shader compiler to correctly unpack this
3007         information and place it inside the array references. That should be everything
3008         that's needed to get buffers to work. After that, hooking up compute should be
3009         fairly trivial.
3010
3011         Tests: webgpu/propertyresolver/ander-abstract-lvalue.html
3012                webgpu/propertyresolver/ander-lvalue-3-levels.html
3013                webgpu/propertyresolver/ander-lvalue.html
3014                webgpu/propertyresolver/ander.html
3015                webgpu/propertyresolver/getter.html
3016                webgpu/propertyresolver/indexer-ander-abstract-lvalue.html
3017                webgpu/propertyresolver/indexer-ander-lvalue-3-levels.html
3018                webgpu/propertyresolver/indexer-ander-lvalue.html
3019                webgpu/propertyresolver/indexer-ander.html
3020                webgpu/propertyresolver/indexer-getter.html
3021                webgpu/propertyresolver/indexer-setter-abstract-lvalue-3-levels.html
3022                webgpu/propertyresolver/indexer-setter-abstract-lvalue.html
3023                webgpu/propertyresolver/indexer-setter-lvalue.html
3024                webgpu/propertyresolver/indexer-setter.html
3025                webgpu/propertyresolver/setter-abstract-lvalue-3-levels.html
3026                webgpu/propertyresolver/setter-abstract-lvalue.html
3027                webgpu/propertyresolver/setter-lvalue.html
3028
3029         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
3030         (WebCore::WHLSL::AST::toString):
3031         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
3032         (WebCore::WHLSL::AST::toString):
3033         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
3034         (WebCore::WHLSL::AST::IndexExpression::takeIndex):
3035         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
3036         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
3037         (WebCore::WHLSL::Metal::writeNativeFunction):
3038         (WebCore::WHLSL::Metal::convertAddressSpace): Deleted.
3039         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3040         (WebCore::WHLSL::checkOperatorOverload):
3041         (WebCore::WHLSL::Checker::finishVisiting):
3042         (WebCore::WHLSL::Checker::visit):
3043         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
3044         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
3045         (WebCore::WHLSL::PropertyResolver::visit):
3046         (WebCore::WHLSL::setterCall):
3047         (WebCore::WHLSL::getterCall):
3048         (WebCore::WHLSL::modify):
3049         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
3050         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
3051         (WebCore::WHLSL::LeftValueSimplifier::visit):
3052         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
3053         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
3054         (WebCore::WHLSL::synthesizeStructureAccessors):
3055
3056 2019-06-12  Devin Rousso  <drousso@apple.com>
3057
3058         Web Inspector: artificial context menus don't work when Web Inspector is zoomed
3059         https://bugs.webkit.org/show_bug.cgi?id=198801
3060
3061         Reviewed by Joseph Pecoraro.
3062
3063         * inspector/InspectorFrontendHost.cpp:
3064         (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
3065         Use the `absoluteLocation` of the `MouseEvent`, which takes into account zoom and scale.
3066
3067 2019-06-12  Sam Weinig  <weinig@apple.com>
3068
3069         Remove dead code in user agent construction
3070         https://bugs.webkit.org/show_bug.cgi?id=198802
3071
3072         Reviewed by Anders Carlsson.
3073
3074         * page/NavigatorBase.cpp:
3075         (WebCore::NavigatorBase::platform const):
3076         Drop dead architures.
3077
3078 2019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>
3079
3080         [GTK] GTK_STOCK_* types have been deprecated since GTK 3.10
3081         https://bugs.webkit.org/show_bug.cgi?id=198787
3082
3083         Reviewed by Michael Catanzaro.
3084
3085         No behaviour changes.
3086
3087         * platform/graphics/gtk/IconGtk.cpp:
3088         (WebCore::lookupIconName):
3089         * platform/graphics/gtk/ImageGtk.cpp:
3090         (WebCore::loadMissingImageIconFromTheme):
3091
3092 2019-06-12  Antti Koivisto  <antti@apple.com>
3093
3094         (Async scrolling) Handle 'position:fixed' inside 'position:sticky' correctly.
3095         https://bugs.webkit.org/show_bug.cgi?id=198788
3096         <rdar://problem/51589759>
3097
3098         Reviewed by Simon Fraser.
3099
3100         Handle 'position:fixed' inside 'position:sticky' correctly.
3101
3102         Also fix nested 'position:fixed' in case where there is an overflow scroller between them.
3103
3104         Tests: scrollingcoordinator/ios/fixed-inside-overflow-inside-fixed.html
3105                scrollingcoordinator/ios/fixed-inside-sticky-frame.html
3106                scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context-2.html
3107                scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context.html
3108                scrollingcoordinator/ios/fixed-inside-sticky-stacking-context.html
3109
3110         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
3111         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
3112
3113         Take offsets from sticky nodes into account.
3114
3115         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
3116         (WebCore::ScrollingTreeStickyNode::layer):
3117         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
3118         (WebCore::ScrollingTreeStickyNode::computeLayerPosition const):
3119
3120         Factor into a function.
3121
3122         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
3123         (WebCore::ScrollingTreeStickyNode::scrollDeltaSinceLastCommit const):
3124         * rendering/RenderLayerCompositor.cpp:
3125         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
3126
3127         We need to generate a scrolling tree node for position:fixed in nested case if there is an overflow scroller
3128         between the layers.
3129
3130 2019-06-12  Truitt Savell  <tsavell@apple.com>
3131
3132         Unreviewed, rolling out r246350.
3133
3134         r246350 Introduced a failing and timing out test svg/clip-path
3135         /clip-hidpi.svg
3136
3137         Reverted changeset:
3138
3139         "[cairo][SVG] If clipPath has multiple elements, clip-path doesn't work with transform"
3140         https://bugs.webkit.org/show_bug.cgi?id=198746
3141         https://trac.webkit.org/changeset/246350
3142
3143 2019-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3144
3145         [cairo][SVG] If clipPath has multiple elements, clip-path doesn't work with transform
3146         https://bugs.webkit.org/show_bug.cgi?id=198746
3147         <rdar://problem/51665805>
3148
3149         Reviewed by Don Olmstead.
3150
3151         We need to save the current transformation matrix at the moment the image mask is set and set it again on
3152         restore right before applying the mask. This patch also creates a pattern for the image mask surface and set its
3153         transformation matrix according to the mask position, so that we don't need to save the mask rectangle too.
3154
3155         Tests: svg/clip-path/clip-hidpi-expected.svg
3156                svg/clip-path/clip-hidpi.svg
3157                svg/clip-path/clip-opacity-translate-expected.svg
3158                svg/clip-path/clip-opacity-translate.svg
3159
3160         * platform/graphics/cairo/PlatformContextCairo.cpp:
3161         (WebCore::PlatformContextCairo::restore):
3162         (WebCore::PlatformContextCairo::pushImageMask):
3163
3164 2019-06-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3165
3166         [iOS] Idempotent text autosizing needs to react properly to viewport changes
3167         https://bugs.webkit.org/show_bug.cgi?id=198736
3168         <rdar://problem/50591911>
3169
3170         Reviewed by Zalan Bujtas.
3171
3172         Minor refactoring and some adjustments around StyleResolver::adjustRenderStyleForTextAutosizing. See below for
3173         more details, as well as the WebKit ChangeLog.
3174
3175         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-after-changing-initial-scale.html
3176
3177         * css/StyleResolver.cpp:
3178         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
3179
3180         Rewrite this using early return statements, to make it easier to debug why elements fall out of text autosizing.
3181         Additionally, this function currently bails if the initial scale is exactly 1, whereas we can really avoid text
3182         autosizing in the case where the initial scale is at least 1; handle this by making idempotentTextSize return
3183         immediately with the specified size, in the case where the scale is at least 1.
3184
3185         Lastly, remove the null check for element by making this method take an Element&, and only call this from
3186         adjustRenderStyle if the element is nonnull (which matches adjustRenderStyleForSiteSpecificQuirks).
3187
3188         (WebCore::StyleResolver::adjustRenderStyle):
3189         * css/StyleResolver.h:
3190         * rendering/style/TextSizeAdjustment.cpp:
3191         (WebCore::AutosizeStatus::idempotentTextSize):
3192
3193 2019-06-11  Timothy Hatcher  <timothy@apple.com>
3194
3195         Flash when tapping compose button after switching to/from dark mode without restarting Mail.
3196         https://bugs.webkit.org/show_bug.cgi?id=198769
3197         rdar://problem/51370037
3198
3199         Reviewed by Tim Horton.
3200
3201         * WebCore.xcodeproj/project.pbxproj: Make LocalCurrentTraitCollection.h a private header.
3202
3203 2019-06-11  Commit Queue  <commit-queue@webkit.org>
3204
3205         Unreviewed, rolling out r246320.
3206         https://bugs.webkit.org/show_bug.cgi?id=198773
3207
3208         New test is failing, and commit is causing another test to
3209         fail. (Requested by ShawnRoberts on #webkit).
3210
3211         Reverted changeset:
3212
3213         "Web Inspector: AXI: Audit: image label test is throwing
3214         spurious errors on elements with existing alt attr, but no
3215         value: <img alt>"
3216         https://bugs.webkit.org/show_bug.cgi?id=194754
3217         https://trac.webkit.org/changeset/246320
3218
3219 2019-06-11  Devin Rousso  <drousso@apple.com>
3220
3221         Sort the computed styles list
3222         https://bugs.webkit.org/show_bug.cgi?id=198743
3223
3224         Reviewed by Simon Fraser
3225
3226         * css/CSSComputedStyleDeclaration.cpp:
3227
3228 2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
3229
3230         Unreviewed build warning fixes
3231
3232         Silence -Wunused-parameter warning
3233
3234         * testing/Internals.cpp:
3235         (WebCore::Internals::storeRegistrationsOnDisk):
3236
3237 2019-06-10  Simon Fraser  <simon.fraser@apple.com>
3238
3239         Add logging for UI-side compositing hit-testing
3240         https://bugs.webkit.org/show_bug.cgi?id=198739
3241
3242         Reviewed by Antti Koivisto.
3243
3244         Export the TextStream output operator.
3245
3246         * platform/TouchAction.h:
3247
3248 2019-06-11  Greg Doolittle  <gr3g@apple.com>
3249
3250         Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>
3251         https://bugs.webkit.org/show_bug.cgi?id=194754
3252         <rdar://problem/48144534>
3253
3254         Reviewed by Chris Fleizach.
3255
3256         Tests: accessibility/img-alt-attribute-empty-string.html
3257                accessibility/img-alt-attribute-no-value.html
3258
3259         * accessibility/AccessibilityObject.cpp:
3260         (WebCore::AccessibilityObject::computedRoleString const):
3261
3262 2019-06-11  Sihui Liu  <sihui_liu@apple.com>
3263
3264         Add a quirk for washingtonpost.com and nytimes.com
3265         https://bugs.webkit.org/show_bug.cgi?id=198678
3266
3267         Reviewed by Geoffrey Garen.
3268
3269         Covered by manual test.
3270
3271         * page/Quirks.cpp:
3272         (WebCore::Quirks::hasWebSQLSupportQuirk const):
3273
3274 2019-06-11  Devin Rousso  <drousso@apple.com>
3275
3276         Include `touch-action` in the computed styles list
3277         https://bugs.webkit.org/show_bug.cgi?id=198742
3278
3279         Reviewed by Antoine Quint.
3280
3281         * css/CSSComputedStyleDeclaration.cpp:
3282
3283 2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
3284
3285         tu-berlin university email web interface (Outlook Web App) goes directly to the light version instead of the normal web app
3286         https://bugs.webkit.org/show_bug.cgi?id=198749
3287
3288         Reviewed by Carlos Garcia Campos.
3289
3290         Add user agent quirk for exchange.tu-berlin.de, which has lost the right to receive an
3291         accurate user agent from WebKit.
3292
3293         * platform/UserAgentQuirks.cpp:
3294         (WebCore::urlRequiresMacintoshPlatform):
3295
3296 2019-06-11  Youenn Fablet  <youenn@apple.com>
3297
3298         MediaStreamAudioSourceNode::setFormat should check for m_sourceSampleRate equality
3299         https://bugs.webkit.org/show_bug.cgi?id=198740
3300         <rdar://problem/47088939>
3301
3302         Reviewed by Eric Carlson.
3303
3304         Covered by tests that are now passing.
3305
3306         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
3307         (WebCore::MediaStreamAudioSourceNode::setFormat):
3308
3309 2019-06-11  Ludovico de Nittis  <ludovico.denittis@collabora.com>
3310
3311         [GTK] Replace gdk_screen_get_monitor_geometry and gdk_screen_get_monitor_workarea
3312         https://bugs.webkit.org/show_bug.cgi?id=198750
3313
3314         Reviewed by Carlos Garcia Campos.
3315
3316         Since GTK 3.22 gdk_screen_get_monitor_geometry and
3317         gdk_screen_get_monitor_workarea has been deprecated. 
3318
3319         No behavior change.
3320
3321         * platform/gtk/PlatformScreenGtk.cpp:
3322         (WebCore::screenRect):
3323         (WebCore::screenAvailableRect):
3324
3325 2019-06-11  Fujii Hironori  <Hironori.Fujii@sony.com>
3326
3327         [cairo][SVG] Putting multiple path elements in clippath causes rendering artifacts
3328         https://bugs.webkit.org/show_bug.cgi?id=198701
3329
3330         PlatformContextCairo::pushImageMask blits wrong position of the
3331         surface to the background of masking objects. And, I don't know
3332         the reason why this blitting is needed. Removed the blitting.
3333
3334         Reviewed by Carlos Garcia Campos.
3335
3336         Tests: svg/clip-path/clip-opacity.html
3337                svg/clip-path/svg-in-html.html
3338
3339         * platform/graphics/cairo/PlatformContextCairo.cpp:
3340         (WebCore::PlatformContextCairo::pushImageMask): Don't blit the
3341         surface to the background.
3342
3343 2019-06-10  Fujii Hironori  <Hironori.Fujii@sony.com>
3344
3345         [WinCairo][MediaFoundation] Remove the unused video window
3346         https://bugs.webkit.org/show_bug.cgi?id=198523
3347
3348         Reviewed by Don Olmstead.
3349
3350         Remove the video window which had been unused since Bug 150941.
3351
3352         No behavior change.
3353
3354         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3355         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
3356         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
3357         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3358         (WebCore::MediaPlayerPrivateMediaFoundation::paint):
3359         (WebCore::MediaPlayerPrivateMediaFoundation::hostWindow):
3360         (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
3361         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow):
3362         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect):
3363         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples):
3364         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
3365         (WebCore::MediaPlayerPrivateMediaFoundation::VideoViewWndProc): Deleted.
3366         (WebCore::MediaPlayerPrivateMediaFoundation::registerVideoWindowClass): Deleted.
3367         (WebCore::MediaPlayerPrivateMediaFoundation::createVideoWindow): Deleted.
3368         (WebCore::MediaPlayerPrivateMediaFoundation::destroyVideoWindow): Deleted.
3369         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSwapChain): Deleted.
3370         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::updateDestRect): Deleted.
3371         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3372
3373 2019-06-10  Simon Fraser  <simon.fraser@apple.com>
3374
3375         Add visualization of touch action regions
3376         https://bugs.webkit.org/show_bug.cgi?id=198718
3377
3378         Reviewed by Antoine Quint.
3379
3380         Add a way to show which elements of the page have touch-action set on them by
3381         painting an overlay with small text that shows the type of action(s).