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