c6f7e343cba37d654201394d74c8230b8e9b1483
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-07-16  Justin Fan  <justin_fan@apple.com>
2
3         [WebGPU] Convert GPUComputePipeline LOG statements to generate GPUErrors
4         https://bugs.webkit.org/show_bug.cgi?id=199773
5
6         Reviewed by Myles C. Maxfield.
7
8         Generate a GPUError if GPUComputePipeline creation fails.
9         Rework the WHLSL test harness to take advantage of this.
10
11         Test: webgpu/compute-pipeline-errors.html
12
13         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp:
14         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
15         * Modules/webgpu/WebGPUComputePipelineDescriptor.h:
16         * Modules/webgpu/WebGPUDevice.cpp:
17         (WebCore::WebGPUDevice::createComputePipeline const):
18         * platform/graphics/gpu/GPUBuffer.h:
19         * platform/graphics/gpu/GPUComputePipeline.h: 
20                 Now inherits from GPUObjectBase, though this isn't super useful yet
21                 since GPUComputePipeline itself does not expose any operations that can error. 
22         * platform/graphics/gpu/GPUDevice.cpp:
23         (WebCore::GPUDevice::tryCreateComputePipeline const):
24         * platform/graphics/gpu/GPUDevice.h:
25         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
26         (WebCore::GPUBuffer::validateBufferUsage):
27         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
28         (WebCore::trySetMetalFunctions):
29         (WebCore::trySetFunctions):
30         (WebCore::convertComputePipelineDescriptor):
31         (WebCore::tryCreateMTLComputePipelineState):
32         (WebCore::GPUComputePipeline::tryCreate):
33         (WebCore::GPUComputePipeline::GPUComputePipeline):
34
35 2019-07-11  Justin Fan  <justin_fan@apple.com>
36
37         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
38         https://bugs.webkit.org/show_bug.cgi?id=199740
39
40         Reviewed by Myles C. Maxfield.
41
42         Move error generation into a separate RefCounted class to allow GPU objects to generate 
43         errors independent of any GPUDevice.
44         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
45
46         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
47
48         * Modules/webgpu/WebGPUDevice.cpp:
49         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
50         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
51         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
52         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
53         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
54         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
55         * Modules/webgpu/WebGPUDevice.h:
56         (WebCore::WebGPUDevice::pushErrorScope):
57         * Sources.txt:
58         * WebCore.xcodeproj/project.pbxproj:
59         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
60         * platform/graphics/gpu/GPUDevice.cpp:
61         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
62         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
63         (WebCore::GPUDevice::popErrorScope): Deleted.
64         (WebCore::GPUDevice::registerError): Deleted.
65         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
66         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
67         (WebCore::GPUErrorGenerator::pushErrorScope):
68         (WebCore::GPUErrorGenerator::popErrorScope):
69         (WebCore::GPUErrorGenerator::generateError):
70         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
71         (WebCore::GPUErrorGenerator::create):
72         * platform/graphics/gpu/GPUObjectBase.h: Added.
73         (WebCore::GPUObjectBase::generateError):
74         (WebCore::GPUObjectBase::GPUObjectBase):
75         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
76         (WebCore::GPUBuffer::validateBufferUsage):
77         (WebCore::GPUBuffer::tryCreate):
78         (WebCore::GPUBuffer::GPUBuffer):
79         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
80         (WebCore::GPUQueue::submit): Prevent possible null dereference.
81
82 2019-07-10  Justin Fan  <justin_fan@apple.com>
83
84         [WebGPU] Implement GPUError and error scopes
85         https://bugs.webkit.org/show_bug.cgi?id=199655
86
87         Reviewed by Myles C. Maxfield.
88
89         Add GPUErrorFilter, GPUError, and the ability to push and pop error scopes on a GPUDevice.
90         This will allow us to check for WebGPU errors from JavaScript.
91         Currently, only some GPUBuffer creation errors are reported for testing; more errors will follow in later patches.
92
93         Test: webgpu/error-scopes-test.html
94
95         * Modules/webgpu/GPUErrorFilter.idl: Added.
96         * Modules/webgpu/GPUOutOfMemoryError.idl: Added.
97         * Modules/webgpu/GPUValidationError.idl: Added.
98         * Modules/webgpu/WebGPUDevice.cpp:
99         (WebCore::WebGPUDevice::pushErrorScope):
100         (WebCore::WebGPUDevice::popErrorScope): Resolve the Promise here, since GPUDevice shouldn't worry about DOM layer.
101         * Modules/webgpu/WebGPUDevice.h:
102         * Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Added.
103         (WebCore::WebGPUDeviceErrorScopes::pushErrorScope): Delegates to WebGPUDevice.
104         (WebCore::WebGPUDeviceErrorScopes::popErrorScope): Ditto.
105         * Modules/webgpu/WebGPUDeviceErrorScopes.h: Added.
106         * Modules/webgpu/WebGPUDeviceErrorScopes.idl: Added.
107         * platform/graphics/gpu/GPUBuffer.h:
108         * platform/graphics/gpu/GPUDevice.cpp: The actual error stack lives here.
109         (WebCore::GPUDevice::pushErrorScope):
110         (WebCore::GPUDevice::popErrorScope): Calls a callback with a GPUError, if any.
111         (WebCore::GPUDevice::registerError): Actually creates GPUErrors.
112         * platform/graphics/gpu/GPUDevice.h:
113         * platform/graphics/gpu/GPUError.cpp: Added.
114         (WebCore::createError): Factory function for various error types.
115         * platform/graphics/gpu/GPUError.h: Added.
116         * platform/graphics/gpu/GPUErrorFilter.h: Added.
117         * platform/graphics/gpu/GPUOutOfMemoryError.h: Added.
118         (WebCore::GPUOutOfMemoryError::create):
119         * platform/graphics/gpu/GPUValidationError.cpp: Added.
120         (WebCore::GPUValidationError::create):
121         (WebCore::GPUValidationError::GPUValidationError):
122         * platform/graphics/gpu/GPUValidationError.h: Added.
123         (WebCore::GPUValidationError::message const):
124         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
125         (WebCore::GPUBuffer::validateBufferUsage): Create an actual GPUValidationError :)
126         (WebCore::GPUBuffer::tryCreate): Create GPUOutOfMemoryErrors where appropriate.
127
128         Add file/name references:
129         * CMakeLists.txt:
130         * DerivedSources-input.xcfilelist:
131         * DerivedSources-output.xcfilelist:
132         * DerivedSources.make:
133         * Sources.txt:
134         * WebCore.xcodeproj/project.pbxproj:
135         * bindings/js/WebCoreBuiltinNames.h:
136
137         Missing includes:
138         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
139
140 2019-07-16  Commit Queue  <commit-queue@webkit.org>
141
142         Unreviewed, rolling out r247493.
143         https://bugs.webkit.org/show_bug.cgi?id=199841
144
145         "The new whlsl-for-loop.html test is failing on the bots"
146         (Requested by rmorisset on #webkit).
147
148         Reverted changeset:
149
150         "[WHLSL] Desugar for loops and while loops"
151         https://bugs.webkit.org/show_bug.cgi?id=199726
152         https://trac.webkit.org/changeset/247493
153
154 2019-07-16  Per Arne Vollan  <pvollan@apple.com>
155
156         Prewarm font cache with more fonts
157         https://bugs.webkit.org/show_bug.cgi?id=199283
158
159         Reviewed by Myles C. Maxfield.
160
161         Use the existing prewarm method in FontCache to prewarm the cache with a set of font family names.
162         The font list consists of some of the fonts used by the 10 most popular sites on Alexa top sites.
163         This is a confirmed improvement in page load time.
164
165         No new tests, covered by existing tests.
166
167         * page/ProcessWarming.cpp:
168         (WebCore::ProcessWarming::prewarmGlobally):
169         * platform/graphics/FontCache.cpp:
170         (WebCore::FontCache::prewarmGlobally):
171         * platform/graphics/FontCache.h:
172         * platform/graphics/cocoa/FontCacheCoreText.cpp:
173         (WebCore::FontCache::prewarmGlobally):
174
175 2019-07-16  Robin Morisset  <rmorisset@apple.com>
176
177         [WHLSL] Desugar for loops and while loops
178         https://bugs.webkit.org/show_bug.cgi?id=199726
179
180         Reviewed by Myles C. Maxfield.
181
182         This patch makes loops behave a lot more similarly to the spec.
183         In particular, while loops are just degenerate for loops, so they can be desugared in the parser.
184         And for loops can themselves be heavily desugared, into having no initializer, one condition and one increment
185         by putting any initializer in a block around the loop, putting true in the condition if there is none, and putting any litteral in the increment if there is none.
186
187         Debugging this patch revealed an unrelated bug where the parser would generate an empty comma expression on ";", which the checker would then choke on.
188         The parser now generates an empty block in that case (as specified in the spec), which fixes the problem.
189
190         Finally, while updating the NameResolver for the new structure of loops I realized that it was needlessly generating extra NameContext.
191         They are not expected by the spec, that forbids naked variable declarations outside of blocks anyway.
192         So I removed this unnecessary work, and fixed the parser to correctly forbid such naked variable declarations.
193
194         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
195         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
196         (WebCore::WHLSL::AST::ForLoop::ForLoop):
197         (WebCore::WHLSL::AST::ForLoop::condition):
198         (WebCore::WHLSL::AST::ForLoop::increment):
199         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
200         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
201         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Removed.
202         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
203         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
204         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
205         (WebCore::WHLSL::ASTDumper::visit):
206         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
207         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
208         (WebCore::WHLSL::Checker::visit):
209         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
210         (WebCore::WHLSL::NameResolver::visit):
211         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
212         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
213         (WebCore::WHLSL::Parser::parseBlockBody):
214         (WebCore::WHLSL::Parser::parseForLoop):
215         (WebCore::WHLSL::Parser::parseWhileLoop):
216         (WebCore::WHLSL::Parser::parseStatement):
217         (WebCore::WHLSL::Parser::parseEffectfulExpression):
218         * Modules/webgpu/WHLSL/WHLSLParser.h:
219         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
220         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
221         (WebCore::WHLSL::Visitor::visit):
222         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
223         * WebCore.xcodeproj/project.pbxproj:
224
225 2019-07-16  Tim Horton  <timothy_horton@apple.com>
226
227         NSTextFinder holes don't scroll with the page
228         https://bugs.webkit.org/show_bug.cgi?id=199815
229         <rdar://problem/52280514>
230
231         Reviewed by Simon Fraser.
232
233         * rendering/ScrollAlignment.h:
234
235 2019-07-16  Youenn Fablet  <youenn@apple.com>
236
237         [iOS] Make sure the first camera device in the list is the front camera
238         https://bugs.webkit.org/show_bug.cgi?id=199811
239         <rdar://problem/53125157>
240
241         Reviewed by Jer Noble.
242
243         Some websites call getUserMedia with a deviceId constraint and theey pick the
244         first deviceId in the list provided by enumerateDevices.
245         On iOS, this is the back camera which is often not what is expected by WebRTC applications.
246         Instead, make sure the first camera device is the front camera.
247
248         Manually tested.
249
250         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
251
252 2019-07-16  Chris Dumez  <cdumez@apple.com>
253
254         Speed up StorageManager::getValues()
255         https://bugs.webkit.org/show_bug.cgi?id=199812
256
257         Reviewed by Alex Christensen.
258
259         * storage/StorageMap.cpp:
260         (WebCore::StorageMap::importItems):
261         * storage/StorageMap.h:
262
263 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
264
265         Remove "GraphicsContext 0x7ffd8765f6b0 stack changed by" logging
266         https://bugs.webkit.org/show_bug.cgi?id=199834
267
268         Reviewed by Dean Jackson.
269
270         I inadvertently left in a couple of GraphicsContextStateStackChecker (used to detect mismatched
271         GraphicsContext save/restore) in r246725, so remove them.
272
273         * rendering/RenderLayer.cpp:
274         (WebCore::RenderLayer::paintLayerContents):
275         * rendering/RenderLayerBacking.cpp:
276         (WebCore::RenderLayerBacking::paintIntoLayer):
277
278 2019-07-16  Wenson Hsieh  <wenson_hsieh@apple.com>
279
280         [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
281         https://bugs.webkit.org/show_bug.cgi?id=199827
282         <rdar://problem/53152660>
283
284         Reviewed by Zalan Bujtas.
285
286         After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
287         increasing inside a container that expects a fixed integer number of lines. However, in the case of
288         linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
289         of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.
290
291         To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
292         is fixed, and is much larger than the font size.
293
294         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
295
296         * rendering/style/TextSizeAdjustment.cpp:
297         (WebCore::AutosizeStatus::updateStatus):
298
299 2019-07-16  Zalan Bujtas  <zalan@apple.com>
300
301         [ContentChangeObserver] Cancel ongoing content observation when tap is failed/cancelled
302         https://bugs.webkit.org/show_bug.cgi?id=199828
303         <rdar://problem/53152696>
304
305         Reviewed by Wenson Hsieh.
306
307         This patch ensures that we stop the content observation (initiated by touch start) when the tap
308         is cancelled/failed.
309
310         Not testable.
311
312         * page/ios/ContentChangeObserver.cpp:
313         (WebCore::ContentChangeObserver::didCancelPotentialTap):
314         * page/ios/ContentChangeObserver.h:
315
316 2019-07-16  Rob Buis  <rbuis@igalia.com>
317
318         Remove support for beforeload on link=prefetch
319         https://bugs.webkit.org/show_bug.cgi?id=199632
320
321         Reviewed by Youenn Fablet.
322
323         Remove support for beforeload on link=prefetch
324         by not calling shouldLoadLink for prefetch.
325         Also make loadLink return void since it always
326         succeeds.
327
328         Tests: http/wpt/prefetch/beforeload-dynamic.html
329                http/wpt/prefetch/beforeload.html
330
331         * html/HTMLLinkElement.cpp:
332         (WebCore::HTMLLinkElement::process):
333         * loader/LinkLoader.cpp:
334         (WebCore::LinkLoader::prefetchIfNeeded):
335         (WebCore::LinkLoader::loadLink):
336         * loader/LinkLoader.h:
337
338 2019-07-16  Youenn Fablet  <youenn@apple.com>
339
340         Hop to main thread for release logging in RealtimeIncomingAudioSource
341         https://bugs.webkit.org/show_bug.cgi?id=199813
342
343         Reviewed by Eric Carlson.
344
345         LoggerHelper routines allow logging messages in system console and inspector console.
346         These routines iterate through a Vector of log observers which is not thread safe.
347         Document, the main log observer, also expects to be called on the main thread.
348         Manually tested (writing a layout test for this would require more than 2 seconds).
349
350         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
351         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
352
353 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
354
355         Unreviewed, rolling out r247444.
356
357         Caused two scrolling tests to fail on iOS Simulator
358
359         Reverted changeset:
360
361         "Typing into a cell in a Google Sheet lags behind by one
362         character"
363         https://bugs.webkit.org/show_bug.cgi?id=199587
364         https://trac.webkit.org/changeset/247444
365
366 2019-07-15  Zalan Bujtas  <zalan@apple.com>
367
368         outlook.live.com has odd viewport with edge gap
369         https://bugs.webkit.org/show_bug.cgi?id=199822
370         <rdar://problem/53029072>
371
372         Reviewed by Wenson Hsieh.
373
374         r244944 introduced a viewport width quirk because at certain screen size outlook.live.com's flex setup produced a slighly broken layout.
375         We don't seem to need this quirk anymore (composed column's min-width is removed.)
376
377         * page/Quirks.cpp:
378         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const): Deleted.
379         (WebCore::Quirks::overriddenViewLayoutWidth const): Deleted.
380         * page/Quirks.h:
381
382 2019-07-15  Saam Barati  <sbarati@apple.com>
383
384         [WHLSL] Matrix memory layout should match HLSL by laying out columns linearly
385         https://bugs.webkit.org/show_bug.cgi?id=199215
386
387         Reviewed by Myles C. Maxfield.
388
389         This patch makes it so that we lay out matrices in memory in the same
390         way HLSL does. This is by laying out columns linearly in memory. So a float4x4
391         composed by this series of floats in memory:
392         [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
393         
394         composes this logical matrix:
395         [[ 0,  4,  8, 12]
396          [ 1,  5,  9, 13]
397          [ 2,  6, 10, 14]
398          [ 3,  7, 11, 15]]
399         
400         To implement this, we switch to using an array to represent the memory
401         contents linear memory layout of a matrix. So the matrix float4x3 will now
402         be an array<float, 12> in metal. Then, we change the indexed getter and
403         setter methods for matrices to load and store from and to the correct
404         memory locations. The memory layout of matrices is observable to WHLSL
405         when using a matrix as an input/output to a shader.
406
407         Test: webgpu/whlsl-matrix-memory-layout.html
408
409         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
410         (WebCore::WHLSL::Metal::writeNativeFunction):
411         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
412         (WebCore::WHLSL::Metal::writeNativeType):
413
414 2019-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
415
416         [Text autosizing] [iPadOS] Product label text is clipped in portrait mode on the front page of sephora.com
417         https://bugs.webkit.org/show_bug.cgi?id=199806
418         <rdar://problem/52902482>
419
420         Reviewed by Zalan Bujtas.
421
422         On sephora.com, some product label text is currently boosted by idempotent text autosizing, which causes the
423         labels be vertically clipped. This patch augments the idempotent text autosizing heuristic to avoid this case by
424         checking if the element to be boosted has a fixed height or max height, whose value is very close to a small
425         integer multiple of the line height. In this case, it's likely that the website expects the text to be no more
426         than a few lines' worth of height, so boosting the text is likely to break the page.
427
428         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
429
430         * rendering/style/RenderStyle.cpp:
431         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
432         * rendering/style/TextSizeAdjustment.cpp:
433         (WebCore::AutosizeStatus::updateStatus):
434         * rendering/style/TextSizeAdjustment.h:
435
436         Rename Fields::DisplayNone to Fields::AvoidSubtree to avoid introducing another bit in RenderStyle's inherited
437         flags.
438
439 2019-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
440
441         New York font erroneously gets synthetic bold
442         https://bugs.webkit.org/show_bug.cgi?id=199653
443
444         Unreviewed watchOS build fix.
445
446         * page/ProcessWarming.cpp:
447         (WebCore::ProcessWarming::prewarmGlobally):
448         * page/cocoa/MemoryReleaseCocoa.mm:
449         (WebCore::platformReleaseMemory):
450         * platform/graphics/FontCascadeDescription.cpp:
451         * platform/graphics/FontDescription.h:
452         * platform/graphics/cocoa/FontCacheCoreText.cpp:
453         (WebCore::invalidateFontCache):
454         (WebCore::lookupFallbackFont):
455         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
456         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
457         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
458         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
459         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
460
461 2019-07-15  Commit Queue  <commit-queue@webkit.org>
462
463         Unreviewed, rolling out r247462.
464         https://bugs.webkit.org/show_bug.cgi?id=199816
465
466         completely messed up the patch (Requested by litherum on
467         #webkit).
468
469         Reverted changeset:
470
471         "New York font erroneously gets synthetic bold"
472         https://bugs.webkit.org/show_bug.cgi?id=199653
473         https://trac.webkit.org/changeset/247462
474
475 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
476
477         Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
478
479         * platform/graphics/cocoa/FontCacheCoreText.cpp:
480         (WebCore::fontWithFamilySpecialCase):
481
482 2019-07-11  Justin Fan  <justin_fan@apple.com>
483
484         Unreviewed build fix.
485
486         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.
487
488 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
489
490         New York font erroneously gets synthetic bold
491         https://bugs.webkit.org/show_bug.cgi?id=199653
492         <rdar://problem/51692592>
493
494         Reviewed by Simon Fraser.
495
496         This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
497         and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
498         to expose these fonts to the web because we don't a standardization story for them
499         yet, but we do want some apps to be able to use them.
500
501         WebKit clients who want to use these fonts can set
502         -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
503
504         The patch generalizes our existing system-ui infrastructure to handle these three
505         additional fonts. It also explicitly disables the unsupported dot-prefixed names
506         so they don't leak out into Web content.
507
508         Tests: fast/text/design-system-ui-10.html
509                fast/text/design-system-ui-11.html
510                fast/text/design-system-ui-12.html
511                fast/text/design-system-ui-13.html
512                fast/text/design-system-ui-14.html
513                fast/text/design-system-ui-15.html
514                fast/text/design-system-ui-16.html
515                fast/text/design-system-ui-2.html
516                fast/text/design-system-ui-3.html
517                fast/text/design-system-ui-4.html
518                fast/text/design-system-ui-5.html
519                fast/text/design-system-ui-6.html
520                fast/text/design-system-ui-7.html
521                fast/text/design-system-ui-8.html
522                fast/text/design-system-ui-9.html
523                fast/text/design-system-ui.html
524
525         * css/CSSFontFace.cpp:
526         (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
527         * css/CSSFontFace.h:
528         * css/CSSFontFaceSource.cpp:
529         (WebCore::CSSFontFaceSource::load):
530         * css/StyleResolver.cpp:
531         (WebCore::StyleResolver::initializeFontStyle):
532         * page/Settings.yaml:
533         * platform/graphics/FontDescription.cpp:
534         (WebCore::m_shouldAllowDesignSystemUIFonts):
535         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
536         * platform/graphics/FontDescription.h:
537         (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
538         (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
539         (WebCore::FontDescription::operator== const):
540         * platform/graphics/cocoa/FontCacheCoreText.cpp:
541         (WebCore::platformFontLookupWithFamily):
542         (WebCore::fontWithFamily):
543         * platform/graphics/cocoa/FontCacheCoreText.h:
544         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
545         (WebCore::systemFontUse):
546         (WebCore::systemFontCascadeList):
547         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
548         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
549         (WebCore::isSystemFontString): Deleted.
550         (WebCore::isUIFontTextStyle): Deleted.
551         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
552         (WebCore::FontPlatformData::ctFont const):
553         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
554         (WebCore::SystemFontDatabaseCoreText::createSystemUI):
555         (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
556         (WebCore::SystemFontDatabaseCoreText::createTextStyle):
557         (WebCore::SystemFontDatabaseCoreText::cascadeList):
558         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
559         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
560         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
561         * platform/graphics/ios/FontCacheIOS.mm:
562         (WebCore::platformFontWithFamilySpecialCase):
563         * platform/graphics/mac/FontCacheMac.mm:
564         (WebCore::platformFontWithFamilySpecialCase):
565         * style/StyleResolveForDocument.cpp:
566         (WebCore::Style::resolveForDocument):
567         * svg/graphics/SVGImage.cpp:
568         (WebCore::SVGImage::dataChanged):
569         * testing/InternalSettings.cpp:
570         (WebCore::InternalSettings::Backup::Backup):
571         (WebCore::InternalSettings::Backup::restoreTo):
572         (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
573         * testing/InternalSettings.h:
574         * testing/InternalSettings.idl:
575
576 2019-07-15  Chris Dumez  <cdumez@apple.com>
577
578         Crash under DisplayRefreshMonitorManager::displayWasUpdated()
579         https://bugs.webkit.org/show_bug.cgi?id=199808
580         <rdar://problem/53070144>
581
582         Reviewed by Geoffrey Garen.
583
584         Copy m_monitors before iterating over it because the calling displayLinkFired() on the
585         monitor may end up calling DisplayRefreshMonitorManager::displayDidRefresh() synchronously,
586         which removes the monitor from m_monitors.
587
588         * platform/graphics/DisplayRefreshMonitorManager.cpp:
589         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
590
591 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
592
593         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
594         https://bugs.webkit.org/show_bug.cgi?id=199783
595
596         Reviewed by Mark Lam.
597
598         Remove WebAssemblyPrototype.
599
600         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
601                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
602                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
603                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
604                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
605                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
606                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
607                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
608                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
609                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
610                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
611                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
612                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
613                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
614                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
615                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
616                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
617                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
618                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
619                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
620                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
621                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
622                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
623                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
624                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
625                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
626                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
627                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
628                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
629                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
630                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
631                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
632                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
633                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
634                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
635                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
636                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
637                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
638                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
639                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
640                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
641                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
642                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
643                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
644                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
645                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
646                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
647                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
648
649         * bindings/js/JSDOMWindowBase.cpp:
650         (WebCore::JSDOMWindowBase::compileStreaming):
651         (WebCore::JSDOMWindowBase::instantiateStreaming):
652
653 2019-07-15  Dean Jackson  <dino@apple.com>
654
655         [WebGL] Remove software rendering and simplify context creation on macOS
656         https://bugs.webkit.org/show_bug.cgi?id=199789
657
658         Reviewed by Sam Weinig.
659
660         We don't ever want to fall-back to the software renderer. We'd be better
661         off failing to create the context completely.
662
663         Also, the number of fall-back attempts we were making before hitting
664         the software renderer was overkill. All hardware we support should
665         handle a 32bpp buffer.
666
667         Lastly, we don't want to support supersampling - multisampling only.
668
669         I lied… there is one more thing - failing to create the context
670         was causing an ASSERT trying to remove the GC3D from the global list.
671
672         * html/canvas/WebGLRenderingContextBase.cpp:
673         (WebCore::WebGLRenderingContextBase::create):
674         * page/Settings.yaml: Remove forceSoftwareWebGL setting.
675         * platform/graphics/GraphicsContext3DAttributes.h:
676         * platform/graphics/GraphicsContext3DManager.cpp:
677         (WebCore::GraphicsContext3DManager::addContext):
678         (WebCore::GraphicsContext3DManager::removeContext):
679         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
680         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
681         (WebCore::GraphicsContext3D::GraphicsContext3D):
682         (WebCore::setPixelFormat): Deleted.
683
684 2019-07-14  Dean Jackson  <dino@apple.com>
685
686         Move more WebGL things into unified builds
687         https://bugs.webkit.org/show_bug.cgi?id=199787
688
689         Reviewed by Wenson Hsieh.
690
691         Unify as many WebGL files as possible.
692
693         * Sources.txt:
694         * WebCore.xcodeproj/project.pbxproj:
695         * html/canvas/WebGLFramebuffer.cpp:
696         * html/canvas/WebGLObject.h: Move a helper function into an inline.
697         (WebCore::objectOrZero):
698         * html/canvas/WebGLRenderingContextBase.cpp:
699         * platform/graphics/cocoa/FontCacheCoreText.cpp:
700         * platform/mediastream/MediaStreamTrackPrivate.cpp:
701
702 2019-07-15  Keith Rollin  <krollin@apple.com>
703
704         Add missing webgpu includes
705         https://bugs.webkit.org/show_bug.cgi?id=199802
706         <rdar://problem/53119120>
707
708         Reviewed by Myles C. Maxfield.
709
710         WHLSLFunctionWriter.cpp fails to compile on tvOS and watchOS due to
711         missing includes. This file likely compiles on other platforms due to
712         the Unified Sources facility that clumps several implementation files
713         together, exposing those implementation files to the others' includes.
714         It fails on tvOS and watchOS due to the different ways these
715         implementation files can get clumped together on different platforms.
716
717         No new tests as there is no functional change.
718
719         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
720
721 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
722
723         Unreviewed, rolling out r247440.
724
725         Broke builds
726
727         Reverted changeset:
728
729         "[JSC] Improve wasm wpt test results by fixing miscellaneous
730         issues"
731         https://bugs.webkit.org/show_bug.cgi?id=199783
732         https://trac.webkit.org/changeset/247440
733
734 2019-07-15  Daniel Bates  <dabates@apple.com>
735
736         Typing into a cell in a Google Sheet lags behind by one character
737         https://bugs.webkit.org/show_bug.cgi?id=199587
738         <rdar://problem/51616845>
739
740         Reviewed by Brent Fulgham.
741
742         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
743         into a holding tank. The timers continue to tick, but are barred from executing their action until
744         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
745         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
746         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
747         of the document.
748
749         The story behind the quirk:
750
751         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
752         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
753         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
754         event. It could happen in the same event loop iteration as the key press (as Google expects), the
755         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
756         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
757         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
758         functionality was available via onpropertychange in IE < 9).
759
760         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
761         this quirk.
762
763         Test: fast/events/ios/dom-update-on-keydown-quirk.html
764
765         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
766
767         * SourcesCocoa.txt:
768         * WebCore.xcodeproj/project.pbxproj:
769         Add some files to the project.
770
771         * dom/Document.cpp:
772         (WebCore::Document::domTimerHoldingTank): Added.
773         * dom/Document.h:
774         (WebCore::Document::domTimerHoldingTankIfExists): Added.
775
776         * page/DOMTimer.cpp:
777         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
778         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
779         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
780         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
781         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
782         we do not suspend timers in the holding tank is because:
783             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
784             Though smart supension logic could avoid this. See (3).
785
786             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
787             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
788             So, the timers in the holding tank are short-lived.
789
790             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
791             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
792             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
793         * page/EventHandler.cpp:
794         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
795         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
796         * page/Quirks.cpp:
797         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
798         * page/Quirks.h:
799         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
800         also lets us enable the quirk for all sites or for certain third-party apps if desired.
801         * page/ios/DOMTimerHoldingTank.cpp: Added.
802         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
803         (WebCore::DOMTimerHoldingTank::add):
804         (WebCore::DOMTimerHoldingTank::remove):
805         (WebCore::DOMTimerHoldingTank::contains):
806         (WebCore::DOMTimerHoldingTank::removeAll):
807         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
808         * page/ios/DOMTimerHoldingTank.h: Added.
809         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
810         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
811         (WebCore::DeferDOMTimersForScope::isDeferring):
812
813 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
814
815         Unreviewed, rolling out r247397, r247378, r247366.
816
817         Broke watchOS builds.
818
819         Reverted changesets:
820
821         "[WebGPU] Implement GPUError and error scopes"
822         https://bugs.webkit.org/show_bug.cgi?id=199655
823         https://trac.webkit.org/changeset/247366/webkit
824
825         "[WebGPU] Move error scopes out of GPUDevice for more portable error generation"
826         https://bugs.webkit.org/show_bug.cgi?id=199740
827         https://trac.webkit.org/changeset/247397/webkit
828
829 2019-07-15  Rob Buis  <rbuis@igalia.com>
830
831         MathML WPT test for RadicalDegreeBottomRaisePercent fails
832         https://bugs.webkit.org/show_bug.cgi?id=183631
833
834         Reviewed by Frédéric Wang.
835
836         When stretching the radical operator also take thickness
837         and radical gap into account:
838         https://mathml-refresh.github.io/mathml-core/#radicals-msqrt-mroot
839
840         Test: imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html
841
842         * rendering/mathml/RenderMathMLRoot.cpp:
843         (WebCore::RenderMathMLRoot::layoutBlock):
844
845 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
846
847         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
848         https://bugs.webkit.org/show_bug.cgi?id=199783
849
850         Reviewed by Mark Lam.
851
852         Remove WebAssemblyPrototype.
853
854         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
855                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
856                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
857                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
858                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
859                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
860                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
861                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
862                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
863                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
864                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
865                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
866                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
867                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
868                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
869                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
870                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
871                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
872                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
873                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
874                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
875                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
876                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
877                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
878                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
879                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
880                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
881                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
882                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
883                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
884                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
885                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
886                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
887                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
888                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
889                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
890                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
891                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
892                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
893                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
894                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
895                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
896                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
897                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
898                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
899                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
900                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
901                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
902
903         * bindings/js/JSDOMWindowBase.cpp:
904         (WebCore::JSDOMWindowBase::compileStreaming):
905         (WebCore::JSDOMWindowBase::instantiateStreaming):
906
907 2019-07-15  Youenn Fablet  <youenn@apple.com>
908
909         Enable a debug WebRTC mode without any encryption
910         https://bugs.webkit.org/show_bug.cgi?id=199177
911         <rdar://problem/52074986>
912
913         Reviewed by Eric Carlson.
914
915         For every RTCPeerConnection, first set whether to use encryption or not
916         based on page settings.
917         If encryption is disabled, log it.
918         Add internals API to toggle the switch from tests.
919         Test: webrtc/disable-encryption.html
920
921         * Modules/mediastream/RTCPeerConnection.cpp:
922         (WebCore::RTCPeerConnection::RTCPeerConnection):
923         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
924         (WebCore::createLibWebRTCPeerConnectionBackend):
925         * inspector/agents/InspectorPageAgent.cpp:
926         * page/Settings.yaml:
927         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
928         (WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
929         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
930         * testing/Internals.cpp:
931         (WebCore::Internals::resetToConsistentState):
932         (WebCore::Internals::setEnableWebRTCEncryption):
933         * testing/Internals.h:
934         * testing/Internals.idl:
935
936 2019-07-15  Sihui Liu  <sihui_liu@apple.com>
937
938         window.openDatabase is not writable
939         https://bugs.webkit.org/show_bug.cgi?id=199737
940         <rdar://problem/52551332>
941
942         Reviewed by Chris Dumez.
943
944         In r246707 we made openDatabase an undetectable attribute of window, and it was set to be read-only. This broke 
945         some sites which replace window.openDatabase with their own implementation when window.openDatabase does not 
946         exists or WebSQL is not implemented. 
947
948         This patch removes the readonly property and adds a setter for openDatabase.
949
950         * Modules/webdatabase/DOMWindowWebDatabase.idl:
951         * bindings/js/JSDOMWindowCustom.cpp:
952         (WebCore::JSDOMWindow::setOpenDatabase):
953
954 2019-07-15  Youenn Fablet  <youenn@apple.com>
955
956         Filter SDP c lines
957         https://bugs.webkit.org/show_bug.cgi?id=199791
958
959         Reviewed by Eric Carlson.
960
961         As discussed in https://github.com/rtcweb-wg/mdns-ice-candidates/issues/91,
962         use 0.0.0.0 for c lines when filtering the SDP.
963         Covered by updated test.
964
965         * Modules/mediastream/PeerConnectionBackend.cpp:
966         (WebCore::PeerConnectionBackend::filterSDP const):
967
968 2019-07-15  Zalan Bujtas  <zalan@apple.com>
969
970         naver.com: Video stops when tapping on the video to use buttons
971         https://bugs.webkit.org/show_bug.cgi?id=199784
972         <rdar://problem/48068610>
973
974         Reviewed by Maciej Stachowiak.
975
976         Opt out of simulated mouse event sending for tv.naver.com.
977         When tv.naver.com receives the simulated mouseUp at touchEnd, it pauses the video right away and calls preventDefault()
978         which prevents us from running the hover heuristics.
979
980         * page/Quirks.cpp:
981         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
982
983 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
984
985         [GTK] GitHub breaks on FreeBSD because of "unsupported browser"
986         https://bugs.webkit.org/show_bug.cgi?id=199745
987
988         Reviewed by Carlos Garcia Campos.
989
990         It's been a while since I last updated the fake version numbers in our user agent, both for
991         the user agent quirks for naughty websites and also the Safari version in our standard user
992         agent. Update them. This should fix github.com on FreeBSD at least. I also noticed some
993         wonkiness on Google Docs recently that I thought required this update, but I didn't do
994         anything about it at the time because I wasn't able to reproduce the issue when I tried
995         again later.
996
997         This could absolutely break websites, because the web is awful, but that's calculated risk.
998
999         * platform/UserAgentQuirks.cpp:
1000         (WebCore::UserAgentQuirks::stringForQuirk):
1001         * platform/glib/UserAgentGLib.cpp:
1002         (WebCore::buildUserAgentString):
1003
1004 2019-07-14  Chris Dumez  <cdumez@apple.com>
1005
1006         Add threading assertion to WeakPtrFactory::createWeakPtr()
1007         https://bugs.webkit.org/show_bug.cgi?id=199639
1008
1009         Reviewed by Ryosuke Niwa.
1010
1011         * platform/ScrollableArea.cpp:
1012         * rendering/RenderObject.cpp:
1013
1014 2019-07-14  Dean Jackson  <dino@apple.com>
1015
1016         WebGL not supported on WKWebView on UIKit for Mac
1017         https://bugs.webkit.org/show_bug.cgi?id=199785
1018         <rdar://problem/52911449>
1019
1020         Reviewed by Antoine Quint.
1021
1022         UIKit for Mac was not creating a CGLPixelFormatObj because
1023         it wasn't using the code hidden in PLATFORM(MAC). Instead
1024         we should be guarding for USE(OPENGL).
1025
1026         There are still some inconsistencies: <rdar://53062794>
1027
1028         Test: webgl/smell-test.html
1029
1030         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1031         (WebCore::GraphicsContext3D::GraphicsContext3D):
1032         (WebCore::GraphicsContext3D::allowOfflineRenderers const): We have to return
1033         true for this, since we don't have access to the Window Server.
1034
1035 2019-07-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1036
1037         [Text autosizing] [iPadOS] Further adjust our heuristics to determine text autosizing candidates
1038         https://bugs.webkit.org/show_bug.cgi?id=199780
1039         <rdar://problem/52289088>
1040
1041         Reviewed by Simon Fraser.
1042
1043         Our current idempotent text autosizing candidate heuristic makes the right judgment call most of the time, but
1044         there is still a large batch of text autosizing bugs left unfixed by the first iteration of the heuristic added
1045         in r246781. This patch attempts to address most of these bugs by adjusting the decision-tree-based heuristic
1046         once again, mostly with improvements to the model generation pipeline.
1047
1048         During the first iteration, I placed emphasis on tuning the max tree depth and min leaf size hyperparameters
1049         when coming up with my decision tree, and didn't consider the inclusion or exclusion of each feature as a
1050         hyperparameters. As such, the trees generated using the pipeline tended to use too many features, and as a
1051         result, tended to have cross-validation overall accuracy scores hovering around 73%.
1052
1053         In this revised model generation pipeline, I now consider the inclusion of each feature (along with max depth
1054         and min leaf size, as before) as a hyperparameter. Since this increases the number of hyperparameters by many
1055         orders of magnitude, a naive grid search (as described in the prior ChangeLog entry) is no longer a tractible
1056         procedure for tuning hyperparameters to the training algorithm.
1057
1058         Instead, I now use a stochastic greedy algorithm to search for good sets of hyperparameters; this process begins
1059         with seeding some number (usually 20-24) of "searchers" with completely randomized sets of hyperparameters (i.e.
1060         random max depth, random leaf size, and random subsets of features). I then evaluate the average performance of
1061         each set of hyperparameters by using them to generate 2000 decision trees over 90% of the training data, and
1062         then cross-validating these trees against the remaining 10%. These cross-validation scores are aggregated into a
1063         single confusion matrix, which is then passed into a loss function that computes a single value indicating how
1064         well training with the set of hyperparameters generalized to cross-validation data. After experimenting with
1065         various loss functions, I settled on the following:
1066
1067         `k(false positive rate)^2 + (false negative rate)^2`
1068
1069         ...where a constant k is chosen to penalize false positives (i.e. broken layout) more harshly than false
1070         negatives (small text). Additionally, squaring the false negative and false positive rates seems to help avoid
1071         converging on solutions that heavily favor reducing only false positives or false negatives, or vice versa.
1072
1073         The stochastic algorithm starts by computing a loss value for the randomly generated configuration. Then, for
1074         an indefinite number of iterations, it randomly mutates the configuration (e.g. by adding or removing features,
1075         or changing min leaf size or max tree depth) and computes a new loss value for the mutated configuration. If the
1076         mutated configuration performs better (i.e. achieves lower loss) than the current configuration, I set the
1077         current configuration to be the mutated configuration. Otherwise, I keep the current (non-mutated) configuration
1078         as-is. The stochastic algorithm then proceeds, ad-infinitum, with this current configuration.
1079
1080         Of course, since each mutation is small, this strategy so far is prone to leaving each searcher stuck in local
1081         optima. To mitigate this, for each searcher, I keep track of a side-table of configurations that have already
1082         been tested; when random mutations would normally lead to testing a configuration that has already been tested,
1083         each searcher instead increases the chance of applying additional mutations. This has the effect of searchers
1084         initially exhausting similar configurations, and expanding to test more and more dissimilar configurations as
1085         the local alternatives all turn out to be worse. This allows searchers to effectively jump out of local optima
1086         after being stuck for a long time.
1087
1088         So, using these strategies, I simultaneously ran a handful of searchers until they all appeared to converge
1089         (a process that takes 8-12 hours on my current dataset). Many of the searchers achieved configurations with
1090         cross-validation scores of 81% and above, up from the 73% of the previous attempt. These additionally have the
1091         added bonus of reducing the number of features, often making the final trees themselves shallower and simpler to
1092         understand than before.
1093
1094         This patch introduces one such decision tree generated using a set of hyperparameters acquired via this
1095         stochasic search algorithm; it appears to simultaneously use fewer features, and achieve better cross-validation
1096         performance.
1097
1098         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
1099
1100         * css/StyleResolver.cpp:
1101         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
1102
1103         Adjust the early return to bail if either (1) the element is a candidate and the computed size is already equal
1104         to the boosted size, or (2) the element is not a candidate and the computed size is already equal to the
1105         specified size. Since the autosizing candidate heuristic depends on styles specified on the element itself (as
1106         opposed to styles on any element in the ancestor chain), a parent may be an autosizing candidate, but a child of
1107         it may not.
1108
1109         * rendering/style/RenderStyle.cpp:
1110         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
1111
1112         Revamp the idempotent text autosizing candidate heuristic. See the explanation above for more details.
1113
1114         * rendering/style/RenderStyle.h:
1115
1116         Remove some bits from RenderStyle's autosizeStatus, now that we care about fewer bits of information from the
1117         inherited flags.
1118
1119         * rendering/style/TextSizeAdjustment.cpp:
1120         (WebCore::AutosizeStatus::updateStatus):
1121         * rendering/style/TextSizeAdjustment.h:
1122
1123 2019-07-13  Simon Fraser  <simon.fraser@apple.com>
1124
1125         Don't do async overflow scrolling for visibility:hidden scrollers
1126         https://bugs.webkit.org/show_bug.cgi?id=199779
1127
1128         Reviewed by Dean Jackson.
1129         
1130         An overflow:scroll with visibility:hidden is not scrollable on macOS, even if it has visible
1131         content. So disable async overflow:scroll when the scroller has non-visible visibility (this also
1132         takes visibility on ancestors into account).
1133         
1134         visibility:hidden overflow:scroll can be common because some JS libraries use it
1135         (https://github.com/wnr/element-resize-detector).
1136
1137         Test: compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html
1138
1139         * rendering/RenderLayer.cpp:
1140         (WebCore::RenderLayer::canUseCompositedScrolling const): Don't use hasVisibleContent() because
1141         that's affected by  visible children.
1142
1143 2019-07-13  Robin Morisset  <rmorisset@apple.com>
1144
1145         [WHLSL] Return statements don't need to keep track of the function they're in
1146         https://bugs.webkit.org/show_bug.cgi?id=199763
1147
1148         Reviewed by Myles C. Maxfield.
1149
1150         Return::m_function is only used in the Checker, and it can easily enough keep track of the current function.
1151         This means we no longer need to keep track of the current function in the NameResolver, and we can save 8 bytes per Return
1152
1153         Since I was touching the NameResolver I also removed a few pointless overrides of Visitor::visit().
1154
1155         No new tests as there is no intended functional change.
1156
1157         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
1158         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1159         (WebCore::WHLSL::Checker::visit):
1160         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
1161         (WebCore::WHLSL::NameResolver::NameResolver):
1162         (WebCore::WHLSL::resolveTypeNamesInFunctions):
1163         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1164
1165 2019-07-13  Andres Gonzalez  <andresg_22@apple.com>
1166
1167         Add accessibility support to WKDataListSuggestionsView.
1168         https://bugs.webkit.org/show_bug.cgi?id=199772
1169         <rdar://problem/47095851>
1170
1171         Reviewed by Chris Fleizach.
1172
1173         Localizable strings for accessibility announcements.
1174
1175         * en.lproj/Localizable.strings:
1176
1177 2019-07-13  Chris Dumez  <cdumez@apple.com>
1178
1179         Drop non thread-safe usage of WeakPtr in VideoFullscreenInterfaceAVKit
1180         https://bugs.webkit.org/show_bug.cgi?id=199775
1181
1182         Reviewed by Eric Carlson.
1183
1184         The VideoFullscreenInterfaceAVKit constructor was making a weakPtr on the UI Thread
1185         of an WebThread object. The WeakPtr would then be used as a data member throughout
1186         the class on the UIThread. This is not thread-safe.
1187
1188         This patch switches to using a raw pointer instead of a WeakPtr. This is a partial
1189         rollout of r243298, which turned the raw pointer into a WeakPtr for hardening
1190         purposes. For extra safety, this patch updates the VideoFullscreenControllerContext
1191         so that it notifies its clients (i.e. PlaybackSessionInterfaceAVKit) that it is
1192         getting destroyed, so that they can null-out their m_videoFullscreenModel &
1193         m_fullscreenChangeObserver data members. This gives the sames guarantees as WeakPtr
1194         but in a thread-safe way.
1195
1196         This is very similar to the fix that was done for PlaybackSessionInterfaceAVKit in
1197         r247380.
1198
1199         * platform/cocoa/VideoFullscreenModel.h:
1200         (WebCore::VideoFullscreenModelClient::modelDestroyed):
1201         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1202         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1203         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
1204         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
1205         (VideoFullscreenInterfaceAVKit::modelDestroyed):
1206         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1207         (VideoFullscreenControllerContext::~VideoFullscreenControllerContext):
1208
1209 2019-07-13  Zalan Bujtas  <zalan@apple.com>
1210
1211         Cannot bring up custom media controls at all on v.youku.com
1212         https://bugs.webkit.org/show_bug.cgi?id=199699
1213         <rdar://problem/51835327>
1214
1215         Reviewed by Simon Fraser.
1216
1217         The "find the node under the finger" heuristic should only find nodes that are visible to hit-testing.
1218
1219         When the user taps on the screen, we run a "find the best node under the finger" heuristic and use the node's location
1220         to dispatch the associated event (e.g. mousePressed).
1221         Ideally the "best node under the finger" and the final target node for the associated event are the same.
1222         However these two methods configure the hit-testing process differently which could lead to node mismatch.
1223         The "best node" heuristic calls hit-testing with AllowChildFrameContent. This flag allows hit-testing to descend into
1224         subframes even if the subframe is not visible to hit-testing (visibility: hidden).
1225         While event dispatching never descends into subfames through hit-testing, but instead it forwards the dispatching to subframes that are visible to hit-testing.
1226
1227         This patch addresses the mismatching node issue by calling the descending version of hit-testing with a flag that enforces visiblity check before descending into a subframe.
1228
1229         Tests: fast/events/touch/ios/visibility-hidden-iframe-click.html
1230                fast/events/touch/ios/visibility-hidden-nested-iframe-click.html
1231
1232         * page/ios/FrameIOS.mm:
1233         (WebCore::Frame::hitTestResultAtViewportLocation):
1234         * rendering/HitTestRequest.h:
1235         (WebCore::HitTestRequest::skipsChildFrameContentInvisibleToHitTest const):
1236         * rendering/RenderWidget.cpp:
1237         (WebCore::RenderWidget::nodeAtPoint):
1238
1239 2019-07-13  Chris Dumez  <cdumez@apple.com>
1240
1241         Fix non thread-safe usage of makeWeakPtr() in MediaPlayerPrivateAVFoundation
1242         https://bugs.webkit.org/show_bug.cgi?id=199777
1243
1244         Reviewed by Eric Carlson.
1245
1246         The code was calling makeWeakPtr() on a main-thread object, from a background thread.
1247         This is not thread safe. To address the issue, this patches creates the WeakPtr ahead
1248         of time, on the main thread.
1249
1250         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1251         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
1252         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
1253         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
1254         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1255
1256 2019-07-12  Thibault Saunier  <tsaunier@igalia.com>
1257
1258         [GStreamer] Mock GStreamer realtime sources should keep a Ref of their mock realtime media sources
1259         https://bugs.webkit.org/show_bug.cgi?id=194326
1260
1261         WrappedMockRealtimeVideoSource is a subclass of RealtimeMediaSource which is refcounted, we can't
1262         use a unique_ptr on those.
1263
1264         Also changed m_wrappedSource type to its actual type so it is cleaner even if needed
1265         to upcast it to RealtimeMediaSource so some method that are made private in the mock
1266         can still be called.
1267
1268         Reviewed by Youenn Fablet.
1269
1270         This fixes MediaStream tests
1271
1272         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
1273         (WebCore::WrappedMockRealtimeAudioSource::create):
1274         (WebCore::WrappedMockRealtimeAudioSource::asRealtimeMediaSource):
1275         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource):
1276         (WebCore::m_wrappedSource):
1277         (WebCore::MockGStreamerAudioCaptureSource::startProducingData):
1278         (WebCore::MockGStreamerAudioCaptureSource::settings):
1279         (WebCore::MockGStreamerAudioCaptureSource::capabilities):
1280         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
1281         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
1282         (WebCore::WrappedMockRealtimeVideoSource::create):
1283         (WebCore::WrappedMockRealtimeVideoSource::asRealtimeMediaSource):
1284         (WebCore::WrappedMockRealtimeVideoSource::WrappedMockRealtimeVideoSource):
1285         (WebCore::m_wrappedSource):
1286         (WebCore::MockGStreamerVideoCaptureSource::settings):
1287         (WebCore::MockGStreamerVideoCaptureSource::capabilities):
1288         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
1289
1290 2019-07-12  Alex Christensen  <achristensen@webkit.org>
1291
1292         Change RELEASE_ASSERT in DocumentWriter::addData to ASSERT and early return
1293         https://bugs.webkit.org/show_bug.cgi?id=199756
1294         <rdar://problem/51554775>
1295
1296         Reviewed by Brady Eidson.
1297
1298         Attempts to reach this assertion were unsuccessful, but sometimes this assertion crashes.
1299         Let's change it to an early return to prevent crashes.
1300
1301         * loader/DocumentWriter.cpp:
1302         (WebCore::DocumentWriter::addData):
1303
1304 2019-07-12  Justin Fan  <justin_fan@apple.com>
1305
1306         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
1307         https://bugs.webkit.org/show_bug.cgi?id=199740
1308
1309         Reviewed by Myles C. Maxfield.
1310
1311         Move error generation into a separate RefCounted class to allow GPU objects to generate 
1312         errors independent of any GPUDevice.
1313         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
1314
1315         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
1316
1317         * Modules/webgpu/WebGPUDevice.cpp:
1318         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
1319         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
1320         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
1321         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
1322         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
1323         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
1324         * Modules/webgpu/WebGPUDevice.h:
1325         (WebCore::WebGPUDevice::pushErrorScope):
1326         * Sources.txt:
1327         * WebCore.xcodeproj/project.pbxproj:
1328         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
1329         * platform/graphics/gpu/GPUDevice.cpp:
1330         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
1331         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
1332         (WebCore::GPUDevice::popErrorScope): Deleted.
1333         (WebCore::GPUDevice::registerError): Deleted.
1334         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
1335         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
1336         (WebCore::GPUErrorGenerator::pushErrorScope):
1337         (WebCore::GPUErrorGenerator::popErrorScope):
1338         (WebCore::GPUErrorGenerator::generateError):
1339         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
1340         (WebCore::GPUErrorGenerator::create):
1341         * platform/graphics/gpu/GPUObjectBase.h: Added.
1342         (WebCore::GPUObjectBase::generateError):
1343         (WebCore::GPUObjectBase::GPUObjectBase):
1344         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
1345         (WebCore::GPUBuffer::validateBufferUsage):
1346         (WebCore::GPUBuffer::tryCreate):
1347         (WebCore::GPUBuffer::GPUBuffer):
1348         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
1349         (WebCore::GPUQueue::submit): Prevent possible null dereference.
1350
1351 2019-07-12  Youenn Fablet  <youenn@apple.com>
1352
1353         Add release logging for quota checks
1354         https://bugs.webkit.org/show_bug.cgi?id=199697
1355
1356         Reviewed by Alex Christensen.
1357
1358         Log whether a request to extend quota is made and the result of the request.
1359         This logging should happen in the networking process.
1360         No change of behavior.
1361
1362         * platform/Logging.h:
1363         * storage/StorageQuotaManager.cpp:
1364         (WebCore::StorageQuotaManager::askForMoreSpace):
1365         (WebCore::StorageQuotaManager::processPendingRequests):
1366
1367 2019-07-12  Youenn Fablet  <youenn@apple.com>
1368
1369         Stopping a cloned MediaStream video track should not stop any other video track
1370         https://bugs.webkit.org/show_bug.cgi?id=199635
1371
1372         Reviewed by Eric Carlson.
1373
1374         In case a track is requesting its source to end, the
1375         RealtimeVideoSource should request its own source to end and not stop it directly.
1376
1377         Also, if a track is removing itself as an observer to a RealtimeVideoSource, we should
1378         stop the underlying source only if this one does not have any other observer.
1379         Covered by updated test.
1380
1381         * platform/mediastream/RealtimeMediaSource.cpp:
1382         (WebCore::RealtimeMediaSource::removeObserver):
1383         * platform/mediastream/RealtimeMediaSource.h:
1384         * platform/mediastream/RealtimeVideoSource.cpp:
1385         (WebCore::RealtimeVideoSource::requestToEnd):
1386         (WebCore::RealtimeVideoSource::stopBeingObserved):
1387         * platform/mediastream/RealtimeVideoSource.h:
1388
1389 2019-07-12  Timothy Hatcher  <timothy@apple.com>
1390
1391         Drop DarkModeCSSEnabled as an experimental feature and always enable it.
1392         https://bugs.webkit.org/show_bug.cgi?id=199725
1393         rdar://problem/52970972
1394
1395         Reviewed by Megan Gardner.
1396
1397         Tests: css-dark-mode
1398
1399         * css/CSSComputedStyleDeclaration.cpp:
1400         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
1401         * css/MediaQueryEvaluator.cpp:
1402         (WebCore::prefersColorSchemeEvaluate):
1403         * css/MediaQueryExpression.cpp:
1404         (WebCore::featureWithValidIdent):
1405         (WebCore::isFeatureValidWithoutValue):
1406         * css/parser/CSSPropertyParser.cpp:
1407         (WebCore::CSSPropertyParser::parseSingleValue):
1408         * html/HTMLMetaElement.cpp:
1409         (WebCore::HTMLMetaElement::process):
1410         * page/RuntimeEnabledFeatures.h:
1411         (WebCore::RuntimeEnabledFeatures::setDarkModeCSSEnabled): Deleted.
1412         (WebCore::RuntimeEnabledFeatures::darkModeCSSEnabled const): Deleted.
1413
1414 2019-07-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1415
1416         Refactor ShadowBlur: remove some class variables and use function parameters instead.
1417         https://bugs.webkit.org/show_bug.cgi?id=199511
1418
1419         Reviewed by Said Abou-Hallawa.
1420
1421         On the ShadowBlur class it is confusing to know if the status of the m_layerImage buffer or the
1422         values calculated by calculateLayerBoundingRect() are valid between the different function calls.
1423
1424         To avoid this problem, pass this values as function parameters instead of storing them in the class.
1425
1426         No new tests, no intended behaviour change.
1427
1428         * platform/graphics/ShadowBlur.cpp:
1429         (WebCore::ShadowBlur::ShadowBlur):
1430         (WebCore::ShadowBlur::calculateLayerBoundingRect):
1431         (WebCore::ShadowBlur::drawShadowBuffer):
1432         (WebCore::ShadowBlur::drawRectShadow): Pass the parameters from the callback.
1433         (WebCore::ShadowBlur::drawInsetShadow): Ditto.
1434         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
1435         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
1436         (WebCore::ShadowBlur::drawRectShadowWithTiling):
1437         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
1438         (WebCore::ShadowBlur::drawLayerPieces):
1439         (WebCore::ShadowBlur::drawLayerPiecesAndFillCenter):
1440         (WebCore::ShadowBlur::blurShadowBuffer):
1441         (WebCore::ShadowBlur::blurAndColorShadowBuffer):
1442         (WebCore::ShadowBlur::drawShadowLayer):
1443         * platform/graphics/ShadowBlur.h: Use a struct to pass the values calculated on calculateLayerBoundingRect().
1444
1445 2019-07-12  Adrian Perez de Castro  <aperez@igalia.com>
1446
1447         [ATK] Avoid unneeded call to to core(selection) in listObjectForSelection()
1448         https://bugs.webkit.org/show_bug.cgi?id=199748
1449         <rdar://problem/52995908>
1450
1451         Reviewed by Konstantin Tokarev.
1452
1453         No new tests needed.
1454
1455         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
1456         (listObjectForCoreSelection): Renamed from listObjectForSelection() and remove the
1457         unneeded call to core() now that coreSelection is passed directly to the function.
1458         (optionFromList): Change to pass coreSelection directly to listObjectForCoreSelection().
1459
1460 2019-07-11  Chris Dumez  <cdumez@apple.com>
1461
1462         Fix non-thread safe use of makeWeakPtr() under MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify()
1463         https://bugs.webkit.org/show_bug.cgi?id=199727
1464
1465         Reviewed by Eric Carlson.
1466
1467         Stop calling makeWeakPtr() on a main thread object from a background thread.
1468
1469         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1470         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
1471
1472 2019-07-11  Youenn Fablet  <youenn@apple.com>
1473
1474         Register a MediaStreamTrack as media producer only if it is a capture track
1475         https://bugs.webkit.org/show_bug.cgi?id=199566
1476         <rdar://problem/52761361>
1477
1478         Addressing post-landing comment to simplify setMuted call.
1479         Unreviewed.
1480
1481         * Modules/mediastream/MediaStreamTrack.cpp:
1482         (WebCore::MediaStreamTrack::MediaStreamTrack):
1483
1484 2019-07-11  Youenn Fablet  <youenn@apple.com>
1485
1486         Protect CoreAudioSharedUnit::m_clients for accessing in different threads simultaneously
1487         https://bugs.webkit.org/show_bug.cgi?id=199717
1488
1489         Reviewed by Eric Carlson.
1490
1491         Add a lock whenever accessing to m_clients.
1492         Manual tests show that audio capture still works.
1493
1494         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1495         (WebCore::CoreAudioSharedUnit::addClient):
1496         (WebCore::CoreAudioSharedUnit::removeClient):
1497         (WebCore::CoreAudioSharedUnit::forEachClient const):
1498         (WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
1499         (WebCore::CoreAudioSharedUnit::captureFailed):
1500
1501 2019-07-11  Chris Dumez  <cdumez@apple.com>
1502
1503         Drop non thread-safe usage of WeakPtr in PlaybackSessionInterfaceAVKit
1504         https://bugs.webkit.org/show_bug.cgi?id=199698
1505
1506         Reviewed by Eric Carlson.
1507
1508         The PlaybackSessionInterfaceAVKit constructor was making a weakPtr on the UI Thread
1509         of an WebThread object. The WeakPtr would then be used as a data member throughout
1510         the class on the UIThread. This is not thread-safe.
1511
1512         This patch switches to using a raw pointer instead of a WeakPtr. This is a partial
1513         rollout of r243337, which turned the raw pointer into a WeakPtr for hardening
1514         purposes. For extra safety, this patch updates the VideoFullscreenControllerContext
1515         so that it notifies its clients (i.e. PlaybackSessionInterfaceAVKit) that it is
1516         getting destroyed, so that they can null-out their m_playbackSessionModel data
1517         member. This gives the sames guarantees than WeakPtr but in a thread-safe way.
1518
1519         * platform/cocoa/PlaybackSessionModel.h:
1520         (WebCore::PlaybackSessionModelClient::modelDestroyed):
1521         * platform/ios/PlaybackSessionInterfaceAVKit.h:
1522         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1523         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
1524         (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
1525         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
1526         (WebCore::PlaybackSessionInterfaceAVKit::modelDestroyed):
1527         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1528         (VideoFullscreenControllerContext::~VideoFullscreenControllerContext):
1529         (VideoFullscreenControllerContext::addClient):
1530         (VideoFullscreenControllerContext::removeClient):
1531
1532 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
1533
1534         Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
1535
1536         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1537         (WebCore::fontWithFamilySpecialCase):
1538
1539 2019-07-11  Justin Fan  <justin_fan@apple.com>
1540
1541         Unreviewed build fix.
1542
1543         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.
1544
1545 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
1546
1547         New York font erroneously gets synthetic bold
1548         https://bugs.webkit.org/show_bug.cgi?id=199653
1549         <rdar://problem/51692592>
1550
1551         Reviewed by Simon Fraser.
1552
1553         This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
1554         and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
1555         to expose these fonts to the web because we don't a standardization story for them
1556         yet, but we do want some apps to be able to use them.
1557
1558         WebKit clients who want to use these fonts can set
1559         -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
1560
1561         The patch generalizes our existing system-ui infrastructure to handle these three
1562         additional fonts. It also explicitly disables the unsupported dot-prefixed names
1563         so they don't leak out into Web content.
1564
1565         Tests: fast/text/design-system-ui-10.html
1566                fast/text/design-system-ui-11.html
1567                fast/text/design-system-ui-12.html
1568                fast/text/design-system-ui-13.html
1569                fast/text/design-system-ui-14.html
1570                fast/text/design-system-ui-15.html
1571                fast/text/design-system-ui-16.html
1572                fast/text/design-system-ui-2.html
1573                fast/text/design-system-ui-3.html
1574                fast/text/design-system-ui-4.html
1575                fast/text/design-system-ui-5.html
1576                fast/text/design-system-ui-6.html
1577                fast/text/design-system-ui-7.html
1578                fast/text/design-system-ui-8.html
1579                fast/text/design-system-ui-9.html
1580                fast/text/design-system-ui.html
1581
1582         * css/CSSFontFace.cpp:
1583         (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
1584         * css/CSSFontFace.h:
1585         * css/CSSFontFaceSource.cpp:
1586         (WebCore::CSSFontFaceSource::load):
1587         * css/StyleResolver.cpp:
1588         (WebCore::StyleResolver::initializeFontStyle):
1589         * page/Settings.yaml:
1590         * platform/graphics/FontDescription.cpp:
1591         (WebCore::m_shouldAllowDesignSystemUIFonts):
1592         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
1593         * platform/graphics/FontDescription.h:
1594         (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
1595         (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
1596         (WebCore::FontDescription::operator== const):
1597         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1598         (WebCore::platformFontLookupWithFamily):
1599         (WebCore::fontWithFamily):
1600         * platform/graphics/cocoa/FontCacheCoreText.h:
1601         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1602         (WebCore::systemFontUse):
1603         (WebCore::systemFontCascadeList):
1604         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
1605         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
1606         (WebCore::isSystemFontString): Deleted.
1607         (WebCore::isUIFontTextStyle): Deleted.
1608         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1609         (WebCore::FontPlatformData::ctFont const):
1610         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1611         (WebCore::SystemFontDatabaseCoreText::createSystemUI):
1612         (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
1613         (WebCore::SystemFontDatabaseCoreText::createTextStyle):
1614         (WebCore::SystemFontDatabaseCoreText::cascadeList):
1615         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
1616         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
1617         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
1618         * platform/graphics/ios/FontCacheIOS.mm:
1619         (WebCore::platformFontWithFamilySpecialCase):
1620         * platform/graphics/mac/FontCacheMac.mm:
1621         (WebCore::platformFontWithFamilySpecialCase):
1622         * style/StyleResolveForDocument.cpp:
1623         (WebCore::Style::resolveForDocument):
1624         * svg/graphics/SVGImage.cpp:
1625         (WebCore::SVGImage::dataChanged):
1626         * testing/InternalSettings.cpp:
1627         (WebCore::InternalSettings::Backup::Backup):
1628         (WebCore::InternalSettings::Backup::restoreTo):
1629         (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
1630         * testing/InternalSettings.h:
1631         * testing/InternalSettings.idl:
1632
1633 2019-07-11  Pablo Saavedra  <psaavedra@igalia.com>
1634
1635         [WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF
1636         https://bugs.webkit.org/show_bug.cgi?id=199625
1637
1638         Added ENABLE(ACCESSIBILITY) and replaced HAVE(ACCESSIBILITY)
1639         with ENABLE(ACCESSIBILITY) in the code.
1640
1641         Additionally, the TestRunner code generator now honors the
1642         Conditional IDL format.
1643
1644         No new tests as there is no intended functional change
1645
1646         Reviewed by Konstantin Tokarev.
1647
1648         * accessibility/AXObjectCache.cpp:
1649         * accessibility/AXObjectCache.h:
1650         * accessibility/AccessibilityObject.cpp:
1651         (WebCore::AccessibilityObject::detach):
1652         (WebCore::AccessibilityObject::isDetached const):
1653         * accessibility/AccessibilityObject.h:
1654         * accessibility/atk/AXObjectCacheAtk.cpp:
1655         * accessibility/atk/AccessibilityObjectAtk.cpp:
1656         * accessibility/atk/WebKitAccessible.cpp:
1657         * accessibility/atk/WebKitAccessible.h:
1658         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1659         * accessibility/atk/WebKitAccessibleHyperlink.h:
1660         * accessibility/atk/WebKitAccessibleInterfaceAction.cpp:
1661         * accessibility/atk/WebKitAccessibleInterfaceAction.h:
1662         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
1663         * accessibility/atk/WebKitAccessibleInterfaceComponent.h:
1664         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
1665         * accessibility/atk/WebKitAccessibleInterfaceDocument.h:
1666         * accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp:
1667         * accessibility/atk/WebKitAccessibleInterfaceEditableText.h:
1668         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
1669         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.h:
1670         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
1671         * accessibility/atk/WebKitAccessibleInterfaceHypertext.h:
1672         * accessibility/atk/WebKitAccessibleInterfaceImage.cpp:
1673         * accessibility/atk/WebKitAccessibleInterfaceImage.h:
1674         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
1675         * accessibility/atk/WebKitAccessibleInterfaceSelection.h:
1676         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1677         * accessibility/atk/WebKitAccessibleInterfaceTable.h:
1678         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
1679         * accessibility/atk/WebKitAccessibleInterfaceTableCell.h:
1680         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1681         * accessibility/atk/WebKitAccessibleInterfaceText.h:
1682         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
1683         * accessibility/atk/WebKitAccessibleInterfaceValue.h:
1684         * accessibility/atk/WebKitAccessibleUtil.cpp:
1685         * accessibility/atk/WebKitAccessibleUtil.h:
1686         * accessibility/ios/AXObjectCacheIOS.mm:
1687         * accessibility/ios/AccessibilityObjectIOS.mm:
1688         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
1689         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1690         * accessibility/mac/AXObjectCacheMac.mm:
1691         * accessibility/mac/AccessibilityObjectBase.mm:
1692         * accessibility/mac/AccessibilityObjectMac.mm:
1693         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1694         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1695         * accessibility/win/AccessibilityObjectWin.cpp:
1696         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
1697         * dom/Document.cpp:
1698         (WebCore::Document::prepareForDestruction):
1699         * editing/FrameSelection.h:
1700         * editing/atk/FrameSelectionAtk.cpp:
1701         * html/HTMLTextFormControlElement.cpp:
1702         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
1703         * testing/Internals.cpp:
1704         (WebCore::Internals::resetToConsistentState):
1705
1706 2019-07-11  Justin Fan  <justin_fan@apple.com>
1707
1708         [WebGPU] Implement GPUError and error scopes
1709         https://bugs.webkit.org/show_bug.cgi?id=199655
1710
1711         Reviewed by Myles C. Maxfield.
1712
1713         Add GPUErrorFilter, GPUError, and the ability to push and pop error scopes on a GPUDevice.
1714         This will allow us to check for WebGPU errors from JavaScript.
1715         Currently, only some GPUBuffer creation errors are reported for testing; more errors will follow in later patches.
1716
1717         Test: webgpu/error-scopes-test.html
1718
1719         * Modules/webgpu/GPUErrorFilter.idl: Added.
1720         * Modules/webgpu/GPUOutOfMemoryError.idl: Added.
1721         * Modules/webgpu/GPUValidationError.idl: Added.
1722         * Modules/webgpu/WebGPUDevice.cpp:
1723         (WebCore::WebGPUDevice::pushErrorScope):
1724         (WebCore::WebGPUDevice::popErrorScope): Resolve the Promise here, since GPUDevice shouldn't worry about DOM layer.
1725         * Modules/webgpu/WebGPUDevice.h:
1726         * Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Added.
1727         (WebCore::WebGPUDeviceErrorScopes::pushErrorScope): Delegates to WebGPUDevice.
1728         (WebCore::WebGPUDeviceErrorScopes::popErrorScope): Ditto.
1729         * Modules/webgpu/WebGPUDeviceErrorScopes.h: Added.
1730         * Modules/webgpu/WebGPUDeviceErrorScopes.idl: Added.
1731         * platform/graphics/gpu/GPUBuffer.h:
1732         * platform/graphics/gpu/GPUDevice.cpp: The actual error stack lives here.
1733         (WebCore::GPUDevice::pushErrorScope):
1734         (WebCore::GPUDevice::popErrorScope): Calls a callback with a GPUError, if any.
1735         (WebCore::GPUDevice::registerError): Actually creates GPUErrors.
1736         * platform/graphics/gpu/GPUDevice.h:
1737         * platform/graphics/gpu/GPUError.cpp: Added.
1738         (WebCore::createError): Factory function for various error types.
1739         * platform/graphics/gpu/GPUError.h: Added.
1740         * platform/graphics/gpu/GPUErrorFilter.h: Added.
1741         * platform/graphics/gpu/GPUOutOfMemoryError.h: Added.
1742         (WebCore::GPUOutOfMemoryError::create):
1743         * platform/graphics/gpu/GPUValidationError.cpp: Added.
1744         (WebCore::GPUValidationError::create):
1745         (WebCore::GPUValidationError::GPUValidationError):
1746         * platform/graphics/gpu/GPUValidationError.h: Added.
1747         (WebCore::GPUValidationError::message const):
1748         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1749         (WebCore::GPUBuffer::validateBufferUsage): Create an actual GPUValidationError :)
1750         (WebCore::GPUBuffer::tryCreate): Create GPUOutOfMemoryErrors where appropriate.
1751
1752         Add file/name references:
1753         * CMakeLists.txt:
1754         * DerivedSources-input.xcfilelist:
1755         * DerivedSources-output.xcfilelist:
1756         * DerivedSources.make:
1757         * Sources.txt:
1758         * WebCore.xcodeproj/project.pbxproj:
1759         * bindings/js/WebCoreBuiltinNames.h:
1760
1761         Missing includes:
1762         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
1763
1764 2019-07-11  Tim Horton  <timothy_horton@apple.com>
1765
1766         Null deref of RenderView under FrameView::setNeedsCompositingConfigurationUpdate
1767         https://bugs.webkit.org/show_bug.cgi?id=199723
1768         <rdar://problem/51554747>
1769
1770         Reviewed by Simon Fraser.
1771
1772         * page/FrameView.cpp:
1773         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
1774         Add a null-check; it looks like it is possible to get here by dismissing
1775         the find overlay (or other page overlay) at an inopportune time.
1776
1777 2019-07-11  Chris Dumez  <cdumez@apple.com>
1778
1779         Pages using Google Tag Manager Google's anti-flicker optimization may take ~5 seconds to do initial paint
1780         https://bugs.webkit.org/show_bug.cgi?id=199704
1781         <rdar://problem/52966461>
1782
1783         Reviewed by Geoffrey Garen.
1784
1785         Apply the same fix as r246764 for when "https://www.googletagmanager.com/gtm.js" load is blocked by a content
1786         extension to avoid delaying initial paint by ~5 seconds. This was tested on https://www.formula1.com/en.html.
1787
1788         * contentextensions/ContentExtensionsBackend.cpp:
1789         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
1790
1791 2019-07-11  Chris Dumez  <cdumez@apple.com>
1792
1793         Disable RGB10 IOSurface pixel format for Mac Catalyst
1794         https://bugs.webkit.org/show_bug.cgi?id=199712
1795         <rdar://problem/52793584>
1796
1797         Reviewed by Beth Dakin.
1798
1799         Disable RGB10 IOSurface pixel format for Mac Catalyst. This format is not supported
1800         on Mac Catalyst and causes us not to render anything.
1801
1802         * platform/graphics/cocoa/IOSurface.h:
1803
1804 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
1805
1806         [iOS WK2] Can't place caret or select in content that overflows a contenteditable element
1807         https://bugs.webkit.org/show_bug.cgi?id=199741
1808         rdar://problem/50545233
1809
1810         Reviewed by Wenson Hsieh.
1811
1812         Various code paths for editing used renderer->absoluteBoundingBoxRect(), which is the border
1813         box of the element (or a set of line boxes for inline elements) converted to absolute
1814         coordinates. This excludes overflow content, but contenteditable needs to be able to
1815         place the caret in overflow content, and allow selection rects to be in the overflow area
1816         (if the element has visible overflow).
1817
1818         Try to clean this up by adding some static helpers on WebPage for accessing the relevant
1819         rects, and use them in code call from visiblePositionInFocusedNodeForPoint(), and
1820         code that is input to selectionClipRect.
1821         
1822         This changes selectionClipRect to use the padding box (excluding borders), which is a progression.
1823
1824         Tests: editing/caret/ios/caret-in-overflow-area.html
1825                editing/selection/ios/place-selection-in-overflow-area.html
1826                editing/selection/ios/selection-extends-into-overflow-area.html
1827
1828         * editing/FrameSelection.cpp:
1829         (WebCore::DragCaretController::editableElementRectInRootViewCoordinates const):
1830
1831 2019-07-11  Jonathan Bedard  <jbedard@apple.com>
1832
1833         [iOS 13] Enable WebKit build
1834         https://bugs.webkit.org/show_bug.cgi?id=199481
1835         <rdar://problem/52619048>
1836
1837         Reviewed by Tim Horton.
1838
1839         No new tests, iOS 13 test expectations will be migrated in the near future.
1840
1841         * platform/ios/LocalCurrentTraitCollection.mm:
1842         (WebCore::LocalCurrentTraitCollection::LocalCurrentTraitCollection): Remove underscore from currentTraitCollection.
1843         (WebCore::LocalCurrentTraitCollection::~LocalCurrentTraitCollection): Remove underscore from setCurrentTraitCollection.
1844
1845 2019-07-11  Chris Dumez  <cdumez@apple.com>
1846
1847         Fix non thread-safe usage of makeWeakPtr() in MediaPlayerPrivateMediaFoundation
1848         https://bugs.webkit.org/show_bug.cgi?id=199700
1849
1850         Reviewed by Eric Carlson.
1851
1852         The code was calling makeWeakPtr() on a main-thread object, from a background thread.
1853         This is not thread safe. To address the issue, this patches creates the WeakPtr ahead
1854         of time, on the main thread. 
1855
1856         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1857         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
1858         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
1859         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
1860         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
1861         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1862         (WebCore::MediaPlayerPrivateMediaFoundation::ThreadSafeWrapper::create):
1863         (WebCore::MediaPlayerPrivateMediaFoundation::ThreadSafeWrapper::wrapped):
1864         (WebCore::MediaPlayerPrivateMediaFoundation::ThreadSafeWrapper::ThreadSafeWrapper):
1865
1866 2019-07-11  Zalan Bujtas  <zalan@apple.com>
1867
1868         [LFC][IFC] Cleanup InlineFormattingContext::LineLayout class.
1869         https://bugs.webkit.org/show_bug.cgi?id=199702
1870         <rdar://problem/52931733>
1871
1872         Reviewed by Sam Weinig.
1873
1874         Move some structs to .cpp. They don't need to pollute the class declaration. 
1875
1876         * layout/inlineformatting/InlineFormattingContext.h:
1877         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const):
1878         (): Deleted.
1879         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1880         (WebCore::Layout::LineInput::HorizontalConstraint::HorizontalConstraint):
1881         (WebCore::Layout::LineInput::LineInput):
1882         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
1883         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::HorizontalConstraint::HorizontalConstraint): Deleted.
1884         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput): Deleted.
1885
1886 2019-07-11  Joanmarie Diggs  <jdiggs@igalia.com>
1887
1888         AX: Implement support for ARIA roles insertion, deletion, subscript, superscript, and time
1889         https://bugs.webkit.org/show_bug.cgi?id=199692
1890
1891         Reviewed by Chris Fleizach.
1892
1893         Create new AccessibilityRole types which correspond to the new ARIA roles and
1894         update AccessibilityRenderObject::determineAccessibilityRole() to assign these
1895         internal roles to the related HTML elements.
1896
1897         Update both ATK and Mac to recognize these new internal roles. In addition, update
1898         the ATK mappings for the ins and del elements to ATK_ROLE_CONTENT_INSERTION and
1899         ATK_ROLE_CONTENT_DELETION respectively. Also expose "insertion" and "deletion" via
1900         the AtkObject xml-roles attribute so that this information is not completely absent
1901         for GTK or WPE built against earlier versions of ATK.
1902
1903         Remove AccessibilityObject's isSubscriptStyleGroup() and isSuperscriptStyleGroup().
1904         These two methods were only being used by ATK and are no longer needed for platform
1905         role mapping.
1906
1907         No new tests. Instead add the roles to the existing role-exposure tests.
1908
1909         * accessibility/AccessibilityObject.cpp:
1910         (WebCore::initializeRoleMap):
1911         (WebCore::AccessibilityObject::isSubscriptStyleGroup const): Deleted.
1912         (WebCore::AccessibilityObject::isSuperscriptStyleGroup const): Deleted.
1913         * accessibility/AccessibilityObject.h:
1914         * accessibility/AccessibilityObjectInterface.h:
1915         * accessibility/AccessibilityRenderObject.cpp:
1916         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1917         * accessibility/atk/WebKitAccessible.cpp:
1918         (webkitAccessibleGetAttributes):
1919         (atkRole):
1920         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1921         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1922         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1923         (createAccessibilityRoleMap):
1924         (-[WebAccessibilityObjectWrapper subrole]):
1925
1926 2019-07-11  Thibault Saunier  <tsaunier@igalia.com>
1927
1928         [GStreamer][MediaStream] Use the new dispatchMediaSampleToObservers to dispatch new buffers
1929         https://bugs.webkit.org/show_bug.cgi?id=199689
1930
1931         Reviewed by Philippe Normand.
1932
1933         We already have tests for this.
1934
1935         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1936         (WebCore::GStreamerVideoCaptureSource::processNewFrame):
1937         (WebCore::GStreamerVideoCaptureSource::newSampleCallback):
1938         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
1939
1940 2019-07-10  Simon Fraser  <simon.fraser@apple.com>
1941
1942         [iOS WK2] With modal overlay and body overflow:hidden, can't access all the content
1943         https://bugs.webkit.org/show_bug.cgi?id=199693
1944         rdar://problem/51930364
1945
1946         Reviewed by Tim Horton.
1947
1948         A page with overflow:hidden on the root needs to be scrollable if:
1949         * it's zoomed
1950         * the visual viewport is smaller than the layout viewport (including visible keyboard)
1951         * scrolling is required to hide MobileSafari's squishy bars
1952
1953         This patch does the last two, plumbing a "visual viewport is smaller than layout viewport"
1954         bit up from WebCore via the scrolling tree (that way, when it changes we automatically trigger
1955         a commit), and checking for squished bars in WKWebView.
1956
1957         Tested by new API tests.
1958
1959         * page/FrameView.cpp:
1960         (WebCore::FrameView::updateLayoutViewport):
1961         (WebCore::FrameView::layoutOrVisualViewportChanged): Make this not iOS-specific. It's not yet called
1962         in all the right places (doing so has risk because it's exposed via VisualViewport resize events).
1963         (WebCore::FrameView::didUpdateViewportOverrideRects): Deleted.
1964         * page/FrameView.h:
1965         * page/scrolling/AsyncScrollingCoordinator.cpp:
1966         (WebCore::AsyncScrollingCoordinator::frameViewVisualViewportChanged):
1967         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
1968         * page/scrolling/AsyncScrollingCoordinator.h:
1969         * page/scrolling/ScrollingCoordinator.h:
1970         (WebCore::ScrollingCoordinator::frameViewVisualViewportChanged):
1971         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1972         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1973         (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
1974         (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportIsSmallerThanLayoutViewport):
1975         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
1976         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1977         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1978         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
1979         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
1980         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1981
1982 2019-07-10  Robin Morisset  <rmorisset@apple.com>
1983
1984         [WHLSL] Optional<UniqueRef<T>> -> std::unique_ptr in Return/IfStatement/ForLoop
1985         https://bugs.webkit.org/show_bug.cgi?id=199695
1986
1987         Reviewed by Dean Jackson.
1988
1989         Trivial patch that saves 8 bytes per Return/If, and 16 bytes per For loop.
1990
1991         No new tests as there is no intended functional change.
1992
1993         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
1994         (WebCore::WHLSL::AST::ForLoop::ForLoop):
1995         (WebCore::WHLSL::AST::ForLoop::condition):
1996         (WebCore::WHLSL::AST::ForLoop::increment):
1997         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
1998         (WebCore::WHLSL::AST::IfStatement::IfStatement):
1999         (WebCore::WHLSL::AST::IfStatement::elseBody):
2000         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
2001         (WebCore::WHLSL::AST::Return::Return):
2002         (WebCore::WHLSL::AST::Return::value):
2003         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2004         (WebCore::WHLSL::Parser::parseIfStatement):
2005         (WebCore::WHLSL::Parser::parseForLoop):
2006         (WebCore::WHLSL::Parser::parseStatement):
2007
2008 2019-07-10  Robin Morisset  <rmorisset@apple.com>
2009
2010         [WHLSL] The recursion checker should not have quadratic complexity
2011         https://bugs.webkit.org/show_bug.cgi?id=199688
2012
2013         Reviewed by Saam Barati.
2014
2015         I fix it by using two different hash sets, tracking which functions we have started visiting, and which we have finished visiting.
2016         The difference are those that are currently "on the stack", and calling any of those is an error.
2017         As a bonus, I also overrode visit(Program&), so that we only bother visiting function definitions.
2018
2019         On whlsl-compute.html ran 5 times, this patch reduces the time spent in the recursion checker from 26ms to 12ms.
2020         It is likely to be a much bigger win on larger programs (since it took the complexity from quadratic to linear).
2021
2022         No new tests as there is no intended functional change.
2023
2024         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
2025
2026 2019-07-10  Sihui Liu  <sihui_liu@apple.com>
2027
2028         Crash at WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator
2029         https://bugs.webkit.org/show_bug.cgi?id=199677
2030         <rdar://problem/52334665>
2031
2032         Reviewed by Alex Christensen.
2033
2034         Add an early return in incrementReverseIterator when setFirstInRemainingRange fails to set m_iterator. This is 
2035         in line with what we did in incrementForwardIterator.
2036
2037         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2038         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
2039
2040 2019-07-10  Chris Dumez  <cdumez@apple.com>
2041
2042         Stop using GenericTaskQueue from multiple threads
2043         https://bugs.webkit.org/show_bug.cgi?id=199652
2044
2045         Reviewed by Eric Carlson and Geoffrey Garen.
2046
2047         WebCoreAVFLoaderDelegate was calling GenericTaskQueue::enqueueTask() from a background thread,
2048         which is not safe because the implementation of enqueueTask() calls makeWeakPtr() on the
2049         GenericTaskQueue (a main thread object).
2050
2051         Update WebCoreAVFLoaderDelegate to make sure it is on the main thread before it calls
2052         GenericTaskQueue::enqueueTask().
2053
2054         * platform/GenericTaskQueue.h:
2055         Remove last template parameter which was used exclusively by WebCoreAVFLoaderDelegate to try and
2056         make GenericTaskQueue thread-safe.
2057
2058         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2059         (-[WebCoreAVFMovieObserver metadataLoaded]):
2060         (-[WebCoreAVFMovieObserver didEnd:]):
2061         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2062         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
2063         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
2064         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
2065         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
2066
2067 2019-07-10  Chris Fleizach  <cfleizach@apple.com>
2068
2069         AX: VoiceOver ignored role="presentation" on <table> HTML elements
2070         https://bugs.webkit.org/show_bug.cgi?id=199659
2071
2072         Reviewed by Zalan Bujtas.
2073
2074         Only include a table ancestor if it's a table we care about for accessibility.
2075
2076         Modified Test: accessibility/ios-simulator/tables-lists.html
2077
2078         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2079         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
2080
2081 2019-07-10  Robin Morisset  <rmorisset@apple.com>
2082
2083         [WHLSL] Track code locations correctly throughout the compiler to get good error messages
2084         https://bugs.webkit.org/show_bug.cgi?id=199675
2085
2086         Reviewed by Myles Maxfield.
2087
2088         The basic idea is to go from having each AST node contain its own token to having each AST node contain a pair of offsets into the source,
2089         the offset before its start and the offset after its end. This will let us get good error messages.
2090         As a bonus, it saves a bit of memory as Tokens are larger (one extra word for their type).
2091
2092         The new CodeLocation class is put in Lexer.h, because it has a cyclic dependency on Token, which also has a cyclic dependency on Lexer.
2093
2094         No new tests as there is no intended functional change.
2095
2096         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
2097         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
2098         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
2099         (WebCore::WHLSL::AST::ArrayType::ArrayType):
2100         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
2101         (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
2102         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
2103         (WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
2104         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
2105         (WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
2106         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
2107         (WebCore::WHLSL::AST::Block::Block):
2108         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
2109         (WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
2110         (WebCore::WHLSL::AST::BooleanLiteral::clone const):
2111         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
2112         (WebCore::WHLSL::AST::Break::Break):
2113         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
2114         (WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
2115         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
2116         (WebCore::WHLSL::AST::CallExpression::CallExpression):
2117         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
2118         (WebCore::WHLSL::AST::CommaExpression::CommaExpression):
2119         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
2120         (WebCore::WHLSL::AST::Continue::Continue):
2121         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
2122         (WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
2123         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
2124         (WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
2125         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
2126         (WebCore::WHLSL::AST::DotExpression::DotExpression):
2127         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
2128         (WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
2129         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
2130         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
2131         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
2132         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
2133         (WebCore::WHLSL::AST::EnumerationMember::codeLocation const):
2134         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
2135         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
2136         (WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
2137         (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
2138         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2139         (WebCore::WHLSL::AST::Expression::Expression):
2140         (WebCore::WHLSL::AST::Expression::codeLocation const):
2141         (WebCore::WHLSL::AST::Expression::updateCodeLocation):
2142         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
2143         (WebCore::WHLSL::AST::Fallthrough::Fallthrough):
2144         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
2145         (WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
2146         (WebCore::WHLSL::AST::FloatLiteral::clone const):
2147         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
2148         (WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
2149         (WebCore::WHLSL::AST::FloatLiteralType::clone const):
2150         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
2151         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
2152         (WebCore::WHLSL::AST::ForLoop::ForLoop):
2153         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
2154         (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
2155         (WebCore::WHLSL::AST::FunctionDeclaration::codeLocation const):
2156         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
2157         (WebCore::WHLSL::AST::GlobalVariableReference::GlobalVariableReference):
2158         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
2159         (WebCore::WHLSL::AST::IfStatement::IfStatement):
2160         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
2161         (WebCore::WHLSL::AST::IndexExpression::IndexExpression):
2162         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
2163         (WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
2164         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
2165         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
2166         (WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
2167         (WebCore::WHLSL::AST::IntegerLiteralType::clone const):
2168         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
2169         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
2170         (WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
2171         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
2172         (WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
2173         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
2174         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
2175         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
2176         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
2177         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
2178         (WebCore::WHLSL::AST::NamedType::NamedType):
2179         (WebCore::WHLSL::AST::NamedType::codeLocation const):
2180         (WebCore::WHLSL::AST::NamedType::updateCodeLocation):
2181         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
2182         (WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
2183         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
2184         (WebCore::WHLSL::AST::NullLiteral::NullLiteral):
2185         (WebCore::WHLSL::AST::NullLiteral::clone const):
2186         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
2187         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
2188         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
2189         (WebCore::WHLSL::AST::PointerType::PointerType):
2190         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
2191         (WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
2192         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
2193         (WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
2194         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
2195         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2196         (WebCore::WHLSL::AST::ReferenceType::ReferenceType):
2197         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
2198         (WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
2199         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
2200         (WebCore::WHLSL::AST::Return::Return):
2201         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
2202         (WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
2203         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
2204         (WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
2205         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
2206         (WebCore::WHLSL::AST::Statement::Statement):
2207         (WebCore::WHLSL::AST::Statement::codeLocation const):
2208         (WebCore::WHLSL::AST::Statement::updateCodeLocation):
2209         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
2210         (WebCore::WHLSL::AST::StatementList::StatementList):
2211         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
2212         (WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
2213         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
2214         (WebCore::WHLSL::AST::StructureElement::StructureElement):
2215         (WebCore::WHLSL::AST::StructureElement::codeLocation const):
2216         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
2217         (WebCore::WHLSL::AST::SwitchCase::SwitchCase):
2218         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
2219         (WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
2220         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
2221         (WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
2222         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h:
2223         (WebCore::WHLSL::AST::Trap::Trap):
2224         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
2225         (WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
2226         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
2227         (WebCore::WHLSL::AST::TypeReference::wrap):
2228         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
2229         (WebCore::WHLSL::AST::TypeReference::TypeReference):
2230         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
2231         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
2232         (WebCore::WHLSL::AST::UnnamedType::UnnamedType):
2233         (WebCore::WHLSL::AST::UnnamedType::codeLocation const):
2234         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
2235         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
2236         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
2237         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
2238         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
2239         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
2240         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
2241         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
2242         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
2243         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
2244         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
2245         (WebCore::WHLSL::AST::VariableReference::VariableReference):
2246         (WebCore::WHLSL::AST::VariableReference::wrap):
2247         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
2248         (WebCore::WHLSL::AST::WhileLoop::WhileLoop):
2249         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
2250         (WebCore::WHLSL::AutoInitialize::visit):
2251         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2252         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
2253         (WebCore::WHLSL::resolveWithOperatorLength):
2254         (WebCore::WHLSL::resolveWithReferenceComparator):
2255         (WebCore::WHLSL::resolveByInstantiation):
2256         (WebCore::WHLSL::resolveFunction):
2257         (WebCore::WHLSL::Checker::visit):
2258         (WebCore::WHLSL::argumentTypeForAndOverload):
2259         (WebCore::WHLSL::Checker::finishVisiting):
2260         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
2261         (WebCore::WHLSL::matchAndCommit):
2262         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
2263         (WebCore::WHLSL::Token::typeName):
2264         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
2265         * Modules/webgpu/WHLSL/WHLSLLexer.h:
2266         (WebCore::WHLSL::AST::CodeLocation::CodeLocation):
2267         (WebCore::WHLSL::AST::CodeLocation::startOffset const):
2268         (WebCore::WHLSL::AST::CodeLocation::endOffset const):
2269         (WebCore::WHLSL::Token::startOffset const):
2270         (WebCore::WHLSL::Lexer::errorString):
2271         (WebCore::WHLSL::Token::stringView const):
2272         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2273         (WebCore::WHLSL::NameResolver::visit):
2274         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2275         (WebCore::WHLSL::Parser::parse):
2276         (WebCore::WHLSL::Parser::peek):
2277         (WebCore::WHLSL::Parser::peekFurther):
2278         (WebCore::WHLSL::Types::includes):
2279         (WebCore::WHLSL::Types::appendNameTo):
2280         (WebCore::WHLSL::Types<t>::includes):
2281         (WebCore::WHLSL::Types<t>::appendNameTo):
2282         (WebCore::WHLSL::Parser::peekType):
2283         (WebCore::WHLSL::Parser::tryType):
2284         (WebCore::WHLSL::Parser::tryTypes):
2285         (WebCore::WHLSL::Parser::consumeType):
2286         (WebCore::WHLSL::Parser::consumeTypes):
2287         (WebCore::WHLSL::Parser::consumeIntegralLiteral):
2288         (WebCore::WHLSL::Parser::parseConstantExpression):
2289         (WebCore::WHLSL::Parser::parseTypeArgument):
2290         (WebCore::WHLSL::Parser::parseTypeArguments):
2291         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
2292         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
2293         (WebCore::WHLSL::Parser::parseType):
2294         (WebCore::WHLSL::Parser::parseTypeDefinition):
2295         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
2296         (WebCore::WHLSL::Parser::parseResourceSemantic):
2297         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
2298         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
2299         (WebCore::WHLSL::Parser::parseSemantic):
2300         (WebCore::WHLSL::Parser::parseQualifiers):
2301         (WebCore::WHLSL::Parser::parseStructureElement):
2302         (WebCore::WHLSL::Parser::parseStructureDefinition):
2303         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
2304         (WebCore::WHLSL::Parser::parseEnumerationMember):
2305         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
2306         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
2307         (WebCore::WHLSL::Parser::parseAttributeBlock):
2308         (WebCore::WHLSL::Parser::parseParameter):
2309         (WebCore::WHLSL::Parser::parseParameters):
2310         (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
2311         (WebCore::WHLSL::Parser::parseVertexOrFragmentFunctionDeclaration):
2312         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
2313         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
2314         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
2315         (WebCore::WHLSL::Parser::parseBlock):
2316         (WebCore::WHLSL::Parser::parseBlockBody):
2317         (WebCore::WHLSL::Parser::parseIfStatement):
2318         (WebCore::WHLSL::Parser::parseSwitchStatement):
2319         (WebCore::WHLSL::Parser::parseSwitchCase):
2320         (WebCore::WHLSL::Parser::parseForLoop):
2321         (WebCore::WHLSL::Parser::parseWhileLoop):
2322         (WebCore::WHLSL::Parser::parseDoWhileLoop):
2323         (WebCore::WHLSL::Parser::parseVariableDeclaration):
2324         (WebCore::WHLSL::Parser::parseVariableDeclarations):
2325         (WebCore::WHLSL::Parser::parseStatement):
2326         (WebCore::WHLSL::Parser::parseEffectfulExpression):
2327         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
2328         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
2329         (WebCore::WHLSL::Parser::parseSuffixOperator):
2330         (WebCore::WHLSL::Parser::parseExpression):
2331         (WebCore::WHLSL::Parser::completeTernaryConditional):
2332         (WebCore::WHLSL::Parser::completeAssignment):
2333         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
2334         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
2335         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
2336         (WebCore::WHLSL::Parser::completePossibleShift):
2337         (WebCore::WHLSL::Parser::completePossibleAdd):
2338         (WebCore::WHLSL::Parser::completePossibleMultiply):
2339         (WebCore::WHLSL::Parser::parsePossiblePrefix):
2340         (WebCore::WHLSL::Parser::parsePossibleSuffix):
2341         (WebCore::WHLSL::Parser::parseCallExpression):
2342         (WebCore::WHLSL::Parser::parseTerm):
2343         * Modules/webgpu/WHLSL/WHLSLParser.h:
2344         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
2345         (WebCore::WHLSL::anonymousToken):
2346         (WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
2347         (WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
2348         (WebCore::WHLSL::preserveVariableLifetimes):
2349         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2350         (WebCore::WHLSL::PropertyResolver::visit):
2351         (WebCore::WHLSL::wrapAnderCallArgument):
2352         (WebCore::WHLSL::setterCall):
2353         (WebCore::WHLSL::getterCall):
2354         (WebCore::WHLSL::modify):
2355         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
2356         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
2357         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
2358         (WebCore::WHLSL::synthesizeArrayOperatorLength):
2359         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
2360         (WebCore::WHLSL::synthesizeConstructors):
2361         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
2362         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2363         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
2364         (WebCore::WHLSL::synthesizeStructureAccessors):
2365
2366 2019-07-10  Ryosuke Niwa  <rniwa@webkit.org>
2367
2368         [iOS] REGRESSION(r244851): Revealing caret sometimes fails when content inset is used
2369         https://bugs.webkit.org/show_bug.cgi?id=199662
2370
2371         Reviewed by Simon Fraser.
2372
2373         The bug was caused by ScrollableArea::maximumScrollPosition using ScrollableArea::visibleSize, which does not
2374         take the content insets into account correctly, rather than FrameView::visualViewportRectExpandedByContentInsets,
2375         which does, and is used for "viewRect" in RenderLayer::scrollRectToVisible.
2376
2377         Override the maximum scroll position using visualViewportRectExpandedByContentInsets in iOS to fix the issue.
2378
2379         Test: editing/selection/ios/autoscroll-with-top-content-inset-2.html
2380
2381         * rendering/RenderLayer.cpp:
2382         (WebCore::RenderLayer::scrollRectToVisible): Fixed the bug.
2383
2384 2019-07-10  Ryan Haddad  <ryanhaddad@apple.com>
2385
2386         Unreviewed, rolling out r247316.
2387
2388         Broke Mojave build
2389
2390         Reverted changeset:
2391
2392         "[WHLSL] Track code locations correctly throughout the
2393         compiler to get good error messages"
2394         https://bugs.webkit.org/show_bug.cgi?id=199675
2395         https://trac.webkit.org/changeset/247316
2396
2397 2019-07-10  Alex Christensen  <achristensen@webkit.org>
2398
2399         Allow CMake to build WebCore on Mac
2400         https://bugs.webkit.org/show_bug.cgi?id=198979
2401
2402         Reviewed by Don Olmstead.
2403
2404         * Modules/websockets/ThreadableWebSocketChannel.cpp:
2405         (WebCore::ThreadableWebSocketChannel::validateURL):
2406         * PlatformMac.cmake:
2407         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
2408         * platform/ios/WebItemProviderPasteboard.h:
2409
2410 2019-07-10  Chris Dumez  <cdumez@apple.com>
2411
2412         Unreviewed, rolling out r247292.
2413
2414         Caused CloseWebViewDuringEnterFullscreen.VideoFullscreen API
2415         test to time out on Mojave bots
2416
2417         Reverted changeset:
2418
2419         "Stop using GenericTaskQueue from multiple threads"
2420         https://bugs.webkit.org/show_bug.cgi?id=199652
2421         https://trac.webkit.org/changeset/247292
2422
2423 2019-07-10  Robin Morisset  <rmorisset@apple.com>
2424
2425         [WHLSL] Track code locations correctly throughout the compiler to get good error messages
2426         https://bugs.webkit.org/show_bug.cgi?id=199675
2427
2428         Reviewed by Myles Maxfield.
2429
2430         The basic idea is to go from having each AST node contain its own token to having each AST node contain a pair of offsets into the source,
2431         the offset before its start and the offset after its end. This will let us get good error messages.
2432         As a bonus, it saves a bit of memory as Tokens are larger (one extra word for their type).
2433
2434         The new CodeLocation class is put in Lexer.h, because it has a cyclic dependency on Token, which also has a cyclic dependency on Lexer.
2435
2436         No new tests as there is no intended functional change.
2437
2438         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
2439         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
2440         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
2441         (WebCore::WHLSL::AST::ArrayType::ArrayType):
2442         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
2443         (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
2444         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
2445         (WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
2446         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
2447         (WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
2448         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
2449         (WebCore::WHLSL::AST::Block::Block):
2450         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
2451         (WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
2452         (WebCore::WHLSL::AST::BooleanLiteral::clone const):
2453         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
2454         (WebCore::WHLSL::AST::Break::Break):
2455         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
2456         (WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
2457         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
2458         (WebCore::WHLSL::AST::CallExpression::CallExpression):
2459         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
2460         (WebCore::WHLSL::AST::CommaExpression::CommaExpression):
2461         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
2462         (WebCore::WHLSL::AST::Continue::Continue):
2463         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
2464         (WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
2465         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
2466         (WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
2467         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
2468         (WebCore::WHLSL::AST::DotExpression::DotExpression):
2469         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
2470         (WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
2471         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
2472         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
2473         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
2474         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
2475         (WebCore::WHLSL::AST::EnumerationMember::codeLocation const):
2476         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
2477         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
2478         (WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
2479         (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
2480         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2481         (WebCore::WHLSL::AST::Expression::Expression):
2482         (WebCore::WHLSL::AST::Expression::codeLocation const):
2483         (WebCore::WHLSL::AST::Expression::updateCodeLocation):
2484         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
2485         (WebCore::WHLSL::AST::Fallthrough::Fallthrough):
2486         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
2487         (WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
2488         (WebCore::WHLSL::AST::FloatLiteral::clone const):
2489         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
2490         (WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
2491         (WebCore::WHLSL::AST::FloatLiteralType::clone const):
2492         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
2493         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
2494         (WebCore::WHLSL::AST::ForLoop::ForLoop):
2495         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
2496         (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
2497         (WebCore::WHLSL::AST::FunctionDeclaration::codeLocation const):
2498         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
2499         (WebCore::WHLSL::AST::GlobalVariableReference::GlobalVariableReference):
2500         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
2501         (WebCore::WHLSL::AST::IfStatement::IfStatement):
2502         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
2503         (WebCore::WHLSL::AST::IndexExpression::IndexExpression):
2504         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
2505         (WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
2506         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
2507         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
2508         (WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
2509         (WebCore::WHLSL::AST::IntegerLiteralType::clone const):
2510         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
2511         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
2512         (WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
2513         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
2514         (WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
2515         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
2516         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
2517         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
2518         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
2519         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
2520         (WebCore::WHLSL::AST::NamedType::NamedType):
2521         (WebCore::WHLSL::AST::NamedType::codeLocation const):
2522         (WebCore::WHLSL::AST::NamedType::updateCodeLocation):
2523         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
2524         (WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
2525         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
2526         (WebCore::WHLSL::AST::NullLiteral::NullLiteral):
2527         (WebCore::WHLSL::AST::NullLiteral::clone const):
2528         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
2529         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
2530         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
2531         (WebCore::WHLSL::AST::PointerType::PointerType):
2532         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
2533         (WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
2534         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
2535         (WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
2536         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
2537         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2538         (WebCore::WHLSL::AST::ReferenceType::ReferenceType):
2539         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
2540         (WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
2541         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
2542         (WebCore::WHLSL::AST::Return::Return):
2543         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
2544         (WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
2545         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
2546         (WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
2547         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
2548         (WebCore::WHLSL::AST::Statement::Statement):
2549         (WebCore::WHLSL::AST::Statement::codeLocation const):
2550         (WebCore::WHLSL::AST::Statement::updateCodeLocation):
2551         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
2552         (WebCore::WHLSL::AST::StatementList::StatementList):
2553         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
2554         (WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
2555         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
2556         (WebCore::WHLSL::AST::StructureElement::StructureElement):
2557         (WebCore::WHLSL::AST::StructureElement::codeLocation const):
2558         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
2559         (WebCore::WHLSL::AST::SwitchCase::SwitchCase):
2560         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
2561         (WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
2562         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
2563         (WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
2564         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h:
2565         (WebCore::WHLSL::AST::Trap::Trap):
2566         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
2567         (WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
2568         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
2569         (WebCore::WHLSL::AST::TypeReference::wrap):
2570         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
2571         (WebCore::WHLSL::AST::TypeReference::TypeReference):
2572         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
2573         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
2574         (WebCore::WHLSL::AST::UnnamedType::UnnamedType):
2575         (WebCore::WHLSL::AST::UnnamedType::codeLocation const):
2576         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
2577         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
2578         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
2579         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
2580         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
2581         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
2582         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
2583         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
2584         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
2585         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
2586         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
2587         (WebCore::WHLSL::AST::VariableReference::VariableReference):
2588         (WebCore::WHLSL::AST::VariableReference::wrap):
2589         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
2590         (WebCore::WHLSL::AST::WhileLoop::WhileLoop):
2591         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
2592         (WebCore::WHLSL::AutoInitialize::visit):
2593         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2594         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
2595         (WebCore::WHLSL::resolveWithOperatorLength):
2596         (WebCore::WHLSL::resolveWithReferenceComparator):
2597         (WebCore::WHLSL::resolveByInstantiation):
2598         (WebCore::WHLSL::resolveFunction):
2599         (WebCore::WHLSL::Checker::visit):
2600         (WebCore::WHLSL::argumentTypeForAndOverload):
2601         (WebCore::WHLSL::Checker::finishVisiting):
2602         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
2603         (WebCore::WHLSL::matchAndCommit):
2604         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
2605         (WebCore::WHLSL::Token::typeName):
2606         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
2607         * Modules/webgpu/WHLSL/WHLSLLexer.h:
2608         (WebCore::WHLSL::AST::CodeLocation::CodeLocation):
2609         (WebCore::WHLSL::AST::CodeLocation::startOffset const):
2610         (WebCore::WHLSL::AST::CodeLocation::endOffset const):
2611         (WebCore::WHLSL::Token::startOffset const):
2612         (WebCore::WHLSL::Lexer::errorString):
2613         (WebCore::WHLSL::Token::stringView const):
2614         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2615         (WebCore::WHLSL::NameResolver::visit):
2616         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2617         (WebCore::WHLSL::Parser::parse):
2618         (WebCore::WHLSL::Parser::peek):
2619         (WebCore::WHLSL::Parser::peekFurther):
2620         (WebCore::WHLSL::Types::includes):
2621         (WebCore::WHLSL::Types::appendNameTo):
2622         (WebCore::WHLSL::Types<t>::includes):
2623         (WebCore::WHLSL::Types<t>::appendNameTo):
2624         (WebCore::WHLSL::Parser::peekType):
2625         (WebCore::WHLSL::Parser::tryType):
2626         (WebCore::WHLSL::Parser::tryTypes):
2627         (WebCore::WHLSL::Parser::consumeType):
2628         (WebCore::WHLSL::Parser::consumeTypes):
2629         (WebCore::WHLSL::Parser::consumeIntegralLiteral):
2630         (WebCore::WHLSL::Parser::parseConstantExpression):
2631         (WebCore::WHLSL::Parser::parseTypeArgument):
2632         (WebCore::WHLSL::Parser::parseTypeArguments):
2633         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
2634         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
2635         (WebCore::WHLSL::Parser::parseType):
2636         (WebCore::WHLSL::Parser::parseTypeDefinition):
2637         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
2638         (WebCore::WHLSL::Parser::parseResourceSemantic):
2639         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
2640         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
2641         (WebCore::WHLSL::Parser::parseSemantic):
2642         (WebCore::WHLSL::Parser::parseQualifiers):
2643         (WebCore::WHLSL::Parser::parseStructureElement):
2644         (WebCore::WHLSL::Parser::parseStructureDefinition):
2645         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
2646         (WebCore::WHLSL::Parser::parseEnumerationMember):
2647         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
2648         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
2649         (WebCore::WHLSL::Parser::parseAttributeBlock):
2650         (WebCore::WHLSL::Parser::parseParameter):
2651         (WebCore::WHLSL::Parser::parseParameters):
2652         (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
2653         (WebCore::WHLSL::Parser::parseVertexOrFragmentFunctionDeclaration):
2654         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
2655         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
2656         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
2657         (WebCore::WHLSL::Parser::parseBlock):
2658         (WebCore::WHLSL::Parser::parseBlockBody):
2659         (WebCore::WHLSL::Parser::parseIfStatement):
2660         (WebCore::WHLSL::Parser::parseSwitchStatement):
2661         (WebCore::WHLSL::Parser::parseSwitchCase):
2662         (WebCore::WHLSL::Parser::parseForLoop):
2663         (WebCore::WHLSL::Parser::parseWhileLoop):
2664         (WebCore::WHLSL::Parser::parseDoWhileLoop):
2665         (WebCore::WHLSL::Parser::parseVariableDeclaration):
2666         (WebCore::WHLSL::Parser::parseVariableDeclarations):
2667         (WebCore::WHLSL::Parser::parseStatement):
2668         (WebCore::WHLSL::Parser::parseEffectfulExpression):
2669         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
2670         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
2671         (WebCore::WHLSL::Parser::parseSuffixOperator):
2672         (WebCore::WHLSL::Parser::parseExpression):
2673         (WebCore::WHLSL::Parser::completeTernaryConditional):
2674         (WebCore::WHLSL::Parser::completeAssignment):
2675         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
2676         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
2677         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
2678         (WebCore::WHLSL::Parser::completePossibleShift):
2679         (WebCore::WHLSL::Parser::completePossibleAdd):
2680         (WebCore::WHLSL::Parser::completePossibleMultiply):
2681         (WebCore::WHLSL::Parser::parsePossiblePrefix):
2682         (WebCore::WHLSL::Parser::parsePossibleSuffix):
2683         (WebCore::WHLSL::Parser::parseCallExpression):
2684         (WebCore::WHLSL::Parser::parseTerm):
2685         * Modules/webgpu/WHLSL/WHLSLParser.h:
2686         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
2687         (WebCore::WHLSL::anonymousToken):
2688         (WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
2689         (WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
2690         (WebCore::WHLSL::preserveVariableLifetimes):
2691         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2692         (WebCore::WHLSL::PropertyResolver::visit):
2693         (WebCore::WHLSL::wrapAnderCallArgument):
2694         (WebCore::WHLSL::setterCall):
2695         (WebCore::WHLSL::getterCall):
2696         (WebCore::WHLSL::modify):
2697         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
2698         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
2699         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
2700         (WebCore::WHLSL::synthesizeArrayOperatorLength):
2701         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
2702         (WebCore::WHLSL::synthesizeConstructors):
2703         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
2704         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2705         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
2706         (WebCore::WHLSL::synthesizeStructureAccessors):
2707
2708 2019-07-10  Kenneth Russell  <kbr@chromium.org>
2709
2710         Hook up WebGL's back buffer in ANGLE backend on macOS
2711         https://bugs.webkit.org/show_bug.cgi?id=198982
2712
2713         Reviewed by Alex Christensen.
2714
2715         Fix a few places which were accidentally calling desktop OpenGL rather
2716         than ANGLE. Fix some calls which were using ANGLE's OpenGL ES 3.0
2717         entry points rather than the OpenGL ES 2.0 extension APIs, causing
2718         them to generate errors in WebGL 1.0's backend. Change
2719         Extensions3DANGLE to use ANGLE's requestable extension mechanism.
2720
2721         Fix framebuffer setup when using ANGLE for WebGL 1.0 contexts, for
2722         both antialias:true and false.
2723
2724         Remove ANGLEWebKitBridge in ANGLE backend. It interfered with the
2725         correct operation of ANGLE's internal shader compiler, and was
2726         unnecessary given the use of ANGLE. Remove all manual shader name
2727         hashing and mapping in ANGLE backend.
2728
2729         Tested with parts of the WebGL conformance suite and the San
2730         Angeles demo, which now runs properly with WebKit's ANGLE backend
2731         for WebGL.
2732
2733         * html/canvas/WebGLRenderingContextBase.cpp:
2734         (WebCore::WebGLRenderingContextBase::getProgramParameter):
2735         (WebCore::WebGLRenderingContextBase::getUniformLocation):
2736         (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
2737         * platform/graphics/GraphicsContext3D.h:
2738         * platform/graphics/angle/Extensions3DANGLE.cpp:
2739         (WebCore::Extensions3DANGLE::Extensions3DANGLE):
2740         (WebCore::Extensions3DANGLE::supports):
2741         (WebCore::Extensions3DANGLE::ensureEnabled):
2742         (WebCore::Extensions3DANGLE::isEnabled):
2743         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
2744         (WebCore::Extensions3DANGLE::initializeAvailableExtensions):
2745         (WebCore::Extensions3DANGLE::blitFramebuffer):
2746         (WebCore::Extensions3DANGLE::renderbufferStorageMultisample):
2747         (WebCore::Extensions3DANGLE::createVertexArrayOES):
2748         (WebCore::Extensions3DANGLE::deleteVertexArrayOES):
2749         (WebCore::Extensions3DANGLE::isVertexArrayOES):
2750         (WebCore::Extensions3DANGLE::bindVertexArrayOES):
2751         (WebCore::Extensions3DANGLE::supportsExtension):
2752         (WebCore::Extensions3DANGLE::drawBuffersEXT):
2753         (WebCore::Extensions3DANGLE::drawArraysInstanced):
2754         (WebCore::Extensions3DANGLE::drawElementsInstanced):
2755         (WebCore::Extensions3DANGLE::vertexAttribDivisor):
2756         * platform/graphics/angle/Extensions3DANGLE.h:
2757         * platform/graphics/angle/GraphicsContext3DANGLE.cpp:
2758         (WebCore::GraphicsContext3D::validateAttributes):
2759         (WebCore::GraphicsContext3D::reshapeFBOs):
2760         (WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
2761         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2762         (WebCore::GraphicsContext3D::validateDepthStencil):
2763         (WebCore::GraphicsContext3D::prepareTexture):
2764         (WebCore::GraphicsContext3D::attachShader):
2765         (WebCore::GraphicsContext3D::bindAttribLocation):
2766         (WebCore::GraphicsContext3D::compileShader):
2767         (WebCore::GraphicsContext3D::compileShaderDirect):
2768         (WebCore::GraphicsContext3D::detachShader):
2769         (WebCore::GraphicsContext3D::getActiveAttribImpl):
2770         (WebCore::GraphicsContext3D::getActiveAttrib):
2771         (WebCore::GraphicsContext3D::getActiveUniformImpl):
2772         (WebCore::GraphicsContext3D::getActiveUniform):
2773         (WebCore::GraphicsContext3D::getAttribLocation):
2774         (WebCore::GraphicsContext3D::getAttribLocationDirect):
2775         (WebCore::GraphicsContext3D::moveErrorsToSyntheticErrorList):
2776         (WebCore::GraphicsContext3D::linkProgram):
2777         (WebCore::GraphicsContext3D::shaderSource):
2778         (WebCore::GraphicsContext3D::getUnmangledInfoLog):
2779         (WebCore::GraphicsContext3D::getShaderiv):
2780         (WebCore::GraphicsContext3D::getShaderInfoLog):
2781         (WebCore::GraphicsContext3D::getUniformLocation):
2782         (WebCore::GraphicsContext3D::createBuffer):
2783         (WebCore::GraphicsContext3D::createFramebuffer):
2784         (WebCore::GraphicsContext3D::createProgram):
2785         (WebCore::GraphicsContext3D::createRenderbuffer):
2786         (WebCore::GraphicsContext3D::createShader):
2787         (WebCore::GraphicsContext3D::createTexture):
2788         (WebCore::GraphicsContext3D::deleteBuffer):
2789         (WebCore::GraphicsContext3D::deleteFramebuffer):
2790         (WebCore::GraphicsContext3D::deleteProgram):
2791         (WebCore::GraphicsContext3D::deleteRenderbuffer):
2792         (WebCore::GraphicsContext3D::deleteShader):
2793         (WebCore::GraphicsContext3D::deleteTexture):
2794         (WebCore::GraphicsContext3D::synthesizeGLError):
2795         (): Deleted.
2796         (WebCore::setCurrentNameHashMapForShader): Deleted.
2797         (WebCore::nameHashForShader): Deleted.
2798         (WebCore::GraphicsContext3D::checkVaryingsPacking const): Deleted.
2799         (WebCore::GraphicsContext3D::precisionsMatch const): Deleted.
2800         (WebCore::generateHashedName): Deleted.
2801         (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap): Deleted.
2802         (WebCore::GraphicsContext3D::mappedSymbolName): Deleted.
2803         (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap): Deleted.
2804         (WebCore::GraphicsContext3D::originalSymbolName): Deleted.
2805         (WebCore::GraphicsContext3D::getNonBuiltInActiveSymbolCount): Deleted.
2806         (WebCore::GraphicsContext3D::getShaderSource): Deleted.
2807         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2808         (WebCore::GraphicsContext3D::GraphicsContext3D):
2809         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2810         (WebCore::GraphicsContext3D::makeContextCurrent):
2811         (WebCore::GraphicsContext3D::checkGPUStatus):
2812         (WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore):
2813         (WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer):
2814         * platform/graphics/cocoa/WebGLLayer.h:
2815         * platform/graphics/cocoa/WebGLLayer.mm:
2816         (-[WebGLLayer initWithGraphicsContext3D:]):
2817         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
2818         (-[WebGLLayer display]):
2819         (-[WebGLLayer setEGLDisplay:andConfig:]):
2820         (-[WebGLLayer dealloc]):
2821         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
2822         (-[WebGLLayer bindFramebufferToNextAvailableSurface]):
2823
2824 2019-07-10  Youenn Fablet  <youenn@apple.com>
2825
2826         openDatabase property should not be enumerable on DOMWindow
2827         https://bugs.webkit.org/show_bug.cgi?id=199672
2828         <rdar://problem/52809000>
2829
2830         Reviewed by Chris Dumez.
2831
2832         Test: storage/websql/openDatabase-deprecation.html
2833
2834         * Modules/webdatabase/DOMWindowWebDatabase.idl:
2835
2836 2019-07-10  Chris Dumez  <cdumez@apple.com>
2837
2838         Fix unsafe usage of makeWeakPtr() in CMTimebaseEffectiveRateChangedCallback()
2839         https://bugs.webkit.org/show_bug.cgi?id=199656
2840
2841         Reviewed by Eric Carlson.
2842
2843         CMTimebaseEffectiveRateChangedCallback() is getting called on a background thread and would call
2844         makeWeakPtr() on the MediaPlayerPrivateMediaSourceAVFObjC object, which is not safe because
2845         MediaPlayerPrivateMediaSourceAVFObjC is a main thread object.
2846
2847         To address the issue, move the logic for listening to effective rate changes to its own
2848         Listener class which is ThreadSafeRefCounted. Instead of using makeWeakPtr() on the background
2849         thread, we now merely ref the thread-safe listener.
2850
2851         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2852         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2853         (WebCore::EffectiveRateChangedListener::create):
2854         (WebCore::EffectiveRateChangedListener::effectiveRateChanged):
2855         (WebCore::CMTimebaseEffectiveRateChangedCallback):
2856         (WebCore::EffectiveRateChangedListener::stop):
2857         (WebCore::EffectiveRateChangedListener::EffectiveRateChangedListener):
2858         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2859         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
2860
2861 2019-07-10  Antti Koivisto  <antti@apple.com>
2862
2863         Remove TouchActionData
2864         https://bugs.webkit.org/show_bug.cgi?id=199668
2865
2866         Reviewed by Simon Fraser.
2867
2868         TouchActionData structure has been superseded by touch-action regions in EventRegion and is unused.
2869         Remove it and the supporting code.
2870
2871         No functional changes.
2872
2873         * dom/Document.cpp:
2874         (WebCore::Document::nodeWillBeRemoved):
2875         (WebCore::Document::updateTouchActionElements): Deleted.
2876         * dom/Document.h:
2877         (WebCore::Document::mayHaveElementsWithNonAutoTouchAction const):
2878         (WebCore::Document::setMayHaveElementsWithNonAutoTouchAction):
2879
2880         Replace touchActionElements set with a bit that covers the only remaining clients (optimizations).
2881         Note that touchActionElements was not deleted when emptied, it had the same "may have" behavior (which
2882         is currently needed).
2883
2884         (WebCore::Document::touchActionElements const): Deleted.
2885         * dom/Element.cpp:
2886         (WebCore::Element::computedTouchActions const): Deleted.
2887         * dom/Element.h:
2888         * page/scrolling/ScrollingCoordinator.cpp:
2889         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
2890         * page/scrolling/ScrollingTree.cpp:
2891         (WebCore::ScrollingTree::touchActionDataAtPoint const): Deleted.
2892         * page/scrolling/ScrollingTree.h:
2893         * platform/EventTrackingRegions.cpp:
2894         (WebCore::operator==):
2895         * platform/EventTrackingRegions.h:
2896         (): Deleted.
2897         * rendering/RenderBlock.cpp:
2898         (WebCore::RenderBlock::paintObject):
2899         * rendering/RenderLayer.cpp:
2900         (WebCore::RenderLayer::calculateClipRects const):
2901         * rendering/RenderLayerBacking.cpp:
2902         (WebCore::RenderLayerBacking::updateEventRegion):
2903         * style/StyleTreeResolver.cpp:
2904         (WebCore::Style::TreeResolver::resolveElement):
2905
2906 2019-07-10  Zalan Bujtas  <zalan@apple.com>
2907
2908         [LFC][IFC] Remove redundant InlineFormattingContext::LineLayout members.
2909         https://bugs.webkit.org/show_bug.cgi?id=199654
2910         <rdar://problem/52869206>
2911
2912         Reviewed by Antti Koivisto.
2913
2914         Some of the members are actually only needed in selected functions.
2915
2916         * layout/inlineformatting/InlineFormattingContext.cpp:
2917         (WebCore::Layout::InlineFormattingContext::layout const):
2918         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
2919         * layout/inlineformatting/InlineFormattingContext.h:
2920         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const):
2921         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2922         (WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout):
2923         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
2924         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
2925         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
2926         (WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const):
2927         * layout/inlineformatting/InlineFormattingState.h:
2928         (WebCore::Layout::InlineFormattingState::inlineItems):
2929         (WebCore::Layout::InlineFormattingState::inlineRuns):
2930         (WebCore::Layout::InlineFormattingState::lineBoxes):
2931
2932 2019-07-10  Enrique Ocaña González  <eocanha@igalia.com>
2933
2934         [GStreamer] Protect against null samples and samples with null buffers
2935         https://bugs.webkit.org/show_bug.cgi?id=199619
2936
2937         Reviewed by Philippe Normand.
2938
2939         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2940         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder): Assert to enforce non-null samples.
2941         (WebCore::GstVideoFrameHolder::updateTexture): Protect against null m_buffer and improperly mapped video frame.
2942
2943 2019-07-09  Andres Gonzalez  <andresg_22@apple.com>
2944
2945         AX: HTML datalist accessibility is not exposed by WebKit
2946         https://bugs.webkit.org/show_bug.cgi?id=196998
2947         <rdar://problem/49962521>
2948
2949         Reviewed by Chris Fleizach.
2950
2951         Input fields with datalist are exposed as having a listbox popup.
2952
2953         Test: accessibility/datalist.html
2954
2955         * accessibility/AccessibilityObject.cpp:
2956         (WebCore::AccessibilityObject::popupValue const):
2957         (WebCore::AccessibilityObject::hasDatalist const):
2958         * accessibility/AccessibilityObject.h:
2959
2960 2019-07-09  Justin Fan  <justin_fan@apple.com>
2961
2962         Replace old, broken WebGPU IDL spec link with the new one in IDL comments.
2963
2964         Rubber-stamped by Myles C. Maxfield.
2965
2966         No test changes or change in behavior.
2967
2968         * Modules/webgpu/GPUBindGroupLayoutBinding.idl:
2969         * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl:
2970         * Modules/webgpu/GPUBlendDescriptor.idl:
2971         * Modules/webgpu/GPUBufferDescriptor.idl:
2972         * Modules/webgpu/GPUBufferUsage.idl:
2973         * Modules/webgpu/GPUCanvasContext.idl:
2974         * Modules/webgpu/GPUColor.idl:
2975         * Modules/webgpu/GPUColorStateDescriptor.idl:
2976         * Modules/webgpu/GPUColorWriteBits.idl:
2977         * Modules/webgpu/GPUCompareFunction.idl:
2978         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
2979         * Modules/webgpu/GPUExtent3D.idl:
2980         * Modules/webgpu/GPULoadOp.idl:
2981         * Modules/webgpu/GPUOrigin3D.idl:
2982         * Modules/webgpu/GPURequestAdapterOptions.idl:
2983         * Modules/webgpu/GPUSamplerDescriptor.idl:
2984         * Modules/webgpu/GPUShaderStageBit.idl:
2985         * Modules/webgpu/GPUStoreOp.idl:
2986         * Modules/webgpu/GPUTextureDescriptor.idl:
2987         * Modules/webgpu/GPUTextureUsage.idl:
2988         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
2989         * Modules/webgpu/GPUVertexBufferDescriptor.idl:
2990         * Modules/webgpu/GPUVertexInputDescriptor.idl:
2991         * Modules/webgpu/WebGPU.idl:
2992         * Modules/webgpu/WebGPUAdapter.idl:
2993         * Modules/webgpu/WebGPUBindGroup.idl:
2994         * Modules/webgpu/WebGPUBindGroupBinding.idl:
2995         * Modules/webgpu/WebGPUBindGroupDescriptor.idl:
2996         * Modules/webgpu/WebGPUBindGroupLayout.idl:
2997         * Modules/webgpu/WebGPUBuffer.idl:
2998         * Modules/webgpu/WebGPUBufferBinding.idl:
2999         * Modules/webgpu/WebGPUCommandBuffer.idl:
3000         * Modules/webgpu/WebGPUCommandEncoder.idl:
3001         * Modules/webgpu/WebGPUComputePassEncoder.idl:
3002         * Modules/webgpu/WebGPUComputePipeline.idl:
3003         * Modules/webgpu/WebGPUComputePipelineDescriptor.idl:
3004         * Modules/webgpu/WebGPUDevice.idl:
3005         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
3006         * Modules/webgpu/WebGPUPipelineLayout.idl:
3007         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl:
3008         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
3009         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
3010         * Modules/webgpu/WebGPUQueue.idl:
3011         * Modules/webgpu/WebGPURenderPassDescriptor.idl:
3012         * Modules/webgpu/WebGPURenderPassEncoder.idl:
3013         * Modules/webgpu/WebGPURenderPipeline.idl:
3014         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
3015         * Modules/webgpu/WebGPUSampler.idl:
3016         * Modules/webgpu/WebGPUShaderModule.idl:
3017         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
3018         * Modules/webgpu/WebGPUSwapChain.idl:
3019         * Modules/webgpu/WebGPUTexture.idl:
3020         * Modules/webgpu/WebGPUTextureView.idl:
3021
3022 2019-07-09  Chris Dumez  <cdumez@apple.com>
3023
3024         Stop using GenericTaskQueue from multiple threads
3025         https://bugs.webkit.org/show_bug.cgi?id=199652
3026
3027         Reviewed by Geoffrey Garen.
3028
3029         WebCoreAVFLoaderDelegate was calling GenericTaskQueue::enqueueTask() from a background thread,
3030         which is not safe because the implementation of enqueueTask() calls makeWeakPtr() on the
3031         GenericTaskQueue (a main thread object).
3032
3033         Update WebCoreAVFLoaderDelegate to use callOnMainThread() instead.
3034
3035         * platform/GenericTaskQueue.h:
3036         Stop last template parameter which was used exclusively by WebCoreAVFLoaderDelegate to try and
3037         make GenericTaskQueue thread-safe.
3038
3039         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3040         (-[WebCoreAVFMovieObserver metadataLoaded]):
3041         (-[WebCoreAVFMovieObserver didEnd:]):
3042         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3043         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
3044         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
3045         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
3046         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
3047
3048 2019-07-09  Tim Horton  <timothy_horton@apple.com>
3049
3050         Fixed elements appear in the middle of full page screenshots taken when scrolled
3051         https://bugs.webkit.org/show_bug.cgi?id=199649
3052         <rdar://problem/52476226>
3053
3054         Reviewed by Simon Fraser.
3055
3056         * page/FrameView.h:
3057         Expose a getter for the layout viewport override rect.
3058
3059 2019-07-09  Alex Christensen  <achristensen@webkit.org>
3060
3061         Fix build after r247279
3062         https://bugs.webkit.org/show_bug.cgi?id=199640
3063
3064         * WebCore.xcodeproj/project.pbxproj:
3065
3066 2019-07-09  Alex Christensen  <achristensen@webkit.org>
3067
3068         Move AutofillElements.{h,cpp} from editing/ios to editing/cocoa since they're used on macOS
3069         https://bugs.webkit.org/show_bug.cgi?id=199640
3070
3071         Reviewed by Chris Dumez.
3072
3073         * SourcesCocoa.txt:
3074         * WebCore.xcodeproj/project.pbxproj:
3075         * editing/cocoa/AutofillElements.cpp: Copied from Source/WebCore/editing/ios/AutofillElements.cpp.
3076         * editing/cocoa/AutofillElements.h: Copied from Source/WebCore/editing/ios/AutofillElements.h.
3077         * editing/ios/AutofillElements.cpp: Removed.
3078         * editing/ios/AutofillElements.h: Removed.
3079
3080 2019-07-09  Devin Rousso  <drousso@apple.com>
3081
3082         Web Inspector: Canvas: replace WTF::Vector with std::initializer_list in CallTracer to avoid dynamic allocations
3083         https://bugs.webkit.org/show_bug.cgi?id=199611
3084
3085         Reviewed by Joseph Pecoraro.
3086
3087         The number of arguments for each member function is known at build time, so there's no need
3088         to dynamically allocate a `WTF::Vector` when capturing the arguments. One downside to using
3089         a `std::initializer_list` is that we can no longer "flatten" `WTF::Variant` arguments into
3090         a `RecordCanvasActionVariant`, but this is acceptable because `WTF::Variant` supports having
3091         yet another `WTF::Variant` as one of it's types, which the `InspectorCanvas` can then figure
3092         out when it finally gets the data. The same applies to `nullptr`/`Optional` checks as well.
3093
3094         * bindings/scripts/CodeGeneratorJS.pm:
3095         (GenerateAttributeSetterBodyDefinition):
3096         (GenerateImplementationFunctionCall):
3097         (GenerateCallTracer):
3098         (GenerateCallTracerParameter): Deleted.
3099         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3100
3101         * bindings/js/CallTracerTypes.h:
3102         * bindings/js/CallTracer.h:
3103         * bindings/js/CallTracer.cpp:
3104         (WebCore::CallTracer::recordCanvasAction):
3105
3106         * inspector/InspectorInstrumentation.h:
3107         (WebCore::InspectorInstrumentation::recordCanvasAction):
3108         * inspector/InspectorInstrumentation.cpp:
3109         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
3110
3111         * inspector/agents/InspectorCanvasAgent.h:
3112         * inspector/agents/InspectorCanvasAgent.cpp:
3113         (WebCore::InspectorCanvasAgent::recordCanvasAction):
3114
3115         * inspector/InspectorCanvas.h:
3116         * inspector/InspectorCanvas.cpp:
3117         (WebCore::InspectorCanvas::recordAction):
3118         (WebCore::InspectorCanvas::buildAction):
3119         Drive-by: handle the situation where a parameter is an array of deduplicated strings, which
3120                   would otherwise be treated as an array of numbers.
3121
3122 2019-07-09  Chris Dumez  <cdumez@apple.com>
3123
3124         Fix non thread-safe use of WeakPtr in DisplayRefreshMonitorMac::displayLinkFired()
3125         https://bugs.webkit.org/show_bug.cgi?id=199626
3126
3127         Reviewed by Ryosuke Niwa.
3128
3129         Fix non thread-safe use of WeakPtr in DisplayRefreshMonitorMac::displayLinkFired().
3130         DisplayRefreshMonitorMac gets constructed / destroyed on the main thread, it is
3131         not thread-safe to call makeWeakPtr() on a DisplayRefreshMonitorMac object like it
3132         was done before.
3133
3134         To address the issue, mark the object as ThreadSafeRefCounted and ref the object
3135         in the lambda instead.
3136
3137         * platform/graphics/DisplayRefreshMonitor.h:
3138         (WebCore::DisplayRefreshMonitor::stop):
3139         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3140         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
3141         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
3142         (WebCore::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
3143         (WebCore::DisplayRefreshMonitorMac::stop):
3144         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
3145         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
3146
3147 2019-07-09  Sihui Liu  <sihui_liu@apple.com>
3148
3149         Only allow fetching and removing session credentials from WebsiteDataStore
3150         https://bugs.webkit.org/show_bug.cgi?id=199385
3151         <rdar://problem/52622080>
3152
3153         Reviewed by Alex Christensen.
3154
3155         Fetch and remove only session credentials from NSURLCredentialStorage.
3156
3157         Modified existing API tests: WKWebsiteDataStore.FetchPersistentCredentials
3158
3159         * platform/network/CredentialStorage.cpp:
3160         (WebCore::CredentialStorage::originsWithCredentials const):
3161         (WebCore::CredentialStorage::originsWithSessionCredentials):
3162         (WebCore::CredentialStorage::removeSessionCredentialsWithOrigins):
3163         (WebCore::CredentialStorage::clearSessionCredentials):
3164         (WebCore::CredentialStorage::clearPermanentCredentialsForProtectionSpace):
3165         * platform/network/CredentialStorage.h:
3166         * platform/network/mac/CredentialStorageMac.mm:
3167         (WebCore::CredentialStorage::originsWithSessionCredentials):
3168         (WebCore::CredentialStorage::removeSessionCredentialsWithOrigins):
3169         (WebCore::CredentialStorage::clearSessionCredentials):
3170         (WebCore::CredentialStorage::clearPermanentCredentialsForProtectionSpace):
3171         (WebCore::CredentialStorage::originsWithPersistentCredentials): Deleted.
3172
3173 2019-07-09  Alex Christensen  <achristensen@webkit.org>
3174
3175         Null check HistoryItems given to loadDifferentDocumentItem
3176         https://bugs.webkit.org/show_bug.cgi?id=199596
3177         <rdar://problem/49884391>
3178
3179         Reviewed by Ryosuke Niwa.
3180
3181         * loader/FrameLoader.cpp:
3182         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
3183         Under some rare and mysterious conditions we can have a null provisionalItem when loading from the cache.
3184
3185 2019-07-09  Zalan Bujtas  <zalan@apple.com>
3186
3187         Fix LOG_DISABLED and TREE_DEBUGGING enabled build.
3188         https://bugs.webkit.org/show_bug.cgi?id=199623
3189         <rdar://problem/52837648>
3190
3191         Reviewed by Simon Fraser.
3192
3193         * rendering/RenderLayerCompositor.cpp:
3194
3195 2019-07-09  Zalan Bujtas  <zalan@apple.com>
3196
3197         [LFC][IFC] Remove InlineItem references from inline runs.
3198         https://bugs.webkit.org/show_bug.cgi?id=199608
3199         <rdar://problem/52812775>
3200
3201         Reviewed by Antti Koivisto.
3202
3203         Constructing the inline runs is where we stop using InlineItems in the process of processing the inline content.
3204         InlineItems are redundant in the context of Display::Runs.
3205         It also enables us to create temporary InlineItems to process split content.  
3206
3207         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3208         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
3209         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3210         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing):
3211         * layout/inlineformatting/InlineLine.cpp:
3212         (WebCore::Layout::Line::Content::Run::Run):
3213         (WebCore::Layout::Line::isVisuallyEmpty const):
3214         (WebCore::Layout::Line::close):
3215         (WebCore::Layout::Line::removeTrailingTrimmableContent):
3216         (WebCore::Layout::Line::trailingTrimmableWidth const):
3217         (WebCore::Layout::Line::appendNonBreakableSpace):
3218         (WebCore::Layout::Line::appendTextContent):
3219         (WebCore::Layout::Line::appendNonReplacedInlineBox):
3220         (WebCore::Layout::Line::appendHardLineBreak):
3221         * layout/inlineformatting/InlineLine.h:
3222         (WebCore::Layout::Line::Content::Run::layoutBox const):
3223         (WebCore::Layout::Line::Content::Run::logicalRect const):
3224         (WebCore::Layout::Line::Content::Run::textContext const):
3225         (WebCore::Layout::Line::Content::Run::type const):
3226         (WebCore::Layout::Line::Content::Run::isText const):
3227         (WebCore::Layout::Line::Content::Run::isBox const):
3228         (WebCore::Layout::Line::Content::Run::isLineBreak const):
3229         (WebCore::Layout::Line::Content::Run::isContainerStart const):
3230         (WebCore::Layout::Line::Content::Run::isContainerEnd const):
3231         (WebCore::Layout::Line::Content::Run::adjustLogicalTop):
3232         (WebCore::Layout::Line::Content::Run::moveVertically):
3233         (WebCore::Layout::Line::Content::Run::moveHorizontally):
3234         (WebCore::Layout::Line::Content::Run::setTextIsCollapsed):
3235
3236 2019-07-09  Antti Koivisto  <antti@apple.com>
3237
3238         REGRESSION(r244906): Crash in WebCore::positionOffsetValue
3239         https://bugs.webkit.org/show_bug.cgi?id=199613
3240         <rdar://problem/51518172>
3241
3242         Reviewed by Zalan Bujtas.
3243
3244         Test: fast/css/getComputedStyle/sticky-scroll-container-crash.html
3245
3246         * css/CSSComputedStyleDeclaration.cpp:
3247         (WebCore::positionOffsetValue):
3248         * rendering/RenderBox.cpp:
3249         (WebCore::RenderBox::enclosingScrollportBox const): Deleted.
3250
3251         The client trivally hits nullptr when this is called for element without overflow scroll parent.
3252
3253         Fix by removing the whole function and using shared enclosingClippingBoxForStickyPosition instead.
3254         It does the same ancestor walk more efficiently via layer tree.
3255
3256         * rendering/RenderBox.h:
3257         * rendering/RenderBoxModelObject.cpp:
3258         (WebCore::RenderBoxModelObject::enclosingClippingBoxForStickyPosition const):
3259
3260         Factor into function.
3261
3262         (WebCore::RenderBoxModelObject::computeStickyPositionConstraints const):
3263         * rendering/RenderBoxModelObject.h:
3264
3265 2019-07-09  Cathie Chen  <cathiechen@igalia.com>
3266
3267         Support writing-mode and direction for scrollIntoViewOptions.
3268         https://bugs.webkit.org/show_bug.cgi?id=161611
3269
3270         Reviewed by Frédéric Wang and Simon Fraser.
3271
3272         To determine which physical side to align we need to transform ScrollIntoViewOptions to scrollAlignment.
3273         We'll translate the inline and block direction separately. The writing-mode will affect the block scrollAlignment.
3274         While both writing-mode and CSS direction will affect the inline scrollAlignment. The argument for scrollRectToVisible
3275         should be physical, so if !isHorizontalWritingMode(), we need to switch alignX and alignY.
3276
3277         For direction: rtl and writing-mode: horizontal-tb box, WebKit puts the scrollbar on the left side. The visible rect
3278         starts from the right side of the scroll bar, so localExposeRect should also start from the right side of
3279         scroll bar.
3280
3281         * dom/Element.cpp:
3282         (WebCore::toScrollAlignmentForInlineDirection):
3283         (WebCore::toScrollAlignmentForBlockDirection):
3284         (WebCore::Element::scrollIntoView):
3285         (WebCore::toScrollAlignment): Deleted.
3286         * rendering/RenderLayer.cpp:
3287         (WebCore::RenderLayer::scrollRectToVisible):
3288
3289 2019-07-08  Saam Barati  <sbarati@apple.com>
3290
3291         [WHLSL Import 23 new JS reference spec tests
3292         https://bugs.webkit.org/show_bug.cgi?id=199604
3293
3294         Reviewed by Myles C. Maxfield.
3295
3296         This patch imports a bunch of JS reference spec tests on our way to
3297         completing https://bugs.webkit.org/show_bug.cgi?id=199595
3298         
3299         It also fixes the recursion checker phase. That phase had two bugs:
3300         1. We'd assert after visiting the function declaration that it was
3301         still in the set. However, it will not be in the set when we actually
3302         detect recursion.
3303         2. We would not visit the arguments to a call, so if they contained other
3304         calls which were recursive, we would not detect such recursive calls.
3305
3306         Tests: webgpu/whlsl-int-literal-compare.html
3307                webgpu/whlsl-simple-tests.html
3308                webgpu/whlsl-type-mismatch.html
3309                webgpu/whlsl-uint-bitwise.html
3310
3311         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
3312
3313 2019-07-08  Chris Dumez  <cdumez@apple.com>
3314
3315         Make Document::postTask() safe to call from a background thread
3316         https://bugs.webkit.org/show_bug.cgi?id=199585
3317
3318         Reviewed by Alex Christensen.
3319
3320         Make Document::postTask() safe to call from a background thread by not calling makeWeakPtr() on the Document.
3321         Calling makeWeakPtr() on a document from a background thread is not safe since Document is a main thread
3322         object. Instead, capture Document::identifier() in the lambda and lookup the document from its identifier
3323         once we're on the main thread.
3324
3325         * dom/Document.cpp:
3326         (WebCore::Document::postTask):
3327
3328 2019-07-08  Youenn Fablet  <youenn@apple.com>
3329
3330         Hop explicitly to the main thread after generating a frame in ScreenDisplayCaptureSourceMac
3331         https://bugs.webkit.org/show_bug.cgi?id=199581
3332
3333         Reviewed by Eric Carlson.
3334
3335         Instead of locking and setting the current frame from a background thread, hop to the main thread.
3336         This also makes sure the weakThis check is done in the main thread.
3337         Manually tested.
3338
3339         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
3340         (WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::DisplaySurface):
3341         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
3342         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
3343         (WebCore::ScreenDisplayCaptureSourceMac::generateFrame):
3344         (WebCore::ScreenDisplayCaptureSourceMac::newFrame):
3345         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Deleted.
3346
3347 2019-07-08  Daniel Bates  <dabates@apple.com>
3348
3349         Command + . generates Escape with key identifier Period, should be Escape
3350         https://bugs.webkit.org/show_bug.cgi?id=199393
3351         <rdar://problem/52498001>
3352
3353         Reviewed by Wenson Hsieh.
3354
3355         Remap the key code for Command + . before we compute the Windows virtual key code.
3356         Otherwise, the Windows virtual key code reveals the pre-mapped key code.
3357
3358         * platform/ios/WebEvent.mm:
3359         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
3360
3361 2019-07-08  Alex Christensen  <achristensen@webkit.org>
3362
3363         Prevent null dereferencing in SubresourceLoader::init's lambda
3364         https://bugs.webkit.org/show_bug.cgi?id=199580
3365
3366         Reviewed by Ryosuke Niwa.
3367
3368         Crash logs indicate that sometimes m_documentLoader is null.
3369         This is similar to https://bugs.webkit.org/show_bug.cgi?id=187360
3370
3371         * loader/SubresourceLoader.cpp:
3372         (WebCore::SubresourceLoader::init):
3373
3374 2019-07-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3375
3376         Unable to paste from Notes into Excel 365 spreadsheet
3377         https://bugs.webkit.org/show_bug.cgi?id=199565
3378         <rdar://problem/43615497>
3379
3380         Reviewed by Chris Dumez.
3381
3382         When pasting into Microsoft Excel 365, the copied data is all inserted into a single cell, even when copying a
3383         table. To understand why this happens, we first need to understand how Excel's logic for handling paste works.
3384         When tapping on the "Paste" button, Excel performs and expects the following:
3385
3386         1.  Before triggering programmatic paste, move focus into a hidden contenteditable area specifically intended to
3387             capture pasted content.
3388         2.  Run a promise that resolves immediately; the promise callback restores focus to the originally focused
3389             element prior to (1).
3390         3.  Invoke programmatic paste using `document.execCommand("Paste")`.
3391         4.  The callback scheduled in step (2) then runs, restoring focus to the main editable element representing a
3392             table cell.
3393
3394         However, what ends up happening is this:
3395
3396         Steps (1)-(3): same as before.
3397         4.  We (WebKit) create a temporary Page for the purposes of sanitizing copied web content before exposing it to
3398             the paste handler. This involves creating and loading a document; when this is finished, we call into
3399             Document::finishedParsing which flushes the microtask queue.
3400         5.  This causes us to immediately run the microtask enqueued in step (2), which restores focus to the previously
3401             focused element (importantly, this is not the element that was focused in step (1)).
3402         6.  The paste commences, and inserts the sanitized fragment into the originally focused element rather than the
3403             content editable area intended to capture pasted content.
3404
3405         Excel's script then gets confused, and does not end up using their special paste logic to handle the paste. The
3406         pasted content is instead just inserted as plain text in a cell. To address this, we simply prevent document
3407         load in the Page for web content sanitization from triggering a microtask checkpoint; this allows any scheduled
3408         main thread microtasks to be deferred until the next turn of the runloop.
3409
3410         Test: editing/pasteboard/paste-does-not-fire-promises-while-sanitizing-web-content.html
3411
3412         * dom/Document.cpp:
3413         (WebCore::Document::finishedParsing):
3414
3415         Don't immediately dispatch microtasks when we finish document parsing, in the case where the page is intended
3416         only for web content sanitization, since this may end up executing script in the original document. As explained
3417         above, this causes compatibility issues when pasting in Excel.
3418
3419         * editing/markup.cpp:
3420         (WebCore::createPageForSanitizingWebContent):
3421
3422         When creating a page for sanitizing web content, mark it as such.
3423
3424         * page/Page.h:
3425
3426         Add a new flag to indicate that a Page is only intended for sanitizing web content.
3427
3428         (WebCore::Page::setIsForSanitizingWebContent):
3429         (WebCore::Page::isForSanitizingWebContent const):
3430
3431 2019-07-08  Konstantin Tokarev  <annulen@yandex.ru>
3432
3433         Remove unused #include "ImageBufferData.h"
3434         https://bugs.webkit.org/show_bug.cgi?id=199574
3435
3436         Reviewed by Michael Catanzaro.
3437
3438         * html/canvas/ImageBitmapRenderingContext.h:
3439
3440 2019-07-08  Chris Dumez  <cdumez@apple.com>
3441
3442         Fix thread safety issue in Database::scheduleTransactionCallback()
3443         https://bugs.webkit.org/show_bug.cgi?id=199557
3444
3445         Reviewed by Alex Christensen.
3446
3447         I am working on adding threading assertions to WeakPtr and found a potentially
3448         unsafe call to makeWeakPtr() on a Document from Database::scheduleTransactionCallback()
3449         via Document::postTask(), on a background database thread. Document is a main thread
3450         object and we should therefore not be interacting with it from a background thread.
3451
3452         For clarity, this patch also switches the webdatabase code to use Document instead
3453         of ScriptExecution as type since it is only exposed to Window contexts, not workers.
3454
3455         * Modules/webdatabase/Database.cpp:
3456         (WebCore::Database::Database):
3457         (WebCore::Database::~Database):
3458         (WebCore::Database::runTransaction):
3459         (WebCore::Database::scheduleTransactionCallback):
3460         (WebCore::Database::logErrorMessage):
3461         (WebCore::Database::securityOrigin):
3462         (WebCore::Database::didExceedQuota):
3463         * Modules/webdatabase/Database.h:
3464         (WebCore::Database::document):
3465         * Modules/webdatabase/DatabaseContext.cpp:
3466         (WebCore::DatabaseContext::DatabaseContext):
3467         * Modules/webdatabase/DatabaseContext.h:
3468         * Modules/webdatabase/DatabaseManager.cpp:
3469         (WebCore::DatabaseManager::databaseContext):
3470         (WebCore::logOpenDatabaseError):
3471         (WebCore::DatabaseManager::openDatabaseBackend):
3472         (WebCore::DatabaseManager::tryToOpenDatabaseBackend):
3473         (WebCore::DatabaseManager::openDatabase):
3474         (WebCore::DatabaseManager::hasOpenDatabases):
3475         (WebCore::DatabaseManager::stopDatabases):
3476         (WebCore::DatabaseManager::logErrorMessage):
3477         * Modules/webdatabase/DatabaseManager.h:
3478         * Modules/webdatabase/SQLStatement.cpp:
3479         (WebCore::SQLStatement::SQLStatement):
3480         * Modules/webdatabase/SQLTransaction.cpp:
3481         (WebCore::SQLTransaction::SQLTransaction):
3482         * inspector/InspectorInstrumentation.h:
3483         (WebCore::InspectorInstrumentation::didOpenDatabase):
3484         * inspector/agents/InspectorDatabaseAgent.cpp:
3485         (WebCore::InspectorDatabaseAgent::executeSQL):
3486
3487 2019-07-08  Chris Dumez  <cdumez@apple.com>
3488
3489         Add threading assertion to WTF::CompletionHandler
3490         https://bugs.webkit.org/show_bug.cgi?id=199516
3491
3492         Reviewed by Alex Christensen.
3493
3494         Update some MessagePort-related code to use WTF::Function instead of WTF::CompletionHandler
3495         since the callback is always called on the main thread, even when it was created on a
3496         worker thread. Ideally, this code would be refactored so that the callback gets called on
3497         the worker thread directly.
3498
3499         * dom/messageports/MessagePortChannel.cpp:
3500         (WebCore::MessagePortChannel::checkRemotePortForActivity):
3501         * dom/messageports/MessagePortChannel.h:
3502         * dom/messageports/MessagePortChannelProvider.h:
3503         * dom/messageports/MessagePortChannelProviderImpl.cpp:
3504         (WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
3505         * dom/messageports/MessagePortChannelProviderImpl.h:
3506         * dom/messageports/MessagePortChannelRegistry.cpp:
3507         (WebCore::MessagePortChannelRegistry::checkRemotePortForActivity):
3508         * dom/messageports/MessagePortChannelRegistry.h:
3509
3510 2019-07-08  Charlie Turner  <cturner@igalia.com>
3511
3512         REGRESSION(r243197): [GStreamer] Web process hangs when scrolling twitter timeline which contains HLS videos
3513         https://bugs.webkit.org/show_bug.cgi?id=197558
3514
3515         Reviewed by Xabier Rodriguez-Calvar.
3516
3517         Not covered, I have a test locally that would probably trigger the
3518         deadlock if the network requests took a realistic amount of time,
3519         but from a local webserver the window of time to hit this deadlock
3520         is too narrow.
3521
3522         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3523         (webkit_web_src_init): Make the websrc start asynchronously, this
3524         allows the main thread to be free to complete resource loader
3525         setup.
3526         (webKitWebSrcCreate): Calling start() from the create() vfunc is a
3527         recipe for deadlock, since BaseSrc holds the streaming lock during
3528         seeks, and then calls create(). In these cases, we do not want to
3529         notify async-completion, since we've already completed from the
3530         necessarily preceeding start() vfunc, and calling it again would
3531         require the stream-lock and deadlock us.
3532         (webKitWebSrcStart): Refactor to use webKitWebSrcMakeRequest, but
3533         ensuring that we do perform an async-complete notification.
3534         (webKitWebSrcMakeRequest): What Start() used to be, but now can be
3535         toggled when to notify of async-completion. Start() no longer
3536         blocks, since the return value of initiating a resource loader is
3537         of no interest to the callers.
3538         (webKitWebSrcCloseSession): Similarly to Start(), we do not need
3539         to wait for the completion of cancelled net requests.
3540
3541 2019-07-08  Chris Dumez  <cdumez@apple.com>
3542
3543         Unable to play videos on xfinity.com/stream on macOS Catalina
3544         https://bugs.webkit.org/show_bug.cgi?id=199576
3545         <rdar://problem/50101264>
3546
3547         Reviewed by Alex Christensen.
3548
3549         Enable invalidate Fetch signal quirk for all sites as the blacklist is getting too large and
3550         we are finding too much breakage too late in the release cycle.
3551
3552         * Modules/fetch/FetchRequest.cpp:
3553         (WebCore::processInvalidSignal):
3554         * page/Quirks.cpp:
3555         (WebCore::Quirks::shouldIgnoreInvalidSignal const):
3556
3557 2019-07-08  Youenn Fablet  <youenn@apple.com>
3558
3559         MediaStreamTrackPrivate should always call readyStateChanged on the main thread
3560         https://bugs.webkit.org/show_bug.cgi?id=199538
3561         <rdar://problem/52709106>
3562
3563         Reviewed by Eric Carlson.
3564
3565         MediaStreamTrackPrivate is sometimes calling readyStateChanged in a
3566         background thread inside its audioSamplesAvailable method.
3567         Instead of doing that, we hop to the main thread to call readyStateChanged.
3568         Once the call is made in the main thread, MediaStreamTrackPrivate will
3569         send the audio samples to its observers.
3570
3571         To make mock audio source closer to real capture audio sources,
3572         audioSamplesAvailable is called on a background thread.
3573         RealtimeMediaSource is updated to always be destroyed in the main
3574         run loop since it is WebKit2 only.
3575
3576         Covered by existing tests and making sure the mock audio source calls
3577         the audioSamplesAvailable method on a background thread.
3578
3579         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3580         (WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
3581         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
3582         * platform/mediastream/MediaStreamTrackPrivate.h:
3583         * platform/mediastream/RealtimeMediaSource.cpp:
3584         (WebCore::RealtimeMediaSource::scheduleDeferredTask):
3585         scheduleDeferredTask may be called from a background thread.
3586         It is thus safer to ref the source instead of creating a weak pointer.
3587         * platform/mediastream/RealtimeMediaSource.h:
3588         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
3589         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac):
3590         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
3591         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
3592         (WebCore::MockRealtimeAudioSourceMac::render):
3593         (WebCore::MockRealtimeAudioSourceMac::settingsDidChange):
3594         * platform/mock/MockRealtimeAudioSource.cpp:
3595         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
3596         (WebCore::MockRealtimeAudioSource::tick):
3597         * platform/mock/MockRealtimeAudioSource.h:
3598
3599 2019-07-08  Youenn Fablet  <youenn@apple.com>
3600
3601         Register a MediaStreamTrack as media producer only if it is a capture track
3602         https://bugs.webkit.org/show_bug.cgi?id=199566
3603
3604         Reviewed by Eric Carlson.
3605
3606         MediaStreamTrack registration as a media producer is only useful for capture tracks.
3607         Otherwise, the audio/video playing state is computed through HTMLMediaElement.
3608         Do not register MediaStreamTrack as a media producer if it is not a capture track.
3609
3610         Set the muted state of the track before registering it as an audio
3611         producer. Otherwise, it might create unnecessary small change of playing state.
3612         Covered by existing tests.
3613
3614         * Modules/mediastream/MediaStreamTrack.cpp:
3615         (WebCore::MediaStreamTrack::MediaStreamTrack):
3616         (WebCore::MediaStreamTrack::~MediaStreamTrack):
3617         * Modules/mediastream/MediaStreamTrack.h:
3618
3619 2019-07-08  Simon Fraser  <simon.fraser@apple.com>
3620
3621         YouTube embedding iframes in WebView sometimes go blank when the video starts playing
3622         https://bugs.webkit.org/show_bug.cgi?id=199600
3623         rdar://problem/47806012
3624
3625         Reviewed by Tim Horton.
3626
3627         With some combinations of nested iframes that are being resized from empty, and toggling into
3628         compositing mode, we'd fail to update compositing in the iframe's enclosing document, so never
3629         host the iframes's layers.
3630
3631         Fix by moving some widget-resize-related code into RenderLayerCompositor::widgetDidChangeSize(),
3632         and adding code to schedule a compositing update.
3633
3634         I was unable to come up with a layout test for this.
3635
3636         * rendering/RenderLayerCompositor.cpp:
3637         (WebCore::RenderLayerCompositor::widgetDidChangeSize):
3638         * rendering/RenderLayerCompositor.h:
3639         * rendering/RenderWidget.cpp:
3640         (WebCore::RenderWidget::setWidgetGeometry):
3641
3642 2019-07-08  Antoine Quint  <graouts@apple.com>
3643
3644         [Pointer Events] Enable only on the most recent version of the supported iOS family
3645         https://bugs.webkit.org/show_bug.cgi?id=199562
3646         <rdar://problem/52766511>
3647
3648         Reviewed by Dean Jackson.
3649
3650         * Configurations/FeatureDefines.xcconfig:
3651
3652 2019-07-08  Philippe Normand  <pnormand@igalia.com>
3653
3654         [GStreamer] The CREATE_TRACK macro is messed up
3655         https://bugs.webkit.org/show_bug.cgi?id=199356
3656
3657         Reviewed by Xabier Rodriguez-Calvar.
3658
3659         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3660         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Fix the
3661         CREATE_TRACK macro for !VIDEO_TRACK builds.
3662
3663 2019-07-07  Zalan Bujtas  <zalan@apple.com>
3664
3665         [ContentChangeObserver] Difficult to control videos on iqiyi.com as the actions are mouse hover
3666         https://bugs.webkit.org/show_bug.cgi?id=199542
3667         <rdar://problem/51886813>
3668
3669         Reviewed by Simon Fraser.
3670
3671         Decouple isVisuallyHidden and isConsideredVisible. Just because an element is not visually hidden (1px wide content)
3672         it is not necessarily qualified to be visible in the context of hover heuristic (e.g. iqiyi.com brings up a 1px wide
3673         clickable element when hovering over the scrubber. This element is clearly not designed to be actionable.)
3674
3675         Tests: fast/events/touch/ios/content-observation/tap-on-1px-height-content.html
3676                fast/events/touch/ios/content-observation/tap-on-1px-width-content.html
3677
3678         * dom/Node.cpp:
3679         (WebCore::Node::defaultEventHandler):
3680         * page/ios/ContentChangeObserver.cpp:
3681         (WebCore::ContentChangeObserver::isVisuallyHidden):
3682         (WebCore::ContentChangeObserver::isConsideredVisible):
3683         (WebCore::ContentChangeObserver::didAddTransition):
3684         (WebCore::ContentChangeObserver::didFinishTransition):
3685         (WebCore::ContentChangeObserver::willDestroyRenderer):
3686         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
3687         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
3688         (WebCore::ContentChangeObserver::isConsideredHidden): Deleted.
3689         * page/ios/ContentChangeObserver.h:
3690
3691 2019-07-07  Zalan Bujtas  <zalan@apple.com>
3692
3693         [LFC][IFC] Introduce splitPosition to LineLayout
3694         https://bugs.webkit.org/show_bug.cgi?id=199558
3695         <rdar://problem/52737649>
3696
3697         Reviewed by Antti Koivisto.
3698
3699         This is in preparation for breaking runs at line end.
3700
3701         * layout/inlineformatting/InlineFormattingContext.h:
3702         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3703         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput):
3704         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
3705         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
3706         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
3707
3708 2019-07-07  Zalan Bujtas  <zalan@apple.com>
3709
3710         [LFC] Fix formatting context root for inflow positioned inline containers
3711         https://bugs.webkit.org/show_bug.cgi?id=199551
3712         <rdar://problem/52728868>
3713
3714         Reviewed by Antti Koivisto.
3715
3716         Relatively positioned (inflow) inline container lives in the formatting context where its parent lives unless
3717         the parent establishes a formatting context. This is slightly different from the usual behavior which is containing block driven.
3718
3719         div id=outer style="position: absolute">><div id=inner><span style="position: relative">content</span></div></div>
3720
3721         While the relatively positioned inline container (span) is placed relative to its containing block "outer", it lives in the inline formatting context established by "inner".
3722
3723         * layout/FormattingContext.cpp:
3724         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3725         * layout/layouttree/LayoutBox.cpp:
3726         (WebCore::Layout::Box::formattingContextRoot const):
3727         * layout/layouttree/LayoutBox.h:
3728         * layout/layouttree/LayoutInlineContainer.cpp:
3729         (WebCore::Layout::InlineContainer::formattingContextRoot const):
3730         * layout/layouttree/LayoutInlineContainer.h:
3731
3732 2019-07-06  Simon Fraser  <simon.fraser@apple.com>
3733
3734         Long hang when loading a cnn.com page on iOS
3735         https://bugs.webkit.org/show_bug.cgi?id=199556
3736
3737         Reviewed by Zalan Bujtas.
3738         
3739         Loading https://edition.cnn.com/travel/article/brussels-airlines-flight-to-nowhere/index.html in the iOS 13 sim
3740         results in a long hang under OverlapMapContainer::append(). We were creating pathological clipping scopes with
3741         thousands of entries, because OverlapMapContainer::mergeClippingScopesRecursive() had a logic error where
3742         it added 'sourceScope' to the child instead of 'sourceChildScope'. Add a new assertion to detect that case.
3743         
3744         I wasn't able to create a testcase that caused a hang, but a number of existing tests would have
3745         hit the assertion.
3746
3747         * rendering/LayerOverlapMap.cpp:
3748         (WebCore::OverlapMapContainer::ClippingScope::addChild):
3749         (WebCore::OverlapMapContainer::mergeClippingScopesRecursive):
3750         * rendering/RenderLayerCompositor.cpp:
3751         (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Drive-by fix: m_overflowControlsHostLayer is null on iOS, so use rootGraphicsLayer().
3752
3753 2019-07-05  Youenn Fablet  <youenn@apple.com>
3754
3755         Carvana.com needs the fetch AbortSignal quirk
3756         https://bugs.webkit.org/show_bug.cgi?id=199540
3757
3758         Reviewed by Chris Dumez.
3759
3760         Manually tested.
3761
3762         * page/Quirks.cpp:
3763         (WebCore::Quirks::shouldIgnoreInvalidSignal const):
3764
3765 2019-07-05  Robin Morisset  <rmorisset@apple.com>
3766
3767         [WHLSL] The checker does not need to keep a separate m_typeAnnotations map
3768         https://bugs.webkit.org/show_bug.cgi?id=199537
3769
3770         Reviewed by Myles C. Maxfield.
3771
3772         Nothing is ever deleted from it, and all of its contents are eventually copied into the expressions.
3773         We might as well put the type annotations directly into the expressions in the first place.
3774         It is about a 5% speedup of the checker.
3775
3776         No new test as there is no inteded functional change.
3777
3778         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3779         (WebCore::WHLSL::Checker::assignTypes):
3780         (WebCore::WHLSL::Checker::getInfo):
3781         (WebCore::WHLSL::Checker::assignType):
3782         (WebCore::WHLSL::Checker::forwardType):
3783         (WebCore::WHLSL::Checker::visit):
3784
3785 2019-07-05  Youenn Fablet  <youenn@apple.com> and Simon Fraser  <simon.fraser@apple.com>
3786
3787         Trigger a compositing update when video element is changing
3788         https://bugs.webkit.org/show_bug.cgi?id=199522
3789         <rdar://problem/47297159>
3790
3791         Reviewed by Simon Fraser.
3792
3793         Test: compositing/video/video-update-rendering.html
3794
3795         * rendering/RenderLayerBacking.cpp:
3796         (WebCore::RenderLayerBacking::contentChanged):
3797
3798 2019-07-05  Michael Catanzaro  <mcatanzaro@igalia.com>
3799
3800         Unreviewed, fix -Wmisleading-indentation warning introduced in r246764
3801         https://bugs.webkit.org/show_bug.cgi?id=199173
3802         <rdar://problem/45968770>
3803
3804         * contentextensions/ContentExtensionsBackend.cpp:
3805         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
3806
3807 2019-07-05  Timothy Hatcher  <timothy@apple.com>
3808
3809         Mail's use of punchOutWhiteBackgroundsInDarkMode not working on iOS.
3810         https://bugs.webkit.org/show_bug.cgi?id=199534
3811         rdar://problem/52586836
3812
3813         Reviewed by Simon Fraser.
3814
3815         Tests: css3/color-filters/punch-out-white-backgrounds.html
3816
3817         * dom/Document.cpp:
3818         (WebCore::Document::compositeOperatorForBackgroundColor const): Added.
3819         Use CompositeDestinationOut for transparent frames, otherwise CompositeDestinationIn.
3820         * dom/Document.h:
3821         * rendering/InlineFlowBox.cpp:
3822         (WebCore::InlineFlowBox::paintBoxDecorations): Use compositeOperatorForBackgroundColor.
3823         * rendering/RenderBox.cpp:
3824         (WebCore::RenderBox::paintRootBoxFillLayers): Ditto.
3825         (WebCore::RenderBox::paintBackground): Ditto.
3826         * rendering/RenderTableCell.cpp:
3827         (WebCore::RenderTableCell::paintBackgroundsBehindCell): Ditto.
3828
3829 2019-07-05  Jer Noble  <jer.noble@apple.com>
3830
3831         Revert change to block playback when process is ostensibly "suspended".
3832         https://bugs.webkit.org/show_bug.cgi?id=199530
3833
3834         Reviewed by Eric Carlson.
3835
3836         In r243958, a drive-by-fix was added that blocked playback when the WebProcess thought it
3837         was susposed to be suspended. The intent was to keep the AVAudioSession for the process
3838         from being activated just before the process was suspended, and thus avoid receiving an
3839         "interruption" and having the AVAudioSession deactivated out from under us upon resuming.
3840
3841         Unfortunately, this caused problems when another process resumes the WebContent process
3842         in order to start playback; namely the Now Playing UI's play button. Because we may receive
3843         the play command long before whe notice that we've been resumed, the WebContent process
3844         may refuse to honor the play command because it thinks its supposed to be suspended.
3845
3846         * platform/audio/PlatformMediaSessionManager.cpp:
3847         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
3848
3849 2019-07-05  Ryosuke Niwa  <rniwa@webkit.org>
3850
3851         [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
3852         https://bugs.webkit.org/show_bug.cgi?id=199503
3853
3854         Reviewed by Wenson Hsieh.
3855
3856         * editing/Editor.cpp:
3857         (WebCore::Editor::compositionRange const): Added a FIXME.
3858
3859 2019-07-02  Myles C. Maxfield  <mmaxfield@apple.com>
3860
3861         [WHLSL] Standard library is too big to directly include in WebCore
3862         https://bugs.webkit.org/show_bug.cgi?id=198186
3863         <rdar://problem/51288898>
3864
3865         Reviewed by Saam Barati.
3866
3867         This patch adds almost the entire remainder of the standard library. There are a few
3868         pieces missing:
3869         - step() because of https://bugs.webkit.org/show_bug.cgi?id=199289
3870         - sign() also because of https://bugs.webkit.org/show_bug.cgi?id=199289
3871         - faceforward() because it calls sign()
3872         - Some of the more rarely-used texturing functions (e.g. Gather()) https://bugs.webkit.org/show_bug.cgi?id=195813
3873         - RWTextures https://bugs.webkit.org/show_bug.cgi?id=198985
3874
3875         There were two problems with adding so many standard library functions:
3876         - We didn't want to increase the WebCore binary size that much
3877         - Compiling all the functions at runtime took 7 seconds, which is much too long
3878
3879         This patch addresses the first problem by gzipping the standard library before including it in the binary.
3880         At runtime, we use libcompression to unzip it.
3881
3882         To address the second problem, we did some analysis and found that 14% of that 7 seconds was simply
3883         destroying all the AST nodes. Even if we eliminated all processing of the AST, simply having the AST
3884         of the entire standard library built and destroyed would still be too slow. Therefore, this patch limits
3885         which parts of the standard library get parsed in the first place. All the functions in the standard library
3886         file are sorted by name, and each group of functions with the same name are preceeded by a comment of the
3887         form /* Functions named xyz */. At build time, a Python script looks for all these comments, and builds a
3888         map from function name to character offset inside the file where those functions begin. At run time, we
3889         parse the user program first, look for all function calls within it, and look up those function call names
3890         in the map to see which part of the standard library holds those functions. We then parse just that part.
3891         Because the standard library can call other functions in the standard library, we do this in a loop until
3892         we have exhausted all the functions.
3893
3894         Covered by existing tests.
3895
3896         * DerivedSources-input.xcfilelist:
3897         * DerivedSources-output.xcfilelist:
3898         * DerivedSources.make: gzip the standard library, and add a build step to generate the offset map.
3899         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
3900         (WebCore::WHLSL::AST::CallExpression::setOverloads):
3901         (WebCore::WHLSL::AST::CallExpression::function): Every caller of this ASSERT()s the result. Might as well
3902         move the ASSERT() into the function.
3903         (WebCore::WHLSL::AST::CallExpression::setFunction):
3904         * Modules/webgpu/WHLSL/Cocoa/WHLSLStandardLibraryUtilities.cpp: Added.
3905         (WebCore::WHLSL::decompressStandardLibrary): Use libcompression. This is why this file is in a Cocoa/
3906         subfolder, and is listed in SourcesCocoa.txt instead of Sources.txt.
3907         (WebCore::WHLSL::decompressAndDecodeStandardLibrary):
3908         (WebCore::WHLSL::NameFinder::takeFunctionNames):
3909         (WebCore::WHLSL::includeStandardLibrary): Include only the bits of the standard library which are relevant,
3910         as described above.
3911         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Only emit MSL code for functions which are actually
3912  &nbs