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