c07afc50d4a47a8c55fa72591c272814162a48d9
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-05  Ryan Haddad  <ryanhaddad@apple.com>
2
3         Unreviewed, rolling out r237785.
4
5         Introduced layout test and API test failures on macOS and iOS.
6
7         Reverted changeset:
8
9         "[iOS] Issue initial paint soon after the visuallyNonEmpty
10         milestone is fired."
11         https://bugs.webkit.org/show_bug.cgi?id=191078
12         https://trac.webkit.org/changeset/237785
13
14 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
15
16         [GStreamer][WebRTC] Error out when simulcast is activated
17         https://bugs.webkit.org/show_bug.cgi?id=190678
18
19         Reviewed by Philippe Normand.
20
21         Implementing it is not for now yet.
22
23         Tests for simulcast have been disabled as they now fail (instead of crashing).
24
25         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
26         (WebCore::GStreamerVideoEncoder::InitEncode):
27
28 2018-11-05  Youenn Fablet  <youenn@apple.com>
29
30         RealtimeOutgoingAudioSource subclasses should observe its source when fully constructed
31         https://bugs.webkit.org/show_bug.cgi?id=191241
32
33         Reviewed by Eric Carlson.
34
35         Moving the logic to observe the audio source to the point where the
36         RealtimeOutgoingAudioSource subclass is fully initialized.
37         Covered by existing tests.
38
39         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
40         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
41         (WebCore::RealtimeOutgoingAudioSource::observeSource):
42         * platform/mediastream/RealtimeOutgoingAudioSource.h:
43         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
44         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::RealtimeOutgoingAudioSourceLibWebRTC):
45         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
46         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
47
48 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
49
50         [GStreamer][WebRTC] Add webrtcencoder bin to cleanup and refactor the way we set encoders
51         https://bugs.webkit.org/show_bug.cgi?id=190674
52
53         Reviewed by Philippe Normand.
54
55         webrtcencoder is a simple GstBin with a set of well known GStreamer encoders which
56         it can use to implement encoding for different formats exposing a trimmed down unified API.
57
58         It also adds proper handling of H264 profiles.
59
60         The added files follow GStreamer coding style as we aim at upstreaming the element
61         in the future.
62
63         This is a refactoring so current tests already cover it.
64
65         * platform/GStreamer.cmake:
66         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
67         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
68         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: Added.
69         (gst_webrtc_video_encoder_get_property):
70         (gst_webrtc_video_encoder_set_bitrate):
71         (gst_webrtc_video_encoder_set_format):
72         (gst_webrtc_video_encoder_set_property):
73         (register_known_encoder):
74         (setup_x264enc):
75         (setup_vp8enc):
76         (setup_openh264enc):
77         (set_bitrate_kbit_per_sec):
78         (set_bitrate_bit_per_sec):
79         (gst_webrtc_video_encoder_class_init):
80         (gst_webrtc_video_encoder_init):
81         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: Added.
82         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
83         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
84         (WebCore::GStreamerVideoEncoder::InitEncode):
85         (WebCore::GStreamerVideoEncoder::createEncoder):
86         (WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
87         (WebCore::GStreamerVideoEncoder::ImplementationName const):
88         (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
89
90 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
91
92         [GStreamer][WebRTC] properly mark H.264 stream type in the "decoder"
93         https://bugs.webkit.org/show_bug.cgi?id=190676
94
95         Reviewed by Philippe Normand.
96
97         Avoiding to have h264parse make assumption (which might be wrong at some
98         point).
99
100         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
101         (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
102
103 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
104
105         [GStreamer] Do not sync libwerbtc stream on the clock
106         https://bugs.webkit.org/show_bug.cgi?id=190677
107
108         The approach here is basically to let libwebrtc do all the
109         synchronisation for us, and the same way as it is done in apple ports,
110         we basically try to display what libwebrtc outputs as fast as possible.
111
112         Reviewed by Philippe Normand.
113
114         Manually tested
115
116         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
117         (WebCore::setSyncOnSink):
118         (WebCore::MediaPlayerPrivateGStreamer::syncOnClock):
119         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
120         (WebCore::MediaPlayerPrivateGStreamer::load):
121         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
122
123 2018-11-05  Ali Juma  <ajuma@chromium.org>
124
125         [IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
126         https://bugs.webkit.org/show_bug.cgi?id=191210
127
128         Reviewed by Simon Fraser.
129
130         isIntersecting should be false if the intersection ratio is smaller than the
131         smallest threshold value. Update the computation of isIntersecting to depend on
132         the current thresholdIndex.
133
134         Test: imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.html
135
136         * dom/Document.cpp:
137         (WebCore::Document::updateIntersectionObservations):
138
139 2018-11-05  Rob Buis  <rbuis@igalia.com>
140
141         Remove some virtual methods in CachedRawResource
142         https://bugs.webkit.org/show_bug.cgi?id=191251
143
144         Reviewed by Frédéric Wang.
145
146         Since CachedRawResource is final no need to introduce new virtual
147         methods in CachedRawResource. This patch also removes an outdated
148         comment and forward declaration.
149
150         No new tests since no change in functionality.
151
152         * loader/cache/CachedRawResource.h:
153
154 2018-11-05  Philippe Normand  <pnormand@igalia.com>
155
156         [GStreamer] Move elements registration to GStreamerCommon
157         https://bugs.webkit.org/show_bug.cgi?id=191189
158
159         Reviewed by Xabier Rodriguez-Calvar.
160
161         It was a bit odd to have this in the base player class and to have
162         sub-classes calling a static function of the super-class.
163
164         Covered by existing tests.
165
166         * platform/graphics/gstreamer/GStreamerCommon.cpp:
167         (WebCore::initializeGStreamerAndRegisterWebKitElements):
168         * platform/graphics/gstreamer/GStreamerCommon.h:
169         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
170         (WebCore::MediaPlayerPrivateGStreamer::isAvailable):
171         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
172         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
173         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
174         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
175         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
176         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
177         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
178         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
179         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
180
181 2018-11-04  Rob Buis  <rbuis@igalia.com>
182
183         Remove ENABLE_OPENCL fully
184         https://bugs.webkit.org/show_bug.cgi?id=191172
185
186         Reviewed by Yusuke Suzuki.
187
188         Forgot to simplify this, no need for applyAll anymore
189         since it just calls apply.
190
191         No new tests since no change in functionality.
192
193         * platform/graphics/filters/FilterEffect.h:
194         (WebCore::FilterEffect::applyAll): Deleted.
195         * rendering/svg/RenderSVGResourceFilter.cpp:
196         (WebCore::RenderSVGResourceFilter::postApplyResource):
197
198 2018-11-04  Zalan Bujtas  <zalan@apple.com>
199
200         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
201         https://bugs.webkit.org/show_bug.cgi?id=191078
202         <rdar://problem/45736178>
203
204         Reviewed by Antti Koivisto.
205
206         1. Improve visuallyNonEmpty milestone confidence level.
207             Ignore whitespace and non visible text content.
208             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
209             Check if the html/body is actually visible.
210
211         2. Issue initial paint soon after the milestone fires.
212             Use a 0ms timer to flush the initial paint.
213             Throttle additional flushes for 500ms (remove the non-initial 1.5 throttling)
214
215         3. Suspend optional style recalcs and layouts while painting is being throttled.
216            When parsing yields we initiate a 0ms style recalc/layout timer.
217            These optional layouts produce content that we have no intention to paint. 
218
219         * dom/Document.cpp:
220         (WebCore::Document::scheduleStyleRecalc):
221         (WebCore::Document::shouldScheduleLayout):
222         * page/ChromeClient.h:
223         * page/FrameView.cpp:
224         (WebCore::FrameView::resetLayoutMilestones):
225         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
226         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
227         (WebCore::FrameView::updateIsVisuallyNonEmpty):
228         * page/FrameView.h:
229         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
230         * platform/graphics/FontCascade.h:
231         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
232         (WebCore::RenderText::RenderText):
233
234 2018-11-04  Zalan Bujtas  <zalan@apple.com>
235
236         [LFC][BFC] Add support for percentage height in quirks mode.
237         https://bugs.webkit.org/show_bug.cgi?id=191232
238
239         Reviewed by Antti Koivisto.
240
241         In quirks mode, we go and travers the containing block chain to find a block level
242         box with fixed height value to resolve the percentage value.
243
244         Test: fast/block/basic/quirk-mode-percent-height.html
245
246         * layout/FormattingContextGeometry.cpp:
247         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
248         * layout/Verification.cpp:
249         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
250
251 2018-11-04  Zalan Bujtas  <zalan@apple.com>
252
253         [LFC][BCF] Add support for block level non-replaced inflow height percentage
254         https://bugs.webkit.org/show_bug.cgi?id=191229
255
256         Reviewed by Antti Koivisto.
257
258         Test: fast/block/basic/child-block-level-box-with-height-percent.html
259
260         * layout/FormattingContext.h:
261         * layout/FormattingContextGeometry.cpp:
262         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
263         (WebCore::Layout::computedHeightValue): Deleted.
264         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
265         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
266
267 2018-11-04  Youenn Fablet  <youenn@apple.com>
268
269         RealtimeOutgoingAudioSource should use DestructionThread::Main
270         https://bugs.webkit.org/show_bug.cgi?id=191230
271
272         Reviewed by Eric Carlson.
273
274         Covered by imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html
275         that should no longer crash in debug.
276
277         * platform/mediastream/RealtimeOutgoingAudioSource.h:
278
279 2018-11-04  Youenn Fablet  <youenn@apple.com>
280
281         IDB should allow storing RTCCertificate
282         https://bugs.webkit.org/show_bug.cgi?id=191077
283
284         Reviewed by Chris Dumez.
285
286         Add support for serialization/deserialization of RTCCertificate.
287         Store the origin in RTCCertificate and make sure that a certificate
288         with a different origin cannot be used to create a RTCPeerConnection.
289
290         Test: imported/w3c/web-platform-tests/webrtc/RTCCertificate-postMessage.html
291
292         * Modules/mediastream/PeerConnectionBackend.cpp:
293         (WebCore::PeerConnectionBackend::generateCertificate):
294         * Modules/mediastream/RTCCertificate.cpp:
295         (WebCore::RTCCertificate::create):
296         (WebCore::RTCCertificate::RTCCertificate):
297         * Modules/mediastream/RTCCertificate.h:
298         (WebCore::RTCCertificate::origin const):
299         * Modules/mediastream/RTCPeerConnection.cpp:
300         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
301         * Modules/mediastream/RTCPeerConnection.h:
302         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
303         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
304         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
305         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h:
306         * bindings/js/SerializedScriptValue.cpp:
307         (WebCore::CloneSerializer::dumpIfTerminal):
308         (WebCore::CloneDeserializer::CachedString::takeString):
309         (WebCore::CloneDeserializer::readRTCCertificate):
310         (WebCore::CloneDeserializer::readTerminal):
311
312 2018-11-04  Youenn Fablet  <youenn@apple.com>
313
314         Add support for RTCMuxPolicy
315         https://bugs.webkit.org/show_bug.cgi?id=191188
316
317         Reviewed by Eric Carlson.
318
319         Add support for RTCMuxPolicy dictionary option for both constructor and setConfiguration.
320         Make sure setConfiguration throws if trying to change this policy.
321         Pipe this parameter up to libwebrtc.
322         Covered by rebased test.
323
324         * Modules/mediastream/RTCConfiguration.h:
325         * Modules/mediastream/RTCConfiguration.idl:
326         * Modules/mediastream/RTCPeerConnection.cpp:
327         (WebCore::iceServersFromConfiguration):
328         (WebCore::RTCPeerConnection::initializeConfiguration):
329         (WebCore::RTCPeerConnection::setConfiguration):
330         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
331         (WebCore::rtcpMuxPolicyfromConfiguration):
332         (WebCore::configurationFromMediaEndpointConfiguration):
333         * WebCore.xcodeproj/project.pbxproj:
334         * platform/mediastream/MediaEndpointConfiguration.cpp:
335         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
336         * platform/mediastream/MediaEndpointConfiguration.h:
337         * platform/mediastream/RTCPMuxPolicy.h: Added.
338
339 2018-11-03  Devin Rousso  <drousso@apple.com>
340
341         Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
342         https://bugs.webkit.org/show_bug.cgi?id=190854
343
344         Reviewed by Matt Baker.
345
346         Updated existing tests: inspector/canvas/recording-2d.html
347                                 inspector/canvas/recording-bitmaprenderer.html
348                                 inspector/canvas/recording-webgl.html
349
350         * html/HTMLCanvasElement.idl:
351         Apply `CallTracingCallback=recordCanvasAction` to the `width` and `height` attributes so
352         that they are recorded through the same path as `CanvasRenderingContext`.
353
354         * html/CanvasBase.h:
355         * html/CanvasBase.cpp:
356         (WebCore::CanvasBase::callTracingActive const): Added.
357
358         * bindings/js/CallTracer.h:
359         * bindings/js/CallTracer.cpp:
360         (WebCore::CallTracer::recordCanvasAction):
361
362
363 2018-11-03  Andy Estes  <aestes@apple.com>
364
365         [Payment Request] PaymentResponse.retry()'s errorFields should be optional
366         https://bugs.webkit.org/show_bug.cgi?id=191212
367
368         Reviewed by Youenn Fablet.
369
370         Per WebIDL, the errorFields argument to PaymentResponse.retry() should be optional. See
371         <https://github.com/w3c/payment-request/issues/804> for details.
372
373         Added test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
374
375         * Modules/paymentrequest/PaymentResponse.idl:
376
377 2018-11-02  Zalan Bujtas  <zalan@apple.com>
378
379         [LFC][BFC] Resolve percentage height values.
380         https://bugs.webkit.org/show_bug.cgi?id=191224
381
382         Reviewed by Antti Koivisto.
383
384         10.5 Content height: the 'height' property
385         The percentage is calculated with respect to the height of the generated box's containing block.
386         If the height of the containing block is not specified explicitly (i.e., it depends on content height),
387         and this element is not absolutely positioned, the used height is calculated as if 'auto' was specified.
388
389         https://www.w3.org/TR/CSS22/visudet.html#propdef-height
390
391         Test: fast/block/basic/height-percentage-simple.html
392
393         * layout/FormattingContextGeometry.cpp:
394         (WebCore::Layout::isHeightAuto):
395         (WebCore::Layout::computedHeightValue):
396         (WebCore::Layout::contentHeightForFormattingContextRoot):
397         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
398         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
399         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
400         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
401         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
402         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
403
404 2018-11-03  Eric Carlson  <eric.carlson@apple.com>
405
406         [MediaStream] enumerateDevices should not expose devices that are not available to getUserMedia
407         https://bugs.webkit.org/show_bug.cgi?id=191177
408         <rdar://problem/45747873>
409
410         Reviewed by Jer Noble.
411
412         Test: http/tests/media/media-stream/enumerate-devices-iframe-allow-attribute.html
413
414         * Modules/mediastream/MediaDevicesRequest.cpp:
415         (WebCore::MediaDevicesRequest::start): Only expose devices that are available to gUM.
416
417         * Modules/mediastream/UserMediaController.cpp:
418         (WebCore::isSecure): Moved from UserMediaRequest.cpp.
419         (WebCore::isAllowedToUse): Ditto.
420         (WebCore::UserMediaController::canCallGetUserMedia): Modified from UserMediaRequest.cpp.
421         (WebCore::UserMediaController::logGetUserMediaDenial): Log reason for denial.
422         * Modules/mediastream/UserMediaController.h:
423
424         * Modules/mediastream/UserMediaRequest.cpp:
425         (WebCore::UserMediaRequest::start): Use UserMediaController::canCallGetUserMedia.
426         (WebCore::isSecure): Deleted.
427         (WebCore::isAllowedToUse): Deleted.
428         (WebCore::canCallGetUserMedia): Deleted.
429
430 2018-11-02  Justin Michaud  <justin_michaud@apple.com>
431
432         Add new global object and preliminary Worklets support for CSS painting api
433         https://bugs.webkit.org/show_bug.cgi?id=190979
434
435         Reviewed by Chris Dumez.
436
437         Test: fast/css-custom-paint/worklet.html
438
439         Add a new ScriptExecutionContext and global object to run worklets in. This is mostly copy+paste
440         from Workers, but without any of the threading. Worklet.addModule does not yet support loading scripts
441         or doing cross origin checking. There are quite a few parts of the ScriptExecutionContext api that are
442         left as ASSERT_NOT_REACHED().
443
444         * CMakeLists.txt:
445         * DerivedSources.make:
446         * Sources.txt:
447         * WebCore.xcodeproj/project.pbxproj:
448         * bindings/js/JSDOMGlobalObject.cpp:
449         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
450         * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp.
451         (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
452         (WebCore::JSPaintWorkletGlobalScope::registerPaint):
453         * bindings/js/JSWorkletGlobalScopeBase.cpp: Added.
454         (WebCore::JSWorkletGlobalScopeBase::JSWorkletGlobalScopeBase):
455         (WebCore::JSWorkletGlobalScopeBase::finishCreation):
456         (WebCore::JSWorkletGlobalScopeBase::clearDOMGuardedObjects):
457         (WebCore::JSWorkletGlobalScopeBase::visitChildren):
458         (WebCore::JSWorkletGlobalScopeBase::destroy):
459         (WebCore::JSWorkletGlobalScopeBase::scriptExecutionContext const):
460         (WebCore::JSWorkletGlobalScopeBase::supportsRichSourceInfo):
461         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScript):
462         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScriptBeforeTimeout):
463         (WebCore::JSWorkletGlobalScopeBase::javaScriptRuntimeFlags):
464         (WebCore::toJS):
465         (WebCore::toJSWorkletGlobalScope):
466         * bindings/js/JSWorkletGlobalScopeBase.h: Added.
467         (WebCore::JSWorkletGlobalScopeBase::wrapped const):
468         (WebCore::JSWorkletGlobalScopeBase::proxy const):
469         (WebCore::JSWorkletGlobalScopeBase::createStructure):
470         (WebCore::toJS):
471         * bindings/js/ScriptState.cpp:
472         (WebCore::execStateFromWorkerGlobalScope):
473         (WebCore::execStateFromWorkletGlobalScope):
474         * bindings/js/ScriptState.h:
475         * bindings/js/WebCoreBuiltinNames.h:
476         * bindings/scripts/CodeGeneratorJS.pm:
477         (IsDOMGlobalObject):
478         (ShouldUseGlobalObjectPrototype):
479         (GenerateHeader):
480         (GenerateRuntimeEnableConditionalStringForExposed):
481         (GenerateImplementation):
482         * bindings/scripts/preprocess-idls.pl:
483         * css/CSSPaintImageValue.cpp:
484         (WebCore::CSSPaintImageValue::image):
485         * css/DOMCSSPaintWorklet.cpp:
486         (WebCore::DOMCSSPaintWorklet::ensurePaintWorklet):
487         (WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope): Deleted.
488         * css/DOMCSSPaintWorklet.h:
489         * css/DOMCSSPaintWorklet.idl:
490         * dom/Document.cpp:
491         (WebCore::Document::ensureCSSPaintWorklet):
492         (WebCore::Document::setCSSPaintWorkletGlobalScope):
493         (WebCore::Document::ensureCSSPaintWorkletGlobalScope): Deleted.
494         * dom/Document.h:
495         (WebCore::Document::getCSSPaintWorkletGlobalScope):
496         * dom/EventTargetFactory.in:
497         * dom/ScriptExecutionContext.cpp:
498         (WebCore::ScriptExecutionContext::vm):
499         (WebCore::ScriptExecutionContext::execState):
500         * dom/ScriptExecutionContext.h:
501         (WebCore::ScriptExecutionContext::isWorkletGlobalScope const):
502         * inspector/agents/worker/WorkerDebuggerAgent.cpp:
503         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
504         * inspector/agents/worker/WorkerRuntimeAgent.cpp:
505         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
506         * platform/graphics/CustomPaintImage.cpp:
507         (WebCore::CustomPaintImage::CustomPaintImage):
508         (WebCore::CustomPaintImage::doCustomPaint):
509         * platform/graphics/CustomPaintImage.h:
510         * worklets/PaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
511         (WebCore::PaintWorkletGlobalScope::create):
512         (WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope):
513         (WebCore::PaintWorkletGlobalScope::devicePixelRatio):
514         (WebCore::PaintWorkletGlobalScope::addRegisteredPaint):
515         * worklets/PaintWorkletGlobalScope.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.h.
516         * worklets/PaintWorkletGlobalScope.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
517         * worklets/Worklet.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
518         (WebCore::Worklet::create):
519         (WebCore::Worklet::Worklet):
520         (WebCore::Worklet::addModule):
521         * worklets/Worklet.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
522         * worklets/Worklet.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
523         * worklets/WorkletConsoleClient.cpp: Copied from Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.cpp.
524         (WebCore::WorkletConsoleClient::WorkletConsoleClient):
525         (WebCore::WorkletConsoleClient::messageWithTypeAndLevel):
526         (WebCore::WorkletConsoleClient::count):
527         (WebCore::WorkletConsoleClient::time):
528         (WebCore::WorkletConsoleClient::timeEnd):
529         (WebCore::WorkletConsoleClient::profile):
530         (WebCore::WorkletConsoleClient::profileEnd):
531         (WebCore::WorkletConsoleClient::takeHeapSnapshot):
532         (WebCore::WorkletConsoleClient::timeStamp):
533         (WebCore::WorkletConsoleClient::record):
534         (WebCore::WorkletConsoleClient::recordEnd):
535         * worklets/WorkletConsoleClient.h: Added.
536         * worklets/WorkletGlobalScope.cpp: Added.
537         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
538         (WebCore::WorkletGlobalScope::~WorkletGlobalScope):
539         (WebCore::WorkletGlobalScope::evaluate):
540         (WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
541         (WebCore::WorkletGlobalScope::disableEval):
542         (WebCore::WorkletGlobalScope::disableWebAssembly):
543         (WebCore::WorkletGlobalScope::completeURL const):
544         (WebCore::WorkletGlobalScope::logExceptionToConsole):
545         (WebCore::WorkletGlobalScope::addConsoleMessage):
546         (WebCore::WorkletGlobalScope::addMessage):
547         * worklets/WorkletGlobalScope.h: Added.
548         (WebCore::WorkletGlobalScope::isPaintWorkletGlobalScope const):
549         (WebCore::WorkletGlobalScope::identifier const):
550         (WebCore::WorkletGlobalScope::script):
551         (WebCore::WorkletGlobalScope::jsRuntimeFlags const):
552         (isType):
553         * worklets/WorkletGlobalScope.idl: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
554         * worklets/WorkletScriptController.cpp: Added.
555         (WebCore::WorkletScriptController::WorkletScriptController):
556         (WebCore::WorkletScriptController::~WorkletScriptController):
557         (WebCore::WorkletScriptController::forbidExecution):
558         (WebCore::WorkletScriptController::isExecutionForbidden const):
559         (WebCore::WorkletScriptController::disableEval):
560         (WebCore::WorkletScriptController::disableWebAssembly):
561         (WebCore::WorkletScriptController::initScriptWithSubclass):
562         (WebCore::WorkletScriptController::initScript):
563         (WebCore::WorkletScriptController::evaluate):
564         (WebCore::WorkletScriptController::setException):
565         * worklets/WorkletScriptController.h: Added.
566         (WebCore::WorkletScriptController::workletGlobalScopeWrapper):
567         (WebCore::WorkletScriptController::vm):
568         (WebCore::WorkletScriptController::initScriptIfNeeded):
569
570 2018-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
571
572         Clean up drawLineForDocumentMarker()
573         https://bugs.webkit.org/show_bug.cgi?id=191215
574
575         Reviewed by Zalan Bujtas.
576
577         In preparation for https://bugs.webkit.org/show_bug.cgi?id=190764, I need to do a little bit of refactoring.
578         This patch has no behavior change; it just does the following:
579
580         1. Renames drawLineForDocumentMarker() to drawDotsForDocumentMarker(), because 2 of the 3 implementations draw dots
581         2. Moves our implementation back into GraphicsContext, because it's simpler and  GraphicsContext is already platform-
582                specific.
583         3. The signature used to accept a location and a width, but without a height, it's difficult to know what the bounding
584                box is. In particular, knowing the bounding box must be possible without a GraphicsContext. So, I've modified
585                the signature to accept a rectangle instead. The GraphicsContext draws only within this rectangle.
586
587         No new tests because there is no behavior change.
588
589         * platform/graphics/GraphicsContext.h:
590         * platform/graphics/GraphicsContextImpl.h:
591         * platform/graphics/cairo/CairoOperations.cpp:
592         (WebCore::Cairo::drawDotsForDocumentMarker):
593         (WebCore::Cairo::drawLineForDocumentMarker): Deleted.
594         * platform/graphics/cairo/CairoOperations.h:
595         * platform/graphics/cairo/GraphicsContextCairo.cpp:
596         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
597         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
598         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
599         (WebCore::GraphicsContextImplCairo::drawDotsForDocumentMarker):
600         (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker): Deleted.
601         * platform/graphics/cairo/GraphicsContextImplCairo.h:
602         * platform/graphics/cocoa/FontCascadeCocoa.mm:
603         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
604         (WebCore::colorForMarkerLineStyle):
605         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
606         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
607         * platform/graphics/displaylists/DisplayListItems.cpp:
608         (WebCore::DisplayList::Item::sizeInBytes):
609         (WebCore::DisplayList::DrawDotsForDocumentMarker::apply const):
610         (WebCore::DisplayList::DrawDotsForDocumentMarker::localBounds const):
611         (WebCore::DisplayList::operator<<):
612         (WebCore::DisplayList::DrawLineForDocumentMarker::apply const): Deleted.
613         (WebCore::DisplayList::DrawLineForDocumentMarker::localBounds const): Deleted.
614         * platform/graphics/displaylists/DisplayListItems.h:
615         (WebCore::DisplayList::DrawDotsForDocumentMarker::create):
616         (WebCore::DisplayList::DrawDotsForDocumentMarker::rect const):
617         (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker):
618         (WebCore::DisplayList::DrawLineForDocumentMarker::create): Deleted.
619         (WebCore::DisplayList::DrawLineForDocumentMarker::point const): Deleted.
620         (WebCore::DisplayList::DrawLineForDocumentMarker::width const): Deleted.
621         (WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker): Deleted.
622         * platform/graphics/displaylists/DisplayListRecorder.cpp:
623         (WebCore::DisplayList::Recorder::drawDotsForDocumentMarker):
624         (WebCore::DisplayList::Recorder::drawLineForDocumentMarker): Deleted.
625         * platform/graphics/displaylists/DisplayListRecorder.h:
626         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
627         (Nicosia::CairoOperationRecorder::drawDotsForDocumentMarker):
628         (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker): Deleted.
629         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
630         * platform/graphics/win/GraphicsContextCGWin.cpp:
631         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
632         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
633         * platform/graphics/win/GraphicsContextDirect2D.cpp:
634         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
635         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
636         * rendering/InlineTextBox.cpp:
637         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
638         * rendering/RenderTheme.cpp:
639         (WebCore::RenderTheme::drawLineForDocumentMarker): Deleted.
640         * rendering/RenderTheme.h:
641         * rendering/RenderThemeCocoa.h:
642         * rendering/RenderThemeCocoa.mm:
643         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Deleted.
644         * rendering/RenderThemeIOS.h:
645         * rendering/RenderThemeIOS.mm:
646         (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Deleted.
647         * rendering/RenderThemeMac.h:
648         * rendering/RenderThemeMac.mm:
649         (WebCore::RenderThemeMac::colorForMarkerLineStyle): Deleted.
650
651 2018-11-02  Ali Juma  <ajuma@chromium.org>
652
653         requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe
654         https://bugs.webkit.org/show_bug.cgi?id=176243
655
656         Reviewed by Simon Fraser.
657
658         When a new layer tree is committed to the UIProcess, the positions of layers for fixed
659         or sticky nodes in the newly-committed tree can be stale, because of scrolling that has
660         happened in the UIProcess since the tree was updated in the WebProcess. To handle this,
661         RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers
662         by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which
663         leads to a recursive traversal of the ScrollingTree to update each such layer. However,
664         since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange,
665         this traversal never descended into scrolling nodes within an iframe, so the layers for
666         these nodes were left with stale positions.
667
668         Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that
669         fixed and sticky layers within an iframe do get their positions updated when a new layer
670         tree is committed.
671
672         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
673         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
674         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange):
675
676 2018-11-02  Wenson Hsieh  <wenson_hsieh@apple.com>
677
678         [iOS] Changing view scale sometimes does not zoom the page to the new initial scale, when the page is at initial scale
679         https://bugs.webkit.org/show_bug.cgi?id=191180
680         <rdar://problem/45744786>
681
682         Reviewed by Simon Fraser.
683
684         When computing the minimum scale in ViewportConfiguration::minimumScale, if our content width or height is
685         shorter than the view width or height, then we recompute the minimum scale such that the content dimensions will
686         fill the bounds of the view by setting the minimum scale to the view width or height divided by the content
687         width or height.
688
689         Suppose the minimum scale is equal to some value `s`; additionally, let `w_c` denote the content width and `w_v`
690         denote the view width (as integers). If `w_v / s` is not an integral value, the computed content width `w_c` may
691         be rounded, such that `w_v / w_c` is not precisely equal to `s`. In the case that `w_v / w_c` is ever so
692         slightly larger than `s`, we will end up overriding the minimum scale `s` with `w_v / w_c`.
693
694         As a result, specifying a viewport with a decimal `minimum-scale` will sometimes cause the computed minimum
695         scale of the viewport (and platform view) to be very slightly different from the minimum scale. The new layout
696         test below exercises this scenario, specifying a viewport with minimum and initial scales of 0.94 that results
697         in `ViewportConfiguration::minimumScale` returning 0.94158.
698
699         With the `WebPage::setViewportConfigurationViewLayoutSize` check added in r237127, this means setting
700         `_viewScale:` when the page is at initial scale sometimes doesn't zoom the page to the new initial scale when it
701         should, since the page scale factor and the initial scale are different enough such that
702         `areEssentiallyEqualAsFloat` returns false.
703
704         This patch addresses these issues by snapping to the minimum scale if the computed scale that fits content
705         dimensions to view dimensions results in a minimum scale that is close enough to the configuration's minimum
706         scale, such that the difference can be attributed to rounding error when computing content or view dimensions.
707
708         Test: fast/viewport/ios/viewport-minimum-and-initial-scale.html
709
710         * page/ViewportConfiguration.cpp:
711         (WebCore::ViewportConfiguration::minimumScale const):
712
713 2018-11-02  Philippe Normand  <pnormand@igalia.com>
714
715         [GTK][WPE] Unreviewed, another --no-video --no-web-audio build fix following r237677
716
717         * inspector/agents/InspectorDOMAgent.cpp:
718         (WebCore::InspectorDOMAgent::addEventListenersToNode):
719
720 2018-11-02  Daniel Bates  <dabates@apple.com>
721
722         [iOS] Normalize character string based on key code
723         https://bugs.webkit.org/show_bug.cgi?id=191120
724
725         Reviewed by Tim Horton.
726
727         Following r236417 (https://bugs.webkit.org/show_bug.cgi?id=189604) we always have a valid key code
728         for a special key (e.g. page up) and can simplify the character string normalization code.
729
730         No functionality changed. So, no new tests.
731
732         * platform/ios/WebEvent.mm:
733         (normalizedStringWithAppKitCompatibilityMapping): Modified to take a key code and wrote algorithm
734         in terms of it.
735
736         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
737         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
738         Pass the key code for the event to normalizedStringWithAppKitCompatibilityMapping().
739
740 2018-11-02  Daniel Bates  <dabates@apple.com>
741
742         [iOS] WebKit should dispatch DOM events when a modifier key is pressed
743         https://bugs.webkit.org/show_bug.cgi?id=190487
744
745         Reviewed by Tim Horton.
746
747         Add support for modifier flags change events.
748
749         * platform/ios/PlatformEventFactoryIOS.mm:
750         (WebCore::modifiersForEvent): Modifier keys do not have an associated character and do not
751         participate in key repeat.
752         (WebCore::keyIdentifierForKeyEvent): Identify modifier keys, returning "Unidentified" if
753         the modifier key is unidentified. This matches the behavior on Mac.
754         (WebCore::keyForKeyEvent): Identify modifier keys, returning the empty string if the modifier
755         key is unidentified. This matches the behavior on Mac.
756         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
757         * platform/ios/WebEvent.h:
758
759         * platform/ios/WebEvent.mm:
760         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
761         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
762         Modifier keys do not have an associated character and do not participate in key repeat.
763
764         (-[WebEvent _eventDescription]): Modified to print a description for a keydown or keyup event
765         that represents a modifier flags change.
766         (-[WebEvent characters]): Modifier keys do not have an associated character. Assert this
767         invariant as it is a programming error. On Mac, the same operation would result in a
768         NSInternalInconsistencyException exception being raised.
769         (-[WebEvent charactersIgnoringModifiers]): Ditto.
770
771 2018-11-02  Ali Juma  <ajuma@chromium.org>
772
773         Allow cross-document intersection observing
774         https://bugs.webkit.org/show_bug.cgi?id=165746
775
776         Reviewed by Simon Fraser.
777
778         Add logic to compute the intersection between the viewport and an element in a
779         subframe.
780
781         Add a FloatRect version of ScrollView::rootViewToContents, and FloatRect versions
782         of the methods it calls.
783
784         Test: http/tests/intersection-observer/intermediate-frame-changes.html
785         Also covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
786
787         * dom/Document.cpp:
788         (WebCore::computeClippedRectInRootContentsSpace):
789         (WebCore::computeIntersectionState):
790         (WebCore::Document::updateIntersectionObservations):
791         * page/FrameView.cpp:
792         (WebCore::FrameView::viewportContentsChanged):
793         (WebCore::FrameView::convertFromContainingViewToRenderer const):
794         (WebCore::FrameView::convertFromContainingView const):
795         * page/FrameView.h:
796         * platform/ScrollView.cpp:
797         (WebCore::ScrollView::viewToContents const):
798         (WebCore::ScrollView::contentsToView const):
799         (WebCore::ScrollView::rootViewToContents const):
800         * platform/ScrollView.h:
801         * platform/Widget.cpp:
802         (WebCore::Widget::convertFromRootView const):
803         (WebCore::Widget::convertFromContainingView const):
804         * platform/Widget.h:
805
806 2018-11-02  Rob Buis  <rbuis@igalia.com>
807
808         Remove ENABLE_OPENCL fully
809         https://bugs.webkit.org/show_bug.cgi?id=191172
810
811         Reviewed by Yusuke Suzuki.
812
813         No new tests since no change in functionality.
814
815         * platform/graphics/filters/FilterEffect.h:
816         (WebCore::FilterEffect::hasResult const):
817         (WebCore::FilterEffect::applyAll):
818         (WebCore::FilterEffect::openCLImage): Deleted.
819         (WebCore::FilterEffect::setOpenCLImage): Deleted.
820
821 2018-11-02  Zalan Bujtas  <zalan@apple.com>
822
823         [LFC][IFC] Add support for intrinsic width calculation
824         https://bugs.webkit.org/show_bug.cgi?id=191144
825
826         Reviewed by Antti Koivisto.
827
828         This is the inline formatting version of the shrink-to-fit computation. It generates inline runs
829         and uses InlineLineBreaker to compute min/max width. This is very similar to ::layout.
830
831         Test: fast/inline/simple-shrink-to-fit-inline-block.html
832
833         * layout/inlineformatting/InlineFormattingContext.cpp:
834         (WebCore::Layout::InlineFormattingContext::layout const):
835         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
836         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
837         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
838         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
839         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
840         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
841         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): Deleted.
842         * layout/inlineformatting/InlineFormattingContext.h:
843
844 2018-11-02  Zalan Bujtas  <zalan@apple.com>
845
846         [LFC][BFC] BlockFormattingContext::instrinsicWidthConstraints logic should look similar to ::layout
847         https://bugs.webkit.org/show_bug.cgi?id=191181
848
849         Reviewed by Antti Koivisto.
850
851         * layout/blockformatting/BlockFormattingContext.cpp:
852         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
853
854 2018-11-02  Zalan Bujtas  <zalan@apple.com>
855
856         [LFC] Align shrink-to-fit width computation with the layout implementation.
857         https://bugs.webkit.org/show_bug.cgi?id=191179
858
859         Reviewed by Antti Koivisto.
860
861         There are many similarities between layout and shrink-to-fit.
862         They both operate on formatting roots only (shrink-to-fit -> float, out-of-flow, inline-block) and in both cases
863         the algoritm depends on what type of formatting context the element establishes.
864
865         This patch is in preparation for transforming the "shrink-to-fit" width computation to make it behave more like layout.
866         With this change the instrinsicWidthConstraints() computation happens in the formatting context that the element establishes (similar to layout).
867
868         * layout/FormattingContext.cpp:
869         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
870         * layout/FormattingContext.h:
871         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
872         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
873         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
874         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
875         * layout/FormattingContextGeometry.cpp:
876         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
877         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
878         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
879         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
880         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
881         * layout/blockformatting/BlockFormattingContext.cpp:
882         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
883         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
884         * layout/blockformatting/BlockFormattingContext.h:
885         * layout/inlineformatting/InlineFormattingContext.cpp:
886         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
887         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
888         * layout/inlineformatting/InlineFormattingContext.h:
889         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
890         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
891
892 2018-11-01  Antoine Quint  <graouts@apple.com>
893
894         [Web Animations] Make document.getAnimations() return declarative animations in the correct order
895         https://bugs.webkit.org/show_bug.cgi?id=191153
896
897         Reviewed by Dean Jackson.
898
899         The Web Animations spec has the notion of "composite order" which determines the order in which animations should
900         be returned when document.getAnimations() is called. The CSS Transitions and CSS Animations specifications also
901         determine the composite order of their respective animation classes, as well as the notion of "owning element",
902         the element that was the animation target when specified through style, prior to any manipulation via the Web
903         Animations API. We implement these two notions so that we can pass the document.getAnimations() tests for
904         declarative animations.
905
906         It is important that we have the notion of an "owning element" since when a CSS Transition or CSS Animation is
907         modified via the Web Animations API in a way that an animation created through CSS we must consider no longer
908         as a declarative animation but as a regular Web Animation. In this patch, we remove the DeclarativeAnimation's
909         target(), which returned a reference, to owningElement(), which returns a pointer and return nullptr once the
910         declarative animation has been modified.
911
912         In order to also keep a correct count of declarative animations applied to elements, we correctly add transitions
913         that have completed to a list of completed transitions, as specified by the CSS Transitions spec. We have had this
914         list declared in AnimationTimeline.h for a while but never actually did the work to add items to it. Thanks to that,
915         AnimationTimeline::updateCSSTransitionsForElement() now correctly accounts for completed transitions so that they
916         may be canceled if overridden with a new animation, correctly removing their "owning element".
917
918         Finally, now that we have saner lists of animations per classes, we can apply the right sorting routines to match
919         the composite order for CSS Transitions, CSS Animations and Web Animations, keeping a list of all animations created
920         in order as the final criterion for sorting.
921
922         * animation/AnimationTimeline.cpp:
923         (WebCore::AnimationTimeline::animationTimingDidChange): Make sure this animation is tracked on the list of all animations
924         created for this timeline in the order in which they were created, which is needed to sort animations correctly when
925         document.getAnimations() is called.
926         (WebCore::AnimationTimeline::animationWasAddedToElement): We've removed the relevantMapForAnimation() method which we used
927         to determine which map we should add an animation to based on its class and instead have code that accounts for not just
928         the animation's class, but also whether it has an owning element since a valid owning element is required to qualify as
929         a CSS Transition or CSS Animation, regardless of the animation's original class.
930         (WebCore::removeAnimationFromMapForElement): Adding this helper to remove an animation from the provided animation map so
931         that animationWasRemovedFromElement() can call this with all of the various animation maps.
932         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Check all of the various animation maps to see which may
933         contain the animation we're trying to remove as the owning element might have been cleared by the time this function is
934         called and looking at the animation's class would not be sufficient to determine which animation map the animation was in.
935         (WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): New function in which the logic from
936         animationWasRemovedFromElement() that dealt with removing animations from the list of running CSS Animations/Transitions as
937         well as completed CSS Transitions was factored out. This allowed us to also call this function from
938         DeclarativeAnimation::disassociateFromOwningElement().
939         (WebCore::AnimationTimeline::elementWasRemoved): We no longer need to remove an animation as canceling it will remove it
940         correctly when DocumentTimeline::updateAnimationsAndSendEvents() is called.
941         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Call cancelDeclarativeAnimation() instead of the removed
942         cancelOrRemoveDeclarativeAnimation() when a CSS Animation should be canceled.
943         (WebCore::AnimationTimeline::ensureRunningTransitionsByProperty): Now that we correctly remove transitions from the list
944         of running transitions once they've completed or have been canceled, we need a helper to always get a valid map of running
945         transitions for a given element as that map can be cleared while updateCSSTransitionsForElement() is running. 
946         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Call cancelDeclarativeAnimation() instead of the removed
947         cancelOrRemoveDeclarativeAnimation() when a CSS Transition should be canceled. Additionally we always get the list of running
948         transitions for a given element as it can be cleared by a prior cancelation.
949         (WebCore::AnimationTimeline::cancelDeclarativeAnimation): New function replacing cancelOrRemoveDeclarativeAnimation() in which
950         we call the new DeclarativeAnimation::cancelFromStyle() function on the provided animation and then remove the animation from
951         all known lists, including the new list of all animations. We do this final part so that the animation gets re-added as if it
952         were a new animation since canceling a declarative animation via a style change removes its declarative-ness. This guarantees
953         that a declarative animation that is canceled through style but then resumed through the Web Animations API sorts after any
954         declarative animation with an owning element.
955         (WebCore::AnimationTimeline::relevantMapForAnimation): Deleted.
956         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Deleted.
957         * animation/AnimationTimeline.h:
958         (WebCore::AnimationTimeline::timingModelDidChange): Deleted. This was left over in the patch where we implemented the "update
959         animations and send events" procedure.
960         (WebCore::AnimationTimeline::animations const): Deleted.
961         * animation/CSSAnimation.cpp:
962         (WebCore::CSSAnimation::create): Some refactoring to make the handling of a declarative animation's owning element part of the
963         DeclarativeAnimation constructor.
964         * animation/CSSTransition.cpp:
965         (WebCore::CSSTransition::create): Some refactoring to make the handling of a declarative animation's owning element part of the
966         DeclarativeAnimation constructor.
967         * animation/DeclarativeAnimation.cpp:
968         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
969         (WebCore::DeclarativeAnimation::tick): Make sure we disassociate from the animation's owning element once we transition from a
970         relevant state to an idle state. This will catch any changes made via the Web Animations API to a declarative animation when the
971         "update animations and send events" procedure is run.
972         (WebCore::DeclarativeAnimation::disassociateFromOwningElement): Remove this animation from the list of declarative animations on
973         the associated timeline and make owningElement() nullptr so that document.getAnimations() will know to sort this animation with other
974         Web Animations created via the Web Animations API.
975         (WebCore::DeclarativeAnimation::initialize):
976         (WebCore::DeclarativeAnimation::cancelFromStyle): New method called from AnimationTimeline::cancelDeclarativeAnimation() which
977         cancels the animation but also disassociates it from its owning element.
978         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
979         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
980         * animation/DeclarativeAnimation.h:
981         (WebCore::DeclarativeAnimation::owningElement const):
982         (WebCore::DeclarativeAnimation::target const): Deleted.
983         * animation/DocumentTimeline.cpp:
984         (WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Adding a new utility used when sorting both
985         CSS Transitions and CSS Animations by tree order when their owning element differ, with special logic for pseudo-elements.
986         (WebCore::DocumentTimeline::getAnimations const): Filter and sort animations according to their composite order.
987         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Compile a list of transitions that move to a finished state to
988         the list of completed transitions so that they may be canceled correctly in AnimationTimeline::updateCSSTransitionsForElement().
989         (WebCore::DocumentTimeline::transitionDidComplete):
990         * animation/DocumentTimeline.h:
991
992 2018-11-02  Zan Dobersek  <zdobersek@igalia.com>
993
994         PNGImageDecoder: report no repetition for non-animated images
995         https://bugs.webkit.org/show_bug.cgi?id=191068
996
997         Reviewed by Michael Catanzaro.
998
999         When building with APNG support enabled, the
1000         PNGImageDecoder::repetitionCount() method until now reported  infinite
1001         repetition count for all PNG images, even the ones that were not
1002         animated. This is now changed so that no repetition is reported for
1003         non-animated images.
1004
1005         * platform/image-decoders/png/PNGImageDecoder.cpp:
1006         (WebCore::PNGImageDecoder::repetitionCount const):
1007
1008 2018-11-02  Justin Fan  <justin_fan@apple.com>
1009
1010         [WebGPU] Experimental prototype for MSL shaders
1011         https://bugs.webkit.org/show_bug.cgi?id=191084
1012
1013         Reviewed by Dean Jackson.
1014
1015         Begin implementation for WebGPUDevice and WebGPUShaderModule and associated descriptor objects.
1016
1017         Test: webgpu/webgpu-basics.html
1018         Test: webgpu/shader-modules.html
1019
1020         * CMakeLists.txt:
1021         * DerivedSources.make:
1022         * Modules/webgpu/GPUDevice.cpp: 
1023         (WebCore::GPUDevice::createShaderModule const):
1024         * Modules/webgpu/GPUDevice.h: 
1025         (WebCore::GPUDevice::platformDevice const):
1026         * Modules/webgpu/GPUShaderModule.h:
1027         (WebCore::GPUShaderModule::platformShaderModule const):
1028         * Modules/webgpu/GPUShaderModuleDescriptor.h:
1029         * Modules/webgpu/WebGPU.cpp:
1030         (WebCore::WebGPU::requestAdapter const):
1031         * Modules/webgpu/WebGPUAdapter.cpp:
1032         (WebCore::WebGPUAdapter::create):
1033         (WebCore::WebGPUAdapter::createDevice):
1034         * Modules/webgpu/WebGPUAdapter.h:
1035         * Modules/webgpu/WebGPUAdapter.idl:
1036         * Modules/webgpu/WebGPUDevice.cpp:
1037         (WebCore::WebGPUDevice::create):
1038         (WebCore::WebGPUDevice::WebGPUDevice):
1039         (WebCore::WebGPUDevice::createShaderModule const):
1040         * Modules/webgpu/WebGPUDevice.h:
1041         * Modules/webgpu/WebGPUDevice.idl:
1042         * Modules/webgpu/WebGPUShaderModule.cpp:
1043         (WebCore::WebGPUShaderModule::create):
1044         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
1045         * Modules/webgpu/WebGPUShaderModule.h:
1046         * Modules/webgpu/WebGPUShaderModule.idl:
1047         * Modules/webgpu/WebGPUShaderModuleDescriptor.h:
1048         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
1049         * Modules/webgpu/WebGPUSwapChain.cpp:
1050         (WebCore::WebGPUSwapChain::configure):
1051         * Modules/webgpu/WebGPUSwapChain.h:
1052         * Modules/webgpu/WebGPUSwapChain.idl:
1053         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
1054         (WebCore::GPUDevice::create):
1055         (WebCore::GPUDevice::GPUDevice):
1056         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
1057         (WebCore::GPUShaderModule::create):
1058         (WebCore::GPUShaderModule::GPUShaderModule):
1059         * Sources.txt:
1060         * SourcesCocoa.txt:
1061         * WebCore.xcodeproj/project.pbxproj:
1062         * bindings/js/WebCoreBuiltinNames.h:
1063         * platform/Logging.h:
1064
1065 2018-11-01  Jiewen Tan  <jiewen_tan@apple.com>
1066
1067         Replace CommonRandom SPI with API
1068         https://bugs.webkit.org/show_bug.cgi?id=191178
1069         <rdar://problem/45722391>
1070
1071         Reviewed by Brent Fulgham.
1072
1073         The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
1074         all SPI usages with API.
1075
1076         No change of behaviors.
1077
1078         * crypto/CommonCryptoUtilities.h:
1079         * crypto/mac/CryptoKeyMac.cpp:
1080         (WebCore::CryptoKey::randomData):
1081         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1082         (WebCore::createAndStoreMasterKey):
1083         (WebCore::wrapSerializedCryptoKey):
1084         * page/Crypto.cpp:
1085         (WebCore::Crypto::getRandomValues):
1086
1087 2018-11-01  Chris Dumez  <cdumez@apple.com>
1088
1089         [WebIDL] Rename CallWith=ScriptState to CallWith=ExecState
1090         https://bugs.webkit.org/show_bug.cgi?id=191162
1091
1092         Reviewed by Alex Christensen.
1093
1094         Rename CallWith=ScriptState to CallWith=ExecState in our Web IDL as ScriptState is no longer a thing
1095         in modern WebKit. The implementation is actually passed an ExecState nowadays.
1096
1097         * Modules/applepay/ApplePaySession.idl:
1098         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
1099         * Modules/fetch/FetchBody.idl:
1100         * Modules/indexeddb/IDBCursor.idl:
1101         * Modules/indexeddb/IDBFactory.idl:
1102         * Modules/indexeddb/IDBIndex.idl:
1103         * Modules/indexeddb/IDBKeyRange.idl:
1104         * Modules/indexeddb/IDBObjectStore.idl:
1105         * Modules/mediastream/RTCPeerConnection.idl:
1106         * animation/Animatable.idl:
1107         * animation/KeyframeEffect.idl:
1108         * animation/KeyframeEffectReadOnly.idl:
1109         * bindings/scripts/CodeGeneratorJS.pm:
1110         (GenerateCallWith):
1111         (GenerateConstructorDefinition):
1112         * bindings/scripts/IDLAttributes.json:
1113         * bindings/scripts/test/JS/JSTestObj.cpp:
1114         (WebCore::jsTestObjWithExecStateAttributeGetter):
1115         (WebCore::jsTestObjWithExecStateAttribute):
1116         (WebCore::setJSTestObjWithExecStateAttributeSetter):
1117         (WebCore::setJSTestObjWithExecStateAttribute):
1118         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter):
1119         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttribute):
1120         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter):
1121         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttribute):
1122         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter):
1123         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
1124         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter):
1125         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
1126         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody):
1127         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoid):
1128         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody):
1129         (WebCore::jsTestObjPrototypeFunctionWithExecStateObj):
1130         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody):
1131         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException):
1132         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody):
1133         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjException):
1134         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody):
1135         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState):
1136         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody):
1137         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException):
1138         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody):
1139         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces):
1140         (WebCore::jsTestObjWithScriptStateAttributeGetter): Deleted.
1141         (WebCore::jsTestObjWithScriptStateAttribute): Deleted.
1142         (WebCore::setJSTestObjWithScriptStateAttributeSetter): Deleted.
1143         (WebCore::setJSTestObjWithScriptStateAttribute): Deleted.
1144         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter): Deleted.
1145         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
1146         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeSetter): Deleted.
1147         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
1148         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter): Deleted.
1149         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
1150         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeSetter): Deleted.
1151         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
1152         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidBody): Deleted.
1153         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid): Deleted.
1154         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjBody): Deleted.
1155         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj): Deleted.
1156         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidExceptionBody): Deleted.
1157         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException): Deleted.
1158         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjExceptionBody): Deleted.
1159         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException): Deleted.
1160         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateBody): Deleted.
1161         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState): Deleted.
1162         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjExceptionBody): Deleted.
1163         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException): Deleted.
1164         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpacesBody): Deleted.
1165         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces): Deleted.
1166         * bindings/scripts/test/TestObj.idl:
1167         * bindings/scripts/test/TestPromiseRejectionEvent.idl:
1168         * crypto/SubtleCrypto.idl:
1169         * dom/Element.idl:
1170         * dom/ErrorEvent.idl:
1171         * dom/MessagePort.idl:
1172         * dom/MouseEvent.idl:
1173         * html/HTMLCanvasElement.idl:
1174         * html/HTMLFrameElement.idl:
1175         * html/OffscreenCanvas.idl:
1176         * html/track/DataCue.idl:
1177         * inspector/CommandLineAPIHost.idl:
1178         * page/DOMWindow.idl:
1179         * page/RemoteDOMWindow.idl:
1180         * page/WindowOrWorkerGlobalScope.idl:
1181         * testing/Internals.idl:
1182         * workers/DedicatedWorkerGlobalScope.idl:
1183         * workers/Worker.idl:
1184
1185 2018-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
1186
1187         Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
1188         https://bugs.webkit.org/show_bug.cgi?id=189693
1189
1190         Reviewed by Yusuke Suzuki.
1191
1192         No new tests because there's no behaviro changes.
1193
1194         * platform/SharedBuffer.cpp: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
1195         * xml/XSLTProcessorLibxslt.cpp: Ditto.
1196         * xml/parser/XMLDocumentParserLibxml2.cpp: Ditto.
1197
1198 2018-11-01  John Wilander  <wilander@apple.com>
1199
1200         In WebCore::ResourceLoadObserver, use document.sessionID().isEphemeral() when possible and check for page existence when not
1201         https://bugs.webkit.org/show_bug.cgi?id=191119
1202         <rdar://problem/44176965>
1203
1204         Reviewed by Chris Dumez.
1205
1206         New API test added.
1207
1208         * loader/ResourceLoadObserver.cpp:
1209         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1210         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1211
1212 2018-11-01  Devin Rousso  <drousso@apple.com>
1213
1214         Web Inspector: Network: remove unnecessary media event tracking
1215         https://bugs.webkit.org/show_bug.cgi?id=191174
1216
1217         Reviewed by Joseph Pecoraro.
1218
1219         No new tests, as this simply removes some event listeners for the WebInspector frontend.
1220
1221         * inspector/agents/InspectorDOMAgent.cpp:
1222         (WebCore::InspectorDOMAgent::addEventListenersToNode):
1223
1224 2018-11-01  Chris Dumez  <cdumez@apple.com>
1225
1226         Location object sans browsing context
1227         https://bugs.webkit.org/show_bug.cgi?id=191060
1228
1229         Reviewed by Geoffrey Garen.
1230
1231         As per https://github.com/whatwg/html/pull/4076, a Location object's URL should be "about:blank" when
1232         it does not have a browsing context (Frame), not "".
1233
1234         No new tests, rebaselined existing tests.
1235
1236         * page/Location.cpp:
1237         (WebCore::Location::url const):
1238         (WebCore::Location::href const):
1239         (WebCore::Location::protocol const):
1240         (WebCore::Location::host const):
1241         (WebCore::Location::hostname const):
1242         (WebCore::Location::port const):
1243         (WebCore::Location::pathname const):
1244         (WebCore::Location::search const):
1245         (WebCore::Location::origin const):
1246         (WebCore::Location::hash const):
1247
1248 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
1249
1250         Add a storage limit for IndexedDB
1251         https://bugs.webkit.org/show_bug.cgi?id=190598
1252         <rdar://problem/44654715>
1253
1254         Reviewed by Chris Dumez.
1255
1256         Set a storage limit in IndexedDB for each pair of mainFrameOrigin and openingOrigin. 
1257         IndexedDB will return a QuotaExceededError if limit is reached.
1258
1259         If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is 
1260         half the free disk space.
1261
1262         Test: storage/indexeddb/storage-limit.html
1263
1264         * Modules/indexeddb/server/IDBBackingStore.h:
1265         * Modules/indexeddb/server/IDBServer.cpp:
1266         (WebCore::IDBServer::IDBServer::createBackingStore):
1267         (WebCore::IDBServer::IDBServer::setPerOriginQuota):
1268         * Modules/indexeddb/server/IDBServer.h:
1269         (WebCore::IDBServer::IDBServer::perOriginQuota const):
1270         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1271         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1272         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
1273         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
1274         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
1275         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
1276         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1277         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
1278         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1279         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
1280         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
1281         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1282         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
1283         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1284         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1285         (WebCore::IDBServer::UniqueIDBDatabase::setQuota):
1286         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1287
1288 2018-11-01  Justin Michaud  <justin_michaud@apple.com>
1289
1290         CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly
1291         https://bugs.webkit.org/show_bug.cgi?id=191042
1292
1293         Reviewed by Antti Koivisto.
1294
1295         Refactor code so that:
1296         - All properties applied in StyleResolver::applyMatchedProperties are only applied once. 
1297         - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
1298           every time they were referenced, and again in RenderStyle.
1299         - The font-size property is applied after its variable references, but before custom properties that depend on it.
1300         - Cycles are detected at the same time as resolution.
1301         - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
1302           If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
1303           This behaviour matches chrome, but is not documented in the spec. 
1304         - Custom property values have more explicit resolved/unresolved state.
1305         - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
1306
1307         Tests: css-custom-properties-api/crash.html
1308                css-custom-properties-api/cycles.html
1309                css-custom-properties-api/inline.html
1310
1311         * css/CSSComputedStyleDeclaration.cpp:
1312         (WebCore::ComputedStyleExtractor::customPropertyValue):
1313         * css/CSSCustomPropertyValue.cpp:
1314         (WebCore::CSSCustomPropertyValue::equals const):
1315         (WebCore::CSSCustomPropertyValue::customCSSText const):
1316         (WebCore::CSSCustomPropertyValue::tokens const):
1317         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
1318         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
1319         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
1320         * css/CSSCustomPropertyValue.h:
1321         * css/CSSRegisteredCustomProperty.cpp:
1322         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
1323         * css/CSSRegisteredCustomProperty.h:
1324         * css/CSSVariableData.cpp:
1325         (WebCore::CSSVariableData::CSSVariableData):
1326         (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
1327         (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
1328         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
1329         (WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
1330         (WebCore::CSSVariableData::resolveVariableReference const): Deleted.
1331         (WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
1332         (WebCore::CSSVariableData::resolveTokenRange const): Deleted.
1333         * css/CSSVariableData.h:
1334         (WebCore::CSSVariableData::create):
1335         (WebCore::CSSVariableData::createResolved): Deleted.
1336         (WebCore::CSSVariableData::needsVariableResolution const): Deleted.
1337         (WebCore::CSSVariableData::CSSVariableData): Deleted.
1338         * css/CSSVariableReferenceValue.cpp:
1339         (WebCore::resolveVariableFallback):
1340         (WebCore::resolveVariableReference):
1341         (WebCore::resolveTokenRange):
1342         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
1343         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
1344         * css/CSSVariableReferenceValue.h:
1345         (WebCore::CSSVariableReferenceValue::create):
1346         (WebCore::CSSVariableReferenceValue::equals const):
1347         (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
1348         * css/DOMCSSRegisterCustomProperty.cpp:
1349         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
1350         * css/PropertySetCSSStyleDeclaration.cpp:
1351         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
1352         * css/StyleBuilderCustom.h:
1353         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
1354         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
1355         * css/StyleProperties.cpp:
1356         (WebCore::MutableStyleProperties::setCustomProperty):
1357         * css/StyleProperties.h:
1358         * css/StyleResolver.cpp:
1359         (WebCore::StyleResolver::State::setStyle):
1360         (WebCore::StyleResolver::styleForKeyframe):
1361         (WebCore::StyleResolver::styleForPage):
1362         (WebCore::StyleResolver::applyMatchedProperties):
1363         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
1364         (WebCore::StyleResolver::applyProperty):
1365         (WebCore::StyleResolver::resolvedVariableValue const):
1366         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
1367         (WebCore::StyleResolver::CascadedProperties::Property::apply):
1368         (WebCore::StyleResolver::applyCascadedCustomProperty):
1369         (WebCore::StyleResolver::applyCascadedProperties):
1370         * css/StyleResolver.h:
1371         * css/parser/CSSParser.cpp:
1372         (WebCore::CSSParser::parseValueWithVariableReferences):
1373         * css/parser/CSSParser.h:
1374         * css/parser/CSSPropertyParser.cpp:
1375         (WebCore::CSSPropertyParser::CSSPropertyParser):
1376         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
1377         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
1378         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
1379         (WebCore::CSSPropertyParser::parseValueStart):
1380         (WebCore::CSSPropertyParser::parseSingleValue):
1381         * css/parser/CSSPropertyParser.h:
1382         * css/parser/CSSVariableParser.cpp:
1383         (WebCore::CSSVariableParser::parseDeclarationValue):
1384         * dom/ConstantPropertyMap.cpp:
1385         (WebCore::ConstantPropertyMap::setValueForProperty):
1386         (WebCore::variableDataForPositivePixelLength):
1387         (WebCore::variableDataForPositiveDuration):
1388         * rendering/style/RenderStyle.cpp:
1389         (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
1390         * rendering/style/RenderStyle.h:
1391         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
1392         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
1393         * rendering/style/StyleCustomPropertyData.h:
1394         (WebCore::StyleCustomPropertyData::operator== const):
1395         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
1396         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
1397         (): Deleted.
1398
1399 2018-11-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
1400
1401         [CG] Adopt CG SPI for non-even cornered rounded rects
1402         https://bugs.webkit.org/show_bug.cgi?id=190155
1403
1404         Reviewed by Simon Fraser.
1405
1406         Instead of creating bezier curves for the non-even corners of the rounded
1407         rects, we should use the optimized SPI provided by CG.
1408
1409         * platform/graphics/cg/PathCG.cpp:
1410         (WebCore::Path::platformAddPathForRoundedRect):
1411
1412 2018-11-01  Youenn Fablet  <youenn@apple.com>
1413
1414         RTCTrackEvent.streams should be SameObject
1415         https://bugs.webkit.org/show_bug.cgi?id=191130
1416
1417         Reviewed by Eric Carlson.
1418
1419         Mimick SameObject using CachedAttribute.
1420         Covered by rebased test.
1421
1422         * Modules/mediastream/RTCTrackEvent.idl:
1423
1424 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1425
1426         [LFC][IFC] Add support for inline-block elements.
1427         https://bugs.webkit.org/show_bug.cgi?id=191143
1428
1429         Reviewed by Antti Koivisto.
1430
1431         This patch add support for laying out non-shrink-to-width inline-block elements.
1432
1433         Test: fast/inline/simple-inline-block.html
1434
1435         * layout/FormattingContext.h:
1436         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1437         * layout/FormattingContextGeometry.cpp:
1438         (WebCore::Layout::contentHeightForFormattingContextRoot):
1439         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1440         * layout/inlineformatting/InlineFormattingContext.cpp:
1441         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1442         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1443         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1444         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
1445         * layout/layouttree/LayoutInlineContainer.cpp:
1446         (WebCore::Layout::InlineContainer::establishesInlineFormattingContext const):
1447         * layout/layouttree/LayoutInlineContainer.h:
1448         * layout/layouttree/LayoutTreeBuilder.cpp:
1449         (WebCore::Layout::TreeBuilder::createSubTree):
1450
1451 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
1452
1453         Fix build with VIDEO and WEB_AUDIO disabled
1454         https://bugs.webkit.org/show_bug.cgi?id=191147
1455
1456         Reviewed by Philippe Normand.
1457
1458         Supported or not, there were a few build fixes needed
1459         to be able to build WebKit with media disabled. Mostly
1460         low-hanging fruits.
1461
1462         * Modules/mediasource/VideoPlaybackQuality.cpp:
1463         * Modules/mediasource/VideoPlaybackQuality.h:
1464         * Modules/mediasource/VideoPlaybackQuality.idl:
1465         * dom/Document.cpp:
1466         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
1467         * inspector/agents/InspectorDOMAgent.cpp:
1468         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
1469         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1470         * inspector/agents/InspectorDOMAgent.h:
1471         * rendering/RenderThemeGtk.cpp:
1472
1473 2018-10-31  Devin Rousso  <drousso@apple.com>
1474
1475         Web Inspector: Canvas: create a setting for auto-recording newly created contexts
1476         https://bugs.webkit.org/show_bug.cgi?id=190856
1477
1478         Reviewed by Brian Burg.
1479
1480         Test: inspector/canvas/setRecordingAutoCaptureFrameCount.html
1481
1482         * inspector/agents/InspectorCanvasAgent.h:
1483         (WebCore::InspectorCanvasAgent::RecordingOptions): Added.
1484         * inspector/agents/InspectorCanvasAgent.cpp:
1485         (WebCore::InspectorCanvasAgent::enable):
1486         (WebCore::InspectorCanvasAgent::disable):
1487         (WebCore::InspectorCanvasAgent::setRecordingAutoCaptureFrameCount): Added.
1488         (WebCore::InspectorCanvasAgent::startRecording):
1489         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1490         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1491         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
1492         (WebCore::InspectorCanvasAgent::startRecording): Added.
1493         Unify the different functions that are able to start a recording to use a single path.
1494
1495         * inspector/InspectorCanvas.h:
1496         * inspector/InspectorCanvas.cpp:
1497         (WebCore::InspectorCanvas::resetRecordingData):
1498         (WebCore::InspectorCanvas::recordAction):
1499         (WebCore::InspectorCanvas::setFrameCount): Added.
1500         (WebCore::InspectorCanvas::overFrameCount const): Added.
1501
1502 2018-10-31  Devin Rousso  <drousso@apple.com>
1503
1504         Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
1505         https://bugs.webkit.org/show_bug.cgi?id=190641
1506         <rdar://problem/45319049>
1507
1508         Reviewed by Joseph Pecoraro.
1509
1510         No new tests, as low power mode is indeterminate. Should not affect functionality.
1511
1512         * inspector/agents/InspectorDOMAgent.h:
1513         * inspector/agents/InspectorDOMAgent.cpp:
1514         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
1515         (WebCore::InspectorDOMAgent::addEventListenersToNode):
1516         (WebCore::InspectorDOMAgent::mediaMetricsTimerFired): Added.
1517
1518 2018-10-31  Alicia Boya García  <aboya@igalia.com>
1519
1520         [MSE] Use tolerance when growing the coded frame group
1521         https://bugs.webkit.org/show_bug.cgi?id=190085
1522
1523         Reviewed by Jer Noble.
1524
1525         Test: media/media-source/media-source-append-acb-tolerance.html
1526
1527         This patch introduces a millisecond tolerance in the range of
1528         potential frames that should be erased frame from the track buffer
1529         when the coded frame group is growing.
1530
1531         This is necessary because some files have imprecise overlapping
1532         timestamps (especially WebM files).
1533
1534         This fixes a stall when seeking back and forth in YouTube with WebM
1535         video.
1536
1537         A test case simulating the problem with video/mock using timestamps
1538         similar to those of a typical 30 fps WebM video is also added.
1539
1540         * Modules/mediasource/SourceBuffer.cpp:
1541         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1542
1543 2018-10-31  Jer Noble  <jer.noble@apple.com>
1544
1545         MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.B0') is inproperly rejected
1546         https://bugs.webkit.org/show_bug.cgi?id=191129
1547
1548         Reviewed by Eric Carlson.
1549
1550         Test: media/media-source/media-source-istypesupported-case-sensitive.html
1551
1552         According to RFC 2045: "All media type values, subtype values, and parameter names as
1553         defined are case-insensitive. However, parameter values are case-sensitive unless otherwise
1554         specified for the specific parameter." So rather than fold the entire ContentType into lower-
1555         case, leave the original string intact and require clients to enforce case-insensitivity.
1556
1557         * Modules/mediasource/MediaSource.cpp:
1558         (WebCore::MediaSource::isTypeSupported):
1559
1560 2018-10-31  Jer Noble  <jer.noble@apple.com>
1561
1562         Unreivewed build fix; fix the non-HAVE_AVCONTENTKEYSESSION builds by adding guards around
1563         access of m_cdmInstance.
1564
1565         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1566         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
1567
1568 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
1569
1570         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
1571         https://bugs.webkit.org/show_bug.cgi?id=190778
1572         <rdar://problem/45703574>
1573
1574         Reviewed by Youenn Fablet.
1575
1576         Add a include to fix the unified build error.
1577
1578         No tests since no new functionality.
1579
1580         * Modules/webgpu/WebGPUDevice.cpp:
1581
1582 2018-10-26  Jer Noble  <jer.noble@apple.com>
1583
1584         [EME][Cocoa] Cannot play unmuxed video and audio fMP4 streams encrypted with different keys via MSE
1585         https://bugs.webkit.org/show_bug.cgi?id=190946
1586
1587         Reviewed by Eric Carlson.
1588
1589         Use separate AVContentKeySessions per CDMInstanceSession (rather than one AVContentKeySession per
1590         CDMInstance).
1591
1592         - Add a mechanism for sending a message out from platform/CDMInstance to MediaKeySession without
1593           requiring MediaKeySession to send a callback first.
1594
1595         - Move all the AVContentKeySession delegate methods from CDMInstanceFairPlayStreamingAVFObjC to
1596           CDMInstanceSessionFairPlayStreamingAVFObjC.
1597
1598         - Add a mechanism for requesting the correct CDMInstanceSession for a given KeyID.
1599
1600         - Support key renewal through a "renew" message.
1601
1602         - Remember the keyID in SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID()
1603           and ask for the correct CDMInstanceSession for that keyID in attemptToDecrypt().
1604
1605         - Pass the CDMInstance down from MediaPlayerPrivateMediaSourceAVFObjC -> SourceBufferPrivateAVFObjC.
1606
1607         * Modules/encryptedmedia/MediaKeySession.cpp:
1608         (WebCore::MediaKeySession::sendMessage):
1609         * Modules/encryptedmedia/MediaKeySession.h:
1610         * platform/encryptedmedia/CDMInstanceSession.h:
1611         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1612         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1613         (-[WebCoreFPSContentKeySessionDelegate initWithParent:]):
1614         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
1615         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
1616         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1617         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
1618         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
1619         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::~CDMInstanceSessionFairPlayStreamingAVFObjC):
1620         (WebCore::keyIDsForRequest):
1621         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
1622         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
1623         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
1624         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
1625         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
1626         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
1627         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
1628         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
1629         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
1630         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
1631         (WebCore::requestStatusToCDMStatus):
1632         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
1633         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1634         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
1635         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1636         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1637         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1638         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
1639         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
1640         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
1641         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1642         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1643         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1644         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
1645         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
1646         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
1647         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
1648         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1649         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1650         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
1651         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached):
1652         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceDetached):
1653         (WebCore::MediaSourcePrivateAVFObjC::attemptToDecryptWithInstance):
1654         (WebCore::MediaSourcePrivateAVFObjC::waitingForKey const):
1655         (WebCore::MediaSourcePrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1656         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1657         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1658         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1659         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
1660         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
1661         (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
1662         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1663
1664 2018-10-31  Zach Li  <zacharyli323@gmail.com>
1665
1666         Add credit card autofill button
1667         https://bugs.webkit.org/show_bug.cgi?id=191051
1668         <rdar://problem/45657011>
1669
1670         Reviewed by Wenson Hsieh.
1671
1672         Test: fast/forms/auto-fill-button/input-credit-card-auto-fill-button.html
1673
1674         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1675         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1676         * css/html.css:
1677         (input::-webkit-credit-card-auto-fill-button):
1678         Add credit card autofill button.
1679         (input::-webkit-credit-card-auto-fill-button:hover):
1680         (input::-webkit-credit-card-auto-fill-button:active):
1681         * html/HTMLTextFormControlElement.h:
1682         * html/TextFieldInputType.cpp:
1683         (WebCore::autoFillButtonTypeToAccessibilityLabel):
1684         (WebCore::autoFillButtonTypeToAutoFillButtonText):
1685         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
1686         (WebCore::isAutoFillButtonTypeChanged):
1687         * platform/LocalizedStrings.cpp:
1688         (WebCore::AXAutoFillCreditCardLabel):
1689         * platform/LocalizedStrings.h:
1690         * testing/Internals.cpp:
1691         (WebCore::toAutoFillButtonType):
1692         (WebCore::toInternalsAutoFillButtonType):
1693         * testing/Internals.h:
1694         * testing/Internals.idl:
1695
1696 2018-10-31  Eric Carlson  <eric.carlson@apple.com>
1697
1698         [MediaStream] Don't reveal device IDs until the user has granted permission to capture
1699         https://bugs.webkit.org/show_bug.cgi?id=191112
1700         <rdar://problem/45699932>
1701
1702         Reviewed by Youenn Fablet.
1703
1704         No new tests, existing tests updated.
1705
1706         * Modules/mediastream/MediaDevicesRequest.cpp:
1707         (WebCore::MediaDevicesRequest::start): Don't reveal device ID or group ID until the user 
1708         has granted permssion to capture.
1709
1710 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
1711
1712         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
1713         https://bugs.webkit.org/show_bug.cgi?id=190778
1714
1715         Reviewed by Youenn Fablet.
1716
1717         Implement JavaScript dispatch event dataavailable and JavaScript exposed method stop().
1718         Implement a mock string as the output buffer of MediaRecorder.
1719         Remove the declaration of timecode in BlobEvent since it has not been implemented in MediaRecorder and MediaRecorderPrivate. 
1720
1721         Tests: http/wpt/mediarecorder/MediaRecorder-dataavailable.html
1722                http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html
1723                imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html
1724                imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html
1725
1726         * CMakeLists.txt:
1727         * Modules/mediarecorder/BlobEvent.cpp: Added.
1728         (WebCore::BlobEvent::create):
1729         (WebCore::BlobEvent::BlobEvent):
1730         (WebCore::BlobEvent::eventInterface const):
1731         * Modules/mediarecorder/BlobEvent.h:
1732         * Modules/mediarecorder/BlobEvent.idl:
1733         * Modules/mediarecorder/MediaRecorder.cpp:
1734         (WebCore::MediaRecorder::MediaRecorder):
1735         (WebCore::MediaRecorder::~MediaRecorder):
1736         (WebCore::MediaRecorder::stop):
1737         (WebCore::MediaRecorder::startRecording):
1738         (WebCore::MediaRecorder::stopRecording):
1739         (WebCore::MediaRecorder::stopRecordingInternal):
1740         (WebCore::MediaRecorder::didAddOrRemoveTrack):
1741         (WebCore::MediaRecorder::trackEnded):
1742         (WebCore::MediaRecorder::sampleBufferUpdated):
1743         (WebCore::MediaRecorder::audioSamplesAvailable):
1744         (WebCore::MediaRecorder::scheduleDeferredTask):
1745         * Modules/mediarecorder/MediaRecorder.h:
1746         * Modules/mediarecorder/MediaRecorder.idl:
1747         * Sources.txt:
1748         * WebCore.xcodeproj/project.pbxproj:
1749         * dom/EventNames.h:
1750         * dom/EventNames.in:
1751         * platform/mediarecorder/MediaRecorderPrivate.h: Added.
1752         * platform/mediarecorder/MediaRecorderPrivateMock.cpp: Added.
1753         (WebCore::MediaRecorderPrivateMock::sampleBufferUpdated):
1754         (WebCore::MediaRecorderPrivateMock::audioSamplesAvailable):
1755         (WebCore::MediaRecorderPrivateMock::generateMockString):
1756         (WebCore::MediaRecorderPrivateMock::fetchData):
1757         * platform/mediarecorder/MediaRecorderPrivateMock.h: Added.
1758
1759 2018-10-31  Claudio Saavedra  <csaavedra@igalia.com>
1760
1761         [GTK][WPE] Remaining topPrivatelyControlledDomain() fixes
1762         https://bugs.webkit.org/show_bug.cgi?id=191110
1763
1764         Reviewed by Michael Catanzaro.
1765
1766         Covered by existing tests.
1767
1768         Turns out that this method is expected to reject domains that
1769         are not registrable. Also sync with the Mac implementation in
1770         that given domains that are not all ASCII should be returned
1771         back as is. This fixes the remaining Public Suffix API tests.
1772
1773         * platform/soup/PublicSuffixSoup.cpp:
1774         (WebCore::topPrivatelyControlledDomain):
1775
1776 2018-10-31  Antti Koivisto  <antti@apple.com>
1777
1778         Remove LayerFlushScheduler
1779         https://bugs.webkit.org/show_bug.cgi?id=191103
1780
1781         Reviewed by Anders Carlsson.
1782
1783         It is only used in WK1.
1784
1785         * SourcesCocoa.txt:
1786         * WebCore.xcodeproj/project.pbxproj:
1787         * platform/graphics/ca/LayerFlushScheduler.cpp: Removed.
1788         * platform/graphics/ca/LayerFlushScheduler.h: Removed.
1789         * platform/graphics/ca/LayerFlushSchedulerClient.h: Removed.
1790         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed.
1791
1792 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1793
1794         Missing from r237634
1795
1796         * layout/inlineformatting/InlineFormattingState.cpp:
1797         (WebCore::Layout::InlineFormattingState::formattingContext):
1798
1799 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1800
1801         [LFC] Do not pass LayoutState& to compute* and layout* functions
1802         https://bugs.webkit.org/show_bug.cgi?id=191100
1803
1804         Reviewed by Antti Koivisto.
1805
1806         Reduce noise by removing LayoutState& parameter where possible.
1807
1808         * layout/FormattingContext.cpp:
1809         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1810         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1811         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1812         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
1813         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1814         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1815         * layout/FormattingContext.h:
1816         * layout/FormattingContextGeometry.cpp:
1817         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1818         * layout/LayoutFormattingState.cpp:
1819         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1820         * layout/blockformatting/BlockFormattingContext.cpp:
1821         (WebCore::Layout::BlockFormattingContext::layout const):
1822         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1823         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1824         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1825         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1826         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1827         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1828         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1829         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1830         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1831         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1832         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1833         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1834         * layout/blockformatting/BlockFormattingContext.h:
1835         * layout/inlineformatting/InlineFormattingContext.cpp:
1836         (WebCore::Layout::InlineFormattingContext::layout const):
1837         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
1838         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1839         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1840         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
1841         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
1842         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
1843         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
1844         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1845         * layout/inlineformatting/InlineFormattingContext.h:
1846
1847 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1848
1849         [LFC] FormattingContext class should take FormattingState&
1850         https://bugs.webkit.org/show_bug.cgi?id=191099
1851
1852         Reviewed by Antti Koivisto.
1853
1854         This is in preparation for not passing LayoutState& into every layout functions.
1855         FormattingContext has FormattingState now and LayoutState can be acquired through FormattingState.
1856         LayoutState <- FormattingState <- FormattingContext
1857
1858         * layout/FormattingContext.cpp:
1859         (WebCore::Layout::FormattingContext::FormattingContext):
1860         (WebCore::Layout::FormattingContext::formattingState const):
1861         (WebCore::Layout::FormattingContext::layoutState const):
1862         * layout/FormattingContext.h:
1863         * layout/FormattingState.cpp:
1864         (WebCore::Layout::FormattingState::FormattingState):
1865         * layout/FormattingState.h:
1866         (WebCore::Layout::FormattingState::layoutState const):
1867         * layout/LayoutFormattingState.h:
1868         * layout/blockformatting/BlockFormattingContext.cpp:
1869         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
1870         * layout/blockformatting/BlockFormattingContext.h:
1871         * layout/blockformatting/BlockFormattingState.cpp:
1872         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
1873         (WebCore::Layout::BlockFormattingState::formattingContext):
1874         (WebCore::Layout::BlockFormattingState::formattingContext const): Deleted.
1875         * layout/blockformatting/BlockFormattingState.h:
1876         * layout/inlineformatting/InlineFormattingContext.cpp:
1877         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
1878         * layout/inlineformatting/InlineFormattingContext.h:
1879         * layout/inlineformatting/InlineFormattingState.cpp:
1880         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
1881         (WebCore::Layout::InlineFormattingState::formattingContext):
1882         (WebCore::Layout::InlineFormattingState::formattingContext const): Deleted.
1883         * layout/inlineformatting/InlineFormattingState.h:
1884
1885 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1886
1887         [LFC] The *FormattingState class should provide the *FormattingContext.
1888         https://bugs.webkit.org/show_bug.cgi?id=191089
1889
1890         Reviewed by Antti Koivisto.
1891
1892         BlockFormattingState provides the BlockFormattingContext object, while InlineFormattingState provides the InlineFormattingContext.
1893
1894         * layout/FormattingContext.cpp:
1895         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1896         * layout/FormattingState.h:
1897         * layout/LayoutFormattingState.cpp:
1898         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1899         (WebCore::Layout::LayoutState::formattingContext const): Deleted.
1900         * layout/LayoutFormattingState.h:
1901         * layout/blockformatting/BlockFormattingContext.cpp:
1902         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1903         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1904         * layout/blockformatting/BlockFormattingState.cpp:
1905         (WebCore::Layout::BlockFormattingState::formattingContext const):
1906         * layout/blockformatting/BlockFormattingState.h:
1907         * layout/inlineformatting/InlineFormattingContext.cpp:
1908         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1909         * layout/inlineformatting/InlineFormattingState.cpp:
1910         (WebCore::Layout::InlineFormattingState::formattingContext const):
1911         * layout/inlineformatting/InlineFormattingState.h:
1912
1913 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1914
1915         [LFC] Rename LayoutContext to LayoutState
1916         https://bugs.webkit.org/show_bug.cgi?id=191080
1917
1918         Reviewed by Antti Koivisto.
1919
1920         LayoutContext naming was a bit misleading since none of the other *FormattingContext classes (BlockFormattingContext etc) hold states.
1921         (LayoutContext.cpp -> LayoutFormattingState.cpp because LayoutState.cpp name is already taken.)
1922
1923         Now the current state is as follows:
1924
1925         LayoutState has
1926         1. Layout tree
1927         2. State content for each formatting subtrees
1928         3. Display tree
1929
1930         * Sources.txt:
1931         * WebCore.xcodeproj/project.pbxproj:
1932         * layout/FormattingContext.cpp:
1933         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1934         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1935         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1936         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
1937         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1938         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
1939         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
1940         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
1941         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1942         * layout/FormattingContext.h:
1943         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
1944         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1945         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
1946         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1947         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1948         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1949         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1950         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1951         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1952         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1953         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1954         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
1955         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1956         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1957         * layout/FormattingContextGeometry.cpp:
1958         (WebCore::Layout::contentHeightForFormattingContextRoot):
1959         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
1960         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
1961         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
1962         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
1963         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1964         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1965         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1966         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1967         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1968         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1969         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1970         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
1971         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1972         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
1973         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1974         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
1975         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1976         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1977         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1978         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
1979         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1980         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1981         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1982         * layout/FormattingState.cpp:
1983         (WebCore::Layout::FormattingState::FormattingState):
1984         * layout/FormattingState.h:
1985         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints):
1986         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const):
1987         * layout/LayoutFormattingState.cpp: Renamed from Source/WebCore/layout/LayoutContext.cpp.
1988         (WebCore::Layout::LayoutState::LayoutState):
1989         (WebCore::Layout::LayoutState::initializeRoot):
1990         (WebCore::Layout::LayoutState::updateLayout):
1991         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1992         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
1993         (WebCore::Layout::LayoutState::styleChanged):
1994         (WebCore::Layout::LayoutState::markNeedsUpdate):
1995         (WebCore::Layout::LayoutState::formattingStateForBox const):
1996         (WebCore::Layout::LayoutState::establishedFormattingState const):
1997         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
1998         (WebCore::Layout::LayoutState::formattingContext const):
1999         * layout/LayoutFormattingState.h: Renamed from Source/WebCore/layout/LayoutContext.h.
2000         (WebCore::Layout::LayoutState::setInQuirksMode):
2001         (WebCore::Layout::LayoutState::hasDisplayBox const):
2002         (WebCore::Layout::LayoutState::inQuirksMode const):
2003         * layout/Verification.cpp:
2004         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2005         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2006         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2007         (WebCore::Layout::verifyAndOutputSubtree):
2008         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2009         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): Deleted.
2010         * layout/blockformatting/BlockFormattingContext.cpp:
2011         (WebCore::Layout::BlockFormattingContext::layout const):
2012         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2013         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2014         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
2015         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
2016         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2017         (WebCore::Layout::hasPrecomputedMarginTop):
2018         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2019         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2020         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2021         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
2022         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2023         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2024         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2025         * layout/blockformatting/BlockFormattingContext.h:
2026         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2027         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2028         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2029         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2030         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2031         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2032         (WebCore::Layout::isStretchedToInitialContainingBlock):
2033         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2034         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2035         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2036         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
2037         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2038         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2039         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2040         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
2041         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
2042         * layout/blockformatting/BlockFormattingState.cpp:
2043         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
2044         * layout/blockformatting/BlockFormattingState.h:
2045         * layout/blockformatting/BlockInvalidation.cpp:
2046         (WebCore::Layout::computeUpdateType):
2047         (WebCore::Layout::computeUpdateTypeForAncestor):
2048         (WebCore::Layout::BlockInvalidation::invalidate):
2049         * layout/blockformatting/BlockInvalidation.h:
2050         * layout/blockformatting/BlockMarginCollapse.cpp:
2051         (WebCore::Layout::isMarginTopCollapsedWithParent):
2052         (WebCore::Layout::isMarginBottomCollapsedThrough):
2053         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
2054         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
2055         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
2056         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
2057         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
2058         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
2059         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
2060         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
2061         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
2062         * layout/displaytree/DisplayBox.h:
2063         * layout/floats/FloatAvoider.cpp:
2064         (WebCore::Layout::FloatAvoider::FloatAvoider):
2065         * layout/floats/FloatAvoider.h:
2066         * layout/floats/FloatBox.cpp:
2067         (WebCore::Layout::FloatBox::FloatBox):
2068         * layout/floats/FloatBox.h:
2069         * layout/floats/FloatingContext.cpp:
2070         (WebCore::Layout::FloatingContext::positionForFloat const):
2071         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
2072         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2073         * layout/floats/FloatingContext.h:
2074         (WebCore::Layout::FloatingContext::layoutState const):
2075         (WebCore::Layout::FloatingContext::layoutContext const): Deleted.
2076         * layout/floats/FloatingState.cpp:
2077         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
2078         (WebCore::Layout::FloatingState::FloatingState):
2079         (WebCore::Layout::FloatingState::constraints const):
2080         * layout/floats/FloatingState.h:
2081         (WebCore::Layout::FloatingState::create):
2082         (WebCore::Layout::FloatingState::layoutState const):
2083         (WebCore::Layout::FloatingState::layoutContext const): Deleted.
2084         * layout/inlineformatting/InlineFormattingContext.cpp:
2085         (WebCore::Layout::InlineFormattingContext::layout const):
2086         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
2087         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2088         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2089         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
2090         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
2091         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
2092         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
2093         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2094         * layout/inlineformatting/InlineFormattingContext.h:
2095         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2096         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2097         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2098         * layout/inlineformatting/InlineFormattingState.cpp:
2099         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
2100         * layout/inlineformatting/InlineFormattingState.h:
2101         * layout/inlineformatting/InlineInvalidation.cpp:
2102         (WebCore::Layout::InlineInvalidation::invalidate):
2103         * layout/inlineformatting/InlineInvalidation.h:
2104         * layout/inlineformatting/InlineLineBreaker.cpp:
2105         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
2106         (WebCore::Layout::InlineLineBreaker::runWidth const):
2107         * layout/inlineformatting/InlineLineBreaker.h:
2108         * layout/layouttree/LayoutTreeBuilder.cpp:
2109         (WebCore::Layout::outputInlineRuns):
2110         (WebCore::Layout::outputLayoutTree):
2111         (WebCore::Layout::showLayoutTree):
2112         * layout/layouttree/LayoutTreeBuilder.h:
2113         * page/FrameViewLayoutContext.cpp:
2114         (WebCore::layoutUsingFormattingContext):
2115
2116 2018-10-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2117
2118         [Cocoa] Attachment dropped from one web view to another is missing its file wrapper
2119         https://bugs.webkit.org/show_bug.cgi?id=190530
2120         <rdar://problem/45232149>
2121
2122         Reviewed by Tim Horton.
2123
2124         Add support for copying and pasting attachment elements across web views by encoding and adding file wrapper
2125         data as subresources in the web archive when writing selected web content to the pasteboard, and then decoding
2126         and creating NSFileWrappers upon reading web content.
2127
2128         Test: WKAttachmentTests.CopyAndPasteBetweenWebViews
2129
2130         * WebCore.xcodeproj/project.pbxproj:
2131         * editing/Editor.cpp:
2132         (WebCore::Editor::registerAttachments):
2133         * editing/Editor.h:
2134
2135         Add registerAttachments(), which registers _WKAttachments in the UI process given a list of
2136         SerializedAttachmentData. This behaves similarly to registerAttachmentIdentifiers(), but differs in that (1) it
2137         sends serialized file wrapper data, and (2) it sends a list of serialized attachments, rather than information
2138         about just a single attachment.
2139
2140         * editing/SerializedAttachmentData.h:
2141
2142         Introduce SerializedAttachmentData, a struct containing information needed to serialize and deserialize an
2143         attachment. These are used both when writing attachment data to the pasteboard, and when consuming attachment
2144         data upon paste.
2145
2146         * editing/cocoa/WebContentReaderCocoa.mm:
2147         (WebCore::replaceRichContentWithAttachments):
2148
2149         Add a step when pasting rich content with attachments, to collect and send serialized attachments to the client.
2150         Also, drive-by fix: don't WTFMove() the Ref here if it's still going to be used below.
2151
2152         * html/HTMLAttachmentElement.cpp:
2153         (WebCore::HTMLAttachmentElement::archiveResourceURL):
2154         * html/HTMLAttachmentElement.h:
2155
2156         Add a static helper function to compute a URL that represents the data for the given attachment identifier, for
2157         use in a web archive resource.
2158
2159         * loader/archive/cf/LegacyWebArchive.cpp:
2160         (WebCore::addSubresourcesForAttachmentElementsIfNecessary):
2161
2162         Add a helper function to create and append ArchiveResources representing attachment element data when writing
2163         attachments to the pasteboard via web archive data.
2164
2165         (WebCore::LegacyWebArchive::create):
2166         * page/EditorClient.h:
2167         (WebCore::EditorClient::registerAttachments):
2168         (WebCore::EditorClient::serializedAttachmentDataForIdentifiers):
2169
2170 2018-10-30  David Kilzer  <ddkilzer@apple.com>
2171
2172         XSLTProcessor should limit max transform depth
2173         <https://webkit.org/b/191075>
2174         <rdar://problem/45531453>
2175
2176         Reviewed by Alex Christensen.
2177
2178         Test: fast/xsl/xslt-max-depth.html
2179
2180         * xml/SoftLinkLibxslt.cpp: Add macro for `xsltMaxDepth` global.
2181         * xml/SoftLinkLibxslt.h: Ditto.
2182         * xml/XSLTProcessorLibxslt.cpp:
2183         (WebCore::XSLTProcessor::transformToString): Set `xsltMaxDepth`
2184         to 1000.  Default in libxslt.dylib is 3000.
2185
2186 2018-10-30  Jim Mason  <jmason@ibinx.com>
2187
2188         [GTK] Scrollbars not following gtk-primary-button-warps-slider setting
2189         https://bugs.webkit.org/show_bug.cgi?id=191067
2190
2191         Reviewed by Michael Catanzaro.
2192
2193         * platform/gtk/ScrollbarThemeGtk.cpp:
2194         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
2195
2196 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2197
2198         Clean up some obsolete MAX_ALLOWED macros
2199         https://bugs.webkit.org/show_bug.cgi?id=190916
2200
2201         Reviewed by Tim Horton.
2202
2203         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2204         (WebCore::exernalDeviceDisplayNameForPlayer):
2205         * platform/mac/PlatformEventFactoryMac.mm:
2206         (WebCore::globalPointForEvent):
2207         (WebCore::pointForEvent):
2208         (WebCore::mouseButtonForEvent):
2209         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2210
2211 2018-10-30  Ali Juma  <ajuma@chromium.org>
2212
2213         Calling window.open("", "_self") allows working around restrictions on window.close()
2214         https://bugs.webkit.org/show_bug.cgi?id=191073
2215
2216         Reviewed by Chris Dumez.
2217
2218         Do not treat a re-used frame in DOMWindow::createWindow as having been opened by DOM.
2219
2220         Test: fast/dom/Window/window-open-self-disallow-close.html
2221
2222         * page/DOMWindow.cpp:
2223         (WebCore::DOMWindow::createWindow):
2224
2225 2018-10-30  Andy Estes  <aestes@apple.com>
2226
2227         [Payment Request] Implement PaymentResponse.retry()
2228         https://bugs.webkit.org/show_bug.cgi?id=190985
2229
2230         Reviewed by Daniel Bates.
2231
2232         Implemented the retry() method on PaymentResponse as specified in the Payment Request API
2233         W3C Editor's Draft of 24 October 2018.
2234
2235         See https://w3c.github.io/payment-request/#retry-method for details.
2236
2237         Tests: http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html
2238                http/tests/paymentrequest/payment-response-retry-method.https.html
2239
2240         * Modules/applepay/PaymentCoordinator.h:
2241         (WebCore::PaymentCoordinator::client): Added. Returns m_client.
2242         * Modules/applepay/PaymentCoordinatorClient.h:
2243         (WebCore::PaymentCoordinatorClient::isMockPaymentCoordinator const): Added. Used to downcast
2244         a PaymentCoordinatorClient to a MockPaymentCoordinator.
2245         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2246         (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems const): Made const.
2247         (WebCore::ApplePayPaymentHandler::computeErrors const): Broke this function into
2248         computeAddressErrors, computePayerErrors, and computePaymentMethodErrors, then modified this
2249         function to call those functions. Exceptions thrown by computePaymentMethodErrors are ignored.
2250         (WebCore::ApplePayPaymentHandler::computeAddressErrors const): Added.
2251         (WebCore::ApplePayPaymentHandler::computePayerErrors const): Added.
2252         (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): Added.
2253         (WebCore::ApplePayPaymentHandler::complete): Added ASSERTs to verify whether result is a
2254         final result.
2255         (WebCore::ApplePayPaymentHandler::retry): Computed PaymentErrors from PaymentValidationErrors,
2256         ensured the PaymentAuthorizationResult was non-final by adding an unknown error if necessary,
2257         and called PaymentCoordinator::completePaymentSession.
2258         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2259         * Modules/paymentrequest/PaymentHandler.h:
2260         * Modules/paymentrequest/PaymentRequest.cpp:
2261         (WebCore::PaymentRequest::show): Changed to call settleShowPromise.
2262         (WebCore::PaymentRequest::abortWithException): Changed to abort PaymentResponse's retry
2263         promise, if present, instead of PaymentResponse's show promise.
2264         (WebCore::PaymentRequest::settleShowPromise): Added. Settles m_showPromise then sets it to
2265         std::nullopt.
2266         (WebCore::PaymentRequest::closeActivePaymentHandler): Added. Hides the active payment
2267         handler then sets it to std::nullopt.
2268         (WebCore::PaymentRequest::stop): Stopped calling abortWithException, since that function
2269         might settle PaymentResponse's retry promise. PaymentResponse is now an ActiveDOMObject and
2270         will settle its own promise in its implementation of stop.
2271         (WebCore::PaymentRequest::abort): Changed to throw an InvalidStateError if there is a
2272         pending retry promise and to call abortWithException instead of stop.
2273         (WebCore::PaymentRequest::completeMerchantValidation): Changed to call abortWithException
2274         instead of stop.
2275         (WebCore::PaymentRequest::settleDetailsPromise): Ditto.
2276         (WebCore::PaymentRequest::accept): Updated the existing PaymentResponse, if present, rather
2277         than creating a new one. Settled the existing PaymentResponse's retry promise, if present,
2278         rather than the show promise.
2279         (WebCore::PaymentRequest::complete): Changed to throw an AbortError if there is no longer an
2280         active payment handler.
2281         (WebCore::PaymentRequest::retry): Changed to throw an AbortError if there is no longer an
2282         active payment handler, and to call PaymentHandler::retry if there is.
2283         (WebCore::PaymentRequest::cancel): Changed to call abortWithException instead of stop.
2284         * Modules/paymentrequest/PaymentRequest.h:
2285         * Modules/paymentrequest/PaymentRequest.idl:
2286         * Modules/paymentrequest/PaymentResponse.cpp:
2287         (WebCore::PaymentResponse::PaymentResponse):
2288         (WebCore::PaymentResponse::finishConstruction): Pending activities create strong references
2289         to |this|, so they cannot be created in constructors without relaxing adoption requirements.
2290         Added this function so that the pending activity can be created after the PaymentResponse is
2291         created and adopted.
2292         (WebCore::PaymentResponse::~PaymentResponse):
2293         (WebCore::PaymentResponse::complete): Updated to throw an AbortError or InvalidStateError
2294         when necessary.
2295         (WebCore::PaymentResponse::retry): Implemented. Throws an AbortError or InvalidStateError
2296         when necessary, otherwise calls PaymentRequest::retry and stores the retry promise in
2297         m_retryPromise.
2298         (WebCore::PaymentResponse::abortWithException): Added. Rejects the retry promise with
2299         |exception|, clears the pending activity, and sets m_state to Completed.
2300         (WebCore::PaymentResponse::settleRetryPromise): Added. Settles the retry promise and sets it
2301         to std::nullopt.
2302         (WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Added. Returns true if
2303         there is no pending activity.
2304         (WebCore::PaymentResponse::stop): Added. Rejects the retry promise with AbortError, clears
2305         the pending activity, and sets m_state to Stopped.
2306         * Modules/paymentrequest/PaymentResponse.h: Changed create to call finishConstruction and
2307         made PaymentResponse an ActiveDOMObject instead of a ContextDestructionObserver.
2308         * testing/Internals.cpp:
2309         (WebCore::Internals::Internals): Changed to only create a MockPaymentCoordinator for main frames.
2310         (WebCore::Internals::mockPaymentCoordinator): Changed to get the MockPaymentCoordinator by
2311         downcasting the page's payment coordinator client.
2312         * testing/Internals.h:
2313         * testing/Internals.idl:
2314         * testing/MockPaymentCoordinator.cpp:
2315         (WebCore::MockPaymentCoordinator::completePaymentSession): Changed to only increment
2316         hideCount for final results.
2317         * testing/MockPaymentCoordinator.h:
2318         (isType): Added so that PaymentCoordinatorClients can be downcasted to MockPaymentCoordinators.
2319
2320 2018-10-30  Zalan Bujtas  <zalan@apple.com>
2321
2322         [iOS] Use the mainframe view size to compute window.outerWidth/height.
2323         https://bugs.webkit.org/show_bug.cgi?id=191070
2324         <rdar://problem/42368377>
2325
2326         Reviewed by Tim Horton.
2327
2328         Use a more reasonable value for window.outerWidth and height.
2329         (WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size)
2330
2331         * page/DOMWindow.cpp:
2332         (WebCore::DOMWindow::outerHeight const):
2333         (WebCore::DOMWindow::outerWidth const):
2334
2335 2018-10-30  Andy Estes  <aestes@apple.com>
2336
2337         [Apple Pay] PaymentRequest.canMakePayment() should resolve to true whenever Apple Pay is available
2338         https://bugs.webkit.org/show_bug.cgi?id=191039
2339
2340         Reviewed by Megan Gardner.
2341
2342         During a recent Web Payments WG F2F, we decided that canMakePayment() should return true
2343         whenever the user agent supports one or more of the specified payment methods, even if those
2344         payment methods do not have active instruments.
2345
2346         Change WebKit's implementation of canMakePayment() for Apple Pay to resolve with the value
2347         of ApplePaySession.canMakePayments() rather than ApplePaySession.canMakePaymentsWithActiveCard().
2348
2349         Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
2350
2351         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2352         (WebCore::ApplePayPaymentHandler::canMakePayment):
2353         (WebCore::shouldDiscloseApplePayCapability): Deleted.
2354         * testing/MockPaymentCoordinator.cpp:
2355         (WebCore::MockPaymentCoordinator::canMakePayments):
2356         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
2357         * testing/MockPaymentCoordinator.h:
2358         * testing/MockPaymentCoordinator.idl:
2359
2360 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
2361
2362         Add a deprecation warning to console for Web SQL
2363         https://bugs.webkit.org/show_bug.cgi?id=190936
2364
2365         Reviewed by Ryosuke Niwa.
2366
2367         No new tests. Just adding a console message.
2368
2369         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2370         (WebCore::DOMWindowWebDatabase::openDatabase):
2371
2372 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
2373
2374         IndexedDB: iteration of cursors skip records if updated or deleted
2375         https://bugs.webkit.org/show_bug.cgi?id=190917
2376         <rdar://problem/35250410>
2377
2378         Reviewed by Chris Dumez.
2379
2380         When object store has changes, we cleared cached records and reset the SQLite statement, 
2381         updating the boundary to the next key in cursor's direction. Therefore, the cursor could 
2382         jump to the next key after update or deletion.
2383         We should cache those records before changing the statement.
2384
2385         Test: storage/indexeddb/cursor-update-while-iterating.html
2386
2387         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2388         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
2389         (WebCore::IDBServer::SQLiteIDBCursor::fetch):
2390         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2391
2392 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2393
2394         [LFC][IFC] Introduce InlineFormattingContextGeometry class
2395         https://bugs.webkit.org/show_bug.cgi?id=191054
2396
2397         Reviewed by Antti Koivisto.
2398
2399         This is in preparation for inline-block support.
2400
2401         Move float and inline-block elements layout to layoutFormattingContextRoot().
2402         computeWidthAndHeightForInlineBox takes care of replaced elements.
2403
2404         * Sources.txt:
2405         * WebCore.xcodeproj/project.pbxproj:
2406         * layout/inlineformatting/InlineFormattingContext.cpp:
2407         (WebCore::Layout::InlineFormattingContext::layout const):
2408         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2409         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
2410         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): Deleted.
2411         * layout/inlineformatting/InlineFormattingContext.h:
2412         * layout/inlineformatting/InlineFormattingContextGeometry.cpp: Added.
2413         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2414         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2415
2416 2018-10-28  Antoine Quint  <graouts@apple.com>
2417
2418         [Web Animations] Implement the update animations and send events procedure
2419         https://bugs.webkit.org/show_bug.cgi?id=191013
2420         <rdar://problem/45620495>
2421
2422         Reviewed by Dean Jackson.
2423
2424         While we implemented the various parts of what the Web Animations specification refers to as the "update animations and send events"
2425         procedure, we did not implement it as one function and in the correct order, specifically updating animations and sending events in
2426         two separate tasks. We now have a single method on DocumentTimeline which runs as the DisplayRefreshMonitor fires to update each
2427         "relevant" animation with the current time, perform a microtask checkpoint and dispatch events.
2428
2429         Implementing this procedure allowed us to make several enhancements:
2430
2431         1. We introduce the concept of a "relevant" animation, which is essentially an animation that is either pending or playing. All animations
2432         in a different state are no longer owned by the DocumentTimeline and can thus be destroyed if the developer doesn't hold references in JS.
2433         Maintaining such a list guarantees that we're only updating animations that would have changed state since the last time the "update animations
2434         and send events" procedure was run. Note that DeclarativeAnimation instances are also considered to be relevant if they have queued DOM events
2435         to dispatch as they could otherwise be destroyed before they can fully dispatch them.
2436
2437         2. We no longer conflate the timing model and effects. Until now the way we would update animations was to go through all elements for which
2438         we had a registered animation, invalidate their style and finally forcing a style update on the document. We had a separate data structure where
2439         we help animations without targets so we update these as well in a separate pass, in order to make sure that promises and events would fire for
2440         them as expected. We now let the "update animations and send events" procedure update the timing of all relevant animations and let individual
2441         animation effects invalidate their style as needed, the document style invalidation happening naturally without DocumentTimeline forcing it. 
2442
2443         3. We use a single step to schedule the update of animations, which is to register for a display refresh monitor update provided a "relevant"
2444         animation is known since the previous update. Until now we first had an "timing model invalidation" task scheduled upon any change of an animation's
2445         timing model, which would then create a timer to the earliest moment any listed animation would require an update, finally registering a display
2446         refresh monitor update, which used at least GenericTaskQueue<Timer> and potentially two, whereas we use none right now.
2447
2448         4. We allow for a display refresh monitor update to be canceled should the number of "relevant" animations since the last update goes back to 0.
2449
2450         To facilitate all of this, we have changed the m_animations ListHashSet to contain only the "relevant" animations, and no longer every animation created
2451         that has this DocumentTimeline set as their "timeline" property. To keep this list current, every single change that changes a given animation's timing
2452         ends up calling AnimationTimeline::animationTimingDidChange() passing the animation as the sole parameter and adding this animation to m_animations. We
2453         immediately schedule a display refresh monitor update if one wasn't already scheduled. Then, when running the "update animations and send events"
2454         procedure, we call a new WebAnimation::tick() method on each of those animations, which updates this animation's effect and relevance, using the newly
2455         computed relevance to identify whether this animation should be kept in the m_animations ListHashSet.
2456
2457         This is only the first step towards a more efficient update and ownership model of animations by the document timeline since animations created as CSS
2458         Animations and CSS Transitions are committed through CSS have dedicated data structures that are not updated in this particular patch, but this will be
2459         addressed in a followup to keep this already significant patch smaller. Another issue that will be addressed later is the ability to not schedule display
2460         refresh monitor udpates when only accelerated animations are running.
2461
2462         * animation/AnimationTimeline.cpp:
2463         (WebCore::AnimationTimeline::animationTimingDidChange): Called by animations when any aspect of their timing model changes. The provided animation is then
2464         added to the m_animations list unless its timeline is no longer this timeline.
2465         (WebCore::AnimationTimeline::removeAnimation): Remove the provided animation from m_animations and remove any animation registered on the element-specific
2466         animation lists if this animation has an effect with a target.
2467         (WebCore::AnimationTimeline::animationWasAddedToElement): We no longer need to worry about the m_animationsWithoutTarget data structure since we removed it.
2468         (WebCore::removeCSSTransitionFromMap): Fix a bug where we would remove any CSSTransition in the provided map that had a matching transition-property instead
2469         of checking the CSSTransition registered for this transition-property was indeed the provided CSSTransition. The other code changes in this patch made this
2470         code now cause regressions in the Web Platform Tests.
2471         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Stop updating m_animationsWithoutTarget since it no longer exists.
2472         (WebCore::AnimationTimeline::elementWasRemoved):
2473         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Fix a small error that caused a regression in the Web Platform Tests where we could attempt to
2474         call setBackingAnimation() on a nullptr instead of a valid CSSAnimation.
2475         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
2476         (WebCore::AnimationTimeline::addAnimation): Deleted.
2477         * animation/AnimationTimeline.h:
2478         (WebCore::AnimationTimeline::hasElementAnimations const): Deleted.
2479         (WebCore::AnimationTimeline:: const): Deleted.
2480         (WebCore::AnimationTimeline::elementToAnimationsMap): Deleted.
2481         (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Deleted.
2482         (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Deleted.
2483         * animation/CSSTransition.cpp:
2484         (WebCore::CSSTransition::canBeListed const): Deleted.
2485         * animation/CSSTransition.h:
2486         * animation/DeclarativeAnimation.cpp:
2487         (WebCore::DeclarativeAnimation::tick): Call the superclass's method and queue any necessary DOM events reflecting the timing model changes.
2488         (WebCore::DeclarativeAnimation::needsTick const): Call the superclass's method and return true also if we have pending events since otherwise this animation
2489         could be removed from m_animations on its AnimationTimeline and potentially destroyed before the GenericEventQueue had a chance to dispatch all events.
2490         (WebCore::DeclarativeAnimation::startTime const): We removed the custom binding for this IDL property and renamed the method from bindingsStartTime to startTime.
2491         (WebCore::DeclarativeAnimation::setStartTime): We removed the custom binding for this IDL property and renamed the method from setBindingsStartTime to setStartTime.
2492         (WebCore::DeclarativeAnimation::bindingsStartTime const): Deleted.
2493         (WebCore::DeclarativeAnimation::setBindingsStartTime): Deleted.
2494         * animation/DeclarativeAnimation.h:
2495         * animation/DocumentAnimationScheduler.cpp:
2496         (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution): Add a method to mark that we no longer need a display refresh monitor update for this
2497         document's animation timeline. This is called when m_animations becomes empty.
2498         * animation/DocumentAnimationScheduler.h:
2499         * animation/DocumentTimeline.cpp:
2500         (WebCore::DocumentTimeline::DocumentTimeline):
2501         (WebCore::DocumentTimeline::detachFromDocument): Stop clearing two task queues and a timer that no longer exist and instead only clear the task queue to clear
2502         the cached current time, which we queue any time we generate a new one (see DocumentTimeline::currentTime).
2503         (WebCore::DocumentTimeline::getAnimations const): Use isRelevant() instead of canBeListed().
2504         (WebCore::DocumentTimeline::updateThrottlingState):
2505         (WebCore::DocumentTimeline::suspendAnimations):
2506         (WebCore::DocumentTimeline::resumeAnimations):
2507         (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const):
2508         (WebCore::DocumentTimeline::currentTime): Queue a task in the new m_currentTimeClearingTaskQueue task queue to clear the current time that we've generated and cached
2509         in the next run loop (provided all pending JS execution has also completed). 
2510         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime):
2511         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Schedule a display refresh monitor update if we are not suspended and have "relevant" animations.
2512         (WebCore::DocumentTimeline::animationTimingDidChange): Call scheduleAnimationResolutionIfNeeded() after calling the superclass's implementation.
2513         (WebCore::DocumentTimeline::removeAnimation): Call unscheduleAnimationResolution() if the list of "relevant" animations is now empty.
2514         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Unschedule a pending display refresh monitor update.
2515         (WebCore::DocumentTimeline::animationResolutionTimerFired):
2516         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Implement the "update animations and send events" procedure as specified by the Web Animations spec.
2517         During this procedure, we call tick() on all animations listed in m_animations and create a list of animations to remove from that list if this animation is no
2518         longer relevant following the call to tick().
2519         (WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent):
2520         (WebCore::DocumentTimeline::timingModelDidChange): Deleted.
2521         (WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Deleted.
2522         (WebCore::DocumentTimeline::performInvalidationTask): Deleted.
2523         (WebCore::DocumentTimeline::updateAnimationSchedule): Deleted.
2524         (WebCore::DocumentTimeline::animationScheduleTimerFired): Deleted.
2525         (WebCore::DocumentTimeline::updateAnimations): Deleted.
2526         (WebCore::compareAnimationPlaybackEvents): Deleted.
2527         (WebCore::DocumentTimeline::performEventDispatchTask): Deleted.
2528         * animation/DocumentTimeline.h:
2529         * animation/WebAnimation.cpp: The majority of the changes to this class is that we call the new timingDidChange() method when any code that modifies the timing model
2530         is run. We also remove methods to set the pending play and pause tasks as well as the animation's start time and hold time since any time we're changing these instance
2531         variables, we later already have a call to update the timing model and we were doing more work than needed. As a result we no longer need an internal method to set the
2532         start time and can stop requiring a custom IDL binding for the "startTime" property.
2533         (WebCore::WebAnimation::effectTimingPropertiesDidChange):
2534         (WebCore::WebAnimation::setEffect):
2535         (WebCore::WebAnimation::setEffectInternal):
2536         (WebCore::WebAnimation::setTimeline):
2537         (WebCore::WebAnimation::setTimelineInternal):
2538         (WebCore::WebAnimation::startTime const):
2539         (WebCore::WebAnimation::setStartTime):
2540         (WebCore::WebAnimation::silentlySetCurrentTime):
2541         (WebCore::WebAnimation::setCurrentTime):
2542         (WebCore::WebAnimation::setPlaybackRate):
2543         (WebCore::WebAnimation::cancel):
2544         (WebCore::WebAnimation::resetPendingTasks):
2545         (WebCore::WebAnimation::finish):
2546         (WebCore::WebAnimation::timingDidChange): New method called any time a timing property changed where we run the "update the finished state" procedure and notify the
2547         animation's timeline that its timing changed so that it can be considered the next time the "update animations and send events" procedure runs.
2548         (WebCore::WebAnimation::invalidateEffect):
2549         (WebCore::WebAnimation::updateFinishedState): Update the animation's relevance after running the procedure as specified.
2550         (WebCore::WebAnimation::play):
2551         (WebCore::WebAnimation::runPendingPlayTask):
2552         (WebCore::WebAnimation::pause):
2553         (WebCore::WebAnimation::runPendingPauseTask):
2554         (WebCore::WebAnimation::needsTick const):
2555         (WebCore::WebAnimation::tick): New method called during the "update animations and send events" procedure where we run the "update the finished state" procedure and run
2556         the pending play and pause tasks.
2557         (WebCore::WebAnimation::resolve):
2558         (WebCore::WebAnimation::updateRelevance):
2559         (WebCore::WebAnimation::computeRelevance):
2560         (WebCore::WebAnimation::timingModelDidChange): Deleted.
2561         (WebCore::WebAnimation::setHoldTime): Deleted.
2562         (WebCore::WebAnimation::bindingsStartTime const): Deleted.
2563         (WebCore::WebAnimation::setBindingsStartTime): Deleted.
2564         (WebCore::WebAnimation::setTimeToRunPendingPlayTask): Deleted.
2565         (WebCore::WebAnimation::setTimeToRunPendingPauseTask): Deleted.
2566         (WebCore::WebAnimation::updatePendingTasks): Deleted.
2567         (WebCore::WebAnimation::timeToNextRequiredTick const): Deleted.
2568         (WebCore::WebAnimation::runPendingTasks): Deleted.
2569         (WebCore::WebAnimation::canBeListed const): Deleted.
2570         * animation/WebAnimation.h:
2571         (WebCore::WebAnimation::isRelevant const):
2572         (WebCore::WebAnimation::hasPendingPlayTask const):
2573         (WebCore::WebAnimation::isEffectInvalidationSuspended):
2574         * animation/WebAnimation.idl:
2575         * dom/Element.cpp:
2576         (WebCore::Element::getAnimations): Use isRelevant() instead of canBeListed().
2577
2578 2018-10-30  Youenn Fablet  <youenn@apple.com>
2579
2580         LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
2581         https://bugs.webkit.org/show_bug.cgi?id=191026
2582
2583         Reviewed by Eric Carlson.
2584
2585         Covered by updated test.
2586
2587         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
2588         (WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
2589
2590 2018-10-30  Claudio Saavedra  <csaavedra@igalia.com>
2591
2592         [GTK][WPE] Fixes to the PublicSuffix implementation
2593         https://bugs.webkit.org/show_bug.cgi?id=191031
2594
2595         Reviewed by Michael Catanzaro.
2596
2597         Covered by existing tests.
2598
2599         Downcase hostnames before passing it on to the underlying
2600         libsoup API. Special case localhost and fix a mixed-up
2601         libsoup GError checks. This fixes most of the failures.
2602
2603         * platform/soup/PublicSuffixSoup.cpp:
2604         (WebCore::isPublicSuffix):
2605         (WebCore::topPrivatelyControlledDomain):
2606
2607 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2608
2609         Missing from r237549
2610
2611         * layout/blockformatting/BlockFormattingContext.cpp:
2612         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2613         (WebCore::Layout::hasPrecomputedMarginTop):
2614
2615 2018-10-29  Ross Kirsling  <ross.kirsling@sony.com>
2616
2617         Unreviewed speculative build fix for AppleWin after r237559.
2618
2619         * PlatformAppleWin.cmake:
2620
2621 2018-10-29  Justin Michaud  <justin_michaud@apple.com>
2622
2623         Revert r237347 registered custom properties... https://bugs.webkit.org/show_bug.cgi?id=190039
2624         https://bugs.webkit.org/show_bug.cgi?id=190919
2625
2626         Reviewed by Michael Saboff.
2627
2628         * css/CSSComputedStyleDeclaration.cpp:
2629         (WebCore::ComputedStyleExtractor::customPropertyValue):
2630         * css/CSSCustomPropertyValue.cpp:
2631         (WebCore::CSSCustomPropertyValue::customCSSText const):
2632         (WebCore::CSSCustomPropertyValue::tokens const):
2633         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
2634         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
2635         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
2636         (WebCore::CSSCustomPropertyValue::equals const): Deleted.
2637         * css/CSSCustomPropertyValue.h:
2638         * css/CSSRegisteredCustomProperty.cpp:
2639         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
2640         * css/CSSRegisteredCustomProperty.h:
2641         * css/CSSVariableData.cpp:
2642         (WebCore::CSSVariableData::consumeAndUpdateTokens):
2643         (WebCore::CSSVariableData::CSSVariableData):
2644         (WebCore::CSSVariableData::checkVariablesForCycles const):
2645         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
2646         (WebCore::CSSVariableData::resolveVariableFallback const):
2647         (WebCore::CSSVariableData::resolveVariableReference const):
2648         (WebCore::CSSVariableData::resolveVariableReferences const):
2649         (WebCore::CSSVariableData::resolveTokenRange const):
2650         * css/CSSVariableData.h:
2651         (WebCore::CSSVariableData::create):
2652         (WebCore::CSSVariableData::createResolved):
2653         (WebCore::CSSVariableData::needsVariableResolution const):
2654         (WebCore::CSSVariableData::CSSVariableData):
2655         * css/CSSVariableReferenceValue.cpp:
2656         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
2657         (WebCore::resolveVariableFallback): Deleted.
2658         (WebCore::resolveVariableReference): Deleted.
2659         (WebCore::resolveTokenRange): Deleted.
2660         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): Deleted.
2661         * css/CSSVariableReferenceValue.h:
2662         (WebCore::CSSVariableReferenceValue::create):
2663         (WebCore::CSSVariableReferenceValue::variableDataValue const):
2664         (WebCore::CSSVariableReferenceValue::equals const):
2665         * css/DOMCSSRegisterCustomProperty.cpp:
2666         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2667         * css/PropertySetCSSStyleDeclaration.cpp:
2668         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
2669         * css/StyleBuilderCustom.h:
2670         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
2671         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
2672         * css/StyleProperties.cpp:
2673         (WebCore::MutableStyleProperties::setCustomProperty):
2674         * css/StyleProperties.h:
2675         * css/StyleResolver.cpp:
2676         (WebCore::StyleResolver::State::setStyle):
2677         (WebCore::StyleResolver::styleForKeyframe):
2678         (WebCore::StyleResolver::styleForPage):
2679         (WebCore::StyleResolver::applyMatchedProperties):
2680         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
2681         (WebCore::StyleResolver::applyProperty):
2682         (WebCore::StyleResolver::resolvedVariableValue const):
2683         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
2684         (WebCore::StyleResolver::CascadedProperties::Property::apply):
2685         (WebCore::StyleResolver::applyCascadedProperties):
2686         (WebCore::StyleResolver::applyCascadedCustomProperty): Deleted.
2687         * css/StyleResolver.h:
2688         * css/parser/CSSParser.cpp:
2689         (WebCore::CSSParser::parseValueWithVariableReferences):
2690         * css/parser/CSSParser.h:
2691         * css/parser/CSSPropertyParser.cpp:
2692         (WebCore::CSSPropertyParser::CSSPropertyParser):
2693         (WebCore::CSSPropertyParser::parseValueStart):
2694         (WebCore::CSSPropertyParser::parseSingleValue):
2695         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): Deleted.
2696         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): Deleted.
2697         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): Deleted.
2698         * css/parser/CSSPropertyParser.h:
2699         * css/parser/CSSVariableParser.cpp:
2700         (WebCore::CSSVariableParser::parseDeclarationValue):
2701         * dom/ConstantPropertyMap.cpp:
2702         (WebCore::ConstantPropertyMap::setValueForProperty):
2703         (WebCore::variableDataForPositivePixelLength):
2704         (WebCore::variableDataForPositiveDuration):
2705         * rendering/style/RenderStyle.cpp:
2706         (WebCore::RenderStyle::checkVariablesInCustomProperties):
2707         * rendering/style/RenderStyle.h:
2708         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
2709         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
2710         * rendering/style/StyleCustomPropertyData.h:
2711         (WebCore::StyleCustomPropertyData::operator== const):
2712         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
2713         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
2714
2715 2018-10-29  Youenn Fablet  <youenn@apple.com>
2716
2717         Handle MDNS resolution of candidates through libwebrtc directly
2718         https://bugs.webkit.org/show_bug.cgi?id=190681
2719
2720         Reviewed by Eric Carlson.
2721
2722         Remove the previous MDNS resolution mechanism.
2723         Instead, add support for the AsyncResolver mechanism added to libwebrtc.
2724         Covered by current mdns webrtc test that is unflaked.
2725
2726         * Modules/mediastream/PeerConnectionBackend.cpp:
2727         (WebCore::PeerConnectionBackend::addIceCandidate):
2728         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2729         (WebCore::LibWebRTCProvider::createPeerConnection):
2730         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2731         * testing/MockLibWebRTCPeerConnection.cpp:
2732         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
2733         * testing/MockLibWebRTCPeerConnection.h:
2734
2735 2018-10-29  Devin Rousso  <drousso@apple.com>
2736
2737         Web Inspector: increase size limits for NetworkResourceData
2738         https://bugs.webkit.org/show_bug.cgi?id=191034
2739         <rdar://problem/45529852>
2740
2741         Reviewed by Joseph Pecoraro.
2742
2743         No tests since no new functionality.
2744
2745         * inspector/NetworkResourcesData.cpp:
2746         All resources: 100MB => 200MB
2747         Each resource:  10MB =>  50MB
2748
2749 2018-10-29  Tim Horton  <timothy_horton@apple.com>
2750
2751         Modernize WebKit nibs and lprojs for localization's sake
2752         https://bugs.webkit.org/show_bug.cgi?id=190911
2753         <rdar://problem/45349466>
2754
2755         Reviewed by Dan Bernstein.
2756
2757         * PlatformGTK.cmake:
2758         * PlatformWPE.cmake:
2759         * PlatformWin.cmake:
2760         * WebCore.xcodeproj/project.pbxproj:
2761         * en.lproj/Localizable.strings: Renamed from Source/WebCore/English.lproj/Localizable.strings.
2762         * en.lproj/Localizable.stringsdict: Renamed from Source/WebCore/English.lproj/Localizable.stringsdict.
2763         * en.lproj/mediaControlsLocalizedStrings.js: Renamed from Source/WebCore/English.lproj/mediaControlsLocalizedStrings.js.
2764         * en.lproj/modern-media-controls-localized-strings.js: Renamed from Source/WebCore/English.lproj/modern-media-controls-localized-strings.js.
2765         English->en
2766
2767 2018-10-29  Tim Horton  <timothy_horton@apple.com>
2768
2769         Make FindOptionsShowOverlay work on iOS
2770         https://bugs.webkit.org/show_bug.cgi?id=190551
2771
2772         Reviewed by Andy Estes.
2773
2774         * platform/graphics/GraphicsContext.h:
2775         Export some more GraphicsContext methods.
2776
2777 2018-10-29  Youenn Fablet  <youenn@apple.com>
2778
2779         Invalid ssrc value in the stats of type 'inbound-rtp'
2780         https://bugs.webkit.org/show_bug.cgi?id=190826
2781         <rdar://problem/45487435>
2782
2783         Reviewed by Eric Carlson.
2784
2785         Value was not initialized in WebCore if missing from libwebrtc.
2786         Change value to an optional so that it will not appear if libwebrtc does not expose it.
2787         Move integer/boolean values from being initialized to be optional so
2788         that we do not expose them to JS if not exposed by libwebrtc.
2789
2790         Covered by updated tests.
2791
2792         * Modules/mediastream/RTCStatsReport.h:
2793
2794 2018-10-29  Jer Noble  <jer.noble@apple.com>
2795
2796         CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
2797         https://bugs.webkit.org/show_bug.cgi?id=190954
2798
2799         Reviewed by Simon Fraser.
2800
2801         Crash analyitics show that WebProcess will crash in ERROR_CGDataProvider_BufferIsNotBigEnough,
2802         which attempts to fetch the last byte in the image buffer in order to verify that the entire
2803         buffer is readable. Unfortunately, the stack trace generated by this crash does not identify
2804         what CGDataProvider is responsible for the not-big-enough buffer. In order to identify which
2805         CGDataProvider created by WebKit is responsible (if any), we will add our own version of
2806         ERROR_CGDataProvider_BufferIsNotBigEnough, called at CGDataProvider creation time, which should
2807         generate a crash within the responsible stack frame.
2808
2809         (This assumes that the issue is the wrong sized buffer at CGDataProvider creation time, and not
2810         that the buffer itself is reclaimed between creation time and access.)
2811
2812         * WebCore.xcodeproj/project.pbxproj:
2813         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2814         (WebCore::GraphicsContext3D::paintToCanvas):
2815         * platform/graphics/cg/ImageBufferCG.cpp:
2816         (WebCore::ImageBuffer::ImageBuffer):
2817         (WebCore::ImageBuffer::toCFData const):
2818         (WebCore::cfData):
2819         * platform/graphics/cocoa/WebGLLayer.mm:
2820         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
2821         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2822         (WebCore::CVPixelBufferGetBytePointerCallback):
2823         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2824         * platform/graphics/cg/ImageUtilitiesCG.h: Added.
2825         (WebCore::verifyImageBufferIsBigEnough):
2826
2827 2018-10-29  David Kilzer  <ddkilzer@apple.com>
2828
2829         Fix clang static analyzer warning in StyleBuilderConverter.h
2830         <https://webkit.org/b/190907>
2831
2832         Reviewed by Antti Koivisto.
2833
2834         Fix the following clang static warning in StyleBuilderConverter.h:
2835             Value stored to 'autoFlow' during its initialization is never read
2836
2837         * css/StyleBuilderConverter.h:
2838         (WebCore::StyleBuilderConverter::convertGridAutoFlow): Move
2839         assignment of RenderStyle::initialGridAutoFlow() to `default`
2840         case.  Make `CSSValueDense` consistent with other cases by
2841         assigning value to `autoFlow` instead of returning early.
2842
2843 2018-10-29  Youenn Fablet  <youenn@apple.com>
2844
2845         Guard H264 simulcast with a runtime flag
2846         https://bugs.webkit.org/show_bug.cgi?id=191025
2847
2848         Reviewed by Eric Carlson.
2849
2850         Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it.
2851         Covered by existing test.
2852
2853         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2854         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
2855         * page/RuntimeEnabledFeatures.h:
2856         (WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const):
2857         (WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled):
2858
2859 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2860
2861         [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
2862         https://bugs.webkit.org/show_bug.cgi?id=191018
2863
2864         Reviewed by Antti Koivisto.
2865
2866         <div><img style="float: left"></div>
2867         This inline formatting context (root -> div) inherits the floating context from the parent block formatting context.
2868         Floats are added to the floating context relative to the floating context's root. In order to position this float properly we
2869         need to precompute the ancestor's margin top (stop at the block formatting root boundary).
2870
2871         Test: fast/inline/simple-intruding-floats3.html
2872
2873         * layout/blockformatting/BlockFormattingContext.cpp:
2874         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2875
2876 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2877
2878         [LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
2879         https://bugs.webkit.org/show_bug.cgi?id=191011
2880
2881         Reviewed by Antti Koivisto.
2882
2883         // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
2884         // Height is the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
2885
2886         This is temporary until after inline runs transition to the display tree.
2887
2888         Test: fast/inline/simple-intruding-floats2.html
2889
2890         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2891         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2892         * layout/inlineformatting/InlineRun.h:
2893         (WebCore::Layout::InlineRun::logicalLeft const):
2894         (WebCore::Layout::InlineRun::logicalRight const):
2895         (WebCore::Layout::InlineRun::logicalTop const):
2896         (WebCore::Layout::InlineRun::logicalBottom const):
2897         (WebCore::Layout::InlineRun::width const):
2898         (WebCore::Layout::InlineRun::height const):
2899         (WebCore::Layout::InlineRun::setWidth):
2900         (WebCore::Layout::InlineRun::setLogicalLeft):
2901         (WebCore::Layout::InlineRun::setLogicalRight):
2902         (WebCore::Layout::InlineRun::moveHorizontally):
2903         (WebCore::Layout::InlineRun::InlineRun):
2904         * layout/inlineformatting/Line.cpp:
2905         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
2906
2907 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2908
2909         [LFC][IFC] Add support for simple intruding floats.
2910         https://bugs.webkit.org/show_bug.cgi?id=190998
2911
2912         Reviewed by Antti Koivisto.
2913
2914         In order to be able to figure out whether a float is intruding on a line, we need to provide the line's final vertical position.
2915         This vertical position must be in the same coordinate system as the float's position is. In case of intruding float,
2916         it is the parent block formatting root's coordinate system (that's where the float lives.)
2917
2918         Test: fast/inline/simple-intruding-float1.html
2919
2920         * layout/blockformatting/BlockFormattingContext.cpp:
2921         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2922         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
2923         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2924         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2925         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2926         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2927         * layout/blockformatting/BlockFormattingContext.h:
2928         * layout/floats/FloatingState.cpp:
2929         (WebCore::Layout::FloatingState::constraints const):
2930
2931 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2932
2933         [LFC][IFC] Inline layout produces separate runs when float is present.
2934         https://bugs.webkit.org/show_bug.cgi?id=190980
2935
2936         Reviewed by Antti Koivisto.
2937
2938         <div>foo<img src="foobar.jpg" style="float: left">bar</div> produces 2 inline boxes (foo) and (bar) -> current inline code
2939         while it is really just one continuous run (foobar) -> LFC
2940         Adjust verification code to check for such runs.
2941
2942         * layout/Verification.cpp:
2943         (WebCore::Layout::checkForMatchingNonTextRuns):
2944         (WebCore::Layout::checkForMatchingTextRuns):
2945         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2946         * layout/inlineformatting/InlineRun.h:
2947         (WebCore::Layout::InlineRun::textContext const):
2948
2949 2018-10-29  Youenn Fablet  <youenn@apple.com>
2950
2951         [WebRTC] Enable VP8 by default
2952         https://bugs.webkit.org/show_bug.cgi?id=190672
2953         <rdar://problem/43663785>
2954
2955         Reviewed by Eric Carlson.
2956
2957         No change of behavior.
2958
2959         * page/RuntimeEnabledFeatures.h: Set default value to true.
2960
2961 2018-10-28  Andy Estes  <aestes@apple.com>
2962
2963         [Payment Request] Implement MerchantValidationEvent.methodName
2964         https://bugs.webkit.org/show_bug.cgi?id=190058
2965
2966         Reviewed by Darin Adler.
2967
2968         Implemented MerchantValidationEvent's methodName attribute and MerchantValidationEventInit's
2969         methodName property as specified in the Payment Request API W3C Editor's Draft of
2970         27 September 2018.
2971
2972         Covered by web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html.
2973
2974         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2975         (WebCore::ApplePayPaymentHandler::validateMerchant): Passed the payment method identifier
2976         (as a string) to MerchantValidationEvent::create()
2977         * Modules/paymentrequest/MerchantValidationEvent.cpp:
2978         (WebCore::MerchantValidationEvent::create): Validated the methodName before constructing the
2979         event, throwing a RangeError on failure.
2980         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
2981         * Modules/paymentrequest/MerchantValidationEvent.h:
2982         * Modules/paymentrequest/MerchantValidationEvent.idl:
2983
2984 2018-10-27  Antoine Quint  <graouts@apple.com>
2985
2986         [Web Animations] Remove WebAnimation::description()
2987         https://bugs.webkit.org/show_bug.cgi?id=190995
2988
2989         Reviewed by Dean Jackson.
2990
2991         This method is never used.
2992
2993         * animation/WebAnimation.cpp:
2994         (WebCore::WebAnimation::description): Deleted.
2995         * animation/WebAnimation.h:
2996
2997 2018-10-27  Antoine Quint  <graouts@apple.com>
2998
2999         [Web Animations] Move the logic of Document::getAnimations() to DocumentTimeline
3000         https://bugs.webkit.org/show_bug.cgi?id=190994
3001
3002         Reviewed by Dean Jackson.
3003
3004         It would be cleaner to have the logic of document.getAnimations() on the DocumentTimeline instead of the Document, keep more
3005         animation-related code compartmentalized in the animation directory. No change in behavior, so no test update.
3006
3007         * animation/DocumentTimeline.cpp:
3008         (WebCore::DocumentTimeline::getAnimations const):
3009         * animation/DocumentTimeline.h:
3010         * dom/Document.cpp:
3011         (WebCore::Document::getAnimations):
3012
3013 2018-10-27  Antoine Quint  <graouts@apple.com>
3014
3015         [Web Animations] Move bindings methods requiring style flush from CSSAnimation to DeclarativeAnimation
3016         https://bugs.webkit.org/show_bug.cgi?id=190996
3017
3018         Reviewed by Dean Jackson.
3019
3020         Moving all of the IDL bindings methods that require flushing style from CSSAnimation to its superclass
3021         DeclarativeAnimation so we follow the same route in CSSTransition. Note that there was code in
3022         CSSAnimation::bindingsCurrentTime() that was not moved as it proved to not be necessary.
3023
3024         * animation/CSSAnimation.cpp:
3025         (WebCore::CSSAnimation::bindingsPlay):
3026         (WebCore::CSSAnimation::bindingsPause):
3027         (WebCore::CSSAnimation::bindingsStartTime const): Deleted.
3028         (WebCore::CSSAnimation::setBindingsStartTime): Deleted.
3029         (WebCore::CSSAnimation::bindingsCurrentTime const): Deleted.
3030         (WebCore::CSSAnimation::setBindingsCurrentTime): Deleted.
3031         (WebCore::CSSAnimation::bindingsPlayState const): Deleted.
3032         (WebCore::CSSAnimation::bindingsPending const): Deleted.
3033         (WebCore::CSSAnimation::bindingsReady): Deleted.
3034         (WebCore::CSSAnimation::bindingsFinished): Deleted.
3035         (WebCore::CSSAnimation::flushPendingStyleChanges const): Deleted.
3036         * animation/CSSAnimation.h:
3037         * animation/DeclarativeAnimation.cpp:
3038         (WebCore::DeclarativeAnimation::bindingsStartTime const):
3039         (WebCore::DeclarativeAnimation::setBindingsStartTime):
3040         (WebCore::DeclarativeAnimation::bindingsCurrentTime const):
3041         (WebCore::DeclarativeAnimation::setBindingsCurrentTime):
3042         (WebCore::DeclarativeAnimation::bindingsPlayState const):
3043         (WebCore::DeclarativeAnimation::bindingsPending const):
3044         (WebCore::DeclarativeAnimation::bindingsReady):
3045         (WebCore::DeclarativeAnimation::bindingsFinished):
3046         (WebCore::DeclarativeAnimation::bindingsPlay):
3047         (WebCore::DeclarativeAnimation::bindingsPause):
3048         (WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
3049         * animation/DeclarativeAnimation.h:
3050
3051 2018-10-27  Charlie Turner  <cturner@igalia.com>
3052
3053         [EME] Add a logging macro
3054         https://bugs.webkit.org/show_bug.cgi?id=190984
3055
3056         Reviewed by Xabier Rodriguez-Calvar.
3057
3058         No tests since no new functionality.
3059
3060         * Modules/encryptedmedia/MediaKeySession.cpp:
3061         (WebCore::MediaKeySession::MediaKeySession):
3062         (WebCore::MediaKeySession::generateRequest):
3063         (WebCore::MediaKeySession::update):
3064         (WebCore::MediaKeySession::close):
3065         (WebCore::MediaKeySession::remove):
3066         (WebCore::MediaKeySession::sessionClosed):
3067         * Modules/encryptedmedia/MediaKeys.cpp:
3068         (WebCore::MediaKeys::createSession):
3069         * Modules/encryptedmedia/NavigatorEME.cpp:
3070         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
3071         * platform/Logging.h:
3072
3073 2018-10-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3074
3075         [GStreamer][EME] Post key received to bus should be done before waking up other threads
3076         https://bugs.webkit.org/show_bug.cgi?id=190822
3077
3078         Reviewed by Philippe Normand.
3079
3080         Notify after posting message to bus.
3081
3082         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3083         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
3084
3085 2018-10-27  Charlie Turner  <cturner@igalia.com>
3086
3087         Fix release build with -DLOG_DISABLED=0
3088         https://bugs.webkit.org/show_bug.cgi?id=190866
3089
3090         Reviewed by Xabier Rodriguez-Calvar.
3091
3092         No new tests since no functionality changed.
3093
3094         * platform/graphics/Font.cpp:
3095         * platform/graphics/Font.h:
3096         * platform/graphics/FontPlatformData.h:
3097         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3098         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3099         * platform/graphics/win/FontPlatformDataWin.cpp:
3100
3101 2018-10-26  Commit Queue  <commit-queue@webkit.org>
3102
3103         Unreviewed, rolling out r237458.
3104         https://bugs.webkit.org/show_bug.cgi?id=190973
3105
3106         broke internal iOS builds (Requested by zalan on #webkit).
3107
3108         Reverted changeset:
3109
3110         "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
3111         https://bugs.webkit.org/show_bug.cgi?id=190951
3112         https://trac.webkit.org/changeset/237458
3113
3114 2018-10-26  Antoine Quint  <graouts@apple.com>
3115
3116         [Web Animations] Remove useless internals methods
3117         https://bugs.webkit.org/show_bug.cgi?id=190968
3118
3119         Reviewed by Dean Jackson.
3120
3121         We had a few internals methods added early on in the Web Animations implementation that are no longer
3122         relevant now that the full API is implemented. We can safely remove them now.
3123
3124         * animation/AnimationTimeline.cpp:
3125         (WebCore::AnimationTimeline::setCurrentTime): Deleted.
3126         (WebCore::AnimationTimeline::description): Deleted.
3127         * animation/AnimationTimeline.h:
3128         (WebCore::AnimationTimeline::currentTime):
3129         (WebCore::AnimationTimeline::pause): Deleted.
3130         * animation/DocumentTimeline.cpp:
3131         (WebCore::DocumentTimeline::currentTime):
3132         (WebCore::DocumentTimeline::pause): Deleted.
3133         * animation/DocumentTimeline.h:
3134         * testing/Internals.cpp:
3135         (WebCore::Internals::timelineDescription): Deleted.
3136         (WebCore::Internals::pauseTimeline): Deleted.
3137         (WebCore::Internals::setTimelineCurrentTime): Deleted.
3138         * testing/Internals.h:
3139         * testing/Internals.idl:
3140
3141 2018-10-26  Antoine Quint  <graouts@apple.com>
3142
3143         Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
3144         https://bugs.webkit.org/show_bug.cgi?id=190955
3145
3146         Reviewed by Dean Jackson.
3147
3148         We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since
3149         showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to
3150         the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown
3151         no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists)
3152         and the CSSAnimationController.
3153
3154         * dom/Element.cpp:
3155         (WebCore::Element::removedFromAncestor):
3156         * dom/PseudoElement.cpp:
3157         (WebCore::PseudoElement::clearHostElement):
3158         * page/FrameView.cpp:
3159         (WebCore::FrameView::didDestroyRenderTree):
3160         * rendering/updating/RenderTreeUpdater.cpp:
3161         (WebCore::RenderTreeUpdater::tearDownRenderers):
3162
3163 2018-10-26  Timothy Hatcher  <timothy@apple.com>
3164
3165         Use dark appearance scrollbar when page background is dark or document supports dark mode.
3166         https://bugs.webkit.org/show_bug.cgi?id=190937
3167         rdar://problem/41225839
3168
3169         Reviewed by Beth Dakin.
3170
3171         * page/FrameView.cpp:
3172         (WebCore::FrameView::useDarkAppearance const): Added. Ask the document.
3173         (WebCore::FrameView::paintScrollCorner): Set LocalDefaultSystemAppearance based
3174         on the scrollbar overlay style too.
3175         * page/FrameView.h:
3176         * platform/ScrollableArea.h:
3177         (WebCore::ScrollableArea::useDarkAppearance const): Added. Default to false.
3178         * platform/mac/ScrollAnimatorMac.mm:
3179         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Added.
3180         Ask the ScrollableArea if a dark appearance is desired.
3181
3182 2018-10-26  Antti Koivisto  <antti@apple.com>
3183
3184         Use random() instead of begin() to limit cache sizes
3185         https://bugs.webkit.org/show_bug.cgi?id=190957
3186
3187         Reviewed by Chris Dumez.
3188
3189         We currently use cache.remove(cache.begin()) pattern to limit sized of various caches.
3190         This is a bad pattern for tables that never rehash (because they have fixed maximum size) as most of the
3191         keys get permanently stuck in the table.
3192
3193         * css/CSSValuePool.cpp:
3194         (WebCore::CSSValuePool::createColorValue):
3195         (WebCore::CSSValuePool::createFontFamilyValue):
3196         (WebCore::CSSValuePool::createFontFaceValue):
3197         * dom/InlineStyleSheetOwner.cpp:
3198         (WebCore::InlineStyleSheetOwner::createSheet):
3199         * dom/SelectorQuery.cpp:
3200         * platform/graphics/FontCascade.cpp:
3201         (WebCore::retrieveOrAddCachedFonts):
3202         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3203         (WebCore::shouldAutoActivateFontIfNeeded):
3204         * platform/mac/PublicSuffixMac.mm:
3205         (WebCore::topPrivatelyControlledDomain):
3206
3207 2018-10-26  Jer Noble  <jer.noble@apple.com>
3208
3209         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
3210         https://bugs.webkit.org/show_bug.cgi?id=190951
3211         <rdar://problem/45213065>
3212
3213         Reviewed by Alex Christensen.
3214
3215         Request the correct route policy and context from the VideoFullscreenModel.
3216
3217         * platform/cocoa/VideoFullscreenModel.h:
3218         (WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
3219         * platform/cocoa/VideoFullscreenModelVideoElement.h:
3220         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
3221         (WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
3222         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3223         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3224         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
3225         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
3226         (VideoFullscreenInterfaceAVKit::doSetup):
3227
3228 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3229
3230         [LFC][IFC] Add more inline information to outputLayoutTree
3231         https://bugs.webkit.org/show_bug.cgi?id=190945
3232
3233         Reviewed by Antti Koivisto.
3234
3235         * layout/layouttree/LayoutTreeBuilder.cpp:
3236         (WebCore::Layout::outputInlineRuns):
3237         (WebCore::Layout::outputLayoutBox):
3238
3239 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3240
3241         [LFC][IFC] Layout floats as part of the inline content
3242         https://bugs.webkit.org/show_bug.cgi?id=190942
3243
3244         Reviewed by Antti Koivisto.
3245
3246         Add float handling to InlineFormattingContext::layoutInlineContent.
3247         Note that floats don't actually generate inline runs.
3248
3249         Test: fast/block/basic/inline-content-with-floating-image.html
3250
3251         * layout/blockformatting/BlockFormattingContext.cpp:
3252         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3253         * layout/floats/FloatAvoider.cpp:
3254         (WebCore::Layout::FloatAvoider::FloatAvoider): Check if any mapping is needed.
3255         * layout/inlineformatting/InlineFormattingContext.cpp:
3256         (WebCore::Layout::isTrimmableContent):
3257         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3258         (WebCore::Layout::trimLeadingRun): Deleted.
3259         * layout/inlineformatting/InlineFormattingContext.h:
3260         (WebCore::Layout::InlineFormattingContext::Line::isClosed const):
3261         * layout/inlineformatting/Line.cpp:
3262         (WebCore::Layout::InlineFormattingContext::Line::init):
3263         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
3264         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
3265         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
3266         (WebCore::Layout::InlineFormattingContext::Line::close):
3267
3268 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3269
3270         [LFC][IFC] Adjust current line with float constraints.
3271         https://bugs.webkit.org/show_bug.cgi?id=190940
3272
3273         Reviewed by Antti Koivisto.
3274
3275         * layout/inlineformatting/InlineFormattingContext.cpp:
3276         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
3277         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3278         * layout/inlineformatting/InlineFormattingContext.h:
3279         * layout/inlineformatting/InlineRun.h:
3280         (WebCore::Layout::InlineRun::moveHorizontally):
3281         * layout/inlineformatting/Line.cpp:
3282         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
3283         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
3284
3285 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3286
3287         [LFC][IFC] Compute float box size and position
3288         https://bugs.webkit.org/show_bug.cgi?id=190938
3289
3290         Reviewed by Antti Koivisto.
3291
3292         * layout/inlineformatting/InlineFormattingContext.cpp:
3293         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
3294         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
3295         * layout/inlineformatting/InlineFormattingContext.h:
3296
3297 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3298
3299         [LFC][IFC] Add line logical top and bottom
3300         https://bugs.webkit.org/show_bug.cgi?id=190934
3301
3302         Reviewed by Antti Koivisto.
3303
3304         * layout/inlineformatting/InlineFormattingContext.cpp:
3305         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
3306         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3307         * layout/inlineformatting/InlineFormattingContext.h:
3308         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const):
3309         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const):
3310         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const):
3311         * layout/inlineformatting/Line.cpp:
3312         (WebCore::Layout::InlineFormattingContext::Line::init):
3313         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
3314         (WebCore::Layout::InlineFormattingContext::Line::close):
3315
3316 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3317
3318         [LFC][IFC] Find floating constraints for a given vertical position
3319         https://bugs.webkit.org/show_bug.cgi?id=190928
3320
3321         Reviewed by Antti Koivisto.
3322
3323         https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
3324
3325         "In general, the left edge of a line box touches the left edge of its containing block and the right edge touches the right edge of its containing block.
3326         However, floating boxes may come between the containing block edge and the line box edge.
3327         Thus, although line boxes in the same inline formatting context generally have the same width
3328         (that of the containing block), they may vary in width if available horizontal space is reduced due to floats."
3329
3330         This patch adds support for retrieving left/right constraints for a given line (vertical position).
3331
3332         * layout/floats/FloatingState.cpp:
3333         (WebCore::Layout::FloatingState::constraints const):
3334         * layout/floats/FloatingState.h:
3335
3336 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3337
3338         [LFC] Inline formatting context has higher priority than block
3339         https://bugs.webkit.org/show_bug.cgi?id=190924
3340
3341         Reviewed by Antti Koivisto.
3342
3343         When an element establishes both inline and block formatting contexts, we need to pick one to
3344         create (and we choose the content driven formatting type (inline)). See example below:
3345
3346         <div style="overflow: hidden">This text should be inside an inlines formatting context.</div>
3347
3348         * layout/LayoutContext.cpp:
3349         (WebCore::Layout::LayoutContext::formattingContext const):
3350
3351 2018-10-26  Ali Juma  <ajuma@chromium.org>
3352
3353         REGRESSION (r237255): Text selection is broken in form fields
3354         https://bugs.webkit.org/show_bug.cgi?id=190899
3355
3356         Reviewed by Ryosuke Niwa.
3357
3358         Fix missing negation when checking for a fully-clipped-out rect. This was causing
3359         RenderObject::computeVisibleRectInContainer to incorrectly early-out.
3360
3361         Test: fast/repaint/text-selection-overflow-hidden.html
3362
3363         * rendering/RenderObject.cpp:
3364         (WebCore::RenderObject::computeVisibleRectInContainer const):
3365
3366 2018-10-25  Chris Dumez  <cdumez@apple.com>
3367
3368         [PSON] Navigating cross-site with locked history but unlocked back/forward list fails to create a new BackForwardListItem
3369         https://bugs.webkit.org/show_bug.cgi?id=190915
3370         <rdar://problem/45059069>
3371
3372         Reviewed by Geoffrey Garen.
3373
3374         * history/PageCache.cpp:
3375         (WebCore::canCacheFrame):
3376         Make sure we do not put into PageCache a page whose main frame is showing the initial empty document.
3377         We usually do not try to put those into PageCache because we do not have a HistoryItem to save the
3378         PageCache entry on. However, when we process-swap on a navigation with the history locked, the new
3379         process has a HistoryItem and is initially showing the initial empty document before continuing
3380         the load from the previous process. Note that saving the initial empty document in PageCache would
3381         lead to crashes later on previous the initial empty document's Window is taken and reused for the
3382         next load.
3383
3384         * loader/FrameLoader.cpp:
3385         (WebCore::FrameLoader::load):
3386         Stop assuming that we're continuing a client-side redirect when lockHistory is Yes. It is
3387         lockBackForwardList that is actually Yes when we're doing a client-side redirect.
3388
3389         * loader/PolicyChecker.cpp:
3390         (WebCore::PolicyChecker::checkNavigationPolicy):
3391         Stop using calling the completion handler with an invalid URL when the policy decision is 'Suspend' and
3392         use 'about:blank' instead. Without this change, FrameLoader::continueLoadAfterNavigationPolicy() would
3393         not load 'about:blank' when its AllowNavigationToInvalidURL parameter is No.
3394
3395 2018-10-25  Devin Rousso  <drousso@apple.com>
3396
3397         Fix build after r237431 for platforms that don't support FULLSCREEN_API
3398
3399         Reviewed by Joseph Pecoraro.
3400
3401         No new tests. No change in behavior.
3402
3403         * inspector/agents/InspectorDOMAgent.cpp:
3404         (WebCore::InspectorDOMAgent::addEventListenersToNode):
3405
3406 2018-10-25  Devin Rousso  <drousso@apple.com>
3407
3408         Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls
3409         https://bugs.webkit.org/show_bug.cgi?id=189874
3410         <rdar://problem/44700000>
3411
3412         Reviewed by Joseph Pecoraro.
3413
3414         Updated existing test: http/tests/inspector/dom/didFireEvent.html
3415
3416         * inspector/agents/InspectorDOMAgent.h:
3417         * inspector/agents/InspectorDOMAgent.cpp:
3418         (WebCore::EventFiredCallback::handleEvent):
3419         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
3420         (WebCore::InspectorDOMAgent::addEventListenersToNode):
3421         (WebCore::InspectorDOMAgent::discardBindings):
3422         (WebCore::InspectorDOMAgent::eventDidResetAfterDispatch): Added.
3423         Prevent the same event from being sent to the frontend more than once.
3424
3425         * dom/Event.cpp:
3426         (WebCore::Event::resetAfterDispatch):
3427
3428         * dom/Document.cpp:
3429         (WebCore::Document::Document):
3430
3431         * inspector/InspectorInstrumentation.h:
3432         (WebCore::InspectorInstrumentation::eventDidResetAfterDispatch): Added.
3433         * inspector/InspectorInstrumentation.cpp:
3434         (WebCore::InspectorInstrumentation::eventDidResetAfterDispatchImpl): Added.
3435
3436 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3437
3438         Unreviewed, silence a -Wreturn-type warning
3439
3440         When every return is supposed to be covered by a switch statement, a release assert or CRASH
3441         is required by GCC.
3442
3443         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
3444         (WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType):
3445
3446 2018-10-25  Antoine Quint  <graouts@apple.com>
3447
3448         [Web Animations] Turn Web Animations CSS Integration off by default
3449         https://bugs.webkit.org/show_bug.cgi?id=190901
3450
3451         Reviewed by Dean Jackson.
3452
3453         * page/RuntimeEnabledFeatures.h:
3454
3455 2018-10-25  Jon Davis  <jond@apple.com>
3456
3457         Changed "Under Development" status to use "In Development" instead
3458         https://bugs.webkit.org/show_bug.cgi?id=187615
3459
3460         Reviewed by Joseph Pecoraro.
3461
3462         * features.json: Updated CSS Painting API Level 1 and CSS Properties and Values API Level 1.
3463
3464 2018-10-25  Chris Dumez  <cdumez@apple.com>
3465
3466         REGRESSION (236779) scandinaviandesigns.com product pages auto redirect to product image
3467         https://bugs.webkit.org/show_bug.cgi?id=190891
3468         <rdar://problem/45296796>
3469
3470         Reviewed by Antti Koivisto.
3471
3472         When a radio element gets clicked, we should only fire the 'input' and 'change' if the checked state
3473         of the radio element has changed.
3474
3475         Test: fast/dom/HTMLInputElement/radio-element-fires-change-event-only-when-checked-state-changes.html
3476
3477         * html/RadioInputType.cpp:
3478         (WebCore::RadioInputType::didDispatchClick):
3479
3480 2018-10-25  Joseph Pecoraro  <pecoraro@apple.com>
3481
3482         InspectorCanvas is not getting cleared properly for OffscreenCanvas
3483         https://bugs.webkit.org/show_bug.cgi?id=190894
3484         <rdar://problem/45498435>
3485
3486         Reviewed by Simon Fraser.
3487
3488         Covered by existing tests not crashing with guard malloc.
3489
3490         InspectorCanvasAgents tracks all CanvasRenderingContexts and needs to
3491         remove its reference when the containing CanvasBase goes away. It does
3492         this by registering as a notification observer, but if it can't map
3493         from the CanvasBase back to the rendering context we were failing to
3494         remove our reference. Enforce CanvasBase classes to notify observers
3495         of destruction while they still have their CanvasRenderingContext.
3496
3497         * html/CanvasBase.cpp:
3498         (WebCore::CanvasBase::~CanvasBase):
3499         (WebCore::CanvasBase::notifyObserversCanvasDestroyed):
3500         * html/CanvasBase.h:
3501         Assert that subclasses notify observers of the canvas being destroyed,
3502         since they will need to do this before m_context is cleared.
3503
3504         * html/CustomPaintCanvas.cpp:
3505         (WebCore::CustomPaintCanvas::~CustomPaintCanvas):
3506         * html/OffscreenCanvas.cpp:
3507         (WebCore::OffscreenCanvas::~OffscreenCanvas):
3508         Follow the new expected pattern of notifying observers before clearing
3509         the context. HTMLCanvasElement already followed this pattern.
3510
3511         * inspector/agents/InspectorCanvasAgent.cpp:
3512         (WebCore::InspectorCanvasAgent::canvasDestroyed):
3513         Add an assertion that would catch this earlier.
3514
3515 2018-10-24  Alexey Proskuryakov  <ap@apple.com>
3516
3517         Clean up some obsolete macOS version guards
3518         https://bugs.webkit.org/show_bug.cgi?id=190887
3519
3520         Reviewed by Dan Bernstein.
3521
3522         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3523         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
3524         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const):
3525         (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
3526         (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
3527
3528 2018-10-24  Tim Horton  <timothy_horton@apple.com>
3529
3530         Attachment filenames with RTL characters should format similar to Finder
3531         https://bugs.webkit.org/show_bug.cgi?id=190736
3532         <rdar://problem/44735946>
3533
3534         Reviewed by Dan Bernstein.
3535
3536         Test: fast/attachment/attachment-title-with-rtl.html
3537
3538         * html/HTMLAttachmentElement.cpp:
3539         (WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const):
3540         * html/HTMLAttachmentElement.h:
3541         Add attachmentTitleForDisplay(), which wraps the non-extension part of
3542         attachmentTitle in BiDi isolates, matching Finder's behavior.
3543
3544         * rendering/RenderThemeIOS.mm:
3545         (WebCore::RenderAttachmentInfo::buildWrappedLines):
3546         (WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
3547         * rendering/RenderThemeMac.mm:
3548         (WebCore::AttachmentLayout::layOutTitle):
3549         Adopt attachmentTitleForDisplay, and ask CoreText to use a subrange of
3550         the original string for the last line, instead of splitting the string
3551         ourselves. This ensures that BiDi control characters are respected
3552         even in the last line of the string.
3553
3554 2018-10-24  Megan Gardner  <megan_gardner@apple.com>
3555
3556         Turn on Conic Gradients
3557         https://bugs.webkit.org/show_bug.cgi?id=190810
3558
3559         Reviewed by Tim Horton.
3560
3561         Added tests previously, only switching feature from experimental to always avaiable.
3562
3563         * Configurations/FeatureDefines.xcconfig:
3564         * css/parser/CSSParserContext.cpp:
3565         (WebCore::CSSParserContext::CSSParserContext):
3566         (WebCore::operator==):
3567         * css/parser/CSSParserContext.h:
3568         (WebCore::CSSParserContextHash::hash):
3569         * css/parser/CSSPropertyParserHelpers.cpp:
3570         (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
3571         * page/Settings.yaml:
3572
3573 2018-10-11  Jiewen Tan  <jiewen_tan@apple.com>
3574
3575         Only report resource timing to parent frame for the first iframe load
3576         https://bugs.webkit.org/show_bug.cgi?id=190498
3577         <rdar://problem/44347398>
3578
3579         Reviewed by Youenn Fablet.
3580
3581         Only the first iframe navigation or the first iframe navigation after about:blank should be reported.
3582         https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface
3583
3584         Test: http/tests/misc/resource-timing-navigation-in-restored-iframe.html
3585
3586         * loader/FrameLoader.cpp:
3587         (WebCore::FrameLoader::loadWithDocumentLoader):
3588         * loader/FrameLoader.h:
3589         (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
3590         (WebCore::FrameLoader::setShouldReportResourceTimingToParentFrame): Deleted.
3591         * loader/ResourceTimingInformation.cpp:
3592         (WebCore::ResourceTimingInformation::addResourceTiming):
3593
3594 2018-10-24  Brent Fulgham  <bfulgham@apple.com>
3595
3596         Cure Windows Direct2D Backend of a nasty case of bitrot
3597         https://bugs.webkit.org/show_bug.cgi?id=190875
3598         <rdar://problem/45523268>
3599         
3600         Reviewed by Zalan Bujtas.
3601
3602         The Direct2D backend has drifted out of date with the rest of WebKit.
3603         This patch updates things so we can get a runnable build.
3604         
3605         * platform/graphics/FontPlatformData.h:
3606         * platform/graphics/ImageBuffer.cpp:
3607         (WebCore::ImageBuffer::create):
3608         * platform/graphics/ImageBuffer.h:
3609         * platform/graphics/ImageDecoder.h:
3610         * platform/graphics/ImageSource.cpp:
3611         (WebCore::ImageSource::setTargetContext):
3612         * platform/graphics/opentype/OpenTypeMathData.cpp:
3613         (WebCore::OpenTypeMathData::OpenTypeMathData): Need non-default constructor to make Visual
3614         Studio happy.
3615         * platform/graphics/win/GradientDirect2D.cpp:
3616         (WebCore::Gradient::generateGradient):
3617         * platform/graphics/win/GraphicsContextDirect2D.cpp: Update for new display list implementation.
3618         (WebCore::GraphicsContextPlatformPrivate::setAlpha):
3619         (WebCore::GraphicsContext::savePlatformState):
3620         (WebCore::GraphicsContext::restorePlatformState):
3621         (WebCore::GraphicsContext::drawNativeImage):
3622         (WebCore::GraphicsContext::drawPattern):
3623         (WebCore::GraphicsContext::drawRect):
3624         (WebCore::GraphicsContext::drawLine):
3625         (WebCore::GraphicsContext::drawEllipse):
3626         (WebCore::GraphicsContext::drawPath):
3627         (WebCore::GraphicsContext::fillPath):
3628         (WebCore::GraphicsContext::strokePath):
3629         (WebCore::GraphicsContext::fillRect):
3630         (WebCore::GraphicsContext::platformFillRoundedRect):
3631         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3632         (WebCore::GraphicsContext::clip):
3633         (WebCore::GraphicsContext::clipOut):
3634         (WebCore::GraphicsContext::clipPath):
3635         (WebCore::GraphicsContext::clipBounds const):
3636         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
3637         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
3638         (WebCore::GraphicsContext::setMiterLimit):
3639         (WebCore::GraphicsContext::clearRect):
3640         (WebCore::GraphicsContext::strokeRect):
3641         (WebCore::GraphicsContext::setLineCap):
3642         (WebCore::GraphicsContext::setLineDash):
3643         (WebCore::GraphicsContext::setLineJoin):
3644         (WebCore::GraphicsContext::scale):
3645         (WebCore::GraphicsContext::rotate):
3646         (WebCore::GraphicsContext::translate):
3647         (WebCore::GraphicsContext::concatCTM):
3648         (WebCore::GraphicsContext::setCTM):
3649         (WebCore::GraphicsContext::getCTM const):
3650         (WebCore::GraphicsContext::roundToDevicePixels):
3651         (WebCore::GraphicsContext::drawLinesForText):
3652         (WebCore::GraphicsContext::setURLForRect):
3653         (WebCore::GraphicsContext::setIsCALayerContext):
3654         (WebCore::GraphicsContext::isCALayerContext const):
3655         (WebCore::GraphicsContext::setIsAcceleratedContext):
3656         (WebCore::GraphicsContext::isAcceleratedContext const):
3657         (WebCore::GraphicsContext::setPlatformShouldAntialias):
3658         (WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
3659         (WebCore::GraphicsContext::setPlatformCompositeOperation):
3660         (WebCore::GraphicsContext::platformFillEllipse):
3661         (WebCore::GraphicsContext::platformStrokeEllipse):
3662         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
3663         (WebCore::GraphicsLayer::create):
3664         (): Deleted.
3665         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
3666         (WebCore::ImageBufferData::putData):
3667         * platform/graphics/win/ImageBufferDataDirect2D.h:
3668         * platform/graphics/win/ImageBufferDirect2D.cpp:
3669         (WebCore::ImageBuffer::createCompatibleBuffer):
3670         (WebCore::ImageBuffer::ImageBuffer):
3671         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3672         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties const):
3673         (WebCore::ImageDecoderDirect2D::encodedDataStatus const):
3674         (WebCore::ImageDecoderDirect2D::repetitionCount const):
3675         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
3676         (WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
3677         (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
3678         (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
3679         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
3680         (WebCore::ImageDecoderDirect2D::setData):
3681         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties): Deleted.
3682         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const): Deleted.
3683         * platform/graphics/win/ImageDecoderDirect2D.h:
3684         * platform/graphics/win/ImageDirect2D.cpp:
3685         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
3686         * platform/graphics/win/PatternDirect2D.cpp:
3687         (WebCore::Pattern::createPlatformPattern const):
3688
3689 2018-10-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
3690
3691         Cleanup: MIMETypeRegistry functions
3692         https://bugs.webkit.org/show_bug.cgi?id=190838
3693
3694         Reviewed by Simon Fraser.
3695
3696         Modernize the initialization of the lists in MIMETypeRegistry. Make the
3697         functions that return these list be self-contained. Use NeverDestroy<> to
3698         allocate the local static variable. Use std::initializer_list() and
3699         makeNeverDestroyed() to initialize NeverDestroy<> variables only once.
3700
3701         supportedImageResourceMIMETypes will be deleted and all the calls to it 
3702         will be replaced by supportedImageMIMETypes because they are identical.
3703
3704         * loader/archive/ArchiveFactory.cpp:
3705         (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): This function
3706         is called while initializing the supportedNonImageMIMETypes(). So it
3707         should not have a direct call to it. Instead, supportedNonImageMIMETypes
3708         is passed to it.
3709         * loader/archive/ArchiveFactory.h:
3710         * platform/MIMETypeRegistry.cpp:
3711         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
3712         (WebCore::supportedImageMIMETypesForEncoding):
3713         (WebCore::supportedJavaScriptMIMETypes):
3714         (WebCore::MIMETypeRegistry::supportedNonImageMIMETypes):
3715         (WebCore::MIMETypeRegistry::supportedMediaMIMETypes):
3716         (WebCore::pdfMIMETypes):
3717         (WebCore::MIMETypeRegistry::unsupportedTextMIMETypes):
3718         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
3719         (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
3720         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
3721         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
3722         (WebCore::MIMETypeRegistry::isSupportedMediaMIMEType):
3723         (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
3724         (WebCore::MIMETypeRegistry::isPDFMIMEType):
3725         (WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
3726         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
3727         (WebCore::initializeSupportedImageMIMETypes): Deleted.
3728         (WebCore::initializeSupportedImageMIMETypesForEncoding): Deleted.
3729         (WebCore::initializeSupportedJavaScriptMIMETypes): Deleted.
3730         (WebCore::initializePDFMIMETypes): Deleted.
3731         (WebCore::initializeSupportedNonImageMimeTypes): Deleted.
3732         (WebCore::initializeSupportedMediaMIMETypes): Deleted.
3733         (WebCore::initializeUnsupportedTextMIMETypes): Deleted.
3734         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Deleted.
3735         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Deleted.
3736         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
3737         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Deleted.
3738         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Deleted.
3739         (WebCore::MIMETypeRegistry::getPDFMIMETypes): Deleted.
3740         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Deleted.
3741         (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): Deleted.
3742         * platform/MIMETypeRegistry.h:
3743         * platform/graphics/Image.cpp:
3744         (WebCore::Image::supportsType):
3745         * platform/graphics/cg/ImageDecoderCG.cpp:
3746         (WebCore::ImageDecoderCG::encodedDataStatus const):
3747         * platform/graphics/cg/UTIRegistry.cpp:
3748         (WebCore::supportedDefaultImageSourceTypes):
3749         (WebCore::isSupportImageSourceType):
3750         (WebCore::allowedImageUTIs): Deleted.
3751         (WebCore::isAllowedImageUTI): Deleted.
3752         * platform/graphics/cg/UTIRegistry.h:
3753         * platform/mac/PasteboardMac.mm:
3754         (WebCore::Pasteboard::write):
3755
3756 2018-10-24  Chris Dumez  <cdumez@apple.com>
3757
3758         [PSON] When navigating back and forth, 'about:blank' shows up in the back/forward list
3759         https://bugs.webkit.org/show_bug.cgi?id=190846
3760         <rdar://problem/45058938>
3761
3762         Reviewed by Antti Koivisto.
3763
3764         When a page gets suspended after a process-swap, we navigate it to about:blank from inside the navigation
3765         policy handler, by overriding the request URL. This normally works fine because we usually process-swap
3766         on standard navigation. However, when we would process-swap on a back/forward navigation, we would end
3767         up using the back/forward navigation load type to do the about:blank load. This would have repercussions
3768         because history navigations update the current history item with the new URL (in this case 'about:blank').
3769         To avoid the issue, switch to a standard load type whenever the client asks us to suspend and we load
3770         'about:blank' as a result.
3771
3772         * loader/FrameLoader.cpp:
3773         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
3774
3775 2018-10-24  Andy Estes  <aestes@apple.com>
3776
3777         [macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure
3778         https://bugs.webkit.org/show_bug.cgi?id=190650
3779         <rdar://problem/45341914>
3780
3781         Reviewed by Alex Christensen.
3782
3783         In computeErrors, we intend to ignore errors when computing paymentMethodErrors. But we
3784         weren't clearing exceptions generated from calling convert(), so they would end up being
3785         logged as unhandled promise rejections.
3786
3787         Changed ApplePayPaymentHandler::computeErrors() to use a CatchScope to clear exceptions when
3788         decoding paymentMethodErrors.
3789
3790         Also changed ApplePayShippingAddressChangeEventErrorsV3.https.html to catch promise
3791         rejections from calling PaymentRequest.abort().
3792
3793         Covered by existing test.
3794
3795         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3796         (WebCore::ApplePayPaymentHandler::computeErrors const):
3797
3798 2018-10-22  Antti Koivisto  <antti@apple.com>
3799
3800         topPrivatelyControlledDomain is slow
3801         https://bugs.webkit.org/show_bug.cgi?id=190792
3802
3803         Reviewed by Alex Christensen and Chris Dumez.
3804
3805         It calls into some slowish CFNetwork code and ends up showing up in profiles.
3806
3807         * platform/mac/PublicSuffixMac.mm:
3808         (WebCore::topPrivatelyControlledDomain):
3809
3810         Add a cache that avoids calls into frameworks.
3811
3812 2018-10-22  Jer Noble  <jer.noble@apple.com>
3813
3814         Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
3815         https://bugs.webkit.org/show_bug.cgi?id=190790
3816
3817         Reviewed by Alex Christensen.
3818
3819         Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
3820         MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
3821         the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make 
3822         GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making 
3823         incrementing the pending task count atomic.
3824
3825         * platform/GenericTaskQueue.cpp:
3826         (WebCore::TaskDispatcher<Timer>::postTask):
3827         (WebCore::TaskDispatcher<Timer>::sharedLock):
3828         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
3829         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
3830         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
3831         * platform/GenericTaskQueue.h:
3832         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3833         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3834         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
3835         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
3836         (-[WebCoreAVFMovieObserver initWithPlayer:]):
3837         (-[WebCoreAVFMovieObserver disconnect]):
3838         (-[WebCoreAVFMovieObserver metadataLoaded]):
3839         (-[WebCoreAVFMovieObserver didEnd:]):
3840         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3841         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
3842         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
3843         (-[WebCoreAVFLoaderDelegate initWithPlayer:]):
3844         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
3845         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
3846         (-[WebCoreAVFPullDelegate initWithPlayer:]):
3847         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
3848         (-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
3849         (-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
3850         (-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
3851         (-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
3852         (-[WebCoreAVFPullDelegate setCallback:]): Deleted.
3853
3854 2018-10-23  Jer Noble  <jer.noble@apple.com>
3855
3856         TextTrack cues should be updated more often than every 250ms.
3857         https://bugs.webkit.org/show_bug.cgi?id=190827
3858
3859         Reviewed by Eric Carlson.
3860
3861         Test: media/track/track-cue-timing.html
3862
3863         TextTracks cues are recalculated on the playback timer, which fires at least every 250ms.
3864         In addition to this timer, add a method to MediaPlayer to provide a task which will be
3865         performed at a particular media time, and use this new method to request cues be updated
3866         at the next interesting media time. The next interesting time would be either when the
3867         soonest current cue will end, or when the next non-current cue will start, whichever is
3868         earlier.
3869
3870         (Determining the "next non-current cue" requires new API on PODIntervalTree, as that class
3871         does not have iterators per-se.)
3872
3873         * html/HTMLMediaElement.cpp:
3874         (WebCore::compareCueIntervalEndTime):
3875         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3876         * platform/PODIntervalTree.h:
3877         * platform/graphics/MediaPlayer.cpp:
3878         (WebCore::MediaPlayer::performTaskAtMediaTime):
3879         * platform/graphics/MediaPlayer.h:
3880         * platform/graphics/MediaPlayerPrivate.h:
3881         (WebCore::MediaPlayerPrivateInterface::performTaskAtMediaTime):
3882         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3883         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3884         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
3885         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3886         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3887         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
3888
3889 2018-10-23  Fujii Hironori  <Hironori.Fujii@sony.com>
3890
3891         [Win] Assertion fails while destructing local static AtomicString of FontCache::lastResortFallbackFont
3892         https://bugs.webkit.org/show_bug.cgi?id=190748
3893
3894         Reviewed by Myles C. Maxfield.
3895