db4ad8b92fa2e02e27ed3c6e9289c027cfa618bf
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-07-29  Simon Fraser  <simon.fraser@apple.com>
2
3         The touch-action property was ignored on replaced elements (canvas, img etc)
4         https://bugs.webkit.org/show_bug.cgi?id=200205
5         rdar://problem/53331224
6
7         Reviewed by Antti Koivisto.
8
9         The event region painting code didn't handle replaced elements correctly,
10         causing touch-action to get ignored for <canvas>, <img> etc. Fix by handling
11         region painting in RenderReplaced.
12
13         This still doesn't fix <iframe> but I'm not sure what the correct behavior is there
14         (webkit.org/b/200204).
15
16         Test: pointerevents/ios/touch-action-region-replaced-elements.html
17
18         * rendering/RenderReplaced.cpp:
19         (WebCore::RenderReplaced::paint):
20         (WebCore::RenderReplaced::shouldPaint):
21
22 2019-07-29  Philippe Normand  <pnormand@igalia.com>
23
24         REGRESSION(r243058): [GStreamer] WebKitWebSrc's internal queue can exhaust the WebProcess memory
25         https://bugs.webkit.org/show_bug.cgi?id=199998
26
27         Reviewed by Xabier Rodriguez-Calvar.
28
29         With the webkitwebsrc rewrite the element lost its ability to tell
30         the resource loader when to pause and resume downloading because
31         we don't use appsrc and its enough-data/need-data signals anymore.
32         So new heuristics are introduced with this patch. Downloading of
33         resources bigger than 2MiB might pause when the internal adapter
34         has enough data (2% of the full resource) and resume when the
35         adapter size goes below 20% of those 2%.
36
37         No new tests, the media element spec doesn't clearly mandate how
38         the resource loading should behave when the element is paused or
39         how aggressively the resource should be downloaded during
40         playback.
41
42         This patch was functionally tested with a 1.3GiB resource loaded
43         over the local network, the resource was downloaded in ~30MiB
44         chunks, stopping and resuming every 20 seconds, approximately.
45
46         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
47         (webkit_web_src_class_init):
48         (webKitWebSrcCreate):
49         (CachedResourceStreamingClient::responseReceived):
50         (CachedResourceStreamingClient::dataReceived):
51
52 2019-07-29  Carlos Garcia Campos  <cgarcia@igalia.com>
53
54         WebSockets: workers never use the platform WebSockets path
55         https://bugs.webkit.org/show_bug.cgi?id=200161
56
57         Reviewed by Michael Catanzaro.
58
59         A WebCore::WebSocketChannel is created unconditionally in WorkerThreadableWebSocketChannel::Peer.
60
61         * Modules/websockets/ThreadableWebSocketChannel.cpp:
62         (WebCore::ThreadableWebSocketChannel::create): New create method that receives a Document& and creates the
63         WebSocket channel checking the runtime enabled features to decide.
64         * Modules/websockets/ThreadableWebSocketChannel.h:
65         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
66         (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer): Use ThreadableWebSocketChannel::create().
67
68 2019-07-29  Carlos Garcia Campos  <cgarcia@igalia.com>
69
70         Multiple context menu actions broken for YouTube videos
71         https://bugs.webkit.org/show_bug.cgi?id=199999
72
73         Reviewed by Eric Carlson.
74
75         Do not include CopyMediaLinkItem and OpenMediaInNewWindowItem to the context menu when media URL is not
76         downloadable or the request can't be handled.
77
78         * page/ContextMenuController.cpp:
79         (WebCore::ContextMenuController::populate):
80
81 2019-07-28  Commit Queue  <commit-queue@webkit.org>
82
83         Unreviewed, rolling out r247886.
84         https://bugs.webkit.org/show_bug.cgi?id=200214
85
86         "Causes PLT5 regression on some machines" (Requested by mlam|a
87         on #webkit).
88
89         Reverted changeset:
90
91         "Add crash diagnostics for debugging unexpected zapped cells."
92         https://bugs.webkit.org/show_bug.cgi?id=200149
93         https://trac.webkit.org/changeset/247886
94
95 2019-07-28  Tim Horton  <timothy_horton@apple.com>
96
97         Fix the release build
98
99         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
100         (WebCore::WHLSL::Metal::TypeNamer::insert):
101
102 2019-07-28  Simon Fraser  <simon.fraser@apple.com>
103
104         [iOS] Touch regions overlay needs to show touch-action:none
105         https://bugs.webkit.org/show_bug.cgi?id=200203
106
107         Reviewed by Wenson Hsieh.
108
109         When I added touch-action overlay painting, I didn't realize that touch-action:none
110         was an important value to display. But it is, so fix that.
111
112         * rendering/RenderLayerBacking.cpp:
113         (WebCore::patternForTouchAction):
114
115 2019-07-27  Saam Barati  <sbarati@apple.com>
116
117         [WHLSL] Remove UnnamedType copy/move constructors and mark classes as final
118         https://bugs.webkit.org/show_bug.cgi?id=200188
119
120         Reviewed by Myles C. Maxfield.
121
122         Since they are ref counted, you should make taking a ref to them
123         instead of moving or copying them. This patch encodes that by deleting
124         the relevant copy/move constructors and assignment operators.
125
126         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
127         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
128         (WebCore::WHLSL::AST::ArrayType::ArrayType): Deleted.
129         (WebCore::WHLSL::AST::ArrayType::create): Deleted.
130         (WebCore::WHLSL::AST::ArrayType::type const): Deleted.
131         (WebCore::WHLSL::AST::ArrayType::type): Deleted.
132         (WebCore::WHLSL::AST::ArrayType::numElements const): Deleted.
133         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
134         (WebCore::WHLSL::AST::PointerType::PointerType): Deleted.
135         (WebCore::WHLSL::AST::PointerType::create): Deleted.
136         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
137         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
138         (WebCore::WHLSL::AST::TypeReference::TypeReference): Deleted.
139         (WebCore::WHLSL::AST::TypeReference::create): Deleted.
140         (WebCore::WHLSL::AST::TypeReference::name): Deleted.
141         (WebCore::WHLSL::AST::TypeReference::typeArguments): Deleted.
142         (WebCore::WHLSL::AST::TypeReference::maybeResolvedType const): Deleted.
143         (WebCore::WHLSL::AST::TypeReference::resolvedType const): Deleted.
144         (WebCore::WHLSL::AST::TypeReference::setResolvedType): Deleted.
145         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
146
147 2019-07-27  Justin Fan  <justin_fan@apple.com>
148
149         [WebGPU] Update GPUComputePipeline errors to match GPURenderPipeline implementation
150         https://bugs.webkit.org/show_bug.cgi?id=200097
151
152         Reviewed by Myles C. Maxfield.
153
154         Remove passing around a functionName in GPUComputePipeline creation in favor of setting it on the GPUErrorScopes.
155         Also, WebGPU objects no longer create new Ref<>s unless object creation succeeds.
156
157         No new tests. Covered by existing tests.
158
159         * Modules/webgpu/WebGPUDevice.cpp:
160         (WebCore::WebGPUDevice::createBuffer const):
161         (WebCore::WebGPUDevice::createBufferMapped const):
162         (WebCore::WebGPUDevice::createComputePipeline const):
163         * platform/graphics/gpu/GPUBuffer.h:
164         * platform/graphics/gpu/GPUComputePipeline.h:
165         * platform/graphics/gpu/GPUDevice.cpp:
166         (WebCore::GPUDevice::tryCreateBuffer):
167         (WebCore::GPUDevice::tryCreateComputePipeline const):
168         * platform/graphics/gpu/GPUDevice.h:
169         * platform/graphics/gpu/GPUErrorScopes.cpp:
170         (WebCore::GPUErrorScopes::generatePrefixedError): Only validaton errors have messages right now.
171         * platform/graphics/gpu/GPUErrorScopes.h:
172         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
173         (WebCore::GPUBuffer::validateBufferUsage):
174         (WebCore::GPUBuffer::tryCreate):
175         (WebCore::GPUBuffer::GPUBuffer):
176         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
177         (WebCore::trySetMetalFunctions):
178         (WebCore::trySetFunctions):
179         (WebCore::convertComputePipelineDescriptor):
180         (WebCore::tryCreateMTLComputePipelineState):
181         (WebCore::GPUComputePipeline::tryCreate):
182         (WebCore::GPUComputePipeline::GPUComputePipeline):
183         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
184         (WebCore::trySetMetalFunctions):
185         (WebCore::trySetFunctions):
186
187         These classes were made RefCounted in a previous patch; remove their move ctors to fix build.
188         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
189         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
190         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
191         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
192         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
193         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
194
195 2019-07-27  Andres Gonzalez  <andresg_22@apple.com>
196
197         Expose the aria-label attribute for <video> elements.
198         https://bugs.webkit.org/show_bug.cgi?id=200169
199         <rdar://problem/51754558>
200
201         Reviewed by Chris Fleizach.
202
203         Tests: accessibility/ios-simulator/media-with-aria-label.html
204                accessibility/media-with-aria-label.html
205
206         We now expose the <video> element to accessibility clients as long as auto-play is not enabled.
207         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
208         (-[WebAccessibilityObjectWrapper accessibilityIsWebInteractiveVideo]):
209
210 2019-07-26  Saam Barati  <sbarati@apple.com>
211
212         Unreviewed. Remove invalid assertion after r247878.
213         We were essentially asserting all UnnamedType* were
214         unique. But my patch made this no longer the case by
215         design to make things faster.
216
217         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
218         (WebCore::WHLSL::Metal::TypeNamer::insert):
219
220 2019-07-26  Mark Lam  <mark.lam@apple.com>
221
222         Add crash diagnostics for debugging unexpected zapped cells.
223         https://bugs.webkit.org/show_bug.cgi?id=200149
224         <rdar://problem/53570112>
225
226         Reviewed by Yusuke Suzuki, Saam Barati, and Michael Saboff.
227
228         No new tests because this is a feature for debugging crashes.  It has been tested
229         manually by modifying the code to force a crash at the point of interest.
230
231         Added some comments to document the hashes of known subspaces.
232
233         * bindings/js/WebCoreJSClientData.cpp:
234         (WebCore::JSVMClientData::JSVMClientData):
235
236 2019-07-26  Ryosuke Niwa  <rniwa@webkit.org>
237
238         Moving right by word boundary right before an object element followed by a br element hangs
239         https://bugs.webkit.org/show_bug.cgi?id=200144
240
241         Reviewed by Simon Fraser.
242
243         The bug was caused by an infinite loop inside wordBreakIteratorForMinOffsetBoundary when it's trying to
244         find the previous word boundary at the beginning of a word after the object element and the br element.
245         In this case, previousBox is at the br element after the object element in the preceding line, and
246         logicallyPreviousBox ends up returning the same inline box (that of the br element), causing a hang.
247
248         Here's how. In logicallyPreviousBox, previousRootInlineBoxCandidatePosition returns a legacy position
249         immediately after the object element. The root inline box for this position (previousRoot) is the one
250         that contains the object element and the br element. However, when previousTextOrLineBreakBox is called
251         on this root inline box, "box" argument of the function is set to nullptr, and as a result, the function
252         finds and returns the same inline box of the br element that was passed to logicallyPreviousBox.
253
254         Fixed the bug by passing the starting inline box to previousRootInlineBoxCandidatePosition when its
255         root inline box is the previous root inline box (previousRoot). Also applied the same fix to
256         logicallyNextBox even though we don't have a reproduction for that case for now (RTL test case is
257         unaffected by nextRootInlineBoxCandidatePosition).
258
259         Tests: editing/selection/move-by-word-visually-across-object-element-1.html
260                editing/selection/move-by-word-visually-across-object-element-2.html
261                editing/selection/move-by-word-visually-across-object-element-3.html
262
263         * editing/VisibleUnits.cpp:
264         (WebCore::logicallyPreviousBox): Fixed the bug.
265         (WebCore::logicallyNextBox): Ditto.
266
267 2019-07-26  Brady Eidson  <beidson@apple.com>
268
269         Do not fire readystatechange events at documents about to get replaced by javascript URLs.
270         <rdar://problem/51665406> and https://bugs.webkit.org/show_bug.cgi?id=198786
271
272         Reviewed by Ryosuke Niwa.
273
274         Test: http/tests/dom/ready-state-on-javascript-replace.html
275
276         We were firing too many readystatechange events, more than other browsers.
277         Our behavior on this test with this patch now matches Chrome.
278
279         (There was even an ancient FIXME alluding to this referencing a spec issue, and that issues has long been resolvedv)
280
281         * loader/FrameLoader.cpp:
282         (WebCore::FrameLoader::stopLoading):
283
284 2019-07-26  Zalan Bujtas  <zalan@apple.com>
285
286         [iPadOS] wix.com cannot select a template to edit or view
287         https://bugs.webkit.org/show_bug.cgi?id=200174
288         <rdar://problem/53281296>
289
290         Reviewed by Simon Fraser.
291
292         Opt out of simulated mouse event sending for template selection on wix.com.
293         When wix.com receives a simulated mouse event during the touch events, it calls preventDefault() which prevents us from running the hover heuristics -> no click.
294
295         * page/Quirks.cpp:
296         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
297
298 2019-07-26  Saam Barati  <sbarati@apple.com>
299
300         [WHLSL] UnnamedType should be reference counted
301         https://bugs.webkit.org/show_bug.cgi?id=200098
302
303         Reviewed by Dean Jackson.
304
305         This patch makes UnnamedType reference counted. The motivation for doing this
306         is I measured how many times we were cloning UnnamedTypes, and I found we were
307         doing it ~433,000 times in some of Justin's demos. This is hugely wasteful,
308         given that an UnnamedType is immutable in the sense that once the type is
309         resolved, it will never change. So instead of repeatedly cloning the same
310         type, and having Expression point to a UniqueRef of UnnamedType, we should
311         instead make UnnamedType reference counted, and have expressions point to a
312         potentially shared UnnamedType.
313         
314         Doing this is hugely beneficial to WHLSL compile times. On Justin's demos,
315         these are the results I'm getting:
316         
317         hello-triangle: neutral
318         hello-cube: 55% faster
319         compute-blur: 35% faster
320         textured-cube: 49% faster
321
322         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
323         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
324         (WebCore::WHLSL::AST::ArrayReferenceType::create):
325         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
326         (WebCore::WHLSL::AST::ArrayType::ArrayType):
327         (WebCore::WHLSL::AST::ArrayType::create):
328         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
329         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
330         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
331         (WebCore::WHLSL::AST::Expression::setType):
332         (WebCore::WHLSL::AST::Expression::copyTypeTo const):
333         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
334         (WebCore::WHLSL::AST::FloatLiteral::clone const):
335         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
336         (WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
337         (WebCore::WHLSL::AST::FloatLiteralType::clone const):
338         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
339         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
340         (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
341         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
342         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
343         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
344         (WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
345         (WebCore::WHLSL::AST::IntegerLiteralType::clone const):
346         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
347         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
348         (WebCore::WHLSL::AST::NullLiteral::clone const):
349         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
350         (WebCore::WHLSL::AST::PointerType::PointerType):
351         (WebCore::WHLSL::AST::PointerType::create):
352         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
353         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
354         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
355         (WebCore::WHLSL::AST::ReferenceType::ReferenceType):
356         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
357         (WebCore::WHLSL::AST::ResolvableType::resolve):
358         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
359         (WebCore::WHLSL::AST::StructureElement::StructureElement):
360         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp:
361         (WebCore::WHLSL::AST::clone):
362         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h:
363         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
364         (WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
365         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
366         (WebCore::WHLSL::AST::TypeReference::wrap):
367         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
368         (WebCore::WHLSL::AST::TypeReference::create):
369         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const): Deleted.
370         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
371         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
372         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
373         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
374         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
375         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
376         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
377         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
378         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
379         (WebCore::WHLSL::Metal::vectorInnerType):
380         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
381         (WebCore::WHLSL::Metal::writeNativeType):
382         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
383         (WebCore::WHLSL::AutoInitialize::visit):
384         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
385         (WebCore::WHLSL::DuplicateFunctionKey::hash const):
386         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
387         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
388         (WebCore::WHLSL::resolveWithOperatorLength):
389         (WebCore::WHLSL::resolveWithReferenceComparator):
390         (WebCore::WHLSL::resolveByInstantiation):
391         (WebCore::WHLSL::checkOperatorOverload):
392         (WebCore::WHLSL::Checker::assignTypes):
393         (WebCore::WHLSL::matchAndCommit):
394         (WebCore::WHLSL::commit):
395         (WebCore::WHLSL::Checker::assignConcreteType):
396         (WebCore::WHLSL::Checker::assignType):
397         (WebCore::WHLSL::Checker::forwardType):
398         (WebCore::WHLSL::Checker::visit):
399         (WebCore::WHLSL::getUnnamedType):
400         (WebCore::WHLSL::argumentTypeForAndOverload):
401         (WebCore::WHLSL::Checker::finishVisiting):
402         (WebCore::WHLSL::Checker::isBoolType):
403         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
404         (WebCore::WHLSL::matchAndCommit):
405         (WebCore::WHLSL::commit):
406         (WebCore::WHLSL::inferTypesForTypeArguments):
407         (WebCore::WHLSL::inferTypesForCallImpl):
408         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
409         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
410         (WebCore::WHLSL::Intrinsics::addVector):
411         (WebCore::WHLSL::Intrinsics::addMatrix):
412         (WebCore::WHLSL::Intrinsics::addTexture):
413         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
414         (WebCore::WHLSL::Parser::parseTypeArgument):
415         (WebCore::WHLSL::Parser::parseType):
416         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
417         (WebCore::WHLSL::Parser::parseVariableDeclaration):
418         (WebCore::WHLSL::Parser::parseVariableDeclarations):
419         * Modules/webgpu/WHLSL/WHLSLParser.h:
420         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
421         (WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
422         (WebCore::WHLSL::PreserveLifetimes::makeStructVariableReference):
423         (WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
424         (WebCore::WHLSL::preserveVariableLifetimes):
425         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
426         (WebCore::WHLSL::wrapAnderCallArgument):
427         (WebCore::WHLSL::anderCallArgument):
428         (WebCore::WHLSL::setterCall):
429         (WebCore::WHLSL::getterCall):
430         (WebCore::WHLSL::modify):
431         (WebCore::WHLSL::PropertyResolver::visit):
432         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
433         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
434         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
435         (WebCore::WHLSL::conversionCost):
436         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
437         (WebCore::WHLSL::ResolvingType::ResolvingType):
438         (WebCore::WHLSL::ResolvingType::getUnnamedType):
439         (WebCore::WHLSL::ResolvingType::visit):
440         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
441         (WebCore::WHLSL::synthesizeArrayOperatorLength):
442         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
443         (WebCore::WHLSL::synthesizeConstructors):
444         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
445         (WebCore::WHLSL::synthesizeEnumerationFunctions):
446         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
447         (WebCore::WHLSL::synthesizeStructureAccessors):
448         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
449         (WebCore::WHLSL::Visitor::visit):
450
451 2019-07-26  Takashi Komori  <Takashi.Komori@sony.com>
452
453         [curl] Heap corruption in ~CurlResponse
454         https://bugs.webkit.org/show_bug.cgi?id=198320
455
456         Reviewed by Fujii Hironori.
457
458         Stop sharing object which was reffered by two threads to fix crash bug.
459
460         No tests needed, no functionality changes.
461
462         * platform/network/curl/CurlRequest.cpp:
463         (WebCore::CurlRequest::start):
464         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
465         * platform/network/curl/CurlRequest.h:
466
467 2019-07-26  Youenn Fablet  <youenn@apple.com>
468
469         slides.google.com: opening speaker notes while presenting causes a fatal error in the web app on iPad
470         https://bugs.webkit.org/show_bug.cgi?id=199933
471         <rdar://problem/53034345>
472
473         Reviewed by Darin Adler.
474
475         docs.google.com might sometimes try to window.open an about URL that not about:blank or about:srcdoc.
476         In that case, WebKit is opening a window but is considering that the window is cross origin with its opener.
477         This breaks docs.google.com as they want to access the website.
478         Add a site-specific hack so as to treat all about URLs being opened through window.open as about:blank.
479
480         Manually tested on docs.google.com website.
481
482         * page/DOMWindow.cpp:
483         (WebCore::DOMWindow::createWindow):
484         (WebCore::DOMWindow::open):
485         * page/Quirks.cpp:
486         (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
487         (WebCore::Quirks::shouldOpenAsAboutBlank const):
488         * page/Quirks.h:
489
490 2019-07-26  Alexander Mikhaylenko  <exalm7659@gmail.com>
491
492         REGRESSION(r246496): [GTK] Tapping the web view scrolls up a bit
493         https://bugs.webkit.org/show_bug.cgi?id=200084
494
495         Reviewed by Carlos Garcia Campos.
496
497         gdk_event_get_scroll_direction() returns false, but also sets direction to GDK_SCROLL_UP if
498         the direction was GDK_SCROLL_SMOOTH. Relying on zero deltas in this case is not correct, because
499         they can also be zero with GDK_SCROLL_SMOOTH. In this case, set the direction manually to avoid
500         that.
501
502         See https://gitlab.gnome.org/GNOME/gtk/issues/2048
503
504         * platform/gtk/PlatformWheelEventGtk.cpp:
505         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
506
507 2019-07-26  Rob Buis  <rbuis@igalia.com>
508
509         Make storing cross-origin top-level prefetches in HTTP cache optional
510         https://bugs.webkit.org/show_bug.cgi?id=199499
511
512         Reviewed by Youenn Fablet.
513
514         Add Internals API for adding an event listener to prefetch load.
515
516         Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html
517
518         * bindings/js/JSEventListener.h:
519         * dom/EventTarget.h:
520         (WebCore::EventTarget::addEventListener):
521         * dom/Node.h:
522         * html/HTMLLinkElement.h:
523         * testing/Internals.cpp:
524         (WebCore::Internals::addPrefetchLoadEventListener):
525         * testing/Internals.h:
526         * testing/Internals.idl:
527
528 2019-07-25  Tim Horton  <timothy_horton@apple.com>
529
530         Subpixel fringes around TextIndicator snapshots at non-integral scale factors
531         https://bugs.webkit.org/show_bug.cgi?id=200145
532
533         Reviewed by Simon Fraser.
534
535         * page/FrameSnapshotting.cpp:
536         (WebCore::snapshotFrameRectWithClip):
537         * page/FrameSnapshotting.h:
538         * page/TextIndicator.cpp:
539         (WebCore::snapshotOptionsForTextIndicatorOptions):
540         Round the scale factor up, and snappily enclose the clip rects.
541
542         TextIndicator doesn't require the use of the precise scale factor that
543         the page is painted at, but we want it to be sharp, so we overshoot!
544
545 2019-07-25  Brent Fulgham  <bfulgham@apple.com>
546
547         Use IWICBitmap (rather than ID2D1Bitmap) for NativeImagePtr on FTW
548         https://bugs.webkit.org/show_bug.cgi?id=200093
549
550         Reviewed by Dean Jackson.
551
552         When I wrote the original Direct2D code, I did not realize that the backing memory for the
553         ID2D1Bitmap was inaccessible since it is effectively a representation of GPU memory. There
554         is no API to access or modify the pixels.
555
556         Instead, MSDN documentation indicates that we should be using IWICBitmap objects, which are
557         converted to ID2D1Bitmap objects when things are ready to be rendered.
558
559         This makes it possible to use the TextureMapper backend to do efficient compositing and tile
560         drawing, since the data backing the bitmap can now be accessed and manipulated, allowing us
561         to support filters and other effects.
562
563         * PlatformFTW.cmake:
564         * platform/MIMETypeRegistry.cpp:
565         (WebCore::supportedImageMIMETypesForEncoding):
566         * platform/graphics/ANGLEWebKitBridge.h:
567         * platform/graphics/GraphicsContext.h:
568         * platform/graphics/ImageBuffer.h:
569         * platform/graphics/NativeImage.h:
570         * platform/graphics/OpenGLShims.h:
571         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
572         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
573         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
574         (WebCore::GraphicsContext3D::GraphicsContext3D):
575         (WebCore::GraphicsContext3D::platformLayer const):
576         * platform/graphics/texmap/BitmapTexture.cpp:
577         (WebCore::BitmapTexture::updateContents):
578         * platform/graphics/texmap/BitmapTextureGL.cpp:
579         (WebCore::BitmapTextureGL::updateContents):
580         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
581         (WebCore::GraphicsContext3D::~GraphicsContext3D):
582         * platform/graphics/win/GraphicsContextDirect2D.cpp:
583         (WebCore::GraphicsContext::GraphicsContext):
584         (WebCore::GraphicsContext::platformInit):
585         (WebCore::GraphicsContextPlatformPrivate::setAlpha):
586         (WebCore::GraphicsContext::drawNativeImage):
587         (WebCore::GraphicsContext::drawDeviceBitmap):
588         (WebCore::GraphicsContext::releaseWindowsContext):
589         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
590         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
591         (WebCore::GraphicsContextPlatformPrivate::beginDraw):
592         (WebCore::GraphicsContextPlatformPrivate::endDraw):
593         (WebCore::GraphicsContext::drawPattern):
594         (WebCore::GraphicsContext::clipPath):
595         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
596         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
597         (WebCore::ImageBufferData::getData const):
598         (WebCore::ImageBufferData::putData):
599         * platform/graphics/win/ImageBufferDataDirect2D.h:
600         (): Deleted.
601         * platform/graphics/win/ImageBufferDirect2D.cpp:
602         (WebCore::ImageBuffer::createCompatibleBuffer):
603         (WebCore::ImageBuffer::ImageBuffer):
604         (WebCore::createCroppedImageIfNecessary):
605         (WebCore::createBitmapImageAfterScalingIfNeeded):
606         (WebCore::ImageBuffer::copyImage const):
607         (WebCore::ImageBuffer::sinkIntoNativeImage):
608         (WebCore::ImageBuffer::copyNativeImage const):
609         (WebCore::ImageBuffer::draw):
610         * platform/graphics/win/ImageDecoderDirect2D.cpp:
611         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
612         * platform/graphics/win/ImageDirect2D.cpp:
613         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
614         * platform/graphics/win/NativeImageDirect2D.cpp:
615         (WebCore::imagingFactory):
616         (WebCore::nativeImageSize):
617         (WebCore::nativeImageHasAlpha):
618         (WebCore::nativeImageSinglePixelSolidColor):
619         (WebCore::drawNativeImage):
620         (WebCore::clearNativeImageSubimages):
621         * platform/graphics/win/PathDirect2D.cpp:
622         (WebCore::Path::strokeContains const):
623         * platform/graphics/win/PatternDirect2D.cpp:
624         (WebCore::Pattern::createPlatformPattern const):
625         * platform/win/PasteboardWin.cpp:
626         (WebCore::Pasteboard::read):
627         * rendering/RenderElement.cpp:
628         (WebCore::RenderElement::shouldRespectImageOrientation const):
629         * rendering/RenderLayerBacking.cpp:
630         (WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
631         * svg/graphics/SVGImage.cpp:
632         (WebCore::SVGImage::nativeImage):
633
634 2019-07-25  Ryosuke Niwa  <rniwa@webkit.org>
635
636         REGRESSION (r243637): Some web fonts fail to load on Google docs
637         https://bugs.webkit.org/show_bug.cgi?id=200106
638
639         Reviewed by Geoffrey Garen.
640
641         Prior to r243637, WebKit threw an exception if the font family name didn't parse as a CSS identifier in the setter
642         of `family` IDL attribute of FontFace interface because WebKit implemented the old spec faithfully unlike Chrome
643         and Firefox which basically treated it as a string and didn't throw any exception. [1]
644
645         To account for this browser behavior difference, Google docs implemented a workaround for Safari which is to wrap
646         some identifiers in font family names with quotation marks: `docs-Amatic SC` as `'docs-Amatic SC'` and
647         `docs-Playfair Display` as `docs-'Playfair Display'`. Unfortunately, this in turn causes the latest Safari to
648         not match these font face family with those that appear in stylesheet since we no longer parse it as a CSS identifier.
649
650         This patch adds a site specific quirk for Google docs to undo this workaround by stripping away single quotation marks.
651
652         [1] See https://github.com/w3c/csswg-drafts/issues/3776 for the context.
653
654         * css/FontFace.cpp:
655         (WebCore::FontFace::create):
656         (WebCore::FontFace::setFamily):
657         * css/FontFace.h:
658         * css/FontFace.idl:
659         * page/Quirks.cpp:
660         (WebCore::Quirks::shouldStripQuotationMarkInFontFaceSetFamily const):
661         * page/Quirks.h:
662
663 2019-07-25  Dean Jackson  <dino@apple.com>
664
665         Add helper for ignoring deprecated implementation warnings
666         https://bugs.webkit.org/show_bug.cgi?id=200135
667
668         Reviewed by Wenson Hsieh.
669
670         Add ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN/END macro which
671         is IGNORE_WARNINGS_BEGIN("deprecated-implementations")
672
673         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
674         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
675         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
676         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
677         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
678         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
679         (-[WebAccessibilityObjectWrapper accessibilityActionDescription:]):
680         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
681         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]): Deleted.
682         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
683         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
684         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
685         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
686         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
687         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
688
689 2019-07-25  Saam Barati  <sbarati@apple.com>
690
691         Unreviewed. Speculative build fix for tvOS of missing include.
692
693         * Modules/webgpu/WHLSL/WHLSLLexer.h:
694
695 2019-07-25  Michael Catanzaro  <mcatanzaro@igalia.com>
696
697         Unreviewed, fix -Wunused-parameter warning
698
699         * testing/Internals.cpp:
700         (WebCore::Internals::privatePlayerVolume):
701
702 2019-07-25  Saam Barati  <sbarati@apple.com>
703
704         [WHLSL] Add descriptive error messages
705         https://bugs.webkit.org/show_bug.cgi?id=195682
706         <rdar://problem/50746322>
707
708         Reviewed by Myles C. Maxfield.
709
710         This patch adds error messages to the WHLSL compiler. I'm taking a first pass
711         at having decent error messages everywhere we set an error. However, we will
712         probably refine these messages to be more accurate and descriptive over time.
713         
714         Passes that can fail no longer return a boolean. Instead, they return Expected<void, Error>.
715         From Error, we can generate a descriptive error message. Visitor::setError now
716         requires an Error as an argument. So anywhere in Visitor that might fail is
717         now required to provide an error message.
718         
719         In a follow-up to this, we should actually make our checkFail tests test that
720         they get the expected error message: https://bugs.webkit.org/show_bug.cgi?id=200049
721
722         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
723         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
724         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
725         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
726         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
727         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
728         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
729         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
730         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
731         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
732         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
733         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
734         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
735         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
736         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
737         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
738         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
739         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
740         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
741         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
742         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
743         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
744         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
745         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
746         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
747         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
748         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
749         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
750         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
751         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
752         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
753         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
754         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
755         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
756         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
757         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
758         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
759         * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h:
760         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
761         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
762         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
763         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
764         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
765         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
766         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
767         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
768         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
769         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
770         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
771         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
772         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
773         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h:
774         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
775         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
776         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
777         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
778         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
779         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
780         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
781         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
782         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
783         (WebCore::WHLSL::AutoInitialize::visit):
784         (WebCore::WHLSL::autoInitializeVariables):
785         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h:
786         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
787         (WebCore::WHLSL::checkDuplicateFunctions):
788         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h:
789         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
790         (WebCore::WHLSL::TextureReferencesChecker::visit):
791         (WebCore::WHLSL::checkTextureReferences):
792         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h:
793         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
794         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
795         (WebCore::WHLSL::resolveWithOperatorLength):
796         (WebCore::WHLSL::resolveWithReferenceComparator):
797         (WebCore::WHLSL::resolveByInstantiation):
798         (WebCore::WHLSL::resolveFunction):
799         (WebCore::WHLSL::checkSemantics):
800         (WebCore::WHLSL::Checker::assignTypes):
801         (WebCore::WHLSL::Checker::visit):
802         (WebCore::WHLSL::Checker::recurseAndGetInfo):
803         (WebCore::WHLSL::Checker::getInfo):
804         (WebCore::WHLSL::Checker::finishVisiting):
805         (WebCore::WHLSL::Checker::recurseAndRequireBoolType):
806         (WebCore::WHLSL::check):
807         * Modules/webgpu/WHLSL/WHLSLChecker.h:
808         * Modules/webgpu/WHLSL/WHLSLCodeLocation.h: Added.
809         (WebCore::WHLSL::CodeLocation::CodeLocation):
810         (WebCore::WHLSL::CodeLocation::startOffset const):
811         (WebCore::WHLSL::CodeLocation::endOffset const):
812         (WebCore::WHLSL::CodeLocation::operator== const):
813         (WebCore::WHLSL::CodeLocation::operator!= const):
814         (WebCore::WHLSL::CodeLocation::operator bool const):
815         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp:
816         (WebCore::WHLSL::computeDimensions):
817         * Modules/webgpu/WHLSL/WHLSLError.h: Added.
818         (WebCore::WHLSL::Error::Error):
819         (WebCore::WHLSL::Error::codeLocation const):
820         (WebCore::WHLSL::Error::message const):
821         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp:
822         (WebCore::WHLSL::checkFunctionStages):
823         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h:
824         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
825         (WebCore::WHLSL::Gatherer::reset):
826         (WebCore::WHLSL::Gatherer::visit):
827         (WebCore::WHLSL::gatherEntryPointItems):
828         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
829         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
830         (WebCore::WHLSL::Lexer::lineAndColumnNumberFromOffset):
831         (WebCore::WHLSL::Lexer::errorString):
832         (WebCore::WHLSL::Lexer::lineNumberFromOffset): Deleted.
833         * Modules/webgpu/WHLSL/WHLSLLexer.h:
834         (WebCore::WHLSL::CodeLocation::CodeLocation):
835         (WebCore::WHLSL::Lexer::errorString):
836         (WebCore::WHLSL::AST::CodeLocation::CodeLocation): Deleted.
837         (WebCore::WHLSL::AST::CodeLocation::startOffset const): Deleted.
838         (WebCore::WHLSL::AST::CodeLocation::endOffset const): Deleted.
839         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
840         (WebCore::WHLSL::NameResolver::~NameResolver):
841         (WebCore::WHLSL::NameResolver::visit):
842         (WebCore::WHLSL::resolveNamesInTypes):
843         (WebCore::WHLSL::resolveTypeNamesInFunctions):
844         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
845         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
846         (WebCore::WHLSL::Parser::parse):
847         (WebCore::WHLSL::intLiteralToInt):
848         (WebCore::WHLSL::uintLiteralToUint):
849         (WebCore::WHLSL::floatLiteralToFloat):
850         (WebCore::WHLSL::recognizeSimpleUnsignedInteger):
851         (WebCore::WHLSL::Parser::parseTypeArgument):
852         (WebCore::WHLSL::Parser::parseType):
853         (WebCore::WHLSL::Parser::parseForLoop):
854         (WebCore::WHLSL::Parser::parseWhileLoop):
855         (WebCore::WHLSL::Parser::parseEffectfulExpression):
856         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
857         (WebCore::WHLSL::Parser::parseSuffixOperator):
858         (WebCore::WHLSL::Parser::parseExpression):
859         (WebCore::WHLSL::Parser::completeTernaryConditional):
860         (WebCore::WHLSL::Parser::completeAssignment):
861         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
862         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
863         (WebCore::WHLSL::Parser::completePossibleShift):
864         (WebCore::WHLSL::Parser::completePossibleAdd):
865         (WebCore::WHLSL::Parser::completePossibleMultiply):
866         (WebCore::WHLSL::Parser::parsePossiblePrefix):
867         (WebCore::WHLSL::Parser::parseCallExpression):
868         * Modules/webgpu/WHLSL/WHLSLParser.h:
869         (WebCore::WHLSL::Parser::Error::Error): Deleted.
870         (WebCore::WHLSL::Parser::Error::dump const): Deleted.
871         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
872         (WebCore::WHLSL::prepareShared):
873         (WebCore::WHLSL::prepare):
874         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
875         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
876         (WebCore::WHLSL::setterCall):
877         (WebCore::WHLSL::getterCall):
878         (WebCore::WHLSL::modify):
879         (WebCore::WHLSL::PropertyResolver::visit):
880         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
881         (WebCore::WHLSL::checkRecursion):
882         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h:
883         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
884         (WebCore::WHLSL::checkRecursiveTypes):
885         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h:
886         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
887         (WebCore::WHLSL::includeStandardLibrary):
888         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
889         (WebCore::WHLSL::checkStatementBehavior):
890         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h:
891         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
892         (WebCore::WHLSL::synthesizeArrayOperatorLength):
893         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h:
894         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
895         (WebCore::WHLSL::synthesizeConstructors):
896         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h:
897         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
898         (WebCore::WHLSL::synthesizeEnumerationFunctions):
899         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h:
900         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
901         (WebCore::WHLSL::synthesizeStructureAccessors):
902         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h:
903         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
904         (WebCore::WHLSL::Visitor::hasError const):
905         (WebCore::WHLSL::Visitor::expectedError):
906         (WebCore::WHLSL::Visitor::checkErrorAndVisit):
907         (WebCore::WHLSL::Visitor::setError):
908         (WebCore::WHLSL::Visitor::error const): Deleted.
909         (): Deleted.
910         * WebCore.xcodeproj/project.pbxproj:
911         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
912         (WebCore::trySetFunctions):
913
914 2019-07-25  Saam Barati  <sbarati@apple.com>
915
916         [WHLSL] Add optional logging for phase timings
917         https://bugs.webkit.org/show_bug.cgi?id=200099
918
919         Reviewed by Dean Jackson.
920
921         As we're doing WHLSL compiler speedup work, it helps to be able to
922         log phase times. I think a few of us have written such patches locally.
923         In this patch, I'm adding a way to easily switch this logging on and
924         off by flipping a "constexpr bool" and rebuilding.
925
926         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
927         (WebCore::WHLSL::logPhaseTimes):
928         (WebCore::WHLSL::PhaseTimer::PhaseTimer):
929         (WebCore::WHLSL::PhaseTimer::~PhaseTimer):
930         (WebCore::WHLSL::prepareShared):
931         (WebCore::WHLSL::prepare):
932
933 2019-07-25  Chris Dumez  <cdumez@apple.com>
934
935         Avoid some unnecessary HashMap copies
936         https://bugs.webkit.org/show_bug.cgi?id=200129
937
938         Reviewed by Youenn Fablet.
939
940         * workers/service/server/SWServer.cpp:
941         (WebCore::SWServer::addRegistrationFromStore):
942
943 2019-07-25  Joshua Watt  <JPEW.hacker@gmail.com>
944
945         [WPE] Draw other button types
946         https://bugs.webkit.org/show_bug.cgi?id=199377
947
948         Reviewed by Michael Catanzaro.
949
950         There are other button types that should be drawn with the default style
951         besides just push buttons.
952
953         * platform/wpe/ThemeWPE.cpp:
954         (WebCore::ThemeWPE::paint):
955         (WebCore::ThemeWPE::paintButton):
956         * platform/wpe/ThemeWPE.h:
957
958 2019-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
959
960         REGRESSION (r244995): Assertion failure when addEventListener to an SVGElement which has an. instance in shadow tree
961         https://bugs.webkit.org/show_bug.cgi?id=200083
962
963         Reviewed by Ryosuke Niwa.
964
965         When adding an event listener to an SVGElement, the same event listener
966         has to be add to all the instances of SVGElement in the shadow tree. See
967         SVGElement::addEventListener().
968
969         In r244995, an assertion was added to ensure if the event listener is
970         attached to an event target, the new event target has be the same as the
971         attached one. This assertion isn't correct for the event targets which 
972         were copied from the targetElement sub tree of an SVGUseElement to the
973         shadow tree.
974
975         Test: svg/custom/add-event-listener-shadow-tree-element.html
976
977         * bindings/js/JSLazyEventListener.cpp:
978         (WebCore::isCloneInShadowTreeOfSVGUseElement):
979         (WebCore::JSLazyEventListener::checkValidityForEventTarget):
980
981 2019-07-25  Truitt Savell  <tsavell@apple.com>
982
983         Unreviewed, rolling out r247821.
984
985         Caused two crashing Layout Tests
986
987         Reverted changeset:
988
989         "Make storing cross-origin top-level prefetches in HTTP cache
990         optional"
991         https://bugs.webkit.org/show_bug.cgi?id=199499
992         https://trac.webkit.org/changeset/247821
993
994 2019-07-25  Chris Dumez  <cdumez@apple.com>
995
996         Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts
997         https://bugs.webkit.org/show_bug.cgi?id=200107
998         <rdar://problem/53034592>
999
1000         Reviewed by Geoffrey Garen.
1001
1002         Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply.
1003
1004         Test: fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html
1005
1006         * page/ChromeClient.h:
1007         * testing/Internals.cpp:
1008         (WebCore::Internals::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
1009         * testing/Internals.h:
1010         * testing/Internals.idl:
1011
1012 2019-07-25  Rob Buis  <rbuis@igalia.com>
1013
1014         Make storing cross-origin top-level prefetches in HTTP cache optional
1015         https://bugs.webkit.org/show_bug.cgi?id=199499
1016
1017         Reviewed by Youenn Fablet.
1018
1019         Add Internals API for adding an event listener to prefetch load.
1020
1021         Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html
1022
1023         * bindings/js/JSEventListener.h:
1024         * dom/EventTarget.h:
1025         (WebCore::EventTarget::addEventListener):
1026         * dom/Node.h:
1027         * html/HTMLLinkElement.h:
1028         * testing/Internals.cpp:
1029         (WebCore::Internals::addPrefetchLoadEventListener):
1030         * testing/Internals.h:
1031         * testing/Internals.idl:
1032
1033 2019-07-24  Yusuke Suzuki  <ysuzuki@apple.com>
1034
1035         [bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
1036         https://bugs.webkit.org/show_bug.cgi?id=200103
1037
1038         Reviewed by Mark Lam.
1039
1040         No behavior change in WebCore.
1041
1042         * page/MemoryRelease.cpp:
1043         * page/ResourceUsageThread.h:
1044         (WebCore::TagInfo::TagInfo): Deleted.
1045         * page/cocoa/ResourceUsageThreadCocoa.mm:
1046         (WebCore::vmPageSize): Deleted.
1047         (WebCore::logFootprintComparison): Deleted.
1048         (WebCore::displayNameForVMTag): Deleted.
1049         (WebCore::pagesPerVMTag): Deleted.
1050
1051 2019-07-24  Devin Rousso  <drousso@apple.com>
1052
1053         Web Inspector: support `console.screenshot` with detached Nodes that are graphical
1054         https://bugs.webkit.org/show_bug.cgi?id=199309
1055
1056         Reviewed by Joseph Pecoraro.
1057
1058         Test: inspector/console/console-screenshot.html
1059
1060         * page/PageConsoleClient.cpp:
1061         (WebCore::PageConsoleClient::screenshot):
1062
1063 2019-07-24  Saam Barati  <sbarati@apple.com>
1064
1065         [WHLSL] Use bmalloc instead of system malloc for WHLSL data structures
1066         https://bugs.webkit.org/show_bug.cgi?id=200063
1067
1068         Rubber-stamped by Sam Weinig.
1069
1070         This is a 25-30% WHLSL compile time speedup on Justin's textured-cube demo
1071         and a ~40% compile time speedup on the hello-cube demo.
1072         
1073         The phases that speed up from this are:
1074         checker
1075         includeStandardLibrary
1076         autoInitializeVariables
1077         resolveProperties
1078
1079         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
1080         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
1081         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
1082         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
1083         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
1084         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
1085         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
1086         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
1087         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
1088         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
1089         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
1090         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
1091         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
1092         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
1093         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
1094         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
1095         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
1096         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
1097         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
1098         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
1099         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
1100         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
1101         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
1102         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
1103         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
1104         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
1105         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
1106         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
1107         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
1108         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
1109         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
1110         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
1111         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
1112         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
1113         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
1114         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
1115         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
1116         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
1117         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
1118         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
1119         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
1120         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h:
1121         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
1122         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
1123         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
1124         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
1125         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
1126         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
1127         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
1128         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
1129         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
1130         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
1131         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
1132         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
1133         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
1134         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
1135         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
1136         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
1137         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
1138         * Modules/webgpu/WHLSL/AST/WHLSLType.h:
1139         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
1140         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
1141         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
1142         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
1143         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
1144         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
1145         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
1146         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
1147         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
1148         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
1149
1150 2019-07-24  Devin Rousso  <drousso@apple.com>
1151
1152         Web Inspector: support `console.screenshot` with ImageData and ImageBitmap
1153         https://bugs.webkit.org/show_bug.cgi?id=199304
1154
1155         Reviewed by Joseph Pecoraro.
1156
1157         Test: inspector/console/console-screenshot.html
1158
1159         * page/PageConsoleClient.cpp:
1160         (WebCore::PageConsoleClient::screenshot):
1161
1162 2019-07-24  Devin Rousso  <drousso@apple.com>
1163
1164         Web Inspector: REGRESSION: Overlay: highlighting a ::before/::after shows the node info of the parent instead
1165         https://bugs.webkit.org/show_bug.cgi?id=200051
1166
1167         Reviewed by Joseph Pecoraro.
1168
1169         When highlighting a pseudo-element, only use the parent node for selector information. All
1170         rendering data should still come from the pseudo-element itself.
1171
1172         * inspector/InspectorOverlay.cpp:
1173         (WebCore::drawShapeHighlight):
1174         (WebCore::InspectorOverlay::drawElementTitle):
1175
1176 2019-07-24  Devin Rousso  <drousso@apple.com>
1177
1178         Web Inspector: support `console.screenshot` with subclasses of CanvasRenderingContext
1179         https://bugs.webkit.org/show_bug.cgi?id=199305
1180
1181         Reviewed by Joseph Pecoraro.
1182
1183         Test: inspector/console/console-screenshot.html
1184
1185         * page/PageConsoleClient.cpp:
1186         (WebCore::canvasRenderingContext):
1187         (WebCore::PageConsoleClient::record):
1188         (WebCore::PageConsoleClient::recordEnd):
1189         (WebCore::PageConsoleClient::screenshot):
1190
1191 2019-07-24  Youenn Fablet  <youenn@apple.com>
1192
1193         Remove MediaPlayerPrivate::supportsMuting()
1194         https://bugs.webkit.org/show_bug.cgi?id=200005
1195
1196         Reviewed by Eric Carlson.
1197
1198         Remove no longer needed interface method.
1199         No change of behavior.
1200
1201         * WebCore.order:
1202         * platform/graphics/MediaPlayer.cpp:
1203         (WebCore::MediaPlayer::setVolume):
1204         (WebCore::MediaPlayer::setMuted):
1205         * platform/graphics/MediaPlayerPrivate.h:
1206         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1207         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1208         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1209         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1210         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1211         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1212
1213 2019-07-24  Tim Horton  <timothy_horton@apple.com>
1214
1215         Daring Fireball long press highlights are unnecessarily inflated due to false illegibility
1216         https://bugs.webkit.org/show_bug.cgi?id=200064
1217
1218         Reviewed by Geoff Garen.
1219
1220         If we consider text illegible on the given estimated background color,
1221         we bail from doing a tightly fitted selection-only TextIndicator and
1222         instead just paint the page without modification into the indicator,
1223         causing ugly overlap and an excessively inflated indicator.
1224
1225         Change the mechanism we use to determine illegibility to be based on
1226         a standard, instead of a constant chosen by hand 13 years ago.
1227
1228         Test: fast/text-indicator/text-indicator-with-low-contrast-text.html
1229
1230         * platform/graphics/ColorUtilities.cpp:
1231         (WebCore::luminance):
1232         Fix a typo.
1233
1234         (WebCore::contrastRatio):
1235         Add a function that computes the contrast ratio given two colors using
1236         the formula from WCAG.
1237
1238         * platform/graphics/ColorUtilities.h:
1239         * rendering/TextPaintStyle.cpp:
1240         (WebCore::textColorIsLegibleAgainstBackgroundColor):
1241         Make use of WCAG's minimum legible contrast ratio instead of an
1242         arbitrary color difference cutoff for determining whether we consider
1243         text legible. It seems sensible and also considers the text on DF readable
1244         (which it seems to be to me!).
1245
1246         * testing/Internals.cpp:
1247         (WebCore::Internals::TextIndicatorInfo::TextIndicatorInfo):
1248         * testing/Internals.h:
1249         * testing/Internals.idl:
1250         Expose all of the text rects to Internals, not just the bounding rect.
1251         Expose some more TextIndicator options to Internals so that we can
1252         turn on the legibility mechanism.
1253
1254 2019-07-24  Devin Rousso  <drousso@apple.com>
1255
1256         Web Inspector: print the target of `console.screenshot` last so the target is the closest item to the image
1257         https://bugs.webkit.org/show_bug.cgi?id=199308
1258
1259         Reviewed by Joseph Pecoraro.
1260
1261         Right now, evaluating `console.screenshot(document, "test", 1);` will log a message to the
1262         console with `#document`, `"test"`, and `1`, all on different lines (togglable by a
1263         disclosure triangle) since `#document` isn't stringifiable.
1264
1265         The ideal situation would be to have `"test"` and `1` logged on the same line, and then have
1266         `#document` be in a disclosure triangle. This way, you can "label" your images using
1267         additional arguments (e.g. `console.screenshot(document.images[1], "second image");`), as
1268         well as provide other data.
1269
1270         If the only argument was the target, it should print as if it was `console.log(target);`.
1271
1272         If there are no arguments, it should print the text "Viewport"` before the image.
1273
1274         Test: inspector/console/console-screenshot.html
1275
1276         * page/PageConsoleClient.cpp:
1277         (WebCore::PageConsoleClient::addMessage):
1278         (WebCore::PageConsoleClient::screenshot):
1279
1280 2019-07-24  Alicia Boya García  <aboya@igalia.com>
1281
1282         [MSE] Reenqueue after removeCodedFrames()
1283         https://bugs.webkit.org/show_bug.cgi?id=199749
1284
1285         Reviewed by Xabier Rodriguez-Calvar.
1286
1287         Before this patch, SourceBuffer::removeCodedFrames() did not trigger
1288         an immediate reenqueue, but rather just set the `needsReenqueuing`
1289         flag, deferring it for the next append... but there may not be another
1290         append! In that case, the removed frames would still wrongly play.
1291
1292         This is the case for instance in tests where a single long media
1293         append is done and then "cropped" with SourceBuffer.erase().
1294
1295         Test: media/media-source/media-source-erase-after-last-append.html
1296
1297         * Modules/mediasource/SourceBuffer.cpp:
1298         (WebCore::SourceBuffer::removeCodedFrames):
1299
1300 2019-07-24  Jer Noble  <jer.noble@apple.com>
1301
1302         Add per-document autoplay quirk for netflix.com.
1303         https://bugs.webkit.org/show_bug.cgi?id=200058
1304
1305         Reviewed by Eric Carlson.
1306
1307         Opt netflix.com into the desktop-style per-document autoplay quirk.
1308
1309         * page/Quirks.cpp:
1310         (WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
1311
1312 2019-07-24  Alicia Boya García  <aboya@igalia.com>
1313
1314         [GStreamer] Don't crash with empty video src
1315         https://bugs.webkit.org/show_bug.cgi?id=200081
1316
1317         When a <video> element is set to load empty or about:blank, a player is still
1318         created, but no pipeline is loaded. This patch fixes some assertion errors that
1319         manifested in that case.
1320
1321         Reviewed by Philippe Normand.
1322
1323         Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html
1324
1325         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1326         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
1327         (WebCore::MediaPlayerPrivateGStreamer::platformDuration const):
1328         (WebCore::MediaPlayerPrivateGStreamer::paused const):
1329
1330 2019-07-23  Justin Fan  <justin_fan@apple.com>
1331
1332         [WebGPU] Implement errors for GPURenderPipeline creation
1333         https://bugs.webkit.org/show_bug.cgi?id=200046
1334
1335         Reviewed by Myles C. Maxfield.
1336
1337         Replacing error logging in GPURenderPipeline creation with GPUError generation. 
1338         Update GPUErrorScopes to re-use an error message prefix for less boiler-plate.
1339
1340         Test: webgpu/render-pipeline-errors.html
1341
1342         * Modules/webgpu/WebGPUDevice.cpp:
1343         (WebCore::WebGPUDevice::createRenderPipeline const):
1344         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
1345         (WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
1346         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
1347         * platform/graphics/gpu/GPUDevice.cpp:
1348         (WebCore::GPUDevice::tryCreateRenderPipeline const):
1349         * platform/graphics/gpu/GPUDevice.h:
1350         * platform/graphics/gpu/GPUErrorScopes.cpp:
1351         (WebCore::GPUErrorScopes::generatePrefixedError):
1352         * platform/graphics/gpu/GPUErrorScopes.h:
1353         (WebCore::GPUErrorScopes::setErrorPrefix):
1354         * platform/graphics/gpu/GPURenderPipeline.h:
1355         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1356         (WebCore::tryCreateMtlDepthStencilState):
1357         (WebCore::trySetVertexInput):
1358         (WebCore::trySetColorStates):
1359         (WebCore::trySetMetalFunctions):
1360         (WebCore::trySetFunctions):
1361         (WebCore::convertRenderPipelineDescriptor):
1362         (WebCore::tryCreateMtlRenderPipelineState):
1363         (WebCore::GPURenderPipeline::tryCreate):
1364         (WebCore::GPURenderPipeline::GPURenderPipeline):
1365
1366 2019-07-23  Konstantin Tokarev  <annulen@yandex.ru>
1367
1368         ImageDecoderDirect2D::hotSpot() should return WTF::nullopt instead of default constructed value
1369         https://bugs.webkit.org/show_bug.cgi?id=200055
1370
1371         Reviewed by Brent Fulgham.
1372
1373         * platform/graphics/win/ImageDecoderDirect2D.cpp:
1374         (WebCore::ImageDecoderDirect2D::hotSpot const):
1375
1376 2019-07-23  Tim Horton  <timothy_horton@apple.com>
1377
1378         Long press hint has half blue shape in Feedly.com
1379         https://bugs.webkit.org/show_bug.cgi?id=200053
1380         <rdar://problem/53323369>
1381
1382         Reviewed by Simon Fraser.
1383
1384         No new tests, because TextIndicator snapshots are not yet testable.
1385
1386         * rendering/RenderLayer.cpp:
1387         (WebCore::RenderLayer::paintForegroundForFragments):
1388         Paint ChildBlockBackgrounds when painting selection AND backgrounds;
1389         only exclude it when doing a selection-only paint.
1390
1391 2019-07-23  Chris Fleizach  <cfleizach@apple.com>
1392
1393         AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
1394         https://bugs.webkit.org/show_bug.cgi?id=199988
1395
1396         Reviewed by Per Arne Vollan.
1397
1398         Implement the reset state to cancel current speech jobs.
1399
1400         * Modules/speech/SpeechSynthesis.cpp:
1401         (WebCore::SpeechSynthesis::startSpeakingImmediately):
1402         (WebCore::SpeechSynthesis::cancel):
1403         * platform/PlatformSpeechSynthesizer.h:
1404         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
1405         (WebCore::PlatformSpeechSynthesizer::resetState):
1406         * platform/mac/PlatformSpeechSynthesizerMac.mm:
1407         (WebCore::PlatformSpeechSynthesizer::resetState):
1408
1409 2019-07-23  Zalan Bujtas  <zalan@apple.com>
1410
1411         [iOS] Tapping the search field on a search results page on zillow.com shows and immediately dismisses the keyboard
1412         https://bugs.webkit.org/show_bug.cgi?id=200044
1413         <rdar://problem/53103732>
1414
1415         Reviewed by Wenson Hsieh.
1416
1417         1. The keyboard gets dismissed as the result of scroll event.
1418         2. The (horizontal)scroll event is initiated by WebKit as we try to re-center the content.
1419         3. The content gets off-centered as the result of the newly constructed drop-down menu which slightly sticks out of the document to the right (layout overflows).
1420
1421         It works with shipping version of iOS because _zoomToFocusRect operates on stale viewport information (see r244494 for the progression).
1422         This patch applies a site specific quirk to restore shipping behavior.
1423
1424         * page/Quirks.cpp:
1425         (WebCore::Quirks::shouldAvoidScrollingWhenFocusedContentIsVisible const):
1426         * page/Quirks.h:
1427
1428 2019-07-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
1429
1430         CanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatrix2DInit
1431         https://bugs.webkit.org/show_bug.cgi?id=199850
1432
1433         Reviewed by Simon Fraser.
1434
1435         The validateAndFixup step of DOMMatrix2DInit sets the matrix attributes 
1436         (m** fields) from the aliases attributes (a, b, c, d, e, f) if the former
1437         ones do not exist and the later ones exist. See
1438         https://www.w3.org/TR/geometry-1/#dommatrixinit-dictionary and
1439         DOMMatrixReadOnly::validateAndFixup(DOMMatrix2DInit& init).
1440
1441         Since CanvasRenderingContext2DBase::setTransform() validates and fixes
1442         the input DOMMatrix2DInit, it should rely on matrix attributes.
1443
1444         Test: fast/canvas/setTransfrom-aliases-transform.html
1445
1446         * html/canvas/CanvasRenderingContext2DBase.cpp:
1447         (WebCore::CanvasRenderingContext2DBase::setTransform):
1448
1449 2019-07-24  Simon Fraser  <simon.fraser@apple.com>
1450
1451         [iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
1452         https://bugs.webkit.org/show_bug.cgi?id=200105
1453         rdar://problem/52871975
1454
1455         Reviewed by Wenson Hsieh.
1456
1457         ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition() computes a visual viewport
1458         from the current scroll position and scrollableAreaSize(). This doesn't know anything about
1459         the impact of keyboards on the visual viewport, so it computes a too-large visual viewport
1460         when the keyboard is up, triggering incorrect manipulations of the layout viewport. This
1461         leads to the top bar flashing to position 0 when it should be hidden off the top.
1462
1463         Fix by feeding into the scrolling tree the height of the visual viewport which takes
1464         FrameView::visualViewportOverrideRect() into account. This is stored on ScrollingStateFrameScrollingNode/
1465         ScrollingTreeFrameScrollingNode.
1466
1467         Test: scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html
1468
1469         * page/FrameView.h:
1470         * page/scrolling/AsyncScrollingCoordinator.cpp:
1471         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
1472         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1473         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1474         (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
1475         (WebCore::ScrollingStateFrameScrollingNode::setOverrideVisualViewportSize):
1476         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
1477         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1478         * page/scrolling/ScrollingTree.cpp:
1479         (WebCore::ScrollingTree::commitTreeState): LOG_WITH_STREAM() doesn't evaluate scrollingTreeAsText()
1480         every time.
1481         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1482         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
1483         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
1484         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
1485         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1486
1487 2019-07-23  Tim Horton  <timothy_horton@apple.com>
1488
1489         Long press hint of AirPods buy buttons are tall and narrow during animation
1490         https://bugs.webkit.org/show_bug.cgi?id=200036
1491         <rdar://problem/53145697>
1492
1493         Reviewed by Wenson Hsieh.
1494
1495         New test: fast/text-indicator/text-indicator-with-tiny-child.html
1496
1497         * dom/Range.cpp:
1498         (WebCore::Range::borderAndTextRects const):
1499         * dom/Range.h:
1500         Add a BoundingRectBehavior that ignores 1x1 and smaller rects.
1501
1502         * page/TextIndicator.cpp:
1503         (WebCore::absoluteBoundingRectForRange):
1504         Enable IgnoreTinyRects.
1505
1506 2019-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1507
1508         [macOS 10.15] Web process crashes when attempting to show the font panel via Font > Show Fonts
1509         https://bugs.webkit.org/show_bug.cgi?id=200021
1510         <rdar://problem/53301325>
1511
1512         Reviewed by Ryosuke Niwa.
1513
1514         In macOS 10.15, attempting to access ~/Library/FontCollections/ from the web process causes a Sandbox violation
1515         and a subsequent crash. This can be triggered by trying to show the font panel via Font > Show Fonts in the
1516         context menu after right clicking.
1517
1518         In the (near) future, we should fix this by moving logic to show the font panel, color panel and styles panel
1519         from the Editor in the web process to the UI process in WebKit2. However, for the time being, we can just work
1520         around this by adding a new EditorClient hook to determine whether to allow the font panel to show; this returns
1521         true in the legacy macOS WebKit port, and false everywhere else.
1522
1523         Test: editing/mac/style/do-not-crash-when-showing-font-panel.html
1524
1525         * editing/mac/EditorMac.mm:
1526         (WebCore::Editor::showFontPanel):
1527         * loader/EmptyClients.cpp:
1528         * page/EditorClient.h:
1529
1530 2019-07-23  Ryosuke Niwa  <rniwa@webkit.org>
1531
1532         WebKit should strip away system font names from the pasted content
1533         https://bugs.webkit.org/show_bug.cgi?id=199975
1534         <rdar://problem/53336353>
1535
1536         Reviewed by Darin Adler.
1537
1538         Cocoa HTML Writer sometimes generate system font names such as ".AppleSystemUIFont", ".SFUI-Regular", and ".SF UI Mono".
1539         We need to strip away these font names upon paste to avoid these font names falling back to Times New Roman.
1540
1541         Added the code to strip these font names away in EditingStyle::mergeStyleFromRulesForSerialization, which is used by
1542         StylizedMarkupAccumulator to generate HTML during copy. This works because WebContentReader::readWebArchive invokes
1543         sanitizeMarkupWithArchive which inserts the pasteboard content into a temporary document then re-serializes back to HTML
1544         using StylizedMarkupAccumulator before the actual pasting happens.
1545
1546         This approach has a few benefits over stripping away these font names in ReplaceSelectionCommand:
1547
1548         1. It would only affect clients that opts-in to copy & paste sanitization. e.g. it won't affect legacy WebKit clients
1549         and those that opt out of pasteboard content sanitization.
1550
1551         2. It preserves font names such as ".SF Blah" that a website may insert as some kind of house keeping purposes if ever.
1552         While we don't have any evidence that there is any such a website but it's a real risk nonetheless. The copy side fix would
1553         only affect cross-site and cross-app pasting, which is rare and less likely to affect real user scenarios.
1554
1555         3. It avoids exposing bogus .Apple* or .SF* font names to websites that directly use event.clipboardData.getData.
1556         Indeed stripping away bogus markup like this is one of the key features / benefit of using copy & paste sanitization.
1557
1558         Test: editing/pasteboard/paste-cocoa-writer-markup-with-system-fonts.html
1559
1560         * editing/EditingStyle.cpp:
1561         (WebCore::usesForbiddenSystemFontAsOnlyFontFamilyName): Added.
1562         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): Added the code to remove font-family property when needed.
1563         * platform/graphics/FontCache.h:
1564         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1565         (WebCore::isSystemFont): Moved.
1566         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added.
1567         * platform/graphics/freetype/FontCacheFreeType.cpp:
1568         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added. Always returns false.
1569         * platform/graphics/win/FontCacheWin.cpp:
1570         (WebCore::FontCache::isSystemFontForbiddenForEditing): Ditto.
1571
1572 2019-07-22  Yusuke Suzuki  <ysuzuki@apple.com>
1573
1574         [bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
1575         https://bugs.webkit.org/show_bug.cgi?id=200024
1576
1577         Reviewed by Saam Barati.
1578
1579         Changed how we interpret VM tags. Add IsoHeap VM tag support, and rename WebAssembly tag
1580         to Gigacage tag.
1581
1582         * page/ResourceUsageData.h:
1583         * page/ResourceUsageOverlay.h:
1584         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1585         (WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
1586         * page/cocoa/ResourceUsageThreadCocoa.mm:
1587         (WebCore::displayNameForVMTag):
1588         (WebCore::categoryForVMTag):
1589
1590 2019-07-22  Youenn Fablet  <youenn@apple.com>
1591
1592         Fix inspector override conversion in InspectorPageAgent::overrideSetting
1593         https://bugs.webkit.org/show_bug.cgi?id=200017
1594
1595         Reviewed by Devin Rousso.
1596
1597         Covered by inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
1598         which should not fail on bots not having cameras
1599
1600         * inspector/agents/InspectorPageAgent.cpp:
1601         (WebCore::toOptionalBool):
1602         (WebCore::InspectorPageAgent::overrideSetting):
1603         Previously, the conversion for the mock capture value was implicit from a bool pointer to an optional.
1604         Make an explicit conversion as done for regular settings.
1605
1606 2019-07-22  Ross Kirsling  <ross.kirsling@sony.com>
1607
1608         Unreviewed non-unified build fix.
1609
1610         * Modules/webdatabase/DatabaseContext.h:
1611         * html/HTMLDialogElement.cpp:
1612         * html/HTMLScriptElement.cpp:
1613         * inspector/agents/InspectorDatabaseAgent.cpp:
1614         * workers/service/server/SWServerWorker.cpp:
1615         * workers/service/server/SWServerWorker.h:
1616         * worklets/WorkletGlobalScope.cpp:
1617         * worklets/WorkletGlobalScope.h:
1618
1619 2019-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1620
1621         [iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal the selection
1622         https://bugs.webkit.org/show_bug.cgi?id=200013
1623         <rdar://problem/52526901>
1624
1625         Reviewed by Simon Fraser.
1626
1627         After <https://trac.webkit.org/r244141>, we no longer attempt to scroll to reveal the text selection in
1628         UIWebView after changing the selection, due to how we use the legacy document view rect in legacy WebKit when
1629         computing the visual viewport. This causes the viewRect in RenderLayer::scrollRectToVisible to be the same size
1630         as the content size, which then causes us to always scroll to the origin when revealing the selection.
1631
1632         To make selection revealing work again in legacy WebKit, conditionally restore the old behavior of using the
1633         unobscured content rect as the view rect, only in the case where scrolling is delegated and the platform widget
1634         is present.
1635
1636         Test: WebKitLegacy.ScrollToRevealSelection
1637
1638         * page/FrameView.cpp:
1639         (WebCore::FrameView::viewRectExpandedByContentInsets const):
1640         (WebCore::FrameView::visualViewportRectExpandedByContentInsets const): Deleted.
1641
1642         Additionally rename visualViewportRectExpandedByContentInsets to viewRectExpandedByContentInsets, to reflect the
1643         fact that this may either be the visual viewport rect or unobscured content rect.
1644
1645         * page/FrameView.h:
1646         * rendering/RenderLayer.cpp:
1647         (WebCore::RenderLayer::scrollRectToVisible):
1648
1649 2019-07-22  Brent Fulgham  <bfulgham@apple.com>
1650
1651         Correct web audio-related crash in seed reports
1652         https://bugs.webkit.org/show_bug.cgi?id=200009
1653         <rdar://problem/51565203>
1654
1655         Reviewed by Per Arne Vollan.
1656
1657         Update the 'createMix' method to do proper return value checking so that
1658         we can clear the result of MTAudioProcessingTapCreate if the create operation
1659         failed.
1660
1661         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1662         (WebCore::AudioSourceProviderAVFObjC::createMix):
1663
1664 2019-07-22  Per Arne Vollan  <pvollan@apple.com>
1665
1666         Prewarmed font does not find any matches
1667         https://bugs.webkit.org/show_bug.cgi?id=200007
1668
1669         Reviewed by Brent Fulgham.
1670
1671         Prewarming the font name 'SF Pro Text' does not find any matches. The font name ".SF NS Text/Display"
1672         should be used instead. Also add 'Lucida Grande' to the list of prewarmed font, since it is used as
1673         fallback font in many cases.
1674
1675         No new tests, covered by existing tests.
1676
1677         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1678         (WebCore::fontFamiliesForPrewarming):
1679
1680 2019-07-22  Youenn Fablet  <youenn@apple.com>
1681
1682         Make sure the player underlying volume is correctly set after creating a new player
1683         https://bugs.webkit.org/show_bug.cgi?id=199974
1684         <rdar://problem/52762559>
1685
1686         Reviewed by Eric Carlson.
1687
1688         When creating a player before starting to play, the volume might not be correctly initialized.
1689         Fix that by updating the volume like done for rate and muted state.
1690         A future refactoring should probably move that code in MediaPlayer.
1691
1692         Add an internal API to query the volume value from the underlying player.
1693
1694         Test: http/tests/media/audio-volume-zero.html
1695
1696         * html/HTMLMediaElement.cpp:
1697         (WebCore::HTMLMediaElement::updateVolume):
1698         (WebCore::HTMLMediaElement::updatePlayState):
1699         (WebCore::HTMLMediaElement::effectiveVolume const):
1700         (WebCore::HTMLMediaElement::effectiveMuted const):
1701         * html/HTMLMediaElement.h:
1702         * testing/Internals.cpp:
1703         (WebCore::Internals::privatePlayerVolume):
1704         * testing/Internals.h:
1705         * testing/Internals.idl:
1706         * testing/Internals.mm:
1707         (WebCore::Internals::privatePlayerVolume):
1708
1709 2019-07-22  Devin Rousso  <drousso@apple.com>
1710
1711         Web Inspector: Page: mark any WebCore::Setting inspector override as UNLIKELY
1712         https://bugs.webkit.org/show_bug.cgi?id=199925
1713
1714         Reviewed by Joseph Pecoraro.
1715
1716         * Scripts/SettingsTemplates/Settings.cpp.erb:
1717
1718 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
1719
1720         Fix crashes in ScrollingStateNode::insertChild()
1721         https://bugs.webkit.org/show_bug.cgi?id=200023
1722         rdar://problem/53265378
1723
1724         Reviewed by Darin Adler.
1725
1726         Crash data suggest that ScrollingStateNode::insertChild() can be passed an index that
1727         is larger than the size of the vector, causing crashes.
1728
1729         Fix defensively by falling back to append() if the passed index is equal to or larger
1730         than the size of the children vector.
1731
1732         * page/scrolling/ScrollingStateNode.cpp:
1733         (WebCore::ScrollingStateNode::insertChild):
1734
1735 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
1736
1737         Make some constructors explicit
1738         https://bugs.webkit.org/show_bug.cgi?id=199981
1739
1740         Reviewed by Daniel Bates.
1741
1742         Make explicit public constructors of objects that take POD or String& arguments,
1743         to reduce the changes of the compiler doing implicit conversions.
1744
1745         * Modules/indexeddb/server/IndexValueEntry.h:
1746         * Modules/indexeddb/server/IndexValueStore.h:
1747         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1748         * Modules/webdatabase/ChangeVersionData.h:
1749         (WebCore::ChangeVersionData::ChangeVersionData):
1750         * Modules/webdatabase/OriginLock.h:
1751         * Modules/websockets/WebSocketExtensionParser.h:
1752         (WebCore::WebSocketExtensionParser::WebSocketExtensionParser):
1753         * bindings/js/ScriptCachedFrameData.h:
1754         * contentextensions/URLFilterParser.cpp:
1755         (WebCore::ContentExtensions::PatternParser::PatternParser):
1756         * css/parser/CSSTokenizer.h:
1757         * css/parser/SizesAttributeParser.h:
1758         * dom/SpaceSplitString.cpp:
1759         (WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor):
1760         * html/FormController.cpp:
1761         (WebCore::SavedFormState::appendControlState):
1762         (WebCore::SavedFormState::takeControlState):
1763         * loader/ProgressTracker.cpp:
1764         (WebCore::ProgressItem::ProgressItem):
1765         * page/DragController.cpp:
1766         (WebCore::DragController::DragController):
1767         (WebCore::DragController::performDragOperation):
1768         * page/DragController.h:
1769         * page/animation/CSSPropertyAnimation.cpp:
1770         (WebCore::AnimationPropertyWrapperBase::AnimationPropertyWrapperBase):
1771         * page/ios/DOMTimerHoldingTank.h:
1772         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
1773         * platform/CountedUserActivity.h:
1774         (WebCore::CountedUserActivity::CountedUserActivity):
1775         * platform/audio/DirectConvolver.h:
1776         * platform/audio/DownSampler.h:
1777         * platform/audio/DynamicsCompressorKernel.h:
1778         * platform/audio/EqualPowerPanner.h:
1779         * platform/audio/MultiChannelResampler.h:
1780         * platform/audio/ReverbAccumulationBuffer.h:
1781         * platform/audio/ReverbInputBuffer.h:
1782         * platform/audio/SincResampler.cpp:
1783         * platform/audio/UpSampler.h:
1784         * platform/audio/ios/AudioFileReaderIOS.h:
1785         * platform/audio/mac/AudioFileReaderMac.h:
1786         * platform/audio/mac/AudioSessionMac.cpp:
1787         (WebCore::AudioSessionPrivate::AudioSessionPrivate):
1788         * platform/cf/KeyedDecoderCF.h:
1789         * platform/graphics/WidthIterator.cpp:
1790         (WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace):
1791         * platform/graphics/cocoa/FontCacheCoreText.h:
1792         (WebCore::SynthesisPair::SynthesisPair):
1793         * platform/graphics/displaylists/DisplayListItems.h:
1794         (WebCore::DisplayList::DrawingItem::DrawingItem):
1795         * platform/network/cf/ResourceRequest.h:
1796         (WebCore::ResourceRequest::ResourceRequest):
1797         * platform/text/TextCodecICU.h:
1798         * rendering/RenderTableSection.h:
1799         (WebCore::CellSpan::CellSpan):
1800         * rendering/shapes/RasterShape.cpp:
1801         * rendering/shapes/RasterShape.h:
1802         (WebCore::RasterShapeIntervals::RasterShapeIntervals):
1803         * testing/MockLibWebRTCPeerConnection.h:
1804         (WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):
1805
1806 2019-07-22  Rob Buis  <rbuis@igalia.com>
1807
1808         Remove some unneeded code in MathOperator
1809         https://bugs.webkit.org/show_bug.cgi?id=199935
1810
1811         Reviewed by Frédéric Wang.
1812
1813         Remove unused method.
1814
1815         No new tests, not changing behavior.
1816
1817         * rendering/mathml/MathOperator.h:
1818
1819 2019-07-21  Konstantin Tokarev  <annulen@yandex.ru>
1820
1821         Add DataListButtonElement.cpp to unified sources
1822         https://bugs.webkit.org/show_bug.cgi?id=199989
1823
1824         Reviewed by Michael Catanzaro.
1825
1826         * Sources.txt:
1827         * WebCore.xcodeproj/project.pbxproj:
1828
1829 2019-07-21  Andres Gonzalez  <andresg_22@apple.com>
1830
1831         Add accessibilityInsertText for text insertion in edit fields.
1832         https://bugs.webkit.org/show_bug.cgi?id=199973
1833
1834         Reviewed by Chris Fleizach.
1835
1836         Renamed accessibilityInsertText to _accessibilityInsertText.
1837
1838         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1839         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
1840         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
1841         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1842         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
1843         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
1844
1845 2019-07-21  Saam Barati  <sbarati@apple.com>
1846
1847         [WHLSL] Checker needs to setError() when a property access node can't commit its base type
1848         https://bugs.webkit.org/show_bug.cgi?id=199978
1849
1850         Reviewed by Dean Jackson.
1851
1852         Test: webgpu/whlsl/null-array-property-access.html
1853
1854         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1855         (WebCore::WHLSL::Checker::finishVisiting):
1856
1857 2019-07-21  Saam Barati  <sbarati@apple.com>
1858
1859         [WHLSL] Return the zero-value enum in the enum-from-integer constructor when the integer is not a valid enum value
1860         https://bugs.webkit.org/show_bug.cgi?id=199853
1861
1862         Reviewed by Dean Jackson.
1863
1864         Test: webgpu/whlsl/enum-integer-constructor.html
1865
1866         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1867         (WebCore::WHLSL::Metal::writeNativeFunction):
1868
1869 2019-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
1870
1871         [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
1872         https://bugs.webkit.org/show_bug.cgi?id=199912
1873         <rdar://problem/52182454>
1874
1875         Reviewed by Simon Fraser.
1876
1877         This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
1878         text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
1879         CoreText.
1880
1881         Test: fast/text/international/system-language/composition.html
1882
1883         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1884         (WebCore::Font::getCFStringAttributes const):
1885
1886 2019-07-20  Andres Gonzalez  <andresg_22@apple.com>
1887
1888         Add accessibilityInsertText for text insertion in edit fields.
1889         https://bugs.webkit.org/show_bug.cgi?id=199973
1890
1891         Reviewed by Chris Fleizach.
1892
1893         Tests: accessibility/insert-newline.html
1894                accessibility/ios-simulator/insert-newline.html
1895
1896         Accessibility clients like VoiceOver and Voice Control were entering
1897         text in text fields by replacing the entire content of the field
1898         (SetValue) and then setting the insertion point to the appropriate
1899         offset (SetSelectedTextRange). accessibilityInsertText gives a simpler
1900         interface to clients to insert text at the insertion point location.
1901         In addition, this provides a workaround for the issue encountered with
1902         the previous method when inserting a linebreak.
1903
1904         * accessibility/AccessibilityObject.cpp:
1905         (WebCore::AccessibilityObject::insertText):
1906         * accessibility/AccessibilityObject.h:
1907         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1908         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1909         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1910         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1911
1912 2019-07-20  Alexander Mikhaylenko  <exalm7659@gmail.com>
1913
1914         REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
1915         https://bugs.webkit.org/show_bug.cgi?id=199322
1916
1917         Reviewed by Michael Catanzaro.
1918
1919         Check ENABLE(KINETIC_SCROLLING) instead of ENABLE(ASYNC_SCROLLING) for kinetic scrolling.
1920
1921         * platform/PlatformWheelEvent.h:
1922         * platform/generic/ScrollAnimatorGeneric.cpp:
1923         (WebCore::ScrollAnimatorGeneric::handleWheelEvent):
1924         * platform/gtk/PlatformWheelEventGtk.cpp:
1925         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1926
1927 2019-07-20  Zalan Bujtas  <zalan@apple.com>
1928
1929         [LFC][TFC] Introduce table formatting context.
1930         https://bugs.webkit.org/show_bug.cgi?id=199979
1931         <rdar://problem/53346292>
1932
1933         Reviewed by Antti Koivisto.
1934
1935         Add the basic class structure for the table formatting context.
1936         https://www.w3.org/TR/CSS22/tables.html
1937
1938         * Sources.txt:
1939         * WebCore.xcodeproj/project.pbxproj:
1940         * layout/FormattingState.h:
1941         (WebCore::Layout::FormattingState::isTableFormattingState const):
1942         * layout/tableformatting/TableFormattingContext.cpp: Added.
1943         (WebCore::Layout::TableFormattingContext::TableFormattingContext):
1944         (WebCore::Layout::TableFormattingContext::layout const):
1945         * layout/tableformatting/TableFormattingContext.h: Added.
1946         * layout/tableformatting/TableFormattingState.cpp: Added.
1947         (WebCore::Layout::TableFormattingState::TableFormattingState):
1948         (WebCore::Layout::TableFormattingState::~TableFormattingState):
1949         * layout/tableformatting/TableFormattingState.h: Added.
1950         * layout/tableformatting/TableInvalidation.cpp: Added.
1951         (WebCore::Layout::TableInvalidation::invalidate):
1952         * layout/tableformatting/TableInvalidation.h: Added.
1953
1954 2019-07-20  Zalan Bujtas  <zalan@apple.com>
1955
1956         [LFC][IFC] Add support for mid-word break.
1957         https://bugs.webkit.org/show_bug.cgi?id=199976
1958         <rdar://problem/53337349>
1959
1960         Reviewed by Antti Koivisto.
1961
1962         Introduce leading and trailing InlineTextItem to support incoming and outgoing partial content.
1963         TextUtil::split is a straight copy of SimpleLineLayout::split.
1964
1965         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1966         (WebCore::Layout::inlineItemWidth):
1967         (WebCore::Layout::LineLayout::close):
1968         (WebCore::Layout::LineLayout::placeInlineItem):
1969         (WebCore::Layout::LineLayout::layout):
1970         * layout/inlineformatting/InlineTextItem.cpp:
1971         (WebCore::Layout::InlineTextItem::split const):
1972         (WebCore::Layout::InlineTextItem::split): Deleted.
1973         * layout/inlineformatting/InlineTextItem.h:
1974         (WebCore::Layout::InlineTextItem::inlineBox const):
1975         * layout/inlineformatting/text/TextUtil.cpp:
1976         (WebCore::Layout::TextUtil::split):
1977         * layout/inlineformatting/text/TextUtil.h:
1978
1979 2019-07-20  Zalan Bujtas  <zalan@apple.com>
1980
1981         [Text autosizing] Do not nuke the style on dynamicViewportSizeUpdate
1982         https://bugs.webkit.org/show_bug.cgi?id=199718
1983         <rdar://problem/53344961>
1984
1985         Reviewed by Simon Fraser.
1986
1987         When the page scale changes (e.g. as the result of shink to fit mode) we need to visit all the text content on the page and check whether they need to be boosted.
1988         Currently we call setNeedsRecalcStyleInAllFrames() to accomplish it. Unfortunatelly setNeedsRecalcStyleInAllFrames destroys all the style information which means that the
1989         subsequent styleResolve() needs to start from scratch.
1990         This patch addresses this issue by directly adjusting the computed style information when text boosting is required and schedules layout accordingly. We also trigger this style adjusting
1991         on a timer so that rapid dynamicViewportSizeUpdate() calls won't trigger redundant layouts.
1992
1993         * css/StyleResolver.cpp:
1994         (WebCore::hasTextChild):
1995         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
1996         (WebCore::hasTextChildren): Deleted.
1997         * css/StyleResolver.h:
1998         * page/FrameView.h:
1999         * page/Page.cpp:
2000         (WebCore::Page::invalidateTextAutoSizeInAllFrames):
2001         * page/Page.h:
2002
2003 2019-07-20  Saam Barati  <sbarati@apple.com>
2004
2005         [WHLSL] Make enums work
2006         https://bugs.webkit.org/show_bug.cgi?id=199634
2007
2008         Reviewed by Robin Morisset.
2009
2010         This patch makes enums work. There were a couple changes needed to do this work:
2011         1. In the metal codegen, we were emitting code like "EnumType.EnumValue"
2012         instead of "EnumType::EnumValue".
2013         
2014         2. Inside the enumeration declaration AST node, we track enums in a HashMap
2015         because we need to look up names of enum values in that map in parts of the
2016         compiler. However, HashMap is not ordered but we were relying on the iteration
2017         order of it to generate the default values of enums. E.g, in: "enum { Foo = 10, Bar }",
2018         Bar should be 11. However, there was no guarantee that we iterated over Bar
2019         after Foo. Instead, we just track the default values as we parse an enum
2020         inside of the parser. This allows us to continue to keep using HashMap without
2021         also adding an auxiliary data structure (or using more memory in some way) to
2022         track the order of the enum elements.
2023         
2024         I've also filed a patch to do follow-up work on implementing the correct
2025         operational behavior when constructing an enum from its underlying type when
2026         the underlying value does not match any enum value:
2027         https://bugs.webkit.org/show_bug.cgi?id=199853
2028
2029         Tests: webgpu/whlsl/enums-2.html
2030                webgpu/whlsl/enums.html
2031
2032         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
2033         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
2034         (WebCore::WHLSL::AST::EnumerationMember::value):
2035         (WebCore::WHLSL::AST::EnumerationMember::setValue): Deleted.
2036         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2037         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2038         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
2039         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
2040         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
2041         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
2042         (WebCore::WHLSL::ASTDumper::visit):
2043         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2044         (WebCore::WHLSL::Checker::visit):
2045         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2046         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
2047         (WebCore::WHLSL::Parser::parseEnumerationMember):
2048         * Modules/webgpu/WHLSL/WHLSLParser.h:
2049         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2050         (WebCore::WHLSL::Visitor::visit):
2051
2052 2019-07-19  Youenn Fablet  <youenn@apple.com>
2053
2054         Remote WebInspector should enable mock capture devices in UIProcess if doing it in WebProcess
2055         https://bugs.webkit.org/show_bug.cgi?id=199924
2056         <rdar://problem/50552067>
2057
2058         Reviewed by Devin Rousso.
2059
2060         Add necessary API to set mock capture devices override.
2061         In case of desynchronization between webprocess and uiprocess, make sure to return early
2062         and fail capture instead of crashing.
2063
2064         * inspector/InspectorClient.h:
2065         (WebCore::InspectorClient::setMockCaptureDevicesEnabled):
2066         * inspector/agents/InspectorPageAgent.cpp:
2067         (WebCore::InspectorPageAgent::disable):
2068         (WebCore::InspectorPageAgent::overrideSetting):
2069         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2070
2071 2019-07-19  Andy Estes  <aestes@apple.com>
2072
2073         [Apple Pay] Log less in PaymentCoordinator::shouldEnableApplePayAPIs()
2074         https://bugs.webkit.org/show_bug.cgi?id=199958
2075
2076         Reviewed by Tim Horton.
2077
2078         Only log when APIs are disabled due to user scripts.
2079
2080         * Modules/applepay/PaymentCoordinator.cpp:
2081         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
2082
2083 2019-07-19  Dean Jackson  <dino@apple.com>
2084
2085         Add a menu item to toggle between showing and hiding link previews
2086         https://bugs.webkit.org/show_bug.cgi?id=199940
2087         <rdar://problem/53032288>
2088
2089         Reviewed by Beth Dakin.
2090
2091         New strings for Show/Hide Link Previews.
2092
2093         * en.lproj/Localizable.strings:
2094
2095 2019-07-19  Antoine Quint  <graouts@apple.com>
2096
2097         Links stop working after long-pressing a link (WK1)
2098         https://bugs.webkit.org/show_bug.cgi?id=199952
2099         <rdar://problem/52291860>
2100
2101         Reviewed by Wenson Hsieh.
2102
2103         Test: fast/events/touch/ios/click-after-long-press.html
2104
2105         When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
2106         WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
2107         process the next tap after a drag interaction.
2108
2109         * page/ios/EventHandlerIOS.mm:
2110         (WebCore::EventHandler::tryToBeginDragAtPoint):
2111
2112 2019-07-19  Sihui Liu  <sihui_liu@apple.com>
2113
2114         IndexedDB: error in starting version change transaction may be neglected
2115         https://bugs.webkit.org/show_bug.cgi?id=199818
2116         <rdar://problem/52925738>
2117
2118         Reviewed by Brady Eidson.
2119
2120         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
2121         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
2122         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
2123         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
2124         m_databaseInfo could become nullptr.
2125
2126         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
2127         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
2128         ungradeneeded event is dispatched to the IDBRequest.
2129
2130         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2131         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
2132         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
2133         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
2134         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2135         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
2136         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2137
2138 2019-07-19  Zalan Bujtas  <zalan@apple.com>
2139
2140         [LFC][IFC] Add partial content handling
2141         https://bugs.webkit.org/show_bug.cgi?id=199930
2142
2143         Reviewed by Antti Koivisto.
2144
2145         Move the actual inline item placement to a dedicated functions. This enables us to
2146         construct a dedicated InlineItem for the partial content and pass it in to this function.
2147
2148         <span>The quick brown fox jumps over the lazy dog</span> <- inline content
2149         [The][ ][quick][ ][brown][ ][fox][ ][jumps][ ][over][ ][the][ ][lazy][ ][dog] <- InlineItems
2150
2151         Line breaking:
2152         [The][ ][qu]
2153         [ick] <- Partial InlineItem (position: 6 length: 3) from [quick] (position: 4 length: 5)
2154
2155         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2156         (WebCore::Layout::LineLayout::close):
2157         (WebCore::Layout::LineLayout::placeInlineItem):
2158         (WebCore::Layout::LineLayout::layout):
2159         (WebCore::Layout::LineInput::LineInput):
2160         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
2161         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2162         * layout/inlineformatting/InlineTextItem.cpp:
2163         (WebCore::Layout::InlineTextItem::split):
2164         * layout/inlineformatting/InlineTextItem.h:
2165
2166 2019-07-19  Charlie Turner  <cturner@igalia.com>
2167
2168         [GStreamer] Flush get_range calls during PAUSED->READY in WebKitWebSource
2169         https://bugs.webkit.org/show_bug.cgi?id=199934
2170
2171         Reviewed by Xabier Rodriguez-Calvar.
2172
2173         Unit testing not applicable.
2174
2175         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2176         (webKitWebSrcChangeState): A well-behaved element should unblock streaming threads
2177         during a PAUSED->READY transition, so do that here.
2178
2179 2019-07-19  Rob Buis  <rbuis@igalia.com>
2180
2181         Remove some unneeded code in MathOperator
2182         https://bugs.webkit.org/show_bug.cgi?id=199935
2183
2184         Reviewed by Frédéric Wang.
2185
2186         The initialize method is unneeded since the member
2187         variables all use default initialization.
2188
2189         No new tests, not changing behavior.
2190
2191         * rendering/mathml/MathOperator.cpp:
2192         (WebCore::MathOperator::MathOperator):
2193         (WebCore::MathOperator::GlyphAssemblyData::initialize): Deleted.
2194
2195 2019-07-18  Antoine Quint  <graouts@apple.com>
2196
2197         Enable simulated mouse events quirk for soundcloud.com
2198         https://bugs.webkit.org/show_bug.cgi?id=199908
2199         <rdar://problem/52915981>
2200
2201         Reviewed by Brent Fulgham.
2202
2203         Scrubbing on soundcloud.com relies on mouse events alone when displaying on iPad with the desktop UA string.
2204         Opting into the simulated mouse events quirk makes scrubbing work and we also ensure that page scrolling is
2205         disabled as a result of scrubbing by returning true in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented().
2206
2207         Also making a drive-by fix in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented() to use a reference
2208         instead of a pointer when downcasting a null-checked pointer.
2209
2210         * page/Quirks.cpp:
2211         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2212         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
2213
2214 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
2215
2216         Prewarm font cache with more fonts
2217         https://bugs.webkit.org/show_bug.cgi?id=199283
2218
2219         Reviewed by Myles C. Maxfield.
2220
2221         Initialize the list of families requiring system fallback in the prewarming information struct, since
2222         this was part of the original, approved patch, and is needed for the performance improvement.
2223
2224         No new tests, covered by existing tests.
2225
2226         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2227         (WebCore::fontFamiliesForPrewarming):
2228         (WebCore::FontCache::prewarmGlobally):
2229
2230 2019-07-18  Ryan Haddad  <ryanhaddad@apple.com>
2231
2232         Unreviewed, rolling out r247531.
2233
2234         Caused multiple IndexedDB layout test crashes.
2235
2236         Reverted changeset:
2237
2238         "IndexedDB: error in starting version change transaction may
2239         be neglected"
2240         https://bugs.webkit.org/show_bug.cgi?id=199818
2241         https://trac.webkit.org/changeset/247531
2242
2243 2019-07-18  Antoine Quint  <graouts@apple.com>
2244
2245         Ensure Quirks::shouldDispatchSimulatedMouseEvents() works for all Google Maps and Amazon domains
2246         https://bugs.webkit.org/show_bug.cgi?id=199904
2247         <rdar://problem/53250104>
2248
2249         Reviewed by Dean Jackson.
2250
2251         Use topPrivatelyControlledDomain() to determine whether the URL is a Google or Amazon domain so as to apply
2252         Google Maps and Amazon quirks to all the various domain names used.
2253
2254         * page/Quirks.cpp:
2255         (WebCore::Quirks::isAmazon const):
2256         (WebCore::Quirks::isGoogleMaps const):
2257         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2258         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
2259         * page/Quirks.h:
2260
2261 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
2262
2263         Crash under WebPage::boundaryEventOccurred
2264         https://bugs.webkit.org/show_bug.cgi?id=199907
2265
2266         Reviewed by Chris Fleizach.
2267
2268         Add null pointer checks.
2269
2270         No new tests, since I have not been able to reproduce this in a test.
2271
2272         * Modules/speech/SpeechSynthesis.cpp:
2273         (WebCore::SpeechSynthesis::didStartSpeaking):
2274         (WebCore::SpeechSynthesis::didFinishSpeaking):
2275         (WebCore::SpeechSynthesis::didPauseSpeaking):
2276         (WebCore::SpeechSynthesis::didResumeSpeaking):
2277         (WebCore::SpeechSynthesis::speakingErrorOccurred):
2278         (WebCore::SpeechSynthesis::boundaryEventOccurred):
2279
2280 2019-07-18  Antoine Quint  <graouts@apple.com>
2281
2282         [Pointer Events] The button and buttons properties are incorrect on iOS
2283         https://bugs.webkit.org/show_bug.cgi?id=199910
2284         <rdar://problem/52778374>
2285
2286         Reviewed by Dean Jackson.
2287
2288         The button and buttons properties were always set to 0 on iOS. We now use the correct values such that
2289         button is always 0 except for "pointermove" where it's -1, and "buttons" is 1 as long as the pointer is
2290         in contact with the touch surface.
2291
2292         Tests: pointerevents/ios/pointer-event-button-and-buttons-pointer-cancel.html
2293                pointerevents/ios/pointer-event-button-and-buttons.html
2294
2295         * dom/ios/PointerEventIOS.cpp:
2296         (WebCore::buttonForType):
2297         (WebCore::buttonsForType):
2298         (WebCore::PointerEvent::PointerEvent):
2299
2300 2019-07-18  Antoine Quint  <graouts@apple.com>
2301
2302         REGRESSION: Unable to enable simulated mouse events using the runtime flag
2303         https://bugs.webkit.org/show_bug.cgi?id=199909
2304         <rdar://problem/53254895>
2305
2306         Reviewed by Dean Jackson.
2307
2308         The fix for wkb.ug/199508 (r247152) broke the ability enable simulated mouse events using the runtime flag.
2309         We now add a check for the flag in Quirks::shouldDispatchSimulatedMouseEvents() so that the runtime flag
2310         overrides the content of that function. This is more practical and allows for a quick override using the flag.
2311
2312         Additionally, we need only call shouldDispatchSimulatedMouseEvents() in simulatedMouseEventTypeForTarget() since
2313         that function already calls needsQuirks().
2314
2315         * dom/EventNames.h:
2316         (WebCore::EventNames::isTouchRelatedEventType const):
2317         * dom/Node.cpp:
2318         (WebCore::Node::moveNodeToNewDocument):
2319         * page/Quirks.cpp:
2320         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2321         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
2322
2323 2019-07-18  Antoine Quint  <graouts@apple.com>
2324
2325         REGRESSION: Panning on an Amazon product image scrolls the page on iPadOS
2326         https://bugs.webkit.org/show_bug.cgi?id=199905
2327         <rdar://problem/49124529>
2328
2329         Reviewed by Dean Jackson.
2330
2331         Amazon product pages include images that the user can touch and pan to show zoomed details in a side image. This
2332         currently works on iPadOS thanks to the dispatch of simulated "mousemove" events on the product image, but the site
2333         doesn't call preventDefault() when handling those events as it wasn't necessary for macOS.
2334
2335         We add a new quirk that will indicate that a given element is such a product image.
2336
2337         * page/Quirks.cpp:
2338         (WebCore::Quirks::isAmazon const):
2339         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2340         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
2341         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
2342         * page/Quirks.h:
2343
2344 2019-07-18  Youenn Fablet  <youenn@apple.com>
2345
2346         Make sure to set kCTFontFallbackOptionAttribute to kCTFontFallbackOptionSystem for system fonts
2347         https://bugs.webkit.org/show_bug.cgi?id=199769
2348         <rdar://problem/49390297>
2349
2350         Reviewed by Myles C. Maxfield.
2351
2352         When getting a system font, set the appropriate attribute so that it
2353         does not fallback to a user initiated font.
2354         Add an ASSERT that checks that the font in use is not a user font if
2355         policy is to not use user installed fonts.
2356
2357         Tests: fast/text/user-installed-fonts/extended-character-with-user-font.html
2358                fast/text/user-installed-fonts/extended-character.html
2359
2360         * platform/graphics/Font.h:
2361         * platform/graphics/FontCascadeFonts.cpp:
2362         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
2363         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2364         (WebCore::preparePlatformFont):
2365         (WebCore::FontDatabase::singletonAllowingUserInstalledFonts):
2366         (WebCore::FontDatabase::singletonDisallowingUserInstalledFonts):
2367         (WebCore::addAttributesForInstalledFonts):
2368         (WebCore::addAttributesForWebFonts):
2369         (WebCore::installedFontMandatoryAttributes):
2370         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
2371         (WebCore::Font::isUserInstalledFont const):
2372
2373 2019-07-18  Zalan Bujtas  <zalan@apple.com>
2374
2375         [LFC][IFC] InlineFormattingContext::LineLayout::placeInlineItems is getting too complex.
2376         https://bugs.webkit.org/show_bug.cgi?id=199898
2377         <rdar://problem/53235958>
2378
2379         Reviewed by Antti Koivisto.
2380
2381         It's time to restructure LineLayout::placeInlineItems to be able to expand it further.
2382         Introduce the LineLayout class. This class is responsible to place the inline items on the current line.
2383         (Rename InlineFormattingContext::lineLayout -> InlineFormattingContext::InlineLayout and
2384         use Line::InitialConstraints in LineInput)
2385
2386         * layout/inlineformatting/InlineFormattingContext.cpp:
2387         (WebCore::Layout::InlineFormattingContext::layout const):
2388         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
2389         * layout/inlineformatting/InlineFormattingContext.h:
2390         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const): Deleted.
2391         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2392         (WebCore::Layout::inlineItemWidth):
2393         (WebCore::Layout::LineLayout::layoutState const):
2394         (WebCore::Layout::LineLayout::UncommittedContent::runs):
2395         (WebCore::Layout::LineLayout::UncommittedContent::isEmpty const):
2396         (WebCore::Layout::LineLayout::UncommittedContent::size const):
2397         (WebCore::Layout::LineLayout::UncommittedContent::width const):
2398         (WebCore::Layout::LineLayout::UncommittedContent::add):
2399         (WebCore::Layout::LineLayout::UncommittedContent::reset):
2400         (WebCore::Layout::LineLayout::LineLayout):
2401         (WebCore::Layout::LineLayout::commitPendingContent):
2402         (WebCore::Layout::LineLayout::close):
2403         (WebCore::Layout::LineLayout::layout):
2404         (WebCore::Layout::LineInput::LineInput):
2405         (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
2406         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
2407         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2408         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
2409         (WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
2410         (WebCore::Layout::UncommittedContent::runs): Deleted.
2411         (WebCore::Layout::UncommittedContent::isEmpty const): Deleted.
2412         (WebCore::Layout::UncommittedContent::size const): Deleted.
2413         (WebCore::Layout::UncommittedContent::width const): Deleted.
2414         (WebCore::Layout::UncommittedContent::add): Deleted.
2415         (WebCore::Layout::UncommittedContent::reset): Deleted.
2416         (WebCore::Layout::LineInput::HorizontalConstraint::HorizontalConstraint): Deleted.
2417         (WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout): Deleted.
2418         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): Deleted.
2419         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): Deleted.
2420         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const): Deleted.
2421         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const): Deleted.
2422         (WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const): Deleted.
2423         * layout/inlineformatting/InlineLine.cpp:
2424         (WebCore::Layout::Line::Line):
2425         * layout/inlineformatting/InlineLine.h:
2426
2427 2019-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2428
2429         [GTK] MOUSE_CURSOR_SCALE is not implemented
2430         https://bugs.webkit.org/show_bug.cgi?id=109469
2431
2432         Reviewed by Darin Adler.
2433
2434         Use gdk_cursor_new_from_surface() instead of gdk_cursor_new_from_pixbuf() to avoid the surface to pixbuf
2435         conversion.
2436
2437         * platform/gtk/CursorGtk.cpp:
2438         (WebCore::createCustomCursor):
2439
2440 2019-07-17  Chris Dumez  <cdumez@apple.com>
2441
2442         Prewarm local storage in the NetworkProcess to reduce WebContent process hangs
2443         https://bugs.webkit.org/show_bug.cgi?id=199879
2444         <rdar://problem/53217757>
2445
2446         Reviewed by Ryosuke Niwa.
2447
2448         When JS accesses window.localStorage for the first time, we end up doing a
2449         synchronous IPC to the network process to pull in all items in the local
2450         storage for the origin. If the network process does not have this data in
2451         memory, it has to read it from a database on disk, which may take a significant
2452         amount of time and hang the WebContent process during this time.
2453
2454         To alleviate this problem, this patch introduces prewarming on the local storage
2455         in the network process when loading a given origin in the WebContent process.
2456         This way, in most cases, when the JS accesses window.localStorage for the first
2457         time, the synchronous IPC to the network process returns much faster (measured
2458         50-100ms for a very large database, down from 250-300ms), as it only needs to
2459         IPC the data over, without the need to fetch it from disk.
2460
2461         As a safety net to avoid excessive prewarming, we currently prewarm at most 5
2462         security origins per page load.
2463
2464         * loader/DocumentLoader.cpp:
2465         (WebCore::DocumentLoader::commitData):
2466         * page/DOMWindow.cpp:
2467         (WebCore::DOMWindow::prewarmLocalStorageIfNecessary):
2468         * page/DOMWindow.h:
2469         * page/Frame.cpp:
2470         (WebCore::Frame::didPrewarmLocalStorage):
2471         (WebCore::Frame::mayPrewarmLocalStorage const):
2472         * page/Frame.h:
2473         * storage/Storage.cpp:
2474         (WebCore::Storage::prewarm):
2475         * storage/Storage.h:
2476         * storage/StorageArea.h:
2477         (WebCore::StorageArea::prewarm):
2478
2479 2019-07-17  Robin Morisset  <rmorisset@apple.com>
2480
2481         [WHLSL] The lexer should not choke on a single '/'
2482         https://bugs.webkit.org/show_bug.cgi?id=199886
2483
2484         Reviewed by Myles Maxfield.
2485
2486         The bug is trivial: just recognize that a single '/' without a '*' or '/' afterwards is not the beginning of a comment.
2487
2488         While investigating this bug, I also found that part of the parser fails to properly propagate errors, so I fixed it.
2489
2490         New test in LayoutTests/webgpu/whlsl/float-math.html
2491         I also added a new flag to WHLSLPrepare.cpp. It can be used to parse the full standard library (this is how I found this bug in the first place).
2492
2493         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
2494         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
2495         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2496         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
2497         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2498         (WebCore::WHLSL::prepareShared):
2499         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
2500         (WebCore::WHLSL::includeStandardLibrary):
2501         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h:
2502
2503 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
2504
2505         Unreviewed build fix after r247549.
2506
2507         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
2508
2509 2019-07-17  Robin Morisset  <rmorisset@apple.com>
2510
2511         [WHLSL] Remove traps from the compiler
2512         https://bugs.webkit.org/show_bug.cgi?id=195811
2513         <rdar://problem/50746299>
2514
2515         Reviewed by Myles Maxfield.
2516
2517         Remove the Trap statement from the language, see https://github.com/gpuweb/WHLSL/issues/301.
2518
2519         No new tests, as this part of the language was already untested, and we are removing it, not adding anything.
2520
2521         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
2522         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
2523         (WebCore::WHLSL::AST::Statement::isSwitchStatement const):
2524         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Removed.
2525         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2526         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
2527         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
2528         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
2529         (WebCore::WHLSL::Token::typeName):
2530         (WebCore::WHLSL::Lexer::recognizeKeyword):
2531         * Modules/webgpu/WHLSL/WHLSLLexer.h:
2532         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2533         (WebCore::WHLSL::Parser::parseStatement):
2534         * Modules/webgpu/WHLSL/WHLSLParser.h:
2535         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
2536         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2537         (WebCore::WHLSL::Visitor::visit):
2538         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
2539         * WebCore.xcodeproj/project.pbxproj:
2540
2541 2019-07-17  Robin Morisset  <rmorisset@apple.com>
2542
2543         [WHLSL] checkRecursiveType should not have exponential complexity.
2544         https://bugs.webkit.org/show_bug.cgi?id=199835
2545
2546         Reviewed by Myles Maxfield.
2547
2548         The change is very similar to that in https://bugs.webkit.org/show_bug.cgi?id=199688.
2549         Just keep track of which types have already been visited, and don't visit them again.
2550
2551         No new tests as there is no intended functional change.
2552
2553         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
2554         (WebCore::WHLSL::RecursiveTypeChecker::visit):
2555         (WebCore::WHLSL::checkRecursiveTypes):
2556
2557 2019-07-17  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
2558
2559         Add missing #include's
2560         https://bugs.webkit.org/show_bug.cgi?id=199856
2561
2562         Reviewed by Simon Fraser.
2563
2564         The missing headers were found during development when unified sources changed.
2565
2566         No new tests required. Adding #include's only.
2567
2568         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
2569         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
2570         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
2571         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2572         * Modules/webgpu/WebGPUCommandEncoder.cpp:
2573
2574 2019-07-17  Ryosuke Niwa  <rniwa@webkit.org>
2575
2576         Add inputmode to the feature status page
2577         https://bugs.webkit.org/show_bug.cgi?id=199884
2578
2579         Reviewed by Wenson Hsieh.
2580
2581         Added as supported.
2582
2583         * features.json:
2584
2585 2019-07-17  Antoine Quint  <graouts@apple.com>
2586
2587         Disable Pointer Events prior to watchOS 6
2588         https://bugs.webkit.org/show_bug.cgi?id=199890
2589         <rdar://problem/53206113>
2590
2591         Reviewed by Dean Jackson.
2592
2593         * Configurations/FeatureDefines.xcconfig:
2594
2595 2019-07-17  Antoine Quint  <graouts@apple.com>
2596
2597         Unable to bring up custom media controls on iOS for video.sina.cn
2598         https://bugs.webkit.org/show_bug.cgi?id=199889
2599         <rdar://problem/51883919>
2600
2601         Reviewed by Dean Jackson.
2602
2603         Videos on video.sina.cn by default have the "controls" attribute and are set not to autoplay. This means that the original state
2604         of the media controls are set to show the built-in media controls and also show the prominent play button to begin playback. The
2605         display of the play button also requires a tap gesture recognizer, which calls preventDefault() when the "touchend" is received
2606         to prevent double-tap-to-zoom, but also has the side-effect of preventing a "click" event from being dispatched for a tap.
2607
2608         The video.sina.cn code would eventually remove the "controls" attribute, which would make the built-in media controls not visible,
2609         but still participate in hit-testing because we keep the shadow DOM around in order to potentially show the Airplay or picture-in-picture
2610         placards. Additionally, we wouldn't disable the tap gesture recognizer when the "controls" attribute was removed.
2611
2612         We now ensure that both gesture recognizers used by iOS inline media controls are only enabled when media controls are visible.
2613
2614         Test: media/modern-media-controls/media-controller/ios/media-controller-allows-click-over-video-with-no-controls.html
2615
2616         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
2617         (IOSInlineMediaControls.prototype.set showsStartButton):
2618         (IOSInlineMediaControls.prototype.get visible):
2619         (IOSInlineMediaControls.prototype.set visible):
2620         (IOSInlineMediaControls.prototype._updateGestureRecognizers):
2621         (IOSInlineMediaControls.prototype._tapGestureRecognizerStateDidChange):
2622         (IOSInlineMediaControls.prototype._pinchGestureRecognizerStateDidChange):
2623
2624 2019-07-17  Christopher Reid  <chris.reid@sony.com>
2625
2626         Bytecode cache should use FileSystem
2627         https://bugs.webkit.org/show_bug.cgi?id=199759
2628
2629         Reviewed by Yusuke Suzuki.
2630
2631         * platform/SharedBuffer.cpp:
2632
2633 2019-07-17  Zalan Bujtas  <zalan@apple.com>
2634
2635         Unable to tap buttons at top of Wells Fargo app’s Payees screen
2636         https://bugs.webkit.org/show_bug.cgi?id=199846
2637         <rdar://problem/48112220>
2638
2639         Reviewed by Simon Fraser.
2640
2641         This patch restores the stop-before-reaching-the-body heuristics for the approximate node finding feature only.
2642         (WebFrame::approximateNodeAtViewportLocation mistakenly relied on this odd quirk of nodeRespondingToClickEvents.)
2643
2644         * page/Frame.h:
2645         * page/ios/FrameIOS.mm:
2646         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
2647
2648 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
2649
2650         [iOS WK2] Avoid lots of compositing backing store for offscreen position:fixed descendants
2651         https://bugs.webkit.org/show_bug.cgi?id=199819
2652         rdar://problem/51977416
2653
2654         Reviewed by Zalan Bujtas.
2655
2656         There was code to ensure that position:fixed layers and their descendants don't have their
2657         backing store detached (thrown away to save memory when offscreen), since that can trigger
2658         flashing when async scrolling moves layers in and out of the visual viewport.
2659
2660         However, some pages have many descendant layers of positon:fixed which entrain backing
2661         store, because, for example, they have a stack of translated-offscreen menu elements inside
2662         a fixed header, and those elements may composite because of overflow:scroll.
2663
2664         To avoid using too much memory on such pages, allow backing store detachment for fixed
2665         layers that are outside the layout viewport. Add a flag to RenderLayer that's set for layers
2666         which are fixed, or descendants of fixed, and consult that flag in
2667         updateAllowsBackingStoreDetaching(). The logic there is similar to
2668         RenderLayerCompositor::requiresCompositingForPosition().
2669         
2670         I considered allowing all position:fixed to composite (since this patch would keep most of
2671         the memory saving), but historically we've avoided compositing out-of-viewport
2672         position:fixed because it's quite common to have them with negative z-index, and compositing
2673         those has significant compositing knock-on effects.
2674         
2675         GraphicsLayer flushing no longer needs to track the viewport-constrained status of layers,
2676         so remove that code.
2677         
2678         This patch removes backing-store pinning for sticky layers.
2679         scrolling/ios/reconcile-layer-position-recursive.html then revealed a bug in
2680         ScrollingStateStickyNode::reconcileLayerPositionForViewportRect(), which was assuming that
2681         the sticky element was scrolled by the page, causing a bad layer position to get sync'd onto
2682         the layer. Fixed by copying code from ScrollingTreeStickyNode that is smarter about
2683         computing layer positions.
2684         
2685         This patch fixes jetsams on kmart.com.au in iOS 13 beta.
2686
2687         Test: compositing/layer-creation/fixed-position-descendants-out-of-view.html
2688
2689         * page/scrolling/ScrollingStateStickyNode.cpp:
2690         (WebCore::ScrollingStateStickyNode::computeLayerPosition const):
2691         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
2692         * page/scrolling/ScrollingStateStickyNode.h:
2693         * platform/graphics/GraphicsLayer.h:
2694         (WebCore::GraphicsLayer::setAllowsBackingStoreDetaching):
2695         (WebCore::GraphicsLayer::allowsBackingStoreDetaching const):
2696         (WebCore::GraphicsLayer::setIsViewportConstrained): Deleted.
2697         (WebCore::GraphicsLayer::isViewportConstrained const): Deleted.
2698         (WebCore::GraphicsLayer::setCanDetachBackingStore): Deleted.
2699         (WebCore::GraphicsLayer::canDetachBackingStore const): Deleted.
2700         * platform/graphics/ca/GraphicsLayerCA.cpp:
2701         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2702         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
2703         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2704         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2705         (WebCore::GraphicsLayerCA::updateCoverage):
2706         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2707         * platform/graphics/ca/GraphicsLayerCA.h:
2708         * rendering/RenderLayer.cpp:
2709         (WebCore::RenderLayer::RenderLayer):
2710         (WebCore::RenderLayer::updateLayerPositions):
2711         (WebCore::outputPaintOrderTreeLegend):
2712         (WebCore::outputPaintOrderTreeRecursive):
2713         * rendering/RenderLayer.h:
2714         * rendering/RenderLayerBacking.cpp:
2715         (WebCore::RenderLayerBacking::updateAllowsBackingStoreDetaching):
2716         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
2717         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole): Deleted.
2718         * rendering/RenderLayerBacking.h:
2719         * rendering/RenderLayerCompositor.cpp:
2720         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2721         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2722         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2723         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
2724
2725 2019-07-17  Chris Dumez  <cdumez@apple.com>
2726
2727         Avoid unnecessary copy of monitors under DisplayRefreshMonitorManager::displayWasUpdated()
2728         https://bugs.webkit.org/show_bug.cgi?id=199847
2729
2730         Reviewed by Said Abou-Hallawa.
2731
2732         There is always one one monitor in m_monitors for a given displayID so there is
2733         no need to copy the monitors inside DisplayRefreshMonitorManager::displayWasUpdated()
2734         and no need to iterate over all of them. This patch also factors a bit differently
2735         so that it becomes more obvious.
2736
2737         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2738         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
2739         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
2740         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
2741         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2742         (WebCore::DisplayRefreshMonitorManager::findMonitorForDisplay const):
2743         (WebCore::DisplayRefreshMonitorManager::monitorForDisplay const):
2744         * platform/graphics/DisplayRefreshMonitorManager.h:
2745
2746 2019-07-17  Sihui Liu  <sihui_liu@apple.com>
2747
2748         IndexedDB: error in starting version change transaction may be neglected
2749         https://bugs.webkit.org/show_bug.cgi?id=199818
2750         <rdar://problem/52925738>
2751
2752         Reviewed by Brady Eidson.
2753
2754         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
2755         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
2756         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
2757         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
2758         m_databaseInfo could become nullptr.
2759
2760         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
2761         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
2762         ungradeneeded event is dispatched to the IDBRequest.
2763
2764         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2765         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
2766         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
2767         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
2768         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
2769         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2770
2771 2019-07-17  Daniel Bates  <dabates@apple.com>
2772
2773         Typing into a cell in a Google Sheet lags behind by one character
2774         https://bugs.webkit.org/show_bug.cgi?id=199587
2775         <rdar://problem/51616845>
2776
2777         Reviewed by Brent Fulgham.
2778
2779         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
2780         into a holding tank. The timers continue to tick, but are barred from executing their action until
2781         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
2782         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
2783         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
2784         of the document.
2785
2786         The story behind the quirk:
2787
2788         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
2789         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
2790         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
2791         event. It could happen in the same event loop iteration as the key press (as Google expects), the
2792         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
2793         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
2794         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
2795         functionality was available via onpropertychange in IE < 9).
2796
2797         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
2798         this quirk.
2799
2800         Test: fast/events/ios/dom-update-on-keydown-quirk.html
2801
2802         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
2803
2804         * SourcesCocoa.txt:
2805         * WebCore.xcodeproj/project.pbxproj:
2806         Add some files to the project.
2807
2808         * dom/Document.cpp:
2809         (WebCore::Document::domTimerHoldingTank): Added.
2810         * dom/Document.h:
2811         (WebCore::Document::domTimerHoldingTankIfExists): Added.
2812
2813         * page/DOMTimer.cpp:
2814         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
2815         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
2816         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
2817         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
2818         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
2819         we do not suspend timers in the holding tank is because:
2820             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
2821             Though smart supension logic could avoid this. See (3).
2822
2823             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
2824             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
2825             So, the timers in the holding tank are short-lived.
2826
2827             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
2828             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
2829             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
2830         * page/EventHandler.cpp:
2831         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
2832         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
2833         * page/Quirks.cpp:
2834         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
2835         * page/Quirks.h:
2836         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
2837         also lets us enable the quirk for all sites or for certain third-party apps if desired.
2838         * page/ios/DOMTimerHoldingTank.cpp: Added.
2839         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
2840         (WebCore::DOMTimerHoldingTank::add):
2841         (WebCore::DOMTimerHoldingTank::remove):
2842         (WebCore::DOMTimerHoldingTank::contains):
2843         (WebCore::DOMTimerHoldingTank::removeAll):
2844         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
2845         * page/ios/DOMTimerHoldingTank.h: Added.
2846         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
2847         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
2848         (WebCore::DeferDOMTimersForScope::isDeferring):
2849
2850 2019-07-17  Darin Adler  <darin@apple.com>
2851
2852         No need for isURLAllowed function in Frame
2853         https://bugs.webkit.org/show_bug.cgi?id=120266
2854
2855         Reviewed by Alex Christensen.
2856
2857         * css/SelectorCheckerTestFunctions.h:
2858         (WebCore::matchesFullScreenPseudoClass): Use is<> instead of
2859         the isFrameElementBase function. Also updated includes and spacing.
2860
2861         * dom/Document.cpp:
2862         (WebCore::Document::resolveStyle): Shortened an old, long comment
2863         that happened to mention HTMLFrameElementBase::isURLAllowed by name.
2864
2865         * dom/Element.h: Deleted isFrameElementBase.
2866
2867         * html/HTMLAppletElement.cpp:
2868         (WebCore::HTMLAppletElement::updateWidget): Tweaked comment.
2869
2870         * html/HTMLBodyElement.cpp:
2871         (WebCore::HTMLBodyElement::insertedIntoAncestor): Moved comment from
2872         here to didFinishInsertingNode, since the code it's talking about is there.
2873         Also got rid of unnecessary local variable.
2874         (WebCore::HTMLBodyElement::didFinishInsertingNode): Moved comment here
2875         and elaborated a bit. Also changed the code to copy margin attributes in a
2876         simpler way without requiring special getter functions. There is a slight
2877         behavior change here, but seems unlikely to affect any websites or tests.
2878         Would be good to add better test coverage, which I think should be done
2879         when fixing the problems described in the FIXME.
2880
2881         * html/HTMLEmbedElement.cpp:
2882         (WebCore::HTMLEmbedElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
2883         Also Tweaked comments.
2884
2885         * html/HTMLFrameElement.cpp:
2886         (WebCore::HTMLFrameElement::rendererIsNeeded): isURLAllowed -> canLoad
2887
2888         * html/HTMLFrameElementBase.cpp:
2889         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase): Removed initial
2890         values for no-longer-needed data members.
2891
2892         (WebCore::HTMLFrameElementBase::canLoadScriptURL const): Renamed from
2893         isURLAllowed. Also refactored so it now calls canLoadURL.
2894         (WebCore::HTMLFrameElementBase::canLoad const): Renamed from isURLAllowed.
2895         Also added FIXME comments about multiple ways that this code incorrectly
2896         handles the empty string. Might inspire some tests and future fixes.
2897         (WebCore::HTMLFrameElementBase::canLoadURL const): Renamed from isURLAllowed.
2898         Added an overload that takes a relative URL string largely to make this
2899         more parallel with the similar code in HTMLPlugInImageElement. Refactored
2900         to call canAddSubframe and isProhibitedSelfReference, removing the need
2901         to call Frame::isURLAllowed.
2902         (WebCore::HTMLFrameElementBase::openURL): isURLAllowed -> canLoad
2903         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code
2904         to parse marginwidth, marginheight, and scrolling, which are now done
2905         as needed instead. Might have to add code back if we ever add code to
2906         make these cause dynamic updates when changed, but that was not the
2907         behavior of the existing code.
2908         (WebCore::HTMLFrameElementBase::scrollingMode const): Changed to call
2909         attributeWithoutSynchronization rather than reading from a data member.
2910
2911         * html/HTMLFrameElementBase.h: Moved scrollingMode into the .cpp file.
2912         Removed marginWidth and marginHeight since they are no longer called.
2913         Made canContainRangeEndPoint override be private. Renamed isURLAllowed
2914         to canLoad/canLoadScriptURL/canLoadURL. Removed unneeded isFrameElementBase
2915         since is<HTMLFrameElementBase> already works without it. Removed unneeded
2916         data members m_scrolling, m_marginWidth, and m_marginHeight.
2917
2918         * html/HTMLFrameOwnerElement.cpp:
2919         (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement): Moved initialization
2920         of m_contentFrame and m_sandboxFlags to the header.
2921         (WebCore::HTMLFrameOwnerElement::clearContentFrame): 0 -> nullptr
2922         (WebCore::HTMLFrameOwnerElement::canAddSubframe const): Added. Code was moved
2923         here from multiple functions that enforced the subframe count limit.
2924         (WebCore::HTMLFrameOwnerElement::isProhibitedSelfReference const): Added.
2925         Moved code here from Frame::isURLAllowed so it's easy to use as needed.
2926
2927         * html/HTMLFrameOwnerElement.h: Renamed isURLAllowed to canLoadScriptURL.
2928         Added protected canAddSubframe and isProhibitedSelfReference functions.
2929         Initialized the data members here.
2930
2931         * html/HTMLIFrameElement.cpp:
2932         (WebCore::HTMLIFrameElement::sandbox): Added braces for multi-line if statement.
2933         (WebCore::HTMLIFrameElement::parseAttribute): Removed unneeded storage of the
2934         allow attribute value. Added missing code to invalidate m_featurePolicy when
2935         the allow attribute changes. This could change behavior, but unlikely to affect
2936         any websites of tests. Would be good to add a test for this.
2937         (WebCore::HTMLIFrameElement::rendererIsNeeded): isURLAllowed -> canLoad. Also
2938         reordered the code to be more efficient for display: none (why not?).
2939         (WebCore::HTMLIFrameElement::featurePolicy const): Use attributeWithoutSynchronization
2940         to read the allow attribute rather than using a data member.
2941
2942         * html/HTMLIFrameElement.h: Removed the unneeded allow function member and
2943         m_allow data member since DOM reflection takes care of the function and the
2944         featurePolicy function can get the attribute without a data member.
2945
2946         * html/HTMLObjectElement.cpp:
2947         (WebCore::HTMLObjectElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
2948         Also tweaked comments.
2949
2950         * html/HTMLPlugInElement.cpp:
2951         (WebCore::HTMLPlugInElement::canLoadScriptURL const): Added. Code moved here
2952         from HTMLFrameOwnerElement::isURLAllowed. Added comment about why this is not
2953         necessarily correct and might need improvement.
2954
2955         * html/HTMLPlugInElement.h: Added private override of canLoadScriptURL.
2956
2957         * html/HTMLPlugInImageElement.cpp:
2958         (WebCore::HTMLPlugInImageElement::canLoadURL const): Renamed from
2959         allowedToLoadFrameURL and refactored into two functions to match the
2960         structure of the similar function in HTMLFrameElementBase. Also refactored
2961         to use canAddSubframe and isProhibitedSelfReference rather than Frame::isURLAllowed.
2962         (WebCore::HTMLPlugInImageElement::canLoadPlugInContent const): Renamed from
2963         allowedToLoadPluginContent.
2964         (WebCore::HTMLPlugInImageElement::requestObject): allowedToLoadPluginContent
2965         -> canLoadPlugInContent
2966
2967         * html/HTMLPlugInImageElement.h: Renamed functions as mentioned above.
2968
2969         * loader/SubframeLoader.cpp:
2970         (WebCore::SubframeLoader::requestFrame): isURLAllowed -> canLoadScriptURL
2971
2972         * page/FocusController.h: Removed unneeded forward declaration of HTMLFrameOwnerElement.
2973
2974         * page/Frame.cpp:
2975         (WebCore::Frame::isURLAllowed const): Deleted.
2976         * page/Frame.h: Ditto.
2977
2978         * page/FrameView.cpp:
2979         (WebCore::FrameView::init): Removed code to initialize m_margins, since nothing
2980         was looking at it after that.
2981         (WebCore::FrameView::setMarginWidth): Deleted.
2982         (WebCore::FrameView::setMarginHeight): Deleted.
2983
2984         * page/FrameView.h: Removed marginWidth, marginHeight, setMarginWidth,
2985         setMarginHeight, and m_margins because there was no code anywhere calling
2986         marginWidth or marginHeight, and no other side effects of these functions.
2987
2988 2019-07-17  Alex Christensen  <achristensen@webkit.org>
2989
2990         Add a runtime-disabled dialog element skeleton
2991         https://bugs.webkit.org/show_bug.cgi?id=199839
2992
2993         Reviewed by Ryosuke Niwa.
2994
2995         Beginning implementation of https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element
2996         Covered by rebaselining WPT tests.
2997
2998         * CMakeLists.txt:
2999         * DerivedSources-input.xcfilelist:
3000         * DerivedSources-output.xcfilelist:
3001         * DerivedSources.make:
3002         * Sources.txt:
3003         * WebCore.xcodeproj/project.pbxproj:
3004         * bindings/js/WebCoreBuiltinNames.h:
3005         * html/HTMLDialogElement.cpp: Added.
3006         (WebCore::HTMLDialogElement::HTMLDialogElement):
3007         (WebCore::HTMLDialogElement::open):
3008         (WebCore::HTMLDialogElement::setOpen):
3009         (WebCore::HTMLDialogElement::returnValue):
3010         (WebCore::HTMLDialogElement::setReturnValue):
3011         (WebCore::HTMLDialogElement::show):
3012         (WebCore::HTMLDialogElement::showModal):
3013         (WebCore::HTMLDialogElement::close):
3014         * html/HTMLDialogElement.h: Added.
3015         * html/HTMLDialogElement.idl: Added.
3016         * html/HTMLTagNames.in:
3017         * page/RuntimeEnabledFeatures.h:
3018         (WebCore::RuntimeEnabledFeatures::setDialogElementEnabled):
3019         (WebCore::RuntimeEnabledFeatures::dialogElementEnabled const):
3020
3021 2019-07-17  Youenn Fablet  <youenn@apple.com>
3022
3023         Hop to the main thread when doing logging in RealtimeIncomingVideoSourceCocoa
3024         https://bugs.webkit.org/show_bug.cgi?id=199865
3025
3026         Reviewed by Darin Adler.
3027
3028         LoggerHelper routines allow logging messages in system console and inspector console.
3029         These routines iterate through a Vector of log observers which is not thread safe.
3030         Document, the main log observer, also expects to be called on the main thread.
3031         Manually tested (writing a layout test for this would require more than 2 seconds).
3032
3033         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
3034         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
3035
3036 2019-07-17  Commit Queue  <commit-queue@webkit.org>
3037
3038         Unreviewed, rolling out r247505.
3039         https://bugs.webkit.org/show_bug.cgi?id=199871
3040
3041         "Caused failed ASSERT in stress test" (Requested by creid on
3042         #webkit).
3043
3044         Reverted changeset:
3045
3046         "Bytecode cache should use FileSystem"
3047         https://bugs.webkit.org/show_bug.cgi?id=199759
3048         https://trac.webkit.org/changeset/247505
3049
3050 2019-07-17  Youenn Fablet  <youenn@apple.com>
3051
3052         Add release logging to AudioSampleDataSource
3053         https://bugs.webkit.org/show_bug.cgi?id=199814
3054         <rdar://problem/53128140>
3055
3056         Reviewed by Eric Carlson.
3057
3058         Use release logging for AudioSampleDataSource in case of errors.
3059         This requires passing a logger and a logger identifier.
3060         For that purpose, pass a MediaStreamTrackPrivate to it constructor
3061         and reuse its logger and log identifier.
3062
3063         For each log, hop to the main thread as release logging requires to be done in the main thread.
3064         Add specific handling for RealtimeOutgoingAudioSource as its MediaStreamTrack can change in case of replaceTrack.
3065         In that case, we change of logger when changing the MediaStreamTrackPrivate.
3066
3067         No observable change of behavior, covered by existing tests.
3068
3069         * platform/audio/mac/AudioSampleDataSource.h:
3070         * platform/audio/mac/AudioSampleDataSource.mm:
3071         (WebCore::AudioSampleDataSource::create):
3072         (WebCore::AudioSampleDataSource::AudioSampleDataSource):
3073         (WebCore::AudioSampleDataSource::setupConverter):
3074         (WebCore::AudioSampleDataSource::pushSamplesInternal):
3075         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3076         (WebCore::AudioSampleDataSource::setLogger):
3077         (WebCore::AudioSampleDataSource::logChannel const):
3078         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
3079         (WebCore::RealtimeOutgoingAudioSource::setSource):
3080         * platform/mediastream/RealtimeOutgoingAudioSource.h:
3081         (WebCore::RealtimeOutgoingAudioSource::sourceUpdated):
3082         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3083         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3084         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
3085         Instead of using its own logger/identifier member field, reuse its MediaStreamTrackPrivate.
3086         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
3087         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
3088         (WebCore::RealtimeOutgoingAudioSourceCocoa::sourceUpdated):
3089         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
3090         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
3091         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
3092
3093 2019-07-17  Kenneth Russell  <kbr@chromium.org>
3094
3095         Make ANGLE work inside WebKit2's sandbox
3096         https://bugs.webkit.org/show_bug.cgi?id=199844
3097
3098         Reviewed by Alex Christensen.
3099
3100         Fix missing #import introduced at the last minute while removing
3101         some debugging code in the last patch.
3102
3103         Tested with San Angeles WebGL demo and some conformance tests.
3104
3105         * platform/graphics/cocoa/WebGLLayer.mm:
3106
3107 2019-07-17  Andres Gonzalez  <andresg_22@apple.com>
3108
3109         Hang in WebCore::AccessibilityRenderObject::visiblePositionRangeForLine.
3110         https://bugs.webkit.org/show_bug.cgi?id=199845
3111         <rdar://problem/53121017>
3112
3113         Reviewed by Chris Fleizach.
3114
3115         - Added check for upper bound NSNotFound for parameter to visiblePositionRangeForLine.
3116         - Fixed signed/unsigned issue for AXTextMarkerRangeForLine attribute.
3117
3118         * accessibility/AccessibilityRenderObject.cpp:
3119         (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const):
3120         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3121         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3122
3123 2019-07-17  Rob Buis  <rbuis@igalia.com>
3124
3125         Add referrerpolicy attribute support for <script> elements
3126         https://bugs.webkit.org/show_bug.cgi?id=185550
3127
3128         Reviewed by Youenn Fablet.
3129
3130         This patch adds 'referrerpolicy' attribute support for script elements.
3131         If set, the value is restricted to the ReferrerPolicy enum, and
3132         if valid it is used for the script fetch.
3133         If not set or invalid, the current behavior is kept.
3134
3135         Tests: http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http-http.html
3136                http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http.https.html
3137                http/tests/referrer-policy-script/no-referrer-when-downgrade/same-origin.html
3138                http/tests/referrer-policy-script/no-referrer/cross-origin-http-http.html
3139                http/tests/referrer-policy-script/no-referrer/cross-origin-http.https.html
3140                http/tests/referrer-policy-script/no-referrer/same-origin.html
3141                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http-http.html
3142                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http.https.html
3143                http/tests/referrer-policy-script/origin-when-cross-origin/same-origin.html
3144                http/tests/referrer-policy-script/origin/cross-origin-http-http.html
3145                http/tests/referrer-policy-script/origin/cross-origin-http.https.html
3146                http/tests/referrer-policy-script/origin/same-origin.html
3147                http/tests/referrer-policy-script/same-origin/cross-origin-http-http.html
3148                http/tests/referrer-policy-script/same-origin/cross-origin-http.https.html
3149                http/tests/referrer-policy-script/same-origin/same-origin.html
3150                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http-http.html
3151                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http.https.html
3152                http/tests/referrer-policy-script/strict-origin-when-cross-origin/same-origin.html
3153                http/tests/referrer-policy-script/strict-origin/cross-origin-http-http.html
3154                http/tests/referrer-policy-script/strict-origin/cross-origin-http.https.html
3155                http/tests/referrer-policy-script/strict-origin/same-origin.html
3156                http/tests/referrer-policy-script/unsafe-url/cross-origin-http-http.html
3157                http/tests/referrer-policy-script/unsafe-url/cross-origin-http.https.html
3158                http/tests/referrer-policy-script/unsafe-url/same-origin.html
3159
3160         * bindings/js/CachedScriptFetcher.cpp:
3161         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
3162         * bindings/js/CachedScriptFetcher.h:
3163         (WebCore::CachedScriptFetcher::CachedScriptFetcher):
3164         * dom/InlineClassicScript.h:
3165         * dom/LoadableClassicScript.cpp:
3166         (WebCore::LoadableClassicScript::create):
3167         * dom/LoadableClassicScript.h:
3168         * dom/LoadableModuleScript.cpp:
3169         (WebCore::LoadableModuleScript::create):
3170         (WebCore::LoadableModuleScript::LoadableModuleScript):
3171         * dom/LoadableModuleScript.h:
3172         * dom/LoadableScript.h:
3173         (WebCore::LoadableScript::LoadableScript):
3174         * dom/ScriptElement.cpp:
3175         (WebCore::ScriptElement::requestClassicScript):
3176         (WebCore::ScriptElement::requestModuleScript):
3177         * dom/ScriptElement.h:
3178         * dom/ScriptElementCachedScriptFetcher.h:
3179         (WebCore::ScriptElementCachedScriptFetcher::ScriptElementCachedScriptFetcher):
3180         * html/HTMLIFrameElement.cpp:
3181         (WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
3182         * html/HTMLScriptElement.cpp:
3183         (WebCore::HTMLScriptElement::setReferrerPolicyForBindings):
3184         (WebCore::HTMLScriptElement::referrerPolicyForBindings const):
3185         (WebCore::HTMLScriptElement::referrerPolicy const):
3186         * html/HTMLScriptElement.h:
3187         * html/HTMLScriptElement.idl:
3188         * html/parser/CSSPreloadScanner.cpp:
3189         (WebCore::CSSPreloadScanner::emitRule):
3190         * html/parser/HTMLPreloadScanner.cpp:
3191         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
3192         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
3193         * html/parser/HTMLResourcePreloader.cpp:
3194         (WebCore::PreloadRequest::resourceRequest):
3195         * html/parser/HTMLResourcePreloader.h:
3196         (WebCore::PreloadRequest::PreloadRequest):
3197         * platform/ReferrerPolicy.cpp:
3198         (WebCore::referrerPolicyToString):
3199         * platform/ReferrerPolicy.h:
3200         * svg/SVGScriptElement.h:
3201
3202 2019-07-16  Christopher Reid  <chris.reid@sony.com>
3203
3204         Bytecode cache should use FileSystem
3205         https://bugs.webkit.org/show_bug.cgi?id=199759
3206
3207         Reviewed by Yusuke Suzuki.
3208
3209         * platform/SharedBuffer.cpp:
3210
3211 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
3212
3213         Fix includes and make a constructor explicit to avoid unified-sources-triggered test failures
3214         https://bugs.webkit.org/show_bug.cgi?id=199849
3215
3216         Reviewed by Wenson Hsieh.
3217         
3218         webkit.org/b/199587 triggered some unexpected test failures because of unified sources include
3219         order. The TextStream operator in ScrollingTreeOverflowScrollingNode::dumpProperties() was invoking
3220         the implicit constructor of TransformOperations.
3221
3222         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: Include TextStream.h
3223         * platform/graphics/transforms/TransformOperations.h: Make ctor explicit.
3224
3225 2019-07-16  Antoine Quint  <graouts@apple.com>
3226
3227         REGRESSION: fast/events/watchos/double-tap-to-zoom* tests crashing in com.apple.WebKit: -[WKContentView(WKInteraction) _singleTapDidReset:]
3228         https://bugs.webkit.org/show_bug.cgi?id=199840
3229         <rdar://problem/52856531>
3230
3231         Reviewed by Wenson Hsieh.
3232
3233         Fix a build error that occured when building for the watchOS Simulator in the debug configuration.
3234
3235         * rendering/RenderLayerCompositor.cpp:
3236         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
3237
3238 2019-07-16  Justin Fan  <justin_fan@apple.com>
3239
3240         [WebGPU] Convert GPUComputePipeline LOG statements to generate GPUErrors
3241         https://bugs.webkit.org/show_bug.cgi?id=199773
3242
3243         Reviewed by Myles C. Maxfield.
3244
3245         Generate a GPUError if GPUComputePipeline creation fails.
3246         Rework the WHLSL test harness to take advantage of this.
3247
3248         Test: webgpu/compute-pipeline-errors.html
3249
3250         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp:
3251         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
3252         * Modules/webgpu/WebGPUComputePipelineDescriptor.h:
3253         * Modules/webgpu/WebGPUDevice.cpp:
3254         (WebCore::WebGPUDevice::createComputePipeline const):
3255         * platform/graphics/gpu/GPUBuffer.h:
3256         * platform/graphics/gpu/GPUComputePipeline.h: 
3257                 Now inherits from GPUObjectBase, though this isn't super useful yet
3258                 since GPUComputePipeline itself does not expose any operations that can error. 
3259         * platform/graphics/gpu/GPUDevice.cpp:
3260         (WebCore::GPUDevice::tryCreateComputePipeline const):
3261         * platform/graphics/gpu/GPUDevice.h:
3262         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3263         (WebCore::GPUBuffer::validateBufferUsage):
3264         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
3265         (WebCore::trySetMetalFunctions):
3266         (WebCore::trySetFunctions):
3267         (WebCore::convertComputePipelineDescriptor):
3268         (WebCore::tryCreateMTLComputePipelineState):
3269         (WebCore::GPUComputePipeline::tryCreate):
3270         (WebCore::GPUComputePipeline::GPUComputePipeline):
3271
3272 2019-07-11  Justin Fan  <justin_fan@apple.com>
3273
3274         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
3275         https://bugs.webkit.org/show_bug.cgi?id=199740
3276
3277         Reviewed by Myles C. Maxfield.
3278
3279         Move error generation into a separate RefCounted class to allow GPU objects to generate 
3280         errors independent of any GPUDevice.
3281         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
3282
3283         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
3284
3285         * Modules/webgpu/WebGPUDevice.cpp:
3286         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
3287         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
3288         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
3289         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
3290         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
3291         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
3292         * Modules/webgpu/WebGPUDevice.h:
3293         (WebCore::WebGPUDevice::pushErrorScope):
3294         * Sources.txt:
3295         * WebCore.xcodeproj/project.pbxproj:
3296         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
3297         * platform/graphics/gpu/GPUDevice.cpp:
3298         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
3299         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
3300         (WebCore::GPUDevice::popErrorScope): Deleted.
3301         (WebCore::GPUDevice::registerError): Deleted.
3302         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
3303         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
3304         (WebCore::GPUErrorGenerator::pushErrorScope):
3305         (WebCore::GPUErrorGenerator::popErrorScope):
3306         (WebCore::GPUErrorGenerator::generateError):
3307         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
3308         (WebCore::GPUErrorGenerator::create):
3309         * platform/graphics/gpu/GPUObjectBase.h: Added.
3310         (WebCore::GPUObjectBase::generateError):
3311         (WebCore::GPUObjectBase::GPUObjectBase):
3312         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
3313         (WebCore::GPUBuffer::validateBufferUsage):
3314         (WebCore::GPUBuffer::tryCreate):
3315         (WebCore::GPUBuffer::GPUBuffer):
3316         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
3317         (WebCore::GPUQueue::submit): Prevent possible null dereference.
3318
3319 2019-07-10  Justin Fan  <justin_fan@apple.com>
3320
3321         [WebGPU] Implement GPUError and error scopes
3322         https://bugs.webkit.org/show_bug.cgi?id=199655
3323
3324         Reviewed by Myles C. Maxfield.
3325
3326         Add GPUErrorFilter, GPUError, and the ability to push and pop error scopes on a GPUDevice.
3327         This will allow us to check for WebGPU errors from JavaScript.
3328         Currently, only some GPUBuffer creation errors are reported for testing; more errors will follow in later patches.
3329
3330         Test: webgpu/error-scopes-test.html
3331
3332         * Modules/webgpu/GPUErrorFilter.idl: Added.
3333         * Modules/webgpu/GPUOutOfMemoryError.idl: Added.
3334         * Modules/webgpu/GPUValidationError.idl: Added.
3335         * Modules/webgpu/WebGPUDevice.cpp:
3336         (WebCore::WebGPUDevice::pushErrorScope):
3337         (WebCore::WebGPUDevice::popErrorScope): Resolve the Promise here, since GPUDevice shouldn't worry about DOM layer.
3338         * Modules/webgpu/WebGPUDevice.h:
3339         * Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Added.
3340         (WebCore::WebGPUDeviceErrorScopes::pushErrorScope): Delegates to WebGPUDevice.
3341         (WebCore::WebGPUDeviceErrorScopes::popErrorScope): Ditto.
3342         * Modules/webgpu/WebGPUDeviceErrorScopes.h: Added.
3343         * Modules/webgpu/WebGPUDeviceErrorScopes.idl: Added.
3344         * platform/graphics/gpu/GPUBuffer.h:
3345         * platform/graphics/gpu/GPUDevice.cpp: The actual error stack lives here.
3346         (WebCore::GPUDevice::pushErrorScope):
3347         (WebCore::GPUDevice::popErrorScope): Calls a callback with a GPUError, if any.
3348         (WebCore::GPUDevice::registerError): Actually creates GPUErrors.
3349         * platform/graphics/gpu/GPUDevice.h:
3350         * platform/graphics/gpu/GPUError.cpp: Added.
3351         (WebCore::createError): Factory function for various error types.
3352         * platform/graphics/gpu/GPUError.h: Added.
3353         * platform/graphics/gpu/GPUErrorFilter.h: Added.
3354         * platform/graphics/gpu/GPUOutOfMemoryError.h: Added.
3355         (WebCore::GPUOutOfMemoryError::create):
3356         * platform/graphics/gpu/GPUValidationError.cpp: Added.
3357         (WebCore::GPUValidationError::create):
3358         (WebCore::GPUValidationError::GPUValidationError):
3359         * platform/graphics/gpu/GPUValidationError.h: Added.
3360         (WebCore::GPUValidationError::message const):
3361         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3362         (WebCore::GPUBuffer::validateBufferUsage): Create an actual GPUValidationError :)
3363         (WebCore::GPUBuffer::tryCreate): Create GPUOutOfMemoryErrors where appropriate.
3364
3365         Add file/name references:
3366         * CMakeLists.txt:
3367         * DerivedSources-input.xcfilelist:
3368         * DerivedSources-output.xcfilelist:
3369         * DerivedSources.make:
3370         * Sources.txt:
3371         * WebCore.xcodeproj/project.pbxproj:
3372         * bindings/js/WebCoreBuiltinNames.h:
3373
3374         Missing includes:
3375         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
3376
3377 2019-07-16  Commit Queue  <commit-queue@webkit.org>
3378
3379         Unreviewed, rolling out r247493.
3380         https://bugs.webkit.org/show_bug.cgi?id=199841
3381
3382         "The new whlsl-for-loop.html test is failing on the bots"
3383         (Requested by rmorisset on #webkit).
3384
3385         Reverted changeset:
3386
3387         "[WHLSL] Desugar for loops and while loops"
3388         https://bugs.webkit.org/show_bug.cgi?id=199726
3389         https://trac.webkit.org/changeset/247493
3390
3391 2019-07-16  Per Arne Vollan  <pvollan@apple.com>
3392
3393         Prewarm font cache with more fonts
3394         https://bugs.webkit.org/show_bug.cgi?id=199283
3395
3396         Reviewed by Myles C. Maxfield.
3397
3398         Use the existing prewarm method in FontCache to prewarm the cache with a set of font family names.
3399         The font list consists of some of the fonts used by the 10 most popular sites on Alexa top sites.
3400         This is a confirmed improvement in page load time.
3401
3402         No new tests, covered by existing tests.
3403
3404         * page/ProcessWarming.cpp:
3405         (WebCore::ProcessWarming::prewarmGlobally):
3406         * platform/graphics/FontCache.cpp:
3407         (WebCore::FontCache::prewarmGlobally):
3408         * platform/graphics/FontCache.h:
3409         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3410         (WebCore::FontCache::prewarmGlobally):
3411
3412 2019-07-16  Robin Morisset  <rmorisset@apple.com>
3413
3414         [WHLSL] Desugar for loops and while loops
3415         https://bugs.webkit.org/show_bug.cgi?id=199726
3416
3417         Reviewed by Myles C. Maxfield.
3418
3419         This patch makes loops behave a lot more similarly to the spec.
3420         In particular, while loops are just degenerate for loops, so they can be desugared in the parser.
3421         And for loops can themselves be heavily desugared, into having no initializer, one condition and one increment
3422         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.
3423
3424         Debugging this patch revealed an unrelated bug where the parser would generate an empty comma expression on ";", which the checker would then choke on.
3425         The parser now generates an empty block in that case (as specified in the spec), which fixes the problem.
3426
3427         Finally, while updating the NameResolver for the new structure of loops I realized that it was needlessly generating extra NameContext.
3428         They are not expected by the spec, that forbids naked variable declarations outside of blocks anyway.
3429         So I removed this unnecessary work, and fixed the parser to correctly forbid such naked variable declarations.
3430
3431         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
3432         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
3433         (WebCore::WHLSL::AST::ForLoop::ForLoop):
3434         (WebCore::WHLSL::AST::ForLoop::condition):
3435         (WebCore::WHLSL::AST::ForLoop::increment):
3436         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
3437         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
3438         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Removed.
3439         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3440         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
3441         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
3442         (WebCore::WHLSL::ASTDumper::visit):
3443         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
3444         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3445         (WebCore::WHLSL::Checker::visit):
3446         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
3447         (WebCore::WHLSL::NameResolver::visit):
3448         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
3449         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3450         (WebCore::WHLSL::Parser::parseBlockBody):
3451         (WebCore::WHLSL::Parser::parseForLoop):
3452         (WebCore::WHLSL::Parser::parseWhileLoop):
3453         (WebCore::WHLSL::Parser::parseStatement):
3454         (WebCore::WHLSL::Parser::parseEffectfulExpression):
3455         * Modules/webgpu/WHLSL/WHLSLParser.h:
3456         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
3457         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
3458         (WebCore::WHLSL::Visitor::visit):
3459         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
3460         * WebCore.xcodeproj/project.pbxproj:
3461
3462 2019-07-16  Tim Horton  <timothy_horton@apple.com>
3463
3464         NSTextFinder holes don't scroll with the page
3465         https://bugs.webkit.org/show_bug.cgi?id=199815
3466         <rdar://problem/52280514>
3467
3468         Reviewed by Simon Fraser.
3469
3470         * rendering/ScrollAlignment.h:
3471
3472 2019-07-16  Youenn Fablet  <youenn@apple.com>
3473
3474         [iOS] Make sure the first camera device in the list is the front camera
3475         https://bugs.webkit.org/show_bug.cgi?id=199811
3476         <rdar://problem/53125157>
3477
3478         Reviewed by Jer Noble.
3479
3480         Some websites call getUserMedia with a deviceId constraint and theey pick the
3481         first deviceId in the list provided by enumerateDevices.
3482         On iOS, this is the back camera which is often not what is expected by WebRTC applications.
3483         Instead, make sure the first camera device is the front camera.
3484
3485         Manually tested.
3486
3487         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3488
3489 2019-07-16  Chris Dumez  <cdumez@apple.com>
3490
3491         Speed up StorageManager::getValues()
3492         https://bugs.webkit.org/show_bug.cgi?id=199812
3493
3494         Reviewed by Alex Christensen.
3495
3496         * storage/StorageMap.cpp:
3497         (WebCore::StorageMap::importItems):
3498         * storage/StorageMap.h:
3499
3500 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
3501
3502         Remove "GraphicsContext 0x7ffd8765f6b0 stack changed by" logging
3503         https://bugs.webkit.org/show_bug.cgi?id=199834
3504
3505         Reviewed by Dean Jackson.
3506
3507         I inadvertently left in a couple of GraphicsContextStateStackChecker (used to detect mismatched
3508         GraphicsContext save/restore) in r246725, so remove them.
3509
3510         * rendering/RenderLayer.cpp:
3511         (WebCore::RenderLayer::paintLayerContents):
3512         * rendering/RenderLayerBacking.cpp:
3513         (WebCore::RenderLayerBacking::paintIntoLayer):
3514
3515 2019-07-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3516
3517         [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
3518         https://bugs.webkit.org/show_bug.cgi?id=199827
3519         <rdar://problem/53152660>
3520
3521         Reviewed by Zalan Bujtas.
3522
3523         After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
3524         increasing inside a container that expects a fixed integer number of lines. However, in the case of
3525         linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
3526         of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.
3527
3528         To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
3529         is fixed, and is much larger than the font size.
3530
3531         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
3532
3533         * rendering/style/TextSizeAdjustment.cpp:
3534         (WebCore::AutosizeStatus::updateStatus):
3535
3536 2019-07-16  Zalan Bujtas  <zalan@apple.com>
3537
3538         [ContentChangeObserver] Cancel ongoing content observation when tap is failed/cancelled
3539         https://bugs.webkit.org/show_bug.cgi?id=199828
3540         <rdar://problem/53152696>
3541
3542         Reviewed by Wenson Hsieh.
3543
3544         This patch ensures that we stop the content observation (initiated by touch start) when the tap
3545         is cancelled/failed.
3546
3547         Not testable.
3548
3549         * page/ios/ContentChangeObserver.cpp:
3550         (WebCore::ContentChangeObserver::didCancelPotentialTap):
3551         * page/ios/ContentChangeObserver.h:
3552
3553 2019-07-16  Rob Buis  <rbuis@igalia.com>
3554
3555         Remove support for beforeload on link=prefetch
3556         https://bugs.webkit.org/show_bug.cgi?id=199632
3557
3558         Reviewed by Youenn Fablet.
3559
3560         Remove support for beforeload on link=prefetch
3561         by not calling shouldLoadLink for prefetch.
3562         Also make loadLink return void since it always
3563         succeeds.
3564
3565         Tests: http/wpt/prefetch/beforeload-dynamic.html
3566                http/wpt/prefetch/beforeload.html
3567
3568         * html/HTMLLinkElement.cpp:
3569         (WebCore::HTMLLinkElement::process):
3570         * loader/LinkLoader.cpp:
3571         (WebCore::LinkLoader::prefetchIfNeeded):
3572         (WebCore::LinkLoader::loadLink):
3573         * loader/LinkLoader.h:
3574
3575 2019-07-16  Youenn Fablet  <youenn@apple.com>
3576
3577         Hop to main thread for release logging in RealtimeIncomingAudioSource
3578         https://bugs.webkit.org/show_bug.cgi?id=199813
3579
3580         Reviewed by Eric Carlson.
3581
3582         LoggerHelper routines allow logging messages in system console and inspector console.
3583         These routines iterate through a Vector of log observers which is not thread safe.
3584         Document, the main log observer, also expects to be called on the main thread.
3585         Manually tested (writing a layout test for this would require more than 2 seconds).
3586
3587         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
3588         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
3589
3590 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
3591
3592         Unreviewed, rolling out r247444.
3593
3594         Caused two scrolling tests to fail on iOS Simulator
3595
3596         Reverted changeset:
3597
3598         "Typing into a cell in a Google Sheet lags behind by one
3599         character"
3600         https://bugs.webkit.org/show_bug.cgi?id=199587
3601         https://trac.webkit.org/changeset/247444
3602
3603 2019-07-15  Zalan Bujtas  <zalan@apple.com>
3604
3605         outlook.live.com has odd viewport with edge gap
3606         https://bugs.webkit.org/show_bug.cgi?id=199822
3607         <rdar://problem/53029072>
3608
3609         Reviewed by Wenson Hsieh.
3610
3611         r244944 introduced a viewport width quirk because at certain screen size outlook.live.com's flex setup produced a slighly broken layout.
3612         We don't seem to need this quirk anymore (composed column's min-width is removed.)
3613
3614         * page/Quirks.cpp:
3615         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const): Deleted.
3616         (WebCore::Quirks::overriddenViewLayoutWidth const): Deleted.
3617         * page/Quirks.h:
3618
3619 2019-07-15  Saam Barati  <sbarati@apple.com>
3620
3621         [WHLSL] Matrix memory layout should match HLSL by laying out columns linearly
3622         https://bugs.webkit.org/show_bug.cgi?id=199215
3623
3624         Reviewed by Myles C. Maxfield.
3625
3626         This patch makes it so that we lay out matrices in memory in the same
3627         way HLSL does. This is by laying out columns linearly in memory. So a float4x4
3628         composed by this series of floats in memory:
3629         [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
3630         
3631         composes this logical matrix:
3632         [[ 0,  4,  8, 12]
3633          [ 1,  5,  9, 13]
3634          [ 2,  6, 10, 14]
3635          [ 3,  7, 11, 15]]
3636         
3637         To implement this, we switch to using an array to represent the memory
3638         contents linear memory layout of a matrix. So the matrix float4x3 will now
3639         be an array<float, 12> in metal. Then, we change the indexed getter and
3640         setter methods for matrices to load and store from and to the correct
3641         memory locations. The memory layout of matrices is observable to WHLSL
3642         when using a matrix as an input/output to a shader.
3643
3644         Test: webgpu/whlsl-matrix-memory-layout.html
3645
3646         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
3647         (WebCore::WHLSL::Metal::writeNativeFunction):
3648         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
3649         (WebCore::WHLSL::Metal::writeNativeType):
3650
3651 2019-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3652
3653         [Text autosizing] [iPadOS] Product label text is clipped in portrait mode on the front page of sephora.com
3654         https://bugs.webkit.org/show_bug.cgi?id=199806
3655         <rdar://problem/52902482>
3656
3657         Reviewed by Zalan Bujtas.
3658
3659         On sephora.com, some product label text is currently boosted by idempotent text autosizing, which causes the
3660         labels be vertically clipped. This patch augments the idempotent text autosizing heuristic to avoid this case by
3661         checking if the element to be boosted has a fixed height or max height, whose value is very close to a small
3662         integer multiple of the line height. In this case, it's likely that the website expects the text to be no more
3663         than a few lines' worth of height, so boosting the text is likely to break the page.
3664
3665         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
3666
3667         * rendering/style/RenderStyle.cpp:
3668         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
3669         * rendering/style/TextSizeAdjustment.cpp:
3670         (WebCore::AutosizeStatus::updateStatus):
3671         * rendering/style/TextSizeAdjustment.h:
3672
3673         Rename Fields::DisplayNone to Fields::AvoidSubtree to avoid introducing another bit in RenderStyle's inherited
3674         flags.
3675
3676 2019-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
3677
3678         New York font erroneously gets synthetic bold
3679         https://bugs.webkit.org/show_bug.cgi?id=199653
3680
3681         Unreviewed watchOS build fix.
3682
3683         * page/ProcessWarming.cpp:
3684         (WebCore::ProcessWarming::prewarmGlobally):
3685         * page/cocoa/MemoryReleaseCocoa.mm:
3686         (WebCore::platformReleaseMemory):
3687         * platform/graphics/FontCascadeDescription.cpp:
3688         * platform/graphics/FontDescription.h:
3689         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3690         (WebCore::invalidateFontCache):
3691         (WebCore::lookupFallbackFont):
3692         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3693         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
3694         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
3695         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
3696         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
3697
3698 2019-07-15  Commit Queue  <commit-queue@webkit.org>
3699
3700         Unreviewed, rolling out r247462.
3701         https://bugs.webkit.org/show_bug.cgi?id=199816
3702
3703         completely messed up the patch (Requested by litherum on
3704         #webkit).
3705
3706         Reverted changeset:
3707
3708         "New York font erroneously gets synthetic bold"
3709         https://bugs.webkit.org/show_bug.cgi?id=199653
3710         https://trac.webkit.org/changeset/247462
3711
3712 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
3713
3714         Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
3715
3716         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3717         (WebCore::fontWithFamilySpecialCase):
3718
3719 2019-07-11  Justin Fan  <justin_fan@apple.com>
3720
3721         Unreviewed build fix.
3722
3723         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.
3724
3725 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
3726
3727         New York font erroneously gets synthetic bold
3728         https://bugs.webkit.org/show_bug.cgi?id=199653
3729         <rdar://problem/51692592>
3730
3731         Reviewed by Simon Fraser.
3732
3733         This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
3734         and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
3735         to expose these fonts to the web because we don't a standardization story for them
3736         yet, but we do want some apps to be able to use them.
3737
3738         WebKit clients who want to use these fonts can set
3739         -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
3740
3741         The patch generalizes our existing system-ui infrastructure to handle these three
3742         additional fonts. It also explicitly disables the unsupported dot-prefixed names
3743         so they don't leak out into Web content.
3744
3745         Tests: fast/text/design-system-ui-10.html
3746                fast/text/design-system-ui-11.html
3747                fast/text/design-system-ui-12.html
3748                fast/text/design-system-ui-13.html
3749                fast/text/design-system-ui-14.html
3750                fast/text/design-system-ui-15.html
3751                fast/text/design-system-ui-16.html
3752                fast/text/design-system-ui-2.html
3753                fast/text/design-system-ui-3.html
3754                fast/text/design-system-ui-4.html
3755                fast/text/design-system-ui-5.html
3756                fast/text/design-system-ui-6.html
3757                fast/text/design-system-ui-7.html
3758                fast/text/design-system-ui-8.html
3759                fast/text/design-system-ui-9.html
3760                fast/text/design-system-ui.html
3761
3762         * css/CSSFontFace.cpp:
3763         (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
3764         * css/CSSFontFace.h:
3765         * css/CSSFontFaceSource.cpp:
3766         (WebCore::CSSFontFaceSource::load):
3767         * css/StyleResolver.cpp:
3768         (WebCore::StyleResolver::initializeFontStyle):
3769         * page/Settings.yaml:
3770         * platform/graphics/FontDescription.cpp:
3771         (WebCore::m_shouldAllowDesignSystemUIFonts):
3772         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
3773         * platform/graphics/FontDescription.h:
3774         (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
3775         (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
3776         (WebCore::FontDescription::operator== const):
3777         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3778         (WebCore::platformFontLookupWithFamily):
3779         (WebCore::fontWithFamily):
3780         * platform/graphics/cocoa/FontCacheCoreText.h:
3781         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3782         (WebCore::systemFontUse):
3783         (WebCore::systemFontCascadeList):
3784         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
3785         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
3786         (WebCore::isSystemFontString): Deleted.
3787         (WebCore::isUIFontTextStyle): Deleted.
3788         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3789         (WebCore::FontPlatformData::ctFont const):
3790         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
3791         (WebCore::SystemFontDatabaseCoreText::createSystemUI):
3792         (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
3793         (WebCore::SystemFontDatabaseCoreText::createTextStyle):
3794         (WebCore::SystemFontDatabaseCoreText::cascadeList):
3795         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
3796         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
3797         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
3798         * platform/graphics/ios/FontCacheIOS.mm:
3799         (WebCore::platformFontWithFamilySpecialCase):
3800         * platform/graphics/mac/FontCacheMac.mm:
3801         (WebCore::platformFontWithFamilySpecialCase):
3802         * style/StyleResolveForDocument.cpp:
3803         (WebCore::Style::resolveForDocument):
3804         * svg/graphics/SVGImage.cpp:
3805         (WebCore::SVGImage::dataChanged):
3806         * testing/InternalSettings.cpp:
3807         (WebCore::InternalSettings::Backup::Backup):
3808         (WebCore::InternalSettings::Backup::restoreTo):
3809         (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
3810         * testing/InternalSettings.h:
3811         * testing/InternalSettings.idl:
3812
3813 2019-07-15  Chris Dumez  <cdumez@apple.com>
3814
3815         Crash under DisplayRefreshMonitorManager::displayWasUpdated()
3816         https://bugs.webkit.org/show_bug.cgi?id=199808
3817         <rdar://problem/53070144>
3818
3819         Reviewed by Geoffrey Garen.
3820
3821         Copy m_monitors before iterating over it because the calling displayLinkFired() on the
3822         monitor may end up calling DisplayRefreshMonitorManager::displayDidRefresh() synchronously,
3823         which removes the monitor from m_monitors.
3824
3825         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3826         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3827
3828 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
3829
3830         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
3831         https://bugs.webkit.org/show_bug.cgi?id=199783
3832
3833         Reviewed by Mark Lam.
3834
3835         Remove WebAssemblyPrototype.
3836
3837         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
3838                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
3839                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
3840                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
3841                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
3842                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
3843                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
3844                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
3845                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
3846                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
3847                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
3848                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
3849                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
3850                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
3851                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
3852                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
3853                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
3854                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
3855                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
3856                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
3857                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
3858                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
3859                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
3860                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
3861                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
3862                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
3863                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
3864                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
3865                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
3866                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
3867                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
3868                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
3869                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
3870                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
3871                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
3872                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
3873                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
3874                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
3875                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
3876                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
3877                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
3878                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
3879                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
3880                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
3881                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
3882                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
3883                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
3884                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
3885
3886         * bindings/js/JSDOMWindowBase.cpp:
3887         (WebCore::JSDOMWindowBase::compileStreaming):
3888         (WebCore::JSDOMWindowBase::instantiateStreaming):
3889
3890 2019-07-15  Dean Jackson  <dino@apple.com>
3891
3892         [WebGL] Remove software rendering and simplify context creation on macOS
3893         https://bugs.webkit.org/show_bug.cgi?id=199789
3894
3895         Reviewed by Sam Weinig.
3896
3897         We don't ever want to fall-back to the software renderer. We'd be better
3898         off failing to create the context completely.
3899
3900         Also, the number of fall-back attempts we were making before hitting
3901         the software renderer was overkill. All hardware we support should
3902         handle a 32bpp buffer.
3903
3904         Lastly, we don't want to support supersampling - multisampling only.
3905
3906         I lied… there is one more thing - failing to create the context
3907         was causing an ASSERT trying to remove the GC3D from the global list.
3908
3909         * html/canvas/WebGLRenderingContextBase.cpp:
3910         (WebCore::WebGLRenderingContextBase::create):
3911         * page/Settings.yaml: Remove forceSoftwareWebGL setting.
3912         * platform/graphics/GraphicsContext3DAttributes.h:
3913         * platform/graphics/GraphicsContext3DManager.cpp:
3914         (WebCore::GraphicsContext3DManager::addContext):
3915         (WebCore::GraphicsContext3DManager::removeContext):
3916         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
3917         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3918         (WebCore::GraphicsContext3D::GraphicsContext3D):
3919         (WebCore::setPixelFormat): Deleted.
3920
3921 2019-07-14  Dean Jackson  <dino@apple.com>
3922
3923         Move more WebGL things into unified builds
3924         https://bugs.webkit.org/show_bug.cgi?id=199787
3925
3926         Reviewed by Wenson Hsieh.
3927
3928         Unify as many WebGL files as possible.
3929
3930         * Sources.txt:
3931         * WebCore.xcodeproj/project.pbxproj:
3932         * html/canvas/WebGLFramebuffer.cpp:
3933         * html/canvas/WebGLObject.h: Move a helper function into an inline.
3934         (WebCore::objectOrZero):
3935         * html/canvas/WebGLRenderingContextBase.cpp:
3936         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3937         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3938
3939 2019-07-15  Keith Rollin  <krollin@apple.com>
3940
3941         Add missing webgpu includes
3942         https://bugs.webkit.org/show_bug.cgi?id=199802
3943         <rdar://problem/53119120>
3944
3945         Reviewed by Myles C. Maxfield.
3946
3947         WHLSLFunctionWriter.cpp fails to compile on tvOS and watchOS due to
3948         missing includes. This file likely compiles on other platforms due to
3949         the Unified Sources facility that clumps several implementation files
3950         together, exposing those implementation files to the others' includes.
3951         It fails on tvOS and watchOS due to the different ways these
3952         implementation files can get clumped together on different platforms.
3953
3954         No new tests as there is no functional change.
3955
3956         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3957
3958 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3959
3960         Unreviewed, rolling out r247440.
3961
3962         Broke builds
3963
3964         Reverted changeset:
3965
3966         "[JSC] Improve wasm wpt test results by fixing miscellaneous
3967         issues"
3968         https://bugs.webkit.org/show_bug.cgi?id=199783
3969         https://trac.webkit.org/changeset/247440
3970