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