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