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