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