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