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