Improve coordination for creating UIWindow instances.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-05-06  James Savage  <james.savage@apple.com>
2
3         Improve coordination for creating UIWindow instances.
4         https://bugs.webkit.org/show_bug.cgi?id=197578.
5         <rdar://problem/50456965>.
6
7         Reviewed by Wenson Hsieh.
8
9         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
10         (makeWindowFromView): Pull out window creation.
11         (VideoFullscreenInterfaceAVKit::doSetup): Call new helper function.
12
13 2019-05-06  Tim Horton  <timothy_horton@apple.com>
14
15         _overrideViewportWithArguments does not work when called before loading
16         https://bugs.webkit.org/show_bug.cgi?id=197638
17         <rdar://problem/50505111>
18
19         Reviewed by Wenson Hsieh.
20
21         * dom/Document.cpp:
22         (WebCore::Document::viewportArguments const):
23         (WebCore::Document::updateViewportArguments):
24         (WebCore::Document::setOverrideViewportArguments): Deleted.
25         * dom/Document.h:
26         (WebCore::Document::viewportArguments const): Deleted.
27         * page/Page.cpp:
28         (WebCore::Page::setOverrideViewportArguments):
29         * page/Page.h:
30         (WebCore::Page::overrideViewportArguments const):
31         * page/ViewportConfiguration.cpp:
32         (WebCore::ViewportConfiguration::setViewportArguments):
33         Move overrideViewportArguments to Page, since it is view-global in the API.
34
35 2019-05-06  Chris Dumez  <cdumez@apple.com>
36
37         Add assertions to JSLazyEventListener to help catch the cause of a crash
38         https://bugs.webkit.org/show_bug.cgi?id=197617
39
40         Reviewed by Alexey Proskuryakov.
41
42         Add assertions to JSLazyEventListener to help catch the cause of <rdar://problem/24314027>.
43
44         * bindings/js/JSLazyEventListener.cpp:
45         (WebCore::JSLazyEventListener::checkValidityForEventTarget):
46         * bindings/js/JSLazyEventListener.h:
47         * dom/EventListener.h:
48         (WebCore::EventListener::checkValidityForEventTarget):
49         * dom/EventTarget.cpp:
50         (WebCore::EventTarget::addEventListener):
51         (WebCore::EventTarget::setAttributeEventListener):
52         (WebCore::EventTarget::innerInvokeEventListeners):
53
54 2019-05-04  Per Arne Vollan  <pvollan@apple.com>
55
56         -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
57         https://bugs.webkit.org/show_bug.cgi?id=197510
58         <rdar://problem/50372338>
59
60         Reviewed by Alex Christensen.
61
62         This patch implements deletion of non persistent credentials for a set of origins. In order for this to work, fetching
63         credentials from the credential storage needs to return a set of SecurityOriginData objects, instead of a set of origin
64         strings. This is implemented by iterating over all the elements in the credential map, and creating a SecurityOriginData
65         object for each credential based on the protection space.
66
67         API test: WKWebsiteDataStore.RemoveNonPersistentCredentials
68
69         * platform/network/CredentialStorage.cpp:
70         (WebCore::CredentialStorage::removeCredentialsWithOrigin):
71         (WebCore::CredentialStorage::originsWithCredentials const):
72         * platform/network/CredentialStorage.h:
73         (WebCore::CredentialStorage::originsWithCredentials const): Deleted.
74
75 2019-05-06  Keith Rollin  <krollin@apple.com>
76
77         Temporarily disable generate-xcfilelists
78         https://bugs.webkit.org/show_bug.cgi?id=197619
79         <rdar://problem/50507392>
80
81         Reviewed by Alex Christensen.
82
83         We need to perform a significant update to the generate-xcfilelist
84         scripts. This work involves coordinated work with another facility. If
85         the work does not occur in tandem, the build will be broken. To avoid
86         this, disable the invoking of the scripts during the transition. The
87         checking will be restored once the new scripts are in place.
88
89         No new tests -- no change in user-visible functionality.
90
91         * Scripts/check-xcfilelists.sh:
92
93 2019-05-06  Andres Gonzalez  <andresg_22@apple.com>
94
95         Hitpoint for link which spans two lines in web content is incorrect
96         https://bugs.webkit.org/show_bug.cgi?id=197511
97         <rdar://problem/49971483>
98
99         Reviewed by Chris Fleizach.
100
101         - Special case for links to return first char location as clickPoint instead of middle point of bounding rect.
102         - Modified iOS ActivationPoint to use clickPoint. This way all code paths go through the same function.
103         - Made boundsForRects to return content coordinates in all platforms. Adjusted all callers, directly or indirectly, appropriately.
104
105         Tests: accessibility/ios-simulator/links-activation.html
106                accessibility/links-activation.html
107
108         * accessibility/AccessibilityRenderObject.cpp:
109         (WebCore::AccessibilityRenderObject::clickPoint):
110         (WebCore::AccessibilityRenderObject::boundsForRects):
111         (WebCore::AccessibilityRenderObject::boundsForRects const): Deleted.
112         * accessibility/AccessibilityRenderObject.h:
113         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
114         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
115         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
116         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
117
118 2019-05-06  Jer Noble  <jer.noble@apple.com>
119
120         Adopt AVStreamDataParser.audiovisualMIMETypes
121         https://bugs.webkit.org/show_bug.cgi?id=197581
122         <rdar://problem/50458981>
123
124         Reviewed by Eric Carlson.
125
126         Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise
127         AVAssetMIMETypeCache.  Update all the old AVFoundationMIMETypeCache with the new name.
128
129         * SourcesCocoa.txt:
130         * WebCore.xcodeproj/project.pbxproj:
131         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h.
132         (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback):
133         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm.
134         (WebCore::AVAssetMIMETypeCache::singleton):
135         (WebCore::AVAssetMIMETypeCache::setSupportedTypes):
136         (WebCore::AVAssetMIMETypeCache::types):
137         (WebCore::AVAssetMIMETypeCache::supportsContentType):
138         (WebCore::AVAssetMIMETypeCache::canDecodeType):
139         (WebCore::AVAssetMIMETypeCache::isAvailable const):
140         (WebCore::AVAssetMIMETypeCache::loadMIMETypes):
141         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added.
142         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added.
143         (WebCore::AVStreamDataParserMIMETypeCache::singleton):
144         (WebCore::AVStreamDataParserMIMETypeCache::types):
145         (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType):
146         (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType):
147         (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
148         (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes):
149         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
150         (WebCore::ImageDecoderAVFObjC::create):
151         (WebCore::ImageDecoderAVFObjC::supportsMediaType):
152         (WebCore::ImageDecoderAVFObjC::supportsContentType):
153         (WebCore::ImageDecoderAVFObjC::canDecodeType):
154         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
155         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
156         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
157         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
158         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
159         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
160         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
161         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
162         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
163
164 2019-05-06  Youenn Fablet  <youenn@apple.com>
165
166         WebAudio Node JS wrappers should not be collected if events can be fired
167         https://bugs.webkit.org/show_bug.cgi?id=197533
168
169         Reviewed by Jer Noble.
170
171         Before the patch, some web audio nodes could fire event listeners, but were not protected from GC.
172         Use CustomIsReachable to ensure theses nodes can be collected if:
173         - their AudioContext is stopped (typically due to document being navigated away).
174         - their AudioContext is closed.
175         - nodes do not have event listeners.
176
177         Covered by WPT mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html and
178         WPT webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html
179         and web audio WebRTC tests.
180         Specific newly added test: webaudio/webaudio-gc.html
181
182         * Modules/webaudio/AudioContext.h:
183         (WebCore::AudioContext::isClosed const):
184         * Modules/webaudio/AudioNode.idl:
185         * Sources.txt:
186         * WebCore.xcodeproj/project.pbxproj:
187         * bindings/js/JSAudioNodeCustom.cpp: Added.
188         (WebCore::JSAudioNodeOwner::isReachableFromOpaqueRoots):
189
190 2019-05-06  Daniel Bates  <dabates@apple.com>
191
192         Google Docs & Yahoo! Japan: Can’t compose characters with Chinese or Japanese keyboard
193         https://bugs.webkit.org/show_bug.cgi?id=197474
194         <rdar://problem/47219324>
195
196         Reviewed by Ryosuke Niwa.
197
198         Fix up some #if defs to compile more Mac code when building on iOS.
199
200         * dom/KeyboardEvent.cpp:
201         (WebCore::KeyboardEvent::KeyboardEvent):
202         * platform/PlatformKeyboardEvent.h:
203         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
204
205 2019-05-06  Chris Dumez  <cdumez@apple.com>
206
207         Add assertions to CachedFrame to help figure out crash in CachedFrame constructor
208         https://bugs.webkit.org/show_bug.cgi?id=197621
209
210         Reviewed by Geoffrey Garen.
211
212         Add release assertions to try and figure out who is sometimes detaching the document from its
213         frame while constructing CachedFrames for its descendants.
214
215         * dom/Document.cpp:
216         (WebCore::Document::detachFromFrame):
217         * dom/Document.h:
218         (WebCore::Document::setMayBeDetachedFromFrame):
219         * history/CachedFrame.cpp:
220         (WebCore::CachedFrame::CachedFrame):
221
222 2019-05-06  Zan Dobersek  <zdobersek@igalia.com>
223
224         [GLib] WebCore::MainThreadSharedTimer should use the appropriate GSource priority, name
225         https://bugs.webkit.org/show_bug.cgi?id=197606
226
227         Reviewed by Carlos Garcia Campos.
228
229         * platform/MainThreadSharedTimer.cpp:
230         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
231         Use the MainThreadSharedTimer GLib priority for this timer. The name is
232         also adjusted accordingly.
233
234 2019-05-05  Wenson Hsieh  <wenson_hsieh@apple.com>
235
236         fast/attachment/attachment-folder-icon.html is an Image Only failure on recent macOS builds
237         https://bugs.webkit.org/show_bug.cgi?id=197593
238         <rdar://problem/50379267>
239
240         Reviewed by Tim Horton.
241
242         On recent versions of macOS, -[NSWorkspace iconForFileType:] returns the generic document icon for
243         "public.directory". Instead of using this UTI to generate attachment icons for "multipart/x-folder" and
244         "application/vnd.apple.folder", we should instead be using "public.folder", which has a folder icon. This fixes
245         the existing test fast/attachment/attachment-folder-icon.html, which currently results in an image diff on these
246         builds of macOS.
247
248         * rendering/RenderThemeMac.mm:
249         (WebCore::iconForAttachment):
250
251 2019-05-04  Alex Christensen  <achristensen@webkit.org>
252
253         Revert r244953 and r244954 because they broke internal builds.
254         https://bugs.webkit.org/show_bug.cgi?id=197534
255
256         * platform/ios/PlatformPasteboardIOS.mm:
257         (WebCore::PlatformPasteboard::changeCount const):
258         (WebCore::PlatformPasteboard::write):
259
260 2019-05-04  Alex Christensen  <achristensen@webkit.org>
261
262         Merge the three UIKitSPI.h files into a single one in PAL
263         https://bugs.webkit.org/show_bug.cgi?id=197534
264
265         Reviewed by Darin Adler.
266
267         * platform/ios/PlatformPasteboardIOS.mm:
268         (WebCore::PlatformPasteboard::changeCount const):
269         (WebCore::PlatformPasteboard::write):
270
271 2019-05-04  Youenn Fablet  <youenn@apple.com>
272
273         Convert some RealtimeOutgoingVideoSourceCocoa logging to ERROR_LOG
274         https://bugs.webkit.org/show_bug.cgi?id=197549
275
276         Reviewed by Eric Carlson.
277
278         No change of behavior.
279
280         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
281         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
282
283 2019-05-03  Simon Fraser  <simon.fraser@apple.com>
284
285         [macOS] Fix programmatic scrolling with async overflow scroll
286         https://bugs.webkit.org/show_bug.cgi?id=197590
287
288         Reviewed by Sam Weinig.
289         
290         ScrollingTreeOverflowScrollingNodeMac needs to handle RequestedScrollPosition.
291
292         Tests: scrollingcoordinator/mac/programmatic-frame-scroll.html
293                scrollingcoordinator/mac/programmatic-overflow-scroll.html
294
295         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
296         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
297
298 2019-05-03  Zalan Bujtas  <zalan@apple.com>
299
300         [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
301         https://bugs.webkit.org/show_bug.cgi?id=197573
302         <rdar://problem/48008441>
303
304         Reviewed by Wenson Hsieh.
305
306         The outlook mail view's flex column setup produces a somewhat unfortunate layout at certain viewport widths.
307         This patch addresses the issue by ensuring that we never fall into that range.
308
309         * page/Quirks.cpp:
310         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const):
311         (WebCore::Quirks::overriddenViewportLayoutWidth const):
312         * page/Quirks.h:
313
314 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
315
316         [WebAuthN] A focused document should be required
317         https://bugs.webkit.org/show_bug.cgi?id=197543
318         <rdar://problem/50430989>
319
320         Reviewed by Brent Fulgham.
321
322         This patch adds a check to see if the invoking document is focused before
323         calling into WebAuthN. This patch also removes some out-to-dated comments.
324
325         Test: http/wpt/webauthn/public-key-credential-unfocused-document.https.html
326
327         * Modules/credentialmanagement/CredentialsContainer.cpp:
328         (WebCore::CredentialsContainer::get):
329         (WebCore::CredentialsContainer::isCreate):
330         * Modules/webauthn/AuthenticatorCoordinator.cpp:
331         (WebCore::AuthenticatorCoordinator::create const):
332         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
333
334 2019-05-03  Devin Rousso  <drousso@apple.com>
335
336         Web Inspector: DOM: rename "low power" to "display composited"
337         https://bugs.webkit.org/show_bug.cgi?id=197296
338
339         Reviewed by Joseph Pecoraro.
340
341         Removed specific ChangeLog entries since it is almost entirely mechanical changes.
342
343         * inspector/agents/InspectorDOMAgent.h:
344         * inspector/agents/InspectorDOMAgent.cpp:
345
346 2019-05-03  Daniel Bates  <dabates@apple.com>
347
348         Pass KeyboardEvent by reference in more places
349         https://bugs.webkit.org/show_bug.cgi?id=197480
350
351         Reviewed by Wenson Hsieh.
352
353         * editing/Editor.cpp:
354         (WebCore::Editor::handleKeyboardEvent):
355         (WebCore::Editor::handleInputMethodKeydown):
356         * loader/EmptyClients.cpp:
357         * page/EditorClient.h:
358
359 2019-05-03  Chris Dumez  <cdumez@apple.com>
360
361         [iOS Sim Debug] ASSERTION FAILED The atomic string comes from an other thread! Layout Test imported/w3c/web-platform-tests/workers/WorkerNavigator_appName.htm is a flaky crash
362         https://bugs.webkit.org/show_bug.cgi?id=197530
363         <rdar://problem/50448285>
364
365         Reviewed by Geoffrey Garen.
366
367         The issue is that NavigatorBase::platform() was not thread safe but was called by both Navigator on
368         the main thread and WorkerNavigator on worker threads.
369
370         No new tests, covered by existing tests.
371
372         * page/Navigator.cpp:
373         (WebCore::Navigator::platform const):
374         * page/Navigator.h:
375
376         * page/NavigatorBase.cpp:
377         (WebCore::NavigatorBase::platform const):
378         * page/NavigatorBase.h:
379         Make NavigatorBase::platform() thread safe.
380
381         * platform/ios/Device.cpp:
382         (WebCore::deviceName):
383         * platform/ios/Device.h:
384         Make WebCore::deviceName() thread safe.
385
386         * platform/ios/UserAgentIOS.mm:
387         (WebCore::deviceNameForUserAgent):
388         Cache value returned by WebCore::deviceName() for performance.
389
390 2019-05-03  Chris Dumez  <cdumez@apple.com>
391
392         Use WeakPtr for JSLazyEventListener::m_originalNode for safety
393         https://bugs.webkit.org/show_bug.cgi?id=197576
394         <rdar://problem/24314027>
395
396         Reviewed by Alex Christensen.
397
398         * bindings/js/JSLazyEventListener.cpp:
399         (WebCore::JSLazyEventListener::JSLazyEventListener):
400         (WebCore::JSLazyEventListener::create):
401         * bindings/js/JSLazyEventListener.h:
402
403 2019-05-03  Eric Carlson  <eric.carlson@apple.com>
404
405         AVFoundation framework isn't always installed
406         https://bugs.webkit.org/show_bug.cgi?id=197577
407         <rdar://problem/50447841>
408
409         Reviewed by Jer Noble.
410         
411         Use PAL::isAVFoundationFrameworkAvailable() to check to see if AVFoundation is
412         installed, not PAL::AVFoundationLibrary().
413
414         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
415         (WebCore::AVFoundationMIMETypeCache::isAvailable const):
416         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
417         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
418         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
419         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
420         (WebCore::exernalDeviceDisplayNameForPlayer):
421         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
422         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
423         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
424         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
425         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
426         (WebCore::validateHEVCParameters):
427         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
428         (WebCore::AVCaptureDeviceManager::isAvailable):
429
430 2019-05-03  Sihui Liu  <sihui_liu@apple.com>
431
432         Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
433         https://bugs.webkit.org/show_bug.cgi?id=197390
434         <rdar://problem/42685773>
435
436         Reviewed by Geoffrey Garen.
437
438         We have seen crashes about accessing database files after device is locked. We are suspecting this is because 
439         shm files have wrong data protection class, but shm files should not have Complete class protection when it 
440         is created. It is likely the protection class is changed later. Add an assertion to verify our guess. If the 
441         crash signature changes after this patch, we probably need to change database implementation. If it is not, we
442         have other problem than data protection.
443
444         * platform/sql/SQLiteDatabase.cpp:
445         (WebCore::SQLiteDatabase::open):
446
447 2019-05-03  Youenn Fablet  <youenn@apple.com>
448
449         Cache.add and Cache.addAll should compute a correct response body size
450         https://bugs.webkit.org/show_bug.cgi?id=197464
451
452         Reviewed by Chris Dumez.
453
454         Compute the response body size as we do for regular Cache.put
455
456         Test: http/wpt/cache-storage/cache-quota-add.any.html
457
458         * Modules/cache/CacheStorageConnection.cpp:
459         (WebCore::CacheStorageConnection::computeRecordBodySize):
460         * Modules/cache/CacheStorageConnection.h:
461         * Modules/cache/DOMCache.cpp:
462         (WebCore::FetchTasksHandler::addResponseBody):
463         (WebCore::DOMCache::addAll):
464         Compute the response body size requires getting access to the connection.
465         'this' is added to the lambda which is fine since taskHandler keeps a
466         Ref to 'this' in its completion handler.
467         (WebCore::DOMCache::toConnectionRecord):
468         * Modules/fetch/FetchResponse.h:
469
470 2019-05-03  Tomoki Imai  <Tomoki.Imai@sony.com>
471
472         [Cairo] Improve ShadowBlur performance using tiling optimization
473         https://bugs.webkit.org/show_bug.cgi?id=197308
474         Reviewed by Žan Doberšek.
475
476         Enable tiling tiling-based optimization for drawRectShadow() and drawInsetShadow().
477         Since r228776, cairo ports doesn't have tiling-based optimization.
478
479         For AppleWin, this patch refactors code and it shares almost same code as cairo port.
480         Only the difference is that AppleWin uses ScratchBuffer, but cairo ports doesn't.
481         This should avoid a performance regression for AppleWin.
482
483         No new tests, covered by existing tests.
484
485         * platform/graphics/ShadowBlur.cpp:
486         (WebCore::calculateLobes):
487         Fix stylecheck errors
488
489         (WebCore::ShadowBlur::blurLayerImage):
490         Fix stylecheck errors
491
492         (WebCore::ShadowBlur::calculateLayerBoundingRect):
493         We don't use position of m_sourceRect, so change the type to FloatSize.
494
495         (WebCore::ShadowBlur::drawShadowBuffer):
496         Use m_layerSize instead of m_shadowedResultSize to fillRect, as m_layerSize is always smaller than m_shadowedResultSize.
497         It's because in m_layerSize is equal to m_shadowedResultSize if it's not clipped.
498         Clipping doesn't increase size of m_layerSize, so m_layerSize is always smaller than or equal to m_shadowedResultSize.
499
500         (WebCore::ShadowBlur::templateSize const):
501         Fix stylecheck errors
502
503         (WebCore::ShadowBlur::drawRectShadow):
504         (WebCore::ShadowBlur::drawInsetShadow):
505         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
506         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
507         (WebCore::ShadowBlur::drawRectShadowWithTiling):
508         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
509         Incorporate tile-based drawing.
510         To accomplish it, this patch abstracts GraphicsContext::drawImageBuffer to ShadowBlur::DrawImageCallback,
511         GraphicsContext::fillRect to ShadowBlur::FillRectCallback, drawing rect with hole to  ShadowBlur::FillRectWithHoleCallback.
512
513         Variants which takes GraphicsContext as parameter now just calls another drawRectShadow.
514
515         (WebCore::ShadowBlur::drawLayerPieces):
516         Instead of graphicsContext.drawImageBuffer, call corresponding callback.
517
518         (WebCore::ShadowBlur::drawLayerPiecesAndFillCenter):
519         This function calls drawLayerPieces and fill center for outer shadow.
520         Drawing outer shadow requires another callback for graphicsContext.fillRect.
521
522         (WebCore::ShadowBlur::drawShadowLayer):
523         Use m_layerSize instead of m_shadowedResultSize to fillRect,
524         as m_layerSize is always smaller than m_shadowedResultSize.
525
526         * platform/graphics/ShadowBlur.h:
527         Rename m_sourceRect to m_shadowedResultSize, and change it to FloatSize from FloatRect.
528         Remove GraphicsContext usage as much as possible and replace them by corresponding callbacks.
529
530         * platform/graphics/cairo/CairoOperations.cpp:
531         (WebCore::Cairo::drawShadowImage):
532         This function corresponds to ShadowBlur::DrawImageCallback.
533
534         (WebCore::Cairo::fillShadowBuffer):
535         Erase sourceRect, as it's always bigger than layerSize.
536
537         (WebCore::Cairo::drawPathShadow):
538         (WebCore::Cairo::drawGlyphsShadow):
539         Erase unused parameter.
540
541         (WebCore::Cairo::fillRect):
542         (WebCore::Cairo::fillRoundedRect):
543         (WebCore::Cairo::fillRectWithRoundedHole):
544         For tile-based optimization, add extra arguments to drawRectShadow.
545
546         (WebCore::Cairo::drawSurface):
547         Erase unused parameter.
548
549 2019-05-03  Antti Koivisto  <antti@apple.com>
550
551         Add a quirk to make youtube navigation bar scrollable without mouse hover on iOS
552         https://bugs.webkit.org/show_bug.cgi?id=197555
553         <rdar://problem/49582231>
554
555         Reviewed by Brent Fulgham.
556
557         * css/StyleResolver.cpp:
558         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
559
560         Turn 'overflow:hidden' into 'overflow:auto' on element with id="guide-inner-content".
561
562         * page/Quirks.cpp:
563         (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
564         * page/Quirks.h:
565
566 2019-05-03  Devin Rousso  <drousso@apple.com>
567
568         Web Inspector: Record actions performed on WebGL2RenderingContext
569         https://bugs.webkit.org/show_bug.cgi?id=176008
570         <rdar://problem/34213884>
571
572         Reviewed by Joseph Pecoraro.
573
574         Tests: inspector/canvas/recording-webgl2.html
575                inspector/canvas/recording-webgl2-snapshots.html
576
577         * html/canvas/WebGL2RenderingContext.idl:
578
579         * bindings/js/CallTracerTypes.h:
580         * inspector/RecordingSwizzleTypes.h:
581
582         * inspector/InspectorCanvas.h:
583         * inspector/InspectorCanvas.cpp:
584         (WebCore::InspectorCanvas::canvasChanged): Added.
585         (WebCore::InspectorCanvas::resetRecordingData):
586         (WebCore::shouldSnapshotWebGL2Action): Added.
587         (WebCore::InspectorCanvas::recordAction):
588         (WebCore::InspectorCanvas::releaseObjectForRecording):
589         (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
590         (WebCore::InspectorCanvas::buildAction):
591         * inspector/agents/InspectorCanvasAgent.h:
592         * inspector/agents/InspectorCanvasAgent.cpp:
593         (WebCore::InspectorCanvasAgent::canvasChanged): Added.
594         (WebCore::InspectorCanvasAgent::startRecording):
595         Provide an actual implementation of `CanvasObserver::canvasChanged` since it can be used to
596         determine whether or not an action needs a snapshot.
597
598         * page/PageConsoleClient.cpp:
599         (WebCore::canvasRenderingContext):
600
601 2019-05-03  Commit Queue  <commit-queue@webkit.org>
602
603         Unreviewed, rolling out r244881.
604         https://bugs.webkit.org/show_bug.cgi?id=197559
605
606         Breaks compilation of jsconly on linux, breaking compilation
607         for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
608         guijemont on #webkit).
609
610         Reverted changeset:
611
612         "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
613         WEBKIT_COPY_FILES"
614         https://bugs.webkit.org/show_bug.cgi?id=197174
615         https://trac.webkit.org/changeset/244881
616
617 2019-05-03  Joonghun Park  <jh718.park@samsung.com>
618
619         Resolve the percentage values of inset properties against proper box.
620         https://bugs.webkit.org/show_bug.cgi?id=189549
621
622         Reviewed by Antti Koivisto.
623
624         Before this CL, sticky element's layout was executed relative to
625         a box's overflow container,
626         but the value returned by getComputedStyle was resolved against
627         its containing block.
628
629         So, the computed value and the actual value used in layout
630         was different before this change.
631
632         Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky-container-for-abspos.html
633                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-sticky-pos-percent.html
634
635         * css/CSSComputedStyleDeclaration.cpp:
636         (WebCore::positionOffsetValue):
637         * rendering/RenderBox.cpp:
638         (WebCore::RenderBox::enclosingScrollportBox const):
639         * rendering/RenderBox.h:
640
641 2019-05-02  Antti Koivisto  <antti@apple.com>
642
643         Add a quirk to make gmail navigation bar scrollable without mouse hover on iOS
644         https://bugs.webkit.org/show_bug.cgi?id=197529
645         <rdar://problem/49403416>
646
647         Reviewed by Simon Fraser.
648
649         * css/StyleResolver.cpp:
650         (WebCore::StyleResolver::adjustRenderStyle):
651         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
652
653         Turn 'overflow:hidden' to 'overflow:auto' on element with role="navigation".
654         This should be both reasonably targeted and robust.
655
656         * css/StyleResolver.h:
657         * page/Quirks.cpp:
658         (WebCore::Quirks::needsGMailOverflowScrollQuirk const):
659         * page/Quirks.h:
660
661 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
662
663         Add logging for RenderLayer clip rects
664         https://bugs.webkit.org/show_bug.cgi?id=197547
665
666         Reviewed by Zalan Bujtas.
667
668         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
669
670         * platform/Logging.h:
671         * rendering/ClipRect.cpp:
672         (WebCore::operator<<):
673         * rendering/ClipRect.h:
674         * rendering/RenderLayer.cpp:
675         (WebCore::operator<<):
676         (WebCore::RenderLayer::calculateClipRects const):
677         * rendering/RenderLayer.h:
678
679 2019-05-02  Youenn Fablet  <youenn@apple.com>
680
681         Make AudioContext::scriptExecutionContext() private
682         https://bugs.webkit.org/show_bug.cgi?id=197512
683
684         Reviewed by Eric Carlson.
685
686         Refactor code to make audio nodes not rely on AudioContext::scriptExecutionContext.
687         Instead, let AudioContext provide the necessary API for its nodes.
688         Covered by existing tests.
689
690         * Modules/webaudio/AudioBufferSourceNode.cpp:
691         (WebCore::AudioBufferSourceNode::looping):
692         (WebCore::AudioBufferSourceNode::setLooping):
693         * Modules/webaudio/AudioContext.cpp:
694         (WebCore::AudioContext::postTask):
695         (WebCore::AudioContext::origin const):
696         (WebCore::AudioContext::addConsoleMessage):
697         * Modules/webaudio/AudioContext.h:
698         (WebCore::AudioContext::isStopped const):
699         * Modules/webaudio/AudioNode.cpp:
700         (WebCore::AudioNode::scriptExecutionContext const):
701         * Modules/webaudio/AudioNode.h:
702         * Modules/webaudio/AudioScheduledSourceNode.cpp:
703         (WebCore::AudioScheduledSourceNode::finish):
704         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
705         (WebCore::DefaultAudioDestinationNode::resume):
706         (WebCore::DefaultAudioDestinationNode::suspend):
707         (WebCore::DefaultAudioDestinationNode::close):
708         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
709         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
710         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
711         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
712         * Modules/webaudio/ScriptProcessorNode.cpp:
713         (WebCore::ScriptProcessorNode::fireProcessEvent):
714
715 2019-05-02  Ryosuke Niwa  <rniwa@webkit.org>
716
717         Disable software keyboard for a math field textarea on desmos.com
718         https://bugs.webkit.org/show_bug.cgi?id=197488
719
720         Reviewed by Wenson Hsieh.
721
722         Treat a textarea inside a math field span as if it had inputmode content attribute set to none to suppress
723         the software keyboard on desmos.com as it interferes with website's own UI.
724
725         * html/HTMLElement.cpp:
726         (WebCore::HTMLElement::canonicalInputMode const):
727         * page/Quirks.cpp:
728         (WebCore::Quirks::needsInputModeNoneImplicitly const):
729         * page/Quirks.h:
730
731 2019-05-02  Timothy Hatcher  <timothy@apple.com>
732
733         NSAttributedString conversion in a loop returns nil and WKUnknownError every other time.
734         https://bugs.webkit.org/show_bug.cgi?id=197523
735
736         Reviewed by Darin Adler.
737
738         * editing/cocoa/HTMLConverter.mm:
739         (HTMLConverter::convert): Don't return early if m_dataSource is nil. This is already null
740         checked later and only needed in specific cases, it shouldn't fail the whole conversion.
741
742 2019-05-02  Chris Dumez  <cdumez@apple.com>
743
744         Setting a frame's src to a javascript URL should not run it synchronously
745         https://bugs.webkit.org/show_bug.cgi?id=197466
746
747         Reviewed by Darin Adler.
748
749         When an iframe's src attribute is set to a javascript URL, whether when parsing
750         or later on via JS, we now execute the URL's JavaScript asynchronously. We used
751         to execute it synchronously, which was a source of bugs and also did not match
752         other browsers.
753
754         I have verified that our new behavior is aligned with both Firefox and Chrome.
755
756         Note that for backward-compatibility and interoperability with Blink
757         (https://bugs.chromium.org/p/chromium/issues/detail?id=923585), the
758         "javascript:''" URL will still run synchronously. We should consider dropping
759         this quirk at some point.
760
761         Test: fast/dom/frame-src-javascript-url-async.html
762
763         * loader/NavigationScheduler.cpp:
764         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
765         (WebCore::ScheduledLocationChange::~ScheduledLocationChange):
766         (WebCore::NavigationScheduler::scheduleLocationChange):
767         * loader/NavigationScheduler.h:
768         (WebCore::NavigationScheduler::scheduleLocationChange):
769         * loader/SubframeLoader.cpp:
770         (WebCore::SubframeLoader::requestFrame):
771
772 2019-05-02  Gary Katsevman  <git@gkatsev.com>
773
774         WebVTT: fix vertical cue alignment.
775         https://bugs.webkit.org/show_bug.cgi?id=136627.
776         <rdar://problem/49725538>
777
778         Reviewed by Eric Carlson.
779
780         Updated existing test results.
781
782         * html/track/VTTCue.cpp:
783         (WebCore::VTTCueBox::applyCSSProperties):
784
785 2019-05-02  Don Olmstead  <don.olmstead@sony.com>
786
787         [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
788         https://bugs.webkit.org/show_bug.cgi?id=197174
789
790         Reviewed by Alex Christensen.
791
792         Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
793         for framework headers explicit.
794
795         * CMakeLists.txt:
796
797 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
798
799         [WebAuthN] Add a quirk for google.com when processing AppID extension
800         https://bugs.webkit.org/show_bug.cgi?id=196046
801         <rdar://problem/49088479>
802
803         Reviewed by Brent Fulgham.
804
805         Relaxing the same site restriction on AppID while in google.com and any
806         of its subdomains to allow two www.gstatic.com AppIDs to slip in.
807
808         Covered by manual tests on Google.com.
809
810         * Modules/webauthn/AuthenticatorCoordinator.cpp:
811         (WebCore::AuthenticatorCoordinatorInternal::needsAppIdQuirks):
812         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
813
814 2019-05-02  Ross Kirsling  <ross.kirsling@sony.com>
815
816         Unreviewed fix for non-unified build after r244853.
817
818         * page/SecurityOrigin.cpp:
819
820 2019-05-02  Frederic Wang  <fwang@igalia.com>
821
822         [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime
823         https://bugs.webkit.org/show_bug.cgi?id=196142
824
825         This patch introduces some experimental runtime flag to let users
826         disable MathML features that are removed from MathML Core [1]. For now,
827         these features are only disabled on GTK and WPE ports. This patch also
828         adds a condition to disable "thin", "thick", "medium" values of
829         mfrac@linethickness at runtime as agreed in [2].
830
831         [1] https://mathml-refresh.github.io/mathml-core/
832         [2] https://github.com/mathml-refresh/mathml/issues/4
833
834         Reviewed by Rob Buis.
835
836         No new tests, covered by frac-linethickness-0001.html
837
838         * mathml/MathMLFractionElement.cpp:
839         (WebCore::MathMLFractionElement::lineThickness): Just do standard
840         parsing for MathML lengths when non-core MathML features are disabled.
841         * page/Settings.yaml: Add WebCore setting.
842
843 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
844
845         [WebAuthN] Adopt SecurityOrigin::isMatchingRegistrableDomainSuffix()
846         https://bugs.webkit.org/show_bug.cgi?id=197481
847
848         Reviewed by Brent Fulgham.
849
850         This patch implements Step 6-7 from:
851         https://www.w3.org/TR/webauthn/#createCredential,
852         https://www.w3.org/TR/webauthn/#discover-from-external-source.
853
854         Test: http/wpt/webauthn/public-key-credential-ip-address.html
855
856         * Modules/webauthn/AuthenticatorCoordinator.cpp:
857         (WebCore::AuthenticatorCoordinator::create const):
858         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
859
860 2019-05-01  Youenn Fablet  <youenn@apple.com>
861
862         Add back hasNullReferences() assert in Document::updateIsPlayingMedia
863         https://bugs.webkit.org/show_bug.cgi?id=197477
864
865         Reviewed by Eric Carlson.
866
867         AudioContext had a special scriptExecutionContext() getter
868         that was returning nullptr when AudioContext is stopped.
869         Instead, make this getter behave as all other scriptExecutionContext() getters
870         and make sure existing call sites of the getter are fine with the change.
871
872         Covered by existing tests.
873
874         * Modules/webaudio/AudioContext.cpp:
875         (WebCore::AudioContext::AudioContext):
876         No need to check whether offline since this constructor is for non offline AudioContext.
877         (WebCore::AudioContext::scriptExecutionContext const):
878         (WebCore::AudioContext::fireCompletionEvent):
879         * dom/Document.cpp:
880         (WebCore::Document::updateIsPlayingMedia):
881
882 2019-05-01  Justin Fan  <justin_fan@apple.com>
883
884         Update WebGPU class names based on sketch.idl
885         https://bugs.webkit.org/show_bug.cgi?id=194260
886
887         Reviewed by Dean Jackson.
888
889         Update all exposed Web GPU interface names to GPU* prefix.
890
891         Existing Web GPU tests updated to expect new names.
892
893         * Modules/webgpu/WebGPU.idl:
894         * Modules/webgpu/WebGPUAdapter.idl:
895         * Modules/webgpu/WebGPUBindGroup.idl:
896         * Modules/webgpu/WebGPUBindGroupLayout.idl:
897         * Modules/webgpu/WebGPUBuffer.idl:
898         * Modules/webgpu/WebGPUDevice.idl:
899         * Modules/webgpu/WebGPUInputStepMode.h: Removed.
900         * Modules/webgpu/WebGPUPipelineLayout.idl:
901         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
902         * Modules/webgpu/WebGPUQueue.idl:
903         * Modules/webgpu/WebGPURenderPassEncoder.idl:
904         * Modules/webgpu/WebGPURenderPipeline.idl:
905         * Modules/webgpu/WebGPUSampler.idl:
906         * Modules/webgpu/WebGPUTexture.idl:
907         * Modules/webgpu/WebGPUTextureView.idl:
908         * WebCore.xcodeproj/project.pbxproj:
909         * bindings/js/WebCoreBuiltinNames.h:
910
911 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
912
913         Move Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
914         https://bugs.webkit.org/show_bug.cgi?id=181950
915         <rdar://problem/43357371>
916
917         Reviewed by Brent Fulgham.
918
919         This patch moves Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
920         to be more aligned with the HTML standard:
921         https://html.spec.whatwg.org/multipage/origin.html#is-a-registrable-domain-suffix-of-or-is-equal-to.
922         Besides that, it also removes redundant codes within the original method that is also done in
923         OriginAccessEntry::matchesOrigin.
924
925         Covered by new API tests.
926
927         * dom/Document.cpp:
928         (WebCore::Document::setDomain):
929         (WebCore::Document::domainIsRegisterable const): Deleted.
930         * dom/Document.h:
931         * page/SecurityOrigin.cpp:
932         (WebCore::SecurityOrigin::isMatchingRegistrableDomainSuffix const):
933         * page/SecurityOrigin.h:
934
935 2019-05-01  Ryosuke Niwa  <rniwa@webkit.org>
936
937         [iOS] Element::focus and Element::scrollIntoView do not clamp scroll positions
938         https://bugs.webkit.org/show_bug.cgi?id=197211
939
940         Reviewed by Simon Fraser.
941
942         Fixed the bug that Element::focus and Element::scrollIntoView were not clamping scroll offsets,
943         which causes scrollTop etc... to return a bogus negative scrolling offset.
944
945         Unfortunately, we can't just use FrameView's ScrollableArea::constrainScrollPosition since
946         scrollRectToVisible relies on the visible rect being expanded by the content insets in order to scroll to
947         a position within the content insets of UIScrollView; e.g. revealing the top of the page as the center.
948         We manually expand minimumScrollPosition() and maximumScrollPosition() by the content insets instead.
949
950         Tests: fast/scrolling/ios/programmatic-scroll-via-focus-should-clamp-top.html
951                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-inside-iframe-should-clamp-top.html
952                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-should-clamp-top.html
953
954         * rendering/RenderLayer.cpp:
955         (WebCore::RenderLayer::scrollRectToVisible):
956
957 2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
958
959         [iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout
960         https://bugs.webkit.org/show_bug.cgi?id=197342
961         <rdar://problem/50063091>
962
963         Reviewed by Tim Horton.
964
965         Adds support for a new shrink-to-fit heuristic that attempts to lay out the contents of the page at a larger
966         width in order to shrink content to fit the viewport. See WebKit ChangeLog for more details.
967
968         Tests: fast/viewport/ios/shrink-to-fit-content-constant-width.html
969                fast/viewport/ios/shrink-to-fit-content-large-width-breakpoint.html
970                fast/viewport/ios/shrink-to-fit-content-no-viewport.html
971                fast/viewport/ios/shrink-to-fit-content-responsive-viewport-with-horizontal-overflow.html
972                fast/viewport/ios/shrink-to-fit-content-temporary-overflow.html
973
974         * page/ViewportConfiguration.cpp:
975         (WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidth):
976         (WebCore::ViewportConfiguration::setIsKnownToLayOutWiderThanViewport):
977         (WebCore::ViewportConfiguration::description const):
978         * page/ViewportConfiguration.h:
979         (WebCore::ViewportConfiguration::canIgnoreScalingConstraints const):
980         (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const):
981
982         Add several new getters and setters in ViewportConfiguration.
983
984         (WebCore::ViewportConfiguration::isKnownToLayOutWiderThanViewport const):
985         (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const):
986
987         Importantly, only allow ignoring the minimum effective device width in webpages with responsive viewports, if
988         they also have *not* laid out wider than the viewport.
989
990         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
991
992 2019-05-01  Zalan Bujtas  <zalan@apple.com>
993
994         [iOS] Star rating is covered with a black circle when writing a review on Yelp
995         https://bugs.webkit.org/show_bug.cgi?id=197469
996         <rdar://problem/48094446>
997
998         Reviewed by Dean Jackson.
999
1000         This patch moves the background painting of the radio/checkbox form controls in checked state to RenderTheme.
1001         It enables content authors to disable default appearance using -webkit-appearance: none (it is also inline with what we do on macOS).
1002
1003         Test: fast/forms/radio-and-checkbox-checked-with-no-appearance.html
1004
1005         * css/html.css:
1006         (input:matches([type="checkbox"], [type="radio"]):checked):
1007         * rendering/RenderThemeIOS.mm:
1008         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
1009         (WebCore::RenderThemeIOS::paintRadioDecorations):
1010
1011 2019-05-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
1012
1013         REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages
1014         https://bugs.webkit.org/show_bug.cgi?id=197451
1015
1016         Reviewed by Simon Fraser.
1017
1018         Before r244182, some web pages never need to schedule a RenderingUpdate.
1019         Only pages with rAF callbacks, web animations, intersection and resize 
1020         observers needed to do so. After r244182, all pages have to schedule a
1021         RenderingUpdate when a page rendering update is required.
1022
1023         When Safari opens, it create a 'blank' web page. The blank page will not
1024         be visible unless the user selects to show the 'Empty page' in the new
1025         tab. Although the blank page is not visible, the loader needs to resolveStyle()
1026         which requires to scheduleLayerFlushNow(). 
1027
1028         We need to optimize this case: calling scheduleLayerFlushNow() for invisible
1029         pages. We do that by checking if the page is visible before scheduling
1030         the RenderingUpdate.
1031
1032         Also we need to change or get rid of scheduleLayerFlushNow() since its name
1033         has become confusing. It suggests that it is going to schedule flushing
1034         the layer 'now'. But after r244182, it does scheduleRenderingUpdate() first.
1035         And when it fires, scheduleCompositingLayerFlush() will be called.
1036
1037         * page/RenderingUpdateScheduler.cpp:
1038         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
1039         * rendering/RenderLayerCompositor.cpp:
1040         (WebCore::RenderLayerCompositor::scheduleLayerFlush):
1041         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
1042         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1043         (WebCore::RenderLayerCompositor::attachRootLayer):
1044         (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled):
1045         (WebCore::RenderLayerCompositor::layerFlushTimerFired):
1046         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow): Deleted.
1047         * rendering/RenderLayerCompositor.h:
1048
1049 2019-05-01  Darin Adler  <darin@apple.com>
1050
1051         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1052         https://bugs.webkit.org/show_bug.cgi?id=195535
1053
1054         Reviewed by Alexey Proskuryakov.
1055
1056         * platform/SharedBuffer.cpp:
1057         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
1058         that is the default behavior. Also updated for changes to return values.
1059
1060         * xml/XSLTProcessorLibxslt.cpp:
1061         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
1062         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
1063
1064         * xml/parser/XMLDocumentParserLibxml2.cpp:
1065         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
1066
1067 2019-05-01  Shawn Roberts  <sroberts@apple.com>
1068
1069         Unreviewed, rolling out r244821.
1070
1071         Causing
1072
1073         Reverted changeset:
1074
1075         "WebKit has too much of its own UTF-8 code and should rely
1076         more on ICU's UTF-8 support"
1077         https://bugs.webkit.org/show_bug.cgi?id=195535
1078         https://trac.webkit.org/changeset/244821
1079
1080 2019-05-01  Shawn Roberts  <sroberts@apple.com>
1081
1082         Unreviewed, rolling out r244822.
1083
1084         Causing
1085
1086         Reverted changeset:
1087
1088         https://trac.webkit.org/changeset/244822
1089
1090 2019-05-01  Youenn Fablet  <youenn@apple.com>
1091
1092         Reject/throw when calling AudioContext methods on a stopped AudioContext
1093         https://bugs.webkit.org/show_bug.cgi?id=197391
1094
1095         Reviewed by Eric Carlson.
1096
1097         Return InvalidStateError in that case.
1098         ASSERT that we do not call lazyInitialize after being stopped
1099         since this would mean we are doing unneeded processing.
1100
1101         Test: http/wpt/webaudio/audiocontext-stopped.html
1102
1103         * Modules/webaudio/AudioContext.cpp:
1104         (WebCore::AudioContext::lazyInitialize):
1105         (WebCore::AudioContext::createBufferSource):
1106         (WebCore::AudioContext::createMediaElementSource):
1107         (WebCore::AudioContext::createMediaStreamSource):
1108         (WebCore::AudioContext::createMediaStreamDestination):
1109         (WebCore::AudioContext::createScriptProcessor):
1110         (WebCore::AudioContext::createBiquadFilter):
1111         (WebCore::AudioContext::createWaveShaper):
1112         (WebCore::AudioContext::createPanner):
1113         (WebCore::AudioContext::createConvolver):
1114         (WebCore::AudioContext::createDynamicsCompressor):
1115         (WebCore::AudioContext::createAnalyser):
1116         (WebCore::AudioContext::createGain):
1117         (WebCore::AudioContext::createDelay):
1118         (WebCore::AudioContext::createChannelSplitter):
1119         (WebCore::AudioContext::createChannelMerger):
1120         (WebCore::AudioContext::createOscillator):
1121         (WebCore::AudioContext::createPeriodicWave):
1122         (WebCore::AudioContext::startRendering):
1123         (WebCore::AudioContext::suspend):
1124         (WebCore::AudioContext::resume):
1125         (WebCore::AudioContext::close):
1126         * Modules/webaudio/AudioContext.h:
1127         * Modules/webaudio/AudioContext.idl:
1128
1129 2019-05-01  Eric Carlson  <eric.carlson@apple.com>
1130
1131         XMLHttpRequest should propagate user gestures for media playback
1132         https://bugs.webkit.org/show_bug.cgi?id=197428
1133         <rdar://problem/46677392>
1134
1135         Reviewed by Jer Noble.
1136
1137         A user gesture the would allow media state change in effect when XMLHttpRequest.send is 
1138         called should be active when the event handlers fire after the transaction completes successfully.
1139
1140         Test: http/tests/media/user-gesture-preserved-across-xmlhttprequest.html
1141
1142         * dom/UserGestureIndicator.cpp:
1143         (WebCore::UserGestureIndicator::UserGestureIndicator): Add a 'scope' parameter to potentially
1144         limit the scope of the gesture to just media.
1145         (WebCore::UserGestureIndicator::~UserGestureIndicator): Clear the scope.
1146         * dom/UserGestureIndicator.h:
1147         (WebCore::UserGestureToken::processingUserGesture const):
1148         (WebCore::UserGestureToken::setScope):
1149         (WebCore::UserGestureToken::resetScope):
1150         (WebCore::UserGestureToken::hasExpired const):
1151
1152         * page/DOMTimer.cpp:
1153         (WebCore::DOMTimerFireState::DOMTimerFireState): Don't need to store the nested timer interval,
1154         UserGestureIndicator knows when it started.
1155         (WebCore::DOMTimer::DOMTimer): Ditto.
1156         (WebCore::DOMTimer::fired): Ditto.
1157         (WebCore::DOMTimerFireState::nestedTimerInterval const): Deleted.
1158         (WebCore::shouldForwardUserGesture): Deleted.
1159         (WebCore::userGestureTokenToForward): Deleted.
1160         (WebCore::currentNestedTimerInterval): Deleted.
1161         * page/DOMTimer.h:
1162
1163         * testing/Internals.cpp:
1164         (WebCore::Internals::setXHRMaximumIntervalForUserGestureForwarding): Override the maximum
1165         user gesture interval for testing.
1166         * testing/Internals.h:
1167         * testing/Internals.idl:
1168
1169         * xml/XMLHttpRequest.cpp:
1170         (WebCore::XMLHttpRequest::XMLHttpRequest): 
1171         (WebCore::XMLHttpRequest::send): Stash the user gesture token.
1172         (WebCore::XMLHttpRequest::dispatchEvent): Clear user gesture token if it has expired. If still
1173         valid, activate it.
1174         * xml/XMLHttpRequest.h:
1175
1176 2019-04-29  Darin Adler  <darin@apple.com>
1177
1178         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1179         https://bugs.webkit.org/show_bug.cgi?id=195535
1180
1181         Reviewed by Alexey Proskuryakov.
1182
1183         * platform/SharedBuffer.cpp:
1184         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
1185         that is the default behavior. Also updated for changes to return values.
1186
1187         * xml/XSLTProcessorLibxslt.cpp:
1188         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
1189         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
1190
1191         * xml/parser/XMLDocumentParserLibxml2.cpp:
1192         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
1193
1194 2019-04-30  John Wilander  <wilander@apple.com>
1195
1196         Add logging of Ad Click Attribution errors and events to a dedicated channel
1197         https://bugs.webkit.org/show_bug.cgi?id=197332
1198         <rdar://problem/49918800>
1199
1200         Reviewed by Youenn Fablet.
1201
1202         This patch adds an experimental Ad Click Attribution debug mode which
1203         logs information.
1204
1205         No new tests.
1206
1207         * loader/AdClickAttribution.cpp:
1208         (WebCore::AdClickAttribution::parseConversionRequest):
1209         (WebCore::AdClickAttribution::debugModeEnabled):
1210         * loader/AdClickAttribution.h:
1211         * page/RuntimeEnabledFeatures.h:
1212         (WebCore::RuntimeEnabledFeatures::adClickAttributionDebugModeEnabled const):
1213         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionDebugModeEnabled):
1214         * platform/Logging.h:
1215
1216 2019-04-30  Myles C. Maxfield  <mmaxfield@apple.com>
1217
1218         font-weight: 1000 is not parsed successfully
1219         https://bugs.webkit.org/show_bug.cgi?id=197427
1220
1221         Reviewed by Dean Jackson.
1222
1223         The spec says:
1224         "Only values greater than or equal to 1, and less than or equal to 1000, are valid"
1225
1226         This change brings us in-line with all the other browsers.
1227
1228         Test: fast/text/font-weight-1-1000.html
1229
1230         * css/parser/CSSPropertyParserHelpers.cpp:
1231         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
1232
1233 2019-04-30  Youenn Fablet  <youenn@apple.com>
1234
1235         Make Document audio producers use WeakPtr
1236         https://bugs.webkit.org/show_bug.cgi?id=197382
1237
1238         Reviewed by Eric Carlson.
1239
1240         Move from a hash set of raw pointers to a hash set of weak pointers.
1241         This helps make the code cleaner.
1242         No observable change of behavior.
1243
1244         * Modules/mediastream/MediaStreamTrack.h:
1245         * dom/Document.cpp:
1246         (WebCore::Document::addAudioProducer):
1247         (WebCore::Document::removeAudioProducer):
1248         (WebCore::Document::updateIsPlayingMedia):
1249         (WebCore::Document::pageMutedStateDidChange):
1250         * dom/Document.h:
1251         * html/HTMLMediaElement.cpp:
1252         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1253         * html/HTMLMediaElement.h:
1254         * page/MediaProducer.h:
1255
1256 2019-04-30  Youenn Fablet  <youenn@apple.com>
1257
1258         [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
1259         https://bugs.webkit.org/show_bug.cgi?id=196864
1260         <rdar://problem/49854497>
1261
1262         Reviewed by Alex Christensen.
1263
1264         In case of redirection, it is sometimes not possible to retrieve the form data
1265         from its NSInputStream in case of redirections.
1266         To handle this case, reuse the first request form data if the new request has a body.
1267         We also clear the HTTP content type in such a case if the original request has no content type.
1268
1269         Covered by re-enabled tests.
1270
1271         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1272         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
1273
1274 2019-04-30  Commit Queue  <commit-queue@webkit.org>
1275
1276         Unreviewed, rolling out r244773.
1277         https://bugs.webkit.org/show_bug.cgi?id=197436
1278
1279         Causing assertion failures on debug queues (Requested by
1280         ShawnRoberts on #webkit).
1281
1282         Reverted changeset:
1283
1284         "Make Document audio producers use WeakPtr"
1285         https://bugs.webkit.org/show_bug.cgi?id=197382
1286         https://trac.webkit.org/changeset/244773
1287
1288 2019-04-30  Commit Queue  <commit-queue@webkit.org>
1289
1290         Unreviewed, rolling out r244774.
1291         https://bugs.webkit.org/show_bug.cgi?id=197431
1292
1293         Causing assertion failures on debug queues (Requested by
1294         ShawnRoberts on #webkit).
1295
1296         Reverted changeset:
1297
1298         "Reject/throw when calling AudioContext methods on a stopped
1299         AudioContext"
1300         https://bugs.webkit.org/show_bug.cgi?id=197391
1301         https://trac.webkit.org/changeset/244774
1302
1303 2019-04-30  Alex Christensen  <achristensen@webkit.org>
1304
1305         Add WKContentRuleList ping resource-type
1306         https://bugs.webkit.org/show_bug.cgi?id=197325
1307         <rdar://problem/49841404>
1308
1309         Reviewed by Geoff Garen.
1310
1311         Tests: http/tests/contentextensions/block-ping-resource-type-ping.html and http/tests/contentextensions/block-ping-resource-type-raw.html
1312
1313         * contentextensions/ContentExtensionsBackend.cpp:
1314         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
1315         * contentextensions/ContentExtensionsBackend.h:
1316         * loader/PingLoader.cpp:
1317         (WebCore::processContentRuleListsForLoad):
1318         (WebCore::PingLoader::sendPing):
1319         * loader/ResourceLoadInfo.cpp:
1320         (WebCore::ContentExtensions::readResourceType):
1321         (WebCore::ContentExtensions::ResourceLoadInfo::getResourceFlags const):
1322         * loader/ResourceLoadInfo.h:
1323         * page/UserContentProvider.cpp:
1324         (WebCore::UserContentProvider::processContentRuleListsForLoad):
1325         * page/UserContentProvider.h:
1326
1327 2019-04-30  Justin Fan  <justin_fan@apple.com>
1328
1329         [WebGPU] Move 'gpu' API entry point from DOMWindow to Navigator
1330         https://bugs.webkit.org/show_bug.cgi?id=197348
1331
1332         Reviewed by Myles C. Maxfield.
1333
1334         Latest API provides 'gpu' through Navigator instead of DOMWindow. Replace DOMWindowWebGPU with NavigatorGPU.
1335
1336         Existing tests updated to match. Add test: webgpu-enabled-in-worker.html to ensure workers can access WebGPU.
1337
1338         * CMakeLists.txt:
1339         * DerivedSources.make:
1340         * Modules/webgpu/NavigatorGPU.cpp:
1341         (WebCore::NavigatorGPU::from):
1342         (WebCore::NavigatorGPU::supplementName):
1343         (WebCore::NavigatorGPU::gpu):
1344         (WebCore::NavigatorGPU::gpu const):
1345         * Modules/webgpu/NavigatorGPU.h:
1346         * Modules/webgpu/NavigatorGPU.idl:
1347         * Modules/webgpu/WorkerNavigatorGPU.cpp:
1348         (WebCore::WorkerNavigatorGPU::from):
1349         (WebCore::WorkerNavigatorGPU::supplementName):
1350         (WebCore::WorkerNavigatorGPU::gpu):
1351         (WebCore::WorkerNavigatorGPU::gpu const):
1352         * Modules/webgpu/WorkerNavigatorGPU.h:
1353         * Modules/webgpu/WorkerNavigatorGPU.idl:
1354         * Sources.txt:
1355         * WebCore.xcodeproj/project.pbxproj:
1356
1357 2019-04-30  Zalan Bujtas  <zalan@apple.com>
1358
1359         Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
1360         https://bugs.webkit.org/show_bug.cgi?id=197347
1361         <rdar://problem/49393423>
1362
1363         Reviewed by Wenson Hsieh.
1364
1365         Tests: fast/events/touch/ios/double-tap-for-double-click1.html
1366                fast/events/touch/ios/double-tap-for-double-click2.html
1367
1368         * page/Frame.h:
1369         * page/ios/FrameIOS.mm:
1370         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
1371
1372 2019-04-30  Youenn Fablet  <youenn@apple.com>
1373
1374         Reject/throw when calling AudioContext methods on a stopped AudioContext
1375         https://bugs.webkit.org/show_bug.cgi?id=197391
1376
1377         Reviewed by Eric Carlson.
1378
1379         Return InvalidStateError in that case.
1380         ASSERT that we do not call lazyInitialize after being stopped
1381         since this would mean we are doing unneeded processing.
1382
1383         Test: http/wpt/webaudio/audiocontext-stopped.html
1384
1385         * Modules/webaudio/AudioContext.cpp:
1386         (WebCore::AudioContext::lazyInitialize):
1387         (WebCore::AudioContext::createBufferSource):
1388         (WebCore::AudioContext::createMediaElementSource):
1389         (WebCore::AudioContext::createMediaStreamSource):
1390         (WebCore::AudioContext::createMediaStreamDestination):
1391         (WebCore::AudioContext::createScriptProcessor):
1392         (WebCore::AudioContext::createBiquadFilter):
1393         (WebCore::AudioContext::createWaveShaper):
1394         (WebCore::AudioContext::createPanner):
1395         (WebCore::AudioContext::createConvolver):
1396         (WebCore::AudioContext::createDynamicsCompressor):
1397         (WebCore::AudioContext::createAnalyser):
1398         (WebCore::AudioContext::createGain):
1399         (WebCore::AudioContext::createDelay):
1400         (WebCore::AudioContext::createChannelSplitter):
1401         (WebCore::AudioContext::createChannelMerger):
1402         (WebCore::AudioContext::createOscillator):
1403         (WebCore::AudioContext::createPeriodicWave):
1404         (WebCore::AudioContext::startRendering):
1405         (WebCore::AudioContext::suspend):
1406         (WebCore::AudioContext::resume):
1407         (WebCore::AudioContext::close):
1408         * Modules/webaudio/AudioContext.h:
1409         * Modules/webaudio/AudioContext.idl:
1410
1411 2019-04-30  Youenn Fablet  <youenn@apple.com>
1412
1413         Make Document audio producers use WeakPtr
1414         https://bugs.webkit.org/show_bug.cgi?id=197382
1415
1416         Reviewed by Eric Carlson.
1417
1418         Move from a hash set of raw pointers to a hash set of weak pointers.
1419         This helps make the code cleaner.
1420         No observable change of behavior.
1421
1422         * Modules/mediastream/MediaStreamTrack.h:
1423         * dom/Document.cpp:
1424         (WebCore::Document::addAudioProducer):
1425         (WebCore::Document::removeAudioProducer):
1426         (WebCore::Document::updateIsPlayingMedia):
1427         (WebCore::Document::pageMutedStateDidChange):
1428         * dom/Document.h:
1429         * html/HTMLMediaElement.cpp:
1430         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1431         * html/HTMLMediaElement.h:
1432         * page/MediaProducer.h:
1433
1434 2019-04-30  Antti Koivisto  <antti@apple.com>
1435
1436         Tighten type of ScrollingTree:rootNode() to ScrollingTreeFrameScrollingNode
1437         https://bugs.webkit.org/show_bug.cgi?id=197414
1438
1439         Reviewed by Frédéric Wang.
1440
1441         * page/scrolling/ScrollingTree.cpp:
1442         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
1443         (WebCore::ScrollingTree::handleWheelEvent):
1444         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1445         (WebCore::ScrollingTree::updateTreeFromStateNode):
1446         * page/scrolling/ScrollingTree.h:
1447         (WebCore::ScrollingTree::rootNode const):
1448
1449 2019-04-30  Youenn Fablet  <youenn@apple.com>
1450
1451         Refactor AudioContext to register/unregister itself at construction/destruction time
1452         https://bugs.webkit.org/show_bug.cgi?id=197383
1453
1454         Reviewed by Eric Carlson.
1455
1456         Registering/Unregistering is cheap.
1457         Instead of registering/unregistering in initialize/uninitialize,
1458         move this code to constructor/destructor.
1459         No observable change of behavior.
1460
1461         * Modules/webaudio/AudioContext.cpp:
1462         (WebCore::AudioContext::AudioContext):
1463         (WebCore::AudioContext::~AudioContext):
1464         (WebCore::AudioContext::lazyInitialize):
1465         (WebCore::AudioContext::uninitialize):
1466         (WebCore::AudioContext::visibilityStateChanged):
1467
1468 2019-04-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1469
1470         WebCore::StyleColorScheme should not have explicitly-declared copy constructor
1471         https://bugs.webkit.org/show_bug.cgi?id=197412
1472
1473         Reviewed by Don Olmstead.
1474
1475         Either we need to explicitly declare a copy assignment operator here, or the copy
1476         constructor needs to be removed. Having one without the other causes a huge warning spam
1477         with GCC 9. In this case, the copy constructor is redundant because it's identical to an
1478         implicitly-declared copy constructor, so let's just remove it.
1479
1480         * rendering/style/StyleColorScheme.h:
1481
1482 2019-04-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1483
1484         [GTK] Support prefers-color-scheme media query
1485         https://bugs.webkit.org/show_bug.cgi?id=196685
1486
1487         Reviewed by Michael Catanzaro.
1488
1489         Change the gtk-application-prefer-dark-theme setting when tests change the useDarkModeAppearance setting.
1490
1491         * PlatformGTK.cmake:
1492         * testing/InternalSettings.cpp:
1493         (WebCore::InternalSettings::resetToConsistentState):
1494         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
1495         (WebCore::InternalSettings::setUseDarkAppearance):
1496         * testing/InternalSettings.h:
1497
1498 2019-04-29  Truitt Savell  <tsavell@apple.com>
1499
1500         Unreviewed, rolling out r244755.
1501
1502         Casued several test failures on iOS
1503
1504         Reverted changeset:
1505
1506         "Double-tapping a post to like doesn't work on Instagram.com
1507         (needs 'dblclick' event)"
1508         https://bugs.webkit.org/show_bug.cgi?id=197347
1509         https://trac.webkit.org/changeset/244755
1510
1511 2019-04-29  Alex Christensen  <achristensen@webkit.org>
1512
1513         <rdar://problem/50299396> Fix internal High Sierra build
1514         https://bugs.webkit.org/show_bug.cgi?id=197388
1515
1516         * Configurations/Base.xcconfig:
1517
1518 2019-04-29  Zalan Bujtas  <zalan@apple.com>
1519
1520         Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
1521         https://bugs.webkit.org/show_bug.cgi?id=197347
1522         <rdar://problem/49393423>
1523
1524         Reviewed by Wenson Hsieh.
1525
1526         Tests: fast/events/touch/ios/double-tap-for-double-click1.html
1527                fast/events/touch/ios/double-tap-for-double-click2.html
1528
1529         * page/Frame.h:
1530         * page/ios/FrameIOS.mm:
1531         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
1532
1533 2019-04-30  Simon Fraser  <simon.fraser@apple.com>
1534
1535         Transform is sometimes left in a bad state after an animation
1536         https://bugs.webkit.org/show_bug.cgi?id=197401
1537         rdar://problem/48179186
1538
1539         Reviewed by Dean Jackson.
1540         
1541         In some more complex compositing scenarios, at the end of an animation we'd
1542         fail to push a new transform onto a layer, because updateGeometry() would
1543         think there's an animation running (which there is, but in the "Ending" state).
1544
1545         It's simpler in this code to just always push transform and opacity to the layer;
1546         they will get overridden by the animation while it's running. The current code
1547         dates from the first landing of the file, and the reason for the if (!isRunningAcceleratedTransformAnimation)
1548         check is lost in the sands of time.
1549
1550         I was not able to get a reliable ref or layer tree test for this, because the next compositing update
1551         fixes it, and WTR seems to trigger one.  But the added test does show the bug
1552         in Safari, and is a good test to have.
1553
1554         Test: compositing/animation/transform-after-animation.html
1555
1556         * rendering/RenderLayerBacking.cpp:
1557         (WebCore::RenderLayerBacking::updateGeometry):
1558
1559 2019-04-29  Youenn Fablet  <youenn@apple.com>
1560
1561         getDisplayMedia should be called on user gesture
1562         https://bugs.webkit.org/show_bug.cgi?id=197356
1563
1564         Reviewed by Eric Carlson.
1565
1566         Allow getDisplayMedia on user gesture only.
1567         Otherwise reject the promise.
1568         Minor refactoring to align getDisplayMedia, getUserMedia and
1569         enumerateDevices when called with no document.
1570
1571         Test: fast/mediastream/screencapture-user-gesture.html
1572
1573         * Modules/mediastream/MediaDevices.cpp:
1574         (WebCore::MediaDevices::getUserMedia const):
1575         * Modules/mediastream/MediaDevices.h:
1576         * Modules/mediastream/NavigatorMediaDevices.h:
1577         * page/DOMWindow.h:
1578         * testing/Internals.cpp:
1579         (WebCore::Internals::setDisableGetDisplayMediaUserGestureConstraint):
1580         * testing/Internals.h:
1581         * testing/Internals.idl:
1582
1583 2019-04-29  Javier Fernandez  <jfernandez@igalia.com>
1584
1585         line should not be broken before the first space after a word
1586         https://bugs.webkit.org/show_bug.cgi?id=197278
1587
1588         Reviewed by Myles C. Maxfield.
1589
1590         The 'white-space: break-spaces' only adds breaking opportunities after
1591         a white space character. However, it's possible to break before the
1592         first space after a word when the feature is used in combination with
1593         other properties, like overflow-wrap.
1594
1595         However, breaking before the first space should not be allowed if
1596         there are previous opportunities. We wrongly assumed that we had to
1597         consider these previous breaking opportunities if the proper combination
1598         of line breaking properties is being used, so that breaking before the
1599         first space after a word is allowed.
1600
1601         This wrong assumption caused several issues, like the one described in
1602         the bug, that lead to incorrectly break before the first space even
1603         though there are previous opportunities, either white spaces or between
1604         letters.
1605
1606         Theses issues have been analyzed [1] by the CSS WG and finally agreed on a
1607         expected behavior, represented in the Web Platform tests added in this
1608         patch.
1609
1610         For the later case, of considering previous opportunities between
1611         letters, we have a seperated issue #952254, so the tests covering such
1612         cases will be added to the TestExpecations as Failure entries.
1613
1614         [1] https://github.com/w3c/csswg-drafts/issues/3701
1615
1616         Tests: imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-001.html
1617                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-002.html
1618                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-003.html
1619                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-004.html
1620                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-005.html
1621                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-006.html
1622                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-007.html
1623                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-008.html
1624                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-009.html
1625                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-010.html
1626                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-011.html
1627                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-012.html
1628                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-013.html
1629
1630         * rendering/line/BreakingContext.h:
1631         (WebCore::BreakingContext::handleText):
1632         (WebCore::BreakingContext::trailingSpacesHang):
1633
1634 2019-04-29  Simon Fraser  <simon.fraser@apple.com>
1635
1636         REGRESSION (r238090): animation on https://www.robotodyssey.online gets stuck; site broken
1637         https://bugs.webkit.org/show_bug.cgi?id=197381
1638
1639         Reviewed by Zalan Bujtas.
1640
1641         When -webkit-clip-path changes on a composited layer, we need to trigger a backing geometry update
1642         to push the changes to GraphicsLayers.
1643
1644         Test: compositing/style-change/clip-path-change.html
1645
1646         * rendering/RenderLayerCompositor.cpp:
1647         (WebCore::recompositeChangeRequiresGeometryUpdate):
1648
1649 2019-04-29  Chris Dumez  <cdumez@apple.com>
1650
1651         User-facing strings should use curly quotes instead of straight
1652         https://bugs.webkit.org/show_bug.cgi?id=197370
1653
1654         Reviewed by Geoffrey Garen.
1655
1656         Update localizable strings.
1657
1658         * en.lproj/Localizable.strings:
1659
1660 2019-04-29  Ross Kirsling  <ross.kirsling@sony.com>
1661
1662         Unreviewed fix for non-unified build after r244687.
1663
1664         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1665
1666 2019-04-29  Youenn Fablet  <youenn@apple.com>
1667
1668         RTCTrackEvent should be delayed until the whole remote description is set
1669         https://bugs.webkit.org/show_bug.cgi?id=196808
1670         <rdar://problem/49802649>
1671
1672         Reviewed by Eric Carlson.
1673
1674         As per https://w3c.github.io/webrtc-pc/#set-description,
1675         fire events just before resolving the setRemoteDescription promise.
1676         This ensures that the exposed stream has all necessary tracks from the beginning.
1677         Pending track events are created in LibWebRTCMediaEndpoint and stored in PeerConnectionBackend.
1678
1679         Covered by updated test.
1680
1681         * Modules/mediastream/PeerConnectionBackend.cpp:
1682         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
1683         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
1684         (WebCore::PeerConnectionBackend::addPendingTrackEvent):
1685         (WebCore::PeerConnectionBackend::stop):
1686         * Modules/mediastream/PeerConnectionBackend.h:
1687         * Modules/mediastream/RTCPeerConnection.cpp:
1688         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1689         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
1690         (WebCore::LibWebRTCMediaEndpoint::addPendingTrackEvent):
1691         (WebCore::LibWebRTCMediaEndpoint::newTransceiver):
1692         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1693
1694 2019-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1695
1696         REGRESSION(r244635): [GTK] Wrong background color used in non-dark mode
1697         https://bugs.webkit.org/show_bug.cgi?id=197276
1698
1699         Reviewed by Michael Catanzaro.
1700
1701         Since r244635, we are now getting the frame view background color from the theme. That's correct for dark mode,
1702         but in non-dark mode we still want to use white backgrounds by default. This made a lot of tests to fail.
1703
1704         * css/CSSValueKeywords.in: Add -webkit-control-background when HAVE(OS_DARK_MODE_SUPPORT).
1705         * css/html.css: Use -webkit-control-background instead of -apple-system-control-background.
1706         * page/FrameView.cpp:
1707         (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindow instead of CSSValueWindowframe.
1708         * rendering/RenderThemeGtk.cpp:
1709         (WebCore::RenderThemeGtk::systemColor const): Only get the window background from the theme in dark mode. Handle
1710         also CSSValueWebkitControlBackground.
1711         * rendering/RenderThemeMac.mm:
1712         (WebCore::RenderThemeMac::systemColor const): Handle CSSValueWebkitControlBackground when HAVE(OS_DARK_MODE_SUPPORT).
1713
1714 2019-04-28  Andy Estes  <aestes@apple.com>
1715
1716         [Apple Pay] Increment the API version from 6 to 7
1717         https://bugs.webkit.org/show_bug.cgi?id=197041
1718         <rdar://problem/49986625>
1719
1720         Reviewed by Geoffrey Garen.
1721
1722         * Modules/applepay/PaymentCoordinatorClient.cpp:
1723         (WebCore::PaymentCoordinatorClient::supportsVersion):
1724
1725 2019-04-28  Andy Estes  <aestes@apple.com>
1726
1727         Fix the watchOS engineering build.
1728
1729         * Modules/webgpu/WebGPUComputePassEncoder.cpp: Included Logging.h.
1730
1731 2019-04-28  Youenn Fablet  <youenn@apple.com>
1732
1733         Remove no longer needed mDNS ICE candidate resolution code
1734         https://bugs.webkit.org/show_bug.cgi?id=197315
1735
1736         Reviewed by Eric Carlson.
1737
1738         No change of behavior.
1739         Removed code is no longer exercised as mDNS resolution happens inside libwebrtc
1740         using the same resolution mechanism as for TURN/STUN server names.
1741
1742         * Modules/mediastream/PeerConnectionBackend.cpp:
1743         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
1744         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
1745         * Modules/mediastream/PeerConnectionBackend.h:
1746
1747 2019-04-27  Simon Fraser  <simon.fraser@apple.com>
1748
1749         Move some Compositing logging to the Layers log channel
1750         https://bugs.webkit.org/show_bug.cgi?id=197345
1751
1752         Reviewed by Sam Weinig.
1753
1754         Make Compositing logging a bit less verbose by moving the GraphicsLayer tree dump
1755         to the Layers log channel. Also log GraphicsLayers after flushing, when we'll have
1756         accurate visible rects. 
1757
1758         * platform/graphics/ca/GraphicsLayerCA.cpp:
1759         (WebCore::GraphicsLayerCA::updateCoverage):
1760         * rendering/RenderLayerCompositor.cpp:
1761         (WebCore::layersLogEnabled):
1762         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1763         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1764
1765 2019-04-27  Megan Gardner  <megan_gardner@apple.com>
1766
1767         Lookup only looking up the first word in selection
1768         https://bugs.webkit.org/show_bug.cgi?id=197341
1769         <rdar://problem/48221414>
1770
1771         Reviewed by Wenson Hsieh.
1772
1773         Lookup is not testable.
1774
1775         Reveal needs the full range in order to correctly create the item for the popover.
1776
1777         * editing/cocoa/DictionaryLookup.mm:
1778         (WebCore::showPopupOrCreateAnimationController):
1779
1780 2019-04-26  Jer Noble  <jer.noble@apple.com>
1781
1782         Reduce the number of copies made during SourceBufferPrivateAVFObjC::append() using SharedBuffer
1783         https://bugs.webkit.org/show_bug.cgi?id=197335
1784         <rdar://problem/49175604>
1785
1786         Rubber-stamped by Alex Christensen.
1787
1788         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1789         (WebCore::SourceBufferPrivateAVFObjC::append):
1790
1791 2019-04-26  Jessie Berlin  <jberlin@webkit.org>
1792
1793         Add new mac target numbers
1794         https://bugs.webkit.org/show_bug.cgi?id=197313
1795
1796         Reviewed by Alex Christensen.
1797
1798         * Configurations/Version.xcconfig:
1799         * Configurations/WebKitTargetConditionals.xcconfig:
1800
1801 2019-04-26  Commit Queue  <commit-queue@webkit.org>
1802
1803         Unreviewed, rolling out r244708.
1804         https://bugs.webkit.org/show_bug.cgi?id=197334
1805
1806         "Broke the debug build" (Requested by rmorisset on #webkit).
1807
1808         Reverted changeset:
1809
1810         "All prototypes should call didBecomePrototype()"
1811         https://bugs.webkit.org/show_bug.cgi?id=196315
1812         https://trac.webkit.org/changeset/244708
1813
1814 2019-04-26  Robin Morisset  <rmorisset@apple.com>
1815
1816         All prototypes should call didBecomePrototype()
1817         https://bugs.webkit.org/show_bug.cgi?id=196315
1818
1819         Reviewed by Saam Barati.
1820
1821         It was found by existing tests, with the new assert in JSC::Structure
1822
1823         * bindings/js/JSWindowProxy.cpp:
1824         (WebCore::JSWindowProxy::setWindow):
1825         * bindings/scripts/CodeGeneratorJS.pm:
1826         (GeneratePrototypeDeclaration):
1827         (GenerateConstructorHelperMethods):
1828
1829 2019-04-26  Eric Carlson  <eric.carlson@apple.com>
1830
1831         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
1832         https://bugs.webkit.org/show_bug.cgi?id=197171
1833         <rdar://problem/47454979>
1834
1835         Reviewed by Youenn Fablet.
1836
1837         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
1838
1839         * Modules/plugins/QuickTimePluginReplacement.mm:
1840         (WebCore::jsValueWithValueInContext):
1841         (WebCore::jsValueWithAVMetadataItemInContext):
1842         * WebCore.xcodeproj/project.pbxproj:
1843         * platform/audio/ios/AudioSessionIOS.mm:
1844         (WebCore::AudioSession::setCategory):
1845         (WebCore::AudioSession::category const):
1846         (WebCore::AudioSession::routeSharingPolicy const):
1847         (WebCore::AudioSession::routingContextUID const):
1848         (WebCore::AudioSession::sampleRate const):
1849         (WebCore::AudioSession::bufferSize const):
1850         (WebCore::AudioSession::numberOfOutputChannels const):
1851         (WebCore::AudioSession::tryToSetActiveInternal):
1852         (WebCore::AudioSession::preferredBufferSize const):
1853         (WebCore::AudioSession::setPreferredBufferSize):
1854         * platform/audio/ios/MediaSessionManagerIOS.mm:
1855         (-[WebMediaSessionHelper initWithCallback:]):
1856         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
1857         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1858         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
1859         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
1860         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
1861         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1862         (WebCore::AudioSourceProviderAVFObjC::createMix):
1863         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
1864         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1865         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
1866         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
1867         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
1868         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
1869         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1870         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
1871         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
1872         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
1873         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
1874         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
1875         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
1876         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
1877         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
1878         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1879         (WebCore::CDMSessionAVContentKeySession::isAvailable):
1880         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
1881         (WebCore::CDMSessionAVContentKeySession::update):
1882         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
1883         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
1884         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1885         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1886         (WebCore::CDMSessionAVStreamSession::releaseKeys):
1887         (WebCore::CDMSessionAVStreamSession::update):
1888         (WebCore::CDMSessionAVStreamSession::setStreamSession):
1889         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
1890         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1891         (WebCore::imageDecoderAssetOptions):
1892         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
1893         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
1894         (WebCore::ImageDecoderAVFObjC::readSamples):
1895         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
1896         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
1897         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
1898         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
1899         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
1900         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1901         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
1902         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1903         (WebCore::assetCacheForPath):
1904         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
1905         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
1906         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1907         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
1908         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1909         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
1910         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1911         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
1912         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1913         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1914         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
1915         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
1916         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1917         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
1918         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
1919         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
1920         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
1921         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
1922         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
1923         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
1924         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
1925         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
1926         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
1927         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
1928         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
1929         (WebCore::exernalDeviceDisplayNameForPlayer):
1930         (WebCore::metadataType):
1931         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1932         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1933         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
1934         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
1935         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
1936         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1937         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1938         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
1939         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
1940         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
1941         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
1942         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1943         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
1944         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
1945         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
1946         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1947         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1948         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1949         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
1950         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1951         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1952         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1953         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
1954         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1955         (WebCore::PlatformCALayerCocoa::clone const):
1956         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
1957         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
1958         (WebCore::validateHEVCParameters):
1959         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
1960         (getAVSpeechUtteranceDefaultSpeechRate):
1961         (getAVSpeechUtteranceMaximumSpeechRate):
1962         (-[WebSpeechSynthesisWrapper speakUtterance:]):
1963         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
1964         (SOFT_LINK_CONSTANT): Deleted.
1965         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1966         (-[WebAVPlayerLayer init]):
1967         (-[WebAVPlayerLayer layoutSublayers]):
1968         (-[WebAVPlayerLayer setVideoGravity:]):
1969         (-[WebAVPlayerLayer videoRect]):
1970         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
1971         * platform/mac/SerializedPlatformRepresentationMac.mm:
1972         (WebCore::jsValueWithValueInContext):
1973         (WebCore::jsValueWithAVMetadataItemInContext):
1974         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1975         (WebCore::getAVFormatIDKeyWithFallback):
1976         (WebCore::getAVNumberOfChannelsKeyWithFallback):
1977         (WebCore::getAVSampleRateKeyWithFallback):
1978         (WebCore::getAVEncoderBitRateKeyWithFallback):
1979         (WebCore::MediaRecorderPrivateWriter::create):
1980         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
1981         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
1982         * platform/mediastream/RealtimeVideoSource.h:
1983         * platform/mediastream/VideoPreset.h:
1984         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
1985         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
1986         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
1987         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
1988         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
1989         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1990         (WebCore::deviceIsAvailable):
1991         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
1992         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
1993         (WebCore::AVCaptureDeviceManager::isAvailable):
1994         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
1995         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1996         (WebCore::AVVideoPreset::create):
1997         (WebCore::AVVideoPreset::AVVideoPreset):
1998         (WebCore::AVVideoCaptureSource::create):
1999         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
2000         (WebCore::AVVideoCaptureSource::capabilities):
2001         (WebCore::sensorOrientationFromVideoOutput):
2002         (WebCore::AVVideoCaptureSource::setupSession):
2003         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
2004         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2005         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2006         (WebCore::AVVideoCaptureSource::generatePresets):
2007         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
2008         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
2009
2010 2019-04-26  Commit Queue  <commit-queue@webkit.org>
2011
2012         Unreviewed, rolling out r244683.
2013         https://bugs.webkit.org/show_bug.cgi?id=197320
2014
2015         Causing crash on iOS Simulator and EWS failures (Requested by
2016         sroberts on #webkit).
2017
2018         Reverted changeset:
2019
2020         "[iOS] Add internal setting to force -webkit-text-size-adjust
2021         to "auto""
2022         https://bugs.webkit.org/show_bug.cgi?id=197275
2023         https://trac.webkit.org/changeset/244683
2024
2025 2019-04-26  Youenn Fablet  <youenn@apple.com>
2026
2027         Use normal loading path for ping loads
2028         https://bugs.webkit.org/show_bug.cgi?id=196807
2029
2030         Reviewed by Alex Christensen.
2031
2032         Make use of regular code path for ping loads and beacon.
2033         This is done conditionally on KeepAlive flag.
2034         The benefits are a single loading code path and service worker interception.
2035
2036         For that purpose, introduce a LoaderStrategy switch based on KeepAlive runtime flag.
2037         This switch is used to use ping loads when keepAlive is set or regular loads.
2038         In case of regular loads, the keepAlive flag should be used to extend the lifetime of the load.
2039
2040         Migrate ping loads to use CachedResourceLoader instead of PingLoad.
2041         For that purpose, introduce a new Ping CachedResource type.
2042
2043         Covered by existing tests.
2044
2045         * Modules/beacon/NavigatorBeacon.cpp:
2046         (WebCore::NavigatorBeacon::sendBeacon):
2047         * inspector/agents/InspectorPageAgent.cpp:
2048         (WebCore::InspectorPageAgent::inspectorResourceType):
2049         * loader/LinkLoader.cpp:
2050         (WebCore::createLinkPreloadResourceClient):
2051         * loader/LoaderStrategy.h:
2052         * loader/PingLoader.cpp:
2053         (WebCore::PingLoader::loadImage):
2054         (WebCore::PingLoader::sendPing):
2055         (WebCore::PingLoader::sendViolationReport):
2056         (WebCore::PingLoader::startPingLoad):
2057         * loader/PingLoader.h:
2058         * loader/ResourceLoadInfo.cpp:
2059         (WebCore::toResourceType):
2060         * loader/SubresourceLoader.cpp:
2061         (WebCore::logResourceLoaded):
2062         * loader/cache/CachedResource.cpp:
2063         (WebCore::CachedResource::defaultPriorityForResourceType):
2064         (WebCore::CachedResource::load):
2065         (WebCore::CachedResource::cancelLoad):
2066         * loader/cache/CachedResource.h:
2067         (WebCore::CachedResource::shouldUsePingLoad):
2068         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
2069         * loader/cache/CachedResourceLoader.cpp:
2070         (WebCore::createResource):
2071         (WebCore::CachedResourceLoader::requestPingResource):
2072         (WebCore::contentTypeFromResourceType):
2073         (WebCore::CachedResourceLoader::checkInsecureContent const):
2074         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
2075         (WebCore::CachedResourceLoader::canRequest):
2076         (WebCore::isResourceSuitableForDirectReuse):
2077         (WebCore::destinationForType):
2078         * loader/cache/CachedResourceLoader.h:
2079
2080 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2081
2082         Fix Windows build after r244695
2083        ​https://bugs.webkit.org/show_bug.cgi?id=197165
2084
2085         * loader/PingLoader.cpp:
2086
2087 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2088
2089         Fix internal High Sierra build after r244653
2090         https://bugs.webkit.org/show_bug.cgi?id=197131
2091
2092         * DerivedSources.make:
2093         -std=gnu++17 didn't exist yet.  -std=gnu++1z did.
2094
2095 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2096
2097         Add ENABLE(CONTENT_EXTENSIONS) and namespace ContentExtensions to ResourceLoadInfo.h
2098         https://bugs.webkit.org/show_bug.cgi?id=197165
2099
2100         Reviewed by Youenn Fablet.
2101
2102         No change in behavior.  This will just make it harder for people working on the loader to mistake
2103         these ContentExtension specific structures for other structures general to loading.
2104         One such mistake was made in r244248.
2105
2106         * Modules/websockets/WebSocketChannel.cpp:
2107         (WebCore::WebSocketChannel::connect):
2108         * contentextensions/ContentExtensionsBackend.h:
2109         * css/StyleSheetContents.cpp:
2110         (WebCore::StyleSheetContents::subresourcesAllowReuse const):
2111         * html/HTMLMediaElement.cpp:
2112         (WebCore::HTMLMediaElement::loadResource):
2113         * loader/FrameLoader.cpp:
2114         (WebCore::FrameLoader::loadResourceSynchronously):
2115         * loader/NetscapePlugInStreamLoader.cpp:
2116         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
2117         * loader/PingLoader.cpp:
2118         (WebCore::processContentRuleListsForLoad):
2119         (WebCore::PingLoader::loadImage):
2120         (WebCore::PingLoader::sendPing):
2121         (WebCore::PingLoader::sendViolationReport):
2122         * loader/ResourceLoadInfo.cpp:
2123         (WebCore::toResourceType): Deleted.
2124         (WebCore::readResourceType): Deleted.
2125         (WebCore::readLoadType): Deleted.
2126         (WebCore::ResourceLoadInfo::isThirdParty const): Deleted.
2127         (WebCore::ResourceLoadInfo::getResourceFlags const): Deleted.
2128         * loader/ResourceLoadInfo.h:
2129         * loader/ResourceLoader.cpp:
2130         (WebCore::ResourceLoader::willSendRequestInternal):
2131         * loader/ResourceLoader.h:
2132         * loader/SubresourceLoader.cpp:
2133         (WebCore::SubresourceLoader::SubresourceLoader):
2134         * loader/cache/CachedResourceLoader.cpp:
2135         (WebCore::CachedResourceLoader::requestResource):
2136         * page/DOMWindow.cpp:
2137         (WebCore::DOMWindow::open):
2138         * page/UserContentProvider.cpp:
2139         (WebCore::UserContentProvider::processContentRuleListsForLoad):
2140         (WebCore::UserContentProvider::actionsForResourceLoad):
2141         * page/UserContentProvider.h:
2142
2143 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2144
2145         Fix an internal High Sierra build after r244653
2146        ​https://bugs.webkit.org/show_bug.cgi?id=197131
2147
2148         * DerivedSources.make:
2149         Apparently we can't use gnu++17 when preprocessing Platform.h in the makefile.
2150
2151 2019-04-26  Chris Fleizach  <cfleizach@apple.com>
2152
2153         AX: Provide iOS method for setting focus
2154         https://bugs.webkit.org/show_bug.cgi?id=197200
2155         <rdar://problem/50131679>
2156
2157         Reviewed by Alex Christensen.
2158
2159         Put the focus setting code in a place that iOS and macOS can access.
2160         Override a platform level method for setting focus on iOS.
2161
2162         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2163         (-[WebAccessibilityObjectWrapper _accessibilitySetFocus:]):
2164         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2165         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2166         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySetFocus:]):
2167         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2168         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2169
2170 2019-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2171
2172         propertyRegistry() was not overridden for SVGFEFloodElement and SVGFEMergeElement
2173         https://bugs.webkit.org/show_bug.cgi?id=197303
2174
2175         Reviewed by Alex Christensen.
2176
2177         Therefore SVGElement::propertyRegistry() was called instead. This means
2178         these two elements will not have access to the properties of the base
2179         class SVGFilterPrimitiveStandardAttributes.
2180
2181         Tests: svg/dom/SVGFEFloodElement-filter-standard-attributes.svg
2182
2183         * svg/SVGElement.cpp:
2184         (WebCore::SVGElement::commitPropertyChange):
2185         * svg/SVGFEFloodElement.h:
2186         * svg/SVGFEMergeElement.h:
2187
2188 2019-04-26  Youenn Fablet  <youenn@apple.com>
2189
2190         [Mac WK2 iOS Sim] Layout Test imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html is a flaky failure
2191         https://bugs.webkit.org/show_bug.cgi?id=196633
2192         <rdar://problem/49627667>
2193
2194         Reviewed by Alex Christensen.
2195
2196         Use formula defined in https://w3c.github.io/webrtc-stats/#dom-rtcrtpcontributingsourcestats-audiolevel
2197         to compute the audio level from the RTP header information.
2198         Covered by rebased test.
2199
2200         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
2201         (WebCore::fillRTCRtpContributingSource):
2202
2203 2019-04-26  Sihui Liu  <sihui_liu@apple.com>
2204
2205         Stop IDB transactions to release locked database files when network process is ready to suspend
2206         https://bugs.webkit.org/show_bug.cgi?id=196372
2207         <rdar://problem/48930116>
2208
2209         Reviewed by Brady Eidson.
2210
2211         Suspend IDB database thread and finish ongoing IDB transactions on the main thread before suspending network 
2212         process.
2213
2214         API test: IndexedDB.IndexedDBSuspendImminently
2215
2216         * Modules/indexeddb/server/IDBBackingStore.h:
2217         * Modules/indexeddb/server/IDBServer.cpp:
2218         (WebCore::IDBServer::IDBServer::tryStop):
2219         (WebCore::IDBServer::IDBServer::resume):
2220         * Modules/indexeddb/server/IDBServer.h:
2221         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2222         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Remove some error log messages, because now we may try
2223         performing database operations without an active transaction if the transaction is finished on the main thread.
2224         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
2225         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
2226         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
2227         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
2228         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2229         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
2230         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
2231         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
2232         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
2233         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2234         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2235         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
2236         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
2237         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2238         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
2239         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
2240         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
2241         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
2242         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
2243         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
2244         (WebCore::IDBServer::SQLiteIDBBackingStore::hasTransaction const):
2245         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2246         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2247         (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction):
2248         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionAfterQuotaCheck):
2249         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
2250         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
2251         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
2252         (WebCore::IDBServer::UniqueIDBDatabase::abortTransactionOnMainThread):
2253         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionOnMainThread):
2254         (WebCore::IDBServer::UniqueIDBDatabase::finishActiveTransactions):
2255         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2256         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2257         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setState):
2258         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::state const):
2259         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setResult):
2260         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::result const):
2261         * platform/sql/SQLiteDatabaseTracker.cpp:
2262         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
2263         * platform/sql/SQLiteDatabaseTracker.h:
2264
2265 2019-04-26  Takashi Komori  <Takashi.Komori@sony.com>
2266
2267         [Curl] Fix Curl Request Scheduler not to release wrong Curl handle when request is cancelled.
2268         https://bugs.webkit.org/show_bug.cgi?id=191650
2269
2270         Reviewed by Fujii Hironori.
2271
2272         Test: http/tests/misc/repeat-open-cancel.html
2273
2274         * platform/network/curl/CurlRequest.cpp:
2275         (WebCore::CurlRequest::cancel):
2276         (WebCore::CurlRequest::isCancelled):
2277         (WebCore::CurlRequest::isCompletedOrCancelled):
2278         (WebCore::CurlRequest::didCompleteTransfer):
2279         (WebCore::CurlRequest::completeDidReceiveResponse):
2280         (WebCore::CurlRequest::pausedStatusChanged):
2281         * platform/network/curl/CurlRequest.h:
2282         (WebCore::CurlRequest::isCompleted const): Deleted.
2283         (WebCore::CurlRequest::isCancelled const): Deleted.
2284         (WebCore::CurlRequest::isCompletedOrCancelled const): Deleted.
2285         * platform/network/curl/CurlRequestScheduler.cpp:
2286         (WebCore::CurlRequestScheduler::cancel):
2287         (WebCore::CurlRequestScheduler::callOnWorkerThread):
2288         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
2289         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
2290         (WebCore::CurlRequestScheduler::stopThread):
2291         (WebCore::CurlRequestScheduler::executeTasks):
2292         (WebCore::CurlRequestScheduler::workerThread):
2293         (WebCore::CurlRequestScheduler::startTransfer):
2294         (WebCore::CurlRequestScheduler::completeTransfer):
2295         (WebCore::CurlRequestScheduler::cancelTransfer):
2296         (WebCore::CurlRequestScheduler::finalizeTransfer):
2297         * platform/network/curl/CurlRequestScheduler.h:
2298
2299 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2300
2301         [iOS] Add internal setting to force -webkit-text-size-adjust to "auto"
2302         https://bugs.webkit.org/show_bug.cgi?id=197275
2303         <rdar://problem/50211019>
2304
2305         Reviewed by Simon Fraser.
2306
2307         This setting makes it easier to investigate the autosizing work we've been doing
2308         in https://bugs.webkit.org/show_bug.cgi?id=197250.
2309
2310         * page/Settings.yaml:
2311         * rendering/RenderBlockFlow.cpp:
2312         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
2313         * rendering/TextAutoSizing.cpp:
2314         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2315
2316 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2317
2318         [iOS] Implement idempotent mode for text autosizing
2319         https://bugs.webkit.org/show_bug.cgi?id=197250
2320         <rdar://problem/50211034>
2321
2322         Reviewed by Jon Lee.
2323
2324         Our text autosizing code has this interesting behavior where it is sensitive to the width of the text's container
2325         and the number of lines of text inside the element. Not only is it sensitive to those things, but as those things
2326         change, their values are stored inside the RenderObject itself and then never recomputed. This means that the text
2327         autosizing parameters are sensitive to the entire history of an element. So, a newly created element with the same
2328         style as an existing element can have dramatically different results.
2329
2330         This patch adds a new mode for text autosizing, which isn't sensitive to either of those things, and therefore
2331         maintains the invariant that a newly created element will behave the same as an existing element with the same style.
2332         Instead of using container size, it instead uses the viewport's initial scale. As the viewport's initial scale
2333         changes, new layouts will be triggered, which will cause the autosizing code to use the new value.
2334
2335         Tests: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html
2336                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html
2337
2338         * page/FrameViewLayoutContext.cpp:
2339         (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
2340         * page/Page.cpp:
2341         (WebCore::Page::setInitialScale): WebKit will push the initial scale down into the page.
2342         * page/Page.h:
2343         (WebCore::Page::initialScale const):
2344         * page/SettingsBase.h:
2345         * page/cocoa/SettingsBaseCocoa.mm:
2346         (WebCore::SettingsBase::textAutosizingUsesIdempotentMode):
2347         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
2348         * rendering/RenderBlockFlow.cpp:
2349         (WebCore::idempotentTextSize): Describe a piecewise-linear curve for the text size to follow. The curve scales
2350         depending on the viewport's initial scale.
2351         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
2352         * rendering/RenderBlockFlow.h:
2353         * rendering/RenderElement.cpp:
2354         (WebCore::includeNonFixedHeight): This new mode should consider max-height as well as height when determining if
2355         content overflows.
2356         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
2357         (WebCore::RenderElement::resetTextAutosizing):
2358         * rendering/RenderElement.h:
2359         * rendering/RenderObject.h:
2360
2361 2019-04-25  Simon Fraser  <simon.fraser@apple.com>
2362
2363         REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures
2364         https://bugs.webkit.org/show_bug.cgi?id=188357
2365         <rdar://problem/42986633>
2366
2367         Reviewed by Dean Jackson.
2368
2369         DumpRenderTree had no code that set page.setCompositingPolicyOverride() to Normal, so some
2370         tests would fall into low memory mode and have different behavior.
2371         
2372         Fix by moving the code that calls setCompositingPolicyOverride(Normal) from the WK2 layer
2373         to Internals, so it's shared by DRT and WTR.
2374         
2375         We no longer need the WK2 C SPI glue.
2376
2377         * testing/Internals.cpp:
2378         (WebCore::Internals::resetToConsistentState):
2379
2380 2019-04-25  Sihui Liu  <sihui_liu@apple.com>
2381
2382         [ iOS Sim ] REGRESSION (r242986) Layout Test storage/indexeddb/modern/idbtransaction-objectstore-failures-private.html is a flaky failure
2383         https://bugs.webkit.org/show_bug.cgi?id=196357
2384         <rdar://problem/49386836>
2385
2386         Reviewed by Geoffrey Garen.
2387
2388         Dispatch IDBRequest event to IDBTransaction if event of IDBTransaction has not been dispatched.
2389
2390         Covered by existing tests.
2391
2392         * Modules/indexeddb/IDBRequest.cpp:
2393         (WebCore::IDBRequest::dispatchEvent):
2394         * Modules/indexeddb/IDBTransaction.cpp:
2395         (WebCore::IDBTransaction::dispatchEvent):
2396         * Modules/indexeddb/IDBTransaction.h:
2397
2398 2019-04-25  Chris Dumez  <cdumez@apple.com>
2399
2400         ASSERT(scriptExecutionContext()) in Performance::resourceTimingBufferFullTimerFired()
2401         https://bugs.webkit.org/show_bug.cgi?id=197300
2402         <rdar://problem/49965990>
2403
2404         Reviewed by Youenn Fablet.
2405
2406         We crash because the scriptExecutionContext has been destroyed by the time the m_resourceTimingBufferFullTimer
2407         timer fires. However, r241598 already makes sure that we stop the timer when the script execution context
2408         is destroyed. This makes me think that somebody restarts the timer *after* the script execution context has
2409         been destroyed. The thing is that we only start the timer in Performance::addResourceTiming() and there are
2410         only 2 call sites for this method. Both call sites get the Performance object from the Window object, which
2411         they get from the Document object. As a result, I would believe that the Window's document is alive, even
2412         though the Performance object's scriptExecutionContext is not. This could indicate that the Performance
2413         object's scriptExecutionContext gets out of sync with its Window's document. I have found one place where
2414         it could happen in theory (DOMWindow::didSecureTransitionTo()). I have not been able to write a test
2415         confirming my theory though so this is a speculative fix. I have also added a few assertions to help us
2416         track down the issue if my speculative fix turns out to be ineffective.
2417
2418         No new tests, we do not know how to reproduce.
2419
2420         * page/DOMWindow.cpp:
2421         (WebCore::DOMWindow::didSecureTransitionTo):
2422         This is a speculative fix for the crash. When a DOMWindow transitions from one document to
2423         another, reset its data members which store the DOMWindow's document to make sure that they
2424         do not get out of sync.
2425
2426         (WebCore::DOMWindow::crypto const):
2427         (WebCore::DOMWindow::navigator):
2428         (WebCore::DOMWindow::performance const):
2429         Add assertions to make sure that the member's scriptExecutionContext is in sync with
2430         the window's.
2431
2432         * page/Performance.cpp:
2433         (WebCore::Performance::addResourceTiming):
2434         Add assertion to make sure that the scriptExecutionContext() is non-null when calling this
2435         as this may start the m_resourceTimingBufferFullTimer timer. If my speculative fix above
2436         does not work, we should hit this and this should tell us which call site is causing this.
2437
2438 2019-04-25  Timothy Hatcher  <timothy@apple.com>
2439
2440         Disable ContentChangeObserver on iOSMac.
2441         https://bugs.webkit.org/show_bug.cgi?id=197292
2442         rdar://problem/49039957
2443
2444         Reviewed by Zalan Bujtas.
2445
2446         We don’t need to run any of ContentChangeObserver, because we have hover events on iOSMac.
2447         Disabling it skips the synthetic mouse move events and speeds up clicks.
2448
2449         * page/SettingsBase.cpp:
2450         (WebCore::SettingsBase::defaultContentChangeObserverEnabled): Return false for PLATFORM(IOSMAC).
2451
2452 2019-04-25  Timothy Hatcher  <timothy@apple.com>
2453
2454         Disable date and time inputs on iOSMac.
2455         https://bugs.webkit.org/show_bug.cgi?id=197287
2456         rdar://problem/46794376
2457
2458         Reviewed by Wenson Hsieh.
2459
2460         * Configurations/FeatureDefines.xcconfig:
2461         * platform/text/mac/LocaleMac.h:
2462         * platform/text/mac/LocaleMac.mm:
2463         (WebCore::LocaleMac::formatDateTime):
2464
2465 2019-04-25  Alex Christensen  <achristensen@webkit.org>
2466
2467         Fix more Windows builds after r244653
2468         https://bugs.webkit.org/show_bug.cgi?id=197131
2469
2470         * svg/properties/SVGAnimatedPropertyList.h:
2471         * svg/properties/SVGProperty.h:
2472         * svg/properties/SVGPropertyList.h:
2473
2474 2019-04-25  Alex Christensen  <achristensen@webkit.org>
2475
2476         Fix more builds after r244653
2477         https://bugs.webkit.org/show_bug.cgi?id=197131
2478
2479         * svg/properties/SVGValuePropertyList.h:
2480         Something is preventing MSVC from seeing protected constructors from subclasses.
2481
2482 2019-04-25  Per Arne Vollan  <pvollan@apple.com>
2483
2484         -[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
2485         https://bugs.webkit.org/show_bug.cgi?id=196991
2486         <rdar://problem/45507423>
2487
2488         Reviewed by Alex Christensen.
2489
2490         Add method to get all origins with persistent credentials from credential storage.
2491
2492         API tests: WKWebsiteDataStore.FetchNonPersistentCredentials
2493                    WKWebsiteDataStore.FetchPersistentCredentials
2494
2495         * platform/network/CredentialStorage.h:
2496         * platform/network/mac/CredentialStorageMac.mm:
2497         (WebCore::CredentialStorage::originsWithPersistentCredentials):
2498
2499 2019-04-25  Alex Christensen  <achristensen@webkit.org>
2500
2501         Fix MSVC build after r244653
2502         https://bugs.webkit.org/show_bug.cgi?id=197131
2503
2504         * svg/properties/SVGValueProperty.h:
2505         MSVC doesn't think it can access these protected constructors from subclasses.
2506         Make the build work and investigate this later.
2507
2508 2019-04-25  Alex Christensen  <achristensen@webkit.org>
2509
2510         Start using C++17
2511         https://bugs.webkit.org/show_bug.cgi?id=197131
2512
2513         Reviewed by Darin Adler.
2514
2515         * Configurations/Base.xcconfig:
2516         * DerivedSources.make:
2517
2518 2019-04-25  Commit Queue  <commit-queue@webkit.org>
2519
2520         Unreviewed, rolling out r244627.
2521         https://bugs.webkit.org/show_bug.cgi?id=197282
2522
2523         Causing internal build failures (Requested by ShawnRoberts on
2524         #webkit).
2525
2526         Reverted changeset:
2527
2528         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
2529         https://bugs.webkit.org/show_bug.cgi?id=197171
2530         https://trac.webkit.org/changeset/244627
2531
2532 2019-04-25  Antti Koivisto  <antti@apple.com>
2533
2534         redefinition of enumerator 'NSAttachmentCharacter' with Apple internal build
2535         https://bugs.webkit.org/show_bug.cgi?id=197279
2536
2537         Reviewed by Antoine Quint.
2538
2539         Try to fix the build.
2540
2541         * platform/mac/WebNSAttributedStringExtras.mm:
2542
2543 2019-04-25  Antti Koivisto  <antti@apple.com>
2544
2545         Visited link hash should be computed only once
2546         https://bugs.webkit.org/show_bug.cgi?id=197229
2547         <rdar://problem/48438924>
2548
2549         Reviewed by Alex Christensen.
2550
2551         Test: fast/history/visited-href-mutation.html
2552
2553         Visited link style is now based on the first target URL of the link element. Further href mutations don't affect styling.
2554
2555         * dom/Document.cpp:
2556         (WebCore::Document::updateBaseURL):
2557         * dom/VisitedLinkState.cpp:
2558         (WebCore::linkAttribute):
2559         (WebCore::linkHashForElement):
2560
2561         Visited link support is now limited to HTML and SVG <a> elements.
2562
2563         (WebCore::VisitedLinkState::invalidateStyleForLink):
2564         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
2565         * html/HTMLAnchorElement.cpp:
2566         (WebCore::HTMLAnchorElement::HTMLAnchorElement):
2567         (WebCore::HTMLAnchorElement::parseAttribute):
2568         * html/HTMLAnchorElement.h:
2569         (WebCore::HTMLAnchorElement::visitedLinkHash const):
2570         (WebCore::HTMLAnchorElement::invalidateCachedVisitedLinkHash): Deleted.
2571         * svg/SVGAElement.cpp:
2572         (WebCore::SVGAElement::visitedLinkHash const):
2573         * svg/SVGAElement.h:
2574
2575 2019-04-25  Philippe Normand  <pnormand@igalia.com>
2576
2577         [GStreamer] gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed in WebCore::MediaPlayerPrivateGStreamer::paused
2578         https://bugs.webkit.org/show_bug.cgi?id=196691
2579
2580         Reviewed by Eric Carlson.
2581
2582         For gif assets, fail media loading early and notify the
2583         MediaPlayer by setting both network and ready states, so that the
2584         MediaPlayer will try with with the next media engine or pass the
2585         error to HTMLMediaElement if there are none.
2586
2587         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2588         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2589         (WebCore::MediaPlayerPrivateGStreamer::loadingFailed):
2590         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2591
2592 2019-04-25  Philippe Normand  <pnormand@igalia.com>
2593
2594         [REGRESSION(r243197)][GStreamer] http/tests/media/clearkey/collect-webkit-media-session.html hits an ASSERT
2595         https://bugs.webkit.org/show_bug.cgi?id=197230
2596
2597         Reviewed by Xabier Rodriguez-Calvar.
2598
2599         Perform the resource loader disposal and destruction from the main
2600         thread. Also ensure there's no circular reference between the
2601         CachedResourceStreamingClient and WebKitWebSrc when disposing of
2602         the private WebKitWebSrc storage.
2603
2604         * platform/graphics/gstreamer/MainThreadNotifier.h:
2605         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2606         (_WebKitWebSrcPrivate::~_WebKitWebSrcPrivate):
2607         (webkit_web_src_class_init):
2608         (webKitWebSrcDispose):
2609         (webKitWebSrcCloseSession):
2610         (webKitWebSrcFinalize): Deleted.
2611
2612 2019-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2613
2614         [GTK] Hardcoded text color in input fields
2615         https://bugs.webkit.org/show_bug.cgi?id=126907
2616
2617         Reviewed by Michael Catanzaro.
2618
2619         Enable HAVE_OS_DARK_MODE_SUPPORT for GTK port to ensure that dark mode is used when Page::useDarkAppearance()
2620         returns true. This patch reverts r232913, I'll reopen the bug, I think we need to find a better solution for
2621         that.
2622
2623         * CMakeLists.txt: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_DEFINES_WITH_SPACE_SEPARATOR if enabled.
2624         * css/CSSDefaultStyleSheets.cpp: Ensure html{color:text} is used in simple style sheet when
2625         HAVE_OS_DARK_MODE_SUPPORT is enabled.
2626         * page/FrameView.cpp:
2627         (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindowframe to get the frame view background
2628         color when HAVE_OS_DARK_MODE_SUPPORT is enabled for non-mac ports.
2629         * platform/gtk/RenderThemeWidget.cpp:
2630         (WebCore::RenderThemeWidget::getOrCreate): Create window widget.
2631         (WebCore::RenderThemeWindow::RenderThemeWindow): Add window widget.
2632         * platform/gtk/RenderThemeWidget.h:
2633         * rendering/RenderThemeGtk.cpp:
2634         (WebCore::RenderThemeGtk::disabledTextColor const): Always use the color from the theme for consistency with
2635         other form controls.
2636         (WebCore::RenderThemeGtk::systemColor const): Get the color from the theme for CSSValueText, CSSValueGraytext
2637         and CSSValueWindowframe.
2638         * rendering/RenderThemeGtk.h:
2639
2640 2019-04-24  Zalan Bujtas  <zalan@apple.com>
2641
2642         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
2643         https://bugs.webkit.org/show_bug.cgi?id=196948
2644         <rdar://problem/49927131>
2645
2646         Reviewed by Tim Horton.
2647
2648         Covered by existing tests.
2649
2650         * loader/EmptyClients.h:
2651         * page/ChromeClient.h:
2652         * page/FrameView.cpp:
2653         (WebCore::FrameView::autoSizeIfEnabled):
2654         (WebCore::FrameView::enableAutoSizeMode):
2655         * page/FrameView.h:
2656
2657 2019-04-24  Youenn Fablet  <youenn@apple.com>
2658
2659         Do not restart WebRTC stats timer if backend is stopped
2660         https://bugs.webkit.org/show_bug.cgi?id=197257
2661         <rdar://problem/50095879>
2662
2663         Reviewed by Eric Carlson.
2664
2665         We used to stop and reschedule the stat gathering timer in case the
2666         gathering delay is changing. Timer should not be rescheduled if the backend is stopped.
2667
2668         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2669         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
2670
2671 2019-04-24  Andres Gonzalez  <andresg_22@apple.com>
2672
2673         Flaky crash under WebCore::AXObjectCache::stopCachingComputedObjectAttributes()
2674         https://bugs.webkit.org/show_bug.cgi?id=187391
2675         <rdar://problem/40681396
2676
2677         Check for null value returned by AccessibilityObject::axObjectCache.
2678
2679         Reviewed by Chris Fleizach.
2680
2681         No need for new test since existing tests caught this problem.
2682
2683         * accessibility/AccessibilityNodeObject.cpp:
2684         (WebCore::AccessibilityNodeObject::firstChild const):
2685         (WebCore::AccessibilityNodeObject::lastChild const):
2686         (WebCore::AccessibilityNodeObject::previousSibling const):
2687         (WebCore::AccessibilityNodeObject::nextSibling const):
2688         (WebCore::AccessibilityNodeObject::addChildren):
2689         (WebCore::AccessibilityNodeObject::anchorElement const):
2690         (WebCore::AccessibilityNodeObject::changeValueByStep):
2691         (WebCore::AccessibilityNodeObject::changeValueByPercent):
2692         (WebCore::AccessibilityNodeObject::textForLabelElement const):
2693         (WebCore::AccessibilityNodeObject::titleElementText const):
2694         (WebCore::AccessibilityNodeObject::alternativeText const):
2695         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
2696         (WebCore::AccessibilityNodeObject::helpText const):
2697
2698 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
2699
2700         REGRESSION (r242132): Nested position:sticky elements move incorrectly
2701         https://bugs.webkit.org/show_bug.cgi?id=197255
2702         rdar://problem/50137744
2703
2704         Reviewed by Zalan Bujtas.
2705         
2706         Revert to the behavior of the code before r242132, where we looked at the direct parent
2707         scrolling tree node instead of walking up the ancestor chain to find an enclosing scrolling node.
2708         This fixes nested sticky behavior.
2709
2710         Test: scrollingcoordinator/mac/nested-sticky.html
2711
2712         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2713         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
2714
2715 2019-04-24  Eric Carlson  <eric.carlson@apple.com>
2716
2717         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
2718         https://bugs.webkit.org/show_bug.cgi?id=197171
2719         <rdar://problem/47454979>
2720
2721         Reviewed by Youenn Fablet.
2722
2723         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
2724
2725         * Modules/plugins/QuickTimePluginReplacement.mm:
2726         (WebCore::jsValueWithValueInContext):
2727         (WebCore::jsValueWithAVMetadataItemInContext):
2728         * WebCore.xcodeproj/project.pbxproj:
2729         * platform/audio/ios/AudioSessionIOS.mm:
2730         (WebCore::AudioSession::setCategory):
2731         (WebCore::AudioSession::category const):
2732         (WebCore::AudioSession::routeSharingPolicy const):
2733         (WebCore::AudioSession::routingContextUID const):
2734         (WebCore::AudioSession::sampleRate const):
2735         (WebCore::AudioSession::bufferSize const):
2736         (WebCore::AudioSession::numberOfOutputChannels const):
2737         (WebCore::AudioSession::tryToSetActiveInternal):
2738         (WebCore::AudioSession::preferredBufferSize const):
2739         (WebCore::AudioSession::setPreferredBufferSize):
2740         * platform/audio/ios/MediaSessionManagerIOS.mm:
2741         (-[WebMediaSessionHelper initWithCallback:]):
2742         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
2743         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2744         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
2745         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
2746         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
2747         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2748         (WebCore::AudioSourceProviderAVFObjC::createMix):
2749         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2750         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
2751         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
2752         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
2753         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
2754         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
2755         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2756         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
2757         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
2758         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
2759         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
2760         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
2761         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
2762         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
2763         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
2764         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2765         (WebCore::CDMSessionAVContentKeySession::isAvailable):
2766         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
2767         (WebCore::CDMSessionAVContentKeySession::update):
2768         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
2769         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
2770         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2771         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2772         (WebCore::CDMSessionAVStreamSession::releaseKeys):
2773         (WebCore::CDMSessionAVStreamSession::update):
2774         (WebCore::CDMSessionAVStreamSession::setStreamSession):
2775         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
2776         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2777         (WebCore::imageDecoderAssetOptions):
2778         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
2779         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
2780         (WebCore::ImageDecoderAVFObjC::readSamples):
2781         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
2782         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
2783         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
2784         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
2785         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
2786         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2787         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
2788         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2789         (WebCore::assetCacheForPath):
2790         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
2791         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
2792         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2793         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
2794         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2795         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
2796         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2797         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
2798         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2799         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
2800         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
2801         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
2802         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
2803         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
2804         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
2805         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
2806         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
2807         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
2808         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
2809         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
2810         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
2811         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
2812         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
2813         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
2814         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
2815         (WebCore::exernalDeviceDisplayNameForPlayer):
2816         (WebCore::metadataType):
2817         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2818         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2819         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
2820         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
2821         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
2822         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2823         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2824         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
2825         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
2826         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
2827         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
2828         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2829         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
2830         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
2831         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2832         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2833         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2834         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2835         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
2836         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2837         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2838         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2839         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
2840         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2841         (WebCore::PlatformCALayerCocoa::clone const):
2842         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
2843         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
2844         (WebCore::validateHEVCParameters):
2845         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
2846         (getAVSpeechUtteranceDefaultSpeechRate):
2847         (getAVSpeechUtteranceMaximumSpeechRate):
2848         (-[WebSpeechSynthesisWrapper speakUtterance:]):
2849         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
2850         (SOFT_LINK_CONSTANT): Deleted.
2851         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2852         (-[WebAVPlayerLayer init]):
2853         (-[WebAVPlayerLayer layoutSublayers]):
2854         (-[WebAVPlayerLayer setVideoGravity:]):
2855         (-[WebAVPlayerLayer videoRect]):
2856         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
2857         * platform/mac/SerializedPlatformRepresentationMac.mm:
2858         (WebCore::jsValueWithValueInContext):
2859         (WebCore::jsValueWithAVMetadataItemInContext):
2860         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2861         (WebCore::getAVFormatIDKeyWithFallback):
2862         (WebCore::getAVNumberOfChannelsKeyWithFallback):
2863         (WebCore::getAVSampleRateKeyWithFallback):
2864         (WebCore::getAVEncoderBitRateKeyWithFallback):
2865         (WebCore::MediaRecorderPrivateWriter::create):
2866         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
2867         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
2868         * platform/mediastream/RealtimeVideoSource.h:
2869         * platform/mediastream/VideoPreset.h:
2870         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
2871         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
2872         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
2873         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
2874         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
2875         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2876         (WebCore::deviceIsAvailable):
2877         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
2878         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
2879         (WebCore::AVCaptureDeviceManager::isAvailable):
2880         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
2881         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2882         (WebCore::AVVideoPreset::create):
2883         (WebCore::AVVideoPreset::AVVideoPreset):
2884         (WebCore::AVVideoCaptureSource::create):
2885         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
2886         (WebCore::AVVideoCaptureSource::capabilities):
2887         (WebCore::sensorOrientationFromVideoOutput):
2888         (WebCore::AVVideoCaptureSource::setupSession):
2889         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
2890         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2891         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2892         (WebCore::AVVideoCaptureSource::generatePresets):
2893         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
2894         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
2895
2896 2019-04-24  Brady Eidson  <beidson@apple.com>
2897
2898         XMLHTTPRequest POSTs to a custom WKURLSchemeHandler protocol are missing the HTTP body.
2899         https://bugs.webkit.org/show_bug.cgi?id=191362
2900
2901         Reviewed by Alex Christensen.
2902
2903         Covered by new API tests.
2904
2905         In 2008 some refactoring added an HTTP(S)-only restriction to copying the form body for
2906         XHRs that POST, and it added that restriction with no explanation.
2907
2908         We definitely want to allow that.
2909
2910         Blobs are broken at this time (covered by bug 197237)
2911
2912         * xml/XMLHttpRequest.cpp:
2913         (WebCore::XMLHttpRequest::send):
2914         (WebCore::XMLHttpRequest::sendBytesData):
2915
2916 2019-04-24  John Wilander  <wilander@apple.com>
2917
2918         Age out unconverted Ad Click Attributions after one week.
2919         https://bugs.webkit.org/show_bug.cgi?id=197238
2920         <rdar://problem/50177349>
2921
2922         Reviewed by Chris Dumez.
2923
2924         This patch adds the two functions AdClickAttribution::markAsExpired()
2925         and AdClickAttribution::hasExpired() which make use of the existing
2926         m_timeOfAdClick member.
2927
2928         Test: http/tests/adClickAttribution/expired-attributions-removed.html
2929
2930         * loader/AdClickAttribution.cpp:
2931         (WebCore::AdClickAttribution::markAsExpired):
2932         (WebCore::AdClickAttribution::hasExpired const):
2933         * loader/AdClickAttribution.h:
2934
2935 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
2936
2937         REGRESSION (iOS 12.2): CSS perspective property value can only be set correctly once
2938         https://bugs.webkit.org/show_bug.cgi?id=197105
2939         rdar://problem/50068230
2940
2941         Reviewed by Zalan Bujtas.
2942
2943         Make sure we trigger a geometry update when style properties change that
2944         result in a StyleDifference::RecompositeLayer, and which are updated on layers
2945         via RenderLayerBacking::updateGeometry().
2946
2947         Tests: compositing/style-change/backface-visibility-change.html
2948                compositing/style-change/perspective-change.html
2949                compositing/style-change/perspective-origin-change.html
2950                compositing/style-change/transform-origin-change.html
2951                compositing/style-change/transform-style-change.html
2952
2953         * rendering/RenderLayerCompositor.cpp:
2954         (WebCore::recompositeChangeRequiresGeometryUpdate):
2955         (WebCore::RenderLayerCompositor::layerStyleChanged):
2956
2957 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
2958
2959         Make it possible to control the renderTreeAsText output by setting options on testRunner
2960         https://bugs.webkit.org/show_bug.cgi?id=197133
2961
2962         Reviewed by Sam Weinig.
2963
2964         Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags
2965         that make sense in testing (those that don't dump unstable data like addresses), and plumb
2966         these flags through the various framework layers.
2967
2968         Convert RenderAsTextBehavior to an OptionSet<RenderAsTextFlag>.
2969
2970         Fix code generation in WebKitTestRunner to generate bindings for IDL const values,
2971         and hand-code DumpRenderTree bindings.
2972
2973         Some cleanup of the TestRunners, using member initializers.
2974
2975         Test: fast/harness/render-tree-as-text-options.html
2976
2977         * rendering/RenderLayer.cpp:
2978         (WebCore::showLayerTree):
2979         * rendering/RenderTreeAsText.cpp:
2980         (WebCore::RenderTreeAsText::writeRenderObject):
2981         (WebCore::writeDebugInfo):
2982         (WebCore::write):
2983         (WebCore::writeLayer):
2984         (WebCore::writeLayerRenderers):
2985         (WebCore::writeLayers):
2986         (WebCore::externalRepresentation):
2987         * rendering/RenderTreeAsText.h:
2988         (WebCore::externalRepresentation):
2989         (WebCore::write):
2990         (WebCore::writeDebugInfo):
2991         (): Deleted.
2992         * rendering/svg/SVGRenderTreeAsText.cpp:
2993         (WebCore::writePositionAndStyle):
2994         (WebCore::writeStandardPrefix):
2995         (WebCore::writeChildren):
2996         (WebCore::writeSVGResourceContainer):
2997         (WebCore::writeSVGContainer):
2998         (WebCore::write):
2999         (WebCore::writeSVGText):
3000         (WebCore::writeSVGInlineText):
3001         (WebCore::writeSVGImage):
3002         (WebCore::writeSVGGradientStop):
3003         (WebCore::writeResources):
3004         * rendering/svg/SVGRenderTreeAsText.h:
3005
3006 2019-04-24  Antoine Quint  <graouts@apple.com>
3007
3008         [iOS] Calling preventDefault() when handling a pointerdown event should not prevent panning, zooming or click event dispatch
3009         https://bugs.webkit.org/show_bug.cgi?id=195839
3010         <rdar://problem/48946154>
3011
3012         Reviewed by Brent Fulgham.
3013
3014         Tests: pointerevents/ios/pointer-events-prevent-default-allows-click-event.html
3015                pointerevents/ios/pointer-events-prevent-default-allows-scrolling.html
3016
3017         The Pointer Events specification defines that the default action of any and all pointer events MUST NOT
3018         be a manipulation of the viewport (e.g. panning or zooming). In practice, this means that calling
3019         preventDefault() while handling a Pointer Event has no effect on the inner workings of the user agent,
3020         so we change the method signature of PointerCaptureController::dispatchEventForTouchAtIndex() to return
3021         void since we don't need to know whether preventDefault() was called.
3022
3023         https://www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-behaviors
3024
3025         * page/PointerCaptureController.cpp:
3026         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
3027         * page/PointerCaptureController.h:
3028
3029 2019-04-24  Frederic Wang  <fwang@igalia.com>
3030
3031         With async scrolling enabled, this MathML test asserts
3032         https://bugs.webkit.org/show_bug.cgi?id=196123
3033
3034         This patch ensures that updateScrollInfoAfterLayout() is called during MathML layout. This
3035         fixes assertions when async scrolling is enabled and MathML elements have non-visible overflow.
3036
3037         Reviewed by Rob Buis.
3038
3039         Test: mathml/mathml-overflow-crash.html
3040
3041         * rendering/mathml/RenderMathMLBlock.cpp:
3042         (WebCore::RenderMathMLBlock::layoutBlock):
3043         (WebCore::RenderMathMLBlock::layoutInvalidMarkup):
3044         * rendering/mathml/RenderMathMLFraction.cpp:
3045         (WebCore::RenderMathMLFraction::layoutBlock):
3046         * rendering/mathml/RenderMathMLMath.cpp:
3047         (WebCore::RenderMathMLMath::layoutBlock):
3048         * rendering/mathml/RenderMathMLMenclose.cpp:
3049         (WebCore::RenderMathMLMenclose::layoutBlock):
3050         * rendering/mathml/RenderMathMLOperator.cpp:
3051         (WebCore::RenderMathMLOperator::layoutBlock):
3052         * rendering/mathml/RenderMathMLPadded.cpp:
3053         (WebCore::RenderMathMLPadded::layoutBlock):
3054         * rendering/mathml/RenderMathMLRoot.cpp:
3055         (WebCore::RenderMathMLRoot::layoutBlock):
3056         * rendering/mathml/RenderMathMLRow.cpp:
3057         (WebCore::RenderMathMLRow::layoutBlock):
3058         * rendering/mathml/RenderMathMLScripts.cpp:
3059         (WebCore::RenderMathMLScripts::layoutBlock):
3060         * rendering/mathml/RenderMathMLSpace.cpp:
3061         (WebCore::RenderMathMLSpace::layoutBlock):
3062         * rendering/mathml/RenderMathMLToken.cpp:
3063         (WebCore::RenderMathMLToken::layoutBlock):
3064         * rendering/mathml/RenderMathMLUnderOver.cpp:
3065         (WebCore::RenderMathMLUnderOver::layoutBlock):
3066
3067 2019-04-24  Greg V  <greg@unrelenting.technology>
3068
3069         Fix -Wc++11-narrowing on unsigned char platforms like FreeBSD/aarch64
3070         https://bugs.webkit.org/show_bug.cgi?id=197148
3071
3072         Reviewed by Alex Christensen.
3073
3074         * contentextensions/DFACombiner.cpp:
3075         * contentextensions/NFAToDFA.cpp:
3076
3077 2019-04-24  Chris Dumez  <cdumez@apple.com>
3078
3079         X-Frame-Options header should be ignored when frame-ancestors CSP directive is present
3080         https://bugs.webkit.org/show_bug.cgi?id=197226
3081         <rdar://problem/50155649>
3082
3083         Reviewed by Alex Christensen.
3084
3085         X-Frame-Options header should be ignored when frame-ancestors CSP directive is present:
3086         - https://www.w3.org/TR/CSP3/#frame-ancestors-and-frame-options
3087
3088         Specification says:
3089         """
3090         In order to allow backwards-compatible deployment, the frame-ancestors directive _obsoletes_ the
3091         X-Frame-Options header. If a resource is delivered with an policy that includes a directive named
3092         frame-ancestors and whose disposition is "enforce", then the X-Frame-Options header MUST be ignored.
3093         """
3094
3095         Gecko and Blink follow the specification, WebKit does not. As a result, page [1] is broken with
3096         WebKit-only on Schwab.com. The page height is wrong and you cannot see all the ETFs as a result.
3097
3098         [1] https://www.schwab.com/public/schwab/investing/investment_help/investment_research/etf_research/etfs.html?&path=/Prospect/Research/etfs/overview/oneSourceETFs.asp
3099
3100         Test: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-overrides-X-Frames-Options.html
3101
3102         * loader/DocumentLoader.cpp:
3103         (WebCore::DocumentLoader::responseReceived):
3104         * page/csp/ContentSecurityPolicy.cpp:
3105         (WebCore::ContentSecurityPolicy::overridesXFrameOptions const):
3106         * page/csp/ContentSecurityPolicy.h:
3107         * page/csp/ContentSecurityPolicyDirectiveList.h:
3108         (WebCore::ContentSecurityPolicyDirectiveList::hasFrameAncestorsDirective const):
3109
3110 2019-04-24  Zalan Bujtas  <zalan@apple.com>
3111
3112         [ContentChangeObserver] Do not use the global _WKContentChange in WebKitLegacy
3113         https://bugs.webkit.org/show_bug.cgi?id=196286
3114         <rdar://problem/49364417>
3115
3116         Reviewed by Simon Fraser.
3117
3118         By reporting WKContentIndeterminateChange in sendMouseMoveEvent enables us to remove the global _WKContentChange state.
3119         Using _WKContentChange is fine as long as only the observed frame reports content change during the synthetic click event.
3120         In case of multiple frames, we should really consult the local state instead.
3121         Unfortunately sendMouseMoveEvent has no access to the observed Document object so we can't really identify the observed content change.
3122         WKContentIndeterminateChange triggers asynchronous decision making at the callsite and in the callback we have access
3123         to the active Document/ContentChangeObverver object and can report the correct state.
3124         This is inline with current WebKit(WK2) behaviour.
3125
3126         Manually tested with a WebKitLegacy test app.
3127
3128         * SourcesCocoa.txt:
3129         * WebCore.xcodeproj/project.pbxproj:
3130         * page/ios/ContentChangeObserver.h:
3131         (WebCore::ContentChangeObserver::setHasNoChangeState):
3132         (WebCore::ContentChangeObserver::setHasIndeterminateState):
3133         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
3134         (WebCore::ContentChangeObserver::setObservedContentState): Deleted.
3135         * page/ios/EventHandlerIOS.mm:
3136         (WebCore::EventHandler::mouseMoved):
3137         * platform/ios/wak/WAKWindow.mm:
3138         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
3139         * platform/ios/wak/WKContentObservation.cpp: Removed.
3140         * platform/ios/wak/WKContentObservation.h:
3141
3142 2019-04-24  Philippe Normand  <pnormand@igalia.com>
3143
3144         [GTK][GStreamer] Flaky ASSERTION FAILED: m_lock.isHeld() in TextureMapperPlatformLayerProxy
3145         https://bugs.webkit.org/show_bug.cgi?id=196739
3146
3147         Reviewed by Xabier Rodriguez-Calvar.
3148
3149         The crash was triggered because m_videoDecoderPlatform not being
3150         explicitely set, its value would be inferred as one of the enum
3151         class values. Making it Optional avoids this issue.
3152
3153         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3154
3155 2019-04-24  Philippe Normand  <pnormand@igalia.com>
3156
3157         [GStreamer] Crash in AudioTrackPrivate with playbin3 enabled
3158         https://bugs.webkit.org/show_bug.cgi?id=196913
3159
3160         Reviewed by Xabier Rodriguez-Calvar.
3161
3162         The crash was due to a playbin3 code path being triggered during
3163         MSE playback, which is not supposed to work in playbin3 anyway.
3164         The problem is that setting the USE_PLAYBIN3 environment variable
3165         to "1" makes the GStreamer playback plugin register the playbin3
3166         element under the playbin name. So that leads to playbin3 being
3167         used everywhere in WebKit where we assume the playbin element is
3168         used. So the proposed solution is to:
3169
3170         - use a WebKit-specific environment variable instead of the
3171         GStreamer USE_PLAYBIN3 variable.
3172         - emit a warning if the USE_PLAYBIN3 environment variable is
3173         detected. We can't unset it ourselves for security reasons.
3174
3175         The patch also includes a code cleanup of the player method
3176         handling the pipeline creation. The previous code had a bug
3177         leading to playbin3 being used for MSE.
3178
3179         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3180         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3181
3182 2019-04-24  chris fleizach  <cfleizach@apple.com>
3183
3184         AX: Remove deprecated Accessibility Object Model events
3185         https://bugs.webkit.org/show_bug.cgi?id=197073
3186         <rdar://problem/50027819>
3187
3188         Reviewed by Ryosuke Niwa.
3189
3190         Test: accessibility/mac/replace-text-with-range.html
3191
3192         * DerivedSources.make:
3193         * Sources.txt:
3194         * WebCore.xcodeproj/project.pbxproj:
3195         * accessibility/AccessibilityListBoxOption.cpp:
3196         (WebCore::AccessibilityListBoxOption::setSelected):
3197         * accessibility/AccessibilityMediaObject.cpp:
3198         (WebCore::AccessibilityMediaObject::increment):
3199         (WebCore::AccessibilityMediaObject::decrement):
3200         * accessibility/AccessibilityMenuListOption.cpp:
3201         (WebCore::AccessibilityMenuListOption::setSelected):
3202         * accessibility/AccessibilityNodeObject.cpp:
3203         (WebCore::AccessibilityNodeObject::increment):
3204         (WebCore::AccessibilityNodeObject::decrement):
3205         * accessibility/AccessibilityObject.cpp:
3206         (WebCore::AccessibilityObject::press):
3207         (WebCore::AccessibilityObject::replaceTextInRange):
3208         (WebCore::AccessibilityObject::scrollToMakeVisible const):
3209         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const): Deleted.
3210         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const): Deleted.
3211         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const): Deleted.
3212         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const): Deleted.
3213         * accessibility/AccessibilityObject.h:
3214         * accessibility/AccessibilityRenderObject.cpp:
3215         (WebCore::AccessibilityRenderObject::setFocused):
3216         (WebCore::AccessibilityRenderObject::setValue):
3217         * accessibility/AccessibilityScrollbar.cpp:
3218         (WebCore::AccessibilityScrollbar::setValue):
3219         * accessibility/AccessibilitySlider.cpp:
3220         (WebCore::AccessibilitySlider::setValue):
3221         * accessibility/ios/AccessibilityObjectIOS.mm:
3222         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3223         (WebCore::AccessibilityObject::hasAccessibleDismissEventListener const): Deleted.
3224         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3225         (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]): Deleted.
3226         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]): Deleted.
3227         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3228         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
3229         * dom/Element.idl:
3230         * dom/EventNames.h:
3231         * dom/EventNames.in:
3232         * html/HTMLAttributeNames.in:
3233         * html/HTMLElement.cpp:
3234         (WebCore::HTMLElement::createEventHandlerNameMap):
3235         * page/Settings.yaml:
3236         * testing/InternalSettings.cpp:
3237         (WebCore::InternalSettings::Backup::Backup):
3238         (WebCore::InternalSettings::Backup::restoreTo):
3239         (WebCore::InternalSettings::setAccessibilityEventsEnabled): Deleted.
3240         * testing/InternalSettings.h:
3241         * testing/InternalSettings.idl:
3242
3243 2019-04-23  Andy Estes  <aestes@apple.com>
3244
3245         [iOS] QuickLook documents loaded from file: URLs should be allowed to perform same-document navigations
3246         https://bugs.webkit.org/show_bug.cgi?id=196749
3247         <rdar://problem/35773454>
3248
3249         Reviewed by Daniel Bates.
3250
3251         QuickLook previews are in a non-local origin defined by a unique x-apple-ql-id: URL, which
3252         isolates the origin that hosted the document from the document preview itself. When a
3253         QuickLook document is loaded as a file: URL, SecurityOrigin's protections against loading
3254         local resources from non-local origins prevented navigations like location.reload() and
3255         fragment navigations.
3256
3257         To allow reloads and same-document navigations in QuickLook documents loaded from file: URLs,
3258         we should grant the QuickLook document's SecurityOrigin access to the file path that loaded
3259         the preview.
3260
3261         Added a new API test.
3262
3263         * dom/Document.cpp:
3264         (WebCore::Document::applyQuickLookSandbox):
3265         * page/SecurityOrigin.cpp:
3266         (WebCore::SecurityOrigin::createNonLocalWithAllowedFilePath):
3267         (WebCore::SecurityOrigin::canDisplay const):
3268         * page/SecurityOrigin.h:
3269
3270 2019-04-23  Devin Rousso  <drousso@apple.com>
3271
3272         Web Inspector: Debugger: remove ASSERT_NOT_REACHED where it's possible to reach
3273         https://bugs.webkit.org/show_bug.cgi?id=197210
3274         <rdar://problem/48462912>
3275
3276         Reviewed by Joseph Pecoraro.
3277
3278         * inspector/agents/page/PageDebuggerAgent.cpp:
3279         (WebCore::PageDebuggerAgent::didAddEventListener):
3280         (WebCore::PageDebuggerAgent::didPostMessage):
3281
3282         * inspector/InspectorInstrumentation.cpp:
3283         (WebCore::InspectorInstrumentation::consoleAgentEnabled):
3284         (WebCore::InspectorInstrumentation::timelineAgentEnabled):
3285         Drive-by: add additional `FAST_RETURN_IF_NO_FRONTENDS`.
3286
3287 2019-04-23  Commit Queue  <commit-queue@webkit.org>
3288
3289         Unreviewed, rolling out r244556.
3290         https://bugs.webkit.org/show_bug.cgi?id=197212
3291
3292         Causing build failures on multiple builders (Requested by
3293         ShawnRoberts on #webkit).
3294
3295         Reverted changeset:
3296
3297         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
3298         https://bugs.webkit.org/show_bug.cgi?id=197171
3299         https://trac.webkit.org/changeset/244556
3300
3301 2019-04-23  Devin Rousso  <drousso@apple.com>
3302
3303         Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier')
3304         https://bugs.webkit.org/show_bug.cgi?id=196420
3305         <rdar://problem/49444205>
3306
3307         Reviewed by Timothy Hatcher.
3308
3309         Modify the existing `frameId` to represent the owner frame of the node, rather than the
3310         frame it holds (in the case of an `<iframe>`).
3311
3312         * inspector/agents/InspectorDOMAgent.cpp:
3313         (WebCore::InspectorDOMAgent::buildObjectForNode):
3314
3315 2019-04-23  Devin Rousso  <drousso@apple.com>
3316
3317         ContentSecurityPolicy::logToConsole should include line/column number and source location
3318         https://bugs.webkit.org/show_bug.cgi?id=114317
3319         <rdar://problem/13614617>
3320
3321         Reviewed by Timothy Hatcher.
3322
3323         No change in functionality.
3324
3325         * page/csp/ContentSecurityPolicy.h:
3326         * page/csp/ContentSecurityPolicy.cpp:
3327         (WebCore::ContentSecurityPolicy::reportViolation const):
3328         (WebCore::ContentSecurityPolicy::logToConsole const):
3329
3330 2019-04-23  Devin Rousso  <drousso@apple.com>
3331
3332         Web Inspector: Canvas: support recording TypedOMCSSImageValue
3333         https://bugs.webkit.org/show_bug.cgi?id=192609
3334
3335         Reviewed by Timothy Hatcher.
3336
3337         * inspector/InspectorCanvas.h:
3338         * inspector/InspectorCanvas.cpp:
3339         (WebCore::InspectorCanvas::indexForData):
3340         (WebCore::InspectorCanvas::buildAction):
3341
3342 2019-04-23  Andres Gonzalez  <andresg_22@apple.com>
3343
3344         Accessibility text search and selection API enhancements.
3345         https://bugs.webkit.org/show_bug.cgi?id=197095
3346         <rdar://problem/48181791>
3347
3348         Reviewed by Chris Fleizach.
3349
3350         - Split the existing SelectTextWithCriteria API into two: search text API (SearchTextWithCriteria) and a text operation API (TextOperation: select, replace, capitalize...).
3351         - This allows for more flexibility and extensibility.
3352         - Added the ability to retrieve text markers for multiple search hits.
3353         - Various code clean up and consolidation.
3354         - Added LayoutTest for search API.
3355         - Previous API is marked with "To be deprecated", and is implemented with new implementation. May be removed in a future change.
3356
3357         Test: accessibility/mac/search-text/search-text.html
3358
3359         * accessibility/AccessibilityObject.cpp:
3360         (WebCore::rangeClosestToRange):
3361         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
3362         (WebCore::AccessibilityObject::findTextRange const):
3363         (WebCore::AccessibilityObject::findTextRanges const):
3364         (WebCore::AccessibilityObject::performTextOperation):
3365         (WebCore::AccessibilityObject::frame const):
3366         (WebCore::AccessibilityObject::selectText): Deleted.
3367         * accessibility/AccessibilityObject.h:
3368         (WebCore::AccessibilitySearchTextCriteria::AccessibilitySearchTextCriteria):
3369         (WebCore::AccessibilityTextOperation::AccessibilityTextOperation):
3370         (WebCore::AccessibilitySelectTextCriteria::AccessibilitySelectTextCriteria): Deleted.
3371         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3372         (accessibilityTextCriteriaForParameterizedAttribute):
3373         (accessibilitySearchTextCriteriaForParameterizedAttribute):
3374         (accessibilityTextOperationForParameterizedAttribute):
3375         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
3376         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3377         (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute): Deleted.
3378
3379 2019-04-23  Guy Lewin  <guy@lewin.co.il>
3380
3381         Multiple File Input Icon Set Regardless of File List
3382         https://bugs.webkit.org/show_bug.cgi?id=195537
3383
3384         Reviewed by Alexey Proskuryakov.
3385
3386         File input elements display icon with an empty file list after
3387         resetting the file list in 'change' event handler - on iOS
3388
3389         Test: fast/forms/file/file-reset-in-change-using-open-panel-with-icon.html
3390
3391         * html/FileInputType.cpp:
3392         (WebCore::FileInputType::filesChosen):
3393
3394 2019-04-23  Eric Carlson  <eric.carlson@apple.com>
3395
3396         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
3397         https://bugs.webkit.org/show_bug.cgi?id=197171
3398         <rdar://problem/47454979>
3399
3400         Reviewed by Youenn Fablet.
3401
3402         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
3403
3404         * Modules/plugins/QuickTimePluginReplacement.mm:
3405         (WebCore::jsValueWithValueInContext):
3406         (WebCore::jsValueWithAVMetadataItemInContext):
3407         * WebCore.xcodeproj/project.pbxproj:
3408         * platform/audio/ios/AudioSessionIOS.mm:
3409         (WebCore::AudioSession::setCategory):
3410         (WebCore::AudioSession::category const):
3411         (WebCore::AudioSession::routeSharingPolicy const):
3412         (WebCore::AudioSession::routingContextUID const):
3413         (WebCore::AudioSession::sampleRate const):
3414         (WebCore::AudioSession::bufferSize const):
3415         (WebCore::AudioSession::numberOfOutputChannels const):
3416         (WebCore::AudioSession::tryToSetActiveInternal):
3417         (WebCore::AudioSession::preferredBufferSize const):
3418         (WebCore::AudioSession::setPreferredBufferSize):
3419         * platform/audio/ios/MediaSessionManagerIOS.mm:
3420         (-[WebMediaSessionHelper initWithCallback:]):
3421         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
3422         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3423         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
3424         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
3425         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
3426         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3427         (WebCore::AudioSourceProviderAVFObjC::createMix):
3428         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
3429         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3430         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
3431         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
3432         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
3433         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
3434         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3435         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
3436         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
3437         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
3438         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
3439         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
3440         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
3441         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
3442         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
3443         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3444         (WebCore::CDMSessionAVContentKeySession::isAvailable):
3445         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
3446         (WebCore::CDMSessionAVContentKeySession::update):
3447         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
3448         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
3449         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3450         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3451         (WebCore::CDMSessionAVStreamSession::releaseKeys):
3452         (WebCore::CDMSessionAVStreamSession::update):
3453         (WebCore::CDMSessionAVStreamSession::setStreamSession):
3454         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
3455         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3456         (WebCore::imageDecoderAssetOptions):
3457         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
3458         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
3459<