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