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