[GStreamer] Utilities cleanups
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-24  Philippe Normand  <pnormand@igalia.com>
2
3         [GStreamer] Utilities cleanups
4         https://bugs.webkit.org/show_bug.cgi?id=189699
5         <rdar://problem/44634143>
6
7         Reviewed by Xabier Rodriguez-Calvar.
8
9         The GstMappedBuffer now has a move constructor so that it can be easily
10         reused in the webaudiosrc element. The now-unused corresponding
11         buffer-mapping utilities are removed from the code-base.
12
13         The HTTP source element used to handle a GstBuffer in its private
14         structure but this is no longer required since data is now pushed
15         in chunks, see bug #182829.
16
17         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
18         (webKitWebAudioSrcLoop):
19         * platform/graphics/gstreamer/GStreamerCommon.cpp:
20         (WebCore::createGstBuffer): Deleted.
21         (WebCore::createGstBufferForData): Deleted.
22         (WebCore::getGstBufferDataPointer): Deleted.
23         (WebCore::mapGstBuffer): Deleted.
24         (WebCore::unmapGstBuffer): Deleted.
25         * platform/graphics/gstreamer/GStreamerCommon.h:
26         (WebCore::GstMappedBuffer::create): New method returning a
27         reference to a newly created GstMappedBuffer instance.
28         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
29         (webKitWebSrcStop): Remove reference to unused GstBuffer.
30         (CachedResourceStreamingClient::dataReceived): Ditto.
31
32 2018-09-24  Enrique Ocaña González  <eocanha@igalia.com>
33
34         [MSE][GStreamer] Don't update duration when it was not previously NaN
35         https://bugs.webkit.org/show_bug.cgi?id=189869
36
37         Reviewed by Xabier Rodriguez-Calvar.
38
39         This is what the spec mandates. The spec doesn't say anything about
40         updating duration when it had been previously set, even if the new
41         init segment says that the duration is growing.
42
43         This fixes MSE YTTV 2018 69.MediaSourceDurationVP9.
44
45         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
46         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
47
48 2018-09-23  Frederic Wang  <fwang@igalia.com>
49
50         Add missing includes in TextCodecReplacement.cpp
51         https://bugs.webkit.org/show_bug.cgi?id=189894
52
53         Reviewed by Darin Adler.
54
55         No new tests, behavior unchanged.
56
57         * platform/text/TextCodecReplacement.cpp: Add missing headers.
58
59 2018-09-22  Adrian Perez de Castro  <aperez@igalia.com>
60
61         [ARM] Building FELightingNEON.cpp fails due to missing lightVector member
62         https://bugs.webkit.org/show_bug.cgi?id=189890
63
64         Reviewed by Darin Adler.
65
66         No new tests needed.
67
68         * platform/graphics/cpu/arm/filters/FELightingNEON.h:
69         (WebCore::FELighting::platformApplyNeon): Adapt to new layout of "struct PaintingData" after r225122.
70
71 2018-09-22  Zan Dobersek  <zdobersek@igalia.com>
72
73         [Cairo] Null-check cairo_pattern_t gradient objects
74         https://bugs.webkit.org/show_bug.cgi?id=189820
75
76         Reviewed by Alex Christensen.
77
78         Cairo-specific implementation of Gradient::createPlatformGradient() can
79         now return a nullptr value when a conic gradient is described by the
80         Gradient object. Cairo doesn't have a way to create cairo_pattern_t
81         objects for such gradients.
82
83         Null-checks are now done on return values of createPlatformGradient(),
84         in order to avoid proceeding to paint a null cairo_pattern_t object.
85
86         * platform/graphics/cairo/GradientCairo.cpp:
87         (WebCore::Gradient::fill):
88         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
89         (WebCore::GraphicsContextImplCairo::fillRect):
90
91 2018-09-21  Ryosuke Niwa  <rniwa@webkit.org>
92
93         Cannot start a drag inside a shadow tree when an inclusive-ancestor of its shadow host is a draggable element
94         https://bugs.webkit.org/show_bug.cgi?id=136836
95
96         Reviewed by Wenson Hsieh.
97
98         Fixed the bug by simply generalizing the existing code path existed for video / input type=color.
99
100         Tests: fast/shadow-dom/dragging-element-inside-shadow-tree.html
101                fast/shadow-dom/dragging-element-with-shadow-tree.html
102
103         * page/DragController.cpp:
104         (WebCore::DragController::startDrag):
105
106 2018-09-22  Chris Dumez  <cdumez@apple.com>
107
108         FontDataCache should use Ref<Font> instead of a RefPtr<Font>
109         https://bugs.webkit.org/show_bug.cgi?id=189861
110
111         Reviewed by Antti Koivisto.
112
113         * platform/graphics/FontCache.cpp:
114         (WebCore::FontCache::fontForPlatformData):
115         (WebCore::FontCache::purgeInactiveFontData):
116
117 2018-09-21  Justin Michaud  <justin_michaud@apple.com>
118
119         Implement initialValue support for CSS Custom Properties and Values API
120         https://bugs.webkit.org/show_bug.cgi?id=189819
121
122         Reviewed by Simon Fraser.
123
124         * css/CSSComputedStyleDeclaration.cpp:
125         (WebCore::ComputedStyleExtractor::customPropertyValue):
126         * css/CSSCustomPropertyValue.cpp:
127         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
128         * css/CSSCustomPropertyValue.h:
129         * css/CSSRegisteredCustomProperty.h:
130         * css/CSSVariableData.cpp:
131         (WebCore::CSSVariableData::resolveVariableFallback const):
132         (WebCore::CSSVariableData::resolveVariableReference const):
133         (WebCore::CSSVariableData::resolveVariableReferences const):
134         (WebCore::CSSVariableData::resolveTokenRange const):
135         * css/CSSVariableData.h:
136         * css/DOMCSSRegisterCustomProperty.cpp:
137         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
138         * css/DOMCSSRegisterCustomProperty.h:
139         * css/DOMCSSRegisterCustomProperty.idl:
140         * css/StyleResolver.cpp:
141         (WebCore::StyleResolver::resolvedVariableValue):
142         (WebCore::StyleResolver::applyCascadedProperties):
143         * css/parser/CSSParser.cpp:
144         (WebCore::CSSParser::parseValueWithVariableReferences):
145         * css/parser/CSSParser.h:
146         * dom/Document.h:
147         (WebCore::Document::getCSSRegisteredCustomPropertySet const):
148         * rendering/style/RenderStyle.cpp:
149         (WebCore::RenderStyle::checkVariablesInCustomProperties):
150         * rendering/style/RenderStyle.h:
151
152 2018-09-21  Dean Jackson  <dino@apple.com>
153
154         Add PointerEvent, plus feature flag, plus Web Platform Tests
155         https://bugs.webkit.org/show_bug.cgi?id=189867
156         <rdar://problem/44697384>
157
158         Reviewed by Simon Fraser.
159
160         Add the PointerEvent interface.
161
162         Tests: imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html
163                imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html
164                imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html
165                imported/w3c/web-platform-tests/pointerevents/idlharness.window.html
166                imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html
167                imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
168                imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html
169                imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html
170
171         * DerivedSources.make:
172         * Sources.txt:
173         * WebCore.xcodeproj/project.pbxproj:
174                 Add the new files.
175
176         * dom/Event.h:
177         (WebCore::Event::isPointerEvent const): New virtual identification method.
178
179         * dom/EventNames.in: Add PointerEvent so the InterfaceType code is generated.
180
181         * dom/PointerEvent.cpp: The PointerEvent interface, as specified by W3C.
182         (WebCore::PointerEvent::PointerEvent):
183         (WebCore::PointerEvent::eventInterface const):
184         * dom/PointerEvent.h: Added.
185         * dom/PointerEvent.idl: Added.
186
187         * page/RuntimeEnabledFeatures.h: Clean up the ordering of the features, so there aren't
188         confusing blank lines interspersed with #if USE macros.
189         (WebCore::RuntimeEnabledFeatures::setPointerEventsEnabled): Add a new flag for Pointer Events.
190         (WebCore::RuntimeEnabledFeatures::pointerEventsEnabled const):
191
192 2018-09-21  Ryosuke Niwa  <rniwa@webkit.org>
193
194         Custom elements in a reaction queue can lose its JS wrapper and become HTMLUnknownElement
195         https://bugs.webkit.org/show_bug.cgi?id=184307
196
197         Reviewed by Keith Miller.
198
199         The bug was caused by the custom elements reaction queue not reporting its content to GC during marking.
200
201         When there is no JS reference to the JS wrappers of those custom element, and if those custom elements
202         are disconnected, GC would happily collect those the wrappers. Unfortunately, the same bug exists for
203         any asynchronous events and other WebCore code which keeps elements alive for a later use but doesn't
204         report them to GC (e.g. during visitChildren).
205
206         This patch, therefore, introduces a generic mechanism to keep these elements' wrappers alive. Namely,
207         we introduce GCReachableRef, a new smart pointer type for Node's subclasses, which keeps element as well
208         as its wrappers alive. GCReachableRef works by adding its Node to a global hash counted set when it's
209         created and making JSNodeOwner::isReachableFromOpaqueRoots return true when the node is in the set.
210
211         Test: fast/custom-elements/custom-elements-reaction-queue-retains-js-wrapper.html
212
213         * Sources.txt:
214         * WebCore.xcodeproj/project.pbxproj:
215         * bindings/js/JSNodeCustom.cpp:
216         (WebCore::isReachableFromDOM):
217         * dom/CustomElementReactionQueue.cpp:
218         (WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): Don't swap the vector of elements in
219         in the queue. Assuming each DOM API has an appropriate CustomElementsReactionStack, we should never
220         append a new element to this queue while invoking custom element reactions.
221         * dom/CustomElementReactionQueue.h:
222         * dom/GCReachableRef.cpp: Added.
223         * dom/GCReachableRef.h: Added.
224         (WebCore::GCReachableRefMap::contains): Added.
225         (WebCore::GCReachableRefMap::add): Added.
226         (WebCore::GCReachableRefMap::remove): Added.
227         (WebCore::GCReachableRef::GCReachableRef): Added. We need isNull() check since WTFMove may have been
228         called on the source GCReachableRef.
229         (WebCore::GCReachableRef::~GCReachableRef): Ditto.
230         (WebCore::GCReachableRef::operator-> const): Added.
231         (WebCore::GCReachableRef::get const): Added.
232         (WebCore::GCReachableRef::operator T& const): Added.
233         (WebCore::GCReachableRef::operator! const): Added.
234         (WebCore::GCReachableRef::isNull const): Added. Returns true if WTFMove had been called on Ref.
235
236 2018-09-21  Alex Christensen  <achristensen@webkit.org>
237
238         Use a Variant for FormDataElement
239         https://bugs.webkit.org/show_bug.cgi?id=189777
240
241         Reviewed by Chris Dumez.
242
243         * platform/network/FormData.cpp:
244         (WebCore::FormData::FormData):
245         (WebCore::FormDataElement::lengthInBytes const):
246         (WebCore::FormDataElement::isolatedCopy const):
247         (WebCore::FormData::appendData):
248         (WebCore::FormData::flatten const):
249         (WebCore::FormData::resolveBlobReferences):
250         (WebCore::FormData::generateFiles):
251         (WebCore::FormData::hasGeneratedFiles const):
252         (WebCore::FormData::hasOwnedGeneratedFiles const):
253         (WebCore::FormData::removeGeneratedFilesIfNeeded):
254         (WebCore::FormData::asSharedBuffer const):
255         (WebCore::FormData::asBlobURL const):
256         (WebCore::FormData::expandDataStore): Deleted.
257         * platform/network/FormData.h:
258         (WebCore::FormDataElement::FormDataElement):
259         (WebCore::FormDataElement::encode const):
260         (WebCore::FormDataElement::decode):
261         (WebCore::FormDataElement::EncodedFileData::isolatedCopy const):
262         (WebCore::FormDataElement::EncodedFileData::operator== const):
263         (WebCore::FormDataElement::EncodedFileData::encode const):
264         (WebCore::FormDataElement::EncodedFileData::decode):
265         (WebCore::FormDataElement::EncodedBlobData::operator== const):
266         (WebCore::FormDataElement::EncodedBlobData::encode const):
267         (WebCore::FormDataElement::EncodedBlobData::decode):
268         (WebCore::FormDataElement::operator== const):
269         (WebCore::FormDataElement::operator!= const):
270         * platform/network/cf/FormDataStreamCFNet.cpp:
271         (WebCore::advanceCurrentStream):
272         (WebCore::createHTTPBodyCFReadStream):
273         (WebCore::setHTTPBody):
274         * platform/network/curl/CurlFormDataStream.cpp:
275         (WebCore::CurlFormDataStream::computeContentLength):
276         (WebCore::CurlFormDataStream::read):
277         (WebCore::CurlFormDataStream::readFromFile):
278         (WebCore::CurlFormDataStream::readFromData):
279         * platform/network/curl/CurlFormDataStream.h:
280
281 2018-09-20  Simon Fraser  <simon.fraser@apple.com>
282
283         Simplify the logic around has*ScrollbarWithAutoBehavior
284         https://bugs.webkit.org/show_bug.cgi?id=189813
285
286         Reviewed by Zalan Bujtas.
287
288         The boolean logic in scrollsOverflowX() and hasHorizontalScrollbarWithAutoBehavior() (and the vertical
289         equivalents) reduces simply to hasOverflowClip() && (style().overflowX() == Overflow::Scroll || style().overflowX() == Overflow::Auto);
290         
291         Similarly, RenderBox::intrinsicScrollbarLogicalWidth() just needs the part of the logic
292         that asks whether the theme uses overlay scrollbars which are not customized (and thus
293         turned into non-overlay scrollbars).
294
295         * rendering/RenderBox.cpp:
296         (WebCore::RenderBox::intrinsicScrollbarLogicalWidth const):
297         (WebCore::RenderBox::canUseOverlayScrollbars const):
298         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
299         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
300         * rendering/RenderBox.h:
301         (WebCore::RenderBox::scrollsOverflowX const):
302         (WebCore::RenderBox::scrollsOverflowY const):
303         * rendering/RenderLayer.cpp:
304         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
305
306 2018-09-21  Michael Catanzaro  <mcatanzaro@igalia.com>
307
308         Unreviewed, rolling out r236255.
309
310         Many WebAudio crashes
311
312         Reverted changeset:
313
314         "[GStreamer] Utilities cleanups"
315         https://bugs.webkit.org/show_bug.cgi?id=189699
316         https://trac.webkit.org/changeset/236255
317
318 2018-09-21  Jer Noble  <jer.noble@apple.com>
319
320         Move AVVideoPerformanceMetrics into AVFoundationSPI.h
321         https://bugs.webkit.org/show_bug.cgi?id=189842
322
323         Reviewed by Jon Lee.
324
325         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
326
327 2018-09-21  Chris Dumez  <cdumez@apple.com>
328
329         WebSQL: User cannot grant quota increase if the JS provides an expected usage value that is too low
330         https://bugs.webkit.org/show_bug.cgi?id=189801
331         <rdar://problem/43592498>
332
333         Reviewed by Youenn Fablet.
334
335         User was unable to grant a quota increase for WebSQL if the JS provided an expected usage value that
336         is too low. This is because WebKit was passing this provided expectedUsage value to the client for
337         the purpose of quota increase, even when this expectedUsage value does not make any sense (i.e. it
338         is lower than the current database size). As a result, the client would grant a quota that is equal
339         to the previous quota and the JS would not be able to insert any data.
340
341         In order to address the issue, when the current quota is exceeded and Database::didExceedQuota()
342         is called, we now make sure that the expectedUsage value is greater than the current quota. If it
343         is not, we provide `current quota + 5MB` as expected usage to the client. This way, the client will
344         grant a quota that is actually increased (provided that the user accepts).
345
346         Test: storage/websql/transaction-database-expand-quota.html
347
348         * Modules/webdatabase/Database.cpp:
349         (WebCore::Database::setEstimatedSize):
350         (WebCore::Database::didExceedQuota):
351         * Modules/webdatabase/Database.h:
352
353 2018-09-21  Youenn Fablet  <youenn@apple.com>
354
355         Use biplanar CVPixelBuffer for black frames sent to libwebrtc
356         https://bugs.webkit.org/show_bug.cgi?id=189837
357
358         Reviewed by Eric Carlson.
359
360         Covered by webrtc/video-mute.html.
361
362         Add support to call CVPixelBufferGetBytesPerRowOfPlane.
363         Make createBlackPixelBuffer use a biplanar CVPixelBuffer as this is better supported in libwebrtc.
364         It is also what is being used in iOS for capture.
365
366         * platform/cocoa/CoreVideoSoftLink.cpp:
367         * platform/cocoa/CoreVideoSoftLink.h:
368         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
369         (WebCore::createBlackPixelBuffer):
370
371 2018-09-21  Youenn Fablet  <youenn@apple.com>
372
373         Add RTCCodecStats support
374         https://bugs.webkit.org/show_bug.cgi?id=189792
375         <rdar://problem/32370668>
376
377         Reviewed by Eric Carlson.
378
379         Covered by updated and rebased tests.
380
381         * Modules/mediastream/RTCStatsReport.h:
382         Removed fields that are already defined in the base class.
383         (WebCore::RTCStatsReport::CodecStats::CodecStats):
384         Add support for RTCCodecStats.
385         * Modules/mediastream/RTCStatsReport.idl:
386         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
387         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
388         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
389         (WebCore::fillRTCRTPStreamStats):
390         (WebCore::fillRTCCodecStats):
391         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
392         Add routines to fill RTCCodecStats from libwebrtc stats.
393
394 2018-09-20  Simon Fraser  <simon.fraser@apple.com>
395
396         Make "overflow: overlay" a synonym for "overflow: auto"
397         https://bugs.webkit.org/show_bug.cgi?id=189811
398
399         Reviewed by Zalan Bujtas.
400         
401         The "overlay" value for overflow was added for an internal Safari feature, and only has
402         an effect (allow the scrollbar to overlap the content) with legacy scrollbars on macOS.
403         It's little used on the web.
404
405         To simplify code in rendering, just make "overflow: overlay" behave like "overflow: auto".
406         It's still parsed, but turns into an "auto" value internally, and will be returned from getComputedStyle
407         as "auto".
408
409         Test: fast/css/getComputedStyle/getComputedStyle-overflow.html
410
411         * css/CSSPrimitiveValueMappings.h:
412         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
413         (WebCore::CSSPrimitiveValue::operator Overflow const):
414         * css/CSSProperties.json:
415         * css/CSSValueKeywords.in:
416         * css/StyleResolver.cpp:
417         (WebCore::isScrollableOverflow):
418         * css/parser/CSSParserFastPaths.cpp:
419         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
420         * page/ios/FrameIOS.mm:
421         (WebCore::Frame::nodeRespondingToScrollWheelEvents):
422         * rendering/RenderBox.cpp:
423         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
424         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
425         * rendering/RenderLayer.cpp:
426         (WebCore::styleDefinesAutomaticScrollbar):
427         * rendering/RenderLayerCompositor.cpp:
428         (WebCore::isScrollableOverflow):
429         * rendering/style/RenderStyleConstants.h:
430
431 2018-09-21  Youenn Fablet  <youenn@apple.com>
432
433         Centralize which CVPixelBuffer format is being used
434         https://bugs.webkit.org/show_bug.cgi?id=189772
435
436         Reviewed by Eric Carlson.
437
438         Get the format type from a single point.
439         This changes the video capture and mock realtime video sources on Mac to use a biplanar format. 
440         No observable change of behavior.
441
442         * WebCore.xcodeproj/project.pbxproj:
443         * platform/mediastream/mac/AVVideoCaptureSource.mm:
444         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
445         (WebCore::AVVideoCaptureSource::setupCaptureSession):
446         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
447         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
448         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
449         (WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset):
450         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
451         (WebCore::createBlackPixelBuffer):
452         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
453         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
454         * platform/mediastream/mac/RealtimeVideoUtilities.h: Added.
455
456 2018-09-21  Antoine Quint  <graouts@apple.com>
457
458         REGRESSION (r235962-r235963): Layout Test animations/suspend-resume-animation-events.html is a flaky failure
459         https://bugs.webkit.org/show_bug.cgi?id=189607
460         <rdar://problem/44652315>
461
462         Reviewed by Dean Jackson.
463
464         There is no reason we shouldn't return the document timeline's time when suspended as otherwise animations may
465         report an unresolved current time when suspended which would wreak havoc when invalidating what DOM events to
466         dispatch for CSS Animations and Transitions. We also shouldn't be invalidation DOM events when suspended.
467
468         * animation/DocumentTimeline.cpp:
469         (WebCore::DocumentTimeline::currentTime):
470         (WebCore::DocumentTimeline::DocumentTimeline::performInvalidationTask):
471
472 2018-09-21  Mike Gorse  <mgorse@suse.com>
473
474         Build tools should work when the /usr/bin/python is python3
475         https://bugs.webkit.org/show_bug.cgi?id=156674
476
477         Reviewed by Michael Catanzaro.
478
479         No new tests (no behavior change).
480
481         * platform/network/create-http-header-name-table: remove xreadlines.
482
483 2018-09-21  Jer Noble  <jer.noble@apple.com>
484
485         [EME] Introduce the concept of CDMInstanceSession.
486         https://bugs.webkit.org/show_bug.cgi?id=189725
487
488         Reviewed by Eric Carlson.
489
490         Currently, the same CDMInstance owned by a MediaKeys object is passed to every MediaKeySession created by that
491         MediaKeys, and since the CDMInstance has only a single CDMInstanceClient, subsequent MediaKeySessions prevent
492         previous ones from getting updates.
493
494         Add a new virtual interface, CDMInstanceSession, to be passed to MediaKeySession upon creation. Refactor
495         CDMInstanceClearKey and CDMInstanceFairPlayStreamingAVFObjC to adopt this new interface.
496
497         Drive-by fixes: Made a number of virtual overrides in final classes final themselves.
498
499         * Modules/encryptedmedia/MediaKeySession.cpp:
500         (WebCore::MediaKeySession::create):
501         (WebCore::MediaKeySession::MediaKeySession):
502         (WebCore::MediaKeySession::generateRequest):
503         (WebCore::MediaKeySession::load):
504         (WebCore::MediaKeySession::update):
505         (WebCore::MediaKeySession::remove):
506         (WebCore::MediaKeySession::updateKeyStatuses):
507         * Modules/encryptedmedia/MediaKeySession.h:
508         * Modules/encryptedmedia/MediaKeys.cpp:
509         (WebCore::MediaKeys::createSession):
510         * WebCore.xcodeproj/project.pbxproj:
511         * platform/encryptedmedia/CDMInstance.h:
512         (WebCore::CDMInstance::setHDCPStatus):
513         (WebCore::CDMInstance::setClient): Deleted.
514         (WebCore::CDMInstance::clearClient): Deleted.
515         * platform/encryptedmedia/CDMInstanceSession.h: Copied from Source/WebCore/platform/encryptedmedia/CDMInstance.h.
516         (WebCore::CDMInstanceSession::setClient):
517         (WebCore::CDMInstanceSession::clearClient):
518         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
519         (WebCore::parseLicenseFormat):
520         (WebCore::CDMInstanceClearKey::keySystem const):
521         (WebCore::CDMInstanceClearKey::createSession):
522         (WebCore::CDMInstanceSessionClearKey::requestLicense):
523         (WebCore::CDMInstanceSessionClearKey::keys const):
524         (WebCore::CDMInstanceSessionClearKey::updateLicense):
525         (WebCore::CDMInstanceSessionClearKey::loadSession):
526         (WebCore::CDMInstanceSessionClearKey::closeSession):
527         (WebCore::CDMInstanceSessionClearKey::removeSessionData):
528         (WebCore::CDMInstanceSessionClearKey::storeRecordOfKeyUsage):
529         (WebCore::CDMInstanceClearKey::requestLicense): Deleted.
530         (WebCore::CDMInstanceClearKey::keys const): Deleted.
531         (WebCore::CDMInstanceClearKey::updateLicense): Deleted.
532         (WebCore::CDMInstanceClearKey::loadSession): Deleted.
533         (WebCore::CDMInstanceClearKey::closeSession): Deleted.
534         (WebCore::CDMInstanceClearKey::removeSessionData): Deleted.
535         (WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage): Deleted.
536         * platform/encryptedmedia/clearkey/CDMClearKey.h:
537         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
538         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
539         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
540         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::processContentKeyRequestForSession):
541         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::processNextContentKeyRequest):
542         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keySystem const):
543         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
544         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRenewingRequest):
545         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvidePersistableRequest):
546         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
547         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
548         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::shouldRetryRequestForReason):
549         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged):
550         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
551         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
552         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
553         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
554         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
555         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
556         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
557         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
558         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::storeRecordOfKeyUsage):
559         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::setClient):
560         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::clearClient):
561         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
562         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
563         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvidePersistableRequest):
564         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
565         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
566         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::shouldRetryRequestForReason):
567         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::sessionIdentifierChanged):
568         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
569         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::isLicenseTypeSupported const):
570         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::isLicenseTypeSupported const): Deleted.
571         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Deleted.
572         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense): Deleted.
573         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense): Deleted.
574         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::loadSession): Deleted.
575         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::closeSession): Deleted.
576         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::removeSessionData): Deleted.
577         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::storeRecordOfKeyUsage): Deleted.
578         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient): Deleted.
579         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient): Deleted.
580         * testing/MockCDMFactory.cpp:
581         (WebCore::MockCDMInstance::keySystem const):
582         (WebCore::MockCDMInstance::createSession):
583         (WebCore::MockCDMInstanceSession::MockCDMInstanceSession):
584         (WebCore::MockCDMInstanceSession::requestLicense):
585         (WebCore::MockCDMInstanceSession::updateLicense):
586         (WebCore::MockCDMInstanceSession::loadSession):
587         (WebCore::MockCDMInstanceSession::closeSession):
588         (WebCore::MockCDMInstanceSession::removeSessionData):
589         (WebCore::MockCDMInstanceSession::storeRecordOfKeyUsage):
590         (WebCore::MockCDMInstance::requestLicense): Deleted.
591         (WebCore::MockCDMInstance::updateLicense): Deleted.
592         (WebCore::MockCDMInstance::loadSession): Deleted.
593         (WebCore::MockCDMInstance::closeSession): Deleted.
594         (WebCore::MockCDMInstance::removeSessionData): Deleted.
595         (WebCore::MockCDMInstance::storeRecordOfKeyUsage): Deleted.
596         * testing/MockCDMFactory.h:
597         (WebCore::MockCDMInstance::factory const):
598         (WebCore::MockCDMInstance::distinctiveIdentifiersAllowed const):
599         (WebCore::MockCDMInstance::persistentStateAllowed const):
600
601 2018-09-21  Alicia Boya García  <aboya@igalia.com>
602
603         [MSE] Fix comparsion with uninitialized greatestDecodeDuration
604         https://bugs.webkit.org/show_bug.cgi?id=189805
605
606         Reviewed by Michael Catanzaro.
607
608         This bug was causing greatestDecodeDuration to never be initialized,
609         which in turned caused unintended frame erase as distant appends where
610         not being recognized as distinct coded frame groups.
611
612         A test reproducing the sequence of appends that caused unintended
613         frame deletion has also been added (media-source-append-out-of-order.html).
614
615         * Modules/mediasource/SourceBuffer.cpp:
616         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
617
618 2018-09-21  Antoine Quint  <graouts@apple.com>
619
620         [Web Animations] Accelerated animations don't get suspended
621         https://bugs.webkit.org/show_bug.cgi?id=189783
622         <rdar://problem/44652315>
623
624         Unreviewed, correct a merge error in the previous commit.
625
626         * animation/DocumentTimeline.cpp:
627         (WebCore::DocumentTimeline::performInvalidationTask):
628
629 2018-09-21  Antoine Quint  <graouts@apple.com>
630
631         [Web Animations] Accelerated animations don't get suspended
632         https://bugs.webkit.org/show_bug.cgi?id=189783
633         <rdar://problem/43033568>
634
635         Reviewed by Dean Jackson.
636
637         Test: webanimations/accelerated-animation-suspension.html
638
639         We used to set the flag that marked the timeline as suspended prior to notifying animations that they need to be suspended.
640         However, since the timeline was marked as suspended, querying the running state of the animations would indicate that the
641         animations weren't running since a suspended timeline would identify its animations as not running. As such we would fail
642         to pause the accelerated animations because they were already not marked as running. We now set the suspended flag on the
643         timeline _after_ suspending its animations.
644
645         We also fix a bug in the new internals.acceleratedAnimationsForElement() test function so that we read from the actual
646         CA animations and not from a stale list of animations which would not indicate the correct animation speeds.
647
648         * animation/DocumentTimeline.cpp:
649         (WebCore::DocumentTimeline::suspendAnimations):
650         * platform/graphics/ca/GraphicsLayerCA.cpp:
651         (WebCore::GraphicsLayerCA::acceleratedAnimationsForTesting):
652
653 2018-09-21  Zan Dobersek  <zdobersek@igalia.com>
654
655         TransformationMatrix::toColumnMajorFloatArray() should return a std::array<> object
656         https://bugs.webkit.org/show_bug.cgi?id=189823
657
658         Reviewed by Michael Catanzaro.
659
660         Alias the TransformationMatrix::FloatMatrix4 type to
661         std::array<float, 16>. Instead of filling out the array object that's
662         passed in through a reference parameter, return the std::array<>
663         object from the function.
664
665         * Modules/webvr/VRFrameData.cpp:
666         (WebCore::matrixToArray):
667         * Modules/webvr/VRStageParameters.cpp:
668         (WebCore::VRStageParameters::sittingToStandingTransform const):
669         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
670         (WebCore::TextureMapperShaderProgram::setMatrix):
671         * platform/graphics/transforms/TransformationMatrix.cpp:
672         (WebCore::TransformationMatrix::toColumnMajorFloatArray const):
673         * platform/graphics/transforms/TransformationMatrix.h:
674
675 2018-09-21  Zan Dobersek  <zdobersek@igalia.com>
676
677         FloatQuad point getters should return const references
678         https://bugs.webkit.org/show_bug.cgi?id=189821
679
680         Reviewed by Yusuke Suzuki.
681
682         Be pedantic and have the FloatQuad point getters return const references
683         to the FloatPoint member variables, instead of technically creating
684         copies of them (though much of this copying is eliminated when the
685         getters are inlined).
686
687         * platform/graphics/FloatQuad.h:
688         (WebCore::FloatQuad::p1 const):
689         (WebCore::FloatQuad::p2 const):
690         (WebCore::FloatQuad::p3 const):
691         (WebCore::FloatQuad::p4 const):
692
693 2018-09-20  Antoine Quint  <graouts@apple.com>
694
695         [Web Animations] DocumentTimeline::updateAnimations() is called endlessly
696         https://bugs.webkit.org/show_bug.cgi?id=189784
697         <rdar://problem/41705679>
698
699         Reviewed by Dean Jackson.
700
701         Test: webanimations/accelerated-animation-interruption-display-none.html
702
703         We have code that keeps queueing pending accelerated actions for an animation that does not have a renderer until it has one
704         so that we can deal with situations where animations are ready to commited before its composited renderer is available. This
705         code ended up running continuously when an element with an accelerated animation had its renderer removed without the animation
706         being removed itself, such as setting "display: none" on an element with an acceelerated CSS Animation targeting it.
707
708         We fix this by queueing up a "Stop" accelerated action when updating the accelerated state if there is no renderer for the current
709         animation target. Then, we no longer re-queue pending accelerated actions if the last queued operation is "Stop". This ensures that
710         we no longer queue actions endlessly when there is no longer a visible animation.
711
712         To test this, we add a new internals.numberOfAnimationTimelineInvalidations() method that indicates the number of times the current
713         document's animation timeline was invalidated.
714
715         * animation/DocumentTimeline.cpp:
716         (WebCore::DocumentTimeline::updateAnimations):
717         (WebCore::DocumentTimeline::numberOfAnimationTimelineInvalidationsForTesting const):
718         * animation/DocumentTimeline.h:
719         * animation/KeyframeEffectReadOnly.cpp:
720         (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): If the animation target does not have a renderer and it's still
721         marked as running, enqueue a "Stop" accelerated action.
722         (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): If we enqueue a "Stop" accelerated action, remove any other queued
723         action so that we only process the "Stop" action, which would have superseded all previously queued actions anyway.
724         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Only re-queue pending accelerated actions when a composited renderer
725         is not yet available if we don't have a "Stop" action queued.
726         * testing/Internals.cpp:
727         (WebCore::Internals::numberOfAnimationTimelineInvalidations const):
728         * testing/Internals.h:
729         * testing/Internals.idl:
730
731 2018-09-21  Yacine Bandou  <yacine.bandou@softathome.com>
732
733         [EME] Fix typo in WebM sanitization variable
734         https://bugs.webkit.org/show_bug.cgi?id=189789
735
736         Reviewed by Xabier Rodriguez-Calvar.
737
738         This commit corrects a typo in the name of a local variable, sanitizedBuffer
739         instead of sanitazedBuffer.
740
741         * Modules/encryptedmedia/InitDataRegistry.cpp:
742         (WebCore::extractKeyIDsWebM):
743
744 2018-09-20  Dean Jackson  <dino@apple.com>
745
746         Restrict the total combined size of backdrop filters
747         https://bugs.webkit.org/show_bug.cgi?id=189812
748         <rdar://problem/44532782>
749
750         Reviewed by Simon Fraser.
751
752         If the total area of all backdrop filters on the page gets
753         too large, the universe collapses in on itself and we enter
754         the Quantum Realm (i.e. crash horribly).
755
756         Put a hard limit on the total coverage, and ignore any backdrop
757         filters after the limit. This might break some content, but
758         such content is likely not doing things in the most optimal manner.
759         There isn't any reason to have a backdrop larger than the size of
760         the screen, because you'd be better off applying a foreground
761         filter to the main content and showing something above it.
762
763         Tests: css3/filters/backdrop/resource-use-add-more-layers.html
764                css3/filters/backdrop/resource-use-excessive.html
765                css3/filters/backdrop/resource-use-ok.html
766                css3/filters/backdrop/resource-use-remove-some-layers.html
767
768         * platform/graphics/ca/GraphicsLayerCA.cpp: Pick a fairly small maximum size. We
769         can consider increasing this if necessary, and as devices with less RAM are
770         upgraded.
771         (WebCore::GraphicsLayerCA::recursiveCommitChanges): Gather the accumulated size
772         of backdrop filters into the commit state as we are recursing through the tree.
773         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Force any layer
774         with backdrop filters, or any that is removing backdrop filters, into an update.
775         (WebCore::GraphicsLayerCA::updateBackdropFilters): Update the logic to first
776         check if this backdrop layer causes us to exceed the total allowed size, and if
777         it does, forbid it from getting the GraphicsLayer that composits the backdrop.
778
779         * platform/graphics/ca/GraphicsLayerCA.h: Remove const from some parameters so
780         that we can use the CommitState to hold the accumulated size.
781
782 2018-09-20  Benjamin Poulain  <benjamin@webkit.org>
783
784         Adopt safe-area-insets on ImageDocument
785         https://bugs.webkit.org/show_bug.cgi?id=189774
786
787         Reviewed by Tim Horton.
788         rdar://problem/44624432
789
790         By having the safe-area insets on the image, we ensure that they only
791         grow the document if there is not enough space. This also ensures the image
792         does not have parts under UI elements.
793
794         * html/ImageDocument.cpp:
795         (WebCore::ImageDocument::createDocumentStructure):
796         (WebCore::ImageDocument::imageUpdated):
797
798 2018-09-20  Zalan Bujtas  <zalan@apple.com>
799
800         Release assert under RenderView::pageOrViewLogicalHeight
801         https://bugs.webkit.org/show_bug.cgi?id=189798
802         <rdar://problem/43659749>
803
804         Reviewed by Simon Fraser.
805
806         Only the mainframe's render view is sized to the page while printing.
807         Use the matching check (see RenderView::layout) when accessing m_pageLogicalSize.
808
809         Test: printing/crash-while-formatting-subframe-for-printing.html
810
811         * rendering/RenderView.cpp:
812         (WebCore::RenderView::pageOrViewLogicalHeight const):
813
814 2018-09-20  Sihui Liu  <sihui_liu@apple.com>
815
816         REGRESSION(r196265): WKWebView fires mouseover, mouseenter, and mouseleave events even when it's in a background window
817         https://bugs.webkit.org/show_bug.cgi?id=187545
818         <rdar://problem/42401575>
819
820         Reviewed by Ryosuke Niwa.
821
822         When the window is not active, we should only update the scrollbar for mouse events. GTK
823         apps have different expectation on this behavior.
824
825         Test: fast/events/inactive-window-no-mouse-event.html
826
827         * page/EventHandler.cpp:
828         (WebCore::EventHandler::handleMouseMoveEvent):
829         (WebCore::EventHandler::shouldSendMouseEventsToInactiveWindows const):
830         * page/EventHandler.h:
831
832 2018-09-20  Alex Christensen  <achristensen@webkit.org>
833
834         Unreviewed, rolling out r235976.
835
836         Broke ARM
837
838         Reverted changeset:
839
840         "Use a Variant instead of a union in CSSSelector"
841         https://bugs.webkit.org/show_bug.cgi?id=188559
842         https://trac.webkit.org/changeset/235976
843
844 2018-09-20  Oriol Brufau  <obrufau@igalia.com>
845
846         Fix 'border' serialization with both common and uncommon values
847         https://bugs.webkit.org/show_bug.cgi?id=189597
848
849         Reviewed by Simon Fraser.
850
851         Remove CommonValueMode enum and make borderPropertyValue always return null
852         when there are uncommon values (the previous ReturnNullOnUncommonValues mode).
853
854         Test: fast/css/getPropertyValue-border.html
855         Test: fast/dom/css-shorthand-common-value.html
856
857         * css/StyleProperties.cpp:
858         (WebCore::StyleProperties::getPropertyValue const):
859         (WebCore::StyleProperties::borderPropertyValue const):
860         (WebCore::StyleProperties::asText const):
861         * css/StyleProperties.h:
862
863 2018-09-20  Justin Michaud  <justin_michaud@apple.com>
864
865         Implement CSS Custom Properties and Values Skeleton
866         https://bugs.webkit.org/show_bug.cgi?id=189694
867
868         Reviewed by Simon Fraser.
869
870         Add feature flag, CSS.registerProperty binding and registered property set in Document.h
871         for the css custom properties and values api.
872
873         Test: css-properties-values-api/registerProperty.html
874
875         * CMakeLists.txt:
876         * DerivedSources.make:
877         * Sources.txt:
878         * WebCore.xcodeproj/project.pbxproj:
879         * css/CSSRegisteredCustomProperty.h: Added.
880         * css/DOMCSSCustomPropertyDescriptor.h: Added.
881         * css/DOMCSSCustomPropertyDescriptor.idl: Added.
882         * css/DOMCSSNamespace.h:
883         * css/DOMCSSRegisterCustomProperty.cpp: Added.
884         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
885         (WebCore::DOMCSSRegisterCustomProperty::from):
886         (WebCore::DOMCSSRegisterCustomProperty::supplementName):
887         * css/DOMCSSRegisterCustomProperty.h: Added.
888         * css/DOMCSSRegisterCustomProperty.idl: Added.
889         * css/parser/CSSParserContext.cpp:
890         * dom/Document.cpp:
891         (WebCore::Document::registerCSSProperty):
892         * dom/Document.h:
893         * features.json:
894         * page/RuntimeEnabledFeatures.h:
895         (WebCore::RuntimeEnabledFeatures::setCSSCustomPropertiesAndValuesEnabled):
896         (WebCore::RuntimeEnabledFeatures::cssCustomPropertiesAndValuesEnabled const):
897
898 2018-09-20  Justin Michaud  <justin_michaud@apple.com>
899
900         JS bindings generator should support EnabledAtRuntime for static methods
901         https://bugs.webkit.org/show_bug.cgi?id=189729
902
903         Reviewed by Chris Dumez.
904
905         Add support for EnabledAtRuntime to static methods in the JS bindings
906         code generator.
907
908         * bindings/scripts/CodeGeneratorJS.pm:
909         (GenerateRuntimeEnableConditionalStringForExposed):
910         (GenerateRuntimeEnableConditionalString):
911         (GetRuntimeEnabledStaticProperties):
912         (GenerateConstructorHelperMethods):
913         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
914         (WebCore::JSTestGlobalObjectConstructor::initializeProperties):
915         (WebCore::JSTestGlobalObject::finishCreation):
916         (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStaticBody):
917         (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStatic):
918         * bindings/scripts/test/JS/JSTestObj.cpp:
919         (WebCore::JSTestObjConstructor::initializeProperties):
920         (WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStaticGetter):
921         (WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStatic):
922         (WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStaticSetter):
923         (WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStatic):
924         (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStaticBody):
925         (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStatic):
926         * bindings/scripts/test/TestGlobalObject.idl:
927         * bindings/scripts/test/TestObj.idl:
928
929 2018-09-20  Per Arne Vollan  <pvollan@apple.com>
930
931         [WebVTT] Update the parser according to the new region syntax.
932         https://bugs.webkit.org/show_bug.cgi?id=189767
933
934         Reviewed by Eric Carlson.
935
936         The majority of the code added in this patch is adopted from the Chromium project, which has added
937         support for the new region syntax. The complete parser specification can be found at
938         https://w3c.github.io/webvtt/#file-parsing. One small difference in behavior is that the new parser
939         will not add regions with empty id.
940
941         No new tests, covered by existing tests.
942
943         * html/track/WebVTTParser.cpp:
944         (WebCore::WebVTTParser::getNewRegions):
945         (WebCore::WebVTTParser::parse):
946         (WebCore::WebVTTParser::collectRegionSettings):
947         (WebCore::WebVTTParser::collectWebVTTBlock):
948         (WebCore::WebVTTParser::checkAndRecoverCue):
949         (WebCore::WebVTTParser::checkAndCreateRegion):
950         (WebCore::WebVTTParser::checkAndStoreRegion):
951         (WebCore::WebVTTParser::collectMetadataHeader): Deleted.
952         (WebCore::WebVTTParser::createNewRegion): Deleted.
953         * html/track/WebVTTParser.h:
954
955 2018-09-20  Alicia Boya García  <aboya@igalia.com>
956
957         [GStreamer][MSE] Add a default sample duration
958         https://bugs.webkit.org/show_bug.cgi?id=189788
959
960         Some WebM files don't provide sample durations, so we need to provide
961         a safe default in order for them to be playable.
962
963         Reviewed by Michael Catanzaro.
964
965         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
966         (WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
967
968 2018-09-20  Alicia Boya García  <aboya@igalia.com>
969
970         [MSE] Use some tolerance when deciding whether a frame should be appended to the decode queue
971         https://bugs.webkit.org/show_bug.cgi?id=189782
972
973         Reviewed by Xabier Rodriguez-Calvar.
974
975         Ideally, container formats should use exact timestamps and frames
976         should not overlap. Unfortunately, there are lots of files out there
977         where this is not always the case.
978
979         This is particularly a problem in WebM, where timestamps are expressed
980         in a power of 10 timescale, which forces some rounding.
981
982         This patch makes SourceBuffer allow frames with a small overlaps
983         (<=1ms) as those usually found in WebM. 1 ms is chosen because it's
984         the default time scale of WebM files.
985
986         * Modules/mediasource/SourceBuffer.cpp:
987         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
988
989 2018-09-20  Yacine Bandou  <yacine.bandou@softathome.com>
990
991         [EME] Add WebM sanitization
992         https://bugs.webkit.org/show_bug.cgi?id=189740
993
994         Reviewed by Xabier Rodriguez-Calvar.
995
996         This patch adds support for sanitizing the WebM initialization data,
997         ensures there are no bogus values.
998         See https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest.
999
1000         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
1001
1002         * Modules/encryptedmedia/InitDataRegistry.cpp:
1003         (WebCore::sanitizeWebM): Added implementation, check if the initialization data doesn't empty and its size
1004         should be less than 64KB, return the buffer copy if it is ok, otherwise a nullptr.
1005         (WebCore::extractKeyIDsWebM): Added implementation.
1006
1007 2018-09-20  Philippe Normand  <pnormand@igalia.com>
1008
1009         [GStreamer] Utilities cleanups
1010         https://bugs.webkit.org/show_bug.cgi?id=189699
1011
1012         Reviewed by Xabier Rodriguez-Calvar.
1013
1014         The GstMappedBuffer now has a move constructor so that it can be easily
1015         reused in the webaudiosrc element. The now-unused corresponding
1016         buffer-mapping utilities are removed from the code-base.
1017
1018         The HTTP source element used to handle a GstBuffer in its private
1019         structure but this is no longer required since data is now pushed
1020         in chunks, see bug #182829.
1021
1022         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
1023         (webKitWebAudioSrcLoop):
1024         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1025         (WebCore::createGstBuffer): Deleted.
1026         (WebCore::createGstBufferForData): Deleted.
1027         (WebCore::getGstBufferDataPointer): Deleted.
1028         (WebCore::mapGstBuffer): Deleted.
1029         (WebCore::unmapGstBuffer): Deleted.
1030         * platform/graphics/gstreamer/GStreamerCommon.h:
1031         (WebCore::GstMappedBuffer::create): New method returning a
1032         reference to a newly created GstMappedBuffer instance.
1033         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1034         (webKitWebSrcStop): Remove reference to unused GstBuffer.
1035         (CachedResourceStreamingClient::dataReceived): Ditto.
1036
1037 2018-09-20  Simon Fraser  <simon.fraser@apple.com>
1038
1039         Fix crash under FontCache::purgeInactiveFontData() when a memory warning fires
1040         https://bugs.webkit.org/show_bug.cgi?id=189722
1041         rdar://problem/44182860
1042
1043         Reviewed by Myles C. Maxfield.
1044         
1045         Hashing of FontPlatformData for cachedFonts() is somewhat broken because CFEqual() on CTFont
1046         can return false when the fonts are actually the same, and have the same CFHash(). This 
1047         can result in multiple entries in cachedFonts() with the same Font.
1048         
1049         Then in FontCache::purgeInactiveFontData(), the loop that appends fonts to fontsToDelete
1050         gets the value by reference, and WTFMoves it into fontsToDelete. This nulls out all
1051         the entries sharing the same value, leaving null entries in the hash table.
1052         We later crash at font->hasOneRef() when using one of those null entries.
1053         
1054         Fix by making a copy of the RefPtr<Font> in the loop, so the WTFMove doesn't nuke
1055         the hash table entries. The entries will get removed at cachedFonts().remove() lower down.
1056
1057         * platform/graphics/FontCache.cpp:
1058         (WebCore::FontCache::purgeInactiveFontData):
1059
1060 2018-09-20  Antoine Quint  <graouts@apple.com>
1061
1062         [Web Animations] Provide a way to query accelerated animations for internal testing
1063         https://bugs.webkit.org/show_bug.cgi?id=189762
1064
1065         Reviewed by Dean Jackson.
1066
1067         Expose a new internals.acceleratedAnimationsForElement(element) method to allow layout tests to query the current list
1068         of accelerated animations for a given element. Currently only the animated property and animation speed are exposed, which
1069         will allow us to identify missing, running and paused accelerated animations.
1070
1071         * animation/DocumentTimeline.cpp:
1072         (WebCore::DocumentTimeline::acceleratedAnimationsForElement const):
1073         * animation/DocumentTimeline.h:
1074         * platform/graphics/GraphicsLayer.h:
1075         (WebCore::GraphicsLayer::acceleratedAnimationsForTesting const):
1076         * platform/graphics/ca/GraphicsLayerCA.cpp:
1077         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1078         * platform/graphics/ca/GraphicsLayerCA.h:
1079         * testing/Internals.cpp:
1080         (WebCore::Internals::acceleratedAnimationsForElement):
1081         * testing/Internals.h:
1082         * testing/Internals.idl:
1083
1084 2018-09-19  Ryosuke Niwa  <rniwa@webkit.org>
1085
1086         Improve node statistics for rare data
1087         https://bugs.webkit.org/show_bug.cgi?id=189775
1088
1089         Reviewed by Simon Fraser.
1090
1091         Report reasons we created NodeRareData and ElementRareData in node statistics.
1092
1093         Added NodeRareData::useTypes and ElementRareData::useTypes which returns OptionSet<NodeRareData::UseType>
1094         indicating which instance member of the rare data is currently in use.
1095
1096         * dom/Element.cpp:
1097         * dom/Element.h:
1098         * dom/ElementRareData.h:
1099         (WebCore::defaultMinimumSizeForResizing):
1100         (WebCore::ElementRareData::useTypes const):
1101         * dom/Node.cpp:
1102         (WebCore::stringForRareDataUseType):
1103         (WebCore::Node::dumpStatistics):
1104         * dom/NodeRareData.cpp:
1105         * dom/NodeRareData.h:
1106         (WebCore::NodeRareData::useTypes const):
1107
1108 2018-09-19  Ryosuke Niwa  <rniwa@webkit.org>
1109
1110         REGRESSION(r235917): 2% regression in Dromaeo CSS selector on MacBookPro11,4
1111         https://bugs.webkit.org/show_bug.cgi?id=189738
1112
1113         Reviewed by Yusuke Suzuki.
1114
1115         The regression was caused by the regundant walk to the parent element. Removed it to fix the regression.
1116
1117         * cssjit/SelectorCompiler.cpp:
1118         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
1119         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
1120
1121 2018-09-19  John Wilander  <wilander@apple.com>
1122
1123         Resource Load Statistics: Add optional cap on partitioned cache max age
1124         https://bugs.webkit.org/show_bug.cgi?id=189711
1125         <rdar://problem/39246837>
1126
1127         Reviewed by Antti Koivisto and Chris Dumez.
1128
1129         Test: http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource.html
1130
1131         * platform/network/NetworkStorageSession.h:
1132         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1133         (WebCore::NetworkStorageSession::maxAgeCacheCap):
1134             Checks if a max age cap is set and returns it if the request
1135             represents a prevalent resource.
1136         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
1137         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
1138             New functionality to receive a max age cap setting in the session.
1139
1140 2018-09-19  Youenn Fablet  <youenn@apple.com>
1141
1142         Layout Test webrtc/video-mute.html is flaky.
1143         https://bugs.webkit.org/show_bug.cgi?id=177501
1144
1145         Reviewed by Eric Carlson.
1146
1147         Covered by updated test expectation.
1148
1149         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1150         (WebCore::createBlackPixelBuffer): Make sure the whole buffer is properly initialized.
1151
1152 2018-09-19  David Kilzer  <ddkilzer@apple.com>
1153
1154         WebCoreNSURLSession leaks an NSString (_sessionDescription) in -dealloc
1155         <https://webkit.org/b/189742>
1156         <rdar://problem/44589774>
1157
1158         Reviewed by Joseph Pecoraro.
1159
1160         * platform/network/cocoa/WebCoreNSURLSession.h:
1161         (WebCoreNSURLSession._sessionDescription): Change type from
1162         NSString * to RetainPtr<NSString>.
1163         * platform/network/cocoa/WebCoreNSURLSession.mm: Remove
1164         @synthesized statement for sessionDescription so that custom
1165         methods can be implemented to handle RetainPtr<NSString>.
1166         (-[WebCoreNSURLSession sessionDescription]): Add.
1167         (-[WebCoreNSURLSession setSessionDescription:]): Add.
1168
1169 2018-09-19  Youenn Fablet  <youenn@apple.com>
1170
1171         Implement sender/receiver getStats
1172         https://bugs.webkit.org/show_bug.cgi?id=189707
1173
1174         Reviewed by Eric Carlson.
1175
1176         Add support for sender and receiver getStats.
1177         Also add support for peer connection selector parameter.
1178
1179         Add the plumbing of the selector to LibWebRTCMediaEndpoint.
1180         Then make use of libwebrtc overloaded methods to retrieve the right stats.
1181
1182         Covered by updated/rebased tests.
1183
1184         * Modules/mediastream/PeerConnectionBackend.h:
1185         * Modules/mediastream/RTCPeerConnection.cpp:
1186         (WebCore::RTCPeerConnection::getStats):
1187         * Modules/mediastream/RTCPeerConnection.h:
1188         * Modules/mediastream/RTCPeerConnection.idl:
1189         * Modules/mediastream/RTCRtpReceiver.cpp:
1190         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
1191         (WebCore::RTCRtpReceiver::getStats):
1192         * Modules/mediastream/RTCRtpReceiver.h:
1193         (WebCore::RTCRtpReceiver::create):
1194         (WebCore::RTCRtpReceiver::backend):
1195         * Modules/mediastream/RTCRtpReceiver.idl:
1196         * Modules/mediastream/RTCRtpSender.cpp:
1197         (WebCore::RTCRtpSender::create):
1198         (WebCore::RTCRtpSender::RTCRtpSender):
1199         (WebCore::RTCRtpSender::getStats):
1200         * Modules/mediastream/RTCRtpSender.h:
1201         * Modules/mediastream/RTCRtpSender.idl:
1202         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1203         (WebCore::LibWebRTCMediaEndpoint::getStats):
1204         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1205         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1206         (WebCore::LibWebRTCPeerConnectionBackend::getStats):
1207         (WebCore::backendFromRTPSender):
1208         (WebCore::createReceiverForSource):
1209         (WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
1210         (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
1211         (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
1212         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1213         (WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver):
1214         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
1215         (WebCore::LibWebRTCPeerConnectionBackend::newRemoteTransceiver):
1216         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1217         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
1218
1219 2018-09-19  Jer Noble  <jer.noble@apple.com>
1220
1221         REGRESSION (r236006): New waitingForKey() requirement breaks Modern EME tests.
1222         https://bugs.webkit.org/show_bug.cgi?id=189720
1223         <rdar://problem/44572140>
1224
1225         Reviewed by Xabier Rodriguez-Calvar.
1226
1227         Always call waitingForKey() after calling initializationDataEncountered().
1228
1229         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1230         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1231         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1232         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
1233
1234 2018-09-19  Philippe Normand <pnormand@igalia.com>
1235
1236         [GStreamer] Add support for AV1 decoding
1237         https://bugs.webkit.org/show_bug.cgi?id=189647
1238
1239         Tweaked by Xabier Rodriguez Calvar <calvaris@igalia.com>.
1240         Reviewed by Žan Doberšek.
1241
1242         AV1 can be muxed in MP4 and WebM containers. The test is an adaptation from Chromium's unittest:
1243         https://chromium.googlesource.com/chromium/src/+/master/content/browser/media/media_canplaytype_browsertest.cc
1244
1245         Test: media/media-can-play-av1.html
1246
1247         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1248         (WebCore::MediaPlayerPrivateGStreamer::supportsType): Add AV1
1249         support. The av01 codec has to be explicitely checked, along with
1250         the presence of a compatible AV1 decoder.
1251
1252 2018-09-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1253
1254         [Curl] Limit capturing extra metrics for Web Inspector when not required.
1255         https://bugs.webkit.org/show_bug.cgi?id=189520
1256
1257         Reviewed by Alex Christensen.
1258
1259         Respect the value of NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics() to reduce the process
1260         time when they are not needed.
1261
1262         No new tests because there's no behavior change.
1263
1264         * platform/network/curl/CurlContext.cpp:
1265         (WebCore::CurlHandle::getNetworkLoadMetrics):
1266         (WebCore::CurlHandle::addExtraNetworkLoadMetrics):
1267         * platform/network/curl/CurlContext.h:
1268         * platform/network/curl/CurlRequest.cpp:
1269         (WebCore::CurlRequest::CurlRequest):
1270         (WebCore::CurlRequest::updateNetworkLoadMetrics):
1271         * platform/network/curl/CurlRequest.h:
1272         (WebCore::CurlRequest::create):
1273         * platform/network/curl/ResourceHandleCurl.cpp:
1274         (WebCore::ResourceHandle::createCurlRequest):
1275
1276 2018-09-18  Megan Gardner  <megan_gardner@apple.com>
1277
1278         Support Images Module Level 4's double-position gradient color stop syntax
1279         https://bugs.webkit.org/show_bug.cgi?id=186154
1280         <rdar://problem/44158152>
1281
1282         Reviewed by Simon Fraser.
1283
1284         The CSS spec for all gradients allows for each color stop to have two angles to be used for hints.
1285         This makes pie chart and checkerboard conic gradients much simpler to write.
1286         Any time you want to have a hard line in a gradient, this syntax simplifies the gradient specification.
1287
1288         Test: fast/gradients/conic-two-hints.html
1289         Test: fast/gradients/linear-two-hints-angle.html
1290         Test: fast/gradients/linear-two-hints.html
1291         Test: fast/gradients/radial-two-hints.html
1292
1293         * css/parser/CSSPropertyParserHelpers.cpp:
1294         (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops): Removed.
1295         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
1296
1297 2018-09-18  Simon Fraser  <simon.fraser@apple.com>
1298
1299         Remove the unused RenderLayerCompositor::enclosingCompositorFlushingLayers()
1300         https://bugs.webkit.org/show_bug.cgi?id=189689
1301
1302         Reviewed by Alex Christensen.
1303
1304         enclosingCompositorFlushingLayers() was added in r76196 but never used. Also use
1305         a SetForScope<>.
1306
1307         * rendering/RenderLayerCompositor.cpp:
1308         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1309         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const): Deleted.
1310         * rendering/RenderLayerCompositor.h:
1311
1312 2018-09-18  Joseph Pecoraro  <pecoraro@apple.com>
1313
1314         [macOS] Frequent leaks seen under WebCore::gpuIDForDisplayMask
1315         https://bugs.webkit.org/show_bug.cgi?id=189685
1316         <rdar://problem/44541974>
1317
1318         Reviewed by Per Arne Vollan.
1319
1320         * platform/mac/PlatformScreenMac.mm:
1321         (WebCore::gpuIDForDisplayMask):
1322
1323 2018-09-18  Youenn Fablet  <youenn@apple.com>
1324
1325         Implement RTCRtpReceiver getContributingSources/getSynchronizationSources
1326         https://bugs.webkit.org/show_bug.cgi?id=189671
1327
1328         Reviewed by Eric Carlson.
1329
1330         Introduce implementation of these two methods by calling the libwebrtc corresponding method.
1331         Add corresponding IDL as per spec.
1332         Covered by rebased WPT tests.
1333
1334         * CMakeLists.txt:
1335         * DerivedSources.make:
1336         * Modules/mediastream/RTCRtpContributingSource.h: Added.
1337         * Modules/mediastream/RTCRtpContributingSource.idl: Added.
1338         * Modules/mediastream/RTCRtpReceiver.h:
1339         (WebCore::RTCRtpReceiver::getContributingSources const):
1340         (WebCore::RTCRtpReceiver::getSynchronizationSources const):
1341         * Modules/mediastream/RTCRtpReceiver.idl:
1342         * Modules/mediastream/RTCRtpReceiverBackend.h:
1343         (WebCore::RTCRtpReceiverBackend::getContributingSources const):
1344         (WebCore::RTCRtpReceiverBackend::getSynchronizationSources const):
1345         * Modules/mediastream/RTCRtpSynchronizationSource.h: Added.
1346         * Modules/mediastream/RTCRtpSynchronizationSource.idl: Added.
1347         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
1348         (WebCore::fillRTCRtpContributingSource):
1349         (WebCore::toRTCRtpContributingSource):
1350         (WebCore::toRTCRtpSynchronizationSource):
1351         (WebCore::LibWebRTCRtpReceiverBackend::getContributingSources const):
1352         (WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
1353         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
1354         * Sources.txt:
1355         * WebCore.xcodeproj/project.pbxproj:
1356
1357 2018-09-18  Youenn Fablet  <youenn@apple.com>
1358
1359         Enable Unified Plan by default
1360         https://bugs.webkit.org/show_bug.cgi?id=189675
1361
1362         Reviewed by Eric Carlson.
1363
1364         RTCRtpTransceiver.currentDirection is now gated by the unified plan runtime flag.
1365         This will allow easy feature detection of unified plan support.
1366         Covered by updated test.
1367
1368         * Modules/mediastream/RTCRtpTransceiver.idl:
1369
1370 2018-09-18  Per Arne Vollan  <pvollan@apple.com>
1371
1372         [WebVTT] change "middle" to "center" for consistency with CSS
1373         https://bugs.webkit.org/show_bug.cgi?id=158478
1374
1375         Reviewed by Eric Carlson.
1376
1377         No new tests, covered by existing tests.
1378
1379         * html/track/TextTrackCueGeneric.cpp:
1380         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
1381         * html/track/VTTCue.cpp:
1382         (WebCore::centerKeyword):
1383         (WebCore::VTTCue::initialize):
1384         (WebCore::VTTCue::align const):
1385         (WebCore::VTTCue::setAlign):
1386         (WebCore::VTTCue::calculateDisplayParameters):
1387         (WebCore::VTTCue::setCueSettings):
1388         (WebCore::middleKeyword): Deleted.
1389         * html/track/VTTCue.h:
1390         * html/track/WebVTTParser.cpp:
1391         (WebCore::WebVTTTreeBuilder::buildFromString):
1392
1393 2018-09-18  Chris Dumez  <cdumez@apple.com>
1394
1395         "DidFirstVisuallyNonEmptyLayout" callback does not get called when restoring a page from PageCache
1396         https://bugs.webkit.org/show_bug.cgi?id=189681
1397         <rdar://problem/44526171>
1398
1399         Reviewed by Alex Christensen and Zalan Bujtas.
1400
1401         The "DidFirstVisuallyNonEmptyLayout" callback was not getting called when restoring a page from PageCache
1402         because the FrameView is restored from PageCache and we would fail to restore its flags (such as
1403         m_firstVisuallyNonEmptyLayoutCallbackPending) when entering Page Cache. We now call reset those flags that
1404         are related to layout miletones when entering PageCache so that layout milestone events properly get sent
1405         again when restoring from Page Cache.
1406
1407         * history/CachedFrame.cpp:
1408         (WebCore::CachedFrame::CachedFrame):
1409
1410 2018-09-18  Manuel Rego Casasnovas  <rego@igalia.com>
1411
1412         [css-grid] Static position should use content-box, not padding-box
1413         https://bugs.webkit.org/show_bug.cgi?id=189698
1414
1415         Reviewed by Javier Fernandez.
1416
1417         This is a recent change by the CSSWG:
1418         https://github.com/w3c/csswg-drafts/issues/3020
1419
1420         The spec text (https://drafts.csswg.org/css-grid/#static-position):
1421           "The static position of an absolutely-positioned child
1422            of a grid container is determined as if it were the sole grid item
1423            in a grid area whose edges coincide with the content edges
1424            of the grid container."
1425
1426         Test: imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html
1427
1428         * rendering/RenderGrid.cpp:
1429         (WebCore::RenderGrid::prepareChildForPositionedLayout):
1430         Simple change to use border and padding.
1431
1432 2018-09-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1433
1434         [EME][GStreamer] The current EME implementation doesn't support the waitingforkey event
1435         https://bugs.webkit.org/show_bug.cgi?id=185590
1436
1437         Reviewed by Philippe Normand.
1438
1439         When decryptors are blocked waiting for the key, instruct the
1440         player to run the Wait for key algorithm. As per spec, if we run
1441         out of blocks pending to decrypt because we don't have the key, we
1442         request running the algorithm again.
1443
1444         Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https.html.
1445
1446         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1447         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1448         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1449         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
1450         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
1451         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1452         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1453         (webkitMediaCommonEncryptionDecryptTransformInPlace):
1454         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
1455
1456 2018-09-12  Ryosuke Niwa  <rniwa@webkit.org>
1457
1458         Update composedPath to match the latest spec
1459         https://bugs.webkit.org/show_bug.cgi?id=180378
1460         <rdar://problem/42843004>
1461
1462         Reviewed by Darin Adler.
1463
1464         This patch makes the check for whether a given node in the event path be included in composedPath
1465         pre-determined at the time of the event dispatching per https://github.com/whatwg/dom/issues/525.
1466         This was a fix for the issue that if an event listener in a closed shadow tree removes a node in the
1467         same tree in the event path, then composedPath called on its shadow host, for example, will include
1468         the removed node since it's no longer in the closed shadow tree.
1469
1470         Naively, implementing this behavior would require remembering the original document or shadow root
1471         of each node in the event path as well as its parent shadow root, or worse which node is disclosed
1472         to every other node at the time of computing the event path.
1473
1474         This patch takes a more novel and efficient approach to implement the new behavior by adding a single
1475         integer indicating the number of closed-mode shadow root ancestors of each node in the event path.
1476         In computePathUnclosedToTarget, any node whose *depth* is greater than the context object is excluded.
1477
1478         Consider the following example:
1479         div ------- ShadowRoot (closed)
1480           +- span     +- slot
1481         If an event is dispatched on span, then the event path would be [span, slot, ShadowRoot, div]. Then
1482         the values of integers assigned to each node would be: [0, 1, 1, 0] respectively. When composedPath
1483         is called on span or div, slot and ShadowRoot are excluded because they have a greater *depth* value.
1484
1485         Unfortunately, this simplistic solution doesn't work when there are multiple shadow roots of the same
1486         depth through which an event is dispatched as in:
1487         section -- ShadowRoot (closed, SR2)
1488           |          +- slot (s2)
1489           +div ------ ShadowRoot (closed, SR1)
1490             +- span     +- slot (s1)
1491         If an event is dispatched on span, the event path would be [span, s1, SR1, div, s2, SR2, section].
1492         The values of integers assigned are: [0, 1, 1, 0, 1, 1, 0] respectively. When composedPath is called
1493         on SR1, the simplistic approach would include s2 and SR2, which would be wrong.
1494
1495         To account for this case, in computePathUnclosedToTarget, we traverse the event path upwards (i.e.
1496         ancestors) and downwards (i.e. descendants) from the context object and decrease the *allowed depth*
1497         of shadow trees when we traverse out of a shadow tree in either direction. When traversing upwards,
1498         therefore, moving out of a shadow root to its host would would decrease the allowed depth. When
1499         traversing dowards, moving from a slot element to its assigned node would decrease the allowed depth.
1500
1501         Note that the depths can be negative when a composed event is dispatched inside a closed shadow tree,
1502         and it gets out of its shadow host.
1503
1504         Unfortunately, the latest DOM specification has a bug and doesn't match the behavior of Chrome. This
1505         patch proposes a new algorithm which can be adopted in https://github.com/whatwg/dom/issues/684.
1506
1507         Test: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html
1508
1509         * dom/EventContext.cpp:
1510         (WebCore::EventContext::EventContext):
1511         (WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext):
1512         (WebCore::TouchEventContext::TouchEventContext):
1513         * dom/EventContext.h:
1514         (WebCore::EventContext::closedShadowDepth const): Added.
1515         * dom/EventPath.cpp:
1516         (WebCore::WindowEventContext::WindowEventContext):
1517         (WebCore::EventPath::buildPath): Compute the closed shadow tree's depths for each node in the path.
1518         (WebCore::computePathUnclosedToTarget const): Implemented the aforementioned algorithm.
1519         (WebCore::EventPath::EventPath):
1520
1521 2018-09-17  Yusuke Suzuki  <utatane.tea@gmail.com>
1522
1523         [WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t
1524         https://bugs.webkit.org/show_bug.cgi?id=185339
1525
1526         Reviewed by Mark Lam.
1527
1528         * fileapi/ThreadableBlobRegistry.cpp:
1529         (WebCore::ThreadableBlobRegistry::blobSize):
1530         * platform/cocoa/NetworkExtensionContentFilter.h:
1531         * platform/cocoa/NetworkExtensionContentFilter.mm:
1532         (WebCore::NetworkExtensionContentFilter::initialize):
1533         (WebCore::NetworkExtensionContentFilter::willSendRequest):
1534         (WebCore::NetworkExtensionContentFilter::responseReceived):
1535         (WebCore::NetworkExtensionContentFilter::addData):
1536         (WebCore::NetworkExtensionContentFilter::finishedAddingData):
1537         (WebCore::NetworkExtensionContentFilter::handleDecision):
1538         Use per-function BinarySemaphore instead of holding it in NetworkExtensionContentFilter's field.
1539
1540         * platform/glib/FileMonitorGLib.cpp:
1541         (WebCore::FileMonitor::FileMonitor):
1542         (WebCore::FileMonitor::~FileMonitor):
1543         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1544         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1545         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1546         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
1547         (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
1548         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
1549         Use BinarySemaphore. And remove unused dispatch_semaphore_t.
1550
1551         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1552         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1553         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
1554         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
1555         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1556         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
1557         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1558         (WebCore::SourceBufferPrivateAVFObjC::abort):
1559         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
1560         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
1561         Use Box<Semaphore> and Box<BinarySemaphore>.
1562
1563         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
1564         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1565         (WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession):
1566         Remove unused dispatch_semaphore_t.
1567
1568         * platform/network/cf/ResourceHandleCFNet.cpp:
1569         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1570         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1571         (WebCore::getRunLoop):
1572         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1573         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1574         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1575         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1576         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1577         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1578         (-[WebCoreResourceHandleAsOperationQueueDelegate initWithHandle:messageQueue:]):
1579         (-[WebCoreResourceHandleAsOperationQueueDelegate detachHandle]):
1580         (-[WebCoreResourceHandleAsOperationQueueDelegate dealloc]):
1581         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
1582         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
1583         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1584         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
1585         Use BinarySemaphore instead.
1586
1587 2018-09-17  Simon Fraser  <simon.fraser@apple.com>
1588
1589         Many modern media control tests leak documents in testing
1590         https://bugs.webkit.org/show_bug.cgi?id=189437
1591
1592         Reviewed by Darin Adler.
1593
1594         In order to accurately detect leaks in media controls tests which use lots of
1595         SVGImages, we have to:
1596         - Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer
1597           to clear references to elements.
1598         - Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources()
1599           to drop the last handle to the CachedResource for an SVGImage.
1600         - Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources()
1601           to run again after that timer has fired.
1602         
1603         This should fix most of the spurious leak reports involving SVGImage documents.
1604
1605         * page/MemoryRelease.cpp:
1606         (WebCore::releaseCriticalMemory):
1607
1608 2018-09-17  Jer Noble  <jer.noble@apple.com>
1609
1610         Add support for HEVC codec types in Media Capabilities
1611         https://bugs.webkit.org/show_bug.cgi?id=189565
1612
1613         Reviewed by Eric Carlson.
1614
1615         Test: media/hevc-codec-parameters.html
1616
1617         Add some utility methods for parsing HEVC codec strings, and using those parsed
1618         values to query the platform for detailed support for HEVC decoding.
1619
1620         Drive-by fix: Modify MediaEngineConfigurationFactory to allow for null function
1621         pointers in the encode/decode factory pair.
1622
1623         * Sources.txt:
1624         * SourcesCocoa.txt:
1625         * WebCore.xcodeproj/project.pbxproj:
1626         * platform/cocoa/VideoToolboxSoftLink.cpp:
1627         * platform/cocoa/VideoToolboxSoftLink.h:
1628         * platform/graphics/HEVCUtilities.cpp: Added.
1629         (WebCore::parseHEVCCodecParameters):
1630         * platform/graphics/HEVCUtilities.h: Added.
1631         * platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp: Added.
1632         (WebCore::validateHEVCParameters):
1633         * platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Added.
1634         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: Added.
1635         (WebCore::videoCodecTypeFromRFC4281Type):
1636         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
1637         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h: Added.
1638         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
1639         (WebCore::factories):
1640         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
1641         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
1642         * testing/Internals.cpp:
1643         (WebCore::Internals::parseHEVCCodecParameters):
1644         * testing/Internals.h:
1645         * testing/Internals.idl:
1646
1647 2018-09-17  Devin Rousso  <drousso@apple.com>
1648
1649         Web Inspector: generate CSSKeywordCompletions from backend values
1650         https://bugs.webkit.org/show_bug.cgi?id=189041
1651
1652         Reviewed by Joseph Pecoraro.
1653
1654         Modified existing test inspector/css/getSupportedCSSProperties.html.
1655
1656         * inspector/agents/InspectorCSSAgent.cpp:
1657         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
1658         Send alias and longhand information for all properties, and any known keyword values for
1659         those applicable. This makes use of `CSSParserFastPaths::isValidKeywordPropertyAndValue` to
1660         determine if a given keyword is a valid value for each property. This only generates a list
1661         for properties who have no non-keyword values.
1662
1663         * css/makeprop.pl:
1664         * css/makevalues.pl:
1665         Create additional helper functions/constants for retrieving strings of each CSS keyword.
1666
1667         * css/CSSProperty.h:
1668         (WebCore::CSSProperty::aliasesForProperty):
1669
1670         * css/CSSPrimitiveValue.cpp:
1671         (WebCore::valueName):
1672
1673         * css/CSSValuePool.cpp:
1674         (WebCore::CSSValuePool::CSSValuePool):
1675         (WebCore::CSSValuePool::createIdentifierValue):
1676
1677 2018-09-17  Youenn Fablet  <youenn@apple.com>
1678
1679         track.onmute isn't called for a remote MediaStreamTrack when its counter part track is removed from the peer connection
1680         https://bugs.webkit.org/show_bug.cgi?id=176281
1681         <rdar://problem/44525674>
1682
1683         Reviewed by Eric Carlson.
1684
1685         Listen to libwebrtc remove track callbacks.
1686         Implement handling as per https://w3c.github.io/webrtc-pc/#process-remote-track-removal.
1687         This triggers a mute event on the track.
1688
1689         Test: webrtc/remove-track.html
1690
1691         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1692         (WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
1693         (WebCore::LibWebRTCMediaEndpoint::OnRemoveTrack):
1694         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1695         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1696         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
1697         Drive by fix: Plan B code path does not mandate having an rtc backend for each sender.
1698
1699 2018-09-17  Simon Fraser  <simon.fraser@apple.com>
1700
1701         Add more Fullscreen logging
1702         https://bugs.webkit.org/show_bug.cgi?id=189656
1703
1704         Reviewed by Jer Noble.
1705
1706         Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
1707         the fullscreen element.
1708
1709         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1710         (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
1711         (VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement):
1712         (VideoFullscreenModelVideoElement::setVideoElement):
1713
1714 2018-09-14  Simon Fraser  <simon.fraser@apple.com>
1715
1716         Add support for dumping the GraphicsLayer tree via notifyutil
1717         https://bugs.webkit.org/show_bug.cgi?id=189639
1718
1719         Reviewed by Zalan Bujtas.
1720
1721         Make "notifyutil -p com.apple.WebKit.showGraphicsLayerTree" work. It dumps the GraphicsLayer tree
1722         for each top-level document (GraphicsLayers are connected across frame boundaries, so this prints
1723         the entire tree for each main frame).
1724         
1725         It uses WTFLogAlways rather than fprintf() so output shows on all platforms (other tree dumps should
1726         be converted in the same way).
1727
1728         * page/mac/PageMac.mm:
1729         (WebCore::Page::platformInitialize):
1730         * platform/graphics/GraphicsLayer.cpp:
1731         (showGraphicsLayerTree):
1732         * rendering/RenderLayerCompositor.cpp:
1733         (showGraphicsLayerTreeForCompositor):
1734         * rendering/RenderLayerCompositor.h:
1735         * rendering/RenderObject.cpp:
1736         (WebCore::printGraphicsLayerTreeForLiveDocuments):
1737         * rendering/RenderObject.h:
1738
1739 2018-09-17  Christopher Reid  <chris.reid@sony.com>
1740
1741         [Curl] Add schema version and enable auto vacuum for cookie database.
1742         https://bugs.webkit.org/show_bug.cgi?id=189669
1743
1744         Reviewed by Alex Christensen.
1745
1746         Turning on auto incremental vacuuming and adding versioning to the database. Right now we
1747         reset tables if there's an unknown schema or if the none is set. There is placeholder logic
1748         in place to upgrade databases as the schema changes in the future.
1749
1750         Tested by checking the database manually after launching MiniBrowser.
1751
1752         * platform/network/curl/CookieJarDB.cpp:
1753         (WebCore::CookieJarDB::openDatabase):
1754         (WebCore::CookieJarDB::verifySchemaVersion):
1755         (WebCore::CookieJarDB::deleteAllTables):
1756         (WebCore::CookieJarDB::createPrepareStatement):
1757         (WebCore::CookieJarDB::getPrepareStatement):
1758         (WebCore::CookieJarDB::executeSimpleSql):
1759         * platform/network/curl/CookieJarDB.h:
1760         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1761         (WebCore::defaultSession):
1762         * platform/sql/SQLiteDatabase.cpp:
1763         (WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum): fixed a bug.
1764
1765 2018-09-14  Ryosuke Niwa  <rniwa@webkit.org>
1766
1767         Re-order Node flags based on semantics
1768         https://bugs.webkit.org/show_bug.cgi?id=189643
1769
1770         Reviewed by Simon Fraser.
1771
1772         Re-ordered Node flags based on their category and subclasses of Node which use them.
1773
1774         * dom/Node.h:
1775
1776 2018-09-17  Simon Fraser  <simon.fraser@apple.com>
1777
1778         Add more ResourceLoading logging, particularly in MemoryCache code
1779         https://bugs.webkit.org/show_bug.cgi?id=189651
1780
1781         Reviewed by Tim Horton.
1782
1783         Adding more logging to the ResourceLoading log channel, which I found useful
1784         when trying to understand cached SVGImage lifetimes (bug 189437).
1785
1786         * loader/cache/CachedResource.cpp:
1787         (WebCore::CachedResource::deleteIfPossible):
1788         * loader/cache/CachedResourceLoader.cpp:
1789         (WebCore::CachedResourceLoader::requestResource):
1790         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
1791         * loader/cache/MemoryCache.cpp:
1792         (WebCore::MemoryCache::add):
1793         (WebCore::MemoryCache::pruneLiveResourcesToSize):
1794         (WebCore::MemoryCache::pruneDeadResources):
1795         (WebCore::MemoryCache::pruneDeadResourcesToSize):
1796         (WebCore::MemoryCache::remove):
1797         (WebCore::MemoryCache::dumpLRULists const):
1798
1799 2018-09-17  Jer Noble  <jer.noble@apple.com>
1800
1801         Enable USE_MEDIAREMOTE on iOS
1802         https://bugs.webkit.org/show_bug.cgi?id=189096
1803
1804         Reviewed by Eric Carlson.
1805
1806         Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
1807         Now Playing implementation on iOS and Mac.
1808
1809         * SourcesCocoa.txt:
1810         * WebCore.xcodeproj/project.pbxproj:
1811         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
1812         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
1813         * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
1814         (PlatformMediaSessionManager::sharedManager):
1815         (PlatformMediaSessionManager::sharedManagerIfExists):
1816         (MediaSessionManagerCocoa::updateSessionState):
1817         (MediaSessionManagerCocoa::beginInterruption):
1818         (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
1819         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
1820         (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
1821         (MediaSessionManagerCocoa::removeSession):
1822         (MediaSessionManagerCocoa::sessionWillEndPlayback):
1823         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
1824         (MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
1825         (MediaSessionManagerCocoa::nowPlayingEligibleSession):
1826         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1827         * platform/audio/ios/MediaSessionManagerIOS.h:
1828         (): Deleted.
1829         * platform/audio/ios/MediaSessionManagerIOS.mm:
1830         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
1831         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
1832         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
1833         (WebCore::MediaSessionManageriOS::removeSession): Deleted.
1834         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
1835         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
1836         * platform/audio/mac/MediaSessionManagerMac.h: Removed.
1837
1838 2018-09-17  Frederic Wang  <fwang@igalia.com>
1839
1840         Build error in ImageBufferCG when compiled with IOSurfacePool
1841         https://bugs.webkit.org/show_bug.cgi?id=189579
1842
1843         Reviewed by Tim Horton.
1844
1845         IOSurface.h might be included with different value of IOSURFACE_CANVAS_BACKING_STORE, causing
1846         compilation errors when files in the same unified source do not agree on the definition.
1847         This patch moves the definition of IOSURFACE_CANVAS_BACKING_STORE from ImageBufferDataCG.h
1848         to Platform.h so that IOSURFACE_CANVAS_BACKING_STORE is set to the same value in all files.
1849         Finally some minors changes to explicitly declare/define ImageBuffer are performed in order
1850         to prevent future issues with Unified build rotating.
1851
1852         No new tests, behavior unchanged.
1853
1854         * html/HTMLCanvasElement.cpp: Explicitly include ImageBuffer.h since it's used in this file.
1855         * platform/graphics/cg/ImageBufferDataCG.h: Move definition into Platform.h.
1856         * platform/graphics/cocoa/IOSurface.h: Forward-declare ImageBuffer since it's used in this
1857         header.
1858
1859 2018-09-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1860
1861         [Curl] Respond with requested authentication scheme for authentication challenge.
1862         https://bugs.webkit.org/show_bug.cgi?id=189318
1863
1864         Reviewed by Alex Christensen.
1865
1866         Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this
1867         mode, the round-trip communication between the client and the server is handled by libcurl
1868         internally. That's okay for many cases. But when initial request has a credentials
1869         (i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because
1870         the returned response is not 401.
1871
1872         Passes following tests:
1873         - http/tests/websocket/tests/hybi/httponly-cookie.pl
1874         - http/tests/websocket/tests/hybi/secure-cookie-insecure-connection.pl
1875         - http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl
1876         - http/tests/xmlhttprequest/basic-auth-default.html
1877         - http/tests/xmlhttprequest/cross-origin-authorization.html
1878         - http/tests/xmlhttprequest/logout.html
1879         - http/tests/xmlhttprequest/null-auth.php
1880         - http/tests/xmlhttprequest/re-login-async.html
1881         - http/tests/xmlhttprequest/re-login.html
1882         - http/tests/xmlhttprequest/redirect-credentials-responseURL.html
1883         - http/tests/xmlhttprequest/remember-bad-password.html
1884
1885         * platform/network/ResourceHandle.h:
1886         * platform/network/curl/CurlContext.cpp:
1887         (WebCore::CurlHandle::setHttpAuthUserPass):
1888         (WebCore::CurlHandle::enableHttpAuthentication): Deleted.
1889         * platform/network/curl/CurlContext.h:
1890         * platform/network/curl/CurlRequest.cpp:
1891         (WebCore::CurlRequest::setAuthenticationScheme):
1892         (WebCore::CurlRequest::setupTransfer):
1893         * platform/network/curl/CurlRequest.h:
1894         * platform/network/curl/ResourceHandleCurl.cpp:
1895         (WebCore::ResourceHandle::start):
1896         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1897         (WebCore::ResourceHandle::receivedCredential):
1898         (WebCore::ResourceHandle::getCredential):
1899         (WebCore::ResourceHandle::restartRequestWithCredential):
1900         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1901         (WebCore::ResourceHandle::continueAfterWillSendRequest):
1902
1903 2018-09-17  Youenn Fablet  <youenn@apple.com>
1904
1905         Enable VCP for iOS and reenable it for MacOS
1906         https://bugs.webkit.org/show_bug.cgi?id=189635
1907         <rdar://problem/43621029>
1908
1909         Reviewed by Eric Carlson.
1910
1911         Covered by exsiting and modified tests.
1912         Instead of using libwebrtc YUV frames for black frames, use CVPixelBuffer to make it efficient.
1913         Add internal API to know whether VCP is enabled so as to make capture-webrtc test pass on all platforms.
1914
1915         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
1916         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
1917         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1918         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
1919         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
1920         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1921         (WebCore::createBlackPixelBuffer):
1922         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
1923         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1924         (WebCore::RealtimeOutgoingVideoSourceCocoa::createBlackFrame):
1925         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
1926         * testing/Internals.cpp:
1927         (WebCore::Internals::supportsVCPEncoder):
1928         * testing/Internals.h:
1929         * testing/Internals.idl:
1930
1931 2018-09-17  Chris Dumez  <cdumez@apple.com>
1932
1933         PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin
1934         https://bugs.webkit.org/show_bug.cgi?id=189602
1935         <rdar://problem/44430549>
1936
1937         Reviewed by Geoff Garen.
1938
1939         * loader/DocumentLoader.cpp:
1940         (WebCore::DocumentLoader::setTriggeringAction):
1941         * loader/DocumentLoader.h:
1942         * loader/FrameLoadRequest.h:
1943         * loader/FrameLoader.cpp:
1944         (WebCore::FrameLoader::loadURL):
1945         (WebCore::FrameLoader::loadWithNavigationAction):
1946         (WebCore::FrameLoader::loadWithDocumentLoader):
1947         (WebCore::FrameLoader::loadPostRequest):
1948         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1949         (WebCore::FrameLoader::loadDifferentDocumentItem):
1950         Move NavigationAction's opener setting to loadWithNavigationAction() as this is a better bottleneck.
1951         Otherwise, we'd have to set it at several call sites. Also move the NavigationAction around instead
1952         of copying it.
1953
1954         * loader/FrameLoader.h:
1955         (WebCore::FrameLoader::loadWithNavigationAction):
1956         * loader/NavigationAction.h:
1957         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy):
1958         * loader/PolicyChecker.cpp:
1959         (WebCore::PolicyChecker::checkNavigationPolicy):
1960         * page/DOMWindow.cpp:
1961         (WebCore::DOMWindow::createWindow):
1962
1963 2018-09-17  Darin Adler  <darin@apple.com>
1964
1965         Use OpaqueJSString rather than JSRetainPtr inside WebKit
1966         https://bugs.webkit.org/show_bug.cgi?id=189652
1967
1968         Reviewed by Saam Barati.
1969
1970         * Modules/plugins/QuickTimePluginReplacement.mm:
1971         (WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.
1972         (WebCore::jsValueWithAVMetadataItemInContext): Use adoptCF.
1973
1974         * platform/mac/SerializedPlatformRepresentationMac.mm:
1975         (WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.
1976
1977 2018-09-08  Darin Adler  <darin@apple.com>
1978
1979         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
1980         https://bugs.webkit.org/show_bug.cgi?id=189455
1981
1982         Reviewed by Keith Miller.
1983
1984         * Modules/plugins/QuickTimePluginReplacement.mm:
1985         (WebCore::jsValueWithDictionaryInContext): Adding a missing
1986         JSStringRelease to fix a leak.
1987
1988 2018-09-15  Rob Buis  <rbuis@igalia.com>
1989
1990         XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response
1991         https://bugs.webkit.org/show_bug.cgi?id=189627
1992
1993         Reviewed by Alexey Proskuryakov.
1994
1995         Right now we return an empty Blob without type when the response is empty, but
1996         it should always include the type [1].
1997
1998         Test: web-platform-tests/xhr/overridemimetype-blob.html
1999
2000         [1] https://xhr.spec.whatwg.org/#blob-response
2001
2002         * xml/XMLHttpRequest.cpp:
2003         (WebCore::XMLHttpRequest::createResponseBlob):
2004
2005 2018-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2006
2007         [Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
2008         https://bugs.webkit.org/show_bug.cgi?id=189530
2009
2010         Reviewed by Alex Christensen.
2011
2012         Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
2013         Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
2014         Also respondEnd was not correctly recorded and fixed.
2015
2016         No new tests because it cannot be measured from DRT.
2017
2018         * platform/network/ResourceHandleInternal.h:
2019         * platform/network/curl/CurlContext.cpp:
2020         (WebCore::CurlHandle::getNetworkLoadMetrics):
2021         * platform/network/curl/CurlContext.h:
2022         * platform/network/curl/CurlRequest.cpp:
2023         (WebCore::CurlRequest::start):
2024         (WebCore::CurlRequest::setupTransfer):
2025         (WebCore::CurlRequest::didCompleteTransfer):
2026         (WebCore::CurlRequest::updateNetworkLoadMetrics):
2027         * platform/network/curl/CurlRequest.h:
2028         (WebCore::CurlRequest::setStartTime):
2029         * platform/network/curl/ResourceHandleCurl.cpp:
2030         (WebCore::ResourceHandle::start):
2031         (WebCore::ResourceHandle::restartRequestWithCredential):
2032         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2033         (WebCore::ResourceHandle::willSendRequest):
2034         (WebCore::ResourceHandle::continueAfterWillSendRequest):
2035
2036 2018-09-14  Justin Fan  <justin_fan@apple.com>
2037
2038         WebGL 2 conformance: rgb-format-support.html
2039         https://bugs.webkit.org/show_bug.cgi?id=189610
2040         <rdar://problem/44403343>
2041
2042         Reviewed by Dean Jackson.
2043
2044         Implementing getInternalformatParameter (emulating on macOS) and updating 
2045         renderbufferStorage{Multisample} for WebGL 2 conformance. 
2046
2047         Test: webgl/2.0.0/conformance2/rendering/rgb-format-support.html enabled.
2048
2049         * html/canvas/WebGL2RenderingContext.cpp:
2050         (WebCore::isRenderableInternalformat):
2051         (WebCore::WebGL2RenderingContext::getInternalformatParameter):
2052         (WebCore::WebGL2RenderingContext::renderbufferStorageMultisample):
2053         (WebCore::WebGL2RenderingContext::renderbufferStorage):
2054         (WebCore::WebGL2RenderingContext::baseInternalFormatFromInternalFormat):
2055         (WebCore::WebGL2RenderingContext::isIntegerFormat):
2056         * platform/graphics/GraphicsContext3D.h:
2057         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2058         (WebCore::GraphicsContext3D::getInternalformativ):
2059         (WebCore::GraphicsContext3D::renderbufferStorageMultisample):
2060
2061 2018-09-14  Justin Michaud  <justin_michaud@apple.com>
2062
2063         Add support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics platforms)
2064         https://bugs.webkit.org/show_bug.cgi?id=5968
2065
2066         Add support for spreadMethod=repeat and reflect. Also, the opacity of a gradient is now
2067         the result of multiplying stop-opacity with the opacity of the color.
2068
2069         Reviewed by Simon Fraser.
2070
2071         Tests: svg/gradients/spreadMethod-expected.svg
2072                svg/gradients/spreadMethod.svg
2073                svg/gradients/spreadMethodAlpha-expected.svg
2074                svg/gradients/spreadMethodAlpha.svg
2075                svg/gradients/spreadMethodClose0-expected-mismatch.svg
2076                svg/gradients/spreadMethodClose0.svg
2077                svg/gradients/spreadMethodClose1-expected-mismatch.svg
2078                svg/gradients/spreadMethodClose1.svg
2079                svg/gradients/spreadMethodClose2-expected.svg
2080                svg/gradients/spreadMethodClose2.svg
2081                svg/gradients/spreadMethodDiagonal-expected.svg
2082                svg/gradients/spreadMethodDiagonal.svg
2083                svg/gradients/spreadMethodDiagonal2-expected.svg
2084                svg/gradients/spreadMethodDiagonal2.svg
2085                svg/gradients/spreadMethodDuplicateStop-expected.svg
2086                svg/gradients/spreadMethodDuplicateStop.svg
2087                svg/gradients/spreadMethodReversed-expected.svg
2088                svg/gradients/spreadMethodReversed.svg
2089                svg/gradients/stopAlpha-expected.svg
2090                svg/gradients/stopAlpha.svg
2091
2092         * platform/graphics/cg/GradientCG.cpp:
2093         (WebCore::Gradient::paint):
2094         * svg/SVGStopElement.cpp:
2095         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
2096
2097 2018-09-14  Ryan Haddad  <ryanhaddad@apple.com>
2098
2099         Unreviewed, attempt to fix the iOSMac build after r236015.
2100
2101         * platform/graphics/cv/PixelBufferResizer.mm:
2102         (WebCore::PixelBufferResizer::PixelBufferResizer):
2103
2104 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
2105
2106         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
2107         https://bugs.webkit.org/show_bug.cgi?id=189521
2108
2109         Reviewed by Tim Horton.
2110         
2111         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
2112         
2113         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
2114         
2115         All the other changes are just to adapt to the new ownership patterns.
2116         
2117         I verified that no GraphicsLayers were leaked or abandoned after this change.
2118
2119         No behavior change.
2120
2121         * page/PageOverlayController.cpp:
2122         (WebCore::PageOverlayController::layerWithDocumentOverlays):
2123         (WebCore::PageOverlayController::layerWithViewOverlays):
2124         (WebCore::PageOverlayController::installPageOverlay):
2125         (WebCore::PageOverlayController::uninstallPageOverlay):
2126         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
2127         (WebCore::PageOverlayController::didChangeViewSize):
2128         (WebCore::PageOverlayController::didChangeDocumentSize):
2129         (WebCore::PageOverlayController::didChangeSettings):
2130         (WebCore::PageOverlayController::paintContents):
2131         (WebCore::PageOverlayController::didChangeOverlayFrame):
2132         (WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
2133         * page/PageOverlayController.h:
2134         * page/mac/ServicesOverlayController.h:
2135         (WebCore::ServicesOverlayController::Highlight::layer const):
2136         * page/mac/ServicesOverlayController.mm:
2137         (WebCore::ServicesOverlayController::Highlight::Highlight):
2138         (WebCore::ServicesOverlayController::Highlight::invalidate):
2139         (WebCore::ServicesOverlayController::Highlight::fadeIn):
2140         (WebCore::ServicesOverlayController::Highlight::fadeOut):
2141         (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
2142         (WebCore::ServicesOverlayController::determineActiveHighlight):
2143         * platform/graphics/GraphicsLayer.cpp:
2144         (WebCore::GraphicsLayer::GraphicsLayer):
2145         (WebCore::GraphicsLayer::willBeDestroyed):
2146         (WebCore::GraphicsLayer::setChildren):
2147         (WebCore::GraphicsLayer::addChild):
2148         (WebCore::GraphicsLayer::addChildAtIndex):
2149         (WebCore::GraphicsLayer::addChildBelow):
2150         (WebCore::GraphicsLayer::addChildAbove):
2151         (WebCore::GraphicsLayer::replaceChild):
2152         (WebCore::GraphicsLayer::removeAllChildren):
2153         (WebCore::GraphicsLayer::removeFromParent):
2154         (WebCore::GraphicsLayer::setMaskLayer):
2155         (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
2156         (WebCore::GraphicsLayer::distributeOpacity):
2157         (WebCore::GraphicsLayer::traverse):
2158         (WebCore::dumpChildren):
2159         * platform/graphics/GraphicsLayer.h:
2160         (WebCore::GraphicsLayer::children const):
2161         (WebCore::GraphicsLayer::children):
2162         (WebCore::GraphicsLayer::maskLayer const):
2163         (WebCore::GraphicsLayer::replicaLayer const):
2164         (WebCore::GraphicsLayer::beingDestroyed const):
2165         (WebCore::GraphicsLayer:: const): Deleted.
2166         * platform/graphics/GraphicsLayerFactory.h:
2167         * platform/graphics/ca/GraphicsLayerCA.cpp:
2168         (WebCore::GraphicsLayer::create):
2169         (WebCore::GraphicsLayerCA::setChildren):
2170         (WebCore::GraphicsLayerCA::addChild):
2171         (WebCore::GraphicsLayerCA::addChildAtIndex):
2172         (WebCore::GraphicsLayerCA::addChildBelow):
2173         (WebCore::GraphicsLayerCA::addChildAbove):
2174         (WebCore::GraphicsLayerCA::replaceChild):
2175         (WebCore::GraphicsLayerCA::setMaskLayer):
2176         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
2177         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2178         (WebCore::GraphicsLayerCA::updateSublayerList):
2179         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2180         * platform/graphics/ca/GraphicsLayerCA.h:
2181         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2182         (WebCore::GraphicsLayer::create):
2183         (WebCore::GraphicsLayerTextureMapper::setChildren):
2184         (WebCore::GraphicsLayerTextureMapper::addChild):
2185         (WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
2186         (WebCore::GraphicsLayerTextureMapper::addChildAbove):
2187         (WebCore::GraphicsLayerTextureMapper::addChildBelow):
2188         (WebCore::GraphicsLayerTextureMapper::replaceChild):
2189         (WebCore::GraphicsLayerTextureMapper::setMaskLayer):
2190         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
2191         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2192         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2193         (WebCore::GraphicsLayer::create):
2194         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
2195         (WebCore::CoordinatedGraphicsLayer::addChild):
2196         (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
2197         (WebCore::CoordinatedGraphicsLayer::addChildAbove):
2198         (WebCore::CoordinatedGraphicsLayer::addChildBelow):
2199         (WebCore::CoordinatedGraphicsLayer::replaceChild):
2200         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
2201         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
2202         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
2203         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
2204         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2205         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
2206         (WebCore::GraphicsLayer::create):
2207         (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
2208         (WebCore::GraphicsLayerDirect2D::initialize): Deleted.
2209         (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
2210         (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
2211         (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
2212         * rendering/RenderLayerBacking.cpp:
2213         (WebCore::RenderLayerBacking::createGraphicsLayer):
2214         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
2215         (WebCore::RenderLayerBacking::updateConfiguration):
2216         (WebCore::RenderLayerBacking::updateInternalHierarchy):
2217         (WebCore::RenderLayerBacking::updateMaskingLayer):
2218         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
2219         (WebCore::RenderLayerBacking::updateScrollingLayers):
2220         * rendering/RenderLayerBacking.h:
2221         * rendering/RenderLayerCompositor.cpp:
2222         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2223         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
2224         (WebCore::RenderLayerCompositor::setCompositingParent):
2225         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2226         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2227         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
2228         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
2229         (WebCore::RenderLayerCompositor::updateLayerForHeader):
2230         (WebCore::RenderLayerCompositor::updateLayerForFooter):
2231         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2232         (WebCore::RenderLayerCompositor::ensureRootLayer):
2233         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
2234         * rendering/RenderLayerCompositor.h:
2235
2236 2018-09-14  Eric Carlson  <eric.carlson@apple.com>
2237
2238         Support arbitrary video resolution in getUserMedia API
2239         https://bugs.webkit.org/show_bug.cgi?id=178109
2240         <rdar://problem/35083128>
2241
2242         Reviewed by Youenn Fablet.
2243
2244         Support arbitrary video resolutions by configuring the camera to capture at the closest
2245         larger size it supports and scaling/cropping frames as necessary.
2246
2247         No new tests, existing tests updated.
2248
2249         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
2250         * Modules/webaudio/MediaStreamAudioSource.cpp:
2251         (WebCore::MediaStreamAudioSource::capabilities): Make non-const, it wasn't helpful.
2252         (WebCore::MediaStreamAudioSource::settings): Ditto.
2253         (WebCore::MediaStreamAudioSource::capabilities const): Deleted.
2254         (WebCore::MediaStreamAudioSource::settings const): Deleted.
2255         * Modules/webaudio/MediaStreamAudioSource.h:
2256
2257         * SourcesCocoa.txt: Add PixelBufferResizer.
2258
2259         * WebCore.xcodeproj/project.pbxproj: Ditto.
2260
2261         * platform/cocoa/CoreVideoSoftLink.h:
2262         * platform/cocoa/VideoToolboxSoftLink.cpp:
2263         * platform/cocoa/VideoToolboxSoftLink.h:
2264
2265         * platform/graphics/cv/PixelBufferResizer.h: Added.
2266         (WebCore::PixelBufferResizer::canResizeTo):
2267         * platform/graphics/cv/PixelBufferResizer.mm: Added.
2268         (WebCore::PixelBufferResizer::PixelBufferResizer):
2269         (WebCore::PixelBufferResizer::resize):
2270
2271         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
2272         (WebCore::RealtimeIncomingAudioSource::capabilities): Make non-const, it wasn't helpful.
2273         (WebCore::RealtimeIncomingAudioSource::settings): Ditto.
2274         (WebCore::RealtimeIncomingAudioSource::capabilities const): Deleted.
2275         (WebCore::RealtimeIncomingAudioSource::settings const): Deleted.
2276         * platform/mediastream/RealtimeIncomingAudioSource.h:
2277
2278         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2279         (WebCore::RealtimeIncomingVideoSource::capabilities): Make non-const, it wasn't helpful.
2280         (WebCore::RealtimeIncomingVideoSource::settings): Ditto.
2281         (WebCore::RealtimeIncomingVideoSource::capabilities const): Deleted.
2282         (WebCore::RealtimeIncomingVideoSource::settings const): Deleted.
2283         * platform/mediastream/RealtimeIncomingVideoSource.h:
2284
2285         * platform/mediastream/RealtimeMediaSource.cpp:
2286         (WebCore::RealtimeMediaSource::supportsConstraint):
2287         (WebCore::RealtimeMediaSource::supportsConstraint const): Deleted.
2288         * platform/mediastream/RealtimeMediaSource.h:
2289
2290         * platform/mediastream/RealtimeVideoSource.cpp:
2291         (WebCore::RealtimeVideoSource::presets):
2292         (WebCore::RealtimeVideoSource::setSupportedPresets):
2293         (WebCore::standardVideoSizes):
2294         (WebCore::RealtimeVideoSource::updateCapabilities): Make non-const, it wasn't helpful.
2295         (WebCore::presetSupportsFrameRate):
2296         (WebCore::RealtimeVideoSource::supportsCaptureSize):
2297         (WebCore::RealtimeVideoSource::shouldUsePreset):
2298         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate):
2299         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
2300         (WebCore::RealtimeVideoSource::addSupportedCapabilities const): Deleted.
2301         * platform/mediastream/RealtimeVideoSource.h:
2302         (WebCore::VideoPresetData::encode const):
2303         (WebCore::VideoPresetData::decode):
2304         (WebCore::VideoPreset::create):
2305         (WebCore::VideoPreset::VideoPreset):
2306         (WebCore::RealtimeVideoSource::prefersPreset):
2307         (WebCore::RealtimeVideoSource::canResizeVideoFrames const):
2308         (WebCore::RealtimeVideoSource::setDefaultSize):
2309         (WebCore::RealtimeVideoSource::observedFrameRate const):
2310         (WebCore::VideoPreset::encode const): Deleted.
2311         (WebCore::VideoPreset::decode): Deleted.
2312
2313         * platform/mediastream/mac/AVVideoCaptureSource.h:
2314         (WebCore::AVVideoCaptureSource::videoPresets): Deleted.
2315         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2316         (WebCore::AVVideoPreset::create):
2317         (WebCore::AVVideoPreset::AVVideoPreset):
2318         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
2319         (WebCore::AVVideoCaptureSource::settings):
2320         (WebCore::AVVideoCaptureSource::capabilities): Make non-const, it wasn't helpful.
2321         (WebCore::AVVideoCaptureSource::setFrameRate):
2322         (WebCore::AVVideoCaptureSource::prefersPreset):
2323         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2324         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
2325         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2326         (WebCore::AVVideoCaptureSource::processNewFrame):
2327         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2328         (WebCore::AVVideoCaptureSource::isFrameRateSupported):
2329         (WebCore::AVVideoCaptureSource::generatePresets):
2330         (WebCore::updateSizeMinMax): Deleted.
2331         (WebCore::updateAspectRatioMinMax): Deleted.
2332         (WebCore::AVVideoCaptureSource::settings const): Deleted.
2333         (WebCore::AVVideoCaptureSource::capabilities const): Deleted.
2334         (WebCore::AVVideoCaptureSource::sizeForPreset): Deleted.
2335         (WebCore::AVVideoCaptureSource::setPreset): Deleted.
2336         (WebCore::AVVideoCaptureSource::setSizeAndFrameRate): Deleted.
2337         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Deleted.
2338         (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Deleted.
2339
2340         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2341         (WebCore::CoreAudioCaptureSource::capabilities): Make non-const, it wasn't helpful.
2342         (WebCore::CoreAudioCaptureSource::settings): Ditto.
2343         (WebCore::CoreAudioCaptureSource::capabilities const): Deleted.
2344         (WebCore::CoreAudioCaptureSource::settings const): Deleted.
2345         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2346
2347         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2348         (WebCore::DisplayCaptureSourceCocoa::capabilities): Make non-const, it wasn't helpful.
2349         (WebCore::DisplayCaptureSourceCocoa::settings): Ditto.
2350         (WebCore::DisplayCaptureSourceCocoa::capabilities const): Deleted.
2351         (WebCore::DisplayCaptureSourceCocoa::settings const): Deleted.
2352         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
2353
2354         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
2355         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2356         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
2357         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
2358         (WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset):
2359         * platform/mock/MockMediaDevice.h:
2360         (WebCore::MockCameraProperties::decode):
2361
2362         * platform/mock/MockRealtimeAudioSource.cpp:
2363         (WebCore::MockRealtimeAudioSource::settings): Make non-const, it wasn't helpful.
2364         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
2365         (WebCore::MockRealtimeAudioSource::settings const): Deleted.
2366         (WebCore::MockRealtimeAudioSource::capabilities const): Deleted.
2367         * platform/mock/MockRealtimeAudioSource.h:
2368
2369         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2370         (WebCore::defaultDevices): Change video device presets to trigger resize code more often.
2371
2372         * platform/mock/MockRealtimeVideoSource.cpp:
2373         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
2374         (WebCore::MockRealtimeVideoSource::generatePresets):
2375         (WebCore::MockRealtimeVideoSource::capabilities): Make non-const, it wasn't helpful.
2376         (WebCore::MockRealtimeVideoSource::settings): Ditto.
2377         (WebCore::MockRealtimeVideoSource::capabilities const): Deleted.
2378         (WebCore::MockRealtimeVideoSource::settings const): Deleted.
2379         * platform/mock/MockRealtimeVideoSource.h:
2380
2381 2018-09-14  Frederic Wang  <fwang@igalia.com>
2382
2383         Bug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTaggedSettings and FontCascadeFonts together
2384         https://bugs.webkit.org/show_bug.cgi?id=189541
2385
2386         Reviewed by Alex Christensen.
2387
2388         FontDescriptionKey::computeHash() from In FontCache.h requires implicit instantiation of the
2389         FontTaggedSettings::hash() template function. This instantiation may happen before
2390         FontTaggedSettings::hash() is actually fully specialized in FontTaggedSettings.cpp. To avoid
2391         compiler errors when FontCache.h and FontTaggedSettings.cpp are in the same translation unit,
2392         we declare full specialization of the hash() functions in FontTaggedSettings.h.
2393
2394         No new tests, behavior unchanged.
2395
2396         * platform/graphics/FontCache.h: Explicitly include FontTaggedSettings to avoid possible future breakage.
2397         * platform/graphics/FontTaggedSettings.h: Declare full specialization of FontTaggedSettings::hash().
2398
2399 2018-09-14  Ryan Haddad  <ryanhaddad@apple.com>
2400
2401         Unreviewed, rolling out r235990.
2402
2403         Introduced TestWebKitAPI.NowPlayingTest timeouts on iOS
2404
2405         Reverted changeset:
2406
2407         "Enable USE_MEDIAREMOTE on iOS"
2408         https://bugs.webkit.org/show_bug.cgi?id=189096
2409         https://trac.webkit.org/changeset/235990
2410
2411 2018-09-14  Jer Noble  <jer.noble@apple.com>
2412
2413         Turn SourceBufferChangeTypeEnabled on by default
2414         https://bugs.webkit.org/show_bug.cgi?id=189527
2415
2416         Reviewed by Eric Carlson.
2417
2418         * page/Settings.yaml:
2419
2420 2018-09-14  Devin Rousso  <webkit@devinrousso.com>
2421
2422         Web Inspector: Record actions performed on ImageBitmapRenderingContext
2423         https://bugs.webkit.org/show_bug.cgi?id=181341
2424
2425         Reviewed by Joseph Pecoraro.
2426
2427         Test: inspector/canvas/recording-bitmaprenderer.html
2428
2429         * html/canvas/ImageBitmapRenderingContext.idl:
2430
2431         * inspector/InspectorCanvas.cpp:
2432         (WebCore::shouldSnapshotBitmapRendererAction):
2433         (WebCore::InspectorCanvas::recordAction):
2434
2435         * inspector/agents/InspectorCanvasAgent.cpp:
2436         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2437
2438         * page/PageConsoleClient.cpp:
2439         (canvasRenderingContext):
2440
2441 2018-09-14  David Kilzer  <ddkilzer@apple.com>
2442
2443         REGRESSION (r235954): Fix build failure on watchOS
2444         <https://webkit.org/b/189605>
2445
2446         Reviewed by Geoffrey Garen.
2447
2448         Remove `using WebCore::IndexedDB::KeyType;` from
2449         Source/WebCore/Modules/indexeddb/IDBKey.h and fix all the
2450         resulting build failures.
2451
2452         * Modules/indexeddb/IDBKey.cpp:
2453         (WebCore::IDBKey::IDBKey):
2454         (WebCore::IDBKey::isValid const):
2455         (WebCore::IDBKey::compare const):
2456         * Modules/indexeddb/IDBKey.h:
2457         (WebCore::IDBKey::createNumber):
2458         (WebCore::IDBKey::createDate):
2459         (WebCore::IDBKey::type const):
2460         (WebCore::IDBKey::array const):
2461         (WebCore::IDBKey::string const):
2462         (WebCore::IDBKey::date const):
2463         (WebCore::IDBKey::number const):
2464         (WebCore::IDBKey::binary const):
2465         (WebCore::IDBKey::compareTypes):
2466         (WebCore::IDBKey::IDBKey):
2467         * Modules/indexeddb/IDBKeyData.cpp:
2468         (WebCore::IDBKeyData::IDBKeyData):
2469         (WebCore::IDBKeyData::maybeCreateIDBKey const):
2470         (WebCore::IDBKeyData::isolatedCopy):
2471         (WebCore::IDBKeyData::encode const):
2472         (WebCore::IDBKeyData::decode):
2473         (WebCore::IDBKeyData::compare const):
2474         (WebCore::IDBKeyData::loggingString const):
2475         (WebCore::IDBKeyData::setArrayValue):
2476         (WebCore::IDBKeyData::setBinaryValue):
2477         (WebCore::IDBKeyData::setStringValue):
2478         (WebCore::IDBKeyData::setDateValue):
2479         (WebCore::IDBKeyData::setNumberValue):
2480         (WebCore::IDBKeyData::isValid const):
2481         (WebCore::IDBKeyData::operator== const):
2482         * Modules/indexeddb/IDBKeyData.h:
2483         (WebCore::IDBKeyData::IDBKeyData):
2484         (WebCore::IDBKeyData::minimum):
2485         (WebCore::IDBKeyData::maximum):
2486         (WebCore::IDBKeyData::type const):
2487         (WebCore::IDBKeyData::hash const):
2488         (WebCore::IDBKeyData::string const):
2489         (WebCore::IDBKeyData::date const):
2490         (WebCore::IDBKeyData::number const):
2491         (WebCore::IDBKeyData::binary const):
2492         (WebCore::IDBKeyData::array const):
2493         (WebCore::IDBKeyData::encode const):
2494         (WebCore::IDBKeyData::decode):
2495         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2496         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
2497         * bindings/js/IDBBindingUtilities.cpp:
2498         (WebCore::toJS):
2499
2500 2018-09-14  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2501
2502         [EME] Add support the waitingforkey event
2503         https://bugs.webkit.org/show_bug.cgi?id=189616
2504
2505         Reviewed by Philippe Normand.
2506
2507         Crossplatform support to fire the waitingforkey event from the
2508         player to the element. The element implements the W3C specified
2509         algorithm.
2510
2511         * html/HTMLMediaElement.cpp:
2512         (WebCore::HTMLMediaElement::mediaPlayerWaitingForKey):
2513         (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
2514         * html/HTMLMediaElement.h:
2515         * platform/graphics/MediaPlayer.cpp:
2516         (WebCore::MediaPlayer::waitingForKey):
2517         * platform/graphics/MediaPlayer.h:
2518         (WebCore::MediaPlayerClient::mediaPlayerWaitingForKey):
2519
2520 2018-09-14  Mike Gorse  <mgorse@suse.com>
2521
2522         builtins directory causes name conflict on Python 3
2523         https://bugs.webkit.org/show_bug.cgi?id=189552
2524
2525         Reviewed by Michael Catanzaro.
2526
2527         No new tests (No behavior change).
2528
2529         * CMakeLists.txt: builtins -> wkbuiltins.
2530         * DerivedSources.make: builtins -> wkbuiltins.
2531
2532 2018-09-13  Ryosuke Niwa  <rniwa@webkit.org>
2533
2534         Capturing event listeners are called during bubbling phase for shadow hosts
2535         https://bugs.webkit.org/show_bug.cgi?id=174288
2536         <rdar://problem/33530455>
2537
2538         Reviewed by Darin Adler.
2539
2540         Implemented the new behavior proposed in https://github.com/whatwg/dom/pull/686 [1] to fix the problem
2541         that capturing event listeners on a shadow host is invoked during bubbling phase when an event is
2542         dispatched within its shadow tree.
2543
2544         To see why this is a problem, suppose we fire a composed event at span#target in the following DOM tree:
2545           section#hostParent
2546             + div#host -- ShadowRoot
2547                             - p#parent
2548                                 - span#target
2549         Then capturing and bubbling event listeners on #target, #parent, #host, and #hostParent are invoked in
2550         the following order in WebKit & Chrome right now:
2551
2552         1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
2553         2. #parent, capturing, eventPhase: CAPTURING_PHASE
2554         3. #target, capturing, eventPhase: AT_TARGET
2555         4. #target, non-capturing, eventPhase: AT_TARGET
2556         5. #parent, non-capturing, eventPhase: BUBBLING_PHASE
2557         6. #host, capturing, eventPhase: AT_TARGET
2558         7. #host, non-capturing, eventPhase: AT_TARGET
2559         8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
2560
2561         This is counter-intuitive because capturing event listeners on #host isn't invoked until bubblign phase
2562         started. A more natural ordering would be:
2563
2564         1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
2565         2. #host, capturing, eventPhase: AT_TARGET
2566         3. #parent, capturing, eventPhase: CAPTURING_PHASE
2567         4. #target, capturing, eventPhase: AT_TARGET
2568         5. #target, non-capturing, eventPhase: AT_TARGET
2569         6. #parent, non-capturing, eventPhase: BUBBLING_PHASE
2570         7. #host, non-capturing, eventPhase: AT_TARGET
2571         8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
2572
2573         This also happens to be the order by which Gecko's current shadow DOM implementation invoke event listners.
2574         This patch implements this new behavior using the spec-change proposed in [1]. Note that this patch also
2575         impacts the invocation order of event listeners when there is no shadow tree. Namely, before this patch,
2576         event listeners on the event's target is invoked in the registration order. After this patch, all capturing
2577         event listeners are invoked before bubbling event listeners are invoked.
2578
2579         To implement this behavior, this patch introduces EventTarget::EventInvokePhase indicating whether we're
2580         in the capturing phase or bubbling phase to EventTarget::fireEventListeners. We can't use Event's eventPhase
2581         enum because that's set to Event::Phase::AT_TARGET when we're at a shadow host.
2582
2583         Test: fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees.html
2584
2585         * Modules/modern-media-controls/media/media-controller-support.js:
2586         (MediaControllerSupport.prototype.enable): Use capturing event listeners so that we can update the states of
2587         media controls before author scripts recieve the event.
2588         (MediaControllerSupport.prototype.disable): Ditto.
2589         * dom/EventContext.cpp:
2590         (WebCore::EventContext::handleLocalEvents const):
2591         (WebCore::MouseOrFocusEventContext::handleLocalEvents const):
2592         (WebCore::TouchEventContext::handleLocalEvents const):
2593         * dom/EventContext.h:
2594         * dom/EventDispatcher.cpp:
2595         (WebCore::dispatchEventInDOM): Invoke capturing event listners even when target and current target are same.
2596         This happens when the current target is a shadow host and event's target is in its shadow tree. Also merged
2597         the special code path for the event's target with the code in the bubbling phase.
2598         * dom/EventPath.cpp:
2599         (WebCore::WindowEventContext::handleLocalEvents const):
2600         * dom/EventTarget.cpp:
2601         (WebCore::EventTarget::dispatchEvent): Invoke capturing and bubbling event listeners in the order.
2602         (WebCore::EventTarget::fireEventListeners):
2603         (WebCore::EventTarget::innerInvokeEventListeners): Renamed from fireEventListeners to match the spec. Use
2604         EventInvokePhase to filter out event listeners so that we can invoke capturing event listners before bubbling
2605         event listeners even when eventPhase is Event::Phase::AT_TARGET.
2606         * dom/EventTarget.h:
2607         * dom/Node.cpp:
2608         (WebCore::Node::handleLocalEvents):
2609         * dom/Node.h:
2610         * html/HTMLFormElement.cpp:
2611         (WebCore::HTMLFormElement::handleLocalEvents):
2612         * html/HTMLFormElement.h:
2613         * page/DOMWindow.cpp:
2614         (WebCore::DOMWindow::dispatchEvent):
2615
2616 2018-09-13  Megan Gardner  <megan_gardner@apple.com>
2617
2618         Fix color stop blending in conic gradients for stops past 1
2619         https://bugs.webkit.org/show_bug.cgi?id=189532
2620         <rdar://problem/44158221>
2621
2622         Reviewed by Simon Fraser.
2623
2624         Calculation was wrong, fixed it, and wrote a test that failed
2625         without the change, and passes with it.
2626
2627         Test: fast/gradients/conic-repeating-last-stop.html
2628
2629         * css/CSSGradientValue.cpp:
2630         (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
2631
2632 2018-09-13  Chris Dumez  <cdumez@apple.com>
2633
2634         Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
2635         https://bugs.webkit.org/show_bug.cgi?id=189590
2636         <rdar://problem/44422725>
2637
2638         Reviewed by Geoffrey Garen.
2639
2640         Set a flag on the navigation action to indicate if the page was opened via window.open() without 'noopener'.
2641
2642         Test: http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html
2643
2644         * loader/FrameLoader.cpp:
2645         (WebCore::FrameLoader::loadURL):
2646         * loader/NavigationAction.h:
2647         (WebCore::NavigationAction::openedViaWindowOpenWithOpener const):
2648         (WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener):
2649         * page/DOMWindow.cpp:
2650         (WebCore::DOMWindow::createWindow):
2651         * page/Page.h:
2652         (WebCore::Page::openedViaWindowOpenWithOpener const):
2653         (WebCore::Page::setOpenedViaWindowOpenWithOpener):
2654
2655 2018-09-13  Jer Noble  <jer.noble@apple.com>
2656
2657         Enable USE_MEDIAREMOTE on iOS
2658         https://bugs.webkit.org/show_bug.cgi?id=189096
2659
2660         Reviewed by Eric Carlson.
2661
2662         Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
2663         Now Playing implementation on iOS and Mac.
2664
2665         * SourcesCocoa.txt:
2666         * WebCore.xcodeproj/project.pbxproj:
2667         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
2668         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
2669         * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
2670         (PlatformMediaSessionManager::sharedManager):
2671         (PlatformMediaSessionManager::sharedManagerIfExists):
2672         (MediaSessionManagerCocoa::updateSessionState):
2673         (MediaSessionManagerCocoa::beginInterruption):
2674         (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
2675         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
2676         (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
2677         (MediaSessionManagerCocoa::removeSession):
2678         (MediaSessionManagerCocoa::sessionWillEndPlayback):
2679         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
2680         (MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
2681         (MediaSessionManagerCocoa::nowPlayingEligibleSession):
2682         (MediaSessionManagerCocoa::updateNowPlayingInfo):
2683         * platform/audio/ios/MediaSessionManagerIOS.h:
2684         (): Deleted.
2685         * platform/audio/ios/MediaSessionManagerIOS.mm:
2686         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
2687         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
2688         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
2689         (WebCore::MediaSessionManageriOS::removeSession): Deleted.
2690         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
2691         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
2692         * platform/audio/mac/MediaSessionManagerMac.h: Removed.
2693
2694 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
2695
2696         Remove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC
2697         https://bugs.webkit.org/show_bug.cgi?id=189576
2698
2699         Reviewed by Alex Christensen.
2700
2701         Old MSVC can't compile "friend class LazyNeverDestroyed<X>"
2702         statements, but "friend LazyNeverDestroyed<X>".
2703
2704         No new tests (No behavior change).
2705
2706         * css/CSSInheritedValue.h: Removed the code for COMPILER(MSVC).
2707         Removed 'class' keyword in "friend class LazyNeverDestroyed<X>"
2708         statement.
2709         * css/CSSInitialValue.h: Ditto.
2710         * css/CSSPrimitiveValue.h: Ditto.
2711         * css/CSSRevertValue.h: Ditto.
2712         * css/CSSUnsetValue.h: Ditto.
2713
2714 2018-09-13  Ms2ger  <Ms2ger@igalia.com>
2715
2716         [GLib] Fix format string in KeyedEncoderGlib::beginObject().
2717         https://bugs.webkit.org/show_bug.cgi?id=189585
2718
2719         Reviewed by Michael Catanzaro.
2720
2721         This appears to fix the following assertion locally:
2722
2723         GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed
2724
2725         Covered by existing tests.
2726
2727         * platform/glib/KeyedEncoderGlib.cpp:
2728         (WebCore::KeyedEncoderGlib::beginObject):
2729
2730 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
2731
2732         Unreviewed, rolling out r235953.
2733
2734         Caused layout test crashes under GuardMalloc.
2735
2736         Reverted changeset:
2737
2738         "Make GraphicsLayers ref-counted, so their tree can persist
2739         when disconnected from RenderLayerBackings"
2740         https://bugs.webkit.org/show_bug.cgi?id=189521
2741         https://trac.webkit.org/changeset/235953
2742
2743 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
2744
2745         Remove a MSVC workaround in XPath::Step::NodeTest
2746         https://bugs.webkit.org/show_bug.cgi?id=189578
2747
2748         Reviewed by Alex Christensen.
2749
2750         XPath::Step::NodeTest has a special code for MSVC bug workaround.
2751         It has been introduced in 5 years ago in Bug 121082 Comment 19.
2752
2753         I think it is safe just to remove the workaround.
2754
2755         No new tests (No behavior change).
2756
2757         * xml/XPathStep.h: Removed the MSVC workaround.
2758
2759 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
2760
2761         Remove a MSVC workaround in InspectorStyle::styleWithProperties
2762         https://bugs.webkit.org/show_bug.cgi?id=189577
2763
2764         Reviewed by Alex Christensen.
2765
2766         No new tests (No behavior change).
2767
2768         * inspector/InspectorStyleSheet.cpp:
2769         (WebCore::InspectorStyle::styleWithProperties const): Use 'auto' for the type of 'status'.
2770
2771 2018-09-13  Alex Christensen  <achristensen@webkit.org>
2772
2773         Use a Variant instead of a union in CSSSelector
2774         https://bugs.webkit.org/show_bug.cgi?id=188559
2775
2776         Reviewed by Antti Koivisto.
2777
2778         No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
2779
2780         I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
2781         I only have m_isForPage when assertions are enabled because it's only used for an assertion.
2782         The rest is pretty straightforward translating union syntax to Variant syntax.
2783         I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
2784
2785         * css/CSSSelector.cpp:
2786         (WebCore::CSSSelector::CSSSelector):
2787         (WebCore::CSSSelector::createRareData):
2788         (WebCore::CSSSelector::setAttribute):
2789         (WebCore::CSSSelector::setArgument):
2790         (WebCore::CSSSelector::setLangArgumentList):
2791         (WebCore::CSSSelector::setSelectorList):
2792         (WebCore::CSSSelector::setNth):
2793         (WebCore::CSSSelector::matchNth const):
2794         (WebCore::CSSSelector::nthA const):
2795         (WebCore::CSSSelector::nthB const):
2796         (WebCore::CSSSelector::RareData::RareData):
2797         * css/CSSSelector.h:
2798         (WebCore::CSSSelector::argument const):
2799         (WebCore::CSSSelector::langArgumentList const):
2800         (WebCore::CSSSelector::selectorList const):
2801         (WebCore::CSSSelector::attribute const):
2802         (WebCore::CSSSelector::attributeCanonicalLocalName const):
2803         (WebCore::CSSSelector::setValue):
2804         (WebCore::CSSSelector::CSSSelector):
2805         (WebCore::CSSSelector::~CSSSelector):
2806         (WebCore::CSSSelector::tagQName const):
2807         (WebCore::CSSSelector::tagLowercaseLocalName const):
2808         (WebCore::CSSSelector::value const):
2809         (WebCore::CSSSelector::serializingValue const):
2810         (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
2811         (WebCore::CSSSelector::RareData::create): Deleted.
2812         * css/parser/CSSParserImpl.cpp:
2813         (WebCore::CSSParserImpl::parsePageSelector):
2814         * css/parser/CSSParserSelector.h:
2815
2816 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
2817
2818         [Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initializer list in WheelEventWin.cpp
2819         https://bugs.webkit.org/show_bug.cgi?id=189575
2820
2821         Reviewed by Alex Christensen.
2822
2823         No new tests (No behavior change).
2824
2825         * platform/win/WheelEventWin.cpp:
2826         (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use flooredIntPoint to convert FloatPoint to POINT.
2827
2828 2018-09-13  Youenn Fablet  <youenn@apple.com>
2829
2830         Introduce RTCRtpSendParameters
2831         https://bugs.webkit.org/show_bug.cgi?id=189563
2832
2833         Reviewed by Eric Carlson.
2834
2835         Introduce RTCRtpSendParameters to match the WebRTC specification.
2836         Split RTCRtpPrameters fields accordingly and update call sites.
2837
2838         Covered by updated test.
2839
2840         * CMakeLists.txt:
2841         * DerivedSources.make:
2842         * Modules/mediastream/PeerConnectionBackend.h:
2843         * Modules/mediastream/RTCRtpCodingParameters.h: Added
2844         * Modules/mediastream/RTCRtpCodingParameters.idl: Added
2845         * Modules/mediastream/RTCRtpDecodingParameters.h: Added
2846         * Modules/mediastream/RTCRtpDecodingParameters.idl: Added
2847         * Modules/mediastream/RTCRtpEncodingParameters.h:
2848         * Modules/mediastream/RTCRtpEncodingParameters.idl:
2849         * Modules/mediastream/RTCRtpParameters.h:
2850         * Modules/mediastream/RTCRtpParameters.idl:
2851         * Modules/mediastream/RTCRtpReceiver.cpp:
2852         * Modules/mediastream/RTCRtpSendParameters.h: Added.
2853         (WebCore::RTCRtpSendParameters::RTCRtpSendParameters):
2854         * Modules/mediastream/RTCRtpSendParameters.idl: Added.
2855         * Modules/mediastream/RTCRtpSender.cpp:
2856         (WebCore::RTCRtpSender::getParameters):
2857         (WebCore::RTCRtpSender::setParameters):
2858         * Modules/mediastream/RTCRtpSender.h:
2859         * Modules/mediastream/RTCRtpSender.idl:
2860         * Modules/mediastream/RTCRtpSenderBackend.h:
2861         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
2862         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
2863         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
2864         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
2865         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
2866         (WebCore::toRTCRtpParameters):
2867         (WebCore::toRTCRtpSendParameters):
2868         (WebCore::fromRTCRtpSendParameters):
2869         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
2870         * Sources.txt:
2871         * WebCore.xcodeproj/project.pbxproj:
2872
2873 2018-09-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2874
2875         [GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
2876         https://bugs.webkit.org/show_bug.cgi?id=189547
2877
2878         Reviewed by Philippe Normand.
2879
2880         decrypt-key-needed message renamed to drm-cdm-instance-needed.
2881
2882         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2883         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Apart from
2884         renaming the message, removed the class prefix for
2885         dispatchCDMInstance.
2886         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2887         (webkitMediaCommonEncryptionDecryptTransformInPlace):
2888
2889 2018-09-11  Ryosuke Niwa  <rniwa@webkit.org>
2890
2891         imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
2892         https://bugs.webkit.org/show_bug.cgi?id=189493
2893
2894         Reviewed by Alex Christensen.
2895
2896         The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
2897         by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
2898         When a form (or any other) element has more than one ref inside removeDetachedChildren,
2899         addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.
2900
2901         However, when a form associated element of this form element appears later in the tree order,
2902         FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.
2903
2904         Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
2905         operations happening in this function so this should be safe.
2906
2907         Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html
2908
2909         * html/FormAssociatedElement.cpp:
2910         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.
2911
2912 2018-09-12  Dan Bernstein  <mitz@apple.com>
2913
2914         [Cocoa] Complete support for Paste as Quotation
2915         https://bugs.webkit.org/show_bug.cgi?id=189504
2916
2917         Reviewed by Wenson Hsieh.
2918
2919         Tests: editing/pasteboard/4930986-1-paste-as-quotation.html
2920                editing/pasteboard/4930986-2-paste-as-quotation.html
2921                editing/pasteboard/4930986-3-paste-as-quotation.html
2922
2923         * editing/Editor.cpp:
2924           Added ClipboardEventKind::PasteAsQuotation.
2925         (WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name.
2926         (WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event.
2927           This means that currently event handlers can’t emulate pasting as quotation, because they
2928           neither have the quoted content nor knowledge that quoting has been requested. We could
2929           change this in the future if needed.
2930         (WebCore::Editor::paste): Updated for change in pasteWithPasteboard’s argument type.
2931         (WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes
2932           PasteOption::AsQuotation to pasteWithPasteboard.
2933         (WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing
2934           the fragment in a blockquote element with the "type" attribute set to "cite" and the
2935           "class" attribute set to a well-known value, which is used to trigger special behavior in
2936           ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end,
2937           so eventually, we could stop using this form of in-band signaling.
2938         * editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText
2939           and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation
2940           behavior.
2941
2942         * editing/EditorCommand.cpp:
2943         (WebCore::executePasteAsQuotation): Added. Similar to executing Paste.
2944         (WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry.
2945
2946         * editing/cocoa/EditorCocoa.mm:
2947         (WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to
2948           here.
2949
2950         * editing/gtk/EditorGtk.cpp:
2951         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
2952           quote the fragment if needed.
2953
2954         * editing/ios/EditorIOS.mm:
2955         (WebCore::Editor::pasteWithPasteboard): Ditto.
2956         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
2957
2958         * editing/mac/EditorMac.mm:
2959         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
2960           quote the fragment if needed.
2961         (WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to
2962           pasteWithPasteboard.
2963         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
2964
2965         * editing/win/EditorWin.cpp:
2966         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
2967           quote the fragment if needed.
2968
2969         * editing/wpe/EditorWPE.cpp:
2970         (WebCore::Editor::pasteWithPasteboard): Ditto.
2971
2972 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
2973
2974         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
2975         https://bugs.webkit.org/show_bug.cgi?id=189521
2976
2977         Reviewed by Tim Horton.
2978         
2979         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
2980         
2981         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
2982         
2983         All the other changes are just to adapt to the new ownership patterns.
2984         
2985         I verified that no GraphicsLayers were leaked or abandoned after this change.
2986
2987         No behavior change.
2988
2989         * page/PageOverlayController.cpp:
2990         (WebCore::PageOverlayController::layerWithDocumentOverlays):
2991         (WebCore::PageOverlayController::layerWithViewOverlays):
2992         (WebCore::PageOverlayController::installPageOverlay):
2993         (WebCore::PageOverlayController::uninstallPageOverlay):
2994         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
2995         (WebCore::PageOverlayController::didChangeViewSize):
2996         (WebCore::PageOverlayController::didChangeDocumentSize):
2997         (WebCore::PageOverlayController::didChangeSettings):
2998         (WebCore::PageOverlayController::paintContents):
2999         (WebCore::PageOverlayController::didChangeOverlayFrame):
3000         (WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
3001         * page/PageOverlayController.h:
3002         * page/mac/ServicesOverlayController.h:
3003         (WebCore::ServicesOverlayController::Highlight::layer const):
3004         * page/mac/ServicesOverlayController.mm:
3005         (WebCore::ServicesOverlayController::Highlight::Highlight):
3006         (WebCore::ServicesOverlayController::Highlight::invalidate):
3007         (WebCore::ServicesOverlayController::Highlight::fadeIn):
3008         (WebCore::ServicesOverlayController::Highlight::fadeOut):
3009         (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
3010         (WebCore::ServicesOverlayController::determineActiveHighlight):
3011         * platform/graphics/GraphicsLayer.cpp:
3012         (WebCore::GraphicsLayer::GraphicsLayer):
3013         (WebCore::GraphicsLayer::willBeDestroyed):
3014         (WebCore::GraphicsLayer::setChildren):
3015         (WebCore::GraphicsLayer::addChild):
3016         (WebCore::GraphicsLayer::addChildAtIndex):
3017         (WebCore::GraphicsLayer::addChildBelow):
3018         (WebCore::GraphicsLayer::addChildAbove):
3019         (WebCore::GraphicsLayer::replaceChild):
3020         (WebCore::GraphicsLayer::removeAllChildren):
3021         (WebCore::GraphicsLayer::removeFromParent):
3022         (WebCore::GraphicsLayer::setMaskLayer):
3023         (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
3024         (WebCore::GraphicsLayer::distributeOpacity):
3025         (WebCore::GraphicsLayer::traverse):
3026         (WebCore::dumpChildren):
3027         * platform/graphics/GraphicsLayer.h:
3028         (WebCore::GraphicsLayer::children const):
3029         (WebCore::GraphicsLayer::children):
3030         (WebCore::GraphicsLayer::maskLayer const):
3031         (WebCore::GraphicsLayer::replicaLayer const):
3032         (WebCore::GraphicsLayer::beingDestroyed const):
3033         (WebCore::GraphicsLayer:: const): Deleted.
3034         * platform/graphics/GraphicsLayerFactory.h:
3035         * platform/graphics/ca/GraphicsLayerCA.cpp:
3036         (WebCore::GraphicsLayer::create):
3037         (WebCore::GraphicsLayerCA::setChildren):
3038         (WebCore::GraphicsLayerCA::addChild):
3039         (WebCore::GraphicsLayerCA::addChildAtIndex):
3040         (WebCore::GraphicsLayerCA::addChildBelow):
3041         (WebCore::GraphicsLayerCA::addChildAbove):
3042         (WebCore::GraphicsLayerCA::replaceChild):
3043         (WebCore::GraphicsLayerCA::setMaskLayer):
3044         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
3045         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3046         (WebCore::GraphicsLayerCA::updateSublayerList):
3047         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
3048         * platform/graphics/ca/GraphicsLayerCA.h:
3049         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3050         (WebCore::GraphicsLayer::create):
3051         (WebCore::GraphicsLayerTextureMapper::setChildren):
3052         (WebCore::GraphicsLayerTextureMapper::addChild):
3053         (WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
3054         (WebCore::GraphicsLayerTextureMapper::addChildAbove):
3055         (WebCore::GraphicsLayerTextureMapper::addChildBelow):
3056         (WebCore::GraphicsLayerTextureMapper::replaceChild):
3057         (WebCore::GraphicsLayerTextureMapper::setMaskLayer):
3058         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
3059         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3060         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3061         (WebCore::GraphicsLayer::create):
3062         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
3063         (WebCore::CoordinatedGraphicsLayer::addChild):
3064         (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
3065         (WebCore::CoordinatedGraphicsLayer::addChildAbove):
3066         (WebCore::CoordinatedGraphicsLayer::addChildBelow):
3067         (WebCore::CoordinatedGraphicsLayer::replaceChild):
3068         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
3069         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
3070         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
3071         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
3072         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3073         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
3074         (WebCore::GraphicsLayer::create):
3075         (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
3076         (WebCore::GraphicsLayerDirect2D::initialize): Deleted.
3077         (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
3078         (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
3079         (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
3080         * rendering/RenderLayerBacking.cpp:
3081         (WebCore::RenderLayerBacking::createGraphicsLayer):
3082         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
3083         (WebCore::RenderLayerBacking::updateConfiguration):
3084         (WebCore::RenderLayerBacking::updateInternalHierarchy):
3085         (WebCore::RenderLayerBacking::updateMaskingLayer):
3086         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
3087         (WebCore::RenderLayerBacking::updateScrollingLayers):
3088         * rendering/RenderLayerBacking.h:
3089         * rendering/RenderLayerCompositor.cpp:
3090         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3091         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
3092         (WebCore::RenderLayerCompositor::setCompositingParent):
3093         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
3094         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
3095         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
3096         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
3097         (WebCore::RenderLayerCompositor::updateLayerForHeader):
3098         (WebCore::RenderLayerCompositor::updateLayerForFooter):
3099         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
3100         (WebCore::RenderLayerCompositor::ensureRootLayer):
3101         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
3102         * rendering/RenderLayerCompositor.h:
3103
3104 2018-09-12  Alex Christensen  <achristensen@webkit.org>
3105
3106         Expose fewer of URL's internal members
3107         https://bugs.webkit.org/show_bug.cgi?id=189528
3108
3109         Reviewed by Chris Dumez.
3110
3111         * loader/appcache/ApplicationCacheStorage.cpp:
3112         (WebCore::urlHostHash):
3113         * platform/URL.cpp:
3114         (WebCore::URL::hostStart const):
3115         (WebCore::protocolHostAndPortAreEqual):
3116         (WebCore::hostsAreEqual):
3117         * platform/URL.h:
3118         (WebCore::URL::hostStart const): Deleted.
3119         (WebCore::URL::hostEnd const): Deleted.
3120
3121 2018-09-12  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3122
3123         [Curl] Implement correct total received bytes.
3124         https://bugs.webkit.org/show_bug.cgi?id=189555
3125
3126         Reviewed by Alex Christensen.
3127
3128         Curl port only reported total network received bytes before decoding.
3129
3130         No new test. InspectorTest is only available for WebKitTestRunner.
3131
3132         * platform/network/curl/CurlRequest.cpp:
3133         (WebCore::CurlRequest::didReceiveData):
3134         (WebCore::CurlRequest::updateNetworkLoadMetrics):
3135         * platform/network/curl/CurlRequest.h:
3136
3137 2018-09-12  Youenn Fablet  <youenn@apple.com>
3138
3139         Split RTCRtpParameters idl and header file
3140         https://bugs.webkit.org/show_bug.cgi?id=189524
3141
3142         Reviewed by Eric Carlson.
3143
3144         This will be easier to manage and will allow to more easily introduce sender/receiver parameters.
3145         No change of behavior.
3146
3147         * CMakeLists.txt:
3148         * DerivedSources.make:
3149         * Modules/mediastream/RTCDegradationPreference.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
3150         * Modules/mediastream/RTCDegradationPreference.idl: Added.
3151         * Modules/mediastream/RTCDtxStatus.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
3152         * Modules/mediastream/RTCDtxStatus.idl: Added.
3153         * Modules/mediastream/RTCPriorityType.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
3154         * Modules/mediastream/RTCPriorityType.idl: Added.
3155         * Modules/mediastream/RTCRtpCodecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
3156         * Modules/mediastream/RTCRtpCodecParameters.idl: Added.
3157         * Modules/mediastream/RTCRtpEncodingParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
3158         * Modules/mediastream/RTCRtpEncodingParameters.idl: Added.
3159         * Modules/mediastream/RTCRtpFecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
3160         * Modules/mediastream/RTCRtpFecParameters.idl: Added.
3161         * Modules/mediastream/RTCRtpHeaderExtensionParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
3162         * Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: Added.
3163         * Modules/mediastream/RTCRtpParameters.h:
3164         * Modules/mediastream/RTCRtpParameters.idl:
3165         * Modules/mediastream/RTCRtpRtxParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
3166         * Modules/mediastream/RTCRtpRtxParameters.idl: Added.
3167         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
3168         (WebCore::toRTCEncodingParameters):
3169         (WebCore::fromRTCEncodingParameters):
3170         (WebCore::toRTCHeaderExtensionParameters):
3171         (WebCore::fromRTCHeaderExtensionParameters):
3172         (WebCore::toRTCCodecParameters):
3173         (WebCore::toRTCRtpParameters):
3174         (WebCore::fromRTCRtpParameters):
3175         * Sources.txt:
3176         * WebCore.xcodeproj/project.pbxproj:
3177
3178 2018-09-12  Ali Juma  <ajuma@chromium.org>
3179
3180         [IntersectionObserver] Implement rootMargin expansion
3181         https://bugs.webkit.org/show_bug.cgi?id=189525
3182
3183         Reviewed by Simon Fraser.
3184
3185         Expand the root intersection rectangle by the observer's rootMargin when computing
3186         intersections.
3187
3188         Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html
3189
3190         * dom/Document.cpp:
3191         (WebCore::expandRootBoundsWithRootMargin):
3192         (WebCore::computeIntersectionRects):
3193         * page/IntersectionObserver.h:
3194         (WebCore::IntersectionObserver::rootMarginBox const):
3195         * platform/graphics/FloatRect.h:
3196         (WebCore::FloatRect::expand):
3197
3198 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
3199
3200         [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
3201         https://bugs.webkit.org/show_bug.cgi?id=189542
3202
3203         Reviewed by Alex Christensen.
3204
3205         No new tests (No behavior change).
3206
3207         * platform/graphics/win/IntPointWin.cpp:
3208         (WebCore::IntPoint::operator POINTS const): Narrowed m_x and m_y by using static_cast.
3209
3210 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
3211
3212         Add IGNORE_WARNING_.* macros
3213         https://bugs.webkit.org/show_bug.cgi?id=188996
3214
3215         Reviewed by Michael Catanzaro.
3216
3217         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
3218         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3219         * accessibility/mac/AXObjectCacheMac.mm:
3220         (WebCore::AXObjectCache::postPlatformNotification):
3221         * accessibility/mac/AccessibilityObjectMac.mm:
3222         (WebCore::AccessibilityObject::overrideAttachmentParent):
3223         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
3224         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3225         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
3226         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
3227         (-[WebAccessibilityObjectWrapper role]):
3228         (-[WebAccessibilityObjectWrapper roleDescription]):
3229         * bridge/objc/WebScriptObject.mm:
3230         * bridge/objc/objc_class.mm:
3231         (JSC::Bindings::ObjcClass::fieldNamed const):
3232         * crypto/CommonCryptoUtilities.cpp:
3233         (WebCore::getCommonCryptoDigestAlgorithm):
3234         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
3235         (WebCore::encryptAES_GCM):
3236         (WebCore::decyptAES_GCM):
3237         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3238         (WebCore::wrapSerializedCryptoKey):
3239         (WebCore::unwrapSerializedCryptoKey):
3240         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
3241         * css/makeSelectorPseudoElementsMap.py:
3242         * editing/TextIterator.cpp:
3243         * editing/mac/EditorMac.mm:
3244         (WebCore::Editor::pasteWithPasteboard):
3245         (WebCore::Editor::takeFindStringFromSelection):
3246         (WebCore::Editor::replaceNodeFromPasteboard):
3247         * page/mac/EventHandlerMac.mm:
3248         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
3249         * page/mac/ServicesOverlayController.mm:
3250         (WebCore::ServicesOverlayController::Highlight::paintContents):
3251         * platform/LocalizedStrings.cpp:
3252         (WebCore::formatLocalizedString):
3253         * platform/ScreenProperties.h:
3254         (WebCore::ScreenData::decode):
3255         * platform/gamepad/mac/HIDGamepadProvider.cpp:
3256         (WebCore::HIDGamepadProvider::stopMonitoringInput):
3257         * platform/graphics/PlatformDisplay.cpp:
3258         (WebCore::PlatformDisplay::sharedDisplay):
3259         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
3260         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3261         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
3262         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3263         (WebCore::CDMSessionAVStreamSession::update):
3264         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3265         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3266         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
3267         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
3268         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
3269         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3270         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3271         (WebCore::IGNORE_CLANG_WARNING_END):
3272         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3273         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3274         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
3275         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
3276         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
3277         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
3278         (WebCore::IGNORE_CLANG_WARNING_END):
3279         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3280         (PlatformCALayer::drawLayerContents):
3281         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3282         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
3283         * platform/graphics/cg/ImageDecoderCG.cpp:
3284         (WebCore::ImageDecoderCG::createFrameImageAtIndex):
3285         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
3286         (WebCore::GraphicsContext::drawLineForDocumentMarker):
3287         * platform/graphics/cocoa/WebGLLayer.h:
3288         (IGNORE_CLANG_WARNING):
3289         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3290         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3291         * platform/graphics/mac/IconMac.mm:
3292         (WebCore::Icon::Icon):
3293         * platform/graphics/mac/PDFDocumentImageMac.mm:
3294         (WebCore::PDFDocumentImage::drawPDFPage):
3295         * platform/graphics/mac/WebKitNSImageExtras.mm:
3296         (-[NSImage _web_lockFocusWithDeviceScaleFactor:]):
3297         * platform/ios/DragImageIOS.mm:
3298         * platform/mac/DragImageMac.mm:
3299         (WebCore::scaleDragImage):
3300         (WebCore::createDragImageForLink):
3301         * platform/mac/LegacyNSPasteboardTypes.h:
3302         * platform/mac/LocalCurrentGraphicsContext.mm:
3303         (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
3304         * platform/mac/PasteboardMac.mm:
3305         (WebCore::Pasteboard::createForCopyAndPaste):
3306         (WebCore::Pasteboard::createForDragAndDrop):
3307         (WebCore::setDragImageImpl):
3308         * platform/mac/PlatformEventFactoryMac.mm:
3309         (WebCore::globalPoint):
3310         * platform/mac/SSLKeyGeneratorMac.mm:
3311         * platform/mac/ScrollViewMac.mm:
3312         (WebCore::ScrollView::platformContentsToScreen const):
3313         (WebCore::ScrollView::platformScreenToContents const):
3314         * platform/mac/ThemeMac.mm:
3315         (WebCore::drawCellFocusRingWithFrameAtTime):
3316         * platform/mac/WebPlaybackControlsManager.mm:
3317         * platform/mac/WidgetMac.mm:
3318         (WebCore::Widget::paint):
3319         * platform/mediastream/RealtimeIncomingAudioSource.h:
3320         * platform/mediastream/RealtimeIncomingVideoSource.h:
3321         * platform/mediastream/RealtimeOutgoingAudioSource.h:
3322         * platform/mediastream/RealtimeOutgoingVideoSource.h:
3323         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
3324         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3325         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3326         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
3327         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
3328         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3329         * platform/network/cf/ResourceHandleCFNet.cpp:
3330         (WebCore::ResourceHandle::createCFURLConnection):
3331         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3332         (WebCore::SocketStreamHandleImpl::reportErrorToClient):
3333         * platform/network/create-http-header-name-table:
3334         * platform/text/TextEncoding.cpp:
3335         * testing/MockLibWebRTCPeerConnection.h:
3336         * xml/XPathGrammar.cpp:
3337
3338 2018-09-12  Pablo Saavedra  <psaavedra@igalia.com>
3339
3340         Linking against libWPEWebKit-0.1.so is not posible when WPE is build with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF
3341         https://bugs.webkit.org/show_bug.cgi?id=189540
3342
3343         Reviewed by Philippe Normand.
3344
3345         Related issues:
3346
3347         This issue is related with changes in https://bugs.webkit.org/show_bug.cgi?id=183080
3348         This issue is introduced in https://bugs.webkit.org/show_bug.cgi?id=186547
3349
3350         No new tests, no changes in the functionality.
3351
3352         * platform/GStreamer.cmake:
3353         * platform/SourcesGLib.txt:
3354         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
3355         (WebCore::LibWebRTCProvider::webRTCAvailable):
3356
3357 2018-09-11  Zan Dobersek  <zdobersek@igalia.com>
3358
3359         Unreviewed WPE build fix.
3360
3361         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
3362         Add extra header inclusions to get this code building after the unified
3363         sources system shifted it into a different translation unit.
3364
3365 2018-09-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3366
3367         [Curl] WebInspector doesn't display request headers added during processing.
3368         https://bugs.webkit.org/show_bug.cgi?id=189531
3369
3370         Reviewed by Alex Christensen.
3371
3372         While processing the request, Curl port network layer adds some headers to the request
3373         such as cookies. Those headers should be displayed in the WebInspector.
3374
3375         Tested on MiniBrowser.
3376
3377         * platform/network/curl/CurlRequest.cpp:
3378         (WebCore::CurlRequest::didReceiveHeader):
3379         (WebCore::CurlRequest::didCompleteTransfer):
3380         (WebCore::CurlRequest::updateNetworkLoadMetrics):
3381         * platform/network/curl/CurlRequest.h:
3382
3383 2018-09-11  James Savage  <james.savage@apple.com>
3384
3385         Follow up to:
3386         Expose -apple-system-container-border color to internal web views.
3387         https://bugs.webkit.org/show_bug.cgi?id=189178.
3388
3389         Reviewed by Timothy Hatcher.
3390
3391         * rendering/RenderThemeMac.mm:
3392         (WebCore::RenderThemeMac::systemColor const): Add a separate #if block for
3393         Mojave. When I used CSSValueAppleSystemFindHighlightBackground as a template
3394         for this change, I had to write out the condition in the first change, but
3395         mistakenly thought I could reuse the block here. Turns out the versions were
3396         different, and I could not.
3397
3398 2018-09-11  Youenn Fablet  <youenn@apple.com>
3399
3400         Remove MediaDevices NoInterfaceObject
3401         https://bugs.webkit.org/show_bug.cgi?id=189512
3402
3403         Reviewed by Alex Christensen.
3404
3405         Covered by rebased WPT tests.
3406
3407         * Modules/mediastream/MediaDevices.idl:
3408
3409 2018-09-11  Jer Noble  <jer.noble@apple.com>
3410