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