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