Remove MediaPlayerPrivate::supportsMuting()
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-07-24  Youenn Fablet  <youenn@apple.com>
2
3         Remove MediaPlayerPrivate::supportsMuting()
4         https://bugs.webkit.org/show_bug.cgi?id=200005
5
6         Reviewed by Eric Carlson.
7
8         Remove no longer needed interface method.
9         No change of behavior.
10
11         * WebCore.order:
12         * platform/graphics/MediaPlayer.cpp:
13         (WebCore::MediaPlayer::setVolume):
14         (WebCore::MediaPlayer::setMuted):
15         * platform/graphics/MediaPlayerPrivate.h:
16         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
17         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
18         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
19         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
20         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
21         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
22
23 2019-07-24  Tim Horton  <timothy_horton@apple.com>
24
25         Daring Fireball long press highlights are unnecessarily inflated due to false illegibility
26         https://bugs.webkit.org/show_bug.cgi?id=200064
27
28         Reviewed by Geoff Garen.
29
30         If we consider text illegible on the given estimated background color,
31         we bail from doing a tightly fitted selection-only TextIndicator and
32         instead just paint the page without modification into the indicator,
33         causing ugly overlap and an excessively inflated indicator.
34
35         Change the mechanism we use to determine illegibility to be based on
36         a standard, instead of a constant chosen by hand 13 years ago.
37
38         Test: fast/text-indicator/text-indicator-with-low-contrast-text.html
39
40         * platform/graphics/ColorUtilities.cpp:
41         (WebCore::luminance):
42         Fix a typo.
43
44         (WebCore::contrastRatio):
45         Add a function that computes the contrast ratio given two colors using
46         the formula from WCAG.
47
48         * platform/graphics/ColorUtilities.h:
49         * rendering/TextPaintStyle.cpp:
50         (WebCore::textColorIsLegibleAgainstBackgroundColor):
51         Make use of WCAG's minimum legible contrast ratio instead of an
52         arbitrary color difference cutoff for determining whether we consider
53         text legible. It seems sensible and also considers the text on DF readable
54         (which it seems to be to me!).
55
56         * testing/Internals.cpp:
57         (WebCore::Internals::TextIndicatorInfo::TextIndicatorInfo):
58         * testing/Internals.h:
59         * testing/Internals.idl:
60         Expose all of the text rects to Internals, not just the bounding rect.
61         Expose some more TextIndicator options to Internals so that we can
62         turn on the legibility mechanism.
63
64 2019-07-24  Devin Rousso  <drousso@apple.com>
65
66         Web Inspector: print the target of `console.screenshot` last so the target is the closest item to the image
67         https://bugs.webkit.org/show_bug.cgi?id=199308
68
69         Reviewed by Joseph Pecoraro.
70
71         Right now, evaluating `console.screenshot(document, "test", 1);` will log a message to the
72         console with `#document`, `"test"`, and `1`, all on different lines (togglable by a
73         disclosure triangle) since `#document` isn't stringifiable.
74
75         The ideal situation would be to have `"test"` and `1` logged on the same line, and then have
76         `#document` be in a disclosure triangle. This way, you can "label" your images using
77         additional arguments (e.g. `console.screenshot(document.images[1], "second image");`), as
78         well as provide other data.
79
80         If the only argument was the target, it should print as if it was `console.log(target);`.
81
82         If there are no arguments, it should print the text "Viewport"` before the image.
83
84         Test: inspector/console/console-screenshot.html
85
86         * page/PageConsoleClient.cpp:
87         (WebCore::PageConsoleClient::addMessage):
88         (WebCore::PageConsoleClient::screenshot):
89
90 2019-07-24  Alicia Boya García  <aboya@igalia.com>
91
92         [MSE] Reenqueue after removeCodedFrames()
93         https://bugs.webkit.org/show_bug.cgi?id=199749
94
95         Reviewed by Xabier Rodriguez-Calvar.
96
97         Before this patch, SourceBuffer::removeCodedFrames() did not trigger
98         an immediate reenqueue, but rather just set the `needsReenqueuing`
99         flag, deferring it for the next append... but there may not be another
100         append! In that case, the removed frames would still wrongly play.
101
102         This is the case for instance in tests where a single long media
103         append is done and then "cropped" with SourceBuffer.erase().
104
105         Test: media/media-source/media-source-erase-after-last-append.html
106
107         * Modules/mediasource/SourceBuffer.cpp:
108         (WebCore::SourceBuffer::removeCodedFrames):
109
110 2019-07-24  Jer Noble  <jer.noble@apple.com>
111
112         Add per-document autoplay quirk for netflix.com.
113         https://bugs.webkit.org/show_bug.cgi?id=200058
114
115         Reviewed by Eric Carlson.
116
117         Opt netflix.com into the desktop-style per-document autoplay quirk.
118
119         * page/Quirks.cpp:
120         (WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
121
122 2019-07-24  Alicia Boya García  <aboya@igalia.com>
123
124         [GStreamer] Don't crash with empty video src
125         https://bugs.webkit.org/show_bug.cgi?id=200081
126
127         When a <video> element is set to load empty or about:blank, a player is still
128         created, but no pipeline is loaded. This patch fixes some assertion errors that
129         manifested in that case.
130
131         Reviewed by Philippe Normand.
132
133         Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html
134
135         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
136         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
137         (WebCore::MediaPlayerPrivateGStreamer::platformDuration const):
138         (WebCore::MediaPlayerPrivateGStreamer::paused const):
139
140 2019-07-23  Justin Fan  <justin_fan@apple.com>
141
142         [WebGPU] Implement errors for GPURenderPipeline creation
143         https://bugs.webkit.org/show_bug.cgi?id=200046
144
145         Reviewed by Myles C. Maxfield.
146
147         Replacing error logging in GPURenderPipeline creation with GPUError generation. 
148         Update GPUErrorScopes to re-use an error message prefix for less boiler-plate.
149
150         Test: webgpu/render-pipeline-errors.html
151
152         * Modules/webgpu/WebGPUDevice.cpp:
153         (WebCore::WebGPUDevice::createRenderPipeline const):
154         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
155         (WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
156         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
157         * platform/graphics/gpu/GPUDevice.cpp:
158         (WebCore::GPUDevice::tryCreateRenderPipeline const):
159         * platform/graphics/gpu/GPUDevice.h:
160         * platform/graphics/gpu/GPUErrorScopes.cpp:
161         (WebCore::GPUErrorScopes::generatePrefixedError):
162         * platform/graphics/gpu/GPUErrorScopes.h:
163         (WebCore::GPUErrorScopes::setErrorPrefix):
164         * platform/graphics/gpu/GPURenderPipeline.h:
165         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
166         (WebCore::tryCreateMtlDepthStencilState):
167         (WebCore::trySetVertexInput):
168         (WebCore::trySetColorStates):
169         (WebCore::trySetMetalFunctions):
170         (WebCore::trySetFunctions):
171         (WebCore::convertRenderPipelineDescriptor):
172         (WebCore::tryCreateMtlRenderPipelineState):
173         (WebCore::GPURenderPipeline::tryCreate):
174         (WebCore::GPURenderPipeline::GPURenderPipeline):
175
176 2019-07-23  Konstantin Tokarev  <annulen@yandex.ru>
177
178         ImageDecoderDirect2D::hotSpot() should return WTF::nullopt instead of default constructed value
179         https://bugs.webkit.org/show_bug.cgi?id=200055
180
181         Reviewed by Brent Fulgham.
182
183         * platform/graphics/win/ImageDecoderDirect2D.cpp:
184         (WebCore::ImageDecoderDirect2D::hotSpot const):
185
186 2019-07-23  Tim Horton  <timothy_horton@apple.com>
187
188         Long press hint has half blue shape in Feedly.com
189         https://bugs.webkit.org/show_bug.cgi?id=200053
190         <rdar://problem/53323369>
191
192         Reviewed by Simon Fraser.
193
194         No new tests, because TextIndicator snapshots are not yet testable.
195
196         * rendering/RenderLayer.cpp:
197         (WebCore::RenderLayer::paintForegroundForFragments):
198         Paint ChildBlockBackgrounds when painting selection AND backgrounds;
199         only exclude it when doing a selection-only paint.
200
201 2019-07-23  Chris Fleizach  <cfleizach@apple.com>
202
203         AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
204         https://bugs.webkit.org/show_bug.cgi?id=199988
205
206         Reviewed by Per Arne Vollan.
207
208         Implement the reset state to cancel current speech jobs.
209
210         * Modules/speech/SpeechSynthesis.cpp:
211         (WebCore::SpeechSynthesis::startSpeakingImmediately):
212         (WebCore::SpeechSynthesis::cancel):
213         * platform/PlatformSpeechSynthesizer.h:
214         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
215         (WebCore::PlatformSpeechSynthesizer::resetState):
216         * platform/mac/PlatformSpeechSynthesizerMac.mm:
217         (WebCore::PlatformSpeechSynthesizer::resetState):
218
219 2019-07-23  Zalan Bujtas  <zalan@apple.com>
220
221         [iOS] Tapping the search field on a search results page on zillow.com shows and immediately dismisses the keyboard
222         https://bugs.webkit.org/show_bug.cgi?id=200044
223         <rdar://problem/53103732>
224
225         Reviewed by Wenson Hsieh.
226
227         1. The keyboard gets dismissed as the result of scroll event.
228         2. The (horizontal)scroll event is initiated by WebKit as we try to re-center the content.
229         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).
230
231         It works with shipping version of iOS because _zoomToFocusRect operates on stale viewport information (see r244494 for the progression).
232         This patch applies a site specific quirk to restore shipping behavior.
233
234         * page/Quirks.cpp:
235         (WebCore::Quirks::shouldAvoidScrollingWhenFocusedContentIsVisible const):
236         * page/Quirks.h:
237
238 2019-07-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
239
240         CanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatrix2DInit
241         https://bugs.webkit.org/show_bug.cgi?id=199850
242
243         Reviewed by Simon Fraser.
244
245         The validateAndFixup step of DOMMatrix2DInit sets the matrix attributes 
246         (m** fields) from the aliases attributes (a, b, c, d, e, f) if the former
247         ones do not exist and the later ones exist. See
248         https://www.w3.org/TR/geometry-1/#dommatrixinit-dictionary and
249         DOMMatrixReadOnly::validateAndFixup(DOMMatrix2DInit& init).
250
251         Since CanvasRenderingContext2DBase::setTransform() validates and fixes
252         the input DOMMatrix2DInit, it should rely on matrix attributes.
253
254         Test: fast/canvas/setTransfrom-aliases-transform.html
255
256         * html/canvas/CanvasRenderingContext2DBase.cpp:
257         (WebCore::CanvasRenderingContext2DBase::setTransform):
258
259 2019-07-23  Tim Horton  <timothy_horton@apple.com>
260
261         Long press hint of AirPods buy buttons are tall and narrow during animation
262         https://bugs.webkit.org/show_bug.cgi?id=200036
263         <rdar://problem/53145697>
264
265         Reviewed by Wenson Hsieh.
266
267         New test: fast/text-indicator/text-indicator-with-tiny-child.html
268
269         * dom/Range.cpp:
270         (WebCore::Range::borderAndTextRects const):
271         * dom/Range.h:
272         Add a BoundingRectBehavior that ignores 1x1 and smaller rects.
273
274         * page/TextIndicator.cpp:
275         (WebCore::absoluteBoundingRectForRange):
276         Enable IgnoreTinyRects.
277
278 2019-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
279
280         [macOS 10.15] Web process crashes when attempting to show the font panel via Font > Show Fonts
281         https://bugs.webkit.org/show_bug.cgi?id=200021
282         <rdar://problem/53301325>
283
284         Reviewed by Ryosuke Niwa.
285
286         In macOS 10.15, attempting to access ~/Library/FontCollections/ from the web process causes a Sandbox violation
287         and a subsequent crash. This can be triggered by trying to show the font panel via Font > Show Fonts in the
288         context menu after right clicking.
289
290         In the (near) future, we should fix this by moving logic to show the font panel, color panel and styles panel
291         from the Editor in the web process to the UI process in WebKit2. However, for the time being, we can just work
292         around this by adding a new EditorClient hook to determine whether to allow the font panel to show; this returns
293         true in the legacy macOS WebKit port, and false everywhere else.
294
295         Test: editing/mac/style/do-not-crash-when-showing-font-panel.html
296
297         * editing/mac/EditorMac.mm:
298         (WebCore::Editor::showFontPanel):
299         * loader/EmptyClients.cpp:
300         * page/EditorClient.h:
301
302 2019-07-23  Ryosuke Niwa  <rniwa@webkit.org>
303
304         WebKit should strip away system font names from the pasted content
305         https://bugs.webkit.org/show_bug.cgi?id=199975
306         <rdar://problem/53336353>
307
308         Reviewed by Darin Adler.
309
310         Cocoa HTML Writer sometimes generate system font names such as ".AppleSystemUIFont", ".SFUI-Regular", and ".SF UI Mono".
311         We need to strip away these font names upon paste to avoid these font names falling back to Times New Roman.
312
313         Added the code to strip these font names away in EditingStyle::mergeStyleFromRulesForSerialization, which is used by
314         StylizedMarkupAccumulator to generate HTML during copy. This works because WebContentReader::readWebArchive invokes
315         sanitizeMarkupWithArchive which inserts the pasteboard content into a temporary document then re-serializes back to HTML
316         using StylizedMarkupAccumulator before the actual pasting happens.
317
318         This approach has a few benefits over stripping away these font names in ReplaceSelectionCommand:
319
320         1. It would only affect clients that opts-in to copy & paste sanitization. e.g. it won't affect legacy WebKit clients
321         and those that opt out of pasteboard content sanitization.
322
323         2. It preserves font names such as ".SF Blah" that a website may insert as some kind of house keeping purposes if ever.
324         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
325         only affect cross-site and cross-app pasting, which is rare and less likely to affect real user scenarios.
326
327         3. It avoids exposing bogus .Apple* or .SF* font names to websites that directly use event.clipboardData.getData.
328         Indeed stripping away bogus markup like this is one of the key features / benefit of using copy & paste sanitization.
329
330         Test: editing/pasteboard/paste-cocoa-writer-markup-with-system-fonts.html
331
332         * editing/EditingStyle.cpp:
333         (WebCore::usesForbiddenSystemFontAsOnlyFontFamilyName): Added.
334         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): Added the code to remove font-family property when needed.
335         * platform/graphics/FontCache.h:
336         * platform/graphics/cocoa/FontCacheCoreText.cpp:
337         (WebCore::isSystemFont): Moved.
338         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added.
339         * platform/graphics/freetype/FontCacheFreeType.cpp:
340         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added. Always returns false.
341         * platform/graphics/win/FontCacheWin.cpp:
342         (WebCore::FontCache::isSystemFontForbiddenForEditing): Ditto.
343
344 2019-07-22  Yusuke Suzuki  <ysuzuki@apple.com>
345
346         [bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
347         https://bugs.webkit.org/show_bug.cgi?id=200024
348
349         Reviewed by Saam Barati.
350
351         Changed how we interpret VM tags. Add IsoHeap VM tag support, and rename WebAssembly tag
352         to Gigacage tag.
353
354         * page/ResourceUsageData.h:
355         * page/ResourceUsageOverlay.h:
356         * page/cocoa/ResourceUsageOverlayCocoa.mm:
357         (WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
358         * page/cocoa/ResourceUsageThreadCocoa.mm:
359         (WebCore::displayNameForVMTag):
360         (WebCore::categoryForVMTag):
361
362 2019-07-22  Youenn Fablet  <youenn@apple.com>
363
364         Fix inspector override conversion in InspectorPageAgent::overrideSetting
365         https://bugs.webkit.org/show_bug.cgi?id=200017
366
367         Reviewed by Devin Rousso.
368
369         Covered by inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
370         which should not fail on bots not having cameras
371
372         * inspector/agents/InspectorPageAgent.cpp:
373         (WebCore::toOptionalBool):
374         (WebCore::InspectorPageAgent::overrideSetting):
375         Previously, the conversion for the mock capture value was implicit from a bool pointer to an optional.
376         Make an explicit conversion as done for regular settings.
377
378 2019-07-22  Ross Kirsling  <ross.kirsling@sony.com>
379
380         Unreviewed non-unified build fix.
381
382         * Modules/webdatabase/DatabaseContext.h:
383         * html/HTMLDialogElement.cpp:
384         * html/HTMLScriptElement.cpp:
385         * inspector/agents/InspectorDatabaseAgent.cpp:
386         * workers/service/server/SWServerWorker.cpp:
387         * workers/service/server/SWServerWorker.h:
388         * worklets/WorkletGlobalScope.cpp:
389         * worklets/WorkletGlobalScope.h:
390
391 2019-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
392
393         [iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal the selection
394         https://bugs.webkit.org/show_bug.cgi?id=200013
395         <rdar://problem/52526901>
396
397         Reviewed by Simon Fraser.
398
399         After <https://trac.webkit.org/r244141>, we no longer attempt to scroll to reveal the text selection in
400         UIWebView after changing the selection, due to how we use the legacy document view rect in legacy WebKit when
401         computing the visual viewport. This causes the viewRect in RenderLayer::scrollRectToVisible to be the same size
402         as the content size, which then causes us to always scroll to the origin when revealing the selection.
403
404         To make selection revealing work again in legacy WebKit, conditionally restore the old behavior of using the
405         unobscured content rect as the view rect, only in the case where scrolling is delegated and the platform widget
406         is present.
407
408         Test: WebKitLegacy.ScrollToRevealSelection
409
410         * page/FrameView.cpp:
411         (WebCore::FrameView::viewRectExpandedByContentInsets const):
412         (WebCore::FrameView::visualViewportRectExpandedByContentInsets const): Deleted.
413
414         Additionally rename visualViewportRectExpandedByContentInsets to viewRectExpandedByContentInsets, to reflect the
415         fact that this may either be the visual viewport rect or unobscured content rect.
416
417         * page/FrameView.h:
418         * rendering/RenderLayer.cpp:
419         (WebCore::RenderLayer::scrollRectToVisible):
420
421 2019-07-22  Brent Fulgham  <bfulgham@apple.com>
422
423         Correct web audio-related crash in seed reports
424         https://bugs.webkit.org/show_bug.cgi?id=200009
425         <rdar://problem/51565203>
426
427         Reviewed by Per Arne Vollan.
428
429         Update the 'createMix' method to do proper return value checking so that
430         we can clear the result of MTAudioProcessingTapCreate if the create operation
431         failed.
432
433         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
434         (WebCore::AudioSourceProviderAVFObjC::createMix):
435
436 2019-07-22  Per Arne Vollan  <pvollan@apple.com>
437
438         Prewarmed font does not find any matches
439         https://bugs.webkit.org/show_bug.cgi?id=200007
440
441         Reviewed by Brent Fulgham.
442
443         Prewarming the font name 'SF Pro Text' does not find any matches. The font name ".SF NS Text/Display"
444         should be used instead. Also add 'Lucida Grande' to the list of prewarmed font, since it is used as
445         fallback font in many cases.
446
447         No new tests, covered by existing tests.
448
449         * platform/graphics/cocoa/FontCacheCoreText.cpp:
450         (WebCore::fontFamiliesForPrewarming):
451
452 2019-07-22  Youenn Fablet  <youenn@apple.com>
453
454         Make sure the player underlying volume is correctly set after creating a new player
455         https://bugs.webkit.org/show_bug.cgi?id=199974
456         <rdar://problem/52762559>
457
458         Reviewed by Eric Carlson.
459
460         When creating a player before starting to play, the volume might not be correctly initialized.
461         Fix that by updating the volume like done for rate and muted state.
462         A future refactoring should probably move that code in MediaPlayer.
463
464         Add an internal API to query the volume value from the underlying player.
465
466         Test: http/tests/media/audio-volume-zero.html
467
468         * html/HTMLMediaElement.cpp:
469         (WebCore::HTMLMediaElement::updateVolume):
470         (WebCore::HTMLMediaElement::updatePlayState):
471         (WebCore::HTMLMediaElement::effectiveVolume const):
472         (WebCore::HTMLMediaElement::effectiveMuted const):
473         * html/HTMLMediaElement.h:
474         * testing/Internals.cpp:
475         (WebCore::Internals::privatePlayerVolume):
476         * testing/Internals.h:
477         * testing/Internals.idl:
478         * testing/Internals.mm:
479         (WebCore::Internals::privatePlayerVolume):
480
481 2019-07-22  Devin Rousso  <drousso@apple.com>
482
483         Web Inspector: Page: mark any WebCore::Setting inspector override as UNLIKELY
484         https://bugs.webkit.org/show_bug.cgi?id=199925
485
486         Reviewed by Joseph Pecoraro.
487
488         * Scripts/SettingsTemplates/Settings.cpp.erb:
489
490 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
491
492         Fix crashes in ScrollingStateNode::insertChild()
493         https://bugs.webkit.org/show_bug.cgi?id=200023
494         rdar://problem/53265378
495
496         Reviewed by Darin Adler.
497
498         Crash data suggest that ScrollingStateNode::insertChild() can be passed an index that
499         is larger than the size of the vector, causing crashes.
500
501         Fix defensively by falling back to append() if the passed index is equal to or larger
502         than the size of the children vector.
503
504         * page/scrolling/ScrollingStateNode.cpp:
505         (WebCore::ScrollingStateNode::insertChild):
506
507 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
508
509         Make some constructors explicit
510         https://bugs.webkit.org/show_bug.cgi?id=199981
511
512         Reviewed by Daniel Bates.
513
514         Make explicit public constructors of objects that take POD or String& arguments,
515         to reduce the changes of the compiler doing implicit conversions.
516
517         * Modules/indexeddb/server/IndexValueEntry.h:
518         * Modules/indexeddb/server/IndexValueStore.h:
519         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
520         * Modules/webdatabase/ChangeVersionData.h:
521         (WebCore::ChangeVersionData::ChangeVersionData):
522         * Modules/webdatabase/OriginLock.h:
523         * Modules/websockets/WebSocketExtensionParser.h:
524         (WebCore::WebSocketExtensionParser::WebSocketExtensionParser):
525         * bindings/js/ScriptCachedFrameData.h:
526         * contentextensions/URLFilterParser.cpp:
527         (WebCore::ContentExtensions::PatternParser::PatternParser):
528         * css/parser/CSSTokenizer.h:
529         * css/parser/SizesAttributeParser.h:
530         * dom/SpaceSplitString.cpp:
531         (WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor):
532         * html/FormController.cpp:
533         (WebCore::SavedFormState::appendControlState):
534         (WebCore::SavedFormState::takeControlState):
535         * loader/ProgressTracker.cpp:
536         (WebCore::ProgressItem::ProgressItem):
537         * page/DragController.cpp:
538         (WebCore::DragController::DragController):
539         (WebCore::DragController::performDragOperation):
540         * page/DragController.h:
541         * page/animation/CSSPropertyAnimation.cpp:
542         (WebCore::AnimationPropertyWrapperBase::AnimationPropertyWrapperBase):
543         * page/ios/DOMTimerHoldingTank.h:
544         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
545         * platform/CountedUserActivity.h:
546         (WebCore::CountedUserActivity::CountedUserActivity):
547         * platform/audio/DirectConvolver.h:
548         * platform/audio/DownSampler.h:
549         * platform/audio/DynamicsCompressorKernel.h:
550         * platform/audio/EqualPowerPanner.h:
551         * platform/audio/MultiChannelResampler.h:
552         * platform/audio/ReverbAccumulationBuffer.h:
553         * platform/audio/ReverbInputBuffer.h:
554         * platform/audio/SincResampler.cpp:
555         * platform/audio/UpSampler.h:
556         * platform/audio/ios/AudioFileReaderIOS.h:
557         * platform/audio/mac/AudioFileReaderMac.h:
558         * platform/audio/mac/AudioSessionMac.cpp:
559         (WebCore::AudioSessionPrivate::AudioSessionPrivate):
560         * platform/cf/KeyedDecoderCF.h:
561         * platform/graphics/WidthIterator.cpp:
562         (WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace):
563         * platform/graphics/cocoa/FontCacheCoreText.h:
564         (WebCore::SynthesisPair::SynthesisPair):
565         * platform/graphics/displaylists/DisplayListItems.h:
566         (WebCore::DisplayList::DrawingItem::DrawingItem):
567         * platform/network/cf/ResourceRequest.h:
568         (WebCore::ResourceRequest::ResourceRequest):
569         * platform/text/TextCodecICU.h:
570         * rendering/RenderTableSection.h:
571         (WebCore::CellSpan::CellSpan):
572         * rendering/shapes/RasterShape.cpp:
573         * rendering/shapes/RasterShape.h:
574         (WebCore::RasterShapeIntervals::RasterShapeIntervals):
575         * testing/MockLibWebRTCPeerConnection.h:
576         (WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):
577
578 2019-07-22  Rob Buis  <rbuis@igalia.com>
579
580         Remove some unneeded code in MathOperator
581         https://bugs.webkit.org/show_bug.cgi?id=199935
582
583         Reviewed by Frédéric Wang.
584
585         Remove unused method.
586
587         No new tests, not changing behavior.
588
589         * rendering/mathml/MathOperator.h:
590
591 2019-07-21  Konstantin Tokarev  <annulen@yandex.ru>
592
593         Add DataListButtonElement.cpp to unified sources
594         https://bugs.webkit.org/show_bug.cgi?id=199989
595
596         Reviewed by Michael Catanzaro.
597
598         * Sources.txt:
599         * WebCore.xcodeproj/project.pbxproj:
600
601 2019-07-21  Andres Gonzalez  <andresg_22@apple.com>
602
603         Add accessibilityInsertText for text insertion in edit fields.
604         https://bugs.webkit.org/show_bug.cgi?id=199973
605
606         Reviewed by Chris Fleizach.
607
608         Renamed accessibilityInsertText to _accessibilityInsertText.
609
610         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
611         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
612         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
613         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
614         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
615         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
616
617 2019-07-21  Saam Barati  <sbarati@apple.com>
618
619         [WHLSL] Checker needs to setError() when a property access node can't commit its base type
620         https://bugs.webkit.org/show_bug.cgi?id=199978
621
622         Reviewed by Dean Jackson.
623
624         Test: webgpu/whlsl/null-array-property-access.html
625
626         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
627         (WebCore::WHLSL::Checker::finishVisiting):
628
629 2019-07-21  Saam Barati  <sbarati@apple.com>
630
631         [WHLSL] Return the zero-value enum in the enum-from-integer constructor when the integer is not a valid enum value
632         https://bugs.webkit.org/show_bug.cgi?id=199853
633
634         Reviewed by Dean Jackson.
635
636         Test: webgpu/whlsl/enum-integer-constructor.html
637
638         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
639         (WebCore::WHLSL::Metal::writeNativeFunction):
640
641 2019-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
642
643         [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
644         https://bugs.webkit.org/show_bug.cgi?id=199912
645         <rdar://problem/52182454>
646
647         Reviewed by Simon Fraser.
648
649         This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
650         text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
651         CoreText.
652
653         Test: fast/text/international/system-language/composition.html
654
655         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
656         (WebCore::Font::getCFStringAttributes const):
657
658 2019-07-20  Andres Gonzalez  <andresg_22@apple.com>
659
660         Add accessibilityInsertText for text insertion in edit fields.
661         https://bugs.webkit.org/show_bug.cgi?id=199973
662
663         Reviewed by Chris Fleizach.
664
665         Tests: accessibility/insert-newline.html
666                accessibility/ios-simulator/insert-newline.html
667
668         Accessibility clients like VoiceOver and Voice Control were entering
669         text in text fields by replacing the entire content of the field
670         (SetValue) and then setting the insertion point to the appropriate
671         offset (SetSelectedTextRange). accessibilityInsertText gives a simpler
672         interface to clients to insert text at the insertion point location.
673         In addition, this provides a workaround for the issue encountered with
674         the previous method when inserting a linebreak.
675
676         * accessibility/AccessibilityObject.cpp:
677         (WebCore::AccessibilityObject::insertText):
678         * accessibility/AccessibilityObject.h:
679         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
680         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
681         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
682         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
683
684 2019-07-20  Alexander Mikhaylenko  <exalm7659@gmail.com>
685
686         REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
687         https://bugs.webkit.org/show_bug.cgi?id=199322
688
689         Reviewed by Michael Catanzaro.
690
691         Check ENABLE(KINETIC_SCROLLING) instead of ENABLE(ASYNC_SCROLLING) for kinetic scrolling.
692
693         * platform/PlatformWheelEvent.h:
694         * platform/generic/ScrollAnimatorGeneric.cpp:
695         (WebCore::ScrollAnimatorGeneric::handleWheelEvent):
696         * platform/gtk/PlatformWheelEventGtk.cpp:
697         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
698
699 2019-07-20  Zalan Bujtas  <zalan@apple.com>
700
701         [LFC][TFC] Introduce table formatting context.
702         https://bugs.webkit.org/show_bug.cgi?id=199979
703         <rdar://problem/53346292>
704
705         Reviewed by Antti Koivisto.
706
707         Add the basic class structure for the table formatting context.
708         https://www.w3.org/TR/CSS22/tables.html
709
710         * Sources.txt:
711         * WebCore.xcodeproj/project.pbxproj:
712         * layout/FormattingState.h:
713         (WebCore::Layout::FormattingState::isTableFormattingState const):
714         * layout/tableformatting/TableFormattingContext.cpp: Added.
715         (WebCore::Layout::TableFormattingContext::TableFormattingContext):
716         (WebCore::Layout::TableFormattingContext::layout const):
717         * layout/tableformatting/TableFormattingContext.h: Added.
718         * layout/tableformatting/TableFormattingState.cpp: Added.
719         (WebCore::Layout::TableFormattingState::TableFormattingState):
720         (WebCore::Layout::TableFormattingState::~TableFormattingState):
721         * layout/tableformatting/TableFormattingState.h: Added.
722         * layout/tableformatting/TableInvalidation.cpp: Added.
723         (WebCore::Layout::TableInvalidation::invalidate):
724         * layout/tableformatting/TableInvalidation.h: Added.
725
726 2019-07-20  Zalan Bujtas  <zalan@apple.com>
727
728         [LFC][IFC] Add support for mid-word break.
729         https://bugs.webkit.org/show_bug.cgi?id=199976
730         <rdar://problem/53337349>
731
732         Reviewed by Antti Koivisto.
733
734         Introduce leading and trailing InlineTextItem to support incoming and outgoing partial content.
735         TextUtil::split is a straight copy of SimpleLineLayout::split.
736
737         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
738         (WebCore::Layout::inlineItemWidth):
739         (WebCore::Layout::LineLayout::close):
740         (WebCore::Layout::LineLayout::placeInlineItem):
741         (WebCore::Layout::LineLayout::layout):
742         * layout/inlineformatting/InlineTextItem.cpp:
743         (WebCore::Layout::InlineTextItem::split const):
744         (WebCore::Layout::InlineTextItem::split): Deleted.
745         * layout/inlineformatting/InlineTextItem.h:
746         (WebCore::Layout::InlineTextItem::inlineBox const):
747         * layout/inlineformatting/text/TextUtil.cpp:
748         (WebCore::Layout::TextUtil::split):
749         * layout/inlineformatting/text/TextUtil.h:
750
751 2019-07-20  Zalan Bujtas  <zalan@apple.com>
752
753         [Text autosizing] Do not nuke the style on dynamicViewportSizeUpdate
754         https://bugs.webkit.org/show_bug.cgi?id=199718
755         <rdar://problem/53344961>
756
757         Reviewed by Simon Fraser.
758
759         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.
760         Currently we call setNeedsRecalcStyleInAllFrames() to accomplish it. Unfortunatelly setNeedsRecalcStyleInAllFrames destroys all the style information which means that the
761         subsequent styleResolve() needs to start from scratch.
762         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
763         on a timer so that rapid dynamicViewportSizeUpdate() calls won't trigger redundant layouts.
764
765         * css/StyleResolver.cpp:
766         (WebCore::hasTextChild):
767         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
768         (WebCore::hasTextChildren): Deleted.
769         * css/StyleResolver.h:
770         * page/FrameView.h:
771         * page/Page.cpp:
772         (WebCore::Page::invalidateTextAutoSizeInAllFrames):
773         * page/Page.h:
774
775 2019-07-20  Saam Barati  <sbarati@apple.com>
776
777         [WHLSL] Make enums work
778         https://bugs.webkit.org/show_bug.cgi?id=199634
779
780         Reviewed by Robin Morisset.
781
782         This patch makes enums work. There were a couple changes needed to do this work:
783         1. In the metal codegen, we were emitting code like "EnumType.EnumValue"
784         instead of "EnumType::EnumValue".
785         
786         2. Inside the enumeration declaration AST node, we track enums in a HashMap
787         because we need to look up names of enum values in that map in parts of the
788         compiler. However, HashMap is not ordered but we were relying on the iteration
789         order of it to generate the default values of enums. E.g, in: "enum { Foo = 10, Bar }",
790         Bar should be 11. However, there was no guarantee that we iterated over Bar
791         after Foo. Instead, we just track the default values as we parse an enum
792         inside of the parser. This allows us to continue to keep using HashMap without
793         also adding an auxiliary data structure (or using more memory in some way) to
794         track the order of the enum elements.
795         
796         I've also filed a patch to do follow-up work on implementing the correct
797         operational behavior when constructing an enum from its underlying type when
798         the underlying value does not match any enum value:
799         https://bugs.webkit.org/show_bug.cgi?id=199853
800
801         Tests: webgpu/whlsl/enums-2.html
802                webgpu/whlsl/enums.html
803
804         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
805         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
806         (WebCore::WHLSL::AST::EnumerationMember::value):
807         (WebCore::WHLSL::AST::EnumerationMember::setValue): Deleted.
808         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
809         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
810         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
811         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
812         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
813         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
814         (WebCore::WHLSL::ASTDumper::visit):
815         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
816         (WebCore::WHLSL::Checker::visit):
817         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
818         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
819         (WebCore::WHLSL::Parser::parseEnumerationMember):
820         * Modules/webgpu/WHLSL/WHLSLParser.h:
821         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
822         (WebCore::WHLSL::Visitor::visit):
823
824 2019-07-19  Youenn Fablet  <youenn@apple.com>
825
826         Remote WebInspector should enable mock capture devices in UIProcess if doing it in WebProcess
827         https://bugs.webkit.org/show_bug.cgi?id=199924
828         <rdar://problem/50552067>
829
830         Reviewed by Devin Rousso.
831
832         Add necessary API to set mock capture devices override.
833         In case of desynchronization between webprocess and uiprocess, make sure to return early
834         and fail capture instead of crashing.
835
836         * inspector/InspectorClient.h:
837         (WebCore::InspectorClient::setMockCaptureDevicesEnabled):
838         * inspector/agents/InspectorPageAgent.cpp:
839         (WebCore::InspectorPageAgent::disable):
840         (WebCore::InspectorPageAgent::overrideSetting):
841         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
842
843 2019-07-19  Andy Estes  <aestes@apple.com>
844
845         [Apple Pay] Log less in PaymentCoordinator::shouldEnableApplePayAPIs()
846         https://bugs.webkit.org/show_bug.cgi?id=199958
847
848         Reviewed by Tim Horton.
849
850         Only log when APIs are disabled due to user scripts.
851
852         * Modules/applepay/PaymentCoordinator.cpp:
853         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
854
855 2019-07-19  Dean Jackson  <dino@apple.com>
856
857         Add a menu item to toggle between showing and hiding link previews
858         https://bugs.webkit.org/show_bug.cgi?id=199940
859         <rdar://problem/53032288>
860
861         Reviewed by Beth Dakin.
862
863         New strings for Show/Hide Link Previews.
864
865         * en.lproj/Localizable.strings:
866
867 2019-07-19  Antoine Quint  <graouts@apple.com>
868
869         Links stop working after long-pressing a link (WK1)
870         https://bugs.webkit.org/show_bug.cgi?id=199952
871         <rdar://problem/52291860>
872
873         Reviewed by Wenson Hsieh.
874
875         Test: fast/events/touch/ios/click-after-long-press.html
876
877         When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
878         WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
879         process the next tap after a drag interaction.
880
881         * page/ios/EventHandlerIOS.mm:
882         (WebCore::EventHandler::tryToBeginDragAtPoint):
883
884 2019-07-19  Sihui Liu  <sihui_liu@apple.com>
885
886         IndexedDB: error in starting version change transaction may be neglected
887         https://bugs.webkit.org/show_bug.cgi?id=199818
888         <rdar://problem/52925738>
889
890         Reviewed by Brady Eidson.
891
892         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
893         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
894         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
895         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
896         m_databaseInfo could become nullptr.
897
898         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
899         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
900         ungradeneeded event is dispatched to the IDBRequest.
901
902         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
903         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
904         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
905         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
906         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
907         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
908         * Modules/indexeddb/server/UniqueIDBDatabase.h:
909
910 2019-07-19  Zalan Bujtas  <zalan@apple.com>
911
912         [LFC][IFC] Add partial content handling
913         https://bugs.webkit.org/show_bug.cgi?id=199930
914
915         Reviewed by Antti Koivisto.
916
917         Move the actual inline item placement to a dedicated functions. This enables us to
918         construct a dedicated InlineItem for the partial content and pass it in to this function.
919
920         <span>The quick brown fox jumps over the lazy dog</span> <- inline content
921         [The][ ][quick][ ][brown][ ][fox][ ][jumps][ ][over][ ][the][ ][lazy][ ][dog] <- InlineItems
922
923         Line breaking:
924         [The][ ][qu]
925         [ick] <- Partial InlineItem (position: 6 length: 3) from [quick] (position: 4 length: 5)
926
927         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
928         (WebCore::Layout::LineLayout::close):
929         (WebCore::Layout::LineLayout::placeInlineItem):
930         (WebCore::Layout::LineLayout::layout):
931         (WebCore::Layout::LineInput::LineInput):
932         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
933         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
934         * layout/inlineformatting/InlineTextItem.cpp:
935         (WebCore::Layout::InlineTextItem::split):
936         * layout/inlineformatting/InlineTextItem.h:
937
938 2019-07-19  Charlie Turner  <cturner@igalia.com>
939
940         [GStreamer] Flush get_range calls during PAUSED->READY in WebKitWebSource
941         https://bugs.webkit.org/show_bug.cgi?id=199934
942
943         Reviewed by Xabier Rodriguez-Calvar.
944
945         Unit testing not applicable.
946
947         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
948         (webKitWebSrcChangeState): A well-behaved element should unblock streaming threads
949         during a PAUSED->READY transition, so do that here.
950
951 2019-07-19  Rob Buis  <rbuis@igalia.com>
952
953         Remove some unneeded code in MathOperator
954         https://bugs.webkit.org/show_bug.cgi?id=199935
955
956         Reviewed by Frédéric Wang.
957
958         The initialize method is unneeded since the member
959         variables all use default initialization.
960
961         No new tests, not changing behavior.
962
963         * rendering/mathml/MathOperator.cpp:
964         (WebCore::MathOperator::MathOperator):
965         (WebCore::MathOperator::GlyphAssemblyData::initialize): Deleted.
966
967 2019-07-18  Antoine Quint  <graouts@apple.com>
968
969         Enable simulated mouse events quirk for soundcloud.com
970         https://bugs.webkit.org/show_bug.cgi?id=199908
971         <rdar://problem/52915981>
972
973         Reviewed by Brent Fulgham.
974
975         Scrubbing on soundcloud.com relies on mouse events alone when displaying on iPad with the desktop UA string.
976         Opting into the simulated mouse events quirk makes scrubbing work and we also ensure that page scrolling is
977         disabled as a result of scrubbing by returning true in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented().
978
979         Also making a drive-by fix in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented() to use a reference
980         instead of a pointer when downcasting a null-checked pointer.
981
982         * page/Quirks.cpp:
983         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
984         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
985
986 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
987
988         Prewarm font cache with more fonts
989         https://bugs.webkit.org/show_bug.cgi?id=199283
990
991         Reviewed by Myles C. Maxfield.
992
993         Initialize the list of families requiring system fallback in the prewarming information struct, since
994         this was part of the original, approved patch, and is needed for the performance improvement.
995
996         No new tests, covered by existing tests.
997
998         * platform/graphics/cocoa/FontCacheCoreText.cpp:
999         (WebCore::fontFamiliesForPrewarming):
1000         (WebCore::FontCache::prewarmGlobally):
1001
1002 2019-07-18  Ryan Haddad  <ryanhaddad@apple.com>
1003
1004         Unreviewed, rolling out r247531.
1005
1006         Caused multiple IndexedDB layout test crashes.
1007
1008         Reverted changeset:
1009
1010         "IndexedDB: error in starting version change transaction may
1011         be neglected"
1012         https://bugs.webkit.org/show_bug.cgi?id=199818
1013         https://trac.webkit.org/changeset/247531
1014
1015 2019-07-18  Antoine Quint  <graouts@apple.com>
1016
1017         Ensure Quirks::shouldDispatchSimulatedMouseEvents() works for all Google Maps and Amazon domains
1018         https://bugs.webkit.org/show_bug.cgi?id=199904
1019         <rdar://problem/53250104>
1020
1021         Reviewed by Dean Jackson.
1022
1023         Use topPrivatelyControlledDomain() to determine whether the URL is a Google or Amazon domain so as to apply
1024         Google Maps and Amazon quirks to all the various domain names used.
1025
1026         * page/Quirks.cpp:
1027         (WebCore::Quirks::isAmazon const):
1028         (WebCore::Quirks::isGoogleMaps const):
1029         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1030         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
1031         * page/Quirks.h:
1032
1033 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
1034
1035         Crash under WebPage::boundaryEventOccurred
1036         https://bugs.webkit.org/show_bug.cgi?id=199907
1037
1038         Reviewed by Chris Fleizach.
1039
1040         Add null pointer checks.
1041
1042         No new tests, since I have not been able to reproduce this in a test.
1043
1044         * Modules/speech/SpeechSynthesis.cpp:
1045         (WebCore::SpeechSynthesis::didStartSpeaking):
1046         (WebCore::SpeechSynthesis::didFinishSpeaking):
1047         (WebCore::SpeechSynthesis::didPauseSpeaking):
1048         (WebCore::SpeechSynthesis::didResumeSpeaking):
1049         (WebCore::SpeechSynthesis::speakingErrorOccurred):
1050         (WebCore::SpeechSynthesis::boundaryEventOccurred):
1051
1052 2019-07-18  Antoine Quint  <graouts@apple.com>
1053
1054         [Pointer Events] The button and buttons properties are incorrect on iOS
1055         https://bugs.webkit.org/show_bug.cgi?id=199910
1056         <rdar://problem/52778374>
1057
1058         Reviewed by Dean Jackson.
1059
1060         The button and buttons properties were always set to 0 on iOS. We now use the correct values such that
1061         button is always 0 except for "pointermove" where it's -1, and "buttons" is 1 as long as the pointer is
1062         in contact with the touch surface.
1063
1064         Tests: pointerevents/ios/pointer-event-button-and-buttons-pointer-cancel.html
1065                pointerevents/ios/pointer-event-button-and-buttons.html
1066
1067         * dom/ios/PointerEventIOS.cpp:
1068         (WebCore::buttonForType):
1069         (WebCore::buttonsForType):
1070         (WebCore::PointerEvent::PointerEvent):
1071
1072 2019-07-18  Antoine Quint  <graouts@apple.com>
1073
1074         REGRESSION: Unable to enable simulated mouse events using the runtime flag
1075         https://bugs.webkit.org/show_bug.cgi?id=199909
1076         <rdar://problem/53254895>
1077
1078         Reviewed by Dean Jackson.
1079
1080         The fix for wkb.ug/199508 (r247152) broke the ability enable simulated mouse events using the runtime flag.
1081         We now add a check for the flag in Quirks::shouldDispatchSimulatedMouseEvents() so that the runtime flag
1082         overrides the content of that function. This is more practical and allows for a quick override using the flag.
1083
1084         Additionally, we need only call shouldDispatchSimulatedMouseEvents() in simulatedMouseEventTypeForTarget() since
1085         that function already calls needsQuirks().
1086
1087         * dom/EventNames.h:
1088         (WebCore::EventNames::isTouchRelatedEventType const):
1089         * dom/Node.cpp:
1090         (WebCore::Node::moveNodeToNewDocument):
1091         * page/Quirks.cpp:
1092         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1093         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
1094
1095 2019-07-18  Antoine Quint  <graouts@apple.com>
1096
1097         REGRESSION: Panning on an Amazon product image scrolls the page on iPadOS
1098         https://bugs.webkit.org/show_bug.cgi?id=199905
1099         <rdar://problem/49124529>
1100
1101         Reviewed by Dean Jackson.
1102
1103         Amazon product pages include images that the user can touch and pan to show zoomed details in a side image. This
1104         currently works on iPadOS thanks to the dispatch of simulated "mousemove" events on the product image, but the site
1105         doesn't call preventDefault() when handling those events as it wasn't necessary for macOS.
1106
1107         We add a new quirk that will indicate that a given element is such a product image.
1108
1109         * page/Quirks.cpp:
1110         (WebCore::Quirks::isAmazon const):
1111         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1112         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
1113         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
1114         * page/Quirks.h:
1115
1116 2019-07-18  Youenn Fablet  <youenn@apple.com>
1117
1118         Make sure to set kCTFontFallbackOptionAttribute to kCTFontFallbackOptionSystem for system fonts
1119         https://bugs.webkit.org/show_bug.cgi?id=199769
1120         <rdar://problem/49390297>
1121
1122         Reviewed by Myles C. Maxfield.
1123
1124         When getting a system font, set the appropriate attribute so that it
1125         does not fallback to a user initiated font.
1126         Add an ASSERT that checks that the font in use is not a user font if
1127         policy is to not use user installed fonts.
1128
1129         Tests: fast/text/user-installed-fonts/extended-character-with-user-font.html
1130                fast/text/user-installed-fonts/extended-character.html
1131
1132         * platform/graphics/Font.h:
1133         * platform/graphics/FontCascadeFonts.cpp:
1134         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
1135         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1136         (WebCore::preparePlatformFont):
1137         (WebCore::FontDatabase::singletonAllowingUserInstalledFonts):
1138         (WebCore::FontDatabase::singletonDisallowingUserInstalledFonts):
1139         (WebCore::addAttributesForInstalledFonts):
1140         (WebCore::addAttributesForWebFonts):
1141         (WebCore::installedFontMandatoryAttributes):
1142         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1143         (WebCore::Font::isUserInstalledFont const):
1144
1145 2019-07-18  Zalan Bujtas  <zalan@apple.com>
1146
1147         [LFC][IFC] InlineFormattingContext::LineLayout::placeInlineItems is getting too complex.
1148         https://bugs.webkit.org/show_bug.cgi?id=199898
1149         <rdar://problem/53235958>
1150
1151         Reviewed by Antti Koivisto.
1152
1153         It's time to restructure LineLayout::placeInlineItems to be able to expand it further.
1154         Introduce the LineLayout class. This class is responsible to place the inline items on the current line.
1155         (Rename InlineFormattingContext::lineLayout -> InlineFormattingContext::InlineLayout and
1156         use Line::InitialConstraints in LineInput)
1157
1158         * layout/inlineformatting/InlineFormattingContext.cpp:
1159         (WebCore::Layout::InlineFormattingContext::layout const):
1160         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
1161         * layout/inlineformatting/InlineFormattingContext.h:
1162         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const): Deleted.
1163         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1164         (WebCore::Layout::inlineItemWidth):
1165         (WebCore::Layout::LineLayout::layoutState const):
1166         (WebCore::Layout::LineLayout::UncommittedContent::runs):
1167         (WebCore::Layout::LineLayout::UncommittedContent::isEmpty const):
1168         (WebCore::Layout::LineLayout::UncommittedContent::size const):
1169         (WebCore::Layout::LineLayout::UncommittedContent::width const):
1170         (WebCore::Layout::LineLayout::UncommittedContent::add):
1171         (WebCore::Layout::LineLayout::UncommittedContent::reset):
1172         (WebCore::Layout::LineLayout::LineLayout):
1173         (WebCore::Layout::LineLayout::commitPendingContent):
1174         (WebCore::Layout::LineLayout::close):
1175         (WebCore::Layout::LineLayout::layout):
1176         (WebCore::Layout::LineInput::LineInput):
1177         (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
1178         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
1179         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1180         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
1181         (WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
1182         (WebCore::Layout::UncommittedContent::runs): Deleted.
1183         (WebCore::Layout::UncommittedContent::isEmpty const): Deleted.
1184         (WebCore::Layout::UncommittedContent::size const): Deleted.
1185         (WebCore::Layout::UncommittedContent::width const): Deleted.
1186         (WebCore::Layout::UncommittedContent::add): Deleted.
1187         (WebCore::Layout::UncommittedContent::reset): Deleted.
1188         (WebCore::Layout::LineInput::HorizontalConstraint::HorizontalConstraint): Deleted.
1189         (WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout): Deleted.
1190         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): Deleted.
1191         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): Deleted.
1192         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const): Deleted.
1193         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const): Deleted.
1194         (WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const): Deleted.
1195         * layout/inlineformatting/InlineLine.cpp:
1196         (WebCore::Layout::Line::Line):
1197         * layout/inlineformatting/InlineLine.h:
1198
1199 2019-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1200
1201         [GTK] MOUSE_CURSOR_SCALE is not implemented
1202         https://bugs.webkit.org/show_bug.cgi?id=109469
1203
1204         Reviewed by Darin Adler.
1205
1206         Use gdk_cursor_new_from_surface() instead of gdk_cursor_new_from_pixbuf() to avoid the surface to pixbuf
1207         conversion.
1208
1209         * platform/gtk/CursorGtk.cpp:
1210         (WebCore::createCustomCursor):
1211
1212 2019-07-17  Chris Dumez  <cdumez@apple.com>
1213
1214         Prewarm local storage in the NetworkProcess to reduce WebContent process hangs
1215         https://bugs.webkit.org/show_bug.cgi?id=199879
1216         <rdar://problem/53217757>
1217
1218         Reviewed by Ryosuke Niwa.
1219
1220         When JS accesses window.localStorage for the first time, we end up doing a
1221         synchronous IPC to the network process to pull in all items in the local
1222         storage for the origin. If the network process does not have this data in
1223         memory, it has to read it from a database on disk, which may take a significant
1224         amount of time and hang the WebContent process during this time.
1225
1226         To alleviate this problem, this patch introduces prewarming on the local storage
1227         in the network process when loading a given origin in the WebContent process.
1228         This way, in most cases, when the JS accesses window.localStorage for the first
1229         time, the synchronous IPC to the network process returns much faster (measured
1230         50-100ms for a very large database, down from 250-300ms), as it only needs to
1231         IPC the data over, without the need to fetch it from disk.
1232
1233         As a safety net to avoid excessive prewarming, we currently prewarm at most 5
1234         security origins per page load.
1235
1236         * loader/DocumentLoader.cpp:
1237         (WebCore::DocumentLoader::commitData):
1238         * page/DOMWindow.cpp:
1239         (WebCore::DOMWindow::prewarmLocalStorageIfNecessary):
1240         * page/DOMWindow.h:
1241         * page/Frame.cpp:
1242         (WebCore::Frame::didPrewarmLocalStorage):
1243         (WebCore::Frame::mayPrewarmLocalStorage const):
1244         * page/Frame.h:
1245         * storage/Storage.cpp:
1246         (WebCore::Storage::prewarm):
1247         * storage/Storage.h:
1248         * storage/StorageArea.h:
1249         (WebCore::StorageArea::prewarm):
1250
1251 2019-07-17  Robin Morisset  <rmorisset@apple.com>
1252
1253         [WHLSL] The lexer should not choke on a single '/'
1254         https://bugs.webkit.org/show_bug.cgi?id=199886
1255
1256         Reviewed by Myles Maxfield.
1257
1258         The bug is trivial: just recognize that a single '/' without a '*' or '/' afterwards is not the beginning of a comment.
1259
1260         While investigating this bug, I also found that part of the parser fails to properly propagate errors, so I fixed it.
1261
1262         New test in LayoutTests/webgpu/whlsl/float-math.html
1263         I also added a new flag to WHLSLPrepare.cpp. It can be used to parse the full standard library (this is how I found this bug in the first place).
1264
1265         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1266         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
1267         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1268         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
1269         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1270         (WebCore::WHLSL::prepareShared):
1271         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
1272         (WebCore::WHLSL::includeStandardLibrary):
1273         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h:
1274
1275 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
1276
1277         Unreviewed build fix after r247549.
1278
1279         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
1280
1281 2019-07-17  Robin Morisset  <rmorisset@apple.com>
1282
1283         [WHLSL] Remove traps from the compiler
1284         https://bugs.webkit.org/show_bug.cgi?id=195811
1285         <rdar://problem/50746299>
1286
1287         Reviewed by Myles Maxfield.
1288
1289         Remove the Trap statement from the language, see https://github.com/gpuweb/WHLSL/issues/301.
1290
1291         No new tests, as this part of the language was already untested, and we are removing it, not adding anything.
1292
1293         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
1294         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
1295         (WebCore::WHLSL::AST::Statement::isSwitchStatement const):
1296         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Removed.
1297         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1298         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
1299         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
1300         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1301         (WebCore::WHLSL::Token::typeName):
1302         (WebCore::WHLSL::Lexer::recognizeKeyword):
1303         * Modules/webgpu/WHLSL/WHLSLLexer.h:
1304         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1305         (WebCore::WHLSL::Parser::parseStatement):
1306         * Modules/webgpu/WHLSL/WHLSLParser.h:
1307         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
1308         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1309         (WebCore::WHLSL::Visitor::visit):
1310         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
1311         * WebCore.xcodeproj/project.pbxproj:
1312
1313 2019-07-17  Robin Morisset  <rmorisset@apple.com>
1314
1315         [WHLSL] checkRecursiveType should not have exponential complexity.
1316         https://bugs.webkit.org/show_bug.cgi?id=199835
1317
1318         Reviewed by Myles Maxfield.
1319
1320         The change is very similar to that in https://bugs.webkit.org/show_bug.cgi?id=199688.
1321         Just keep track of which types have already been visited, and don't visit them again.
1322
1323         No new tests as there is no intended functional change.
1324
1325         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
1326         (WebCore::WHLSL::RecursiveTypeChecker::visit):
1327         (WebCore::WHLSL::checkRecursiveTypes):
1328
1329 2019-07-17  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1330
1331         Add missing #include's
1332         https://bugs.webkit.org/show_bug.cgi?id=199856
1333
1334         Reviewed by Simon Fraser.
1335
1336         The missing headers were found during development when unified sources changed.
1337
1338         No new tests required. Adding #include's only.
1339
1340         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
1341         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
1342         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
1343         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1344         * Modules/webgpu/WebGPUCommandEncoder.cpp:
1345
1346 2019-07-17  Ryosuke Niwa  <rniwa@webkit.org>
1347
1348         Add inputmode to the feature status page
1349         https://bugs.webkit.org/show_bug.cgi?id=199884
1350
1351         Reviewed by Wenson Hsieh.
1352
1353         Added as supported.
1354
1355         * features.json:
1356
1357 2019-07-17  Antoine Quint  <graouts@apple.com>
1358
1359         Disable Pointer Events prior to watchOS 6
1360         https://bugs.webkit.org/show_bug.cgi?id=199890
1361         <rdar://problem/53206113>
1362
1363         Reviewed by Dean Jackson.
1364
1365         * Configurations/FeatureDefines.xcconfig:
1366
1367 2019-07-17  Antoine Quint  <graouts@apple.com>
1368
1369         Unable to bring up custom media controls on iOS for video.sina.cn
1370         https://bugs.webkit.org/show_bug.cgi?id=199889
1371         <rdar://problem/51883919>
1372
1373         Reviewed by Dean Jackson.
1374
1375         Videos on video.sina.cn by default have the "controls" attribute and are set not to autoplay. This means that the original state
1376         of the media controls are set to show the built-in media controls and also show the prominent play button to begin playback. The
1377         display of the play button also requires a tap gesture recognizer, which calls preventDefault() when the "touchend" is received
1378         to prevent double-tap-to-zoom, but also has the side-effect of preventing a "click" event from being dispatched for a tap.
1379
1380         The video.sina.cn code would eventually remove the "controls" attribute, which would make the built-in media controls not visible,
1381         but still participate in hit-testing because we keep the shadow DOM around in order to potentially show the Airplay or picture-in-picture
1382         placards. Additionally, we wouldn't disable the tap gesture recognizer when the "controls" attribute was removed.
1383
1384         We now ensure that both gesture recognizers used by iOS inline media controls are only enabled when media controls are visible.
1385
1386         Test: media/modern-media-controls/media-controller/ios/media-controller-allows-click-over-video-with-no-controls.html
1387
1388         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
1389         (IOSInlineMediaControls.prototype.set showsStartButton):
1390         (IOSInlineMediaControls.prototype.get visible):
1391         (IOSInlineMediaControls.prototype.set visible):
1392         (IOSInlineMediaControls.prototype._updateGestureRecognizers):
1393         (IOSInlineMediaControls.prototype._tapGestureRecognizerStateDidChange):
1394         (IOSInlineMediaControls.prototype._pinchGestureRecognizerStateDidChange):
1395
1396 2019-07-17  Christopher Reid  <chris.reid@sony.com>
1397
1398         Bytecode cache should use FileSystem
1399         https://bugs.webkit.org/show_bug.cgi?id=199759
1400
1401         Reviewed by Yusuke Suzuki.
1402
1403         * platform/SharedBuffer.cpp:
1404
1405 2019-07-17  Zalan Bujtas  <zalan@apple.com>
1406
1407         Unable to tap buttons at top of Wells Fargo app’s Payees screen
1408         https://bugs.webkit.org/show_bug.cgi?id=199846
1409         <rdar://problem/48112220>
1410
1411         Reviewed by Simon Fraser.
1412
1413         This patch restores the stop-before-reaching-the-body heuristics for the approximate node finding feature only.
1414         (WebFrame::approximateNodeAtViewportLocation mistakenly relied on this odd quirk of nodeRespondingToClickEvents.)
1415
1416         * page/Frame.h:
1417         * page/ios/FrameIOS.mm:
1418         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
1419
1420 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
1421
1422         [iOS WK2] Avoid lots of compositing backing store for offscreen position:fixed descendants
1423         https://bugs.webkit.org/show_bug.cgi?id=199819
1424         rdar://problem/51977416
1425
1426         Reviewed by Zalan Bujtas.
1427
1428         There was code to ensure that position:fixed layers and their descendants don't have their
1429         backing store detached (thrown away to save memory when offscreen), since that can trigger
1430         flashing when async scrolling moves layers in and out of the visual viewport.
1431
1432         However, some pages have many descendant layers of positon:fixed which entrain backing
1433         store, because, for example, they have a stack of translated-offscreen menu elements inside
1434         a fixed header, and those elements may composite because of overflow:scroll.
1435
1436         To avoid using too much memory on such pages, allow backing store detachment for fixed
1437         layers that are outside the layout viewport. Add a flag to RenderLayer that's set for layers
1438         which are fixed, or descendants of fixed, and consult that flag in
1439         updateAllowsBackingStoreDetaching(). The logic there is similar to
1440         RenderLayerCompositor::requiresCompositingForPosition().
1441         
1442         I considered allowing all position:fixed to composite (since this patch would keep most of
1443         the memory saving), but historically we've avoided compositing out-of-viewport
1444         position:fixed because it's quite common to have them with negative z-index, and compositing
1445         those has significant compositing knock-on effects.
1446         
1447         GraphicsLayer flushing no longer needs to track the viewport-constrained status of layers,
1448         so remove that code.
1449         
1450         This patch removes backing-store pinning for sticky layers.
1451         scrolling/ios/reconcile-layer-position-recursive.html then revealed a bug in
1452         ScrollingStateStickyNode::reconcileLayerPositionForViewportRect(), which was assuming that
1453         the sticky element was scrolled by the page, causing a bad layer position to get sync'd onto
1454         the layer. Fixed by copying code from ScrollingTreeStickyNode that is smarter about
1455         computing layer positions.
1456         
1457         This patch fixes jetsams on kmart.com.au in iOS 13 beta.
1458
1459         Test: compositing/layer-creation/fixed-position-descendants-out-of-view.html
1460
1461         * page/scrolling/ScrollingStateStickyNode.cpp:
1462         (WebCore::ScrollingStateStickyNode::computeLayerPosition const):
1463         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
1464         * page/scrolling/ScrollingStateStickyNode.h:
1465         * platform/graphics/GraphicsLayer.h:
1466         (WebCore::GraphicsLayer::setAllowsBackingStoreDetaching):
1467         (WebCore::GraphicsLayer::allowsBackingStoreDetaching const):
1468         (WebCore::GraphicsLayer::setIsViewportConstrained): Deleted.
1469         (WebCore::GraphicsLayer::isViewportConstrained const): Deleted.
1470         (WebCore::GraphicsLayer::setCanDetachBackingStore): Deleted.
1471         (WebCore::GraphicsLayer::canDetachBackingStore const): Deleted.
1472         * platform/graphics/ca/GraphicsLayerCA.cpp:
1473         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1474         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
1475         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1476         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1477         (WebCore::GraphicsLayerCA::updateCoverage):
1478         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1479         * platform/graphics/ca/GraphicsLayerCA.h:
1480         * rendering/RenderLayer.cpp:
1481         (WebCore::RenderLayer::RenderLayer):
1482         (WebCore::RenderLayer::updateLayerPositions):
1483         (WebCore::outputPaintOrderTreeLegend):
1484         (WebCore::outputPaintOrderTreeRecursive):
1485         * rendering/RenderLayer.h:
1486         * rendering/RenderLayerBacking.cpp:
1487         (WebCore::RenderLayerBacking::updateAllowsBackingStoreDetaching):
1488         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
1489         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole): Deleted.
1490         * rendering/RenderLayerBacking.h:
1491         * rendering/RenderLayerCompositor.cpp:
1492         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1493         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
1494         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1495         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
1496
1497 2019-07-17  Chris Dumez  <cdumez@apple.com>
1498
1499         Avoid unnecessary copy of monitors under DisplayRefreshMonitorManager::displayWasUpdated()
1500         https://bugs.webkit.org/show_bug.cgi?id=199847
1501
1502         Reviewed by Said Abou-Hallawa.
1503
1504         There is always one one monitor in m_monitors for a given displayID so there is
1505         no need to copy the monitors inside DisplayRefreshMonitorManager::displayWasUpdated()
1506         and no need to iterate over all of them. This patch also factors a bit differently
1507         so that it becomes more obvious.
1508
1509         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1510         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
1511         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
1512         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
1513         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
1514         (WebCore::DisplayRefreshMonitorManager::findMonitorForDisplay const):
1515         (WebCore::DisplayRefreshMonitorManager::monitorForDisplay const):
1516         * platform/graphics/DisplayRefreshMonitorManager.h:
1517
1518 2019-07-17  Sihui Liu  <sihui_liu@apple.com>
1519
1520         IndexedDB: error in starting version change transaction may be neglected
1521         https://bugs.webkit.org/show_bug.cgi?id=199818
1522         <rdar://problem/52925738>
1523
1524         Reviewed by Brady Eidson.
1525
1526         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
1527         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
1528         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
1529         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
1530         m_databaseInfo could become nullptr.
1531
1532         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
1533         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
1534         ungradeneeded event is dispatched to the IDBRequest.
1535
1536         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1537         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
1538         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
1539         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
1540         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
1541         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1542
1543 2019-07-17  Daniel Bates  <dabates@apple.com>
1544
1545         Typing into a cell in a Google Sheet lags behind by one character
1546         https://bugs.webkit.org/show_bug.cgi?id=199587
1547         <rdar://problem/51616845>
1548
1549         Reviewed by Brent Fulgham.
1550
1551         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
1552         into a holding tank. The timers continue to tick, but are barred from executing their action until
1553         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
1554         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
1555         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
1556         of the document.
1557
1558         The story behind the quirk:
1559
1560         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
1561         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
1562         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
1563         event. It could happen in the same event loop iteration as the key press (as Google expects), the
1564         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
1565         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
1566         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
1567         functionality was available via onpropertychange in IE < 9).
1568
1569         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
1570         this quirk.
1571
1572         Test: fast/events/ios/dom-update-on-keydown-quirk.html
1573
1574         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
1575
1576         * SourcesCocoa.txt:
1577         * WebCore.xcodeproj/project.pbxproj:
1578         Add some files to the project.
1579
1580         * dom/Document.cpp:
1581         (WebCore::Document::domTimerHoldingTank): Added.
1582         * dom/Document.h:
1583         (WebCore::Document::domTimerHoldingTankIfExists): Added.
1584
1585         * page/DOMTimer.cpp:
1586         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
1587         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
1588         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
1589         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
1590         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
1591         we do not suspend timers in the holding tank is because:
1592             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
1593             Though smart supension logic could avoid this. See (3).
1594
1595             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
1596             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
1597             So, the timers in the holding tank are short-lived.
1598
1599             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
1600             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
1601             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
1602         * page/EventHandler.cpp:
1603         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
1604         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
1605         * page/Quirks.cpp:
1606         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
1607         * page/Quirks.h:
1608         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
1609         also lets us enable the quirk for all sites or for certain third-party apps if desired.
1610         * page/ios/DOMTimerHoldingTank.cpp: Added.
1611         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
1612         (WebCore::DOMTimerHoldingTank::add):
1613         (WebCore::DOMTimerHoldingTank::remove):
1614         (WebCore::DOMTimerHoldingTank::contains):
1615         (WebCore::DOMTimerHoldingTank::removeAll):
1616         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
1617         * page/ios/DOMTimerHoldingTank.h: Added.
1618         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
1619         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
1620         (WebCore::DeferDOMTimersForScope::isDeferring):
1621
1622 2019-07-17  Darin Adler  <darin@apple.com>
1623
1624         No need for isURLAllowed function in Frame
1625         https://bugs.webkit.org/show_bug.cgi?id=120266
1626
1627         Reviewed by Alex Christensen.
1628
1629         * css/SelectorCheckerTestFunctions.h:
1630         (WebCore::matchesFullScreenPseudoClass): Use is<> instead of
1631         the isFrameElementBase function. Also updated includes and spacing.
1632
1633         * dom/Document.cpp:
1634         (WebCore::Document::resolveStyle): Shortened an old, long comment
1635         that happened to mention HTMLFrameElementBase::isURLAllowed by name.
1636
1637         * dom/Element.h: Deleted isFrameElementBase.
1638
1639         * html/HTMLAppletElement.cpp:
1640         (WebCore::HTMLAppletElement::updateWidget): Tweaked comment.
1641
1642         * html/HTMLBodyElement.cpp:
1643         (WebCore::HTMLBodyElement::insertedIntoAncestor): Moved comment from
1644         here to didFinishInsertingNode, since the code it's talking about is there.
1645         Also got rid of unnecessary local variable.
1646         (WebCore::HTMLBodyElement::didFinishInsertingNode): Moved comment here
1647         and elaborated a bit. Also changed the code to copy margin attributes in a
1648         simpler way without requiring special getter functions. There is a slight
1649         behavior change here, but seems unlikely to affect any websites or tests.
1650         Would be good to add better test coverage, which I think should be done
1651         when fixing the problems described in the FIXME.
1652
1653         * html/HTMLEmbedElement.cpp:
1654         (WebCore::HTMLEmbedElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
1655         Also Tweaked comments.
1656
1657         * html/HTMLFrameElement.cpp:
1658         (WebCore::HTMLFrameElement::rendererIsNeeded): isURLAllowed -> canLoad
1659
1660         * html/HTMLFrameElementBase.cpp:
1661         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase): Removed initial
1662         values for no-longer-needed data members.
1663
1664         (WebCore::HTMLFrameElementBase::canLoadScriptURL const): Renamed from
1665         isURLAllowed. Also refactored so it now calls canLoadURL.
1666         (WebCore::HTMLFrameElementBase::canLoad const): Renamed from isURLAllowed.
1667         Also added FIXME comments about multiple ways that this code incorrectly
1668         handles the empty string. Might inspire some tests and future fixes.
1669         (WebCore::HTMLFrameElementBase::canLoadURL const): Renamed from isURLAllowed.
1670         Added an overload that takes a relative URL string largely to make this
1671         more parallel with the similar code in HTMLPlugInImageElement. Refactored
1672         to call canAddSubframe and isProhibitedSelfReference, removing the need
1673         to call Frame::isURLAllowed.
1674         (WebCore::HTMLFrameElementBase::openURL): isURLAllowed -> canLoad
1675         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code
1676         to parse marginwidth, marginheight, and scrolling, which are now done
1677         as needed instead. Might have to add code back if we ever add code to
1678         make these cause dynamic updates when changed, but that was not the
1679         behavior of the existing code.
1680         (WebCore::HTMLFrameElementBase::scrollingMode const): Changed to call
1681         attributeWithoutSynchronization rather than reading from a data member.
1682
1683         * html/HTMLFrameElementBase.h: Moved scrollingMode into the .cpp file.
1684         Removed marginWidth and marginHeight since they are no longer called.
1685         Made canContainRangeEndPoint override be private. Renamed isURLAllowed
1686         to canLoad/canLoadScriptURL/canLoadURL. Removed unneeded isFrameElementBase
1687         since is<HTMLFrameElementBase> already works without it. Removed unneeded
1688         data members m_scrolling, m_marginWidth, and m_marginHeight.
1689
1690         * html/HTMLFrameOwnerElement.cpp:
1691         (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement): Moved initialization
1692         of m_contentFrame and m_sandboxFlags to the header.
1693         (WebCore::HTMLFrameOwnerElement::clearContentFrame): 0 -> nullptr
1694         (WebCore::HTMLFrameOwnerElement::canAddSubframe const): Added. Code was moved
1695         here from multiple functions that enforced the subframe count limit.
1696         (WebCore::HTMLFrameOwnerElement::isProhibitedSelfReference const): Added.
1697         Moved code here from Frame::isURLAllowed so it's easy to use as needed.
1698
1699         * html/HTMLFrameOwnerElement.h: Renamed isURLAllowed to canLoadScriptURL.
1700         Added protected canAddSubframe and isProhibitedSelfReference functions.
1701         Initialized the data members here.
1702
1703         * html/HTMLIFrameElement.cpp:
1704         (WebCore::HTMLIFrameElement::sandbox): Added braces for multi-line if statement.
1705         (WebCore::HTMLIFrameElement::parseAttribute): Removed unneeded storage of the
1706         allow attribute value. Added missing code to invalidate m_featurePolicy when
1707         the allow attribute changes. This could change behavior, but unlikely to affect
1708         any websites of tests. Would be good to add a test for this.
1709         (WebCore::HTMLIFrameElement::rendererIsNeeded): isURLAllowed -> canLoad. Also
1710         reordered the code to be more efficient for display: none (why not?).
1711         (WebCore::HTMLIFrameElement::featurePolicy const): Use attributeWithoutSynchronization
1712         to read the allow attribute rather than using a data member.
1713
1714         * html/HTMLIFrameElement.h: Removed the unneeded allow function member and
1715         m_allow data member since DOM reflection takes care of the function and the
1716         featurePolicy function can get the attribute without a data member.
1717
1718         * html/HTMLObjectElement.cpp:
1719         (WebCore::HTMLObjectElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
1720         Also tweaked comments.
1721
1722         * html/HTMLPlugInElement.cpp:
1723         (WebCore::HTMLPlugInElement::canLoadScriptURL const): Added. Code moved here
1724         from HTMLFrameOwnerElement::isURLAllowed. Added comment about why this is not
1725         necessarily correct and might need improvement.
1726
1727         * html/HTMLPlugInElement.h: Added private override of canLoadScriptURL.
1728
1729         * html/HTMLPlugInImageElement.cpp:
1730         (WebCore::HTMLPlugInImageElement::canLoadURL const): Renamed from
1731         allowedToLoadFrameURL and refactored into two functions to match the
1732         structure of the similar function in HTMLFrameElementBase. Also refactored
1733         to use canAddSubframe and isProhibitedSelfReference rather than Frame::isURLAllowed.
1734         (WebCore::HTMLPlugInImageElement::canLoadPlugInContent const): Renamed from
1735         allowedToLoadPluginContent.
1736         (WebCore::HTMLPlugInImageElement::requestObject): allowedToLoadPluginContent
1737         -> canLoadPlugInContent
1738
1739         * html/HTMLPlugInImageElement.h: Renamed functions as mentioned above.
1740
1741         * loader/SubframeLoader.cpp:
1742         (WebCore::SubframeLoader::requestFrame): isURLAllowed -> canLoadScriptURL
1743
1744         * page/FocusController.h: Removed unneeded forward declaration of HTMLFrameOwnerElement.
1745
1746         * page/Frame.cpp:
1747         (WebCore::Frame::isURLAllowed const): Deleted.
1748         * page/Frame.h: Ditto.
1749
1750         * page/FrameView.cpp:
1751         (WebCore::FrameView::init): Removed code to initialize m_margins, since nothing
1752         was looking at it after that.
1753         (WebCore::FrameView::setMarginWidth): Deleted.
1754         (WebCore::FrameView::setMarginHeight): Deleted.
1755
1756         * page/FrameView.h: Removed marginWidth, marginHeight, setMarginWidth,
1757         setMarginHeight, and m_margins because there was no code anywhere calling
1758         marginWidth or marginHeight, and no other side effects of these functions.
1759
1760 2019-07-17  Alex Christensen  <achristensen@webkit.org>
1761
1762         Add a runtime-disabled dialog element skeleton
1763         https://bugs.webkit.org/show_bug.cgi?id=199839
1764
1765         Reviewed by Ryosuke Niwa.
1766
1767         Beginning implementation of https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element
1768         Covered by rebaselining WPT tests.
1769
1770         * CMakeLists.txt:
1771         * DerivedSources-input.xcfilelist:
1772         * DerivedSources-output.xcfilelist:
1773         * DerivedSources.make:
1774         * Sources.txt:
1775         * WebCore.xcodeproj/project.pbxproj:
1776         * bindings/js/WebCoreBuiltinNames.h:
1777         * html/HTMLDialogElement.cpp: Added.
1778         (WebCore::HTMLDialogElement::HTMLDialogElement):
1779         (WebCore::HTMLDialogElement::open):
1780         (WebCore::HTMLDialogElement::setOpen):
1781         (WebCore::HTMLDialogElement::returnValue):
1782         (WebCore::HTMLDialogElement::setReturnValue):
1783         (WebCore::HTMLDialogElement::show):
1784         (WebCore::HTMLDialogElement::showModal):
1785         (WebCore::HTMLDialogElement::close):
1786         * html/HTMLDialogElement.h: Added.
1787         * html/HTMLDialogElement.idl: Added.
1788         * html/HTMLTagNames.in:
1789         * page/RuntimeEnabledFeatures.h:
1790         (WebCore::RuntimeEnabledFeatures::setDialogElementEnabled):
1791         (WebCore::RuntimeEnabledFeatures::dialogElementEnabled const):
1792
1793 2019-07-17  Youenn Fablet  <youenn@apple.com>
1794
1795         Hop to the main thread when doing logging in RealtimeIncomingVideoSourceCocoa
1796         https://bugs.webkit.org/show_bug.cgi?id=199865
1797
1798         Reviewed by Darin Adler.
1799
1800         LoggerHelper routines allow logging messages in system console and inspector console.
1801         These routines iterate through a Vector of log observers which is not thread safe.
1802         Document, the main log observer, also expects to be called on the main thread.
1803         Manually tested (writing a layout test for this would require more than 2 seconds).
1804
1805         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1806         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
1807
1808 2019-07-17  Commit Queue  <commit-queue@webkit.org>
1809
1810         Unreviewed, rolling out r247505.
1811         https://bugs.webkit.org/show_bug.cgi?id=199871
1812
1813         "Caused failed ASSERT in stress test" (Requested by creid on
1814         #webkit).
1815
1816         Reverted changeset:
1817
1818         "Bytecode cache should use FileSystem"
1819         https://bugs.webkit.org/show_bug.cgi?id=199759
1820         https://trac.webkit.org/changeset/247505
1821
1822 2019-07-17  Youenn Fablet  <youenn@apple.com>
1823
1824         Add release logging to AudioSampleDataSource
1825         https://bugs.webkit.org/show_bug.cgi?id=199814
1826         <rdar://problem/53128140>
1827
1828         Reviewed by Eric Carlson.
1829
1830         Use release logging for AudioSampleDataSource in case of errors.
1831         This requires passing a logger and a logger identifier.
1832         For that purpose, pass a MediaStreamTrackPrivate to it constructor
1833         and reuse its logger and log identifier.
1834
1835         For each log, hop to the main thread as release logging requires to be done in the main thread.
1836         Add specific handling for RealtimeOutgoingAudioSource as its MediaStreamTrack can change in case of replaceTrack.
1837         In that case, we change of logger when changing the MediaStreamTrackPrivate.
1838
1839         No observable change of behavior, covered by existing tests.
1840
1841         * platform/audio/mac/AudioSampleDataSource.h:
1842         * platform/audio/mac/AudioSampleDataSource.mm:
1843         (WebCore::AudioSampleDataSource::create):
1844         (WebCore::AudioSampleDataSource::AudioSampleDataSource):
1845         (WebCore::AudioSampleDataSource::setupConverter):
1846         (WebCore::AudioSampleDataSource::pushSamplesInternal):
1847         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1848         (WebCore::AudioSampleDataSource::setLogger):
1849         (WebCore::AudioSampleDataSource::logChannel const):
1850         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
1851         (WebCore::RealtimeOutgoingAudioSource::setSource):
1852         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1853         (WebCore::RealtimeOutgoingAudioSource::sourceUpdated):
1854         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1855         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1856         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1857         Instead of using its own logger/identifier member field, reuse its MediaStreamTrackPrivate.
1858         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1859         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
1860         (WebCore::RealtimeOutgoingAudioSourceCocoa::sourceUpdated):
1861         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
1862         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1863         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
1864
1865 2019-07-17  Kenneth Russell  <kbr@chromium.org>
1866
1867         Make ANGLE work inside WebKit2's sandbox
1868         https://bugs.webkit.org/show_bug.cgi?id=199844
1869
1870         Reviewed by Alex Christensen.
1871
1872         Fix missing #import introduced at the last minute while removing
1873         some debugging code in the last patch.
1874
1875         Tested with San Angeles WebGL demo and some conformance tests.
1876
1877         * platform/graphics/cocoa/WebGLLayer.mm:
1878
1879 2019-07-17  Andres Gonzalez  <andresg_22@apple.com>
1880
1881         Hang in WebCore::AccessibilityRenderObject::visiblePositionRangeForLine.
1882         https://bugs.webkit.org/show_bug.cgi?id=199845
1883         <rdar://problem/53121017>
1884
1885         Reviewed by Chris Fleizach.
1886
1887         - Added check for upper bound NSNotFound for parameter to visiblePositionRangeForLine.
1888         - Fixed signed/unsigned issue for AXTextMarkerRangeForLine attribute.
1889
1890         * accessibility/AccessibilityRenderObject.cpp:
1891         (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const):
1892         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1893         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1894
1895 2019-07-17  Rob Buis  <rbuis@igalia.com>
1896
1897         Add referrerpolicy attribute support for <script> elements
1898         https://bugs.webkit.org/show_bug.cgi?id=185550
1899
1900         Reviewed by Youenn Fablet.
1901
1902         This patch adds 'referrerpolicy' attribute support for script elements.
1903         If set, the value is restricted to the ReferrerPolicy enum, and
1904         if valid it is used for the script fetch.
1905         If not set or invalid, the current behavior is kept.
1906
1907         Tests: http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http-http.html
1908                http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http.https.html
1909                http/tests/referrer-policy-script/no-referrer-when-downgrade/same-origin.html
1910                http/tests/referrer-policy-script/no-referrer/cross-origin-http-http.html
1911                http/tests/referrer-policy-script/no-referrer/cross-origin-http.https.html
1912                http/tests/referrer-policy-script/no-referrer/same-origin.html
1913                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http-http.html
1914                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http.https.html
1915                http/tests/referrer-policy-script/origin-when-cross-origin/same-origin.html
1916                http/tests/referrer-policy-script/origin/cross-origin-http-http.html
1917                http/tests/referrer-policy-script/origin/cross-origin-http.https.html
1918                http/tests/referrer-policy-script/origin/same-origin.html
1919                http/tests/referrer-policy-script/same-origin/cross-origin-http-http.html
1920                http/tests/referrer-policy-script/same-origin/cross-origin-http.https.html
1921                http/tests/referrer-policy-script/same-origin/same-origin.html
1922                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http-http.html
1923                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http.https.html
1924                http/tests/referrer-policy-script/strict-origin-when-cross-origin/same-origin.html
1925                http/tests/referrer-policy-script/strict-origin/cross-origin-http-http.html
1926                http/tests/referrer-policy-script/strict-origin/cross-origin-http.https.html
1927                http/tests/referrer-policy-script/strict-origin/same-origin.html
1928                http/tests/referrer-policy-script/unsafe-url/cross-origin-http-http.html
1929                http/tests/referrer-policy-script/unsafe-url/cross-origin-http.https.html
1930                http/tests/referrer-policy-script/unsafe-url/same-origin.html
1931
1932         * bindings/js/CachedScriptFetcher.cpp:
1933         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
1934         * bindings/js/CachedScriptFetcher.h:
1935         (WebCore::CachedScriptFetcher::CachedScriptFetcher):
1936         * dom/InlineClassicScript.h:
1937         * dom/LoadableClassicScript.cpp:
1938         (WebCore::LoadableClassicScript::create):
1939         * dom/LoadableClassicScript.h:
1940         * dom/LoadableModuleScript.cpp:
1941         (WebCore::LoadableModuleScript::create):
1942         (WebCore::LoadableModuleScript::LoadableModuleScript):
1943         * dom/LoadableModuleScript.h:
1944         * dom/LoadableScript.h:
1945         (WebCore::LoadableScript::LoadableScript):
1946         * dom/ScriptElement.cpp:
1947         (WebCore::ScriptElement::requestClassicScript):
1948         (WebCore::ScriptElement::requestModuleScript):
1949         * dom/ScriptElement.h:
1950         * dom/ScriptElementCachedScriptFetcher.h:
1951         (WebCore::ScriptElementCachedScriptFetcher::ScriptElementCachedScriptFetcher):
1952         * html/HTMLIFrameElement.cpp:
1953         (WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
1954         * html/HTMLScriptElement.cpp:
1955         (WebCore::HTMLScriptElement::setReferrerPolicyForBindings):
1956         (WebCore::HTMLScriptElement::referrerPolicyForBindings const):
1957         (WebCore::HTMLScriptElement::referrerPolicy const):
1958         * html/HTMLScriptElement.h:
1959         * html/HTMLScriptElement.idl:
1960         * html/parser/CSSPreloadScanner.cpp:
1961         (WebCore::CSSPreloadScanner::emitRule):
1962         * html/parser/HTMLPreloadScanner.cpp:
1963         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
1964         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1965         * html/parser/HTMLResourcePreloader.cpp:
1966         (WebCore::PreloadRequest::resourceRequest):
1967         * html/parser/HTMLResourcePreloader.h:
1968         (WebCore::PreloadRequest::PreloadRequest):
1969         * platform/ReferrerPolicy.cpp:
1970         (WebCore::referrerPolicyToString):
1971         * platform/ReferrerPolicy.h:
1972         * svg/SVGScriptElement.h:
1973
1974 2019-07-16  Christopher Reid  <chris.reid@sony.com>
1975
1976         Bytecode cache should use FileSystem
1977         https://bugs.webkit.org/show_bug.cgi?id=199759
1978
1979         Reviewed by Yusuke Suzuki.
1980
1981         * platform/SharedBuffer.cpp:
1982
1983 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
1984
1985         Fix includes and make a constructor explicit to avoid unified-sources-triggered test failures
1986         https://bugs.webkit.org/show_bug.cgi?id=199849
1987
1988         Reviewed by Wenson Hsieh.
1989         
1990         webkit.org/b/199587 triggered some unexpected test failures because of unified sources include
1991         order. The TextStream operator in ScrollingTreeOverflowScrollingNode::dumpProperties() was invoking
1992         the implicit constructor of TransformOperations.
1993
1994         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: Include TextStream.h
1995         * platform/graphics/transforms/TransformOperations.h: Make ctor explicit.
1996
1997 2019-07-16  Antoine Quint  <graouts@apple.com>
1998
1999         REGRESSION: fast/events/watchos/double-tap-to-zoom* tests crashing in com.apple.WebKit: -[WKContentView(WKInteraction) _singleTapDidReset:]
2000         https://bugs.webkit.org/show_bug.cgi?id=199840
2001         <rdar://problem/52856531>
2002
2003         Reviewed by Wenson Hsieh.
2004
2005         Fix a build error that occured when building for the watchOS Simulator in the debug configuration.
2006
2007         * rendering/RenderLayerCompositor.cpp:
2008         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
2009
2010 2019-07-16  Justin Fan  <justin_fan@apple.com>
2011
2012         [WebGPU] Convert GPUComputePipeline LOG statements to generate GPUErrors
2013         https://bugs.webkit.org/show_bug.cgi?id=199773
2014
2015         Reviewed by Myles C. Maxfield.
2016
2017         Generate a GPUError if GPUComputePipeline creation fails.
2018         Rework the WHLSL test harness to take advantage of this.
2019
2020         Test: webgpu/compute-pipeline-errors.html
2021
2022         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp:
2023         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
2024         * Modules/webgpu/WebGPUComputePipelineDescriptor.h:
2025         * Modules/webgpu/WebGPUDevice.cpp:
2026         (WebCore::WebGPUDevice::createComputePipeline const):
2027         * platform/graphics/gpu/GPUBuffer.h:
2028         * platform/graphics/gpu/GPUComputePipeline.h: 
2029                 Now inherits from GPUObjectBase, though this isn't super useful yet
2030                 since GPUComputePipeline itself does not expose any operations that can error. 
2031         * platform/graphics/gpu/GPUDevice.cpp:
2032         (WebCore::GPUDevice::tryCreateComputePipeline const):
2033         * platform/graphics/gpu/GPUDevice.h:
2034         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2035         (WebCore::GPUBuffer::validateBufferUsage):
2036         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
2037         (WebCore::trySetMetalFunctions):
2038         (WebCore::trySetFunctions):
2039         (WebCore::convertComputePipelineDescriptor):
2040         (WebCore::tryCreateMTLComputePipelineState):
2041         (WebCore::GPUComputePipeline::tryCreate):
2042         (WebCore::GPUComputePipeline::GPUComputePipeline):
2043
2044 2019-07-11  Justin Fan  <justin_fan@apple.com>
2045
2046         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
2047         https://bugs.webkit.org/show_bug.cgi?id=199740
2048
2049         Reviewed by Myles C. Maxfield.
2050
2051         Move error generation into a separate RefCounted class to allow GPU objects to generate 
2052         errors independent of any GPUDevice.
2053         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
2054
2055         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
2056
2057         * Modules/webgpu/WebGPUDevice.cpp:
2058         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
2059         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
2060         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
2061         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
2062         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
2063         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
2064         * Modules/webgpu/WebGPUDevice.h:
2065         (WebCore::WebGPUDevice::pushErrorScope):
2066         * Sources.txt:
2067         * WebCore.xcodeproj/project.pbxproj:
2068         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
2069         * platform/graphics/gpu/GPUDevice.cpp:
2070         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
2071         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
2072         (WebCore::GPUDevice::popErrorScope): Deleted.
2073         (WebCore::GPUDevice::registerError): Deleted.
2074         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
2075         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
2076         (WebCore::GPUErrorGenerator::pushErrorScope):
2077         (WebCore::GPUErrorGenerator::popErrorScope):
2078         (WebCore::GPUErrorGenerator::generateError):
2079         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
2080         (WebCore::GPUErrorGenerator::create):
2081         * platform/graphics/gpu/GPUObjectBase.h: Added.
2082         (WebCore::GPUObjectBase::generateError):
2083         (WebCore::GPUObjectBase::GPUObjectBase):
2084         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
2085         (WebCore::GPUBuffer::validateBufferUsage):
2086         (WebCore::GPUBuffer::tryCreate):
2087         (WebCore::GPUBuffer::GPUBuffer):
2088         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2089         (WebCore::GPUQueue::submit): Prevent possible null dereference.
2090
2091 2019-07-10  Justin Fan  <justin_fan@apple.com>
2092
2093         [WebGPU] Implement GPUError and error scopes
2094         https://bugs.webkit.org/show_bug.cgi?id=199655
2095
2096         Reviewed by Myles C. Maxfield.
2097
2098         Add GPUErrorFilter, GPUError, and the ability to push and pop error scopes on a GPUDevice.
2099         This will allow us to check for WebGPU errors from JavaScript.
2100         Currently, only some GPUBuffer creation errors are reported for testing; more errors will follow in later patches.
2101
2102         Test: webgpu/error-scopes-test.html
2103
2104         * Modules/webgpu/GPUErrorFilter.idl: Added.
2105         * Modules/webgpu/GPUOutOfMemoryError.idl: Added.
2106         * Modules/webgpu/GPUValidationError.idl: Added.
2107         * Modules/webgpu/WebGPUDevice.cpp:
2108         (WebCore::WebGPUDevice::pushErrorScope):
2109         (WebCore::WebGPUDevice::popErrorScope): Resolve the Promise here, since GPUDevice shouldn't worry about DOM layer.
2110         * Modules/webgpu/WebGPUDevice.h:
2111         * Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Added.
2112         (WebCore::WebGPUDeviceErrorScopes::pushErrorScope): Delegates to WebGPUDevice.
2113         (WebCore::WebGPUDeviceErrorScopes::popErrorScope): Ditto.
2114         * Modules/webgpu/WebGPUDeviceErrorScopes.h: Added.
2115         * Modules/webgpu/WebGPUDeviceErrorScopes.idl: Added.
2116         * platform/graphics/gpu/GPUBuffer.h:
2117         * platform/graphics/gpu/GPUDevice.cpp: The actual error stack lives here.
2118         (WebCore::GPUDevice::pushErrorScope):
2119         (WebCore::GPUDevice::popErrorScope): Calls a callback with a GPUError, if any.
2120         (WebCore::GPUDevice::registerError): Actually creates GPUErrors.
2121         * platform/graphics/gpu/GPUDevice.h:
2122         * platform/graphics/gpu/GPUError.cpp: Added.
2123         (WebCore::createError): Factory function for various error types.
2124         * platform/graphics/gpu/GPUError.h: Added.
2125         * platform/graphics/gpu/GPUErrorFilter.h: Added.
2126         * platform/graphics/gpu/GPUOutOfMemoryError.h: Added.
2127         (WebCore::GPUOutOfMemoryError::create):
2128         * platform/graphics/gpu/GPUValidationError.cpp: Added.
2129         (WebCore::GPUValidationError::create):
2130         (WebCore::GPUValidationError::GPUValidationError):
2131         * platform/graphics/gpu/GPUValidationError.h: Added.
2132         (WebCore::GPUValidationError::message const):
2133         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2134         (WebCore::GPUBuffer::validateBufferUsage): Create an actual GPUValidationError :)
2135         (WebCore::GPUBuffer::tryCreate): Create GPUOutOfMemoryErrors where appropriate.
2136
2137         Add file/name references:
2138         * CMakeLists.txt:
2139         * DerivedSources-input.xcfilelist:
2140         * DerivedSources-output.xcfilelist:
2141         * DerivedSources.make:
2142         * Sources.txt:
2143         * WebCore.xcodeproj/project.pbxproj:
2144         * bindings/js/WebCoreBuiltinNames.h:
2145
2146         Missing includes:
2147         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
2148
2149 2019-07-16  Commit Queue  <commit-queue@webkit.org>
2150
2151         Unreviewed, rolling out r247493.
2152         https://bugs.webkit.org/show_bug.cgi?id=199841
2153
2154         "The new whlsl-for-loop.html test is failing on the bots"
2155         (Requested by rmorisset on #webkit).
2156
2157         Reverted changeset:
2158
2159         "[WHLSL] Desugar for loops and while loops"
2160         https://bugs.webkit.org/show_bug.cgi?id=199726
2161         https://trac.webkit.org/changeset/247493
2162
2163 2019-07-16  Per Arne Vollan  <pvollan@apple.com>
2164
2165         Prewarm font cache with more fonts
2166         https://bugs.webkit.org/show_bug.cgi?id=199283
2167
2168         Reviewed by Myles C. Maxfield.
2169
2170         Use the existing prewarm method in FontCache to prewarm the cache with a set of font family names.
2171         The font list consists of some of the fonts used by the 10 most popular sites on Alexa top sites.
2172         This is a confirmed improvement in page load time.
2173
2174         No new tests, covered by existing tests.
2175
2176         * page/ProcessWarming.cpp:
2177         (WebCore::ProcessWarming::prewarmGlobally):
2178         * platform/graphics/FontCache.cpp:
2179         (WebCore::FontCache::prewarmGlobally):
2180         * platform/graphics/FontCache.h:
2181         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2182         (WebCore::FontCache::prewarmGlobally):
2183
2184 2019-07-16  Robin Morisset  <rmorisset@apple.com>
2185
2186         [WHLSL] Desugar for loops and while loops
2187         https://bugs.webkit.org/show_bug.cgi?id=199726
2188
2189         Reviewed by Myles C. Maxfield.
2190
2191         This patch makes loops behave a lot more similarly to the spec.
2192         In particular, while loops are just degenerate for loops, so they can be desugared in the parser.
2193         And for loops can themselves be heavily desugared, into having no initializer, one condition and one increment
2194         by putting any initializer in a block around the loop, putting true in the condition if there is none, and putting any litteral in the increment if there is none.
2195
2196         Debugging this patch revealed an unrelated bug where the parser would generate an empty comma expression on ";", which the checker would then choke on.
2197         The parser now generates an empty block in that case (as specified in the spec), which fixes the problem.
2198
2199         Finally, while updating the NameResolver for the new structure of loops I realized that it was needlessly generating extra NameContext.
2200         They are not expected by the spec, that forbids naked variable declarations outside of blocks anyway.
2201         So I removed this unnecessary work, and fixed the parser to correctly forbid such naked variable declarations.
2202
2203         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
2204         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
2205         (WebCore::WHLSL::AST::ForLoop::ForLoop):
2206         (WebCore::WHLSL::AST::ForLoop::condition):
2207         (WebCore::WHLSL::AST::ForLoop::increment):
2208         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
2209         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
2210         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Removed.
2211         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2212         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2213         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
2214         (WebCore::WHLSL::ASTDumper::visit):
2215         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
2216         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2217         (WebCore::WHLSL::Checker::visit):
2218         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2219         (WebCore::WHLSL::NameResolver::visit):
2220         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
2221         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2222         (WebCore::WHLSL::Parser::parseBlockBody):
2223         (WebCore::WHLSL::Parser::parseForLoop):
2224         (WebCore::WHLSL::Parser::parseWhileLoop):
2225         (WebCore::WHLSL::Parser::parseStatement):
2226         (WebCore::WHLSL::Parser::parseEffectfulExpression):
2227         * Modules/webgpu/WHLSL/WHLSLParser.h:
2228         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
2229         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2230         (WebCore::WHLSL::Visitor::visit):
2231         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
2232         * WebCore.xcodeproj/project.pbxproj:
2233
2234 2019-07-16  Tim Horton  <timothy_horton@apple.com>
2235
2236         NSTextFinder holes don't scroll with the page
2237         https://bugs.webkit.org/show_bug.cgi?id=199815
2238         <rdar://problem/52280514>
2239
2240         Reviewed by Simon Fraser.
2241
2242         * rendering/ScrollAlignment.h:
2243
2244 2019-07-16  Youenn Fablet  <youenn@apple.com>
2245
2246         [iOS] Make sure the first camera device in the list is the front camera
2247         https://bugs.webkit.org/show_bug.cgi?id=199811
2248         <rdar://problem/53125157>
2249
2250         Reviewed by Jer Noble.
2251
2252         Some websites call getUserMedia with a deviceId constraint and theey pick the
2253         first deviceId in the list provided by enumerateDevices.
2254         On iOS, this is the back camera which is often not what is expected by WebRTC applications.
2255         Instead, make sure the first camera device is the front camera.
2256
2257         Manually tested.
2258
2259         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2260
2261 2019-07-16  Chris Dumez  <cdumez@apple.com>
2262
2263         Speed up StorageManager::getValues()
2264         https://bugs.webkit.org/show_bug.cgi?id=199812
2265
2266         Reviewed by Alex Christensen.
2267
2268         * storage/StorageMap.cpp:
2269         (WebCore::StorageMap::importItems):
2270         * storage/StorageMap.h:
2271
2272 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
2273
2274         Remove "GraphicsContext 0x7ffd8765f6b0 stack changed by" logging
2275         https://bugs.webkit.org/show_bug.cgi?id=199834
2276
2277         Reviewed by Dean Jackson.
2278
2279         I inadvertently left in a couple of GraphicsContextStateStackChecker (used to detect mismatched
2280         GraphicsContext save/restore) in r246725, so remove them.
2281
2282         * rendering/RenderLayer.cpp:
2283         (WebCore::RenderLayer::paintLayerContents):
2284         * rendering/RenderLayerBacking.cpp:
2285         (WebCore::RenderLayerBacking::paintIntoLayer):
2286
2287 2019-07-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2288
2289         [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
2290         https://bugs.webkit.org/show_bug.cgi?id=199827
2291         <rdar://problem/53152660>
2292
2293         Reviewed by Zalan Bujtas.
2294
2295         After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
2296         increasing inside a container that expects a fixed integer number of lines. However, in the case of
2297         linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
2298         of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.
2299
2300         To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
2301         is fixed, and is much larger than the font size.
2302
2303         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
2304
2305         * rendering/style/TextSizeAdjustment.cpp:
2306         (WebCore::AutosizeStatus::updateStatus):
2307
2308 2019-07-16  Zalan Bujtas  <zalan@apple.com>
2309
2310         [ContentChangeObserver] Cancel ongoing content observation when tap is failed/cancelled
2311         https://bugs.webkit.org/show_bug.cgi?id=199828
2312         <rdar://problem/53152696>
2313
2314         Reviewed by Wenson Hsieh.
2315
2316         This patch ensures that we stop the content observation (initiated by touch start) when the tap
2317         is cancelled/failed.
2318
2319         Not testable.
2320
2321         * page/ios/ContentChangeObserver.cpp:
2322         (WebCore::ContentChangeObserver::didCancelPotentialTap):
2323         * page/ios/ContentChangeObserver.h:
2324
2325 2019-07-16  Rob Buis  <rbuis@igalia.com>
2326
2327         Remove support for beforeload on link=prefetch
2328         https://bugs.webkit.org/show_bug.cgi?id=199632
2329
2330         Reviewed by Youenn Fablet.
2331
2332         Remove support for beforeload on link=prefetch
2333         by not calling shouldLoadLink for prefetch.
2334         Also make loadLink return void since it always
2335         succeeds.
2336
2337         Tests: http/wpt/prefetch/beforeload-dynamic.html
2338                http/wpt/prefetch/beforeload.html
2339
2340         * html/HTMLLinkElement.cpp:
2341         (WebCore::HTMLLinkElement::process):
2342         * loader/LinkLoader.cpp:
2343         (WebCore::LinkLoader::prefetchIfNeeded):
2344         (WebCore::LinkLoader::loadLink):
2345         * loader/LinkLoader.h:
2346
2347 2019-07-16  Youenn Fablet  <youenn@apple.com>
2348
2349         Hop to main thread for release logging in RealtimeIncomingAudioSource
2350         https://bugs.webkit.org/show_bug.cgi?id=199813
2351
2352         Reviewed by Eric Carlson.
2353
2354         LoggerHelper routines allow logging messages in system console and inspector console.
2355         These routines iterate through a Vector of log observers which is not thread safe.
2356         Document, the main log observer, also expects to be called on the main thread.
2357         Manually tested (writing a layout test for this would require more than 2 seconds).
2358
2359         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
2360         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
2361
2362 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
2363
2364         Unreviewed, rolling out r247444.
2365
2366         Caused two scrolling tests to fail on iOS Simulator
2367
2368         Reverted changeset:
2369
2370         "Typing into a cell in a Google Sheet lags behind by one
2371         character"
2372         https://bugs.webkit.org/show_bug.cgi?id=199587
2373         https://trac.webkit.org/changeset/247444
2374
2375 2019-07-15  Zalan Bujtas  <zalan@apple.com>
2376
2377         outlook.live.com has odd viewport with edge gap
2378         https://bugs.webkit.org/show_bug.cgi?id=199822
2379         <rdar://problem/53029072>
2380
2381         Reviewed by Wenson Hsieh.
2382
2383         r244944 introduced a viewport width quirk because at certain screen size outlook.live.com's flex setup produced a slighly broken layout.
2384         We don't seem to need this quirk anymore (composed column's min-width is removed.)
2385
2386         * page/Quirks.cpp:
2387         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const): Deleted.
2388         (WebCore::Quirks::overriddenViewLayoutWidth const): Deleted.
2389         * page/Quirks.h:
2390
2391 2019-07-15  Saam Barati  <sbarati@apple.com>
2392
2393         [WHLSL] Matrix memory layout should match HLSL by laying out columns linearly
2394         https://bugs.webkit.org/show_bug.cgi?id=199215
2395
2396         Reviewed by Myles C. Maxfield.
2397
2398         This patch makes it so that we lay out matrices in memory in the same
2399         way HLSL does. This is by laying out columns linearly in memory. So a float4x4
2400         composed by this series of floats in memory:
2401         [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
2402         
2403         composes this logical matrix:
2404         [[ 0,  4,  8, 12]
2405          [ 1,  5,  9, 13]
2406          [ 2,  6, 10, 14]
2407          [ 3,  7, 11, 15]]
2408         
2409         To implement this, we switch to using an array to represent the memory
2410         contents linear memory layout of a matrix. So the matrix float4x3 will now
2411         be an array<float, 12> in metal. Then, we change the indexed getter and
2412         setter methods for matrices to load and store from and to the correct
2413         memory locations. The memory layout of matrices is observable to WHLSL
2414         when using a matrix as an input/output to a shader.
2415
2416         Test: webgpu/whlsl-matrix-memory-layout.html
2417
2418         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
2419         (WebCore::WHLSL::Metal::writeNativeFunction):
2420         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
2421         (WebCore::WHLSL::Metal::writeNativeType):
2422
2423 2019-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2424
2425         [Text autosizing] [iPadOS] Product label text is clipped in portrait mode on the front page of sephora.com
2426         https://bugs.webkit.org/show_bug.cgi?id=199806
2427         <rdar://problem/52902482>
2428
2429         Reviewed by Zalan Bujtas.
2430
2431         On sephora.com, some product label text is currently boosted by idempotent text autosizing, which causes the
2432         labels be vertically clipped. This patch augments the idempotent text autosizing heuristic to avoid this case by
2433         checking if the element to be boosted has a fixed height or max height, whose value is very close to a small
2434         integer multiple of the line height. In this case, it's likely that the website expects the text to be no more
2435         than a few lines' worth of height, so boosting the text is likely to break the page.
2436
2437         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
2438
2439         * rendering/style/RenderStyle.cpp:
2440         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
2441         * rendering/style/TextSizeAdjustment.cpp:
2442         (WebCore::AutosizeStatus::updateStatus):
2443         * rendering/style/TextSizeAdjustment.h:
2444
2445         Rename Fields::DisplayNone to Fields::AvoidSubtree to avoid introducing another bit in RenderStyle's inherited
2446         flags.
2447
2448 2019-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
2449
2450         New York font erroneously gets synthetic bold
2451         https://bugs.webkit.org/show_bug.cgi?id=199653
2452
2453         Unreviewed watchOS build fix.
2454
2455         * page/ProcessWarming.cpp:
2456         (WebCore::ProcessWarming::prewarmGlobally):
2457         * page/cocoa/MemoryReleaseCocoa.mm:
2458         (WebCore::platformReleaseMemory):
2459         * platform/graphics/FontCascadeDescription.cpp:
2460         * platform/graphics/FontDescription.h:
2461         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2462         (WebCore::invalidateFontCache):
2463         (WebCore::lookupFallbackFont):
2464         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2465         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
2466         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
2467         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
2468         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
2469
2470 2019-07-15  Commit Queue  <commit-queue@webkit.org>
2471
2472         Unreviewed, rolling out r247462.
2473         https://bugs.webkit.org/show_bug.cgi?id=199816
2474
2475         completely messed up the patch (Requested by litherum on
2476         #webkit).
2477
2478         Reverted changeset:
2479
2480         "New York font erroneously gets synthetic bold"
2481         https://bugs.webkit.org/show_bug.cgi?id=199653
2482         https://trac.webkit.org/changeset/247462
2483
2484 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
2485
2486         Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
2487
2488         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2489         (WebCore::fontWithFamilySpecialCase):
2490
2491 2019-07-11  Justin Fan  <justin_fan@apple.com>
2492
2493         Unreviewed build fix.
2494
2495         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.
2496
2497 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
2498
2499         New York font erroneously gets synthetic bold
2500         https://bugs.webkit.org/show_bug.cgi?id=199653
2501         <rdar://problem/51692592>
2502
2503         Reviewed by Simon Fraser.
2504
2505         This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
2506         and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
2507         to expose these fonts to the web because we don't a standardization story for them
2508         yet, but we do want some apps to be able to use them.
2509
2510         WebKit clients who want to use these fonts can set
2511         -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
2512
2513         The patch generalizes our existing system-ui infrastructure to handle these three
2514         additional fonts. It also explicitly disables the unsupported dot-prefixed names
2515         so they don't leak out into Web content.
2516
2517         Tests: fast/text/design-system-ui-10.html
2518                fast/text/design-system-ui-11.html
2519                fast/text/design-system-ui-12.html
2520                fast/text/design-system-ui-13.html
2521                fast/text/design-system-ui-14.html
2522                fast/text/design-system-ui-15.html
2523                fast/text/design-system-ui-16.html
2524                fast/text/design-system-ui-2.html
2525                fast/text/design-system-ui-3.html
2526                fast/text/design-system-ui-4.html
2527                fast/text/design-system-ui-5.html
2528                fast/text/design-system-ui-6.html
2529                fast/text/design-system-ui-7.html
2530                fast/text/design-system-ui-8.html
2531                fast/text/design-system-ui-9.html
2532                fast/text/design-system-ui.html
2533
2534         * css/CSSFontFace.cpp:
2535         (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
2536         * css/CSSFontFace.h:
2537         * css/CSSFontFaceSource.cpp:
2538         (WebCore::CSSFontFaceSource::load):
2539         * css/StyleResolver.cpp:
2540         (WebCore::StyleResolver::initializeFontStyle):
2541         * page/Settings.yaml:
2542         * platform/graphics/FontDescription.cpp:
2543         (WebCore::m_shouldAllowDesignSystemUIFonts):
2544         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
2545         * platform/graphics/FontDescription.h:
2546         (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
2547         (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
2548         (WebCore::FontDescription::operator== const):
2549         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2550         (WebCore::platformFontLookupWithFamily):
2551         (WebCore::fontWithFamily):
2552         * platform/graphics/cocoa/FontCacheCoreText.h:
2553         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2554         (WebCore::systemFontUse):
2555         (WebCore::systemFontCascadeList):
2556         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
2557         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
2558         (WebCore::isSystemFontString): Deleted.
2559         (WebCore::isUIFontTextStyle): Deleted.
2560         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2561         (WebCore::FontPlatformData::ctFont const):
2562         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
2563         (WebCore::SystemFontDatabaseCoreText::createSystemUI):
2564         (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
2565         (WebCore::SystemFontDatabaseCoreText::createTextStyle):
2566         (WebCore::SystemFontDatabaseCoreText::cascadeList):
2567         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
2568         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
2569         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
2570         * platform/graphics/ios/FontCacheIOS.mm:
2571         (WebCore::platformFontWithFamilySpecialCase):
2572         * platform/graphics/mac/FontCacheMac.mm:
2573         (WebCore::platformFontWithFamilySpecialCase):
2574         * style/StyleResolveForDocument.cpp:
2575         (WebCore::Style::resolveForDocument):
2576         * svg/graphics/SVGImage.cpp:
2577         (WebCore::SVGImage::dataChanged):
2578         * testing/InternalSettings.cpp:
2579         (WebCore::InternalSettings::Backup::Backup):
2580         (WebCore::InternalSettings::Backup::restoreTo):
2581         (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
2582         * testing/InternalSettings.h:
2583         * testing/InternalSettings.idl:
2584
2585 2019-07-15  Chris Dumez  <cdumez@apple.com>
2586
2587         Crash under DisplayRefreshMonitorManager::displayWasUpdated()
2588         https://bugs.webkit.org/show_bug.cgi?id=199808
2589         <rdar://problem/53070144>
2590
2591         Reviewed by Geoffrey Garen.
2592
2593         Copy m_monitors before iterating over it because the calling displayLinkFired() on the
2594         monitor may end up calling DisplayRefreshMonitorManager::displayDidRefresh() synchronously,
2595         which removes the monitor from m_monitors.
2596
2597         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2598         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2599
2600 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
2601
2602         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
2603         https://bugs.webkit.org/show_bug.cgi?id=199783
2604
2605         Reviewed by Mark Lam.
2606
2607         Remove WebAssemblyPrototype.
2608
2609         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
2610                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
2611                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
2612                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
2613                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
2614                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
2615                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
2616                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
2617                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
2618                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
2619                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
2620                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
2621                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
2622                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
2623                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
2624                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
2625                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
2626                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
2627                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
2628                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
2629                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
2630                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
2631                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
2632                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
2633                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
2634                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
2635                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
2636                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
2637                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
2638                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
2639                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
2640                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
2641                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
2642                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
2643                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
2644                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
2645                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
2646                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
2647                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
2648                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
2649                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
2650                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
2651                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
2652                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
2653                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
2654                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
2655                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
2656                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
2657
2658         * bindings/js/JSDOMWindowBase.cpp:
2659         (WebCore::JSDOMWindowBase::compileStreaming):
2660         (WebCore::JSDOMWindowBase::instantiateStreaming):
2661
2662 2019-07-15  Dean Jackson  <dino@apple.com>
2663
2664         [WebGL] Remove software rendering and simplify context creation on macOS
2665         https://bugs.webkit.org/show_bug.cgi?id=199789
2666
2667         Reviewed by Sam Weinig.
2668
2669         We don't ever want to fall-back to the software renderer. We'd be better
2670         off failing to create the context completely.
2671
2672         Also, the number of fall-back attempts we were making before hitting
2673         the software renderer was overkill. All hardware we support should
2674         handle a 32bpp buffer.
2675
2676         Lastly, we don't want to support supersampling - multisampling only.
2677
2678         I lied… there is one more thing - failing to create the context
2679         was causing an ASSERT trying to remove the GC3D from the global list.
2680
2681         * html/canvas/WebGLRenderingContextBase.cpp:
2682         (WebCore::WebGLRenderingContextBase::create):
2683         * page/Settings.yaml: Remove forceSoftwareWebGL setting.
2684         * platform/graphics/GraphicsContext3DAttributes.h:
2685         * platform/graphics/GraphicsContext3DManager.cpp:
2686         (WebCore::GraphicsContext3DManager::addContext):
2687         (WebCore::GraphicsContext3DManager::removeContext):
2688         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
2689         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2690         (WebCore::GraphicsContext3D::GraphicsContext3D):
2691         (WebCore::setPixelFormat): Deleted.
2692
2693 2019-07-14  Dean Jackson  <dino@apple.com>
2694
2695         Move more WebGL things into unified builds
2696         https://bugs.webkit.org/show_bug.cgi?id=199787
2697
2698         Reviewed by Wenson Hsieh.
2699
2700         Unify as many WebGL files as possible.
2701
2702         * Sources.txt:
2703         * WebCore.xcodeproj/project.pbxproj:
2704         * html/canvas/WebGLFramebuffer.cpp:
2705         * html/canvas/WebGLObject.h: Move a helper function into an inline.
2706         (WebCore::objectOrZero):
2707         * html/canvas/WebGLRenderingContextBase.cpp:
2708         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2709         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2710
2711 2019-07-15  Keith Rollin  <krollin@apple.com>
2712
2713         Add missing webgpu includes
2714         https://bugs.webkit.org/show_bug.cgi?id=199802
2715         <rdar://problem/53119120>
2716
2717         Reviewed by Myles C. Maxfield.
2718
2719         WHLSLFunctionWriter.cpp fails to compile on tvOS and watchOS due to
2720         missing includes. This file likely compiles on other platforms due to
2721         the Unified Sources facility that clumps several implementation files
2722         together, exposing those implementation files to the others' includes.
2723         It fails on tvOS and watchOS due to the different ways these
2724         implementation files can get clumped together on different platforms.
2725
2726         No new tests as there is no functional change.
2727
2728         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2729
2730 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2731
2732         Unreviewed, rolling out r247440.
2733
2734         Broke builds
2735
2736         Reverted changeset:
2737
2738         "[JSC] Improve wasm wpt test results by fixing miscellaneous
2739         issues"
2740         https://bugs.webkit.org/show_bug.cgi?id=199783
2741         https://trac.webkit.org/changeset/247440
2742
2743 2019-07-15  Daniel Bates  <dabates@apple.com>
2744
2745         Typing into a cell in a Google Sheet lags behind by one character
2746         https://bugs.webkit.org/show_bug.cgi?id=199587
2747         <rdar://problem/51616845>
2748
2749         Reviewed by Brent Fulgham.
2750
2751         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
2752         into a holding tank. The timers continue to tick, but are barred from executing their action until
2753         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
2754         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
2755         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
2756         of the document.
2757
2758         The story behind the quirk:
2759
2760         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
2761         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
2762         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
2763         event. It could happen in the same event loop iteration as the key press (as Google expects), the
2764         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
2765         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
2766         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
2767         functionality was available via onpropertychange in IE < 9).
2768
2769         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
2770         this quirk.
2771
2772         Test: fast/events/ios/dom-update-on-keydown-quirk.html
2773
2774         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
2775
2776         * SourcesCocoa.txt:
2777         * WebCore.xcodeproj/project.pbxproj:
2778         Add some files to the project.
2779
2780         * dom/Document.cpp:
2781         (WebCore::Document::domTimerHoldingTank): Added.
2782         * dom/Document.h:
2783         (WebCore::Document::domTimerHoldingTankIfExists): Added.
2784
2785         * page/DOMTimer.cpp:
2786         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
2787         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
2788         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
2789         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
2790         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
2791         we do not suspend timers in the holding tank is because:
2792             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
2793             Though smart supension logic could avoid this. See (3).
2794
2795             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
2796             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
2797             So, the timers in the holding tank are short-lived.
2798
2799             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
2800             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
2801             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
2802         * page/EventHandler.cpp:
2803         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
2804         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
2805         * page/Quirks.cpp:
2806         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
2807         * page/Quirks.h:
2808         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
2809         also lets us enable the quirk for all sites or for certain third-party apps if desired.
2810         * page/ios/DOMTimerHoldingTank.cpp: Added.
2811         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
2812         (WebCore::DOMTimerHoldingTank::add):
2813         (WebCore::DOMTimerHoldingTank::remove):
2814         (WebCore::DOMTimerHoldingTank::contains):
2815         (WebCore::DOMTimerHoldingTank::removeAll):
2816         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
2817         * page/ios/DOMTimerHoldingTank.h: Added.
2818         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
2819         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
2820         (WebCore::DeferDOMTimersForScope::isDeferring):
2821
2822 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
2823
2824         Unreviewed, rolling out r247397, r247378, r247366.
2825
2826         Broke watchOS builds.
2827
2828         Reverted changesets:
2829
2830         "[WebGPU] Implement GPUError and error scopes"
2831         https://bugs.webkit.org/show_bug.cgi?id=199655
2832         https://trac.webkit.org/changeset/247366/webkit
2833
2834         "[WebGPU] Move error scopes out of GPUDevice for more portable error generation"
2835         https://bugs.webkit.org/show_bug.cgi?id=199740
2836         https://trac.webkit.org/changeset/247397/webkit
2837
2838 2019-07-15  Rob Buis  <rbuis@igalia.com>
2839
2840         MathML WPT test for RadicalDegreeBottomRaisePercent fails
2841         https://bugs.webkit.org/show_bug.cgi?id=183631
2842
2843         Reviewed by Frédéric Wang.
2844
2845         When stretching the radical operator also take thickness
2846         and radical gap into account:
2847         https://mathml-refresh.github.io/mathml-core/#radicals-msqrt-mroot
2848
2849         Test: imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html
2850
2851         * rendering/mathml/RenderMathMLRoot.cpp:
2852         (WebCore::RenderMathMLRoot::layoutBlock):
2853
2854 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
2855
2856         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
2857         https://bugs.webkit.org/show_bug.cgi?id=199783
2858
2859         Reviewed by Mark Lam.
2860
2861         Remove WebAssemblyPrototype.
2862
2863         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
2864                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
2865                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
2866                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
2867                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
2868                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
2869                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
2870                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
2871                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
2872                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
2873                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
2874                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
2875                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
2876                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
2877                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
2878                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
2879                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
2880                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
2881                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
2882                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
2883                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
2884                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
2885                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
2886                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
2887                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
2888                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
2889                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
2890                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
2891                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
2892                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
2893                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
2894                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
2895                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
2896                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
2897                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
2898                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
2899                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
2900                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
2901                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
2902                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
2903                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
2904                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
2905                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
2906                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
2907                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
2908                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
2909                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
2910                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
2911
2912         * bindings/js/JSDOMWindowBase.cpp:
2913         (WebCore::JSDOMWindowBase::compileStreaming):
2914         (WebCore::JSDOMWindowBase::instantiateStreaming):
2915
2916 2019-07-15  Youenn Fablet  <youenn@apple.com>
2917
2918         Enable a debug WebRTC mode without any encryption
2919         https://bugs.webkit.org/show_bug.cgi?id=199177
2920         <rdar://problem/52074986>
2921
2922         Reviewed by Eric Carlson.
2923
2924         For every RTCPeerConnection, first set whether to use encryption or not
2925         based on page settings.
2926         If encryption is disabled, log it.
2927         Add internals API to toggle the switch from tests.
2928         Test: webrtc/disable-encryption.html
2929
2930         * Modules/mediastream/RTCPeerConnection.cpp:
2931         (WebCore::RTCPeerConnection::RTCPeerConnection):
2932         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2933         (WebCore::createLibWebRTCPeerConnectionBackend):
2934         * inspector/agents/InspectorPageAgent.cpp:
2935         * page/Settings.yaml:
2936         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2937         (WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
2938         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2939         * testing/Internals.cpp:
2940         (WebCore::Internals::resetToConsistentState):
2941         (WebCore::Internals::setEnableWebRTCEncryption):
2942         * testing/Internals.h:
2943         * testing/Internals.idl:
2944
2945 2019-07-15  Sihui Liu  <sihui_liu@apple.com>
2946
2947         window.openDatabase is not writable
2948         https://bugs.webkit.org/show_bug.cgi?id=199737
2949         <rdar://problem/52551332>
2950
2951         Reviewed by Chris Dumez.
2952
2953         In r246707 we made openDatabase an undetectable attribute of window, and it was set to be read-only. This broke 
2954         some sites which replace window.openDatabase with their own implementation when window.openDatabase does not 
2955         exists or WebSQL is not implemented. 
2956
2957         This patch removes the readonly property and adds a setter for openDatabase.
2958
2959         * Modules/webdatabase/DOMWindowWebDatabase.idl:
2960         * bindings/js/JSDOMWindowCustom.cpp:
2961         (WebCore::JSDOMWindow::setOpenDatabase):
2962
2963 2019-07-15  Youenn Fablet  <youenn@apple.com>
2964
2965         Filter SDP c lines
2966         https://bugs.webkit.org/show_bug.cgi?id=199791
2967
2968         Reviewed by Eric Carlson.
2969
2970         As discussed in https://github.com/rtcweb-wg/mdns-ice-candidates/issues/91,
2971         use 0.0.0.0 for c lines when filtering the SDP.
2972         Covered by updated test.
2973
2974         * Modules/mediastream/PeerConnectionBackend.cpp:
2975         (WebCore::PeerConnectionBackend::filterSDP const):
2976
2977 2019-07-15  Zalan Bujtas  <zalan@apple.com>
2978
2979         naver.com: Video stops when tapping on the video to use buttons
2980         https://bugs.webkit.org/show_bug.cgi?id=199784
2981         <rdar://problem/48068610>
2982
2983         Reviewed by Maciej Stachowiak.
2984
2985         Opt out of simulated mouse event sending for tv.naver.com.
2986         When tv.naver.com receives the simulated mouseUp at touchEnd, it pauses the video right away and calls preventDefault()
2987         which prevents us from running the hover heuristics.
2988
2989         * page/Quirks.cpp:
2990         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2991
2992 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2993
2994         [GTK] GitHub breaks on FreeBSD because of "unsupported browser"
2995         https://bugs.webkit.org/show_bug.cgi?id=199745
2996
2997         Reviewed by Carlos Garcia Campos.
2998
2999         It's been a while since I last updated the fake version numbers in our user agent, both for
3000         the user agent quirks for naughty websites and also the Safari version in our standard user
3001         agent. Update them. This should fix github.com on FreeBSD at least. I also noticed some
3002         wonkiness on Google Docs recently that I thought required this update, but I didn't do
3003         anything about it at the time because I wasn't able to reproduce the issue when I tried
3004         again later.
3005
3006         This could absolutely break websites, because the web is awful, but that's calculated risk.
3007
3008         * platform/UserAgentQuirks.cpp:
3009         (WebCore::UserAgentQuirks::stringForQuirk):
3010         * platform/glib/UserAgentGLib.cpp:
3011         (WebCore::buildUserAgentString):
3012
3013 2019-07-14  Chris Dumez  <cdumez@apple.com>
3014
3015         Add threading assertion to WeakPtrFactory::createWeakPtr()
3016         https://bugs.webkit.org/show_bug.cgi?id=199639
3017
3018         Reviewed by Ryosuke Niwa.
3019
3020         * platform/ScrollableArea.cpp:
3021         * rendering/RenderObject.cpp:
3022
3023 2019-07-14  Dean Jackson  <dino@apple.com>
3024
3025         WebGL not supported on WKWebView on UIKit for Mac
3026         https://bugs.webkit.org/show_bug.cgi?id=199785
3027         <rdar://problem/52911449>
3028
3029         Reviewed by Antoine Quint.
3030
3031         UIKit for Mac was not creating a CGLPixelFormatObj because
3032         it wasn't using the code hidden in PLATFORM(MAC). Instead
3033         we should be guarding for USE(OPENGL).
3034
3035         There are still some inconsistencies: <rdar://53062794>
3036
3037         Test: webgl/smell-test.html
3038
3039         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3040         (WebCore::GraphicsContext3D::GraphicsContext3D):
3041         (WebCore::GraphicsContext3D::allowOfflineRenderers const): We have to return
3042         true for this, since we don't have access to the Window Server.
3043
3044 2019-07-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3045
3046         [Text autosizing] [iPadOS] Further adjust our heuristics to determine text autosizing candidates
3047         https://bugs.webkit.org/show_bug.cgi?id=199780
3048         <rdar://problem/52289088>
3049
3050         Reviewed by Simon Fraser.
3051
3052         Our current idempotent text autosizing candidate heuristic makes the right judgment call most of the time, but
3053         there is still a large batch of text autosizing bugs left unfixed by the first iteration of the heuristic added
3054         in r246781. This patch attempts to address most of these bugs by adjusting the decision-tree-based heuristic
3055         once again, mostly with improvements to the model generation pipeline.
3056
3057         During the first iteration, I placed emphasis on tuning the max tree depth and min leaf size hyperparameters
3058         when coming up with my decision tree, and didn't consider the inclusion or exclusion of each feature as a
3059         hyperparameters. As such, the trees generated using the pipeline tended to use too many features, and as a
3060         result, tended to have cross-validation overall accuracy scores hovering around 73%.
3061
3062         In this revised model generation pipeline, I now consider the inclusion of each feature (along with max depth
3063         and min leaf size, as before) as a hyperparameter. Since this increases the number of hyperparameters by many
3064         orders of magnitude, a naive grid search (as described in the prior ChangeLog entry) is no longer a tractible
3065         procedure for tuning hyperparameters to the training algorithm.
3066
3067         Instead, I now use a stochastic greedy algorithm to search for good sets of hyperparameters; this process begins
3068         with seeding some number (usually 20-24) of "searchers" with completely randomized sets of hyperparameters (i.e.
3069         random max depth, random leaf size, and random subsets of features). I then evaluate the average performance of
3070         each set of hyperparameters by using them to generate 2000 decision trees over 90% of the training data, and
3071         then cross-validating these trees against the remaining 10%. These cross-validation scores are aggregated into a
3072         single confusion matrix, which is then passed into a loss function that computes a single value indicating how
3073         well training with the set of hyperparameters generalized to cross-validation data. After experimenting with
3074         various loss functions, I settled on the following:
3075
3076         `k(false positive rate)^2 + (false negative rate)^2`
3077
3078         ...where a constant k is chosen to penalize false positives (i.e. broken layout) more harshly than false
3079         negatives (small text). Additionally, squaring the false negative and false positive rates seems to help avoid
3080         converging on solutions that heavily favor reducing only false positives or false negatives, or vice versa.
3081
3082         The stochastic algorithm starts by computing a loss value for the randomly generated configuration. Then, for
3083         an indefinite number of iterations, it randomly mutates the configuration (e.g. by adding or removing features,
3084         or changing min leaf size or max tree depth) and computes a new loss value for the mutated configuration. If the
3085         mutated configuration performs better (i.e. achieves lower loss) than the current configuration, I set the
3086         current configuration to be the mutated configuration. Otherwise, I keep the current (non-mutated) configuration
3087         as-is. The stochastic algorithm then proceeds, ad-infinitum, with this current configuration.
3088
3089         Of course, since each mutation is small, this strategy so far is prone to leaving each searcher stuck in local
3090         optima. To mitigate this, for each searcher, I keep track of a side-table of configurations that have already
3091         been tested; when random mutations would normally lead to testing a configuration that has already been tested,
3092         each searcher instead increases the chance of applying additional mutations. This has the effect of searchers
3093         initially exhausting similar configurations, and expanding to test more and more dissimilar configurations as
3094         the local alternatives all turn out to be worse. This allows searchers to effectively jump out of local optima
3095         after being stuck for a long time.
3096
3097         So, using these strategies, I simultaneously ran a handful of searchers until they all appeared to converge
3098         (a process that takes 8-12 hours on my current dataset). Many of the searchers achieved configurations with
3099         cross-validation scores of 81% and above, up from the 73% of the previous attempt. These additionally have the
3100         added bonus of reducing the number of features, often making the final trees themselves shallower and simpler to
3101         understand than before.
3102
3103         This patch introduces one such decision tree generated using a set of hyperparameters acquired via this
3104         stochasic search algorithm; it appears to simultaneously use fewer features, and achieve better cross-validation
3105         performance.
3106
3107         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
3108
3109         * css/StyleResolver.cpp:
3110         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
3111
3112         Adjust the early return to bail if either (1) the element is a candidate and the computed size is already equal
3113         to the boosted size, or (2) the element is not a candidate and the computed size is already equal to the
3114         specified size. Since the autosizing candidate heuristic depends on styles specified on the element itself (as
3115         opposed to styles on any element in the ancestor chain), a parent may be an autosizing candidate, but a child of
3116         it may not.
3117
3118         * rendering/style/RenderStyle.cpp:
3119         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
3120
3121         Revamp the idempotent text autosizing candidate heuristic. See the explanation above for more details.
3122
3123         * rendering/style/RenderStyle.h:
3124
3125         Remove some bits from RenderStyle's autosizeStatus, now that we care about fewer bits of information from the
3126         inherited flags.
3127
3128         * rendering/style/TextSizeAdjustment.cpp:
3129         (WebCore::AutosizeStatus::updateStatus):
3130         * rendering/style/TextSizeAdjustment.h:
3131
3132 2019-07-13  Simon Fraser  <simon.fraser@apple.com>
3133
3134         Don't do async overflow scrolling for visibility:hidden scrollers
3135         https://bugs.webkit.org/show_bug.cgi?id=199779
3136
3137         Reviewed by Dean Jackson.
3138         
3139         An overflow:scroll with visibility:hidden is not scrollable on macOS, even if it has visible
3140         content. So disable async overflow:scroll when the scroller has non-visible visibility (this also
3141         takes visibility on ancestors into account).
3142         
3143         visibility:hidden overflow:scroll can be common because some JS libraries use it
3144         (https://github.com/wnr/element-resize-detector).
3145
3146         Test: compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html
3147
3148         * rendering/RenderLayer.cpp:
3149         (WebCore::RenderLayer::canUseCompositedScrolling const): Don't use hasVisibleContent() because
3150         that's affected by  visible children.
3151
3152 2019-07-13  Robin Morisset  <rmorisset@apple.com>
3153
3154         [WHLSL] Return statements don't need to keep track of the function they're in
3155         https://bugs.webkit.org/show_bug.cgi?id=199763
3156
3157         Reviewed by Myles C. Maxfield.
3158
3159         Return::m_function is only used in the Checker, and it can easily enough keep track of the current function.
3160         This means we no longer need to keep track of the current function in the NameResolver, and we can save 8 bytes per Return
3161
3162         Since I was touching the NameResolver I also removed a few pointless overrides of Visitor::visit().
3163
3164         No new tests as there is no intended functional change.
3165
3166         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
3167         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3168         (WebCore::WHLSL::Checker::visit):
3169         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
3170         (WebCore::WHLSL::NameResolver::NameResolver):
3171         (WebCore::WHLSL::resolveTypeNamesInFunctions):
3172         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
3173
3174 2019-07-13  Andres Gonzalez  <andresg_22@apple.com>
3175
3176         Add accessibility support to WKDataListSuggestionsView.
3177         https://bugs.webkit.org/show_bug.cgi?id=199772
3178         <rdar://problem/47095851>
3179
3180         Reviewed by Chris Fleizach.
3181
3182         Localizable strings for accessibility announcements.
3183
3184         * en.lproj/Localizable.strings:
3185
3186 2019-07-13  Chris Dumez  <cdumez@apple.com>
3187
3188         Drop non thread-safe usage of WeakPtr in VideoFullscreenInterfaceAVKit
3189         https://bugs.webkit.org/show_bug.cgi?id=199775
3190
3191         Reviewed by Eric Carlson.
3192
3193         The VideoFullscreenInterfaceAVKit constructor was making a weakPtr on the UI Thread
3194         of an WebThread object. The WeakPtr would then be used as a data member throughout
3195         the class on the UIThread. This is not thread-safe.
3196
3197         This patch switches to using a raw pointer instead of a WeakPtr. This is a partial
3198         rollout of r243298, which turned the raw pointer into a WeakPtr for hardening
3199         purposes. For extra safety, this patch updates the VideoFullscreenControllerContext
3200         so that it notifies its clients (i.e. PlaybackSessionInterfaceAVKit) that it is
3201         getting destroyed, so that they can null-out their m_videoFullscreenModel &
3202         m_fullscreenChangeObserver data members. This gives the sames guarantees as WeakPtr
3203         but in a thread-safe way.
3204
3205         This is very similar to the fix that was done for PlaybackSessionInterfaceAVKit in
3206         r247380.
3207
3208         * platform/cocoa/VideoFullscreenModel.h:
3209         (WebCore::VideoFullscreenModelClient::modelDestroyed):
3210         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3211         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3212         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
3213         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
3214         (VideoFullscreenInterfaceAVKit::modelDestroyed):
3215         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3216         (VideoFullscreenControllerContext::~VideoFullscreenControllerContext):
3217
3218 2019-07-13  Zalan Bujtas  <zalan@apple.com>
3219
3220         Cannot bring up custom media controls at all on v.youku.com
3221         https://bugs.webkit.org/show_bug.cgi?id=199699
3222         <rdar://problem/51835327>
3223
3224         Reviewed by Simon Fraser.
3225
3226         The "find the node under the finger" heuristic should only find nodes that are visible to hit-testing.
3227
3228         When the user taps on the screen, we run a "find the best node under the finger" heuristic and use the node's location
3229         to dispatch the associated event (e.g. mousePressed).
3230         Ideally the "best node under the finger" and the final target node for the associated event are the same.
3231         However these two methods configure the hit-testing process differently which could lead to node mismatch.
3232         The "best node" heuristic calls hit-testing with AllowChildFrameContent. This flag allows hit-testing to descend into
3233         subframes even if the subframe is not visible to hit-testing (visibility: hidden).
3234         While event dispatching never descends into subfames through hit-testing, but instead it forwards the dispatching to subframes that are visible to hit-testing.
3235
3236         This patch addresses the mismatching node issue by calling the descending version of hit-testing with a flag that enforces visiblity check before descending into a subframe.
3237
3238         Tests: fast/events/touch/ios/visibility-hidden-iframe-click.html
3239                fast/events/touch/ios/visibility-hidden-nested-iframe-click.html
3240
3241         * page/ios/FrameIOS.mm:
3242         (WebCore::Frame::hitTestResultAtViewportLocation):
3243         * rendering/HitTestRequest.h:
3244         (WebCore::HitTestRequest::skipsChildFrameContentInvisibleToHitTest const):
3245         * rendering/RenderWidget.cpp:
3246         (WebCore::RenderWidget::nodeAtPoint):
3247
3248 2019-07-13  Chris Dumez  <cdumez@apple.com>
3249
3250         Fix non thread-safe usage of makeWeakPtr() in MediaPlayerPrivateAVFoundation
3251         https://bugs.webkit.org/show_bug.cgi?id=199777
3252
3253         Reviewed by Eric Carlson.
3254
3255         The code was calling makeWeakPtr() on a main-thread object, from a background thread.
3256         This is not thread safe. To address the issue, this patches creates the WeakPtr ahead
3257         of time, on the main thread.
3258
3259         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3260         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
3261         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
3262         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
3263         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3264
3265 2019-07-12  Thibault Saunier  <tsaunier@igalia.com>
3266
3267         [GStreamer] Mock GStreamer realtime sources should keep a Ref of their mock realtime media sources
3268         https://bugs.webkit.org/show_bug.cgi?id=194326
3269
3270         WrappedMockRealtimeVideoSource is a subclass of RealtimeMediaSource which is refcounted, we can't
3271         use a unique_ptr on those.
3272
3273         Also changed m_wrappedSource type to its actual type so it is cleaner even if needed
3274         to upcast it to RealtimeMediaSource so some method that are made private in the mock
3275         can still be called.
3276
3277         Reviewed by Youenn Fablet.
3278
3279         This fixes MediaStream tests
3280
3281         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
3282         (WebCore::WrappedMockRealtimeAudioSource::create):
3283         (WebCore::WrappedMockRealtimeAudioSource::asRealtimeMediaSource):
3284         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource):
3285         (WebCore::m_wrappedSource):
3286         (WebCore::MockGStreamerAudioCaptureSource::startProducingData):
3287         (WebCore::MockGStreamerAudioCaptureSource::settings):
3288         (WebCore::MockGStreamerAudioCaptureSource::capabilities):
3289         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
3290         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
3291         (WebCore::WrappedMockRealtimeVideoSource::create):
3292         (WebCore::WrappedMockRealtimeVideoSource::asRealtimeMediaSource):
3293         (WebCore::WrappedMockRealtimeVideoSource::WrappedMockRealtimeVideoSource):
3294         (WebCore::m_wrappedSource):
3295         (WebCore::MockGStreamerVideoCaptureSource::settings):
3296         (WebCore::MockGStreamerVideoCaptureSource::capabilities):
3297         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
3298
3299 2019-07-12  Alex Christensen  <achristensen@webkit.org>
3300
3301         Change RELEASE_ASSERT in DocumentWriter::addData to ASSERT and early return
3302         https://bugs.webkit.org/show_bug.cgi?id=199756
3303         <rdar://problem/51554775>
3304
3305         Reviewed by Brady Eidson.
3306
3307         Attempts to reach this assertion were unsuccessful, but sometimes this assertion crashes.
3308         Let's change it to an early return to prevent crashes.
3309
3310         * loader/DocumentWriter.cpp:
3311         (WebCore::DocumentWriter::addData):
3312
3313 2019-07-12  Justin Fan  <justin_fan@apple.com>
3314
3315         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
3316         https://bugs.webkit.org/show_bug.cgi?id=199740
3317
3318         Reviewed by Myles C. Maxfield.
3319
3320         Move error generation into a separate RefCounted class to allow GPU objects to generate 
3321         errors independent of any GPUDevice.
3322         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
3323
3324         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
3325
3326         * Modules/webgpu/WebGPUDevice.cpp:
3327         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
3328         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
3329         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
3330         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
3331         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
3332         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
3333         * Modules/webgpu/WebGPUDevice.h:
3334         (WebCore::WebGPUDevice::pushErrorScope):
3335         * Sources.txt:
3336         * WebCore.xcodeproj/project.pbxproj:
3337         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
3338         * platform/graphics/gpu/GPUDevice.cpp:
3339         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
3340         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
3341         (WebCore::GPUDevice::popErrorScope): Deleted.
3342         (WebCore::GPUDevice::registerError): Deleted.
3343         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
3344         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
3345         (WebCore::GPUErrorGenerator::pushErrorScope):
3346         (WebCore::GPUErrorGenerator::popErrorScope):
3347         (WebCore::GPUErrorGenerator::generateError):
3348         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
3349         (WebCore::GPUErrorGenerator::create):
3350         * platform/graphics/gpu/GPUObjectBase.h: Added.
3351         (WebCore::GPUObjectBase::generateError):
3352         (WebCore::GPUObjectBase::GPUObjectBase):
3353         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
3354         (WebCore::GPUBuffer::validateBufferUsage):
3355         (WebCore::GPUBuffer::tryCreate):
3356         (WebCore::GPUBuffer::GPUBuffer):
3357         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
3358         (WebCore::GPUQueue::submit): Prevent possible null dereference.
3359
3360 2019-07-12  Youenn Fablet  <youenn@apple.com>
3361
3362         Add release logging for quota checks
3363         https://bugs.webkit.org/show_bug.cgi?id=199697