5fff931d24b2fd111f1c0ad1ba22f4a686f70250
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-07  Matt Rajca  <mrajca@apple.com>
2
3         Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)
4         https://bugs.webkit.org/show_bug.cgi?id=189433
5         <rdar://problem/44186498> Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)
6
7         Reviewed by Eric Carlson.
8
9         When playing an audio element, the media Touch Bar displays an active PIP button even though only
10         videos are PIP-able. Pressing it does not do anything. The issue is canTogglePictureInPicture is set
11         to YES unconditionally on the WebPlaybackControlsManager. It is then only updated based on whether or
12         not external playback is enabled.
13
14         This patch extends that logic such that the picture-in-picture Touch Bar button will be disabled for
15         audio elements. Since PlaybackSessionModelMediaElement today does not know whether we're dealing
16         with an audio or video element, a new isPictureInPictureSupported flag has been added (as well as
17         the plumbing necessary to get the state over from the web process).
18
19         An API test has been added that checks the value of the canTogglePictureInPicture and ensures it
20         is NO when audio elements are playing. To expose it to tests, a _canTogglePictureInPictureForTesting
21         property has been added to the WKTesting category.
22
23         * platform/cocoa/PlaybackSessionModel.h:
24         (WebCore::PlaybackSessionModelClient::isPictureInPictureSupportedChanged):
25         * platform/cocoa/PlaybackSessionModelMediaElement.h:
26         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
27         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
28         (WebCore::PlaybackSessionModelMediaElement::isPictureInPictureSupported const):
29         * platform/mac/PlaybackSessionInterfaceMac.h:
30         * platform/mac/PlaybackSessionInterfaceMac.mm:
31         (WebCore::PlaybackSessionInterfaceMac::isPictureInPictureSupportedChanged):
32         (WebCore::PlaybackSessionInterfaceMac::externalPlaybackChanged):
33         (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerCanTogglePictureInPicture):
34
35 2018-09-10  Alicia Boya García  <aboya@igalia.com>
36
37         [GStreamer] Fix overflow in buffered ranges
38         https://bugs.webkit.org/show_bug.cgi?id=189419
39
40         Reviewed by Philippe Normand.
41
42         Scale operations on big numbers (like media timestamps or durations)
43         should be made with GStreamer utility functions to avoid overflows.
44
45         This fixes an assertion when a 24 hour long fragmented MP4 file is
46         played.
47
48         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
49         (WebCore::MediaPlayerPrivateGStreamer::buffered const):
50
51 2018-09-07  Frederic Wang  <fwang@igalia.com>
52
53         Refactor filter list checking code
54         https://bugs.webkit.org/show_bug.cgi?id=185087
55
56         Reviewed by Yusuke Suzuki.
57
58         No new tests, behavior unchanged.
59
60         * animation/KeyframeEffectReadOnly.h: Add missing forward-declaration FilterOperations.
61
62 2018-09-10  Philippe Normand  <pnormand@igalia.com>
63
64         [GStreamer] Several media related tests timing out around the same revision
65         https://bugs.webkit.org/show_bug.cgi?id=189349
66
67         Reviewed by Carlos Garcia Campos.
68
69         The timeouts were happening because the `ended` event was no
70         longer properly emitted. The change in playbackPosition also
71         ensures `timeupdate` event remains emitted in a... timely manner.
72
73         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
74         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
75         Reduce the position cache threshold to 200ms, which is a value
76         slightly lower than the 250ms defined in HTMLMediaElement.
77         (WebCore::MediaPlayerPrivateGStreamer::didEnd): Reset the cached
78         position value to ensure the following query will most likely
79         return the same value as reported by the duration query.
80
81 2018-09-10  Rob Buis  <rbuis@igalia.com>
82
83         XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header
84         https://bugs.webkit.org/show_bug.cgi?id=189465
85
86         Reviewed by Frédéric Wang.
87
88         The xhr spec changed [1, 2] so that overrideMimeType should not update the
89         response's "Content-Type" header anymore.
90
91         Behavior matches Firefox and Chrome.
92
93         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype
94         [2] https://github.com/whatwg/xhr/issues/157
95
96         Tests: http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html
97                web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm
98
99         * xml/XMLHttpRequest.cpp:
100         (WebCore::XMLHttpRequest::didReceiveResponse):
101
102 2018-09-10  Antoine Quint  <graouts@apple.com>
103
104         [Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails
105         https://bugs.webkit.org/show_bug.cgi?id=189405
106         <rdar://problem/43342639>
107
108         Reviewed by Simon Fraser.
109
110         Test: webanimations/accelerated-transition-interrupted-on-composited-element.html
111
112         If we interrupt an animation on an element that is composited also outside of the duration of the animation,
113         the "stop" accelerated action would fail to be performed because we no longer had a resolved current time and
114         the accelerated animation applied to the layer would never be removed.
115
116         However, having a resolved current time is not necessary to stop an animation, only for the other types of
117         actions (play, pause and seek). So we now simply default to a 0s time for an unresolved current time for a
118         simple fix to this issue.
119
120         * animation/KeyframeEffectReadOnly.cpp:
121         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
122
123 2018-09-09  Fujii Hironori  <Hironori.Fujii@sony.com>
124
125         Add specialized template declarations of HashTraits and DefaultHash to detect misuse
126         https://bugs.webkit.org/show_bug.cgi?id=189044
127
128         Reviewed by Yusuke Suzuki.
129
130         Some classes have a separate header for specializations of
131         WTF::HashTraits and WTF::DefaultHash to reduce the number of
132         header files included. For example, ColorHash.h and Color.h.
133
134         If someone is mistakenly using HashSet or HashMap without
135         including the specialization header, unexpected template
136         instantiation can cause subtle bugs. For example, MSVC linker
137         would silently produce an broken executable (Bug 188893).
138
139         By applying this change, I found three misuse cases in
140         DebugPageOverlays.cpp, AVVideoCaptureSource.h and WebPage.h. As
141         far as I analyzed, I concluded that these misuses don't introduce
142         any bugs at the moment, and they are not testable (Bug 189044 Comment 9),
143         except the MSVC issue (Bug 188893).
144
145         No new tests (Covered by existing tests).
146
147         * Modules/webdatabase/SQLResultSetRowList.h: Removed unused #include <wtf/HashTraits.h>.
148         * bindings/js/SerializedScriptValue.cpp: Ditto.
149         * page/DebugPageOverlays.cpp: Added #include "ColorHash.h" to instantiate HashMap<String, Color>.
150         * platform/URLHash.h: Added DefaultHash<URL> specialization definition.
151         * platform/URL.h: Added specialized template declarations.
152         * platform/graphics/Color.h: Ditto.
153         * platform/graphics/FloatSize.h: Ditto.
154         * platform/graphics/IntPoint.h: Ditto.
155         * platform/graphics/IntSize.h: Ditto.
156         * platform/network/ProtectionSpace.h: Ditto.
157         * platform/network/ProtectionSpaceHash.h: Removed unnecessary DefaultHash declaration.
158         * platform/mediastream/mac/AVVideoCaptureSource.h:
159         Added #include "IntSizeHash.h" to instantiate HashMap<String, IntSize>.
160
161 2018-09-09  Fujii Hironori  <Hironori.Fujii@sony.com>
162
163         [Win][Clang] Add FloatRect(const RECT&) constructor
164         https://bugs.webkit.org/show_bug.cgi?id=189398
165
166         Reviewed by Alex Christensen.
167
168         While trying to build WebKit WinCairo port with the latest Clang
169         (Bug 171618), the following compilation errors were reported.
170
171           error: no viable conversion from returned value of type 'RECT' (aka 'tagRECT') to function return type 'WebCore::FloatRect'
172
173         No new tests (No behavior change).
174
175         * platform/graphics/FloatRect.h:
176         * platform/graphics/win/FloatRectDirect2D.cpp:
177         (WebCore::FloatRect::FloatRect): Added a new constructor taking a RECT as the argument.
178
179 2018-09-08  Andy Estes  <aestes@apple.com>
180
181         [Apple Pay] Dispatch a paymentmethodchange event when the payment method changes
182         https://bugs.webkit.org/show_bug.cgi?id=189386
183
184         Reviewed by Darin Adler.
185
186         Implemented the "payment method changed" algorithm as defined in the Payment Request API W3C
187         Editor's Draft of 05 September 2018.
188
189         Payment Request says that the user agent MAY run this algorithm when the payment method
190         changes. In our case, we only wish to dispatch this event when a listener is registered for
191         it. Since PassKit requires merchants to respond to this event by calling updateWith() within
192         30 seconds, firing the event unconditionally would break compatibility with existing
193         clients.
194
195         For merchants that do not listen for this event, they can continue to use modifiers to
196         update details based on the selected payment method type.
197         
198         Also made PaymentMethodChangeEvent.methodDetails a cached attribute in a way that avoids
199         potential reference cycles from holding a JSC::Strong in the wrapped object.
200
201         Test: http/tests/ssl/applepay/ApplePayPaymentMethodChangeEvent.https.html
202
203         * CMakeLists.txt:
204         * DerivedSources.make:
205         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
206         (WebCore::toJSDictionary):
207         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
208         (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
209         * Modules/paymentrequest/PaymentMethodChangeEvent.cpp:
210         (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
211         * Modules/paymentrequest/PaymentMethodChangeEvent.h:
212         * Modules/paymentrequest/PaymentMethodChangeEvent.idl:
213         * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Removed.
214         * Modules/paymentrequest/PaymentRequest.cpp:
215         (WebCore::PaymentRequest::paymentMethodChanged):
216         * Modules/paymentrequest/PaymentRequest.h:
217         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
218         (WebCore::PaymentRequestUpdateEvent::updateWith):
219         * Sources.txt:
220         * WebCore.xcodeproj/project.pbxproj:
221         * bindings/js/JSPaymentMethodChangeEventCustom.cpp: Added.
222         (WebCore::JSPaymentMethodChangeEvent::methodDetails const):
223         (WebCore::JSPaymentMethodChangeEvent::visitAdditionalChildren):
224
225 2018-09-08  Simon Fraser  <simon.fraser@apple.com>
226
227         Clean up code related to Document node removal
228         https://bugs.webkit.org/show_bug.cgi?id=189452
229
230         Reviewed by Wenson Hsieh.
231
232         Replace the "amongChildrenOnly" boolean argument with an enum for clarity.
233         
234         Rename the remove*OfSubtree functions, because that naming is very unclear.
235         Instead, use adjust*OnNodeRemoval which better describes what the code does.
236
237         * dom/Document.cpp:
238         (WebCore::isNodeInSubtree):
239         (WebCore::Document::adjustFocusedNodeOnNodeRemoval):
240         (WebCore::Document::nodeChildrenWillBeRemoved):
241         (WebCore::Document::nodeWillBeRemoved):
242         (WebCore::Document::adjustFocusNavigationNodeOnNodeRemoval):
243         (WebCore::Document::adjustFullScreenElementOnNodeRemoval):
244         (WebCore::Document::removeFocusedNodeOfSubtree): Deleted.
245         (WebCore::Document::removeFocusNavigationNodeOfSubtree): Deleted.
246         (WebCore::Document::removeFullScreenElementOfSubtree): Deleted.
247         * dom/Document.h:
248         * dom/Element.cpp:
249         (WebCore::Element::removeShadowRoot):
250         * loader/FrameLoader.cpp:
251         (WebCore::FrameLoader::clear):
252
253 2018-09-08  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
254
255         [CSSJIT] Use lshiftPtr instead of mul32
256         https://bugs.webkit.org/show_bug.cgi?id=189451
257
258         Reviewed by Sam Weinig.
259
260         Use `value << 4` instead of `value * 16`. In 64bit environment, sizeof(Style::Relation) is 16,
261         so that we can use `value << 4` in CSS JIT.
262
263         No behavior change.
264
265         * cssjit/SelectorCompiler.cpp:
266         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
267
268 2018-09-07  Fujii Hironori  <Hironori.Fujii@sony.com>
269
270         [Win][Clang] exceptionShouldTerminateProgram of StructuredExceptionHandlerSuppressor.cpp should take DWORD
271         https://bugs.webkit.org/show_bug.cgi?id=189402
272
273         Reviewed by Alex Christensen.
274
275         Clang reports compilation errors like following:
276
277         > StructuredExceptionHandlerSuppressor.cpp(38,10):  error: case value evaluates to 2147483650, which cannot be narrowed to type 'int' [-Wc++11-narrowing]
278         >     case EXCEPTION_DATATYPE_MISALIGNMENT:
279         >          ^
280
281         No new tests (no behavioral change).
282
283         * platform/win/StructuredExceptionHandlerSuppressor.cpp:
284         (exceptionShouldTerminateProgram): Changed the type of argument from int to DWORD.
285
286 2018-09-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
287
288         [Curl] Stop sending request with credential if no authorization requested.
289         https://bugs.webkit.org/show_bug.cgi?id=189057
290
291         Reviewed by Alex Christensen.
292
293         When 401 response returns without 'www-authenticate' header, suppress another request with credential.
294
295         Test: http/tests/xmlhttprequest/unauthorized-without-authenticate-header.html
296
297         * platform/network/curl/CurlResourceHandleDelegate.cpp:
298         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
299
300 2018-09-07  Fujii Hironori  <Hironori.Fujii@sony.com>
301
302         [Win][Clang] duplicated variable name `advance` in UniscribeController::shapeAndPlaceItem
303         https://bugs.webkit.org/show_bug.cgi?id=189399
304
305         Reviewed by Myles C. Maxfield.
306
307         Clang reports the following compilation error:
308
309         UniscribeController.cpp(372,56):  error: invalid operands to binary expression ('float' and 'WebCore::GlyphBufferAdvance' (aka 'WebCore::FloatSize'))
310              GlyphBufferAdvance advance(-origin.width() + advance, -origin.height());
311                                         ~~~~~~~~~~~~~~~ ^ ~~~~~~~
312         No new tests (No behavior change).
313
314         * platform/graphics/win/UniscribeController.cpp:
315         (WebCore::UniscribeController::shapeAndPlaceItem): Replaced the second variable named `advance` with `glyphAdvance`.
316
317 2018-09-07  Youenn Fablet  <youenn@apple.com>
318
319         RTCRtpReceiver::track should return a MediaStreamTrack reference
320         https://bugs.webkit.org/show_bug.cgi?id=189420
321
322         Reviewed by Eric Carlson.
323
324         As per spec, a receiver always has a track.
325         Remove unneeded RTCRtpSenderReceiverBase and make RTCRtpReceiver have a Ref<MediaStreamTrack>.
326         RTCRtpSender keeps having a RefPtr<MediaStreamTrack>.
327         Update call sites accordingly. 
328         No change of behavior.
329
330         * Modules/mediastream/RTCRtpReceiver.cpp:
331         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
332         (WebCore::RTCRtpReceiver::stop):
333         * Modules/mediastream/RTCRtpReceiver.h:
334         (WebCore::RTCRtpReceiver::track):
335         * Modules/mediastream/RTCRtpReceiver.idl:
336         * Modules/mediastream/RTCRtpSender.cpp:
337         (WebCore::RTCRtpSender::RTCRtpSender):
338         * Modules/mediastream/RTCRtpSender.h:
339         (WebCore::RTCRtpSender::track):
340         * Modules/mediastream/RTCRtpSender.idl:
341         * Modules/mediastream/RTCRtpSenderReceiverBase.h: Removed.
342         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
343         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
344         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
345         (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
346         (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
347         * WebCore.xcodeproj/project.pbxproj:
348
349 2018-09-07  Daniel Bates  <dabates@apple.com>
350
351         Cleanup: Remove extraneous "using namespace" and scope WebCore::LogThreading
352         https://bugs.webkit.org/show_bug.cgi?id=189381
353
354         Reviewed by Simon Fraser.
355
356         * platform/ios/wak/WKGraphics.mm:
357         * platform/ios/wak/WebCoreThread.mm:
358         (WebThreadEnable):
359
360 2018-09-07  Wenson Hsieh  <wenson_hsieh@apple.com>
361
362         Clean up FontAttributeChanges.cpp after r235748
363         https://bugs.webkit.org/show_bug.cgi?id=189394
364
365         Reviewed by Tim Horton.
366
367         * Sources.txt: Move FontAttributeChanges.cpp into unified sources.
368         * WebCore.xcodeproj/project.pbxproj:
369         * editing/FontAttributeChanges.cpp: Replace `#import`s with `#include`s.
370
371 2018-09-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
372
373         [Curl][WebKitLegacy] Stop sending credential embedded in the url via XHR.
374         https://bugs.webkit.org/show_bug.cgi?id=189198
375
376         Reviewed by Alexey Proskuryakov.
377
378         Because sync XHR of Curl port uses passed request directly, the credential information in
379         url is not removed. Use ResourceHandleInternal's firstRequest because those are
380         already takne out.
381
382         Test: http/tests/xmlhttprequest/url-with-credentials.html
383
384         * platform/network/curl/ResourceHandleCurl.cpp:
385         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
386
387 2018-09-07  Youenn Fablet  <youenn@apple.com>
388
389         RealtimeOutgoingVideoSourceCocoa should use VTImageRotationSession to rotate CVPixelBuffers
390         https://bugs.webkit.org/show_bug.cgi?id=189427
391
392         Reviewed by Eric Carlson.
393
394         Previously, we were relying on libwebrtc utils to do the rotation.
395         This is inefficient compared to VTImageRotateSession and also induces additional memory cost
396         since libwebrtc is rotating using its own buffers and the encoder will convert this buffer back to a CVPixelBuffer.
397
398         Instead use VTImageRotationSession when rotation must be done at sending side.
399         Covered by webrtc/video-rotation.html.
400
401         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
402         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
403         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
404         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
405         (WebCore::computeRotatedWidthAndHeight):
406         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
407
408 2018-09-07  Youenn Fablet  <youenn@apple.com>
409
410         Add support for unified plan transceivers
411         https://bugs.webkit.org/show_bug.cgi?id=189390
412
413         Reviewed by Eric Carlson.
414
415         Keep previous transceiver behavior when unified plan flag is off.
416         Otherwise, use the libwebrtc transceiver API to create and use unified plan transceivers.
417         Fuel the implementation of transceivers through a dedicated backend.
418
419         Update transceiver IDL and make some smaller fixes at the same time:
420         - Make sure remote sources have a proper name as per https://w3c.github.io/webrtc-pc/#dfn-create-an-rtcrtpreceiver.
421         - Add support for transceiver.currentDirection.
422
423         Our mock peer connections are only supporting plan B APIs at the moment.
424         We therefore mandate plan B when using such mocks until we can upgrade mocks to support unified plan APIs.
425
426         Covered by modified and rebased tests.
427
428         * Modules/mediastream/PeerConnectionBackend.cpp:
429         (WebCore::PeerConnectionBackend::addTrack):
430         * Modules/mediastream/PeerConnectionBackend.h:
431         * Modules/mediastream/RTCPeerConnection.cpp:
432         (WebCore::RTCPeerConnection::addTrack):
433         (WebCore::RTCPeerConnection::addTransceiver):
434         * Modules/mediastream/RTCRtpSender.cpp:
435         (WebCore::RTCRtpSender::RTCRtpSender):
436         * Modules/mediastream/RTCRtpTransceiver.cpp:
437         (WebCore::RTCRtpTransceiver::mid const):
438         (WebCore::RTCRtpTransceiver::currentDirection const):
439         * Modules/mediastream/RTCRtpTransceiver.h:
440         (WebCore::RTCRtpTransceiver::backend):
441         * Modules/mediastream/RTCRtpTransceiver.idl:
442         * Modules/mediastream/RTCRtpTransceiverBackend.h:
443         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
444         (WebCore::LibWebRTCMediaEndpoint::addTrack):
445         (WebCore::LibWebRTCMediaEndpoint::newTransceiver):
446         (WebCore::LibWebRTCMediaEndpoint::addTransceiver):
447         (WebCore::LibWebRTCMediaEndpoint::transceiverBackendFromSender):
448         (WebCore::LibWebRTCMediaEndpoint::OnAddTrack):
449         (WebCore::LibWebRTCMediaEndpoint::OnTrack):
450         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
451         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
452         (WebCore::createReceiverForSource):
453         (WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
454         (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
455         (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
456         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
457         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
458         (WebCore::backendFromRTPTransceiver):
459         (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
460         (WebCore::LibWebRTCPeerConnectionBackend::newTransceiver):
461         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
462         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
463         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
464         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
465         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: Added.
466         (WebCore::LibWebRTCRtpTransceiverBackend::createReceiverBackend):
467         (WebCore::LibWebRTCRtpTransceiverBackend::createSenderBackend):
468         (WebCore::LibWebRTCRtpTransceiverBackend::direction const):
469         (WebCore::LibWebRTCRtpTransceiverBackend::currentDirection const):
470         (WebCore::LibWebRTCRtpTransceiverBackend::setDirection):
471         (WebCore::LibWebRTCRtpTransceiverBackend::mid):
472         (WebCore::LibWebRTCRtpTransceiverBackend::stop):
473         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h: Added.
474         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
475         (WebCore::toRTCRtpTransceiverDirection):
476         (WebCore::fromRTCRtpTransceiverDirection):
477         (WebCore::fromRtpTransceiverInit):
478         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
479         * WebCore.xcodeproj/project.pbxproj:
480         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
481         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
482         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
483         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
484         * platform/mediastream/RealtimeMediaSource.h:
485         * testing/Internals.cpp:
486         (WebCore::Internals::useMockRTCPeerConnectionFactory):
487
488 2018-09-07  Rob Buis  <rbuis@igalia.com>
489
490         XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved
491         https://bugs.webkit.org/show_bug.cgi?id=46008
492
493         Reviewed by Chris Dumez.
494
495         Check if passed URL is valid as specified here [1].
496
497         Test: web-platform-tests/xhr/open-url-bogus.htm
498
499         [1] https://xhr.spec.whatwg.org/#the-open()-method Step 7
500
501         * xml/XMLHttpRequest.cpp:
502         (WebCore::XMLHttpRequest::open):
503
504 2018-09-07  Frederic Wang  <fwang@igalia.com>
505
506         [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To)
507         https://bugs.webkit.org/show_bug.cgi?id=182230
508
509         Reviewed by Simon Fraser.
510
511         This commit moves the special logic for "scrolling element" body from the
512         HtmlBodyElement::scroll(Left/Top/Width/Height/To) functions to the Element class. The code
513         is executed when the element is the scrolling element which includes the case of body
514         in Quirks mode and of documentElement in standard mode. This makes the behavior closer to
515         the CSSOM View spec (bug 5991) while not deviating too much from the current implementation.
516         Finally, CSSOMViewScrollingAPI is now enabled for running tests and some adjustments are made
517         to existing tests. Further improvements will be performed in dependencies of bug 5991.
518
519         No new tests, already covered by existing tests.
520
521         * dom/Document.cpp: Split scrollingElement into two functions so that one can be called
522         internally without updating the layout.
523         (WebCore::Document::scrollingElement):
524         (WebCore::Document::scrollingElementForAPI):
525         * dom/Document.h: Ditto.
526         * dom/Document.idl: Use the version updating the layout for API calls.
527         * dom/Element.cpp: Add include to call DOMWindow::ScrollTo
528         (WebCore::Element::scrollTo): Moved some logic from HtmlBodyElement to handle the case of
529         the scrolling element. Also skip special handling of documentElement() when
530         CSSOMViewScrollingAPI is disabled.
531         (WebCore::adjustContentsScrollPositionOrSizeForZoom): Moved some logic from HtmlBodyElement
532         to handle the case of the scrolling element. Also add a FIXME for improving these kinds of
533         helper functions. Renamed to make more explicit the semantic of the value argument.
534         (WebCore::Element::scrollLeft): Moved some logic from HtmlBodyElement to handle the case of
535         the scrolling element. Use the new documentFrameWithNonNullView() helper function.
536         (WebCore::Element::scrollTop): Ditto.
537         (WebCore::Element::setScrollLeft): Ditto
538         (WebCore::Element::setScrollTop): Ditto.
539         (WebCore::Element::scrollWidth): Ditto.
540         (WebCore::Element::scrollHeight): Ditto.
541         * dom/Element.h:
542         (WebCore::Document::documentFrameWithNonNullView): New helper function to retrieve the
543         frame and ensure a view is available.
544         * html/HTMLBodyElement.cpp: Remove code that is now in Element.
545         * html/HTMLBodyElement.h: Ditto.
546
547 2018-09-07  Don Olmstead  <don.olmstead@sony.com>
548
549         [AX] Fix compile error in AXObjectCache constructor when !HAVE(ACCESSIBILITY)
550         https://bugs.webkit.org/show_bug.cgi?id=189423
551         <rdar://problem/44231775>
552
553         Reviewed by Yusuke Suzuki.
554
555         No new tests. Compilation fix.
556
557         * accessibility/AXObjectCache.h:
558         (WebCore::AXObjectCache::AXObjectCache):
559
560 2018-09-07  Zalan Bujtas  <zalan@apple.com>
561
562         [LFC] Replace "computed" value with "used" value to match spec language
563         https://bugs.webkit.org/show_bug.cgi?id=189414
564
565         Reviewed by Antti Koivisto.
566
567         * layout/FormattingContext.cpp:
568         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
569         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
570         * layout/FormattingContext.h:
571         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
572         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
573         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
574         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
575         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
576         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
577         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
578         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
579         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
580         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
581         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
582         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
583         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
584         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
585         * layout/FormattingContextGeometry.cpp:
586         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
587         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
588         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
589         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
590         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
591         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
592         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
593         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
594         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
595         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
596         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
597         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
598         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
599         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
600         * layout/blockformatting/BlockFormattingContext.cpp:
601         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
602         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
603         * layout/blockformatting/BlockFormattingContext.h:
604         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
605         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
606         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
607         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
608         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
609         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
610         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
611         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
612         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
613         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
614         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
615
616 2018-09-06  Ryosuke Niwa  <rniwa@webkit.org>
617
618         ShadowRoot should have its own node flag
619         https://bugs.webkit.org/show_bug.cgi?id=189392
620
621         Reviewed by Antti Koivisto.
622
623         Added IsShadowRootFlag and IsDocumentNodeFlag, and removed IsDocumentFragmentFlag and IsStyledElementFlag.
624         Also re-ordered flags to group flags used by subclasses below ones directly used by Node in
625         accordinate with the comment.
626
627         No new tests since there should be no behavioral change.
628
629         * dom/ContainerNode.h:
630         (WebCore::Node::isTreeScope const): Deleted.
631         * dom/Node.h:
632         (WebCore::Node::isStyledElement const): Check if this is a HTML, SVG, or MathML element instead.
633         (WebCore::Node::isDocumentNode const): Simply check IsDocumentNodeFlag.
634         (WebCore::Node::isTreeScope const): Check if this is a document or a shadow root Instead of comparing
635         the tree scope to this.
636         (WebCore::Node::isDocumentFragment const): Check if this is a container node which is neither document,
637         element, nor shadow root.
638         (WebCore::Node::isShadowRoot const): Simply check IsShadowRootFlag. This is the change needed to fix
639         the blockign bug 166748.
640         (WebCore::Node::flagIsShadowRoot): Added. Will be used in the bug 166748.
641
642 2018-09-06  Zalan Bujtas  <zalan@apple.com>
643
644         [LFC] Inline replaced height calculation should use "used value"
645         https://bugs.webkit.org/show_bug.cgi?id=189395
646
647         Reviewed by Antti Koivisto.
648
649         Use the already assigned width value (aka used value) instead of the computed value when computing the inline's height.
650         see https://www.w3.org/TR/CSS22/cascade.html#value-stages for "used" and "computed" value.
651
652         * layout/FormattingContextGeometry.cpp:
653         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
654
655 2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
656
657         Refactor WebCore::EditAction to be an 8-bit enum class
658         https://bugs.webkit.org/show_bug.cgi?id=189383
659
660         Reviewed by Dan Bernstein.
661
662         Currently, EditAction.h defines an EditAction as an enum. This patch changes EditAction to instead be an 8-bit-
663         wide enum class, and renames all EditAction values from EditAction(*) to EditAction::(*).
664
665         No change in behavior.
666
667         * editing/ApplyStyleCommand.h:
668         (WebCore::ApplyStyleCommand::create):
669         * editing/CompositeEditCommand.cpp:
670         (WebCore::CompositeEditCommand::apply):
671         (WebCore::deleteSelectionEditingActionForEditingAction):
672         * editing/CompositeEditCommand.h:
673         (WebCore::EditCommandComposition::wasCreateLinkCommand const):
674         * editing/CreateLinkCommand.h:
675         * editing/DeleteFromTextNodeCommand.h:
676         (WebCore::DeleteFromTextNodeCommand::create):
677         * editing/DeleteSelectionCommand.h:
678         (WebCore::DeleteSelectionCommand::create):
679         * editing/DictationCommand.cpp:
680         (WebCore::DictationCommand::insertTextRunWithoutNewlines):
681         (WebCore::DictationCommand::insertParagraphSeparator):
682         * editing/EditAction.h:
683         (): Deleted.
684         * editing/EditCommand.cpp:
685         (WebCore::inputTypeNameForEditingAction):
686         * editing/EditCommand.h:
687         * editing/Editor.cpp:
688         (WebCore::inputEventDataForEditingStyleAndAction):
689         (WebCore::ClearTextCommand::editingAction const):
690         (WebCore::Editor::handleTextEvent):
691         (WebCore::Editor::replaceSelectionWithFragment):
692         (WebCore::Editor::performCutOrCopy):
693         (WebCore::Editor::setBaseWritingDirection):
694         (WebCore::Editor::markMisspellingsAfterTypingToWord):
695         (WebCore::Editor::changeBackToReplacedString):
696         (WebCore::Editor::transpose):
697         * editing/Editor.h:
698         * editing/EditorCommand.cpp:
699         (WebCore::applyCommandToFrame):
700         (WebCore::executeInsertFragment):
701         (WebCore::executeBackColor):
702         (WebCore::executeFontName):
703         (WebCore::executeFontSize):
704         (WebCore::executeFontSizeDelta):
705         (WebCore::executeForeColor):
706         (WebCore::executeJustifyCenter):
707         (WebCore::executeJustifyFull):
708         (WebCore::executeJustifyLeft):
709         (WebCore::executeJustifyRight):
710         (WebCore::executeMakeTextWritingDirectionLeftToRight):
711         (WebCore::executeMakeTextWritingDirectionNatural):
712         (WebCore::executeMakeTextWritingDirectionRightToLeft):
713         (WebCore::executeStrikethrough):
714         (WebCore::executeSubscript):
715         (WebCore::executeSuperscript):
716         (WebCore::executeToggleBold):
717         (WebCore::executeToggleItalic):
718         (WebCore::executeUnderline):
719         (WebCore::executeUnscript):
720         * editing/FormatBlockCommand.h:
721         * editing/IndentOutdentCommand.h:
722         * editing/InsertIntoTextNodeCommand.h:
723         (WebCore::InsertIntoTextNodeCommand::create):
724         * editing/InsertListCommand.cpp:
725         (WebCore::InsertListCommand::editingAction const):
726         * editing/InsertNodeBeforeCommand.h:
727         (WebCore::InsertNodeBeforeCommand::create):
728         * editing/InsertParagraphSeparatorCommand.h:
729         (WebCore::InsertParagraphSeparatorCommand::create):
730         * editing/InsertTextCommand.h:
731         (WebCore::InsertTextCommand::create):
732         (WebCore::InsertTextCommand::createWithMarkerSupplier):
733         * editing/MoveSelectionCommand.cpp:
734         (WebCore::MoveSelectionCommand::doApply):
735         (WebCore::MoveSelectionCommand::editingAction const):
736         * editing/RemoveFormatCommand.h:
737         * editing/RemoveNodeCommand.h:
738         (WebCore::RemoveNodeCommand::create):
739         * editing/ReplaceRangeWithTextCommand.cpp:
740         (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
741         (WebCore::ReplaceRangeWithTextCommand::doApply):
742         * editing/ReplaceSelectionCommand.cpp:
743         (WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
744         (WebCore::ReplaceSelectionCommand::performTrivialReplace):
745         * editing/ReplaceSelectionCommand.h:
746         (WebCore::ReplaceSelectionCommand::create):
747         * editing/SpellingCorrectionCommand.cpp:
748         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
749         (WebCore::SpellingCorrectionCommand::doApply):
750         * editing/TextInsertionBaseCommand.h:
751         * editing/TypingCommand.cpp:
752         (WebCore::editActionForTypingCommand):
753         (WebCore::editActionIsDeleteByTyping):
754         (WebCore::TypingCommand::isBeforeInputEventCancelable const):
755         (WebCore::TypingCommand::inputEventData const):
756         (WebCore::TypingCommand::inputEventDataTransfer const):
757         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
758         (WebCore::TypingCommand::insertParagraphSeparator):
759         * editing/UnlinkCommand.h:
760         * editing/ios/DictationCommandIOS.cpp:
761         (WebCore::DictationCommandIOS::DictationCommandIOS):
762         * editing/ios/EditorIOS.mm:
763         (WebCore::Editor::removeUnchangeableStyles):
764         * page/DragController.cpp:
765         (WebCore::DragController::concludeEditDrag):
766
767 2018-09-06  Simon Fraser  <simon.fraser@apple.com>
768
769         Fix the build for non-Cocoa platforms after r235772.
770
771         * platform/graphics/cairo/GradientCairo.cpp:
772         (WebCore::Gradient::createPlatformGradient):
773         * platform/graphics/win/GradientDirect2D.cpp:
774         (WebCore::Gradient::generateGradient):
775         (WebCore::Gradient::fill):
776
777 2018-09-06  Zalan Bujtas  <zalan@apple.com>
778
779         [LFC] Add support for min/max-height percentage values.
780         https://bugs.webkit.org/show_bug.cgi?id=189391
781
782         Reviewed by Antti Koivisto.
783
784         The percentage is calculated with respect to the height of the generated box's containing block.
785         If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element
786         is not absolutely positioned, the percentage value is treated as '0' (for 'min-height') or 'none' (for 'max-height').
787
788         Test: fast/block/block-only/min-max-height-percentage.html
789
790         * layout/FormattingContext.cpp:
791         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
792         * layout/FormattingContext.h:
793         * layout/FormattingContextGeometry.cpp:
794         (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto):
795         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
796         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
797         * layout/blockformatting/BlockFormattingContext.cpp:
798         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
799
800 2018-09-06  Megan Gardner  <megan_gardner@apple.com>
801
802         Add Support for Conic Gradients
803         https://bugs.webkit.org/show_bug.cgi?id=189329
804         <rdar://problem/21444701>
805
806         Reviewed by Simon Fraser.
807
808         Add support for rendering CSS conic gradients.
809         The parsing work was already done, this just hooks up the data we have
810         with the CG functionality for conic gradients. Add the needed plumbing
811         to allow for this additional type and fill in the creation of 
812         a conic gradient.
813
814         Tests: fast/gradients/conic-repeating.html
815                fast/gradients/conic.html
816
817         * css/CSSGradientValue.cpp:
818         (WebCore::createGradient):
819         (WebCore::LinearGradientAdapter::gradientLength const):
820         (WebCore::RadialGradientAdapter::gradientLength const):
821         (WebCore::ConicGradientAdapter::ConicGradientAdapter):
822         (WebCore::ConicGradientAdapter::gradientLength const):
823         (WebCore::ConicGradientAdapter::maxExtent const):
824         (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
825
826         Compute what the color stops should be if they extend past 0-1
827
828         (WebCore::CSSGradientValue::computeStops):
829         (WebCore::CSSConicGradientValue::createGradient):
830         (WebCore::LinearGradientAdapter::startPoint const): Deleted.
831         (WebCore::LinearGradientAdapter::endPoint const): Deleted.
832         (WebCore::RadialGradientAdapter::startPoint const): Deleted.
833         (WebCore::RadialGradientAdapter::endPoint const): Deleted.
834
835         Start and End points weren't very universal. All we really need from these
836         gradientAdapters is their length, so just ask for that instead.
837
838         * inspector/InspectorCanvas.cpp:
839         (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
840         * platform/graphics/Gradient.cpp:
841         (WebCore::Gradient::create):
842         (WebCore::Gradient::Gradient):
843         (WebCore::Gradient::type const):
844         (WebCore::Gradient::adjustParametersForTiledDrawing):
845         (WebCore::Gradient::isZeroSize const):
846         (WebCore::Gradient::hash const):
847         * platform/graphics/Gradient.h:
848         * platform/graphics/cg/GradientCG.cpp:
849         (WebCore::Gradient::paint):
850
851 2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
852
853         [macOS] [WK2] Support changing attributes for selected text (text shadow, underline, strike-through)
854         https://bugs.webkit.org/show_bug.cgi?id=189356
855         <rdar://problem/44185674>
856
857         Reviewed by Tim Horton.
858
859         Add support for encoding and decoding FontAttributeChanges, so that we can send FontAttributeChanges over IPC in
860         WebKit2. Also change m_verticalAlign to a new VerticalAlignChange enum type, so that it's no longer tied to the
861         CSS property values of "vertical-align", and can be encoded/decoded separately from VerticalAlign in
862         RenderStyleConstants.
863
864         Test: FontManagerTests.ChangeAttributesWithFontEffectsBox
865
866         * editing/FontAttributeChanges.cpp:
867         (WebCore::FontAttributeChanges::createEditingStyle const):
868         * editing/FontAttributeChanges.h:
869         (WebCore::FontAttributeChanges::setVerticalAlign):
870         (WebCore::FontShadow::encode const):
871         (WebCore::FontShadow::decode):
872         (WebCore::FontAttributeChanges::encode const):
873         (WebCore::FontAttributeChanges::decode):
874         * platform/mac/WebCoreNSFontManagerExtras.mm:
875         (WebCore::computedFontAttributeChanges):
876
877 2018-09-06  Zalan Bujtas  <zalan@apple.com>
878
879         [LFC][BFC] Add support for min(max)-height
880         https://bugs.webkit.org/show_bug.cgi?id=189377
881
882         Reviewed by Antti Koivisto.
883
884         See https://www.w3.org/TR/CSS22/visudet.html#min-max-heights for details.
885
886         Tests: fast/block/block-only/absolute-position-min-max-height.html
887                fast/block/block-only/float-min-max-height.html
888                fast/block/block-only/inflow-min-max-height.html
889
890         * layout/FormattingContext.cpp:
891         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
892         * layout/FormattingContext.h:
893         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
894         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
895         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
896         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
897         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
898         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
899         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
900         * layout/FormattingContextGeometry.cpp:
901         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
902         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
903         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
904         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
905         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
906         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
907         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
908         * layout/blockformatting/BlockFormattingContext.cpp:
909         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
910         * layout/blockformatting/BlockFormattingContext.h:
911         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
912         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
913         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
914         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
915         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
916
917 2018-09-06  Eric Carlson  <eric.carlson@apple.com>
918
919         [MediaStream] Include supported frame rates in video capture presets
920         https://bugs.webkit.org/show_bug.cgi?id=189351
921         <rdar://problem/44188917>
922
923         Reviewed by Youenn Fablet.
924
925         No new tests, no functionality changed.
926
927         Include frame rates as well as width/height in video capture presets, so the mock video
928         capture devices model real camera devices more closely.
929
930         * platform/mediastream/RealtimeMediaSource.cpp:
931         (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Renamed from applySizeAndFrameRate. Use
932         setSize instead of setWidth and setHeight.
933         (WebCore::RealtimeMediaSource::applyConstraints): applySizeAndFrameRate -> setSizeAndFrameRate.
934         (WebCore::RealtimeMediaSource::applySizeAndFrameRate): Deleted.
935         (WebCore::RealtimeMediaSource::setWidth): Deleted.
936         (WebCore::RealtimeMediaSource::setHeight): Deleted.
937         * platform/mediastream/RealtimeMediaSource.h:
938
939         * platform/mediastream/RealtimeVideoSource.cpp:
940         (WebCore::RealtimeVideoSource::setSupportedPresets): New.
941         (WebCore::updateMinMax):
942         (WebCore::RealtimeVideoSource::addSupportedCapabilities const): Calculate capabilities from
943         presets.
944         (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate): Use bestSupportedSizeAndFrameRate.
945         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): 
946         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
947         (WebCore::RealtimeVideoSource::setSupportedFrameRates): Deleted.
948         (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight): Deleted.
949         (WebCore::RealtimeVideoSource::applySizeAndFrameRate): Deleted.
950         (WebCore::RealtimeVideoSource::supportsFrameRate): Deleted.
951         * platform/mediastream/RealtimeVideoSource.h:
952         (WebCore::RealtimeVideoSource::setSupportedCaptureSizes): Deleted.
953         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
954         (WebCore::GStreamerVideoCaptureSource::stopProducingData):
955         * platform/mediastream/mac/AVVideoCaptureSource.h:
956         * platform/mediastream/mac/AVVideoCaptureSource.mm:
957         (WebCore::AVVideoCaptureSource::setSizeAndFrameRate):
958         (WebCore::AVVideoCaptureSource::applySizeAndFrameRate): Deleted.
959         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
960         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
961         * platform/mock/MockMediaDevice.h:
962         (WebCore::MockCameraProperties::encode const):
963         (WebCore::MockCameraProperties::decode):
964         (WebCore::MockDisplayProperties::encode const):
965         (WebCore::MockDisplayProperties::decode):
966         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
967         (WebCore::defaultDevices):
968         * platform/mock/MockRealtimeVideoSource.cpp:
969         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
970         (WebCore::MockRealtimeVideoSource::capabilities const):
971         (WebCore::MockRealtimeVideoSource::settings const):
972
973 2018-09-06  Antti Koivisto  <antti@apple.com>
974
975         Actively prewarm processes created for prewarm pool
976         https://bugs.webkit.org/show_bug.cgi?id=189364
977
978         Reviewed by Chris Dumez.
979
980         Do some basic prewarming for newly created processes.
981
982         * Sources.txt:
983         * WebCore.xcodeproj/project.pbxproj:
984         * css/CSSDefaultStyleSheets.cpp:
985         (WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
986         * css/CSSDefaultStyleSheets.h:
987         * page/Frame.cpp:
988         (WebCore::Frame::Frame):
989         * page/ProcessWarming.cpp: Added.
990         (WebCore::ProcessWarming::initializeNames):
991
992         Factor name initialization into a function.
993
994         (WebCore::ProcessWarming::prewarm):
995
996         Prewarm
997         - names
998         - settings (system fonts)
999         - user agent stylesheet
1000         - JavaScript VM
1001         - telephone number detection
1002
1003         * page/ProcessWarming.h: Added.
1004
1005 2018-09-06  Youenn Fablet  <youenn@apple.com>
1006
1007         Move replaceTrack logic to RTCRtpSender backend
1008         https://bugs.webkit.org/show_bug.cgi?id=189359
1009
1010         Reviewed by Eric Carlson.
1011
1012         Move replaceTrack handling from LibWebRTCPeerConnectionBackend to LibWebRTCRtpSenderBackend.
1013         This will allow using SetTrack when fully implementing unified plan.
1014         No change of behavior.
1015
1016         * Modules/mediastream/RTCRtpSender.cpp:
1017         (WebCore::RTCRtpSender::replaceTrack):
1018         * Modules/mediastream/RTCRtpSender.h:
1019         * Modules/mediastream/RTCRtpSender.idl:
1020         * Modules/mediastream/RTCRtpSenderBackend.h:
1021         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1022         (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): Deleted.
1023         (WebCore::LibWebRTCPeerConnectionBackend::enqueueReplaceTrackTask): Deleted.
1024         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1025         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1026         (WebCore::updateTrackSource):
1027         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
1028         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1029
1030 2018-09-06  Andy Estes  <aestes@apple.com>
1031
1032         [Apple Pay] Rename the -apple-pay-button-type value "checkout" to "check-out"
1033         https://bugs.webkit.org/show_bug.cgi?id=189366
1034         <rdar://problem/44193218>
1035
1036         Reviewed by Sam Weinig.
1037
1038         The button title is "Check out with Apple Pay", so we should use the verb phrase "check out"
1039         rather than the noun "checkout" for naming this value.
1040
1041         Updated http/tests/ssl/applepay/ApplePayButtonV4.html.
1042
1043         * css/CSSPrimitiveValueMappings.h:
1044         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1045         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
1046         * css/CSSValueKeywords.in:
1047         * css/parser/CSSParserFastPaths.cpp:
1048         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1049         * rendering/RenderThemeCocoa.mm:
1050         (WebCore::toPKPaymentButtonType):
1051         * rendering/style/RenderStyleConstants.h:
1052
1053 2018-09-06  Jer Noble  <jer.noble@apple.com>
1054
1055         Don't pause playback when locking screen if video is being displayed on second screen.
1056         https://bugs.webkit.org/show_bug.cgi?id=189321
1057
1058         Reviewed by Eric Carlson.
1059
1060         Expand the existing behavior when AirPlaying to an external device to playing to a local
1061         external screen. Don't pause when the screen locks, and don't stop buffering in that mode either.
1062
1063         Add a KVO-observer to the WebAVPlayerController's playingOnSecondScreen property, and pass
1064         that observed value on to the media element.
1065
1066         * html/HTMLMediaElement.cpp:
1067         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
1068         (WebCore::HTMLMediaElement::setPlayingOnSecondScreen):
1069         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
1070         (WebCore::HTMLMediaElement::processingUserGestureForMedia const):
1071         (WebCore::HTMLMediaElement::mediaState const):
1072         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
1073         (WebCore::HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction const):
1074         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
1075         (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget const): Deleted.
1076         (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget const): Deleted.
1077         * html/HTMLMediaElement.h:
1078         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
1079         (WebCore::HTMLMediaElement::isPlayingToExternalTarget const):
1080         * html/MediaElementSession.cpp:
1081         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget const): Deleted.
1082         * html/MediaElementSession.h:
1083         * platform/audio/PlatformMediaSession.h:
1084         (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
1085         (WebCore::PlatformMediaSessionClient::isPlayingOnSecondScreen const):
1086         (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget const): Deleted.
1087         (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget const): Deleted.
1088         * platform/cocoa/PlaybackSessionModel.h:
1089         * platform/cocoa/PlaybackSessionModelMediaElement.h:
1090         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1091         (WebCore::PlaybackSessionModelMediaElement::setPlayingOnSecondScreen):
1092         * platform/ios/WebAVPlayerController.mm:
1093         (-[WebAVPlayerController init]):
1094         (-[WebAVPlayerController dealloc]):
1095         (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
1096         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1097         (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
1098
1099 2018-09-06  Frederic Wang  <fwang@igalia.com>
1100
1101         Group options of scrollRectToVisible into a struct
1102         https://bugs.webkit.org/show_bug.cgi?id=189352
1103
1104         Reviewed by Simon Fraser.
1105
1106         RenderLayer::scrollRectToVisible and RenderObject::scrollRectToVisible have several
1107         parameters to configure the type of scrolling. This patch groups the const options into a
1108         single struct to make easier to handle them in the future. For example, an #ifdefed scroll
1109         behavior option will be added in bug 188043. This refactoring can maybe help too for other
1110         scroll extensions (e.g. bug 176454 and bug 161611).
1111
1112         No new tests, behavior unchanged.
1113
1114         * accessibility/AccessibilityObject.cpp:
1115         (WebCore::AccessibilityObject::scrollToMakeVisible const): Pass options via a struct.
1116         * dom/Element.cpp:
1117         (WebCore::Element::scrollIntoView): Ditto.
1118         (WebCore::Element::scrollIntoViewIfNeeded): Ditto.
1119         (WebCore::Element::scrollIntoViewIfNotVisible): Ditto.
1120         * editing/FrameSelection.cpp: Include RenderLayer.h in all WebKit ports in order to define
1121         ScrollRectToVisibleOptions.
1122         (WebCore::FrameSelection::revealSelection): Pass options via a struct.
1123         * page/FrameView.cpp:
1124         (WebCore::FrameView::scrollToFocusedElementInternal): Ditto.
1125         (WebCore::FrameView::scrollToAnchor): Ditto.
1126         * rendering/RenderLayer.cpp:
1127         (WebCore::RenderLayer::scrollRectToVisible): Pass options via a struct. Note that
1128         absoluteRect and insideFixed are modified in this function.
1129         (WebCore::RenderLayer::autoscroll): Pass options via a struct.
1130         * rendering/RenderLayer.h: Add ScrollRectToVisibleOptions and use it in order to pass
1131         scrollRectToVisible options.
1132         * rendering/RenderObject.cpp:
1133         (WebCore::RenderObject::scrollRectToVisible): Pass options via a struct
1134         * rendering/RenderObject.h: Forward-declare ScrollRectToVisibleOptions and use in order to
1135         pass scrollRectToVisible options.
1136
1137 2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1138
1139         [macOS] Cannot change font size at selection until font panel is shown
1140         https://bugs.webkit.org/show_bug.cgi?id=189295
1141         <rdar://problem/35593389>
1142
1143         Reviewed by Ryosuke Niwa.
1144
1145         Currently, attempting to alter the font size of currently selected editable text in WKWebView via menu items
1146         will fail if the font panel has never been shown. This is because WebViewImpl::changeFontFromFontPanel, which is
1147         responsible for converting the current font at the selection to the new font using -[NSFontManager convertFont:]
1148         bails as a result of NSFontManager's currently selected font always being nil.
1149
1150         WKWebView is responsible for keeping NSFontManager up-to-date with the currently selected font; in fact, this
1151         was initially the case in r180465, which introduced NSFontManager support in WebKit2 by propagating EditorState
1152         updates that contained font information for the current selection. However, this regressed performance due to
1153         selected font computation triggering extra layout passes; r180768 addressed this by introducing a mechanism for
1154         requesting the font at the current selection, and only updating NSFontManager with the new selected font when
1155         the shared font panel is visible (determined by KVO on NSFontPanel). However, this again regressed WKWebView
1156         launch performance, due to KVO registration always forcing the shared NSFontPanel to be created. r182037
1157         addressed this by only registering for KVO on the font panel if the WKWebView has been made editable (SPI on
1158         WKWebView).
1159
1160         This leads to two issues when attempting to alter font attributes using macOS UI: (1) in web views that have not
1161         been made editable using SPI, showing the font panel and attempting to change the font fails due to the selected
1162         font staying nil, because we've never begun registering for KVO notifications on the font panel so we don't try
1163         to keep the font manager up to date. (2) Even if the web view is made editable, if the font panel is never
1164         shown, then the font manager still won't be kept up to date with the current selection, so changing fonts using
1165         menu items still does not work.
1166
1167         We fix both of these problems by refactoring font manager support on WebKit2 such that an up-to-date selected
1168         font in the UI process is no longer necessary in order to alter the font at the current selection. To do this,
1169         we figure out what changes the NSFontManager would've made to the currently selected font in the UI process, and
1170         then propagate this information to the web process, where we convert this information into an EditingStyle which
1171         we apply to the current selection.
1172
1173         The code to both determine the attributes changed by NSFontManager and to convert these attributes into editing
1174         styles to be applied via Editor already exists in WebKitLegacy, in WebHTMLView.mm. This patch moves this
1175         existing logic into WebCore and teases it apart into two portions: the first portion probes NSFontManager to
1176         determine which aspects of the font changed and constructs FontChanges, which captures these differences. The
1177         second portion maps FontChanges to an EditingStyle, which can then be applied to the current selection. In
1178         WebKitLegacy, we construct FontChanges using the font manager, and then immediately use it to create and apply
1179         an EditingStyle. In WebKit, we construct FontChanges in the UI process using the font manager, and then send
1180         this over to the web process via WebPage::changeFont, which then creates and applies the EditingStyle.
1181
1182         Note that this patch also introduces FontAttributeChanges, which is similar in concept to FontChanges, but
1183         captures a broader range of changes possible via NSFontPanel. This was done so that we can eliminate all of the
1184         font manager probing code (along with the two specimen fonts) from WebHTMLView, but is also necessary in order
1185         to allow changing font shadow, strikethrough, and underlines via the font panel to work in WebKit2. This will be
1186         fixed in a followup, by making FontAttributeChanges IPC encodable and by making WKWebView/WKView respond to the
1187         -changeAttributes: selector.
1188
1189         Changes in behavior to WebKit2 are covered by new API tests; legacy WebKit behavior should remain unchanged.
1190
1191         Tests:  FontManagerTests.ChangeFontSizeWithMenuItems
1192                 FontManagerTests.ChangeFontWithPanel
1193
1194         * SourcesCocoa.txt:
1195         * WebCore.xcodeproj/project.pbxproj:
1196         * editing/Editor.h:
1197
1198         Remove applyFontStyles.
1199
1200         * editing/FontAttributeChanges.cpp: Added.
1201         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
1202
1203         Given a font family name and a font name, returns the string to use as the "font-family" style property value.
1204         Originally from WebHTMLView.mm.
1205
1206         (WebCore::FontChanges::createEditingStyle const):
1207
1208         Converts font changes to an EditingStyle that can be used to apply these changes.
1209
1210         (WebCore::FontChanges::createStyleProperties const):
1211
1212         Introduce FontChanges, which encapsulates changes which are to be applied to the font in the current selection.
1213
1214         (WebCore::cssValueListForShadow):
1215         (WebCore::FontAttributeChanges::createEditingStyle const):
1216
1217         Converts font attribute changes to an EditingStyle that can be used to apply these changes.
1218
1219         * editing/FontAttributeChanges.h: Added.
1220
1221         Introduce FontAttributeChanges, which encapsulates changes which are to be applied to the font attributes in the
1222         current selection. This includes a set of FontChanges, as well as additional attributes such as strike-through
1223         and underlines.
1224
1225         (WebCore::FontChanges::setFontName):
1226         (WebCore::FontChanges::setFontFamily):
1227         (WebCore::FontChanges::setFontSize):
1228         (WebCore::FontChanges::setFontSizeDelta):
1229         (WebCore::FontChanges::setBold):
1230         (WebCore::FontChanges::setItalic):
1231         (WebCore::FontAttributeChanges::setVerticalAlign):
1232         (WebCore::FontAttributeChanges::setBackgroundColor):
1233         (WebCore::FontAttributeChanges::setForegroundColor):
1234         (WebCore::FontAttributeChanges::setShadow):
1235         (WebCore::FontAttributeChanges::setStrikeThrough):
1236         (WebCore::FontAttributeChanges::setUnderline):
1237         (WebCore::FontAttributeChanges::setFontChanges):
1238
1239         Setters for FontChanges and FontAttributeChanges. Initially, most of these values are optional, indicating that
1240         there should be no change.
1241
1242         (WebCore::FontChanges::encode const):
1243         (WebCore::FontChanges::decode):
1244
1245         Add encoding/decoding support to FontChanges, so that it can be sent over IPC for WebKit2.
1246
1247         * editing/cocoa/FontAttributeChangesCocoa.mm: Added.
1248         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
1249
1250         Helper method to determine whether the font family or the font name should be used, by looking up the PostScript
1251         font name using a FontDescriptor and comparing it against the result of -[NSFont fontName]. This logic was
1252         originally in WebHTMLView.mm.
1253
1254         * editing/mac/EditorMac.mm:
1255         (WebCore::Editor::applyFontStyles): Deleted.
1256         * platform/mac/WebCoreNSFontManagerExtras.h: Added.
1257         * platform/mac/WebCoreNSFontManagerExtras.mm: Added.
1258
1259         Add helper functions to compute FontChanges and FontAttributeChanges from NSFontManager.
1260
1261         (WebCore::firstFontConversionSpecimen):
1262         (WebCore::secondFontConversionSpecimen):
1263
1264         Two "specimen fonts" used to determine what changes NSFontManager or NSFontPanel makes when performing font or
1265         font attribute conversion. Moved from WebHTMLView.mm.
1266
1267         (WebCore::computedFontChanges):
1268         (WebCore::computedFontAttributeChanges):
1269
1270         Moved here from WebHTMLView.mm. Instead of converting font attributes to NSStrings and setting properties on
1271         DOMCSSStyleDeclaration, we instead specify properties on MutableStyleProperties using CSSValues.
1272
1273 2018-09-06  Zalan Bujtas  <zalan@apple.com>
1274
1275         [LFC][BFC] Add support for min(max)-width
1276         https://bugs.webkit.org/show_bug.cgi?id=189358
1277
1278         Reviewed by Antti Koivisto.
1279
1280         See https://www.w3.org/TR/CSS22/visudet.html#min-max-widths for details.
1281
1282         Tests: fast/block/block-only/absolute-position-min-max-width.html
1283                fast/block/block-only/float-min-max-width.html
1284                fast/block/block-only/inflow-min-max-width.html
1285
1286         * layout/FormattingContext.cpp:
1287         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1288         * layout/FormattingContext.h:
1289         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1290         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1291         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1292         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1293         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1294         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1295         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1296         * layout/FormattingContextGeometry.cpp:
1297         (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto):
1298         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1299         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1300         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1301         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1302         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1303         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1304         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1305         * layout/blockformatting/BlockFormattingContext.cpp:
1306         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1307         * layout/blockformatting/BlockFormattingContext.h:
1308         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1309         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1310         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1311         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1312         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1313         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1314         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1315
1316 2018-09-06  Eric Carlson  <eric.carlson@apple.com>
1317
1318         [MediaStream] Initialize AVVideoCapture video presets
1319         https://bugs.webkit.org/show_bug.cgi?id=189355
1320
1321         Reviewed by Youenn Fablet.
1322
1323         No new tests, no functionality changed.
1324
1325         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1326         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Don't try to load symbols if they
1327         aren't available.
1328
1329 2018-09-06  Ali Juma  <ajuma@chromium.org>
1330
1331         IntersectionObserver leaks documents
1332         https://bugs.webkit.org/show_bug.cgi?id=189128
1333
1334         Reviewed by Simon Fraser.
1335
1336         Currently, Documents own IntersectionObservers while IntersectionObservers own callbacks
1337         that have strong references to Documents. To break this cycle, make Documents only have
1338         weak pointers to IntersectionObservers. Instead, manage the lifetime of an
1339         IntersectionObserver as an ActiveDOMObject, overriding hasPendingActivity to keep
1340         the observer alive while there are ongoing observations.
1341
1342         However, there is a still a potential reference cycle. The callback keeps global
1343         references alive, so if there's a global reference to the observer in JavaScript,
1344         we have an observer->callback->observer cycle, keeping the callback (and hence the Document)
1345         alive. To break this cycle, make IntersectionObserver release the callback when its
1346         Document is stopped.
1347
1348         With these changes, there are no longer any leaks reported with run-webkit-tests --world-leaks
1349         on LayoutTests/intersection-observer and LayoutTests/imported/w3c/web-platform-tests/intersection-observer.
1350
1351         Tests: intersection-observer/no-document-leak.html
1352                intersection-observer/observer-and-callback-without-js-references.html
1353
1354         * dom/Document.cpp:
1355         (WebCore::Document::addIntersectionObserver):
1356         (WebCore::Document::removeIntersectionObserver):
1357         * dom/Document.h:
1358         * dom/Element.cpp:
1359         (WebCore::Element::didMoveToNewDocument):
1360         * page/IntersectionObserver.cpp:
1361         (WebCore::IntersectionObserver::IntersectionObserver):
1362         (WebCore::IntersectionObserver::~IntersectionObserver):
1363         (WebCore::IntersectionObserver::observe):
1364         (WebCore::IntersectionObserver::rootDestroyed):
1365         (WebCore::IntersectionObserver::createTimestamp const):
1366         (WebCore::IntersectionObserver::notify):
1367         (WebCore::IntersectionObserver::hasPendingActivity const):
1368         (WebCore::IntersectionObserver::activeDOMObjectName const):
1369         (WebCore::IntersectionObserver::canSuspendForDocumentSuspension const):
1370         (WebCore::IntersectionObserver::stop):
1371         * page/IntersectionObserver.h:
1372         (WebCore::IntersectionObserver::trackingDocument const):
1373         (WebCore::IntersectionObserver::trackingDocument): Deleted.
1374         * page/IntersectionObserver.idl:
1375
1376 2018-09-05  Zalan Bujtas  <zalan@apple.com>
1377
1378         [LFC] Adapt to the new const WeakPtr<>
1379         https://bugs.webkit.org/show_bug.cgi?id=189334
1380
1381         Reviewed by Antti Koivisto.
1382
1383         * layout/FormattingContext.cpp:
1384         (WebCore::Layout::FormattingContext::FormattingContext):
1385         * layout/FormattingContext.h:
1386         * layout/LayoutContext.cpp:
1387         (WebCore::Layout::LayoutContext::initializeRoot):
1388         * layout/LayoutContext.h:
1389         * layout/floats/FloatAvoider.cpp:
1390         (WebCore::Layout::FloatAvoider::FloatAvoider):
1391         * layout/floats/FloatAvoider.h:
1392         * layout/floats/FloatingState.cpp:
1393         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
1394         (WebCore::Layout::FloatingState::FloatingState):
1395         * layout/floats/FloatingState.h:
1396         * layout/layouttree/LayoutContainer.cpp:
1397         (WebCore::Layout::Container::addOutOfFlowDescendant):
1398         * layout/layouttree/LayoutContainer.h:
1399         (WebCore::Layout::Container::outOfFlowDescendants const):
1400
1401 2018-09-06  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1402
1403         [GStreamer] Extra ASSERTs at MainThreadNotifier
1404         https://bugs.webkit.org/show_bug.cgi?id=188786
1405
1406         Reviewed by Carlos Garcia Campos.
1407
1408         We add a couple of checks in debug mode: there is only one bit on
1409         per notification and ensure a notifier was invalidated before
1410         being destroyed.
1411
1412         * platform/graphics/gstreamer/MainThreadNotifier.h:
1413
1414 2018-09-05  Youenn Fablet  <youenn@apple.com>
1415
1416         Move ownership of outgoing source to RTCRtpSender backend
1417         https://bugs.webkit.org/show_bug.cgi?id=189310
1418
1419         Reviewed by Alex Christensen.
1420
1421         RTCRtpSender should own the source so that it can replace/stop it.
1422         Since this is libwebrtc specific, the source is actually owned by the backend.
1423         Simplified replaceTrack a bit based on that.
1424
1425         No change of behavior.
1426
1427         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1428         (WebCore::LibWebRTCMediaEndpoint::addTrack):
1429         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1430         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
1431         (WebCore::updateTrackSource):
1432         (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
1433         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
1434         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1435         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1436
1437 2018-09-05  Brent Fulgham  <bfulgham@apple.com>
1438
1439         The width of an empty or nullptr TextRun should be zero
1440         https://bugs.webkit.org/show_bug.cgi?id=189154
1441         <rdar://problem/43685926>
1442
1443         Reviewed by Zalan Bujtas.
1444
1445         If a page has an empty TextRun and attempts to paint it we can crash with a nullptr.
1446
1447         This patch recognizes that an empty TextRun should always produce a zero width, rather than
1448         attempt to compute this value from font data. It also prevents ListBox from attempting to
1449         paint a null string.
1450
1451         Test: fast/text/null-string-textrun.html
1452
1453         * platform/graphics/FontCascade.cpp:
1454         (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width.
1455         (WebCore::FontCascade::width const): Ditto.
1456         * platform/graphics/TextRun.h:
1457         (WebCore::TextRun::TextRun): ASSERT that the supplied String is non-null.
1458         (WebCore::TextRun::setText): Ditto.
1459         * rendering/RenderListBox.cpp:
1460         (WebCore::RenderListBox::paintItemForeground): Don't attempt to paint a null string.
1461
1462 2018-09-05  Zalan Bujtas  <zalan@apple.com>
1463
1464         [LFC][BFC] ComputeFloat* methods should take a const FloatingContext&
1465         https://bugs.webkit.org/show_bug.cgi?id=189333
1466
1467         Reviewed by Antti Koivisto.
1468
1469         Only layoutFormattingContextRoot() needs a non-const FloatingContext& object (to add the floating box to the floating state).
1470
1471         * layout/blockformatting/BlockFormattingContext.cpp:
1472         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1473         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1474         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1475         * layout/blockformatting/BlockFormattingContext.h:
1476
1477 2018-09-05  Youenn Fablet  <youenn@apple.com>
1478
1479         Introduce a backend for RTCRtpTransceiver
1480         https://bugs.webkit.org/show_bug.cgi?id=189322
1481
1482         Reviewed by Eric Carlson.
1483
1484         Introduce RTCRtpTransceiverBackend to implement the transceiver functionality using libwebrtc.
1485         Remove provisional mids as it will be done by the webrtc backend.
1486
1487         No observable change of behavior yet since there is no transceiver backend yet.
1488
1489         * Modules/mediastream/PeerConnectionBackend.h:
1490         * Modules/mediastream/RTCRtpTransceiver.cpp:
1491         (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
1492         (WebCore::RTCRtpTransceiver::mid const):
1493         (WebCore::RTCRtpTransceiver::direction const):
1494         (WebCore::RTCRtpTransceiver::setDirection):
1495         (WebCore::RTCRtpTransceiver::stop):
1496         (WebCore::RTCRtpTransceiver::getNextMid): Deleted.
1497         (WebCore::RTCRtpTransceiver::directionString const): Deleted.
1498         * Modules/mediastream/RTCRtpTransceiver.h:
1499         (WebCore::RTCRtpTransceiver::create):
1500         (WebCore::RTCRtpTransceiver::provisionalMid const): Deleted.
1501         (WebCore::RTCRtpTransceiver::setMid): Deleted.
1502         * Modules/mediastream/RTCRtpTransceiverBackend.h: Added.
1503         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1504         (WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
1505         (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
1506         (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
1507         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1508         (WebCore::LibWebRTCPeerConnectionBackend::completeAddTransceiver):
1509         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1510         * WebCore.xcodeproj/project.pbxproj:
1511
1512 2018-09-05  Zalan Bujtas  <zalan@apple.com>
1513
1514         [LFC] Pass in const LayoutContext& to geometry methods when possible
1515         https://bugs.webkit.org/show_bug.cgi?id=189331
1516
1517         Reviewed by Antti Koivisto.
1518
1519         Only layout and layout-like methods (intrinsic width computation -> shrink to fit -> out-of-flow/floating boxes) should take a
1520         non-const LayoutContext&. Other geometry functions should not mutate the the context.
1521
1522         * layout/FormattingContext.cpp:
1523         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1524         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1525         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
1526         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1527         * layout/FormattingContext.h:
1528         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1529         * layout/FormattingContextGeometry.cpp:
1530         (WebCore::Layout::contentHeightForFormattingContextRoot):
1531         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1532         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1533         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1534         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1535         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
1536         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1537         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
1538         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
1539         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1540         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1541         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
1542         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1543         * layout/LayoutContext.cpp:
1544         (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
1545         (WebCore::Layout::LayoutContext::establishedFormattingState const):
1546         (WebCore::Layout::LayoutContext::createFormattingStateForFormattingRootIfNeeded):
1547         (WebCore::Layout::LayoutContext::formattingContext const):
1548         (WebCore::Layout::LayoutContext::establishedFormattingState): Deleted.
1549         (WebCore::Layout::LayoutContext::formattingContext): Deleted.
1550         * layout/LayoutContext.h:
1551         * layout/blockformatting/BlockFormattingContext.cpp:
1552         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1553         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1554         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1555         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1556         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1557         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1558         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1559         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1560         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1561         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1562         * layout/blockformatting/BlockFormattingContext.h:
1563         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1564         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1565         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1566         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1567         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1568         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
1569         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1570         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1571         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1572         * layout/inlineformatting/InlineFormattingContext.cpp:
1573         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
1574         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
1575         * layout/inlineformatting/InlineFormattingContext.h:
1576
1577 2018-09-05  Youenn Fablet  <youenn@apple.com>
1578
1579         Expose RTCRtpSender.setParameters
1580         https://bugs.webkit.org/show_bug.cgi?id=189307
1581
1582         Reviewed by Eric Carlson.
1583
1584         Implement RTCRtpSender.setParameters.
1585         This is an incomplete implementation as we need to refresh parameters as per the spec and testing is much easier with full transceiver support.
1586         Implementation uses sender backend to set the parameters at libwebrtc level.
1587         Fix the case of a stopped sender/transceiver in which case promise should be rejected.
1588         Covered by rebased and modified tests.
1589
1590         * Modules/mediastream/RTCRtpParameters.h:
1591         * Modules/mediastream/RTCRtpSender.cpp:
1592         (WebCore::RTCRtpSender::setParameters):
1593         * Modules/mediastream/RTCRtpSender.h:
1594         * Modules/mediastream/RTCRtpSender.idl:
1595         * Modules/mediastream/RTCRtpSenderBackend.h:
1596         * Modules/mediastream/RTCRtpTransceiver.cpp:
1597         (WebCore::RTCRtpTransceiver::stop):
1598         * Modules/mediastream/RTCRtpTransceiver.h:
1599         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
1600         (WebCore::LibWebRTCRtpReceiverBackend::getParameters):
1601         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1602         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
1603         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
1604         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1605         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1606         (WebCore::toRTCEncodingParameters):
1607         (WebCore::fromRTCEncodingParameters):
1608         (WebCore::toRTCHeaderExtensionParameters):
1609         (WebCore::fromRTCHeaderExtensionParameters):
1610         (WebCore::toRTCCodecParameters):
1611         (WebCore::toRTCRtpParameters):
1612         (WebCore::fromRTCRtpParameters):
1613         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
1614
1615 2018-09-05  Simon Fraser  <simon.fraser@apple.com>
1616
1617         Remove some logging that I committed by mistake.
1618
1619         * rendering/RenderLayerFilters.cpp:
1620         (WebCore::RenderLayerFilters::RenderLayerFilters):
1621         (WebCore::RenderLayerFilters::~RenderLayerFilters):
1622
1623 2018-09-05  Zalan Bujtas  <zalan@apple.com>
1624
1625         [LFC] Construct the Display::Box objects on demand.
1626         https://bugs.webkit.org/show_bug.cgi?id=189320
1627
1628         Reviewed by Antti Koivisto.
1629
1630         * layout/FormattingContext.cpp:
1631         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1632         * layout/LayoutContext.cpp:
1633         (WebCore::Layout::LayoutContext::initializeRoot):
1634         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
1635         (WebCore::Layout::LayoutContext::createDisplayBox): Deleted.
1636         * layout/LayoutContext.h:
1637         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const): Deleted.
1638         * layout/Verification.cpp:
1639         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
1640         * layout/blockformatting/BlockFormattingContext.cpp:
1641         (WebCore::Layout::BlockFormattingContext::layout const):
1642         * layout/displaytree/DisplayBox.h:
1643
1644 2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>
1645
1646         Add infrastructure to dump resource load statistics
1647         https://bugs.webkit.org/show_bug.cgi?id=189213
1648
1649         Reviewed by Daniel Bates. 
1650
1651         The dumping functionality is not currently used, but will be included in tests for
1652         <https://bugs.webkit.org/show_bug.cgi?id=187773>.
1653
1654         * loader/ResourceLoadStatistics.h:
1655
1656 2018-09-05  Ryan Haddad  <ryanhaddad@apple.com>
1657
1658         Unreviewed, fix the build with recent SDKs.
1659
1660         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1661         (WebCore::exernalDeviceDisplayNameForPlayer):
1662
1663 2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>
1664
1665         Added runtime feature flag for web API statistics
1666         https://bugs.webkit.org/show_bug.cgi?id=189211
1667
1668         Reviewed by Daniel Bates.
1669
1670         Added functionality to get and set the runtime flag.
1671
1672         * page/RuntimeEnabledFeatures.h:
1673         (WebCore::RuntimeEnabledFeatures::setWebAPIStatisticsEnabled):
1674         (WebCore::RuntimeEnabledFeatures::webAPIStatisticsEnabled const):
1675
1676 2018-09-05  Youenn Fablet  <youenn@apple.com>
1677
1678         Move replaceTrack logic to LibWebRTCPeerConnectionBackend
1679         https://bugs.webkit.org/show_bug.cgi?id=189281
1680
1681         Reviewed by Eric Carlson.
1682
1683         Move replaceTrack handling code from RTCPeerConnection to LibWebRTCPeerConnectionBackend.
1684         This makes the logic easier to understand.
1685         Future refactoring will further try to put more handling in RTCRtpSenderBackend.
1686         No change of behavior.
1687
1688         * Modules/mediastream/RTCPeerConnection.cpp:
1689         * Modules/mediastream/RTCPeerConnection.h:
1690         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1691         (WebCore::tryUpdatingTrackSource):
1692         (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
1693         (WebCore::LibWebRTCPeerConnectionBackend::enqueueReplaceTrackTask):
1694         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1695         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1696         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
1697
1698 2018-09-05  Zalan Bujtas  <zalan@apple.com>
1699
1700         [LFC] LayoutContext::displayBoxForLayoutBox() should return a Display::Box&
1701         https://bugs.webkit.org/show_bug.cgi?id=189311
1702
1703         Reviewed by Antti Koivisto.
1704
1705         When the layout logic needs a Display::Box, we must have already created one for the associated Layout::Box.
1706         (It does not necessarily mean that evey Layout::Box has a Display::Box. For example in case of inline formatting context,
1707         we don't create a Display::Box for every inline box, but the formatting logic does not require such pairs.)
1708
1709         * layout/FormattingContext.cpp:
1710         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1711         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1712         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1713         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
1714         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
1715         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
1716         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1717         * layout/FormattingContextGeometry.cpp:
1718         (WebCore::Layout::contentHeightForFormattingContextRoot):
1719         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
1720         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
1721         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1722         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1723         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1724         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1725         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1726         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1727         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1728         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1729         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1730         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1731         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1732         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1733         * layout/LayoutContext.h:
1734         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
1735         * layout/Verification.cpp:
1736         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1737         * layout/blockformatting/BlockFormattingContext.cpp:
1738         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1739         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1740         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1741         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1742         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1743         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1744         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1745         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1746         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1747         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1748         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1749         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1750         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1751         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
1752         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1753         * layout/blockformatting/BlockMarginCollapse.cpp:
1754         (WebCore::Layout::isMarginTopCollapsedWithParent):
1755         (WebCore::Layout::isMarginBottomCollapsedThrough):
1756         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
1757         * layout/floats/FloatingContext.cpp:
1758         (WebCore::Layout::FloatingContext::positionForFloat const):
1759         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1760         * layout/floats/FloatingState.cpp:
1761         (WebCore::Layout::FloatingState::append):
1762         * layout/inlineformatting/InlineFormattingContext.cpp:
1763         (WebCore::Layout::InlineFormattingContext::layout const):
1764         * layout/layouttree/LayoutTreeBuilder.cpp:
1765         (WebCore::Layout::outputLayoutTree):
1766         (WebCore::Layout::showLayoutTree):
1767
1768 2018-09-05  Zalan Bujtas  <zalan@apple.com>
1769
1770         [LFC] Drop Display:Box from FormattingContext::compute* functions
1771         https://bugs.webkit.org/show_bug.cgi?id=189309
1772
1773         Reviewed by Antti Koivisto.
1774
1775         They are redundant and could get out of sync.
1776
1777         * layout/FormattingContext.cpp:
1778         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1779         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1780         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1781         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
1782         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1783         * layout/FormattingContext.h:
1784         * layout/blockformatting/BlockFormattingContext.cpp:
1785         (WebCore::Layout::BlockFormattingContext::layout const):
1786         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1787         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1788         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1789         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1790         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1791         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1792         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1793         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1794         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1795         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1796         * layout/blockformatting/BlockFormattingContext.h:
1797         * layout/inlineformatting/InlineFormattingContext.cpp:
1798         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
1799         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
1800         * layout/inlineformatting/InlineFormattingContext.h:
1801
1802 2018-09-05  Jer Noble  <jer.noble@apple.com>
1803
1804         Add MediaCapabilities as an Experimental Feature
1805         https://bugs.webkit.org/show_bug.cgi?id=189209
1806
1807         Reviewed by Eric Carlson.
1808
1809         Move mediaCapabilitiesEnabled out of RuntimeEnabledFeatures. It already (also) exists in Settings.
1810
1811         * Modules/mediacapabilities/MediaCapabilities.idl:
1812         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
1813         * Modules/mediacapabilities/NavigatorMediaCapabilities.idl:
1814         * Modules/mediacapabilities/ScreenLuminance.idl:
1815         * page/RuntimeEnabledFeatures.h:
1816         (WebCore::RuntimeEnabledFeatures::setMediaCapabilitiesEnabled): Deleted.
1817         (WebCore::RuntimeEnabledFeatures::mediaCapabilitiesEnabled const): Deleted.
1818
1819 2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>
1820
1821         Add functionality to encode and decode a uint64_t in KeyedCoding
1822         https://bugs.webkit.org/show_bug.cgi?id=189216
1823
1824         Reviewed by Daniel Bates.
1825
1826         I've added this functionality in order to be able to encode and decode the raw uint64_t 
1827         representation of an OptionSet for my patch here <https://bugs.webkit.org/show_bug.cgi?id=187773>. 
1828
1829         The changes in the KeyedEncoder/KeyedDecoder for Glib were made because they are derived classes
1830         of KeyedCoding which contains pure virtual functions that need to be implemented.
1831
1832         * platform/KeyedCoding.h:
1833         * platform/cf/KeyedDecoderCF.cpp:
1834         (WebCore::KeyedDecoderCF::decodeUInt64):
1835         * platform/cf/KeyedDecoderCF.h:
1836         * platform/cf/KeyedEncoderCF.cpp:
1837         (WebCore::KeyedEncoderCF::encodeUInt64):
1838         * platform/cf/KeyedEncoderCF.h:
1839         * platform/glib/KeyedDecoderGlib.cpp:
1840         (WebCore::KeyedDecoderGlib::decodeUInt64):
1841         * platform/glib/KeyedDecoderGlib.h:
1842         * platform/glib/KeyedEncoderGlib.cpp:
1843         (WebCore::KeyedEncoderGlib::encodeUInt64):
1844         * platform/glib/KeyedEncoderGlib.h:
1845
1846 2018-09-05  Zan Dobersek  <zdobersek@igalia.com>
1847
1848         [GTK] ASSERT(!m_nicosia.imageBacking) when starting any YouTube video
1849         https://bugs.webkit.org/show_bug.cgi?id=189215
1850
1851         Reviewed by Carlos Garcia Campos.
1852
1853         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1854         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
1855         Manually clear out any layer-side state of any image backing that is
1856         associated with this layer, much like we do for backing stores.
1857
1858 2018-09-05  Eric Carlson  <eric.carlson@apple.com>
1859
1860         [MediaStream] Simplify logic when changing RealtimeMediaSource settings
1861         https://bugs.webkit.org/show_bug.cgi?id=189284
1862         <rdar://problem/44117948>
1863
1864         Reviewed by Youenn Fablet.
1865
1866         Remove all "apply<setting>" methods from RealtimeMediaSource and derived classes, and
1867         add a bitfield to settingsDidChange so classes can do setting-specific setup and
1868         configuration by overriding settingsDidChange.
1869
1870         No new tests, no functionality changed.
1871
1872         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1873         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
1874         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
1875         * platform/mediastream/MediaConstraints.h:
1876         (WebCore::NumericConstraint::fitnessDistance const):
1877         (WebCore::NumericConstraint::valueForDiscreteCapabilityValues const):
1878         * platform/mediastream/RealtimeIncomingVideoSource.h:
1879         (): Deleted.
1880         * platform/mediastream/RealtimeMediaSource.cpp:
1881         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
1882         (WebCore::RealtimeMediaSource::settingsDidChange):
1883         (WebCore::RealtimeMediaSource::fitnessDistance):
1884         (WebCore::applyNumericConstraint):
1885         (WebCore::RealtimeMediaSource::applyConstraint):
1886         (WebCore::RealtimeMediaSource::applyConstraints):
1887         (WebCore::RealtimeMediaSource::setSize):
1888         (WebCore::RealtimeMediaSource::setWidth):
1889         (WebCore::RealtimeMediaSource::setHeight):
1890         (WebCore::RealtimeMediaSource::setFrameRate):
1891         (WebCore::RealtimeMediaSource::setAspectRatio):
1892         (WebCore::RealtimeMediaSource::setFacingMode):
1893         (WebCore::RealtimeMediaSource::setVolume):
1894         (WebCore::RealtimeMediaSource::setSampleRate):
1895         (WebCore::RealtimeMediaSource::setSampleSize):
1896         (WebCore::RealtimeMediaSource::setEchoCancellation):
1897         * platform/mediastream/RealtimeMediaSource.h:
1898         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
1899         (WebCore::RealtimeMediaSourceSettings::diff const):
1900         * platform/mediastream/RealtimeMediaSourceSettings.h:
1901         (WebCore::RealtimeMediaSourceSettings::allFlags):
1902         * platform/mediastream/RealtimeVideoSource.cpp:
1903         (WebCore::RealtimeVideoSource::applySize): Deleted.
1904         (WebCore::RealtimeVideoSource::applyFrameRate): Deleted.
1905         * platform/mediastream/RealtimeVideoSource.h:
1906         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
1907         (WebCore::GStreamerAudioCaptureSource::settingsDidChange):
1908         (WebCore::GStreamerAudioCaptureSource::applySampleRate): Deleted.
1909         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
1910         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1911         (WebCore::GStreamerVideoCaptureSource::settingsDidChange):
1912         (WebCore::GStreamerVideoCaptureSource::applySize): Deleted.
1913         (WebCore::GStreamerVideoCaptureSource::applyFrameRate): Deleted.
1914         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
1915         * platform/mediastream/mac/AVVideoCaptureSource.h:
1916         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1917         (WebCore::AVVideoCaptureSource::settingsDidChange):
1918         (WebCore::AVVideoCaptureSource::setPreset):
1919         (WebCore::AVVideoCaptureSource::setFrameRate):
1920         (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
1921         (WebCore::AVVideoCaptureSource::processNewFrame):
1922         (WebCore::AVVideoCaptureSource::applySize): Deleted.
1923         (WebCore::AVVideoCaptureSource::applyFrameRate): Deleted.
1924         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1925         (WebCore::CoreAudioCaptureSource::settingsDidChange):
1926         (WebCore::CoreAudioCaptureSource::applySampleRate): Deleted.
1927         (WebCore::CoreAudioCaptureSource::applyEchoCancellation): Deleted.
1928         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1929         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1930         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
1931         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
1932         (WebCore::DisplayCaptureSourceCocoa::applySize): Deleted.
1933         (WebCore::DisplayCaptureSourceCocoa::applyFrameRate): Deleted.
1934         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
1935         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1936         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1937         (WebCore::MockRealtimeAudioSourceMac::settingsDidChange):
1938         (WebCore::MockRealtimeAudioSourceMac::applySampleRate): Deleted.
1939         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
1940         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1941         (WebCore::MockRealtimeVideoSourceMac::settingsDidChange):
1942         (WebCore::MockRealtimeVideoSourceMac::applySize): Deleted.
1943         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1944         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
1945         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
1946         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1947         (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange):
1948         (WebCore::ScreenDisplayCaptureSourceMac::applySize): Deleted.
1949         (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Deleted.
1950         * platform/mock/MockRealtimeAudioSource.cpp:
1951         (WebCore::MockRealtimeAudioSource::settingsDidChange):
1952         * platform/mock/MockRealtimeAudioSource.h:
1953         * platform/mock/MockRealtimeVideoSource.cpp:
1954         (WebCore::MockRealtimeVideoSource::settingsDidChange):
1955         (WebCore::MockRealtimeVideoSource::applySize): Deleted.
1956         * platform/mock/MockRealtimeVideoSource.h:
1957
1958 2018-09-05  Zalan Bujtas <zalan@apple.com>
1959
1960         [LFC][BFC] Move MarginCollapse class under BlockFormattingContext::Geometry
1961         https://bugs.webkit.org/show_bug.cgi?id=189296
1962
1963         Reviewed by Antti Koivisto.
1964
1965         Margin collapsing is part of geometry after all.
1966
1967         * layout/blockformatting/BlockFormattingContext.cpp:
1968         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1969         * layout/blockformatting/BlockFormattingContext.h:
1970         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1971         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
1972         * layout/blockformatting/BlockMarginCollapse.cpp:
1973         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
1974         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
1975         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
1976         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
1977         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
1978         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
1979         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
1980         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
1981         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
1982         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
1983         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
1984         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop): Deleted.
1985         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
1986         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
1987         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop): Deleted.
1988         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom): Deleted.
1989         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
1990         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
1991         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
1992         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom): Deleted.
1993         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop): Deleted.
1994
1995 2018-09-04  Zalan Bujtas  <zalan@apple.com>
1996
1997         [LFC] Make BlockFormattingContext::Geometry a subclass of FormattingContext::Geometry
1998         https://bugs.webkit.org/show_bug.cgi?id=189294
1999
2000         Reviewed by Antti Koivisto.
2001
2002         This simplifies some of the call sites.
2003
2004         * layout/blockformatting/BlockFormattingContext.cpp:
2005         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2006         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2007         * layout/blockformatting/BlockFormattingContext.h:
2008         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2009         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2010         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2011         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2012         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2013         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2014         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
2015
2016 2018-09-04  Frederic Wang  <fwang@igalia.com>
2017
2018         Add basic support for ScrollIntoViewOptions
2019         https://bugs.webkit.org/show_bug.cgi?id=189258
2020
2021         Reviewed by Simon Fraser.
2022
2023         This patch introduces a new ScrollIntoViewOptions parameter that can be passed into
2024         Element.scrollIntoView instead of a boolean. A basic support for scroll alignments is
2025         implemented, so that it is closer to the behavior of the CSSOMView spec while still remaining
2026         compatible with the current boolean-parameter implementation. Full implementation that
2027         takes into account orientation/direction will be handled in bug 161611. This patch is also a
2028         preliminary step to support the ScrollBehavior (bug 188043) for ScrollIntoView.
2029
2030         Tests: web-platform-tests/css/cssom-view/scrollintoview-html
2031                web-platform-tests/css/cssom-view/scrollIntoView-smooth.html
2032
2033         * CMakeLists.txt: Add new IDL files.
2034         * DerivedSources.make: Ditto.
2035         * Sources.txt: Add new generated cpp JS bindings.
2036         * WebCore.xcodeproj/project.pbxproj: Add files to build to XCode.
2037         * dom/Element.cpp:
2038         (WebCore::toScrollAlignment): Convert ScrollLogicalPosition to scroll alignment. Orientation
2039         and direction are not implemented yet.
2040         (WebCore::Element::scrollIntoView): Implement new scrollIntoView version accepting
2041         ScrollIntoViewOptions parameter.
2042         * dom/Element.h: Declare new scrollIntoView.
2043         * dom/Element.idl: Make scrollIntoView accept a ScrollIntoViewOptions parameter.
2044         * page/ScrollIntoViewOptions.h: Added.
2045         * page/ScrollIntoViewOptions.idl: Added.
2046         * page/ScrollLogicalPosition.h: Added.
2047         * page/ScrollLogicalPosition.idl: Added.
2048
2049 2018-09-04  Oriol Brufau  <obrufau@igalia.com>
2050
2051         Check important flags when serializing shorthand with "initial" values
2052         https://bugs.webkit.org/show_bug.cgi?id=188984
2053
2054         Reviewed by Antti Koivisto.
2055
2056         Test: imported/w3c/web-platform-tests/css/cssom/shorthand-serialization.html
2057
2058         The test still has some failures due to https://bugs.webkit.org/show_bug.cgi?id=185953
2059         but without this patch it would fail earlier.
2060
2061         * css/StyleProperties.cpp:
2062         (WebCore::StyleProperties::get4Values const):
2063
2064 2018-09-04  Antti Koivisto  <antti@apple.com>
2065
2066         Remove pointless RenderSVGResourceMode::ApplyToDefault enum value
2067         https://bugs.webkit.org/show_bug.cgi?id=189260
2068
2069         Reviewed by Sam Weinig.
2070
2071         Default does not need a bit, it is better represented with an empty OptionSet.
2072
2073         * rendering/svg/RenderSVGResource.cpp:
2074         (WebCore::requestPaintingResource):
2075         * rendering/svg/RenderSVGResource.h:
2076         * rendering/svg/RenderSVGResourceClipper.cpp:
2077         (WebCore::RenderSVGResourceClipper::applyResource):
2078         * rendering/svg/RenderSVGResourceFilter.cpp:
2079         (WebCore::RenderSVGResourceFilter::applyResource):
2080         (WebCore::RenderSVGResourceFilter::postApplyResource):
2081         * rendering/svg/RenderSVGResourceGradient.cpp:
2082         (WebCore::RenderSVGResourceGradient::applyResource):
2083         * rendering/svg/RenderSVGResourceMasker.cpp:
2084         (WebCore::RenderSVGResourceMasker::applyResource):
2085         * rendering/svg/RenderSVGResourcePattern.cpp:
2086         (WebCore::RenderSVGResourcePattern::applyResource):
2087         (WebCore::RenderSVGResourcePattern::postApplyResource):
2088         * rendering/svg/RenderSVGResourceSolidColor.cpp:
2089         (WebCore::RenderSVGResourceSolidColor::applyResource):
2090         (WebCore::RenderSVGResourceSolidColor::postApplyResource):
2091         * rendering/svg/SVGInlineTextBox.cpp:
2092         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
2093         (WebCore::SVGInlineTextBox::paintSelectionBackground):
2094         (WebCore::SVGInlineTextBox::paint):
2095         (WebCore::SVGInlineTextBox::acquirePaintingResource):
2096         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
2097         * rendering/svg/SVGRenderingContext.cpp:
2098         (WebCore::SVGRenderingContext::~SVGRenderingContext):
2099         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2100
2101 2018-08-29  Emilio Cobos Álvarez  <emilio@crisal.io>
2102
2103         Remove PseudoElementUserAgentCustom.
2104         https://bugs.webkit.org/show_bug.cgi?id=189089
2105
2106         Reviewed by Ryosuke Niwa.
2107
2108         Tests at https://github.com/web-platform-tests/wpt/pull/12743.
2109
2110         * css/CSSSelector.cpp:
2111         (WebCore::CSSSelector::pseudoId):
2112         (WebCore::CSSSelector::parsePseudoElementType):
2113         * css/CSSSelector.h:
2114         (WebCore::CSSSelector::isCustomPseudoElement const):
2115         * css/RuleSet.cpp:
2116         (WebCore::RuleSet::addRule):
2117         * css/parser/CSSParserSelector.h:
2118         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const):
2119
2120 2018-09-04  Dean Jackson  <dino@apple.com>
2121
2122         Post review Weinig fix-ups
2123         https://bugs.webkit.org/show_bug.cgi?id=189288
2124
2125         Reviewed by Sam Weinig.
2126
2127         Fix-ups from https://bugs.webkit.org/show_bug.cgi?id=189252
2128
2129         * platform/MIMETypeRegistry.cpp:
2130         (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes):
2131         (WebCore::initializeSystemPreviewMIMETypes): Deleted.
2132         * rendering/RenderThemeIOS.mm:
2133         (WebCore::arKitBundle):
2134         (WebCore::loadARKitPDFPage):
2135         (WebCore::systemPreviewLogo):
2136
2137 2018-09-04  Ryosuke Niwa  <rniwa@webkit.org>
2138
2139         slotchange event doesn't get fired when inserting, removing, or renaming slot elements
2140         https://bugs.webkit.org/show_bug.cgi?id=189144
2141         <rdar://problem/43871061>
2142
2143         Reviewed by Antti Koivisto.
2144
2145         This patch implements `slotchange` event when a slot element is inserted, removed, or renamed in the DOM tree.
2146         Let us consider each scenario separately.
2147
2148         Insertion (https://dom.spec.whatwg.org/#concept-node-insert): In this case, we must fire `slotchange` event on
2149         slot elements whose assigned nodes have changed in the tree order. When there is at most one slot element for
2150         each name, this can be done by simply checking whether each slot has assigned nodes or not. When there are more
2151         than one slot element, however, the newly inserted slot element may now become the first slot of a given name,
2152         and gain assined nodes while the previously first element loses its assigned nodes. To see if the newly inserted
2153         slot element is the first of its kind, we must travere the DOM tree to check the order of that and the previously
2154         first slot element. To do this, we resolve the slot elements before start inserting nodes in
2155         executeNodeInsertionWithScriptAssertion via SlotAssignment::resolveSlotsBeforeNodeInsertionOrRemoval. Note that
2156         when the DOM tree has at most one slot element of its kind, resolveSlotsBeforeNodeInsertionOrRemoval is a no-op
2157         and addSlotElementByName continues to operate in O(1). Becasue addSlotElementByName is called on each inserted
2158         slot element in the tree order, we do the tree traversal upon finding the first slot element which has more than
2159         one of its kind in the current tree. In this case, we resolve all other slot elements and enqueues slotchange
2160         event as needed to avoid doing the tree traversal more than once.
2161
2162         Removal (https://dom.spec.whatwg.org/#concept-node-remove): In removal, we're concerned with removing the first
2163         slot element of its kind. We must fire slotchange event on the remaining slot elements which became the first of
2164         its kind after the removal as well as the ones which got removed from the tree if they had assigned nodes.
2165         Furthermore, the DOM specification mandates that we first fire slotchange events in the tree from which a node
2166         was removed and then in the removed subtree. Because we must only fire slotchange event on the first slot element
2167         of its kind which has been removed, we must resolve the first slot elements of each kind before a node removal
2168         in removeAllChildrenWithScriptAssertion and removeNodeWithScriptAssertion as we've done for insertion. Again,
2169         in the case there was at most one slot element of each kind, resolveSlotsBeforeNodeInsertionOrRemoval is a no-op
2170         and removeSlotElementByName would continue to operate in O(1). When there are multiple slot elements for a given
2171         kind, we immediately enqueue slotchange event on the slot elements which newly became the first of its kind but
2172         delay the enqueuing of slotchange event on the removed slot elements until removeSlotElementByName is called on
2173         that element so that enqueuing of slotchange events on the slot elements still remaining in the in the tree would
2174         happen before those which got removed as the DOM specification mandates.
2175
2176         Rename (https://dom.spec.whatwg.org/#shadow-tree-slots): In the case the slot element's name content attribute
2177         is changed, the renamed element might have become the first of its kind or ceased to be the first of its kind.
2178         There could be two other slot elements appearing later in the tree order which might have gained or lost assigned
2179         nodes as a result. In this case, we invoke the algorithms for removing & inserting the slot with a key difference:
2180         we enqueue slotchange event on the renamed slot immediately if it has assigned nodes.
2181
2182         To enqueue slotchange event in the tree order, this patch adds oldElement, which is a WeakPtr to a slot element,
2183         to SlotAssignment::Slot. This WeakPtr is set to the slot element which used to have assigned nodes prior to the
2184         node insertion, removal, or rename but no longer has after the mutation. This patch also adds a slot mutation
2185         version number, m_slotMutationVersion, which is incremented whenever a node is about to be inserted or removed,
2186         and slot resolution version, m_slotResolutionVersion, which is set to the current slot mutation version number
2187         when the full slot resolution is triggered during slot mutations. They are used to avoid redundant tree traversals
2188         in resolveSlotsAfterSlotMutation. This patch also makes m_needsToResolveSlotElements compiled in release builds
2189         to avoid resolving slot elements when there is at most one slot element of each kind.
2190
2191         For insertion, oldElement is set to the slot which used to be the first of its kind before getting set to a slot
2192         element being inserted in resolveSlotsAfterSlotMutation. We enqueue slotchange event on the newly inserted slot
2193         element at that point (1). Since the slot element which used to be the first of its kind appears after the newly
2194         inserted slot element by definition, we're guaranteed to see this oldElement later in the tree traversal upon
2195         which we enqueue slotchange event. Note that if this slot element was the first of its kind, then we're simply
2196         hitting (1), which is O(1) and does not invoke the tree traversal.
2197
2198         For removal, oldElement is set to the slot which used to be the first of its kind. Because this slot element is
2199         getting removed, slotchange event must be enqueud after slotchange events have been enqueued on all slot elements
2200         still remaining in the tree. To do this, we enqueue slotchange event immediately on the first slot element of
2201         its kind during the tree traversal as we encounter it (2), and set oldElement to the previosuly-first-but-removed
2202         slot element. slotchange event is enqueued on this slot element when removeSlotElementByName is later invoked via
2203         HTMLSlotElement::removedFromAncestor which traverses each removed element in the tree order. Again, if this was
2204         the last slot of its kind, we'd simply expedite (2) by enqueuing slotchange event during removeSlotElementByName,
2205         which is O(1).
2206
2207         When the DOM invokes the concept to replace all children (https://dom.spec.whatwg.org/#concept-node-replace-all),
2208         however, this algorithm isn't sufficient because the removal of each child happens one after another. We would
2209         either need to resolve slots between each removal, or treat the removal of all children as a single operation.
2210         While the DOM specification currently specifies the former behavior, this patch implements the latter behavior
2211         to avoid useless work. See the DOM spec issue: https://github.com/w3c/webcomponents/issues/764
2212
2213         Test: fast/shadow-dom/slotchange-for-slot-mutation.html
2214
2215         * dom/ContainerNode.cpp:
2216         (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Call resolveSlotsBeforeNodeInsertionOrRemoval
2217         before start removing children.
2218         (WebCore::ContainerNode::removeNodeWithScriptAssertion): Ditto.
2219         (WebCore::executeNodeInsertionWithScriptAssertion): Ditto before inserting children.
2220         * dom/ShadowRoot.cpp:
2221         (WebCore::ShadowRoot::~ShadowRoot): Set m_hasBegunDeletingDetachedChildren to true. This flag is used to supress
2222         slotchange events during the shadow tree destruction.
2223         (WebCore::ShadowRoot::renameSlotElement): Added.
2224         (WebCore::ShadowRoot::removeSlotElementByName): Added oldParentOfRemovedTree as an argument.
2225         * dom/ShadowRoot.h:
2226         (WebCore::ShadowRoot::shouldFireSlotchangeEvent): Added.
2227         * dom/SlotAssignment.cpp:
2228         (WebCore::findSlotElement): Added.
2229         (WebCore::nextSlotElementSkippingSubtree): Added.
2230         (WebCore::SlotAssignment::hasAssignedNodes): Added. Returns true if the slot of a given name has assigned nodes.
2231         (WebCore::SlotAssignment::renameSlotElement): Added.
2232         (WebCore::SlotAssignment::addSlotElementByName): Call resolveSlotsAfterSlotMutation when slotchange event needs
2233         to be dispatched for the current slot and there are more than one slot elements.
2234         (WebCore::SlotAssignment::removeSlotElementByName): Ditto. When the slot's oldElement is set to the current slot
2235         element, meaning that this slot element used to have assigned nodes, then enqueue slotchange event. It also has
2236         a special case for oldParentOfRemovedTree is null when renaming a slot element. In this case, we want to enqueue
2237         slot change event immediately on the renamed slot element and any affected elements as in a node insertion since
2238         removeSlotElementByName would never be called on a slot element which newly become the first of its kind after
2239         a slot rename.
2240         (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): Added. This is the slot resolution algorithm invoked
2241         when there are more than one slot elements for a given name. It has two modes dealing with insertion & removal.
2242         The insertion mode is also used for renaming a slot element. The firs
2243         (WebCore::SlotAssignment::resolveSlotsBeforeNodeInsertionOrRemoval): Added. Resolves all slot elements prior to
2244         inserting or removing nodes. In many cases, this should be a no-op since m_needsToResolveSlotElements is set to
2245         true only when there are more than one slot element of its kind.
2246         (WebCore::SlotAssignment::willRemoveAllChildren): Ditto. Also sets m_willBeRemovingAllChildren to true.
2247         (WebCore::SlotAssignment::didChangeSlot):
2248         (WebCore::SlotAssignment::resolveAllSlotElements): Use seenFirstElement instead of element to indicate whether
2249         we have seen a slot element of given name for consistency with resolveSlotsAfterSlotMutation.
2250         * dom/SlotAssignment.h:
2251         (WebCore::SlotAssignment::Slot): Added oldElement and seenFirstElement.
2252         (WebCore::SlotAssignment): Always compile m_needsToResolveSlotElements. Added m_willBeRemovingAllChildren,
2253         m_slotMutationVersion, and m_slotResolutionVersion.
2254         (WebCore::ShadowRoot::resolveSlotsBeforeNodeInsertionOrRemoval): Added. Calls the one in SlotAssignment.
2255         (WebCore::ShadowRoot::willRemoveAllChildren): Ditto.
2256         * html/HTMLSlotElement.cpp:
2257         (WebCore::HTMLSlotElement::removedFromAncestor):
2258         (WebCore::HTMLSlotElement::attributeChanged): Calls ShadowRoot::renameSlotElement instead of
2259         removeSlotElementByName and addSlotElementByName pair.
2260
2261 2018-09-04  Youenn Fablet  <youenn@apple.com>
2262
2263         Make LibWebRTCRtpSenderBackend own its libwebrtc RTP sender backend
2264         https://bugs.webkit.org/show_bug.cgi?id=189270
2265
2266         Reviewed by Eric Carlson.
2267
2268         Previously, the libwebrtc senders were owned in LibWebRTCMediaEndpoint.
2269         This patch makes them be owned by LibWebRTCRtpSenderBackend.
2270         This simplifies the implementation of RTCRtpSender::getParameters.
2271         This will help simplify the implementation of RTCRtpSender::replaceTrack.
2272
2273         removeTrack is also refactored so that LibWebRTCMediaEndpoint directly uses libwebrtc constructs and not WebCore libwebrtc-agnostic ones.
2274
2275         No change of behavior.
2276
2277         * Modules/mediastream/PeerConnectionBackend.h:
2278         (WebCore::PeerConnectionBackend::removeTrack):
2279         (WebCore::PeerConnectionBackend::notifyRemovedTrack): Deleted.
2280         * Modules/mediastream/RTCPeerConnection.cpp:
2281         (WebCore::RTCPeerConnection::removeTrack):
2282         * Modules/mediastream/RTCRtpSender.cpp:
2283         (WebCore::RTCRtpSender::getParameters):
2284         * Modules/mediastream/RTCRtpSender.h:
2285         (WebCore::RTCRtpSender::backend):
2286         * Modules/mediastream/RTCRtpSenderBackend.h:
2287         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2288         (WebCore::LibWebRTCMediaEndpoint::addTrack):
2289         (WebCore::LibWebRTCMediaEndpoint::removeTrack):
2290         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
2291         (WebCore::LibWebRTCMediaEndpoint::stop):
2292         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const): Deleted.
2293         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const): Deleted.
2294         (WebCore::LibWebRTCMediaEndpoint::getRTCRtpSenderParameters): Deleted.
2295         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2296         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2297         (WebCore::backendFromRTPSender):
2298         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
2299         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
2300         (WebCore::LibWebRTCPeerConnectionBackend::removeTrack):
2301         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
2302         (WebCore::LibWebRTCPeerConnectionBackend::notifyRemovedTrack): Deleted.
2303         (WebCore::LibWebRTCPeerConnectionBackend::getParameters const): Deleted.
2304         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2305         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
2306         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
2307         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
2308
2309 2018-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2310
2311         Populate "text/uri-list" with multiple URLs when the pasteboard contains multiple URLs
2312         https://bugs.webkit.org/show_bug.cgi?id=188890
2313         <rdar://problem/43648605>
2314
2315         Reviewed by Tim Horton.
2316
2317         Adds support for exposing a newline separated list of URLs via DataTransfer's "text/uri-list" type when pasting
2318         or dropping multiple items on the pasteboard that can be represented as URLs. Currently on iOS, only the URL of
2319         the first item (if present) is exposed, and on macOS, only the first out of all the URLs in the pasteboard is
2320         exposed.
2321
2322         To fix this, we introduce `Pasteboard::readAllStrings`, which reads a list of pasteboard strings collected from
2323         all available items on the platform pasteboard. Currently, this is only used to provide a list of URL strings
2324         when fetching data for the "text/uri-list" type when calling `DataTransfer.getData()` and
2325         `DataTransferItem.getAsString()`.
2326
2327         Tests:  DragAndDropTests.ExposeMultipleURLsInDataTransfer
2328                 UIPasteboardTests.DataTransferURIListContainsMultipleURLs
2329                 PasteMixedContent.PasteOneOrMoreURLs
2330
2331         * dom/DataTransfer.cpp:
2332         (WebCore::readURLsFromPasteboardAsString):
2333
2334         Add a helper method that reads all URL strings from the pasteboard (for the MIME type "text/uri-list", which
2335         corresponds to NSURLPboardType and "public.url" on macOS and iOS, respectively) and returns a single string
2336         containing all non-empty URLs joined by newline characters. Also takes a filtering block which may be used to
2337         reject URLs from being included in "text/uri-list" output.
2338
2339         (WebCore::DataTransfer::getDataForItem const):
2340         (WebCore::DataTransfer::readStringFromPasteboard const):
2341
2342         Insteading of reading a single string from the pasteboard for "text/uri-list", call the above helper function to
2343         read all URL strings in the pasteboard. If there are files present in the pasteboard, we also filter out URLs
2344         whose schemes are not in the set of schemes that are safe to expose to the page (i.e. http(s), blob, and data).
2345
2346         * platform/Pasteboard.cpp:
2347         (WebCore::Pasteboard::readAllStrings):
2348
2349         Add a default non-Cocoa implementation of readAllStrings() that returns a vector, which may contain the result
2350         of readString().
2351
2352         * platform/Pasteboard.h:
2353         * platform/PasteboardStrategy.h:
2354         * platform/PlatformPasteboard.h:
2355
2356         Add plumbing to grab a list of strings from the pasteboard for a given type.
2357
2358         * platform/cocoa/PasteboardCocoa.mm:
2359         (WebCore::Pasteboard::readAllStrings):
2360         (WebCore::Pasteboard::readString):
2361
2362         Implement these two methods in terms of `readPlatformValuesAsStrings`. `readAllStrings` returns the full list of
2363         results, while `readString` only returns the first result.
2364
2365         * platform/ios/PasteboardIOS.mm:
2366         (WebCore::Pasteboard::readPlatformValuesAsStrings):
2367         (WebCore::Pasteboard::readPlatformValueAsString): Deleted.
2368
2369         Refactor this Cocoa helper function to return a list of pasteboard string values for the given type, rather than
2370         a single string.
2371
2372         * platform/ios/PlatformPasteboardIOS.mm:
2373         (WebCore::PlatformPasteboard::allStringsForType const):
2374
2375         Grab a string for each item (represented by an NSItemProvider) in the pasteboard that has data for the given
2376         type identifier.
2377
2378         (WebCore::PlatformPasteboard::readString const):
2379
2380         Return the absolute string of the NSURL, instead of WebCore::URL::string(). This is needed to handle the case
2381         where the NSURL is constructed from absolute and relative parts using a Plist. While -absoluteString gets us the
2382         full URL string, URL::string() only returns the relative portion.
2383
2384         * platform/mac/PasteboardMac.mm:
2385         (WebCore::Pasteboard::readPlatformValuesAsStrings):
2386         (WebCore::Pasteboard::readPlatformValueAsString): Deleted.
2387
2388         Also refactor this to retrieve a list of pasteboard strings, rather than a single result.
2389
2390         * platform/mac/PlatformPasteboardMac.mm:
2391         (WebCore::typeIdentifierForPasteboardType):
2392         (WebCore::PlatformPasteboard::allStringsForType const):
2393
2394         Add an implementation for `allStringsForType` on macOS. Unlike iOS, it's much trickier to get this right since
2395         we need to maintain compatibility with legacy "NS*Pboard" types, and `NSPasteboardItem` can only provide data
2396         for `NSPasteboardType`s (i.e. UTIs), so there's no way to just iterate through each pasteboard item and ask it
2397         for data that matches the given type, if the types are not UTIs. However, in the case where we have multiple
2398         items, the client must have used NSPasteboardWriting-conformant objects and/or NSPasteboardItem itself to write
2399         data to the pasteboard. Since NSPasteboardWriting-conformant objects register modern pasteboard types when
2400         writing to the pasteboard, we can simply iterate over these pasteboard items and ask for property lists using
2401         type identifiers instead of having to worry about legacy pasteboard types. Furthermore, in the case where there
2402         is only a single item in the pasteboard and we do need to handle legacy pasteboard types, using `-[NSPasteboard
2403         stringForType:]` in the same way we do currently should yield the correct result.
2404
2405         As such, in the case where there is a single pasteboard item, we use `-[NSPasteboard stringForType:]` with the
2406         original legacy type, and in the case where there are multiple items on the pasteboard, we iterate over each of
2407         the pasteboard items and call `-[NSPasteboardItem propertyListForType:]` with the modern pasteboard type
2408         corresponding to the given legacy pasteboard type.
2409
2410         The different corner cases in this logic are tested by the new API test, PasteMixedContent.PasteOneOrMoreURLs,
2411         which exercises several different ways of writing one or more URLs to the pasteboard on macOS, which each result
2412         in different legacy and modern pasteboard types being written to the pasteboard; our implementation of
2413         `PlatformPasteboard::allStringsForType` on macOS handles all cases correctly.
2414
2415 2018-09-04  Simon Fraser  <simon.fraser@apple.com>
2416
2417         CSS reference filter that references a tiled feTurbulence is blank
2418         https://bugs.webkit.org/show_bug.cgi?id=188950
2419
2420         Reviewed by Dean Jackson.
2421         
2422         We need to run the code that was in RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion()
2423         for CSS reference filters, to set up the various rects in the filter effects.
2424         
2425         Do this by moving the code to FilterEffect::determineFilterPrimitiveSubregion(), which makes sense
2426         because it recurses on the FilterEffect input chain. To make it CSS/SVGFilter agnostic, we move filterRegionInUserSpace()
2427         to the Filter base class (for CSSFilter, it just returns m_filterRegion).
2428
2429         Test: css3/filters/reference-filter-set-filter-regions.html
2430
2431         * platform/graphics/filters/Filter.h:
2432         * platform/graphics/filters/FilterEffect.cpp:
2433         (WebCore::FilterEffect::determineFilterPrimitiveSubregion):
2434         * platform/graphics/filters/FilterEffect.h:
2435         * rendering/CSSFilter.cpp:
2436         (WebCore::CSSFilter::determineFilterPrimitiveSubregion):
2437         * rendering/CSSFilter.h:
2438         * rendering/RenderLayerFilters.cpp:
2439         (WebCore::RenderLayerFilters::beginFilterEffect):
2440         * rendering/svg/RenderSVGResourceFilter.cpp:
2441         (WebCore::RenderSVGResourceFilter::applyResource):
2442         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
2443         (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Deleted.
2444         * rendering/svg/RenderSVGResourceFilterPrimitive.h:
2445         * svg/graphics/filters/SVGFilter.h:
2446
2447 2018-09-04  Zalan Bujtas  <zalan@apple.com>
2448
2449         [LFC] Rename LayoutPair to BoxPair
2450         https://bugs.webkit.org/show_bug.cgi?id=189276
2451
2452         Reviewed by Antti Koivisto.
2453
2454         * layout/FormattingContext.h:
2455         * layout/blockformatting/BlockFormattingContext.cpp:
2456         (WebCore::Layout::BlockFormattingContext::layout const):
2457
2458 2018-09-04  Youenn Fablet  <youenn@apple.com>
2459
2460         Disable WebRTC unified plan runtime flag by default
2461         https://bugs.webkit.org/show_bug.cgi?id=189264
2462
2463         Reviewed by Jer Noble.
2464
2465         Covered by existing tests.
2466
2467         * testing/Internals.cpp:
2468         (WebCore::Internals::resetToConsistentState):
2469         Activate unified plan for testing.
2470
2471 2018-09-04  Zalan Bujtas  <zalan@apple.com>
2472
2473         [LFC][BFC] Merge computeInFlowWidth(Height)AndMargin and computeFloatingWidth(Height)AndMargin.
2474         https://bugs.webkit.org/show_bug.cgi?id=189271
2475
2476         Reviewed by Antti Koivisto.
2477
2478         This is in preparation for adding min/max-widht(height).
2479
2480         * layout/FormattingContext.cpp:
2481         (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const): Deleted.
2482         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const): Deleted.
2483         * layout/FormattingContext.h:
2484         * layout/blockformatting/BlockFormattingContext.cpp:
2485         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2486         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2487         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const): Deleted.
2488         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const): Deleted.
2489         * layout/blockformatting/BlockFormattingContext.h:
2490
2491 2018-09-04  Rob Buis  <rbuis@igalia.com>
2492
2493         Adjust XMLHttpRequest username/password precedence rules
2494         https://bugs.webkit.org/show_bug.cgi?id=184910
2495
2496         Reviewed by Chris Dumez.
2497
2498         Steps 9.1 and 9.2 in the XMLHTTPRequest::open [1] algorithm
2499         specify that non null user or non null password ought
2500         to be set on the URL, so implement this.
2501
2502         Behavior matches Firefox and Chrome.
2503
2504         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-open
2505
2506         Test: xhr/send-authentication-competing-names-passwords.htm
2507
2508         * xml/XMLHttpRequest.cpp:
2509         (WebCore::XMLHttpRequest::open):
2510
2511 2018-09-04  Simon Fraser  <simon.fraser@apple.com>
2512
2513         Simplify RenderLayer filter code
2514         https://bugs.webkit.org/show_bug.cgi?id=189248
2515
2516         Reviewed by Dean Jackson.
2517         
2518         Painting filters in RenderLayer involved the confusingly named RenderLayer::FilterInfo,
2519         and FilterEffectRenderer/FilterEffectRendererHelper. Reduce confusion by just collapsing
2520         these together into RenderLayerFilters. RenderLayerFilters stores a reference to the
2521         CSSFilter, and knows how to set it up, and vend a GraphicsContext* for painting the content
2522         to be filtered.
2523         
2524         It's also simpler to just give RenderLayer a member variable for RenderLayerFilters, rather
2525         than using a side hash (we can recoup the space in other ways layer).
2526
2527         * Sources.txt:
2528         * WebCore.xcodeproj/project.pbxproj:
2529         * css/CSSFilterImageValue.cpp:
2530         * rendering/CSSFilter.h:
2531         * rendering/FilterEffectRenderer.cpp: Removed.
2532         * rendering/FilterEffectRenderer.h: Removed.
2533         * rendering/RenderLayer.cpp:
2534         (WebCore::RenderLayer::RenderLayer):
2535         (WebCore::RenderLayer::~RenderLayer):
2536         (WebCore::RenderLayer::paintsWithFilters const):
2537         (WebCore::RenderLayer::requiresFullLayerImageForFilters const):
2538         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
2539         (WebCore::RenderLayer::filtersForPainting const):
2540         (WebCore::RenderLayer::setupFilters):
2541         (WebCore::RenderLayer::applyFilters):
2542         (WebCore::RenderLayer::paintLayerContents):
2543         (WebCore::RenderLayer::calculateClipRects const):
2544         (WebCore::RenderLayer::filter const): Deleted.
2545         (WebCore::RenderLayer::filterPainter const): Deleted.
2546         (WebCore::RenderLayer::hasFilterThatIsPainting const): Deleted.
2547         * rendering/RenderLayer.h:
2548         * rendering/RenderLayerFilterInfo.cpp: Removed.
2549         * rendering/RenderLayerFilters.cpp: Added.
2550         (WebCore::RenderLayerFilters::RenderLayerFilters):
2551         (WebCore::RenderLayerFilters::~RenderLayerFilters):
2552         (WebCore::RenderLayerFilters::setFilter):
2553         (WebCore::RenderLayerFilters::hasFilterThatMovesPixels const):
2554         (WebCore::RenderLayerFilters::hasFilterThatShouldBeRestrictedBySecurityOrigin const):
2555         (WebCore::RenderLayerFilters::notifyFinished):
2556         (WebCore::RenderLayerFilters::updateReferenceFilterClients):
2557         (WebCore::RenderLayerFilters::removeReferenceFilterClients):
2558         (WebCore::RenderLayerFilters::buildFilter):
2559         (WebCore::RenderLayerFilters::beginFilterEffect):
2560         (WebCore::RenderLayerFilters::applyFilterEffect):
2561         * rendering/RenderLayerFilters.h: Renamed from Source/WebCore/rendering/RenderLayerFilterInfo.h.
2562
2563 2018-09-04  Dean Jackson  <dino@apple.com>
2564
2565         Build fix.
2566
2567         * testing/Internals.cpp:
2568
2569 2018-09-03  Dean Jackson  <dino@apple.com>
2570
2571         Move SystemPreview code from WebKitAdditions to WebKit
2572         https://bugs.webkit.org/show_bug.cgi?id=189252
2573         <rdar://problem/44080245>
2574
2575         Reviewed by Wenson Hsieh.
2576
2577         Move the WebKitAdditions code into WebKit/WebCore.
2578
2579         * html/HTMLAnchorElement.cpp:
2580         (WebCore::HTMLAnchorElement::relList const): Look for "ar".
2581         (WebCore::HTMLAnchorElement::isSystemPreviewLink const): Ditto.
2582
2583         * platform/MIMETypeRegistry.cpp: Add a couple of new static methods
2584         for System Preview MIME types.
2585         (WebCore::initializeSystemPreviewMIMETypes):
2586         (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes):
2587         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
2588         * platform/MIMETypeRegistry.h:
2589
2590         * rendering/RenderThemeIOS.mm: Load the ARKit artwork from the framework.
2591         (WebCore::arKitBundle):
2592         (WebCore::loadARKitPDFPage):
2593         (WebCore::systemPreviewLogo):
2594         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
2595
2596         * testing/Internals.cpp: Remove internal helper.
2597         (WebCore::Internals::systemPreviewRelType): Deleted.
2598         * testing/Internals.h:
2599         * testing/Internals.idl:
2600
2601 2018-09-04  Andy Estes  <aestes@apple.com>
2602
2603         [Payment Request] PaymentResponse should have an onpayerdetailchange event handler
2604         https://bugs.webkit.org/show_bug.cgi?id=189249
2605
2606         Reviewed by Alex Christensen.
2607
2608         Implemented the onpayerdetailchange event handler as defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
2609
2610         The "payer detail changed" algorithm will be implemented in a follow-up patch.
2611
2612         Covered by existing web platform tests.
2613
2614         * Modules/paymentrequest/PaymentResponse.cpp:
2615         (WebCore::PaymentResponse::scriptExecutionContext const):
2616         * Modules/paymentrequest/PaymentResponse.h:
2617         * Modules/paymentrequest/PaymentResponse.idl:
2618         * dom/EventNames.h:
2619         * dom/EventTargetFactory.in:
2620
2621 2018-09-04  Youenn Fablet  <youenn@apple.com>
2622
2623         Introduce LibWebRTC backends for sender and receiver
2624         https://bugs.webkit.org/show_bug.cgi?id=189171
2625
2626         Reviewed by Alejandro G. Castro.
2627
2628         Rename RTCRtpSender::Backend to RTCRtpSenderBackend, ditto for RTCRtpReceiver::Backend.
2629         Make RTCRtpSender/RTCRtpReceiver own their backend.
2630         This will allow the backends to own a libwebrtc sender/receiver ref counted object
2631         and might allow us to cleanly separate code from unified plan vs plan B.
2632
2633         Update code so that libwebrtc code specific code is now creating senders and receivers.
2634         This moves code from RTCPeerConnection down to LibWebRTCPeerConnectionBackend, in particular for
2635         addTrack and addTransceiver methods.
2636
2637         Moved some code from LibWebRTCMediaEndpoint to LibWebRTCUtils to ease readability.
2638
2639         A future patch will allow to tie the libwebrtc sender/receiver to WebKit DOM sender/receiver.
2640
2641         Covered by existing tests.
2642
2643         * Modules/mediastream/PeerConnectionBackend.cpp:
2644         (WebCore::PeerConnectionBackend::addTrack):
2645         (WebCore::PeerConnectionBackend::addTransceiver):
2646         * Modules/mediastream/PeerConnectionBackend.h:
2647         * Modules/mediastream/RTCPeerConnection.cpp:
2648         (WebCore::RTCPeerConnection::addTrack):
2649         (WebCore::RTCPeerConnection::addTransceiver):
2650         (WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
2651         * Modules/mediastream/RTCPeerConnection.h:
2652         * Modules/mediastream/RTCRtpReceiver.cpp:
2653         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
2654         * Modules/mediastream/RTCRtpReceiver.h:
2655         (WebCore::RTCRtpReceiver::create):
2656         (WebCore::RTCRtpReceiver::setBackend):
2657         * Modules/mediastream/RTCRtpReceiverBackend.h: Added.
2658         (WebCore::RTCRtpReceiverBackend::getParameters):
2659         * Modules/mediastream/RTCRtpSender.cpp:
2660         (WebCore::RTCRtpSender::create):
2661         (WebCore::RTCRtpSender::RTCRtpSender):
2662         * Modules/mediastream/RTCRtpSender.h:
2663         * Modules/mediastream/RTCRtpSenderBackend.h: Added.
2664         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2665         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
2666         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2667         (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
2668         (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
2669         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
2670         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
2671         (WebCore::LibWebRTCPeerConnectionBackend::completeAddTransceiver):
2672         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2673         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: Added.
2674         (WebCore::LibWebRTCRtpReceiverBackend::getParameters):
2675         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h: Added.
2676         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: Added.
2677         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
2678         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
2679         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: Added.
2680         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
2681         (WebCore::fillEncodingParameters):
2682         (WebCore::fillHeaderExtensionParameters):
2683         (WebCore::fillCodecParameters):
2684         (WebCore::fillRtpParameters):
2685         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
2686         (WebCore::fromStdString):
2687         * WebCore.xcodeproj/project.pbxproj:
2688
2689 2018-09-04  Antoine Quint  <graouts@apple.com>
2690
2691         [Modern Media Controls] Disabling both fullscreen and picture-in-picture shows an empty top left container
2692         https://bugs.webkit.org/show_bug.cgi?id=189259
2693         <rdar://problem/42026625>
2694
2695         Reviewed by Dean Jackson.
2696
2697         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html
2698
2699         Ensure the top left controls bar is hidden when none of its children are visible.
2700
2701         * Modules/modern-media-controls/controls/inline-media-controls.js:
2702         (InlineMediaControls.prototype.layout):
2703
2704 2018-09-04  Daniel Bates  <dabates@apple.com>
2705
2706         Attempt to fix failing tests following r235615 (https://bugs.webkit.org/show_bug.cgi?id=187925)
2707
2708         An inline text box that does not have combined text and contains a single character
2709         should be considered as having text content.
2710
2711         * rendering/InlineTextBox.cpp:
2712         (WebCore::InlineTextBox::hasTextContent const):
2713
2714 2018-09-04  Per Arne Vollan  <pvollan@apple.com>
2715
2716         Add test for fix in https://bugs.webkit.org/show_bug.cgi?id=187922
2717         https://bugs.webkit.org/show_bug.cgi?id=187925
2718
2719         Reviewed by Simon Fraser.
2720
2721         This will test that the function primaryScreenDisplayID() returns a valid display ID.
2722
2723         Test: fast/misc/valid-primary-screen-displayID.html
2724
2725         * platform/PlatformScreen.h:
2726         * platform/mac/PlatformScreenMac.mm:
2727         (WebCore::primaryScreenDisplayID):
2728         * testing/Internals.cpp:
2729         (WebCore::Internals::primaryScreenDisplayID):
2730         * testing/Internals.h:
2731         * testing/Internals.idl:
2732
2733 2018-09-04  Daniel Bates  <dabates@apple.com>
2734
2735         Add helper function to create a potential CORS request
2736         https://bugs.webkit.org/show_bug.cgi?id=189251
2737
2738         Reviewed by Andy Estes.
2739
2740         Add a new function, createPotentialAccessControlRequest, that we will use to implement the algorithm Create a potential-
2741         CORS request from the HTML standard: <https://html.spec.whatwg.org/multipage/urls-and-fetching.html#create-a-potential-cors-request> (31 August 2018).
2742         This function replaces CachedResourceRequest::setAsPotentiallyCrossOrigin() and is the first step towards separating
2743         the concepts of CORS settings states and module script credentials mode as well as implementing the aforementioned
2744         algorithm. Rename CachedResourceRequest::setAsPotentiallyCrossOrigin() to deprecatedSetAsPotentiallyCrossOrigin()
2745         and switch existing callers to use createPotentialAccessControlRequest(). For now, createPotentialAccessControlRequest()
2746         is implemented in terms of deprecatedSetAsPotentiallyCrossOrigin().
2747
2748         No functionality changed. So, no new tests.
2749
2750         * bindings/js/CachedScriptFetcher.cpp:
2751         (WebCore::CachedScriptFetcher::requestScriptWithCache const): Write in terms of WebCore::createPotentialAccessControlRequest().
2752         * html/HTMLLinkElement.cpp:
2753         (WebCore::HTMLLinkElement::process): Ditto.
2754         * html/parser/HTMLResourcePreloader.cpp:
2755         (WebCore::PreloadRequest::resourceRequest): Ditto.
2756         * loader/CrossOriginAccessControl.cpp:
2757         (WebCore::createPotentialAccessControlRequest): For now, implemented in terms of CachedResourceRequest::deprecatedSetAsPotentiallyCrossOrigin().
2758         * loader/CrossOriginAccessControl.h:
2759         * loader/ImageLoader.cpp:
2760         (WebCore::ImageLoader::updateFromElement): Write in terms of WebCore::createPotentialAccessControlRequest().
2761         * loader/LinkLoader.cpp:
2762         (WebCore::LinkLoader::preloadIfNeeded): Ditto.
2763         * loader/MediaResourceLoader.cpp:
2764         (WebCore::MediaResourceLoader::requestResource): Ditto. Also renamed local variable cacheRequest to cachedRequest.
2765         * loader/TextTrackLoader.cpp:
2766         (WebCore::TextTrackLoader::load): Write in terms of WebCore::createPotentialAccessControlRequest(). Also change local variable
2767         document from a pointer to a reference since this function asserts that the script execution context is a non-null Document.
2768         * loader/cache/CachedResourceRequest.cpp:
2769         (WebCore::CachedResourceRequest::deprecatedSetAsPotentiallyCrossOrigin): Renamed; formerly named setAsPotentiallyCrossOrigin.
2770         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin): Deleted.
2771         * loader/cache/CachedResourceRequest.h:
2772         (WebCore::CachedResourceRequest::setPriority): Added.
2773
2774 2018-09-04  Daniel Bates  <dabates@apple.com>
2775
2776         Remove redundant inline text boxes for empty combined text
2777         https://bugs.webkit.org/show_bug.cgi?id=189119
2778
2779         Reviewed by Zalan Bujtas.
2780
2781         We should consider inline text boxes that have a combined text renderer (RenderCombineText)
2782         whose composed string is empty as "redundant" just as we do for inline text boxes that have
2783         a non-combined text renderer that have zero length so that we remove them. Such boxes are
2784         visibly empty and do not take up space visually. By removing them we reduce memory and make
2785         it easier to reason about the line box tree.
2786
2787         Currently RenderBlockFlow::computeBlockDirectionPositionsForLine() tests if an inline text
2788         box is empty by checking if it has a zero length (InlineTextBox::len()). However an inline
2789         text box associated with a RenderCombineText always has length 1 regardless of whether the
2790         composed string it represents is the empty string. Instead we should expose a way to check
2791         if an inline text box is visually empty and have RenderBlockFlow::computeBlockDirectionPositionsForLine()
2792         query the inline text box for this answer.
2793
2794         * rendering/InlineTextBox.cpp:
2795         (WebCore::InlineTextBox::hasTextContent const): Added. Returns whether an inline text box
2796         has text content. We do not need to consider hypenation since hypens are an embellishment (i.e.
2797         they are not part of the markup of the page).
2798         (WebCore::InlineTextBox::paint): Write in terms of hasTextContent().
2799         (WebCore::InlineTextBox::subdivideAndResolveStyle): Assert that WebCore::subdivide() always
2800         returns a non-empty list of subdivisions. A non-empty text box should always have at least
2801         one subdivision, say for the unmarked text. I left the existing conditonal (though marked
2802         it as UNLIKELY()) so as to be forgiving and avoid a bad user experience should WebCore::subdivide()
2803         return an empty vector in a non-debug build.
2804         * rendering/InlineTextBox.h:
2805         * rendering/RenderBlockLineLayout.cpp:
2806         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine): Write in terms of InlineTextBox::hasTextContent()
2807         so that we remove empty inline text boxes associated with combined text.
2808         * rendering/RenderText.cpp:
2809         (WebCore::RenderText::positionLineBox): Write in terms of InlineTextBox::hasTextContent().
2810
2811 2018-09-04  Zan Dobersek  <zdobersek@igalia.com> and Ms2ger  <Ms2ger@igalia.com>
2812
2813         Implement support for passing ImageBitmap to texImage2D/texSubImage2D
2814         https://bugs.webkit.org/show_bug.cgi?id=187584
2815
2816         Reviewed by Dean Jackson.
2817
2818         Test: fast/canvas/webgl/gl-teximage-imagebitmap.html
2819
2820         * html/canvas/WebGL2RenderingContext.h: Update union type definition.
2821         * html/canvas/WebGL2RenderingContext.idl: Update union type definition.
2822         * html/canvas/WebGLRenderingContext.idl: Update union type definition.
2823         * html/canvas/WebGLRenderingContextBase.cpp:
2824         (WebCore::WebGLRenderingContextBase::texSubImage2D): implement.
2825         (WebCore::WebGLRenderingContextBase::texImage2D): implement.
2826         * html/canvas/WebGLRenderingContextBase.h: Update union type definition; add to TexFuncValidationSourceType.
2827         * html/canvas/WebGLRenderingContextBase.idl: Remove unused union type definition.
2828
2829 2018-09-04  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2830
2831         [EME] Add the WebM initData support in ClearKey CDM
2832         https://bugs.webkit.org/show_bug.cgi?id=189240
2833
2834         Reviewed by Xabier Rodriguez-Calvar.
2835
2836         Add the "webm" initDataType support in ClearKey CDM.
2837         Read the WebM initData by following the W3C spec https://www.w3.org/TR/eme-initdata-webm/#common-system,
2838         and put it in JSON object format like is specified in https://www.w3.org/TR/encrypted-media/#clear-key-request-format.
2839
2840         Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-event-mse.html
2841                media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html
2842
2843         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2844         (WebCore::extractKeyIdFromWebMInitData):
2845         (WebCore::CDMPrivateClearKey::supportsInitDataType const):
2846         (WebCore::CDMPrivateClearKey::supportsInitData const):
2847         (WebCore::CDMInstanceClearKey::requestLicense):
2848
2849 2018-09-03  Andy Estes  <aestes@apple.com>
2850
2851         [Payment Request] Remove PaymentAddress.languageCode
2852         https://bugs.webkit.org/show_bug.cgi?id=189254
2853
2854         Reviewed by Sam Weinig.
2855
2856         PaymentAddress.languageCode is marked as "at risk" in the latest Payment Request Editor's
2857         Draft (30 August 2018). Firefox has already removed it, and Chrome is considering it.
2858
2859         There is some compatibility risk in removing this attribute, but considering we never
2860         populated it with a meaningful value, the risk seems very low. If we learn about
2861         compatibility problems, we can address them by evangelising or even reverting this change.
2862
2863         Updated existing tests.
2864
2865         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2866         (WebCore::convert):
2867         * Modules/paymentrequest/PaymentAddress.cpp:
2868         (WebCore::PaymentAddress::PaymentAddress):
2869         * Modules/paymentrequest/PaymentAddress.h:
2870         * Modules/paymentrequest/PaymentAddress.idl:
2871
2872 2018-09-03  Andy Estes  <aestes@apple.com>
2873
2874         [Payment Request] Add a stub for PaymentResponse.retry
2875         https://bugs.webkit.org/show_bug.cgi?id=189253
2876
2877         Reviewed by Sam Weinig.
2878
2879         Implemented the AddressErrors, PayerErrorFields, and PaymentValidationErrors dictionaries as
2880         defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
2881
2882         Also added a stub implementation of PaymentResponse.retry. This method will be implemented
2883         with tests in a follow-up patch.
2884
2885         * CMakeLists.txt:
2886         * DerivedSources.make:
2887         * Modules/paymentrequest/AddressErrors.h: Added.
2888         * Modules/paymentrequest/AddressErrors.idl: Added.
2889         * Modules/paymentrequest/PayerErrorFields.h: Added.
2890         * Modules/paymentrequest/PayerErrorFields.idl: Added.
2891         * Modules/paymentrequest/PaymentResponse.cpp:
2892         (WebCore::PaymentResponse::retry):
2893         * Modules/paymentrequest/PaymentResponse.h:
2894         * Modules/paymentrequest/PaymentResponse.idl:
2895         * Modules/paymentrequest/PaymentValidationErrors.h: Added.
2896         * Modules/paymentrequest/PaymentValidationErrors.idl: Added.
2897         * Sources.txt:
2898         * WebCore.xcodeproj/project.pbxproj:
2899
2900 2018-09-03  Andy Estes  <aestes@apple.com>
2901
2902         [Payment Request] MerchantValidationEvent should be enabled by the PaymentRequest setting
2903         https://bugs.webkit.org/show_bug.cgi?id=189250
2904
2905         Reviewed by Daniel Bates.
2906
2907         * Modules/paymentrequest/MerchantValidationEvent.idl:
2908
2909 2018-09-03  Youenn Fablet  <youenn@apple.com>
2910
2911         REGRESSION: Layout Test http/tests/security/bypassing-cors-checks-for-extension-urls.html is Flaky
2912         https://bugs.webkit.org/show_bug.cgi?id=187658
2913         <rdar://problem/42306442>
2914
2915         Reviewed by Alexey Proskuryakov.
2916
2917         Test is flaky as a previous test was setting the isRunningUserScripts state on the Page and it was never reset.
2918         This patch moves this state to the topDocument so that it will be reset for every navigation.
2919         Covered by existing test being no longer flaky.
2920
2921         * dom/Document.h:
2922         (WebCore::Document::setAsRunningUserScripts):
2923         (WebCore::Document::isRunningUserScripts const):
2924         * loader/DocumentThreadableLoader.cpp:
2925         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2926         * page/Frame.cpp:
2927         (WebCore::Frame::injectUserScriptImmediately):
2928         * page/Page.h:
2929         (WebCore::Page::setAsRunningUserScripts): Deleted.
2930         (WebCore::Page::isRunningUserScripts const): Deleted.
2931         * testing/Internals.cpp:
2932         (WebCore::Internals::setAsRunningUserScripts):
2933
2934 2018-09-03  Andy Estes  <aestes@apple.com>
2935
2936         [Payment Request] Implement the MerchantValidationEvent constructor
2937         https://bugs.webkit.org/show_bug.cgi?id=189235
2938
2939         Reviewed by Daniel Bates.
2940
2941         Implemented the constructor for MerchantValidationEvent as defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
2942
2943         Updated the payment-request web platform tests to include MerchantValidationEvent tests.
2944
2945         Tests: imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html
2946                imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html
2947                imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html
2948                imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html
2949                imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html
2950                imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html
2951
2952         * CMakeLists.txt:
2953         * DerivedSources.make:
2954         * Modules/paymentrequest/MerchantValidationEvent.cpp:
2955         (WebCore::MerchantValidationEvent::create):
2956         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
2957         (WebCore::MerchantValidationEvent::complete):
2958         * Modules/paymentrequest/MerchantValidationEvent.h:
2959         * Modules/paymentrequest/MerchantValidationEvent.idl:
2960         * Modules/paymentrequest/MerchantValidationEventInit.h: Added.
2961         * Modules/paymentrequest/MerchantValidationEventInit.idl: Added.
2962         * Modules/paymentrequest/PaymentRequest.idl:
2963         * Sources.txt:
2964         * WebCore.xcodeproj/project.pbxproj:
2965         * bindings/js/WebCoreBuiltinNames.h:
2966
2967 2018-09-03  Philippe Normand  <pnormand@igalia.com>
2968
2969         [GStreamer] elements registration clean-ups
2970         https://bugs.webkit.org/show_bug.cgi?id=189192
2971
2972         Reviewed by Xabier Rodriguez-Calvar.
2973
2974         Register all our elements from the base player class. This
2975         simplifies the MSE player by removing duplicated code.
2976
2977         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2978         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2979         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
2980         (WebCore::registerWebKitGStreamerElements): Deleted.
2981         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2982         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
2983         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
2984         (WebCore::mimeTypeCache):
2985         (WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Deleted.
2986         (WebCore::MediaPlayerPrivateGStreamerMSE::isAvailable): Deleted.
2987         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2988
2989 2018-09-02  Zalan Bujtas  <zalan@apple.com>
2990
2991         REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value()
2992         https://bugs.webkit.org/show_bug.cgi?id=189232
2993         <rdar://problem/43886373>
2994
2995         Reviewed by Brent Fulgham.
2996
2997         It's not guaranteed that RenderFlexibleBox::computeMainAxisExtentForChild() always returns with a valid value.
2998
2999         Test: fast/flexbox/crash-when-min-max-content-is-not-computed.html
3000
3001         * rendering/RenderFlexibleBox.cpp:
3002         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
3003
3004 2018-09-01  Simon Fraser  <simon.fraser@apple.com>
3005
3006         Rename FilterEffectRenderer to CSSFilter
3007         https://bugs.webkit.org/show_bug.cgi?id=189223
3008
3009         Reviewed by Sam Weinig.
3010
3011         Filter was subclassed by SVGFilter for SVG, and FilterEffectRenderer for CSS,
3012         which was very confusing, especially when the code uses renderer() to get it.
3013         
3014         Rename FilterEffectRenderer to CSSFilter, and access via filter().
3015         
3016         Future cleanup will deal with FilterEffectRendererHelper.
3017
3018         * Sources.txt:
3019         * WebCore.xcodeproj/project.pbxproj:
3020         * css/CSSFilterImageValue.cpp:
3021         (WebCore::CSSFilterImageValue::image):
3022         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
3023         * platform/graphics/filters/Filter.h:
3024         (WebCore::Filter::isCSSFilter const):
3025         * rendering/CSSFilter.cpp: Copied from Source/WebCore/rendering/FilterEffectRenderer.cpp.
3026         (WebCore::endMatrixRow):
3027         (WebCore::lastMatrixRow):
3028         (WebCore::CSSFilter::create):
3029         (WebCore::CSSFilter::CSSFilter):
3030         (WebCore::m_sourceGraphic):
3031         (WebCore::CSSFilter::inputContext):
3032         (WebCore::CSSFilter::buildReferenceFilter):
3033         (WebCore::CSSFilter::build):
3034         (WebCore::CSSFilter::updateBackingStoreRect):
3035         (WebCore::CSSFilter::allocateBackingStoreIfNeeded):
3036         (WebCore::CSSFilter::clearIntermediateResults):
3037         (WebCore::CSSFilter::apply):
3038         (WebCore::CSSFilter::computeSourceImageRectForDirtyRect):
3039         (WebCore::CSSFilter::output const):
3040         (WebCore::CSSFilter::setSourceImageRect):
3041         (WebCore::CSSFilter::setMaxEffectRects):
3042         (WebCore::CSSFilter::outputRect const):
3043         * rendering/CSSFilter.h: Copied from Source/WebCore/rendering/FilterEffectRenderer.h.
3044         (isType):
3045         * rendering/FilterEffectRenderer.cpp:
3046         (WebCore::FilterEffectRendererHelper::prepareFilterEffect):
3047         (WebCore::FilterEffectRendererHelper::filterContext const):
3048         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
3049         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
3050         (WebCore::endMatrixRow): Deleted.
3051         (WebCore::lastMatrixRow): Deleted.
3052         (WebCore::FilterEffectRenderer::FilterEffectRenderer): Deleted.
3053         (WebCore::m_sourceGraphic): Deleted.
3054         (WebCore::FilterEffectRenderer::create): Deleted.
3055         (WebCore::FilterEffectRenderer::inputContext): Deleted.
3056         (WebCore::FilterEffectRenderer::buildReferenceFilter): Deleted.
3057         (WebCore::FilterEffectRenderer::build): Deleted.
3058         (WebCore::FilterEffectRenderer::updateBackingStoreRect): Deleted.
3059         (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Deleted.
3060         (WebCore::FilterEffectRenderer::clearIntermediateResults): Deleted.
3061         (WebCore::FilterEffectRenderer::apply): Deleted.
3062         (WebCore::FilterEffectRenderer::computeSourceImageRectForDirtyRect): Deleted.
3063         (WebCore::FilterEffectRenderer::output const): Deleted.
3064         (WebCore::FilterEffectRenderer::setMaxEffectRects): Deleted.
3065         (WebCore::FilterEffectRenderer::outputRect const): Deleted.
3066         * rendering/FilterEffectRenderer.h:
3067         (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper):
3068         (WebCore::FilterEffectRenderer::setSourceImageRect): Deleted.
3069         * rendering/RenderBlockFlow.cpp:
3070         * rendering/RenderFrame.cpp:
3071         * rendering/RenderImage.cpp:
3072         * rendering/RenderLayer.cpp:
3073         (WebCore::RenderLayer::requiresFullLayerImageForFilters const):
3074         (WebCore::RenderLayer::filter const):
3075         (WebCore::RenderLayer::filterPainter const):
3076         (WebCore::RenderLayer::setupFilters):
3077         (WebCore::RenderLayer::calculateClipRects const):
3078         (WebCore::RenderLayer::filterRenderer const): Deleted.
3079         * rendering/RenderLayer.h:
3080         * rendering/RenderLayerBacking.cpp:
3081         * rendering/RenderLayerFilterInfo.cpp:
3082         (WebCore::RenderLayer::FilterInfo::setFilter):
3083         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
3084         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
3085         (WebCore::RenderLayer::FilterInfo::setRenderer): Deleted.
3086         * rendering/RenderLayerFilterInfo.h:
3087         * rendering/updating/RenderTreeBuilderBlock.cpp:
3088
3089 2018-09-01  Darin Adler  <darin@apple.com>
3090
3091         [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently
3092         https://bugs.webkit.org/show_bug.cgi?id=189072
3093
3094         Reviewed by Dan Bernstein.
3095
3096         * platform/mac/WebCoreNSURLExtras.mm: Include CFNetworkSPI.h and remove a
3097         declaration of +[NSURLProtocol _protocolClassForRequest:].
3098
3099         * platform/network/mac/ResourceHandleMac.mm: Remove a declaration of
3100         -[NSURLConnection _initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:].
3101         (WebCore::ResourceHandle::createNSURLConnection): Add ignore of
3102         "-Wdeprecated-declarations" around use of the above method, since it
3103         is deprecated.
3104
3105 2018-09-01  Simon Fraser  <simon.fraser@apple.com>
3106
3107         Add some more filter logging
3108         https://bugs.webkit.org/show_bug.cgi?id=189221
3109
3110         Reviewed by Anders Carlsson.
3111
3112         Add logging in FilterEffect::apply() that shows all the filter rects, and logging
3113         that brackets the application of a whole filter chain, for both SVG and CSS filters.
3114
3115         * platform/graphics/filters/FilterEffect.cpp:
3116         (WebCore::FilterEffect::apply):
3117         * rendering/FilterEffectRenderer.cpp:
3118         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
3119         * rendering/svg/RenderSVGResourceFilter.cpp:
3120         (WebCore::RenderSVGResourceFilter::postApplyResource):
3121
3122 2018-08-31  Youenn Fablet  <youenn@apple.com>
3123
3124         Move stats gathering out of LibWebRTCMediaEndpoint
3125         https://bugs.webkit.org/show_bug.cgi?id=189180
3126
3127         Reviewed by Alejandro G. Castro.
3128
3129         Move stats gathering in LibWebRTCStatsCollector.
3130         Make sure that the lambda given to the collector is always called and destroyed from the main thread.
3131         This allows capturing the promise here instead of storing it into the peer connection backend.
3132         No change of behavior.
3133
3134         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3135         (WebCore::LibWebRTCMediaEndpoint::getStats):
3136         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3137         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3138         (WebCore::LibWebRTCPeerConnectionBackend::getStats):
3139         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
3140         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3141         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: Added.
3142         (WebCore::LibWebRTCStatsCollector::LibWebRTCStatsCollector):
3143         (WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
3144         (WebCore::fromStdString):
3145         (WebCore::fillRTCStats):
3146         (WebCore::fillRTCRTPStreamStats):
3147         (WebCore::fillInboundRTPStreamStats):
3148         (WebCore::fillOutboundRTPStreamStats):
3149         (WebCore::fillRTCMediaStreamTrackStats):
3150         (WebCore::fillRTCDataChannelStats):
3151         (WebCore::iceCandidatePairState):
3152         (WebCore::fillRTCIceCandidatePairStats):
3153         (WebCore::fillRTCCertificateStats):
3154         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
3155         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: Added.
3156         (WebCore::LibWebRTCStatsCollector::create):
3157         * WebCore.xcodeproj/project.pbxproj:
3158
3159 2018-08-31  Jer Noble  <jer.noble@apple.com>
3160
3161         Compile error in RealtimeOutgoingVideoSource.cpp; unused parameter in libwebrtc header
3162         https://bugs.webkit.org/show_bug.cgi?id=189203
3163
3164         Reviewed by Youenn Fablet.
3165
3166         If RealtimeOutgoingVideoSource.cpp is compiled alone (non-unified) or if it is the first file compiled in
3167         a unified build, there is no pragma set to ignore unused parameter warnings in place.
3168
3169         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
3170
3171 2018-08-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3172
3173         [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
3174         https://bugs.webkit.org/show_bug.cgi?id=189054
3175         <rdar://problem/43819779>
3176
3177         Reviewed by Tim Horton.
3178
3179         Remove redundant and unnecessary logic for reading from the pasteboard on iOS.
3180
3181         * platform/PlatformPasteboard.h:
3182         * platform/ios/PlatformPasteboardIOS.mm:
3183         (WebCore::PlatformPasteboard::stringForType const):
3184
3185         This currently grabs a string corresponding to the given type from the first item in the pasteboard. Make
3186         stringForType instead call readString with pasteboard item index 0.
3187
3188         (WebCore::PlatformPasteboard::count const):
3189         (WebCore::PlatformPasteboard::readBuffer const):
3190         (WebCore::PlatformPasteboard::readString const):
3191
3192         Make readString with "public.url" call readURL.
3193
3194         (WebCore::PlatformPasteboard::readURL const):
3195
3196         Remove logic for reading URLs from the pasteboard as property lists deserialized from properly lists. This was
3197         added in r223195 due to fix a case "when UIPasteboard serializes NSURL as a plist" when grabbing pasteboard data
3198         using -valuesForPasteboardType:inItemSet:. However, this case only arises in non-UI applications (i.e. when
3199         UIApplicationInitialize() has not been invoked); this is currently exercised by the test CopyURL.ValidURL, but
3200         doesn't really correspond to a real-world use case, since all UI applications where a user would be able to
3201         paste in a web view already invoke UIApplicationInitialize().
3202
3203         Instead of handling the case where the pasteboard contains a property list that has not been coerced to an
3204         NSURL, simply remove the code from PlatformPasteboard::readURL and allow UIKit to perform the coercion when
3205         running the test.
3206
3207         (WebCore::PlatformPasteboard::count): Deleted.
3208         (WebCore::PlatformPasteboard::readBuffer): Deleted.
3209         (WebCore::PlatformPasteboard::readString): Deleted.
3210         (WebCore::PlatformPasteboard::readURL): Deleted.
3211
3212         Mark these functions as `const`.
3213
3214         * platform/wpe/PlatformPasteboardWPE.cpp:
3215         (WebCore::PlatformPasteboard::readString const):
3216         (WebCore::PlatformPasteboard::readString): Deleted.
3217
3218         Mark this function as const.
3219
3220 2018-08-31  Jer Noble  <jer.noble@apple.com>
3221
3222         Compilation error in FormData.cpp: incomplete type 'WebCore::SharedBuffer'
3223         https://bugs.webkit.org/show_bug.cgi?id=189207
3224
3225         Reviewed by Youenn Fablet.
3226
3227         If FormData.cpp is compiled alone (non-unified) or if it is the first file compiled in
3228         a unified build, SharedBuffer.h is not included.
3229
3230         * platform/network/FormData.cpp:
3231
3232 2018-08-31  Chris Dumez  <cdumez@apple.com>
3233
3234         [ WK2 ] http/tests/workers/service/client-*-page-cache.html LayoutTests are flaky
3235         https://bugs.webkit.org/show_bug.cgi?id=183705
3236         <rdar://problem/42440606>
3237
3238         Reviewed by Youenn Fablet.
3239
3240         Add internals.serviceWorkerClientIdentifier() utility function so that a layout test can get the
3241         service worker client identifier of a document.
3242
3243         * testing/Internals.cpp:
3244         (WebCore::Internals::serviceWorkerClientIdentifier const):
3245         * testing/Internals.h:
3246         * testing/Internals.idl:
3247
3248 2018-08-31  John Wilander  <wilander@apple.com>
3249
3250         Storage Access API: Maintain access through same-site navigations
3251         https://bugs.webkit.org/show_bug.cgi?id=188564
3252         <rdar://problem/43445160>
3253
3254         Reviewed by Alex Christensen.
3255
3256         Tests: http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html
3257                http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html
3258
3259         * dom/Document.h:
3260             Removed unused member variable m_hasFrameSpecificStorageAccess.
3261         * loader/DocumentLoader.cpp:
3262         (WebCore::DocumentLoader::willSendRequest):
3263         * loader/FrameLoaderClient.h:
3264
3265 2018-08-31  Youenn Fablet  <youenn@apple.com>
3266
3267         WebAudioBufferList.cpp/.h is named as cocoa/WebAudioBufferList.cpp/.h
3268         https://bugs.webkit.org/show_bug.cgi?id=189160
3269
3270         Reviewed by Jer Noble.
3271
3272         Add WebAudioBufferList.cpp to unified build.
3273         Update XCode project so that the file names are right.
3274         No change of behavior.
3275
3276         * PlatformMac.cmake:
3277         * SourcesCocoa.txt:
3278         * WebCore.xcodeproj/project.pbxproj:
3279
3280 2018-08-31  Chris Dumez  <cdumez@apple.com>
3281
3282         Assertion hit in ~CompletionHandler() from ~WebFrame()
3283         https://bugs.webkit.org/show_bug.cgi?id=189199
3284         <rdar://problem/42657233>
3285
3286         Reviewed by Youenn Fablet.
3287
3288         The issue was caused by WebFrame::m_willSubmitFormCompletionHandlers implicitly containing
3289         CompletionHandlers (wrapped in WTF::Functions) and not calling them upon WebFrame
3290         destruction.
3291
3292         No new tests, covered by fast/frames/iframe-target.html.
3293
3294         * loader/EmptyClients.cpp:
3295         (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm):
3296         * loader/EmptyFrameLoaderClient.h:
3297         * loader/FrameLoaderClient.h:
3298
3299 2018-08-31  Zalan Bujtas  <zalan@apple.com>
3300
3301         [LFC] Add margin box verification back now that Display::Box has non-computed horizontal margin.
3302         https://bugs.webkit.org/show_bug.cgi?id=189193
3303
3304         Reviewed by Antti Koivisto.
3305
3306         Use the non-computed margin values to verify correctness.
3307         This patch also fixes a margin collapsing issue when the inflow box has a float sibling. The float
3308         sibling does not prevent collapsing with the parent's top/bottom margin.
3309
3310         Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html
3311
3312         * layout/Verification.cpp:
3313         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3314         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
3315         * layout/blockformatting/BlockMarginCollapse.cpp:
3316         (WebCore::Layout::isMarginTopCollapsedWithParent):
3317         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
3318
3319 2018-08-31  Antti Koivisto  <antti@apple.com>
3320
3321         Replace OptionSet |= and -= operators with add() and remove() functions
3322         https://bugs.webkit.org/show_bug.cgi?id=189169
3323
3324         Reviewed by Anders Carlsson.
3325
3326         * accessibility/AccessibilityObject.cpp:
3327         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
3328         * css/StyleBuilderConverter.h:
3329         (WebCore::StyleBuilderConverter::convertTextDecoration):
3330         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
3331         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
3332         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
3333         (WebCore::StyleBuilderConverter::convertSpeakAs):
3334         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
3335         * css/parser/CSSParser.cpp:
3336         (WebCore::CSSParser::parseSystemColor):
3337         * dom/Document.cpp:
3338         (WebCore::Document::styleColorOptions const):
3339         * dom/DocumentMarkerController.cpp:
3340         (WebCore::DocumentMarkerController::addMarker):
3341         (WebCore::DocumentMarkerController::removeMarkers):
3342         * dom/ScriptedAnimationController.cpp:
3343         (WebCore::ScriptedAnimationController::addThrottlingReason):
3344         (WebCore::ScriptedAnimationController::removeThrottlingReason):
3345         * dom/SecurityContext.h:
3346         (WebCore::SecurityContext::setFoundMixedContent):
3347         * dom/UIEventWithKeyState.cpp:
3348         (WebCore::UIEventWithKeyState::modifiersFromInitializer):
3349         (WebCore::UIEventWithKeyState::setModifierKeys):
3350         * dom/UserActionElementSet.cpp:
3351         (WebCore::UserActionElementSet::setFlags):
3352         * editing/CompositeEditCommand.cpp:
3353         (WebCore::CompositeEditCommand::moveParagraphs):
3354         * editing/Editor.cpp:
3355         (WebCore::Editor::replaceSelectionWithFragment):
3356         (WebCore::Editor::appliedEditing):
3357         (WebCore::Editor::markMisspellingsAfterTypingToWord):
3358         (WebCore::Editor::markMisspellingsAndBadGrammar):
3359         (WebCore::Editor::resolveTextCheckingTypeMask):
3360         * editing/FrameSelection.cpp:
3361         (WebCore::FrameSelection::moveWithoutValidationTo):
3362         (WebCore::FrameSelection::setSelectedRange):
3363         * editing/FrameSelection.h:
3364         (WebCore::FrameSelection::defaultSetSelectionOptions):
3365         * editing/MoveSelectionCommand.cpp:
3366         (WebCore::MoveSelectionCommand::doApply):
3367         * editing/SpellChecker.cpp:
3368         (WebCore::SpellChecker::didCheckSucceed):
3369         * editing/TextCheckingHelper.cpp:
3370         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
3371         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
3372         * editing/TextIterator.cpp:
3373         (WebCore::SearchBuffer::SearchBuffer):
3374         * html/HTMLAnchorElement.cpp:
3375         (WebCore::HTMLAnchorElement::parseAttribute):
3376         * inspector/agents/InspectorPageAgent.cpp:
3377         (WebCore::InspectorPageAgent::reload):
3378         * page/ContextMenuController.cpp:
3379         (WebCore::ContextMenuController::contextMenuItemSelected):
3380         * page/DOMWindow.cpp:
3381         (WebCore::DOMWindow::find const):
3382         * page/DragController.cpp:
3383         (WebCore::DragController::concludeEditDrag):
3384         * page/FrameSnapshotting.cpp:
3385         (WebCore::snapshotFrameRectWithClip):
3386         * page/FrameView.cpp:
3387         (WebCore::updateLayerPositionFlags):
3388         (WebCore::FrameView::willPaintContents):
3389         * page/Page.cpp:
3390         (WebCore::Page::setIsVisible):
3391         * page/PerformanceObserver.cpp:
3392         (WebCore::PerformanceObserver::observe):
3393         * page/TextIndicator.cpp:
3394         (WebCore::TextIndicator::createWithRange):
3395         * page/WindowFeatures.cpp:
3396         (WebCore::parseDisabledAdaptations):
3397         * page/csp/ContentSecurityPolicy.h:
3398         (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts):
3399         (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets):
3400         * page/csp/ContentSecurityPolicySourceList.cpp:
3401         (WebCore::ContentSecurityPolicySourceList::parseHashSource):
3402         * platform/PlatformEvent.h:
3403         (WebCore::PlatformEvent::PlatformEvent):
3404         * platform/ios/PlatformEventFactoryIOS.mm:
3405         (WebCore::modifiersForEvent):
3406         * platform/mac/PlatformEventFactoryMac.mm:
3407         (WebCore::modifiersForEvent):
3408         * rendering/RenderLayer.cpp:
3409         (WebCore::RenderLayer::updateLayerPositions):
3410         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
3411         (WebCore::RenderLayer::paintLayer):
3412         (WebCore::RenderLayer::paintLayerContentsAndReflection):
3413         (WebCore::RenderLayer::paintLayerContents):
3414         (WebCore::RenderLayer::paintForegroundForFragments):
3415         * rendering/RenderLayerBacking.cpp:
3416         (WebCore::RenderLayerBacking::paintIntoLayer):
3417         (WebCore::RenderLayerBacking::paintContents):
3418         * rendering/RenderLayerCompositor.cpp:
3419         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
3420         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
3421         * rendering/TextDecorationPainter.cpp:
3422         (WebCore::collectStylesForRenderer):
3423         * rendering/TextPaintStyle.cpp:
3424         (WebCore::computeTextPaintStyle):
3425         * rendering/style/RenderStyle.cpp:
3426         (WebCore::RenderStyle::changeRequiresLayout const):
3427         (WebCore::RenderStyle::changeRequiresLayerRepaint const):
3428         (WebCore::RenderStyle::changeRequiresRepaint const):
3429         * testing/Internals.cpp:
3430         (WebCore::parseFindOptions):
3431         (WebCore::Internals::forceReload):
3432         (WebCore::Internals::setPageVisibility):
3433         (WebCore::Internals::setPageIsFocusedAndActive):
3434
3435 2018-08-31  Aditya Keerthi  <akeerthi@apple.com>
3436
3437         [Datalist][iOS] Add suggestions UI for TextFieldInputTypes
3438         https://bugs.webkit.org/show_bug.cgi?id=186714
3439
3440         Reviewed by Wenson Hsieh.
3441
3442         On iOS, the datalist button should appear as a downward triangle. Furthermore, the
3443         button should only be displayed if the input has focus and there are suggested
3444         values.
3445
3446         * css/html.css:
3447         (input::-webkit-list-button): Draw the triangle using an SVG.
3448         * html/DataListSuggestionInformation.h:
3449         * html/HTMLInputElement.h:
3450         * html/TextFieldInputType.cpp: Added logic to show and hide the datalist button as necessary.
3451         (WebCore::TextFieldInputType::handleFocusEvent):
3452         (WebCore::TextFieldInputType::handleBlurEvent):
3453         (WebCore::TextFieldInputType::didSetValueByUserEdit):
3454         (WebCore::TextFieldInputType::listAttributeTargetChanged):
3455         (WebCore::TextFieldInputType::displaySuggestions):
3456
3457 2018-08-31  Youenn Fablet  <youenn@apple.com>
3458
3459         Move LibWebRTCMediaEndpoint data channel code to LibWebRTCDataChannelHandler
3460         https://bugs.webkit.org/show_bug.cgi?id=189182
3461
3462         Reviewed by Alejandro G. Castro.
3463
3464         Moving data channel code outside of LibWebRTCMediaEndpoint.
3465         This will allow future development to support unified plan.
3466         No change of behavior.
3467
3468         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
3469         (WebCore::LibWebRTCDataChannelHandler::fromRTCDataChannelInit):
3470         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
3471         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
3472         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3473         (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
3474         (WebCore::LibWebRTCMediaEndpoint::OnDataChannel):
3475         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3476
3477 2018-08-31  Youenn Fablet  <youenn@apple.com>
3478
3479         Move session observers outside LibWebRTCMediaEndpoint
3480         https://bugs.webkit.org/show_bug.cgi?id=189181
3481
3482         Reviewed by Alejandro G. Castro.
3483
3484         Move classes of LibWebRTCMediaEndpoint to a separate file.
3485         No change of behavior.
3486
3487         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3488         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: Added.
3489         * WebCore.xcodeproj/project.pbxproj:
3490
3491 2018-08-31  Eric Carlson  <eric.carlson@apple.com>
3492
3493         [MediaStream] Remove AVMediaCaptureSource
3494         https://bugs.webkit.org/show_bug.cgi?id=189159
3495
3496         Reviewed by Youenn Fablet.
3497
3498         No new tests, no change in functionality.
3499
3500         Refactor video capture to get rid of a base class we don't 
3501         need any more.
3502
3503         * WebCore.xcodeproj/project.pbxproj:
3504         * platform/mediastream/mac/AVMediaCaptureSource.h: Removed.
3505         * platform/mediastream/mac/AVMediaCaptureSource.mm: Removed.
3506         * platform/mediastream/mac/AVVideoCaptureSource.h:
3507         (WebCore::AVVideoCaptureSource::session const):
3508         (WebCore::AVVideoCaptureSource::device const):
3509         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3510         (WebCore::globaVideoCaptureSerialQueue):
3511         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
3512         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
3513         (WebCore::AVVideoCaptureSource::startProducingData):
3514         (WebCore::AVVideoCaptureSource::stopProducingData):
3515         (WebCore::AVVideoCaptureSource::beginConfiguration):
3516         (WebCore::AVVideoCaptureSource::commitConfiguration):
3517         (WebCore::AVVideoCaptureSource::settingsDidChange):
3518         (WebCore::AVVideoCaptureSource::settings const):
3519         (WebCore::AVVideoCaptureSource::capabilities const):
3520         (WebCore::AVVideoCaptureSource::setPreset):
3521         (WebCore::AVVideoCaptureSource::setupSession):
3522         (WebCore::AVVideoCaptureSource::setupCaptureSession):
3523         (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
3524         (WebCore::AVVideoCaptureSource::interrupted const):
3525         (WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
3526         (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
3527         (WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
3528         (-[WebCoreAVVideoCaptureSourceObserver initWithCallback:]):
3529         (-[WebCoreAVVideoCaptureSourceObserver disconnect]):
3530         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
3531         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
3532         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
3533         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
3534         (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
3535         (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
3536         (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
3537         (WebCore::AVVideoCaptureSource::initializeCapabilities): Deleted.
3538         (WebCore::AVVideoCaptureSource::initializeSupportedConstraints): Deleted.
3539         (WebCore::AVVideoCaptureSource::updateSettings): Deleted.
3540
3541 2018-08-31  Philippe Normand  <pnormand@igalia.com>
3542
3543         Unreviewed, GTK Ubuntu LTS build fix after r235543.
3544
3545         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3546
3547 2018-08-31  Philippe Normand  <pnormand@igalia.com>
3548
3549         Unreviewed, fix compilation warning in EME GStreamer backend.
3550
3551         Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:1293:19:
3552         warning: format ‘%lu’ expects argument of type ‘long unsigned
3553         int’, but argument 9 has type ‘unsigned int’ [-Wformat=]
3554
3555         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3556         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
3557
3558 2018-08-31  Philippe Normand  <philn@igalia.com>
3559
3560         [GStreamer][GL] useless ifdef in pushTextureToCompositor
3561         https://bugs.webkit.org/show_bug.cgi?id=188552
3562
3563         Reviewed by Xabier Rodriguez-Calvar.
3564
3565         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3566         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
3567         There's no need for an ifdef because the frame holder already
3568         ensures a valid texture ID will be set if it maps a GL video frame.
3569
3570 2018-08-31  David Kilzer  <ddkilzer@apple.com>
3571
3572         REGRESSION (r235190): Fix name of WebAudioBufferList.{cpp,h} in Xcode project
3573
3574         * WebCore.xcodeproj/project.pbxproj:
3575         - Add the 'name' parameter to the file references, then fix the
3576           visual name everywhere else, so these files don't appear as
3577           "cocoa/WebAudioBufferList.{cpp,h}" in the project.
3578
3579 2018-08-31  Frederic Wang  <fwang@igalia.com>
3580
3581         Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement
3582         https://bugs.webkit.org/show_bug.cgi?id=182053
3583
3584         Reviewed by Simon Fraser.
3585
3586         This commit introduces a new CSSOMViewScrollingAPIEnabled flag that will be used to implement
3587         the standard behavior of DOM scroll* API as specified by the CSSOM View spec (see bug 5991).
3588         It changes the behavior of document.scrollingElement so that it follows the spec when the
3589         flag is enabled. This will allow to pass the WPT test cssom-view/scrollingElement.html when
3590         it becomes the default behavior. WPT tests cssom-view/scrollingElement-quirks-dynamic*.html
3591         still fail; comparing with Chromium's code, we might need to propagate the style of <html>
3592         and <body> to the viewport element. Behaviors for other scrolling attributes will be changed
3593         in follow-up bugs.
3594
3595         Tests: fast/dom/Document/scrollingElement-quirks-mode.html
3596                fast/dom/Document/scrollingElement-standard-mode.html
3597
3598         * dom/Document.cpp:
3599         (WebCore::Document::isBodyPotentiallyScrollable): Helper function to verify whether the body
3600         is potentially scrollable, as defined by the CSSOM View spec. It seems that
3601         RenderObject::hasOverflowClip() may return incorrect value at this point and we might need
3602         to do something similar to Chromium's style propagation to make it work. For now, we just
3603         use the computed style. See bug 182292.
3604         (WebCore::Document::scrollingElement): When CSSOMViewScrollingAPIEnabled is enabled, we
3605         implement the algorithm of the CSSOM View spec.
3606         (WebCore::Document::body const): Verify that the root is actually a <html> element or
3607         otherwise return null. This is required by the CSSOM View spec and for WPT test
3608         scrollingElement.html. It is consistent  with bodyOrFrameset().
3609         * dom/Document.h: Add spec references for body() and bodyOrFrameset() and declare
3610         isBodyPotentiallyScrollable().
3611         * page/Settings.yaml: Add developer option for enabling the CSSOM View behavior.
3612         * rendering/style/RenderStyle.h:
3613         (WebCore::RenderStyle::isOverflowVisible const): Add helper function to check whether the
3614         style implies visible overflow.
3615
3616 2018-08-30  Zalan Bujtas  <zalan@apple.com>
3617
3618         CounterMaps should hold a unique_ptr of CounterMap.
3619         https://bugs.webkit.org/show_bug.cgi?id=189174
3620         <rdar://problem/43686458>
3621
3622         Reviewed by Ryosuke Niwa.
3623
3624         In certain cases calls to CounterMaps might lead to unexpected deletion of the CounterMap object.
3625
3626         Test: fast/css/counters/crash-when-cloning-body.html
3627
3628         * rendering/RenderCounter.cpp:
3629         (WebCore::makeCounterNode):
3630         (WebCore::destroyCounterNodeWithoutMapRemoval):
3631         (WebCore::RenderCounter::destroyCounterNodes):
3632         (WebCore::RenderCounter::destroyCounterNode):
3633         (WebCore::updateCounters):
3634         (showCounterRendererTree):
3635
3636 2018-08-30  Ross Kirsling  <ross.kirsling@sony.com>
3637
3638         Speculative build fix for WPE after r235531.
3639
3640         * platform/graphics/filters/PointLightSource.cpp:
3641         Add missing include.
3642
3643 2018-08-30  Ryosuke Niwa  <rniwa@webkit.org>
3644
3645         Add assignedElements to HTMLSlotElement
3646         https://bugs.webkit.org/show_bug.cgi?id=189146
3647
3648         Reviewed by Darin Adler.
3649
3650         Added assignedElements to HTMLSlotElement. For now, we simply filter the results returned by assignedNodes.
3651
3652         Also fixed a bug that assignedNodes was returning the fallback content when the slot is not in a shadow tree,
3653         which is specified in step 2 of the concept to find flattened slotables for a slot.
3654
3655         Spec: https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignedelements
3656               https://dom.spec.whatwg.org/#find-flattened-slotables
3657
3658         Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html
3659                imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html
3660
3661         * html/HTMLSlotElement.cpp:
3662         (WebCore::flattenAssignedNodes): Updated to take Vector<Ref<Node>> for consistency.
3663         (WebCore::HTMLSlotElement::assignedNodes const): Ditto.
3664         (WebCore::HTMLSlotElement::assignedElements const):
3665         * html/HTMLSlotElement.h:
3666         * html/HTMLSlotElement.idl:
3667
3668 2018-08-30  Don Olmstead  <don.olmstead@sony.com>
3669
3670         [CMake] Replace AVFoundationSupport.py using CMake
3671         https://bugs.webkit.org/show_bug.cgi?id=182891
3672
3673         Reviewed by Per Arne Vollan.
3674
3675         No new tests. No change in behavior.
3676
3677         Remove refernces to PAL derived sources.
3678
3679         * PlatformWin.cmake:
3680         * config.h:
3681
3682 2018-08-30  Olivia Barnett  <obarnett@apple.com>
3683
3684         REGRESSION(r235489): fast/dom/navigator-detached-no-crash.html crashes under Navigator::share
3685         https://bugs.webkit.org/show_bug.cgi?id=189170
3686
3687         Reviewed by Tim Horton.
3688
3689         No new tests; fixing a failing existing test.
3690
3691         * page/Navigator.cpp:
3692         (WebCore::Navigator::share):
3693         Added null check for frame.
3694
3695 2018-08-30  Truitt Savell  <tsavell@apple.com>
3696
3697         Unreviewed, rolling out r235516.
3698
3699         Caused 50 Crashes on Sierra
3700
3701         Reverted changeset:
3702
3703         "The width of a nullptr TextRun should be zero"
3704         https://bugs.webkit.org/show_bug.cgi?id=189154
3705         https://trac.webkit.org/changeset/235516
3706
3707 2018-08-30  Tim Horton  <timothy_horton@apple.com>
3708
3709         Bundle unified sources more tightly in projects with deep directory structures
3710         https://bugs.webkit.org/show_bug.cgi?id=189009
3711
3712         Reviewed by Simon Fraser.
3713
3714         Fix a variety of unification errors due to reshuffling the bundles.
3715
3716         * Modules/mediastream/RTCController.cpp:
3717         * SourcesCocoa.txt:
3718         * WebCore.xcodeproj/project.pbxproj:
3719         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
3720         (WebCore::CryptoAlgorithmECDSA::importKey):
3721         * dom/Document.h:
3722         * html/parser/HTMLTreeBuilder.cpp:
3723         * loader/appcache/ApplicationCacheResourceLoader.h:
3724         * page/AlternativeTextClient.h:
3725         * platform/Pasteboard.h:
3726         * platform/graphics/DisplayRefreshMonitor.cpp:
3727         * platform/graphics/FontFamilySpecificationNull.cpp:
3728         * platform/graphics/cocoa/WebGLLayer.mm:
3729         (-[WebGLLayer initWithGraphicsContext3D:]):
3730         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
3731         (-[WebGLLayer display]):
3732         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
3733         * platform/graphics/cocoa/WebGPULayer.mm:
3734         (-[WebGPULayer initWithGPUDevice:]):
3735         * platform/graphics/metal/GPUCommandQueueMetal.mm:
3736         * platform/mac/PasteboardMac.mm:
3737         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
3738         * platform/network/ResourceRequestBase.cpp:
3739         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
3740         * rendering/updating/RenderTreeBuilderInline.cpp:
3741
3742 2018-08-30  Andy Estes  <aestes@apple.com>
3743
3744         [Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEventInit interfaces
3745         https://bugs.webkit.org/show_bug.cgi?id=189100
3746
3747         Reviewed by Daniel Bates.
3748
3749         Implement the PaymentMethodChangeEvent interface and PaymentMethodChangeEventInit dictionary
3750         defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
3751
3752         <https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>
3753
3754         The "payment method changed" algorithm will be implemented in a follow-up.
3755
3756         Covered by existing web platform tests.
3757
3758         * CMakeLists.txt:
3759         * DerivedSources.make:
3760         * Modules/paymentrequest/PaymentMethodChangeEvent.cpp: Added.
3761         (WebCore::PaymentMethodChangeEvent::eventInterface const):
3762         (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
3763         * Modules/paymentrequest/PaymentMethodChangeEvent.h: Added.
3764         * Modules/paymentrequest/PaymentMethodChangeEvent.idl: Added.
3765         * Modules/paymentrequest/PaymentMethodChangeEventInit.h: Added.
3766         * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Added.
3767         * Modules/paymentrequest/PaymentRequest.idl:
3768         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
3769         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
3770         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
3771         * Modules/paymentrequest/PaymentRequestUpdateEventInit.h:
3772         * Sources.txt:
3773         * WebCore.xcodeproj/project.pbxproj:
3774         * bindings/js/WebCoreBuiltinNames.h:
3775         * dom/EventNames.h:
3776         * dom/EventNames.in:
3777
3778 2018-08-30  Brent Fulgham  <bfulgham@apple.com>
3779
3780         The width of a nullptr TextRun should be zero
3781         https://bugs.webkit.org/show_bug.cgi?id=189154
3782         <rdar://problem/43685926>
3783
3784         Reviewed by Zalan Bujtas.
3785
3786         If a page has an empty TextRun and attempts to paint it we can crash with a nullptr.
3787
3788         This patch recognizes that an empty TextRun should always produce a zero width, rather than
3789         attempt to compute this value from font data.
3790
3791         Test: fast/text/null-string-textrun.html
3792
3793         * platform/graphics/FontCascade.cpp:
3794         (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width.
3795         (WebCore::FontCascade::width const): Ditto.
3796         (WebCore::FontCascade::codePath const): ASSERT that the TextRun is non-empty.
3797
3798 2018-08-30  Eric Carlson  <eric.carlson@apple.com>
3799
3800         Mock video devices should only support discrete sizes
3801         https://bugs.webkit.org/show_bug.cgi?id=189000
3802         <rdar://problem/43766551>
3803
3804         Reviewed by Youenn Fablet.
3805         
3806         While many/most video capture devices only support a finite number of discrete width/height
3807         pairs, our mock video capture devices supported arbitrary width and height combinations which
3808         made it difficult to write realistic tests using them. Change the mock devices to support
3809         finite "presets" like those supported by AVFoundation. Create a RealtimeVideoSource base
3810         class with support for these presets, so the same code will eventually be used by the mock
3811         and real capture devices.
3812
3813         No new tests, existing tests updated for these changes.
3814
3815         * Sources.txt: Add RealtimeVideoSource.cpp, remove MockRealtimeMediaSource.cpp.
3816
3817         * WebCore.xcodeproj/project.pbxproj: Ditto.
3818
3819         * platform/mediastream/MediaConstraints.h: Deal with min constraint less than the supported minimum
3820         and max larger than the supported maximum when there is no ideal.
3821
3822         * platform/mediastream/RealtimeMediaSource.cpp:
3823         (WebCore::RealtimeMediaSource::selectSettings): Use supportsSizeAndFrameRate for widths,
3824         heights, and framerates in advanced constraints so a width and height that are supported but
3825         in the same preset are filtered out.
3826         (WebCore::RealtimeMediaSource::setSize): New.
3827         * platform/mediastream/RealtimeMediaSource.h:
3828
3829         * platform/mediastream/RealtimeMediaSourceSettings.h: Remove an unneeded include.
3830
3831         * platform/mediastream/RealtimeVideoSource.cpp: Added.
3832         (WebCore::RealtimeVideoSource::RealtimeVideoSource):
3833         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
3834         (WebCore::RealtimeVideoSource::startProducingData):
3835         (WebCore::RealtimeVideoSource::setSupportedFrameRates):
3836         (WebCore::RealtimeVideoSource::addSupportedCapabilities const):
3837         (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate):
3838         (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight):
3839         (WebCore::RealtimeVideoSource::applySize):
3840         (WebCore::RealtimeVideoSource::applySizeAndFrameRate):
3841         (WebCore::RealtimeVideoSource::videoSampleAvailable):
3842         (WebCore::RealtimeVideoSource::applyFrameRate):
3843         (WebCore::RealtimeVideoSource::supportsFrameRate):
3844
3845         * platform/mediastream/RealtimeVideoSource.h: Copied from Source/WebCore/platform/mock/MockRealtimeAudioSource.h.
3846         (WebCore::RealtimeVideoSource::setSupportedCaptureSizes):
3847         (WebCore::RealtimeVideoSource::setDefaultSize):
3848         (WebCore::RealtimeVideoSource::observedFrameRate const):
3849
3850         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3851         (WebCore::AVMediaCaptureSource::initializeSettings): Don't set label, it isn't used.
3852
3853         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3854         (WebCore::MockRealtimeVideoSourceMac::applySize): Call the base class.
3855
3856         * platform/mock/MockMediaDevice.h:
3857         (WebCore::MockCameraProperties::encode const): Add frame rates, sizes, and facing mode.
3858         (WebCore::MockCameraProperties::decode): Ditto.
3859
3860         * platform/mock/MockRealtimeAudioSource.cpp:
3861         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): No more MockRealtimeMediaSource.
3862         (WebCore::MockRealtimeAudioSource::settings const): Clean up.
3863         (WebCore::MockRealtimeAudioSource::capabilities const): Ditto.
3864         (WebCore::MockRealtimeAudioSource::settingsDidChange): Ditto.
3865         (WebCore::MockRealtimeAudioSource::stopProducingData): m_elapsedTime isn't used, delete it.
3866         (WebCore::MockRealtimeAudioSource::updateSettings): Deleted.
3867         (WebCore::MockRealtimeAudioSource::initializeCapabilities): Deleted.
3868         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints): Deleted.
3869         (WebCore::MockRealtimeAudioSource::elapsedTime): Deleted.
3870         * platform/mock/MockRealtimeAudioSource.h:
3871
3872         * platform/mock/MockRealtimeMediaSourceCenter.cpp: Moved all of the mock device management
3873         code from MockRealtimeMediaSource.cpp here.
3874         (WebCore::defaultDevices):
3875         (WebCore::devices):
3876         (WebCore::deviceMap):
3877         (WebCore::deviceListForDevice):
3878         (WebCore::createCaptureDevice):
3879         (WebCore::MockRealtimeMediaSourceCenter::resetDevices):
3880         (WebCore::MockRealtimeMediaSourceCenter::setDevices):
3881         (WebCore::MockRealtimeMediaSourceCenter::addDevice):
3882         (WebCore::MockRealtimeMediaSourceCenter::removeDevice):
3883         (WebCore::MockRealtimeMediaSourceCenter::mockDeviceWithPersistentID):
3884         (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
3885         (WebCore::MockRealtimeMediaSourceCenter::audioDevices):
3886         (WebCore::MockRealtimeMediaSourceCenter::videoDevices):
3887         (WebCore::MockRealtimeMediaSourceCenter::displayDevices):
3888
3889         * platform/mock/MockRealtimeVideoSource.cpp:
3890         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Use RealtimeVideoSource, no
3891         more MockRealtimeMediaSource.
3892         (WebCore::MockRealtimeVideoSource::capabilities const): Ditto, cleanup.
3893         (WebCore::MockRealtimeVideoSource::settings const): Ditto.
3894         (WebCore::MockRealtimeVideoSource::settingsDidChange): Ditto.
3895         (WebCore::MockRealtimeVideoSource::startCaptureTimer): Ditto.
3896         (WebCore::MockRealtimeVideoSource::startProducingData): Ditto.
3897         (WebCore::MockRealtimeVideoSource::stopProducingData): Ditto.
3898         (WebCore::MockRealtimeVideoSource::elapsedTime): Ditto.
3899         (WebCore::MockRealtimeVideoSource::applySize): Ditto.
3900         (WebCore::MockRealtimeVideoSource::drawText): Render the actual frame rate.
3901         (WebCore::MockRealtimeVideoSource::generateFrame): Use m_fillColor.
3902         (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted.
3903         (WebCore::MockRealtimeVideoSource::updateSettings): Deleted.