31f2e4d062e5f57c84b019b5f912a8cc3c2334cb
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-07  Chris Dumez  <cdumez@apple.com>
2
3         ASSERT(renderer()) under HTMLTextAreaElement::updateValue()
4         https://bugs.webkit.org/show_bug.cgi?id=191391
5         <rdar://problem/34219633>
6
7         Reviewed by Geoffrey Garen.
8
9         Update HTMLTextFormControlElement::didEditInnerTextValue() to not call subtreeHasChanged()
10         if the element has no renderer, similarly to what is already done in 
11         HTMLTextFormControlElement::setRangeText() and HTMLInputElement::setEditingValue().
12
13         Test: editing/inserting/inset-html-textarea-without-renderer.html
14
15         * html/HTMLTextFormControlElement.cpp:
16         (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
17
18 2018-11-07  Youenn Fablet  <youenn@apple.com>
19
20         Allow setting RTCRtpTransceiver.direction
21         https://bugs.webkit.org/show_bug.cgi?id=191346
22
23         Reviewed by Eric Carlson.
24
25         Remove readonly from the direction attribute.
26         Keep setDirection for now as it is in use, with an intent to remove it.
27         Driven-by fix as in some cases, the rtc source track might be changed
28         and current implementation is not expecting that.
29         In such a case, stop observing the old track (which should no longer call us)
30         before observing the new one.
31
32         Covered by rebased tests.
33
34         * Modules/mediastream/RTCRtpTransceiver.idl:
35         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
36         (WebCore::RealtimeIncomingAudioSource::setSourceTrack):
37         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
38         (WebCore::RealtimeIncomingVideoSource::setSourceTrack):
39
40 2018-11-07  Sihui Liu  <sihui_liu@apple.com>
41
42         RELEASE_ASSERT(!m_hardClosedForUserDelete) fails in WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer
43         https://bugs.webkit.org/show_bug.cgi?id=191326
44         <rdar://problem/45769269>
45
46         Reviewed by Geoffrey Garen.
47
48         UniqueIDBDatabase should ignore incoming requests or operations when it is already marked as
49         hardClosedForUserDelete.
50
51         Test: IndexedDB.IndexedDBUserDelete.
52
53         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
54         (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore):
55         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
56         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
57         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
58         (WebCore::IDBServer::UniqueIDBDatabaseConnection::deleteTransaction):
59         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
60         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
61         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
62
63 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
64
65         Positioned text underline can look like a strike-through
66         https://bugs.webkit.org/show_bug.cgi?id=191341
67
68         Reviewed by Simon Fraser.
69
70         We should just clamp the value so it can't go above the baseline.
71
72         We shouldn't do this at parse time because it's totally reasonable for text-underline-position: under to want
73         a negative text-underline-offset. Instead, we just do it at used value time.
74
75         Test: fast/css3-text/css3-text-decoration/text-underline-negative.html
76
77         * style/InlineTextBoxStyle.cpp:
78         (WebCore::computeUnderlineOffset):
79
80 2018-11-07  Chris Dumez  <cdumez@apple.com>
81
82         Unreviewed, fix iOS build with recent SDKs.
83
84         * platform/network/cocoa/ResourceResponseCocoa.mm:
85         (WebCore::ResourceResponse::platformCertificateInfo const):
86
87 2018-11-07  Chris Dumez  <cdumez@apple.com>
88
89         Unreviewed, fix iOS build with recent SDKs.
90
91         * platform/network/cocoa/ResourceResponseCocoa.mm:
92         (WebCore::ResourceResponse::platformCertificateInfo const):
93
94 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
95
96         Dotted underlines that skip descenders are invisible
97         https://bugs.webkit.org/show_bug.cgi?id=191403
98
99         Reviewed by Simon Fraser.
100
101         Turns out our underline bounding boxes had negative width. When drawing the full
102         underline that was fine because it was handled by the 2D graphics engine, but when
103         we try to split up the box into dots, our "for" loop was taking 0 iterations (because
104         the end was before the start).
105
106         Test: fast/css3-text/css3-text-decoration/text-underline-style.html
107
108         * platform/graphics/cairo/GraphicsContextCairo.cpp:
109         (WebCore::GraphicsContext::drawLineForText):
110         * platform/graphics/cg/GraphicsContextCG.cpp:
111         (WebCore::GraphicsContext::drawLineForText):
112         * platform/graphics/win/GraphicsContextDirect2D.cpp:
113         (WebCore::GraphicsContext::drawLineForText):
114
115 2018-11-07  Andy Estes  <aestes@apple.com>
116
117         Crash in WebCore::PaymentRequest::canMakePayment when Apple Pay payment method data is missing
118         https://bugs.webkit.org/show_bug.cgi?id=191331
119
120         Reviewed by Alexey Proskuryakov.
121
122         Apple Pay requires merchants specify an ApplePayRequest (which contains several required
123         fields) as payment method data when constructing a new PaymentRequest. If the
124         ApplePayRequest is missing required fields, or is missing entirely, canMakePayment() should
125         resolve to false.
126
127         We would properly resolve to false when an ApplePayRequest was specified with missing
128         required fields, but we would crash when the ApplePayRequest was missing entirely.
129
130         This patch fixes the crash by checking for an empty JSValue before trying to convert it to
131         an ApplePayRequest struct. Because we stringify ApplePayRequests in the PaymentRequest
132         constructor then parse them again in canMakePayments, an undefined or null payment method
133         data stringifies to a null String, which then parses to an empty JSValue.
134
135         Added test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
136
137         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
138         (WebCore::ApplePayPaymentHandler::convertData):
139         * Modules/paymentrequest/PaymentRequest.cpp:
140         (WebCore::PaymentRequest::canMakePayment):
141
142 2018-11-07  Simon Fraser  <simon.fraser@apple.com>
143
144         Revert 237849: it breaks MotionMark
145         https://bugs.webkit.org/show_bug.cgi?id=191398
146
147         Reviewed by Simon Fraser.
148
149         This change broke painting while the test is running.
150
151         * rendering/RenderLayerCompositor.cpp:
152         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
153
154 2018-11-07  Don Olmstead  <don.olmstead@sony.com>
155
156         Simplify macros in platform
157         https://bugs.webkit.org/show_bug.cgi?id=191378
158
159         Reviewed by Michael Catanzaro.
160
161         No new tests. No change in behavior.
162
163         Modifies a few cases where a platform macro could be simplified.
164
165         * page/EventHandler.cpp:
166         * platform/network/DNS.h:
167         * platform/network/NetworkStateNotifier.h:
168
169 2018-11-07  Simon Fraser  <simon.fraser@apple.com>
170
171         Some WK1 repaint tests are flakey
172         https://bugs.webkit.org/show_bug.cgi?id=190627
173
174         Reviewed by Zalan Bujtas.
175
176         Repaint tracking in GraphicsLayerCA was sensitive to whether there were already dirty
177         rects on the layer, since tracking happened after checks against existing dirty rects.
178         This caused some WK1 repaint tests to be flakey, since there's no guarantee that
179         no repaints happen between the last layer flush and a test calling startTrackingRepaints().
180
181         Fix by moving the repaint tracking to before the checks against existing dirty rects.
182         This is more similar to how repaint tracking on FrameView works.
183
184         * platform/graphics/ca/GraphicsLayerCA.cpp:
185         (WebCore::GraphicsLayerCA::setNeedsDisplayInRect):
186
187 2018-11-07  Dean Jackson  <dino@apple.com>
188
189         [iOS] WebGL leaks exact GPU type
190         https://bugs.webkit.org/show_bug.cgi?id=191393
191
192         Reviewed by Tim Horton.
193
194         The fully exposed renderer info shouldn't be necessary
195         on iOS, where the GPUs and drivers are consistent
196         enough that people shouldn't need to write code specifically
197         for them. Reduce the ability to fingerprint by simply
198         returning "Apple GPU".
199
200         The other option would have been to disable the extension,
201         but I think it might still be useful to know you're on
202         an iOS device.
203
204         Test: fast/canvas/webgl/hide-some-renderer-info.html
205
206         * html/canvas/WebGL2RenderingContext.cpp: Return "Apple GPU"
207         on iOS.
208         (WebCore::WebGL2RenderingContext::getParameter):
209         * html/canvas/WebGLRenderingContext.cpp: Ditto.
210         (WebCore::WebGLRenderingContext::getParameter):
211
212 2018-11-07  Daniel Bates  <dabates@apple.com>
213
214         Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
215         https://bugs.webkit.org/show_bug.cgi?id=190141
216
217         Reviewed by Darin Adler.
218
219         Remove the runtime application check for WebKitTestRunner as we no longer need this
220         now that WebKitTestRunner and DumpRenderTree override +[UIKeyboard isInHardwareKeyboardMode].
221
222         * platform/RuntimeApplicationChecks.h:
223         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
224         (WebCore::IOSApplication::isWebKitTestRunner): Deleted.
225
226 2018-11-07  Joseph Pecoraro  <pecoraro@apple.com>
227
228         Web Inspector: Fix "Javascript" => "JavaScript" enum in protocol generated objects
229         https://bugs.webkit.org/show_bug.cgi?id=191340
230
231         Reviewed by Devin Rousso.
232
233         * inspector/agents/InspectorMemoryAgent.cpp:
234         (WebCore::InspectorMemoryAgent::collectSample):
235         Use new enum name.
236
237 2018-11-07  Dan Bernstein  <mitz@apple.com>
238
239         Add a pseudoclass that matches img elements that are backed by an attachment
240         https://bugs.webkit.org/show_bug.cgi?id=191286
241         <rdar://problem/45823554>
242
243         Reviewed by Dean Jackson.
244
245         Test: fast/css/has-attachment.html
246
247         Added a :has-attachment pseudoclass, enabled only when the attachment element is enabled at
248         runtime, that matches elements (currently only img elements qualify) that have an attachment
249         element in their shadow DOM.
250
251         * css/CSSSelector.cpp:
252         (WebCore::CSSSelector::selectorText const): Handle the new PseudoClassHasAttachment value.
253         * css/CSSSelector.h: Added a new value to the PseudoClassType enum.
254
255         * css/SelectorChecker.cpp:
256         (WebCore::SelectorChecker::checkOne const): Check the new PseudoClassHasAttachment value
257           using the new hasAttachment test function.
258
259         * css/SelectorCheckerTestFunctions.h:
260         (WebCore::hasAttachment): Added. Tests if the element is an img element that has an
261           attachment.
262
263         * css/SelectorPseudoClassAndCompatibilityElementMap.in: Added has-attachment.
264
265         * css/parser/CSSParserContext.cpp:
266         (WebCore::CSSParserContext::CSSParserContext): Initialize new attachmentEnabled member based
267           on RuntimeEnabledFeatures.
268         (WebCore::operator==): Compare new attachmentEnabled member.
269         * css/parser/CSSParserContext.h:
270         (WebCore::CSSParserContextHash::hash): Include new attachmentEnabled member.
271
272         * css/parser/CSSSelectorParser.cpp:
273         (WebCore::CSSSelectorParser::consumePseudo): Reject :has-attachment if the attachment
274           element is not enabled.
275
276         * cssjit/SelectorCompiler.cpp:
277         (WebCore::SelectorCompiler::addPseudoClassType): Handle PseudoClassHasAttachment.
278
279 2018-11-07  Don Olmstead  <don.olmstead@sony.com>
280
281         Make generic MainThreadSharedTimer implementation
282         https://bugs.webkit.org/show_bug.cgi?id=191327
283
284         Reviewed by Michael Catanzaro.
285
286         No new tests. No change in behavior.
287
288         Moves generic implementation for MainThreadSharedTimerGlib.cpp into
289         MainThreadSharedTimer.cpp.
290
291         * platform/MainThreadSharedTimer.cpp:
292         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
293         (WebCore::MainThreadSharedTimer::setFireInterval):
294         (WebCore::MainThreadSharedTimer::stop):
295         (WebCore::MainThreadSharedTimer::invalidate):
296         * platform/MainThreadSharedTimer.h:
297         * platform/SourcesGLib.txt:
298         * platform/glib/MainThreadSharedTimerGLib.cpp: Removed.
299
300 2018-11-07  Ali Juma  <ajuma@chromium.org>
301
302         IntersectionObserverEntry doesn't keep JS wrappers of rects alive
303         https://bugs.webkit.org/show_bug.cgi?id=191330
304
305         Reviewed by Chris Dumez.
306
307         Retain wrappers of each rect in an IntersectionObserverEntry as long as the entry's wrapper
308         is alive, by adding these wrappers as opaque roots.
309
310         Test: intersection-observer/intersection-observer-entry-keeps-js-wrappers-of-rects-alive.html
311
312         * bindings/js/JSIntersectionObserverEntryCustom.cpp:
313         (WebCore::JSIntersectionObserverEntry::visitAdditionalChildren):
314         * dom/DOMRectReadOnly.idl:
315         * page/IntersectionObserverEntry.h:
316         (WebCore::IntersectionObserverEntry::rootBounds const): Make this return a raw pointer instead of a RefPtr so that it
317         can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which can be called from non-main threads.
318         (WebCore::IntersectionObserverEntry::boundingClientRect const): Ditto.
319         (WebCore::IntersectionObserverEntry::intersectionRect const): Ditto.
320
321 2018-11-07  Simon Fraser  <simon.fraser@apple.com>
322
323         TileController::tileSize() should not have side effects
324         https://bugs.webkit.org/show_bug.cgi?id=191349
325
326         Reviewed by Zalan Bujtas.
327
328         Calling TileController::tileSize() would recompute a new tile size and set m_tileSizeLocked,
329         which caused test failures if logging was enabled when running tests.
330
331         * platform/graphics/ca/TileController.cpp:
332         (WebCore::TileController::tileSize const):
333         (WebCore::TileController::computeTileSize):
334         * platform/graphics/ca/TileController.h:
335         * platform/graphics/ca/TileGrid.cpp:
336         (WebCore::TileGrid::revalidateTiles):
337
338 2018-11-07  Charlie Turner  <cturner@igalia.com>
339
340         [EME][GStreamer] Ensure key id buffers are present and simplify lifetime management of ClearKey class.
341         https://bugs.webkit.org/show_bug.cgi?id=191157
342
343         Reviewed by Xabier Rodriguez-Calvar.
344
345         This is in preparation for moving the clearkey decryptor behind a
346         new decrypt API in CDMInstance, which will be sent into the
347         pipeline to handle key management and decryption. This is for a
348         later patch.
349
350         Covered by existing clear key tests in media/encrypted-media.
351
352         * platform/graphics/gstreamer/GStreamerCommon.h:
353         (WebCore::GstMappedBuffer::data const): Add a const data accessor,
354         since we are now providing operator=='s on const objects of this
355         class that need const access to the data pointer.
356         (WebCore::GstMappedBuffer::operator==): Add a swap of the new
357         equality operator so you don't have to remember to have the
358         GstBuffer on the RHS of the equality all the time.
359         (WebCore::operator==): Define an equality operator between Gst
360         buffers and WebCore's mapped buffers. Gst creates a ref and a
361         separate read view under the covers in the memcmp call, so we do
362         not need to map the buffer ourselves.
363         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
364         (webkit_media_clear_key_decrypt_class_init): Remove setup/release
365         bindings.
366         (webkit_media_clear_key_decrypt_init): Initialize gcrypt cipher
367         here once instead of for every buffer to be decrypted.
368         (webKitMediaClearKeyDecryptorFinalize): And destroy the cipher
369         context when the decryptor is destroyed.
370         (webKitMediaClearKeyDecryptorFindAndSetKey): Factor out the key
371         retrieval and context setting in this method, call it for each
372         sample.
373         (webKitMediaClearKeyDecryptorDecrypt): Base key id buffer into
374         this function, and remove cipher creation / destroy methods.
375         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
376         (webkit_media_common_encryption_decrypt_class_init): Remove
377         setup/release bindings.
378         (webkitMediaCommonEncryptionDecryptTransformInPlace): Ensure a key
379         id is present and pass it to the decrypt class method.
380         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher): Deleted.
381         (webKitMediaCommonEncryptionDecryptDefaultReleaseCipher): Deleted.
382         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
383
384 2018-11-07  Frederic Wang  <fwang@igalia.com>
385
386         [Cairo] Move state change operations from GraphicsContextCairo to CairoOperations
387         https://bugs.webkit.org/show_bug.cgi?id=179610
388
389         Unreviewed build fix.
390
391         * platform/graphics/cairo/GraphicsContextCairo.cpp: Add missing include.
392
393 2018-11-06  Joseph Pecoraro  <pecoraro@apple.com>
394
395         ServiceWorker Inspector: Uncaught Exception: null is not an object (evaluating 'resource.target.addResource')
396         https://bugs.webkit.org/show_bug.cgi?id=191339
397
398         Reviewed by Matt Baker.
399
400         * workers/service/ServiceWorkerJob.cpp:
401         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
402         Use the Service Worker's identifier, not this static but otherwise unknown identifier.
403
404 2018-11-06  Youenn Fablet  <youenn@apple.com>
405
406         sender.replaceTrack() fails with InvalidStateError if the transceiver.direction is "inactive"
407         https://bugs.webkit.org/show_bug.cgi?id=191202
408
409         Reviewed by Eric Carlson.
410
411         Covered by updated test.
412
413         * Modules/mediastream/RTCPeerConnection.cpp:
414         (WebCore::RTCPeerConnection::removeTrack):
415         Update as per spec, in particular make sure to not stop the sender when removing the track.
416
417 2018-11-06  Justin Fan  <justin_fan@apple.com>
418
419         [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
420         https://bugs.webkit.org/show_bug.cgi?id=191291
421
422         Reviewed by Myles Maxfield.
423
424         Test: webgpu/render-pipelines.html
425         Also update test webgpu/webgpu-basics.html to create a WebGPURenderPipeline.
426
427         Begin implementation of WebGPURenderPipeline and WebGPUSwapChain. A WebGPURenderPipeline is backed by a
428         GPURenderPipeline, created lazily using the properties of the passed-in WebGPURenderPipelineDescriptor.
429         On Metal-supported systems, GPURenderPipeline is an interface to a MTLRenderPipelineState.
430         The MTLRenderPipelineState is created with the WebGPUDevice currently configured on the WebGPURenderingContext.
431
432         * CMakeLists.txt:
433         * Configurations/FeatureDefines.xcconfig:
434         * DerivedSources.make:
435         * Modules/webgpu/GPUDevice.cpp:
436         (WebCore::GPUDevice::createRenderPipeline const):
437         * Modules/webgpu/GPUDevice.h:
438         * Modules/webgpu/GPUPipelineDescriptorBase.h:
439         * Modules/webgpu/GPUPipelineStageDescriptor.h:
440         * Modules/webgpu/GPURenderPipelineDescriptor.h:
441         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
442         (WebCore::GPURenderPipelineDescriptor::primitiveTopology):
443         * Modules/webgpu/WebGPUDevice.cpp:
444         (WebCore::WebGPUDevice::createRenderPipeline const):
445         * Modules/webgpu/WebGPUDevice.h:
446         (WebCore::WebGPUDevice::adapter const):
447         (WebCore::WebGPUDevice::device const):
448         * Modules/webgpu/WebGPUDevice.idl:
449         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
450         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
451         * Modules/webgpu/WebGPUPipelineStageDescriptor.h:
452         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
453         * Modules/webgpu/WebGPURenderPipeline.cpp:
454         (WebCore::WebGPURenderPipeline::create):
455         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
456         * Modules/webgpu/WebGPURenderPipeline.h:
457         * Modules/webgpu/WebGPURenderPipeline.idl:
458         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
459         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
460         * Modules/webgpu/WebGPURenderingContext.cpp:
461         (WebCore::WebGPURenderingContext::create):
462         (WebCore::WebGPURenderingContext::WebGPURenderingContext):
463         * Modules/webgpu/WebGPURenderingContext.h:
464         * Modules/webgpu/WebGPUShaderModule.h:
465         (WebCore::WebGPUShaderModule::module const):
466         * Modules/webgpu/WebGPUShaderStage.h:
467         * Modules/webgpu/WebGPUShaderStage.idl:
468         * Modules/webgpu/WebGPUSwapChain.cpp:
469         (WebCore::WebGPUSwapChain::configure):
470         (WebCore::WebGPUSwapChain::reshape):
471         (WebCore::WebGPUSwapChain::markLayerComposited):
472         * Modules/webgpu/WebGPUSwapChain.h:
473         (WebCore::WebGPUSwapChain::WebGPUSwapChain):
474         * Modules/webgpu/WebGPUSwapChain.idl:
475         * Modules/webgpu/cocoa/GPURenderPipeline.h:
476         (WebCore::GPURenderPipeline::platformRenderPipeline const):
477         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm: Added.
478         (WebCore::setFunctionsForPipelineDescriptor):
479         (WebCore::GPURenderPipeline::create):
480         (WebCore::GPURenderPipeline::GPURenderPipeline):
481         * Modules/webgpu/cocoa/GPUSwapChain.h:
482         (WebCore::GPUSwapChain::platformLayer const):
483         * Modules/webgpu/cocoa/GPUSwapChainMetal.mm:
484         (WebCore::GPUSwapChain::create):
485         (WebCore::GPUSwapChain::GPUSwapChain):
486         (WebCore::GPUSwapChain::setDevice):
487         (WebCore::GPUSwapChain::reshape):
488         (WebCore::GPUSwapChain::present):
489         * Sources.txt:
490         * SourcesCocoa.txt:
491         * WebCore.xcodeproj/project.pbxproj:
492         * bindings/js/WebCoreBuiltinNames.h:
493
494 2018-11-06  Youenn Fablet  <youenn@apple.com>
495
496         Add support for sender/receiver getCapabilities
497         https://bugs.webkit.org/show_bug.cgi?id=191192
498
499         Reviewed by Eric Carlson.
500
501         Expose sender/receiver RTCRtpCapabilities to JS.
502         Add corresponding IDL and plumbing down to libwebrtc peer connection factory.
503         Covered by rebased tests.
504
505         * CMakeLists.txt:
506         * DerivedSources.make:
507         * Modules/mediastream/PeerConnectionBackend.cpp:
508         (WebCore::PeerConnectionBackend::receiverCapabilities):
509         (WebCore::PeerConnectionBackend::senderCapabilities):
510         * Modules/mediastream/PeerConnectionBackend.h:
511         * Modules/mediastream/RTCRtpCapabilities.idl: Added.
512         * Modules/mediastream/RTCRtpReceiver.cpp:
513         (WebCore::RTCRtpReceiver::getCapabilities):
514         * Modules/mediastream/RTCRtpReceiver.h:
515         * Modules/mediastream/RTCRtpReceiver.idl:
516         * Modules/mediastream/RTCRtpSender.cpp:
517         (WebCore::RTCRtpSender::getCapabilities):
518         * Modules/mediastream/RTCRtpSender.h:
519         * Modules/mediastream/RTCRtpSender.idl:
520         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
521         (WebCore::PeerConnectionBackend::receiverCapabilities):
522         (WebCore::PeerConnectionBackend::senderCapabilities):
523         * Sources.txt:
524         * WebCore.xcodeproj/project.pbxproj:
525         * platform/mediastream/RTCPMuxPolicy.h:
526         * platform/mediastream/RTCRtpCapabilities.h: Added.
527         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
528         (WebCore::typeFromKind):
529         (WebCore::fromStdString):
530         (WebCore::toChannels):
531         (WebCore::toRTCRtpCapabilities):
532         (WebCore::LibWebRTCProvider::receiverCapabilities):
533         (WebCore::LibWebRTCProvider::senderCapabilities):
534         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
535
536 2018-11-06  Youenn Fablet  <youenn@apple.com>
537
538         Calling sender.replaceTrack() twice produces a new transceiver and its corresponding m= section
539         https://bugs.webkit.org/show_bug.cgi?id=191261
540
541         Reviewed by Eric Carlson.
542
543         Handle the case of replacing a track in a sender that has no track.
544         In particular, do not create a new m-section as was implied by plan B implementation.
545         Instead, set the track directly on the rtc sender.
546         Covered by webrtc/video-addTransceiver.html.
547
548         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
549         (WebCore::LibWebRTCMediaEndpoint::createSourceAndRTCTrack):
550         (WebCore::LibWebRTCMediaEndpoint::addTransceiver):
551         (WebCore::LibWebRTCMediaEndpoint::setSenderSourceFromTrack):
552         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
553         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
554         (WebCore::LibWebRTCPeerConnectionBackend::setSenderSourceFromTrack):
555         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
556         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
557         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
558
559 2018-11-06  Chris Dumez  <cdumez@apple.com>
560
561         Post too much text to iFrame could crash webkit
562         https://bugs.webkit.org/show_bug.cgi?id=190947
563         <rdar://problem/45678231>
564
565         Reviewed by Geoffrey Garen.
566
567         Optimize SuffixTree (Which is used by XSSAuditor) to stop storing each Node's
568         children as a static array of 128 pointers and use a dynamic array (vector)
569         instead. This uses way less memory. Also make SuffixTree and SuffixTree::Node
570         as fast allocated for performance. This part of the change is based on the
571         following Blink change:
572         - https://chromium.googlesource.com/chromium/src.git/+/6ca590e1c7edaa7c56cac9e3e3c39cf398ca8d4d
573
574         Also update the XSSAuditor to construct the SuffixTree lazily since there are
575         many cases (including the one in this bug) where we were spending a significant
576         amount of time building the SuffixTree and then never querying it.
577
578         * html/parser/XSSAuditor.cpp:
579         (WebCore::XSSAuditor::init):
580         (WebCore::XSSAuditor::decodedHTTPBodySuffixTree):
581         (WebCore::XSSAuditor::isContainedInRequest):
582         * html/parser/XSSAuditor.h:
583         * platform/text/SuffixTree.h:
584         (WebCore::SuffixTree::mightContain):
585         (WebCore::SuffixTree::Node::Node):
586         (WebCore::SuffixTree::Node::~Node):
587         (WebCore::SuffixTree::Node::find):
588         (WebCore::SuffixTree::Node::end):
589         (WebCore::SuffixTree::build):
590         (WebCore::SuffixTree<Codebook>::Node::childAt):
591         (WebCore::SuffixTree::Node::at): Deleted.
592
593 2018-11-06  Youenn Fablet  <youenn@apple.com>
594
595         Support onremovetrack for RTCPeerConnection removed tracks
596         https://bugs.webkit.org/show_bug.cgi?id=191299
597
598         Reviewed by Eric Carlson.
599
600         When applying SDP, LibWebRTCMediaEndpoint gets notified of a removed track.
601         In that case, make sure to remove it from its remote stream(s) so as
602         to notify the application of the changes.
603         Work around the receiver missing the list of streams by storing in a map
604         the list of the remote streams for a given remote track.
605
606         Covered by rebased test.
607
608         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
609         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
610         (WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
611         (WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
612         (WebCore::LibWebRTCMediaEndpoint::stop):
613         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
614
615 2018-11-06  Timothy Hatcher  <timothy@apple.com>
616
617         REGRESSION (r237878): css-dark-mode/supported-color-schemes.html is failing on Mojave
618         https://bugs.webkit.org/show_bug.cgi?id=191338
619
620         Reviewed by Dean Jackson.
621
622         * page/Page.cpp:
623         (WebCore::Page::appearanceDidChange): Add back call to didChangeStyleSheetEnvironment().
624         It was dropped by mistake when I moved code to appearanceDidChange(). This is needed to
625         update styles for semantic colors and from controls when the media prefers-color-scheme
626         media query is not used on the page.
627
628 2018-11-06  Youenn Fablet  <youenn@apple.com>
629
630         Make mDNS ICE Candidate an experimental flag again
631         https://bugs.webkit.org/show_bug.cgi?id=191262
632
633         Reviewed by Dean Jackson.
634
635         Rename mdnsICECandidatesEnabled to webRTCICECandidatesEnabled.
636         This allows grouping the WebRTC runtime flags.
637         No change of behavior.
638
639         * Modules/mediastream/PeerConnectionBackend.cpp:
640         (WebCore::PeerConnectionBackend::newICECandidate):
641         * page/RuntimeEnabledFeatures.h:
642         (WebCore::RuntimeEnabledFeatures::webRTCMDNSICECandidatesEnabled const):
643         (WebCore::RuntimeEnabledFeatures::setWebRTCMDNSICECandidatesEnabled):
644         (WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const): Deleted.
645         (WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled): Deleted.
646
647 2018-11-06  Myles C. Maxfield  <mmaxfield@apple.com>
648
649         Implement text-underline-offset and text-decoration-thickness
650         https://bugs.webkit.org/show_bug.cgi?id=190774
651
652         Reviewed by Dean Jackson.
653
654         Because of our existing infrastructure for text decorations, adding support for these
655         is fairly simple. This patch updates our existing functions to handle thick & placed
656         underlines, as well as updating our repaint code to correcly handle repainting them.
657         It also handles animations.
658
659         Tests: animations/text-decoration-thickness.html
660                animations/text-underline-offset.html
661                fast/css3-text/css3-text-decoration/text-decoration-offset-2.html
662                fast/css3-text/css3-text-decoration/text-decoration-offset-3.html
663                fast/css3-text/css3-text-decoration/text-decoration-offset-auto-length.html
664                fast/css3-text/css3-text-decoration/text-decoration-offset-baseline.html
665                fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-auto.html
666                fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-length.html
667                fast/css3-text/css3-text-decoration/text-decoration-offset-repaint.html
668                fast/css3-text/css3-text-decoration/text-decoration-offset-under-auto.html
669                fast/css3-text/css3-text-decoration/text-decoration-offset-under-length.html
670                fast/css3-text/css3-text-decoration/text-decoration-offset.html
671                fast/css3-text/css3-text-decoration/text-decoration-thickness-length.html
672                fast/css3-text/css3-text-decoration/text-decoration-thickness-repaint.html
673
674         * page/animation/CSSPropertyAnimation.cpp:
675         (WebCore::blendFunc):
676         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
677         * platform/graphics/FontMetrics.h:
678         (WebCore::FontMetrics::underlinePosition const):
679         (WebCore::FontMetrics::setUnderlinePosition):
680         (WebCore::FontMetrics::underlineThickness const):
681         (WebCore::FontMetrics::setUnderlineThickness):
682         * platform/graphics/cocoa/FontCocoa.mm:
683         (WebCore::Font::platformInit):
684         * rendering/InlineFlowBox.cpp:
685         (WebCore::InlineFlowBox::addToLine):
686         * rendering/SimpleLineLayout.cpp:
687         (WebCore::SimpleLineLayout::canUseForStyle):
688         * rendering/TextDecorationPainter.cpp:
689         (WebCore::TextDecorationPainter::paintTextDecoration):
690         * rendering/style/RenderStyle.cpp:
691         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
692         * rendering/style/TextDecorationThickness.h:
693         (WebCore::TextDecorationThickness::resolve const):
694         * style/InlineTextBoxStyle.cpp:
695         (WebCore::computeUnderlineOffset):
696         (WebCore::visualOverflowForDecorations):
697         * style/InlineTextBoxStyle.h:
698         (WebCore::textDecorationStrokeThickness): Deleted.
699
700 2018-11-06  John Wilander  <wilander@apple.com>
701
702         Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only)
703         https://bugs.webkit.org/show_bug.cgi?id=189760
704         <rdar://problem/44612242>
705
706         Reviewed by Youenn Fablet and Antti Koivisto.
707
708         No new tests. Existing test fleshed out.
709
710         * platform/network/ResourceResponseBase.cpp:
711         (WebCore::ResourceResponseBase::isRedirection const):
712         * platform/network/ResourceResponseBase.h:
713         (WebCore::ResourceResponseBase::isRedirection const): Deleted.
714             Moved to the implementation file so that I can export it without warning.
715
716 2018-11-06  Myles C. Maxfield  <mmaxfield@apple.com>
717
718         Spelling dots are drawn in the wrong place
719         https://bugs.webkit.org/show_bug.cgi?id=190764
720
721         Reviewed by Dean Jackson.
722
723         - Dots should not be clipped.
724         - Dots should be horizontally centered.
725         - Dots should be drawn behind the text.
726         - Distance from the baseline to the top of the dot should be 11.035% of font size.
727         - Dot diameter should be 13.247% of the font size.
728         - Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size.
729         - The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px.
730
731         Tests: editing/spelling/spelling-dots-position-2.html
732                editing/spelling/spelling-dots-position-3.html
733                editing/spelling/spelling-dots-position.html
734                editing/spelling/spelling-dots-repaint.html
735
736         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
737         (WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations.
738         (WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly.
739         * rendering/InlineFlowBox.cpp:
740         (WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots,
741             because there is no guarantee the spelling dots will lie inside the layout rect of the element.
742         (WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions.
743         * rendering/InlineFlowBox.h: Comments should explain why, not say what.
744         * rendering/InlineTextBox.cpp:
745         (WebCore::InlineTextBox::paint): Draw the dots behind the text.
746         (WebCore::InlineTextBox::hasMarkers const): Convenience.
747         (WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function.
748         (WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation.
749         (WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly.
750         (WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method.
751         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
752         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted.
753         * rendering/InlineTextBox.h: Declare the helper methods.
754         * rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of
755             spelling dots opt us out of SLL.
756         (WebCore::SimpleLineLayout::canUseForWithReason):
757         * rendering/SimpleLineLayoutCoverage.cpp:
758         (WebCore::SimpleLineLayout::printReason):
759         * rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason.
760
761 2018-11-06  Per Arne Vollan  <pvollan@apple.com>
762
763         REGRESSION (r230523): Caps lock indicator not shown in password field
764         https://bugs.webkit.org/show_bug.cgi?id=190056
765
766         Reviewed by Ryosuke Niwa.
767
768         When WindowServer access is blocked, GetCurrentModifiers() always returns 0. Instead of calling
769         GetCurrentModifiers(), store the current modifiers from the key event argument in the method
770         WebKit::WebPage::keyEvent, and use the stored value to detect if Caps lock is on. Additionally,
771         the modifiers needs to be updated when the window becomes active.
772
773         Test: fast/events/detect-caps-lock.html
774
775         * Sources.txt:
776         * platform/PlatformKeyboardEvent.h:
777         * platform/graphics/FontTaggedSettings.cpp:
778         * platform/mac/KeyEventMac.mm:
779         (WebCore::PlatformKeyboardEvent::currentCapsLockState):
780         (WebCore::PlatformKeyboardEvent::getCurrentModifierState):
781         * testing/Internals.cpp:
782         (WebCore::Internals::capsLockIsOn):
783         * testing/Internals.h:
784         * testing/Internals.idl:
785
786 2018-11-06  Javier Fernandez  <jfernandez@igalia.com>
787
788         CSS grid elements with justify-content: space-around have extra whitespace, sometimes a lot
789         https://bugs.webkit.org/show_bug.cgi?id=191308
790
791         Reviewed by Dean Jackson.
792
793         The CSS WG resolved [1] that Content Alignment should account to the
794         track sizing algorithm.
795
796         The sizing algorithm has been modified so that two new steps (1.5
797         and 2.5) were added to compute the Content Alignment offsets after
798         resolving the columns' and rows' sizes respectively.
799
800         This change decouples the Content Alignment logic from the tracks
801         position, so that we can use it as part of the track sizing algorithm.
802
803         I also had to store the whole ContentAlignmentData structure in two
804         class attributes. We need both, position and distribution offsets, to
805         be used in different parts of the layout logic.
806
807         [1] https://github.com/w3c/csswg-drafts/issues/2557
808
809         Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-001.html
810                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-002.html
811                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-003.html
812                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-004.html
813                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-filled-shrinkwrap-001.html
814                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-spanned-shrinkwrap-001.html
815                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-filled-shrinkwrap-001.html
816                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-spanned-shrinkwrap-001.html
817
818         * rendering/GridTrackSizingAlgorithm.cpp:
819         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
820         * rendering/RenderGrid.cpp:
821         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
822         (WebCore::RenderGrid::layoutBlock):
823         (WebCore::RenderGrid::gridItemOffset const):
824         (WebCore::RenderGrid::trackSizesForComputedStyle const):
825         (WebCore::RenderGrid::populateGridPositionsForDirection):
826         (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
827         (WebCore::contentDistributionOffset):
828         (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
829         (WebCore::RenderGrid::nonCollapsedTracks const):
830         * rendering/RenderGrid.h:
831         (WebCore::ContentAlignmentData::isValid):
832         (WebCore::ContentAlignmentData::defaultOffsets):
833
834 2018-11-06  Sihui Liu  <sihui_liu@apple.com>
835
836         IndexedDB: WAL file keeps growing
837         https://bugs.webkit.org/show_bug.cgi?id=191294
838         <rdar://problem/41333493>
839
840         Reviewed by Chris Dumez.
841
842         When we quit apps, the database connection may not be shut down properly, and WAL file will be retained on disk.
843         On the next open of database connection, new logs will be appended to the original WAL file, which keeps 
844         increasing size of the WAL file. We should do a manual checkpoint when we open a IndexedDB to make sure previous
845         log is written to database and truncate WAL file.
846
847         Test: IndexedDB.IndexedDBTempFileSize
848
849         * platform/sql/SQLiteDatabase.cpp:
850         (WebCore::SQLiteDatabase::open):
851
852 2018-11-06  Ali Juma  <ajuma@chromium.org>
853
854         IntersectionObserver doesn't keep target's JS wrapper alive
855         https://bugs.webkit.org/show_bug.cgi?id=190235
856
857         Reviewed by Ryosuke Niwa.
858
859         Retain JS wrappers of targets in queued entries using a vector of GCReachableRef owned by
860         IntersectionObserver, which gets cleared after the entries have been delivered.
861
862         Make IntersectionObserver::takeRecords return a struct which has both the vector of GCReachableRefs
863         for targets and the vector of intersection observer entries, so that the GCReachableRefs survive
864         until the creation of JS wrappers for the entries.
865
866         Modify IntersectionObserver::hasPendingActivity to keep the observer alive while it has
867         entries to deliver.
868
869         Tests: intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive.html
870                intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html
871                intersection-observer/target-deleted.html
872
873         * Sources.txt:
874         * WebCore.xcodeproj/project.pbxproj:
875         * bindings/js/JSIntersectionObserverEntryCustom.cpp:
876         (WebCore::JSIntersectionObserverEntry::visitAdditionalChildren): Keep the target element's wrapper alive while the
877         IntersectionObserverEntry's wrapper is alive.
878         * page/IntersectionObserver.cpp:
879         (WebCore::IntersectionObserver::takeRecords): Change return type to include GCReachableRefs for each record's target, so that
880         each target can be kept until a JS wrapper is constructed for its IntersectionObserverEntry.
881         (WebCore::IntersectionObserver::appendQueuedEntry):
882         (WebCore::IntersectionObserver::notify): Erase GCReachableRefs for targets after delivering the corresponding records.
883         (WebCore::IntersectionObserver::hasPendingActivity const): Keep the IntersectionObserver alive until queued entries are delivered.
884         (WebCore::IntersectionObserver::stop):
885         * page/IntersectionObserver.h:
886         * page/IntersectionObserver.idl:
887         * page/IntersectionObserverEntry.h:
888         (WebCore::IntersectionObserverEntry::target const): Make this return a raw pointer instead of a RefPtr so that it
889         can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which runs on the GC thread (it's illegal to ref a Node
890         on a non-main thread).
891         * page/IntersectionObserverEntry.idl:
892
893 2018-11-06  Timothy Hatcher  <timothy@apple.com>
894
895         <picture> container doesn't update when prefers-color-scheme media query changes
896         https://bugs.webkit.org/show_bug.cgi?id=190913
897         rdar://problem/45608456
898
899         Reviewed by Dean Jackson.
900
901         Test: css-dark-mode/prefers-color-scheme-picture-element.html
902
903         * css/MediaQueryEvaluator.cpp:
904         (WebCore::isAppearanceDependent): Added.
905         (WebCore::MediaQueryEvaluator::evaluate const): Keep track of appearanceDependentResults.
906         * css/MediaQueryEvaluator.h:
907         * css/StyleResolver.cpp:
908         (WebCore::StyleResolver::addAppearanceDependentMediaQueryResult): Added.
909         (WebCore::StyleResolver::hasMediaQueriesAffectedByAppearanceChange const): Added.
910         * css/StyleResolver.h:
911         (WebCore::StyleResolver::hasAppearanceDependentMediaQueries const): Added.
912         * dom/Document.cpp:
913         (WebCore::Document::evaluateMediaQueryList): Call checkAppearanceDependentPictures.
914         (WebCore::Document::checkAppearanceDependentPictures): Added.
915         (WebCore::Document::addAppearanceDependentPicture): Added.
916         (WebCore::Document::removeAppearanceDependentPicture): Added.
917         * dom/Document.h:
918         * html/HTMLImageElement.cpp:
919         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Call addAppearanceDependentPicture.
920         * html/HTMLPictureElement.cpp:
921         (WebCore::HTMLPictureElement::~HTMLPictureElement): Call removeAppearanceDependentPicture.
922         (WebCore::HTMLPictureElement::didMoveToNewDocument): Ditto.
923         (WebCore::HTMLPictureElement::appearanceChangeAffectedPicture const): Added.
924         * html/HTMLPictureElement.h:
925         * page/Page.cpp:
926         (WebCore::Page::appearanceDidChange): Added.
927         (WebCore::Page::setUseSystemAppearance): Call appearanceDidChange.
928         (WebCore::Page::setUseDarkAppearance): Call appearanceDidChange.
929         * page/Page.h:
930         * style/StyleScope.cpp:
931         (WebCore::Style::Scope::evaluateMediaQueriesForAppearanceChange): Added.
932         * style/StyleScope.h:
933
934 2018-11-06  Ryan Haddad  <ryanhaddad@apple.com>
935
936         Unreviewed, rolling out r237834.
937
938         Tests for this change crash on iOS Simulator
939
940         Reverted changeset:
941
942         "Spelling dots are drawn in the wrong place"
943         https://bugs.webkit.org/show_bug.cgi?id=190764
944         https://trac.webkit.org/changeset/237834
945
946 2018-11-06  Antoine Quint  <graouts@apple.com>
947
948         [Web Animations] transitions/remove-transition-style.html crashes with GuardMalloc on
949         https://bugs.webkit.org/show_bug.cgi?id=191304
950         <rdar://problem/45819476>
951
952         Reviewed by Dean Jackson.
953
954         Ensure we remove animations from the m_allAnimations ListHashSet upon destruction.
955
956         * animation/AnimationTimeline.cpp:
957         (WebCore::AnimationTimeline::forgetAnimation):
958         (WebCore::AnimationTimeline::cancelDeclarativeAnimation):
959         * animation/AnimationTimeline.h:
960         * animation/DocumentTimeline.cpp:
961         (WebCore::DocumentTimeline::getAnimations const):
962         * animation/WebAnimation.cpp:
963         (WebCore::WebAnimation::~WebAnimation):
964
965 2018-11-06  Youenn Fablet  <youenn@apple.com>
966
967         RealtimeOutgoingAudioSourceCocoa should unobserve its source at destruction time
968         https://bugs.webkit.org/show_bug.cgi?id=191295
969
970         Reviewed by Eric Carlson.
971
972         Make RealtimeOutgoingAudioSource subclasses unobserve their source
973         inside their destructor instead of RealtimeOutgoingAudioSource.
974         This is consistent with how starting to observe works.
975         Covered by existing tests.
976
977         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
978         (WebCore::RealtimeOutgoingAudioSource::unobserveSource):
979         * platform/mediastream/RealtimeOutgoingAudioSource.h:
980         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
981         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC):
982         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
983         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
984         (WebCore::RealtimeOutgoingAudioSourceCocoa::~RealtimeOutgoingAudioSourceCocoa):
985         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
986
987 2018-11-06  Youenn Fablet  <youenn@apple.com>
988
989         Make sure RTCIceCandidateStats address is undefined for host and peer reflexive case
990         https://bugs.webkit.org/show_bug.cgi?id=191263
991
992         Reviewed by Eric Carlson.
993
994         Test: webrtc/datachannel/getStats-no-prflx-remote-candidate.html
995
996         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
997         (WebCore::fillRTCIceCandidateStats):
998
999 2018-11-06  Thibault Saunier  <tsaunier@igalia.com>
1000
1001         [GStreamer][WebRTC] Handle setting max number of frame between keyframes
1002         https://bugs.webkit.org/show_bug.cgi?id=190682
1003
1004         Reviewed by Philippe Normand.
1005
1006         That has been manually checked.
1007
1008         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
1009         (gst_webrtc_video_encoder_get_property):
1010         (gst_webrtc_video_encoder_set_property):
1011         (register_known_encoder):
1012         (gst_webrtc_video_encoder_class_init):
1013         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1014         (WebCore::GStreamerVideoEncoder::InitEncode):
1015
1016 2018-11-03  Alex Christensen  <achristensen@webkit.org>
1017
1018         [Mac] Implement safe browsing in WebKit
1019         https://bugs.webkit.org/show_bug.cgi?id=188871
1020
1021         Reviewed by Tim Horton.
1022
1023         * en.lproj/Localizable.strings:
1024
1025 2018-11-06  Ali Juma  <ajuma@chromium.org>
1026
1027         [IntersectionObserver] Account for CSS zoom when computing client rects
1028         https://bugs.webkit.org/show_bug.cgi?id=191282
1029
1030         Reviewed by Simon Fraser.
1031
1032         When computing rects for an IntersectionObserverEntry, account for the effective zoom when
1033         converting from absolute to client coordinates.
1034
1035         Test: web-platform-tests/intersection-observer/bounding-box.html
1036
1037         * dom/Document.cpp:
1038         (WebCore::Document::updateIntersectionObservations):
1039
1040 2018-11-06  Thibault Saunier  <tsaunier@igalia.com>
1041
1042         [GStreamer][WebRTC] Implement black frame generation
1043         https://bugs.webkit.org/show_bug.cgi?id=190684
1044
1045         Reviewed by Xabier Rodriguez-Calvar.
1046
1047         Avoiding webrtc/video-mute-vp8.html to crash but it still fails because
1048         we are missing the canvas bridging code.
1049
1050         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
1051         (WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame):
1052         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
1053
1054 2018-11-06  Thibault Saunier  <tsaunier@igalia.com>
1055
1056         [GStreamer][WebRTC] Do not try to handle framerate modulation in the encoder
1057         https://bugs.webkit.org/show_bug.cgi?id=190683
1058
1059         Reviewed by Philippe Normand.
1060
1061         This has to already be handled in capturing pipeline or in libwebrtc itself.
1062
1063         No other encoder implementation do that, and libwebrtc is not happy with encoder that do not output the exact number of frames that have been passed in.
1064
1065         No regressions detected and libwebrtc is happier this way, less warning output and no more frame corruption in H264 streams found.
1066
1067         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1068         (WebCore::GStreamerVideoEncoder::InitEncode):
1069
1070 2018-11-06  Frederic Wang  <fwang@igalia.com>
1071
1072         Unreviewed, follow-up of previous commit.
1073
1074         Actually move OptionSet in the header since it's used there too.
1075
1076         * page/WindowFeatures.cpp:
1077         * page/WindowFeatures.h:
1078
1079 2018-11-06  Frederic Wang  <fwang@igalia.com>
1080
1081         Unreviewed build fix.
1082
1083         * page/WindowFeatures.cpp: Add missing header for OptionSet.
1084         * platform/graphics/FontTaggedSettings.cpp: Add missing header for IntegerHash.
1085
1086 2018-11-06  Antoine Quint  <graouts@apple.com>
1087
1088         [Web Animations] Don't reset pending tasks when setting a null effect
1089         https://bugs.webkit.org/show_bug.cgi?id=191301
1090         <rdar://problem/45838422>
1091
1092         Reviewed by Dean Jackson.
1093
1094         The issue https://github.com/w3c/csswg-drafts/issues/2077 has changed the Web Animations API such that
1095         we no longer reset pending tasks when setting a null effect on an animation.
1096
1097         * animation/WebAnimation.cpp:
1098         (WebCore::WebAnimation::setEffect):
1099
1100 2018-11-06  Antoine Quint  <graouts@apple.com>
1101
1102         [Web Animations] Update the API to allow the "auto" composite value
1103         https://bugs.webkit.org/show_bug.cgi?id=191300
1104         <rdar://problem/45838373>
1105
1106         Reviewed by Dean Jackson.
1107
1108         The Web Animations API has been changed such that the various "composite" properties are no longer optional and instead
1109         allow an "auto" value in their enumeration.
1110
1111         * CMakeLists.txt:
1112         * DerivedSources.make:
1113         * Sources.txt:
1114         * WebCore.xcodeproj/project.pbxproj:
1115         * animation/CompositeOperationOrAuto.h: Copied from Source/WebCore/animation/KeyframeEffect.idl.
1116         * animation/CompositeOperationOrAuto.idl: Copied from Source/WebCore/animation/KeyframeEffect.idl.
1117         * animation/KeyframeEffect.cpp:
1118         (WebCore::processKeyframeLikeObject):
1119         (WebCore::processIterableKeyframes):
1120         (WebCore::processPropertyIndexedKeyframes):
1121         (WebCore::KeyframeEffect::getKeyframes):
1122         * animation/KeyframeEffect.h:
1123         * animation/KeyframeEffect.idl:
1124
1125 2018-11-06  Antoine Quint  <graouts@apple.com>
1126
1127         [Web Animations] Update the API to implement Animation.updatePlaybackRate()
1128         https://bugs.webkit.org/show_bug.cgi?id=186510
1129         <rdar://problem/41000641>
1130
1131         Reviewed by Dean Jackson.
1132
1133         The Web Animations API has been changed to allow for changes to an animation's playback rate both synchronously,
1134         with the existing "playbackRate" property, and asynchronously, with the new updatePlaybackRate() method. In this
1135         patch we update the various procedures to account for pending playback rate changes and the notion of an "effective
1136         playback rate".
1137
1138         * animation/WebAnimation.cpp:
1139         (WebCore::WebAnimation::setEffect):
1140         (WebCore::WebAnimation::setTimeline):
1141         (WebCore::WebAnimation::setStartTime):
1142         (WebCore::WebAnimation::setCurrentTime):
1143         (WebCore::WebAnimation::effectivePlaybackRate const):
1144         (WebCore::WebAnimation::setPlaybackRate):
1145         (WebCore::WebAnimation::updatePlaybackRate):
1146         (WebCore::WebAnimation::applyPendingPlaybackRate):
1147         (WebCore::WebAnimation::playState const):
1148         (WebCore::WebAnimation::resetPendingTasks):
1149         (WebCore::WebAnimation::finish):
1150         (WebCore::WebAnimation::play):
1151         (WebCore::WebAnimation::runPendingPlayTask):
1152         (WebCore::WebAnimation::reverse):
1153         (WebCore::WebAnimation::runPendingPauseTask):
1154         * animation/WebAnimation.h:
1155         (WebCore::WebAnimation::playbackRate const):
1156         * animation/WebAnimation.idl:
1157
1158 2018-11-06  Antoine Quint  <graouts@apple.com>
1159
1160         [Web Animations] Implement getTiming() and updateTiming()
1161         https://bugs.webkit.org/show_bug.cgi?id=186511
1162         <rdar://problem/41000677>
1163
1164         Reviewed by Dean Jackson.
1165
1166         The Web Animations API has been further simplified by removing the AnimationEffectTiming and AnimationEffectTimingReadOnly
1167         interfaces, removing the "timing" property on AnimationEffect replacing it with getTiming() and updateTiming() methods. This
1168         does not change the features of the API but simply how they are exposed.
1169
1170         * CMakeLists.txt:
1171         * DerivedSources.make:
1172         * Sources.txt:
1173         * WebCore.xcodeproj/project.pbxproj:
1174         * animation/AnimationEffect.cpp:
1175         (WebCore::AnimationEffect::AnimationEffect):
1176         (WebCore::AnimationEffect::~AnimationEffect):
1177         (WebCore::AnimationEffect::phase const):
1178         (WebCore::AnimationEffect::activeTime const):
1179         (WebCore::AnimationEffect::overallProgress const):
1180         (WebCore::AnimationEffect::simpleIterationProgress const):
1181         (WebCore::AnimationEffect::currentIteration const):
1182         (WebCore::AnimationEffect::currentDirection const):
1183         (WebCore::AnimationEffect::transformedProgress const):
1184         (WebCore::AnimationEffect::getTiming):
1185         (WebCore::AnimationEffect::getComputedTiming):
1186         (WebCore::AnimationEffect::updateTiming):
1187         (WebCore::AnimationEffect::setIterationStart):
1188         (WebCore::AnimationEffect::setIterations):
1189         (WebCore::AnimationEffect::endTime const):
1190         (WebCore::AnimationEffect::setDelay):
1191         (WebCore::AnimationEffect::setEndDelay):
1192         (WebCore::AnimationEffect::setFill):
1193         (WebCore::AnimationEffect::setIterationDuration):
1194         (WebCore::AnimationEffect::setDirection):
1195         (WebCore::AnimationEffect::setTimingFunction):
1196         (WebCore::AnimationEffect::activeDuration const):
1197         * animation/AnimationEffect.h:
1198         (WebCore::AnimationEffect::delay const):
1199         (WebCore::AnimationEffect::endDelay const):
1200         (WebCore::AnimationEffect::fill const):
1201         (WebCore::AnimationEffect::iterationStart const):
1202         (WebCore::AnimationEffect::iterations const):
1203         (WebCore::AnimationEffect::iterationDuration const):
1204         (WebCore::AnimationEffect::direction const):
1205         (WebCore::AnimationEffect::timingFunction const):
1206         * animation/AnimationEffect.idl:
1207         * animation/AnimationEffectTiming.idl: Removed.
1208         * animation/AnimationEffectTimingReadOnly.cpp: Removed.
1209         * animation/AnimationEffectTimingReadOnly.h: Removed.
1210         * animation/AnimationEffectTimingReadOnly.idl: Removed.
1211         * animation/CSSAnimation.cpp:
1212         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
1213         * animation/CSSTransition.cpp:
1214         (WebCore::CSSTransition::setTimingProperties):
1215         * animation/DeclarativeAnimation.cpp:
1216         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1217         * animation/DocumentTimeline.cpp:
1218         * animation/EffectTiming.idl:
1219         * animation/KeyframeEffect.cpp:
1220         (WebCore::KeyframeEffect::create):
1221         (WebCore::KeyframeEffect::KeyframeEffect):
1222         (WebCore::KeyframeEffect::copyPropertiesFromSource):
1223         (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
1224         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1225         (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
1226         * animation/KeyframeEffect.h:
1227         * animation/OptionalEffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTiming.h.
1228         * animation/OptionalEffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTiming.cpp.
1229         * animation/WebAnimation.cpp:
1230         (WebCore::WebAnimation::effectTimingDidChange):
1231         (WebCore::WebAnimation::updatePlaybackRate):
1232         * animation/WebAnimation.h:
1233         (WebCore::WebAnimation::isRelevant const):
1234         * bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Removed.
1235         * bindings/js/WebCoreBuiltinNames.h:
1236
1237 2018-11-06  Antoine Quint  <graouts@apple.com>
1238
1239         [Web Animations] Update the Web Animations API to remove all the ReadOnly interfaces
1240         https://bugs.webkit.org/show_bug.cgi?id=186512
1241         <rdar://problem/41000691>
1242
1243         Reviewed by Dean Jackson.
1244
1245         The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch,
1246         we make the following changes, not adding code but merely merging and renaming files:
1247
1248         - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface
1249         - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface
1250         - ComputedTimingProperties is now named ComputedEffectTiming
1251         - AnimationEffectTimingProperties is now named EffectTiming
1252
1253         * CMakeLists.txt:
1254         * DerivedSources.make:
1255         * Sources.txt:
1256         * WebCore.xcodeproj/project.pbxproj:
1257         * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp.
1258         (WebCore::AnimationEffect::~AnimationEffect):
1259         (WebCore::AnimationEffect::timingDidChange):
1260         (WebCore::AnimationEffect::localTime const):
1261         (WebCore::AnimationEffect::phase const):
1262         (WebCore::AnimationEffect::activeTime const):
1263         (WebCore::AnimationEffect::overallProgress const):
1264         (WebCore::AnimationEffect::simpleIterationProgress const):
1265         (WebCore::AnimationEffect::currentIteration const):
1266         (WebCore::AnimationEffect::currentDirection const):
1267         (WebCore::AnimationEffect::directedProgress const):
1268         (WebCore::AnimationEffect::transformedProgress const):
1269         (WebCore::AnimationEffect::iterationProgress const):
1270         (WebCore::AnimationEffect::getComputedTiming):
1271         * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h.
1272         (WebCore::AnimationEffect::isKeyframeEffect const):
1273         * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl.
1274         * animation/AnimationEffectTimingReadOnly.cpp:
1275         * animation/AnimationEffectTimingReadOnly.h:
1276         (WebCore::AnimationEffectTimingReadOnly::setEffect):
1277         * animation/AnimationTimeline.cpp:
1278         (WebCore::AnimationTimeline::removeAnimation):
1279         (WebCore::AnimationTimeline::cssAnimationForElementAndProperty):
1280         * animation/CSSTransition.cpp:
1281         * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h.
1282         * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl.
1283         * animation/DeclarativeAnimation.cpp:
1284         (WebCore::DeclarativeAnimation::initialize):
1285         (WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
1286         (WebCore::DeclarativeAnimation::phaseWithoutEffect const):
1287         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1288         * animation/DeclarativeAnimation.h:
1289         * animation/DocumentTimeline.cpp:
1290         (WebCore::DocumentTimeline::getAnimations const):
1291         (WebCore::DocumentTimeline::transitionDidComplete):
1292         (WebCore::DocumentTimeline::computeExtentOfAnimation const):
1293         (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const):
1294         (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const):
1295         (WebCore::DocumentTimeline::animatedStyleForRenderer):
1296         (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
1297         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
1298         (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
1299         (WebCore::DocumentTimeline::resolveAnimationsForElement):
1300         * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h.
1301         * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl.
1302         * animation/KeyframeEffect.cpp:
1303         (WebCore::invalidateElement):
1304         (WebCore::CSSPropertyIDToIDLAttributeName):
1305         (WebCore::IDLAttributeNameToAnimationPropertyName):
1306         (WebCore::computeMissingKeyframeOffsets):
1307         (WebCore::processKeyframeLikeObject):
1308         (WebCore::processIterableKeyframes):
1309         (WebCore::processPropertyIndexedKeyframes):
1310         (WebCore::KeyframeEffect::create):
1311         (WebCore::KeyframeEffect::KeyframeEffect):
1312         (WebCore::KeyframeEffect::copyPropertiesFromSource):
1313         (WebCore::KeyframeEffect::getKeyframes):
1314         (WebCore::KeyframeEffect::processKeyframes):
1315         (WebCore::KeyframeEffect::updateBlendingKeyframes):
1316         (WebCore::KeyframeEffect::forceLayoutIfNeeded):
1317         (WebCore::KeyframeEffect::setBlendingKeyframes):
1318         (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists):
1319         (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const):
1320         (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists):
1321         (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists):
1322         (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists):
1323         (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes):
1324         (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes):
1325         (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
1326         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
1327         (WebCore::KeyframeEffect::computeStackingContextImpact):
1328         (WebCore::KeyframeEffect::setTarget):
1329         (WebCore::KeyframeEffect::apply):
1330         (WebCore::KeyframeEffect::invalidate):
1331         (WebCore::KeyframeEffect::computeShouldRunAccelerated):
1332         (WebCore::KeyframeEffect::getAnimatedStyle):
1333         (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
1334         (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex):
1335         (WebCore::KeyframeEffect::updateAcceleratedAnimationState):
1336         (WebCore::KeyframeEffect::addPendingAcceleratedAction):
1337         (WebCore::KeyframeEffect::animationDidSeek):
1338         (WebCore::KeyframeEffect::animationSuspensionStateDidChange):
1339         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1340         (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
1341         (WebCore::KeyframeEffect::renderer const):
1342         (WebCore::KeyframeEffect::currentStyle const):
1343         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
1344         (WebCore::containsRotation):
1345         (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const):
1346         (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const):
1347         * animation/KeyframeEffect.h:
1348         (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe):
1349         (WebCore::KeyframeEffect::target const):
1350         (WebCore::KeyframeEffect::iterationComposite const):
1351         (WebCore::KeyframeEffect::composite const):
1352         (WebCore::KeyframeEffect::isRunningAccelerated const):
1353         (WebCore::KeyframeEffect::hasPendingAcceleratedAction const):
1354         (WebCore::KeyframeEffect::hasBlendingKeyframes const):
1355         (WebCore::KeyframeEffect::animatedProperties const):
1356         * animation/KeyframeEffect.idl:
1357         * animation/KeyframeEffectOptions.h:
1358         * animation/KeyframeEffectOptions.idl:
1359         * animation/KeyframeEffectReadOnly.cpp: Removed.
1360         * animation/KeyframeEffectReadOnly.h: Removed.
1361         * animation/KeyframeEffectReadOnly.idl: Removed.
1362         * animation/WebAnimation.cpp:
1363         (WebCore::WebAnimation::create):
1364         (WebCore::WebAnimation::setEffect):
1365         (WebCore::WebAnimation::setEffectInternal):
1366         (WebCore::WebAnimation::setTimeline):
1367         (WebCore::WebAnimation::applyPendingAcceleratedActions):
1368         (WebCore::WebAnimation::computeRelevance):
1369         * animation/WebAnimation.h:
1370         (WebCore::WebAnimation::effect const):
1371         * animation/WebAnimation.idl:
1372         * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp.
1373         (WebCore::toJSNewlyCreated):
1374         (WebCore::toJS):
1375         * bindings/js/JSWebAnimationCustom.cpp:
1376         (WebCore::constructJSWebAnimation):
1377         * bindings/js/WebCoreBuiltinNames.h:
1378         * dom/Document.cpp:
1379
1380 2018-11-06  Rob Buis  <rbuis@igalia.com>
1381
1382         Some minor X-Content-Type-Options parsing issues
1383         https://bugs.webkit.org/show_bug.cgi?id=191107
1384
1385         Reviewed by Darin Adler.
1386
1387         Implement new parsing rules for X-Content-Type-Options [1]:
1388         https://github.com/whatwg/fetch/pull/818
1389
1390         [1] https://fetch.spec.whatwg.org/#x-content-type-options-header
1391
1392         Test: web-platform-tests/fetch/nosniff/parsing-nosniff.html
1393
1394         * platform/network/HTTPParsers.cpp:
1395         (WebCore::isHTTPTabOrSpace):
1396         (WebCore::parseContentTypeOptionsHeader):
1397
1398 2018-11-06  Frederic Wang  <fwang@igalia.com>
1399
1400         Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
1401         https://bugs.webkit.org/show_bug.cgi?id=158342
1402
1403         Reviewed by Simon Fraser.
1404
1405         Resizing the content of a -webkit-overflow-scrolling:touch overflow node on iOS may make it
1406         scrollable. However, the RenderLayerBacking's scrolling layer is not properly created
1407         when RenderLayerCompositor::updateScrollCoordinatedLayer is called and hence the UIProcess
1408         receives a null UIScrollView pointer when ScrollingTreeScrollingNodeDelegateIOS performs the
1409         associated update. In debug mode this hits an ASSERT and in release mode the overflow node
1410         remains unscrollable from the user's point of view. This patch fixes this issue by ensuring
1411         the RenderLayerBacking's scrolling layer is created during updateScrollCoordinatedStatus.
1412
1413         Test: fast/scrolling/ios/update-scroll-coordinated-status.html
1414
1415         * rendering/RenderLayerCompositor.cpp:
1416         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Call updateConfiguration()
1417         to ensure the scrolling layer is present and indicate whether a rebuild is necessary.
1418
1419 2018-11-05  Zan Dobersek  <zdobersek@igalia.com>
1420
1421         Place Fontconfig-specific RefPtr specializations in RefPtrFontconfig.h
1422         https://bugs.webkit.org/show_bug.cgi?id=191267
1423
1424         Reviewed by Michael Catanzaro.
1425
1426         Move the Fontconfig-specific RefPtr specialization declarations from
1427         RefPtrCairo.h to RefPtrFontconfig.h, with definitions moved to the new
1428         RefPtrFontconfig.cpp implementation file. These specializations are
1429         not tied to Cairo in any way.
1430
1431         * platform/FreeType.cmake:
1432         * platform/graphics/FontPlatformData.h:
1433         * platform/graphics/cairo/RefPtrCairo.cpp:
1434         * platform/graphics/cairo/RefPtrCairo.h:
1435         * platform/graphics/freetype/FontCacheFreeType.cpp:
1436         * platform/graphics/freetype/RefPtrFontconfig.cpp: Added.
1437         (WTF::refIfNotNull):
1438         (WTF::derefIfNotNull):
1439         * platform/graphics/freetype/RefPtrFontconfig.h: Copied from Source/WebCore/platform/graphics/cairo/RefPtrCairo.h.
1440
1441 2018-11-05  Don Olmstead  <don.olmstead@sony.com>
1442
1443         [CMake] Fix WebCore/Modules includes
1444         https://bugs.webkit.org/show_bug.cgi?id=191287
1445
1446         Reviewed by Fujii Hironori.
1447
1448         No new tests. No change in behavior.
1449
1450         Add in applicationmanifest to the list of includes and sort the
1451         modules directory.
1452
1453         * CMakeLists.txt:
1454
1455 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
1456
1457         Cache glyph paths and share underline skipping code between all the ports
1458         https://bugs.webkit.org/show_bug.cgi?id=191239
1459
1460         Reviewed by Alex Christensen.
1461
1462         I was hoping that caching the glyph paths was going to be a performance progression,
1463         but it turns out that the additional overhead of WebCore::Path compensated for it.
1464         In total, the performance is the same (my testing says that this patch is a 1%
1465         progression, but that's within the noise).
1466
1467         Because the ink skipping logic is now shared among all ports, Windows now gets it for
1468         free.
1469
1470         Test: PerformanceTests/Layout/underline.html
1471
1472         * platform/graphics/Font.cpp:
1473         (WebCore::Font::pathForGlyph const):
1474         * platform/graphics/Font.h:
1475         * platform/graphics/FontCascade.cpp:
1476         (WebCore::computeUnderlineType):
1477         (WebCore::GlyphIterationState::GlyphIterationState):
1478         (WebCore::findIntersectionPoint):
1479         (WebCore::updateX):
1480         (WebCore::findPathIntersections):
1481         (WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
1482         (WebCore::GlyphToPathTranslator::containsMorePaths):
1483         (WebCore::GlyphToPathTranslator::path):
1484         (WebCore::GlyphToPathTranslator::extents):
1485         (WebCore::GlyphToPathTranslator::underlineType):
1486         (WebCore::GlyphToPathTranslator::advance):
1487         (WebCore::FontCascade::dashesForIntersectionsWithRect const):
1488         * platform/graphics/FontCascade.h:
1489         * platform/graphics/GlyphMetricsMap.h:
1490         (WebCore::GlyphMetricsMap::existingMetricsForGlyph):
1491         (WebCore::GlyphMetricsMap::GlyphMetricsPage::existingMetricsForGlyph const):
1492         (WebCore::GlyphMetricsMap<std::optional<Path>>::unknownMetrics):
1493         * platform/graphics/TextRun.h:
1494         * platform/graphics/cairo/FontCairo.cpp:
1495         (WebCore::Font::platformPathForGlyph const):
1496         (WebCore::GlyphIterationState::GlyphIterationState): Deleted.
1497         (WebCore::findIntersectionPoint): Deleted.
1498         (WebCore::updateX): Deleted.
1499         (WebCore::findPathIntersections): Deleted.
1500         (): Deleted.
1501         (WebCore::CairoGlyphToPathTranslator::path): Deleted.
1502         (WebCore::CairoGlyphToPathTranslator::extents): Deleted.
1503         (WebCore::CairoGlyphToPathTranslator::underlineType): Deleted.
1504         (WebCore::CairoGlyphToPathTranslator::advance): Deleted.
1505         (WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
1506         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1507         (WebCore::GlyphIterationState::GlyphIterationState): Deleted.
1508         (WebCore::findIntersectionPoint): Deleted.
1509         (WebCore::updateX): Deleted.
1510         (WebCore::findPathIntersections): Deleted.
1511         (): Deleted.
1512         (WebCore::MacGlyphToPathTranslator::path): Deleted.
1513         (WebCore::MacGlyphToPathTranslator::extents): Deleted.
1514         (WebCore::MacGlyphToPathTranslator::underlineType): Deleted.
1515         (WebCore::MacGlyphToPathTranslator::advance): Deleted.
1516         (WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
1517         * platform/graphics/cocoa/FontCocoa.mm:
1518         (WebCore::Font::platformPathForGlyph const):
1519         * rendering/TextDecorationPainter.cpp:
1520         (WebCore::drawSkipInkUnderline):
1521         (WebCore::TextDecorationPainter::paintTextDecoration):
1522
1523 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
1524
1525         Clean up text decoration drawing code
1526         https://bugs.webkit.org/show_bug.cgi?id=191245
1527
1528         Reviewed by Zalan Bujtas.
1529
1530         This is some general clean up of the text decorations code. There is no behavior change.
1531
1532         This patch modifies GraphicsContext::drawLineForText() & friends to accept a FloatRect instead of a FloatPoint + float width.
1533         This is helpful because it allows for easier bounding box calculations.
1534         This patch also removes some redundant computations that the skip:ink codepath was performing.
1535         This patch also refactors the wavy decoration parameters to not use out params.
1536
1537         No new tests because there is no behavior change.
1538
1539         * platform/graphics/GraphicsContext.cpp:
1540         (WebCore::GraphicsContext::computeUnderlineBoundsForText):
1541         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
1542         * platform/graphics/GraphicsContext.h:
1543         * platform/graphics/GraphicsContextImpl.h:
1544         * platform/graphics/cg/GraphicsContextCG.cpp:
1545         (WebCore::GraphicsContext::drawLineForText):
1546         (WebCore::GraphicsContext::drawLinesForText):
1547         * platform/graphics/displaylists/DisplayListItems.cpp:
1548         (WebCore::DisplayList::DrawLinesForText::apply const):
1549         (WebCore::DisplayList::DrawLinesForText::localBounds const):
1550         (WebCore::DisplayList::operator<<):
1551         * platform/graphics/displaylists/DisplayListItems.h:
1552         (WebCore::DisplayList::DrawLinesForText::create):
1553         (WebCore::DisplayList::DrawLinesForText::thickness const):
1554         (WebCore::DisplayList::DrawLinesForText::DrawLinesForText):
1555         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1556         (WebCore::DisplayList::Recorder::drawLinesForText):
1557         * platform/graphics/displaylists/DisplayListRecorder.h:
1558         * rendering/InlineTextBox.cpp:
1559         (WebCore::InlineTextBox::paintMarkedTextDecoration):
1560         (WebCore::InlineTextBox::paintCompositionUnderline const):
1561         * rendering/SimpleLineLayoutFunctions.cpp:
1562         (WebCore::SimpleLineLayout::paintFlow):
1563         * rendering/TextDecorationPainter.cpp:
1564         (WebCore::strokeWavyTextDecoration):
1565         (WebCore::translateIntersectionPointsToSkipInkBoundaries):
1566         (WebCore::TextDecorationPainter::TextDecorationPainter):
1567         (WebCore::TextDecorationPainter::paintTextDecoration):
1568         (WebCore::drawSkipInkUnderline): Deleted.
1569         * rendering/TextDecorationPainter.h:
1570         (WebCore::TextDecorationPainter::setInlineTextBox):
1571         (WebCore::TextDecorationPainter::setWidth):
1572         (WebCore::TextDecorationPainter::setFont): Deleted.
1573         (WebCore::TextDecorationPainter::setBaseline): Deleted.
1574         * style/InlineTextBoxStyle.cpp:
1575         (WebCore::getWavyStrokeParameters):
1576         (WebCore::visualOverflowForDecorations):
1577         * style/InlineTextBoxStyle.h:
1578
1579 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
1580
1581         Fix the Windows build after r237835
1582         https://bugs.webkit.org/show_bug.cgi?id=191242
1583
1584         Reviewed by Simon Fraser.
1585
1586         * rendering/style/TextDecorationThickness.h:
1587         (WebCore::TextDecorationThickness::operator== const):
1588
1589 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1590
1591         [iOS] Swatch appears squished and off-center in inputs of type color
1592         https://bugs.webkit.org/show_bug.cgi?id=191279
1593         <rdar://problem/45816319>
1594
1595         Reviewed by Tim Horton.
1596
1597         This patch makes some small adjustments to color inputs on iOS to bring them closer to the intended design.
1598         See comments below for more details.
1599
1600         Tests:  fast/forms/color/color-input-uses-color-well-appearance.html
1601                 fast/forms/color/input-appearance-color.html
1602
1603         * css/html.css:
1604
1605         Adjust the UA stylesheet for color inputs on iOS.
1606
1607         * rendering/RenderTheme.cpp:
1608         (WebCore::RenderTheme::paintDecorations):
1609
1610         When painting decorations for `ColorWellPart`, treat it as a standard button instead of the square button
1611         appearance.
1612
1613         (WebCore::RenderTheme::colorInputStyleSheet const):
1614
1615         Add `-webkit-appearance: color-well;` to the stylesheet for color inputs. Previously, this was special-cased on
1616         iOS, where color input elements had appearances of `textfield`; however, this patch makes some adjustments to
1617         RenderThemeIOS, allowing us to use `color-well` on iOS.
1618
1619         * rendering/RenderTheme.h:
1620         (WebCore::RenderTheme::platformUsesColorWellAppearance const): Deleted.
1621
1622         Remove this from RenderTheme. This is no longer necessary, since all platforms now use
1623         `-webkit-appearance: color-well;`.
1624
1625         * rendering/RenderThemeIOS.h:
1626         * rendering/RenderThemeIOS.mm:
1627         (WebCore::RenderThemeIOS::adjustButtonStyle const):
1628
1629         When painting buttons for color inputs, don't add rounded corners that are present by default for regular
1630         buttons.
1631
1632 2018-11-05  Eric Carlson  <eric.carlson@apple.com>
1633
1634         [MediaStream] An audio track should be muted when capture is interrupted by the OS.
1635         https://bugs.webkit.org/show_bug.cgi?id= 191283
1636          <rdar://problem/45773103>
1637
1638         Reviewed by Jon Lee.
1639
1640         Test: fast/mediastream/media-stream-track-interrupted.html
1641
1642         * platform/mediastream/RealtimeMediaSource.cpp:
1643         (WebCore::RealtimeMediaSource::setInterruptedForTesting):
1644         * platform/mediastream/RealtimeMediaSource.h:
1645         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1646         (WebCore::CoreAudioCaptureSource::beginInterruption):
1647         (WebCore::CoreAudioCaptureSource::endInterruption):
1648         * testing/Internals.cpp:
1649         (WebCore::Internals::setMediaStreamSourceInterrupted):
1650         * testing/Internals.h:
1651         * testing/Internals.idl:
1652
1653 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
1654
1655         Parsing support for text-underline-offset and text-decoration-thickness
1656         https://bugs.webkit.org/show_bug.cgi?id=191242
1657
1658         Reviewed by Simon Fraser.
1659
1660         Before we can implement the properties properly, we have to parse them.
1661
1662         https://github.com/w3c/csswg-drafts/issues/3118#issuecomment-432297480 describes the grammar:
1663         text-underline-position: auto | [ [ under | from-font] || [ left | right ] ]
1664         text-underline-offset: auto | <length>
1665         text-decoration-thickness: auto | from-font | <length>
1666
1667         This patch also takes the opportunity to update the grammar of text-underline-position to match the spec,
1668         and to add an alias to the unprefixed version.
1669
1670         We still don't support the left and right values on text-underline-position. We should add those eventually.
1671
1672         Tests: fast/css3-text/css3-text-decoration/text-decoration-thickness-parse.html
1673                fast/css3-text/css3-text-decoration/text-underline-offset-parse.html
1674
1675         * WebCore.xcodeproj/project.pbxproj:
1676         * css/CSSComputedStyleDeclaration.cpp:
1677         (WebCore::textUnderlineOffsetToCSSValue):
1678         (WebCore::textDecorationThicknessToCSSValue):
1679         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1680         * css/CSSPrimitiveValueMappings.h:
1681         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1682         (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
1683         (WebCore::CSSPrimitiveValue::operator OptionSet<TextUnderlinePosition> const): Deleted.
1684         * css/CSSProperties.json:
1685         * css/CSSValueKeywords.in:
1686         * css/StyleBuilderConverter.h:
1687         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
1688         (WebCore::StyleBuilderConverter::convertTextUnderlineOffset):
1689         (WebCore::StyleBuilderConverter::convertTextDecorationThickness):
1690         * css/StyleResolver.cpp:
1691         (WebCore::shouldApplyPropertyInParseOrder):
1692         * css/parser/CSSPropertyParser.cpp:
1693         (WebCore::consumeTextUnderlineOffset):
1694         (WebCore::consumeTextDecorationThickness):
1695         (WebCore::CSSPropertyParser::parseSingleValue):
1696         * rendering/style/RenderStyle.h:
1697         (WebCore::RenderStyle::textUnderlinePosition const):
1698         (WebCore::RenderStyle::textUnderlineOffset const):
1699         (WebCore::RenderStyle::textDecorationThickness const):
1700         (WebCore::RenderStyle::setTextUnderlinePosition):
1701         (WebCore::RenderStyle::setTextUnderlineOffset):
1702         (WebCore::RenderStyle::setTextDecorationThickness):
1703         (WebCore::RenderStyle::initialTextUnderlinePosition):
1704         (WebCore::RenderStyle::initialTextUnderlineOffset):
1705         (WebCore::RenderStyle::initialTextDecorationThickness):
1706         * rendering/style/RenderStyleConstants.h:
1707         * rendering/style/StyleRareInheritedData.cpp:
1708         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1709         (WebCore::StyleRareInheritedData::operator== const):
1710         * rendering/style/StyleRareInheritedData.h:
1711         * rendering/style/TextDecorationThickness.h: Added.
1712         (WebCore::TextDecorationThickness::createWithAuto):
1713         (WebCore::TextDecorationThickness::createFromFont):
1714         (WebCore::TextDecorationThickness::createWithLength):
1715         (WebCore::TextDecorationThickness::isAuto const):
1716         (WebCore::TextDecorationThickness::isFromFont const):
1717         (WebCore::TextDecorationThickness::isLength const):
1718         (WebCore::TextDecorationThickness::setLengthValue):
1719         (WebCore::TextDecorationThickness::lengthValue const):
1720         (WebCore::TextDecorationThickness::operator== const):
1721         (WebCore::TextDecorationThickness::operator!= const):
1722         (WebCore::TextDecorationThickness::TextDecorationThickness):
1723         (WebCore::operator<<):
1724         * rendering/style/TextUnderlineOffset.h: Added.
1725         (WebCore::TextUnderlineOffset::createWithAuto):
1726         (WebCore::TextUnderlineOffset::createWithLength):
1727         (WebCore::TextUnderlineOffset::isAuto const):
1728         (WebCore::TextUnderlineOffset::isLength const):
1729         (WebCore::TextUnderlineOffset::setLengthValue):
1730         (WebCore::TextUnderlineOffset::lengthValue const):
1731         (WebCore::TextUnderlineOffset::lengthOr const):
1732         (WebCore::TextUnderlineOffset::operator== const):
1733         (WebCore::TextUnderlineOffset::operator!= const):
1734         (WebCore::TextUnderlineOffset::TextUnderlineOffset):
1735         (WebCore::operator<<):
1736         * style/InlineTextBoxStyle.cpp:
1737         (WebCore::computeUnderlineOffset):
1738         * style/InlineTextBoxStyle.h:
1739
1740 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
1741
1742         Spelling dots are drawn in the wrong place
1743         https://bugs.webkit.org/show_bug.cgi?id=190764
1744
1745         Reviewed by Dean Jackson.
1746
1747         - Dots should not be clipped.
1748         - Dots should be horizontally centered.
1749         - Dots should be drawn behind the text.
1750         - Distance from the baseline to the top of the dot should be 11.035% of font size.
1751         - Dot diameter should be 13.247% of the font size.
1752         - Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size.
1753         - The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px.
1754
1755         Tests: editing/spelling/spelling-dots-position-2.html
1756                editing/spelling/spelling-dots-position-3.html
1757                editing/spelling/spelling-dots-position.html
1758                editing/spelling/spelling-dots-repaint.html
1759
1760         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1761         (WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations.
1762         (WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly.
1763         * rendering/InlineFlowBox.cpp:
1764         (WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots,
1765             because there is no guarantee the spelling dots will lie inside the layout rect of the element.
1766         (WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions.
1767         * rendering/InlineFlowBox.h: Comments should explain why, not say what.
1768         * rendering/InlineTextBox.cpp:
1769         (WebCore::InlineTextBox::paint): Draw the dots behind the text.
1770         (WebCore::InlineTextBox::hasMarkers const): Convenience.
1771         (WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function.
1772         (WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation.
1773         (WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly.
1774         (WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method.
1775         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
1776         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted.
1777         * rendering/InlineTextBox.h: Declare the helper methods.
1778         * rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of
1779             spelling dots opt us out of SLL.
1780         (WebCore::SimpleLineLayout::canUseForWithReason):
1781         * rendering/SimpleLineLayoutCoverage.cpp:
1782         (WebCore::SimpleLineLayout::printReason):
1783         * rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason.
1784
1785 2018-11-05  Dean Jackson  <dino@apple.com>
1786
1787         Attempted build fix.
1788
1789         * dom/messageports/MessagePortChannelRegistry.cpp:
1790
1791 2018-11-05  Chris Dumez  <cdumez@apple.com>
1792
1793         Crash under DOMWindow::postMessageTimerFired()
1794         https://bugs.webkit.org/show_bug.cgi?id=191217
1795         <rdar://problem/40888466>
1796
1797         Reviewed by Geoffrey Garen.
1798
1799         Protect the frame in DOMWindow::postMessageTimerFired() before calling dispatchEvent() as dispatching the
1800         event may cause JS to run and this JS may cause the frame to be destroyed, in which case we will crash
1801         when trying to use the frame on the next line.
1802
1803         Test: fast/dom/Window/remove-frame-in-message-event-handler.html
1804
1805         * page/DOMWindow.cpp:
1806         (WebCore::DOMWindow::postMessageTimerFired):
1807
1808 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
1809
1810         [GStreamer] Fix EncodedImage timestamps to match what libWebRTC expects
1811         https://bugs.webkit.org/show_bug.cgi?id=190035
1812
1813         Reviewed by Philippe Normand.
1814
1815         We can't rely on GStreamer timestamps to pass to EncodedImages after encoding
1816         because libWebRTC doesn't use the timestamp we fed it but does
1817         some computation on the input timestamp in the images we pass in before it passes
1818         them back to the encoder. Then internally LibWebRTC relies on those exact timestamps
1819         passed into the encoder to do checks and compute RTP timestamps so we need to carefully
1820         pass the exact timestamps to LibWebRTC (in practice we still use GStreamer timestamps in
1821         all the GStreamer processing pipelines as the WebRTC object basically wraps the "same"
1822         `GstSample` all around, but we are not synced on the clock anyway).
1823
1824         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
1825         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
1826         (WebCore::LibWebRTCVideoFrameFromGStreamerSample):
1827         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h:
1828         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
1829         (WebCore::GStreamerVideoDecoder::newSampleCallback):
1830         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1831         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
1832         (WebCore::GStreamerVideoEncoder::newSampleCallback):
1833
1834 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1835
1836         [iOS] Changing view scale sometimes does not zoom the page to the new initial scale when the page is zoomed in when ignoring meta viewport
1837         https://bugs.webkit.org/show_bug.cgi?id=191226
1838         <rdar://problem/45781765>
1839
1840         Reviewed by Tim Horton.
1841
1842         When `_setViewScale:` SPI is used to adjust the layout scale factor of the page, we multiply minimum, initial
1843         and maximum scales by the given layout scale factor to adjust for a larger or smaller minimum layout size.
1844         However, in the case where the layout size scale factor is greater than 1 and we're also forcing the viewport to
1845         be scalable, we override the default minimum scale with 1 (i.e. `forceAlwaysUserScalableMinimumScale`). This
1846         means that the might be off by a small margin due to rounding error when computing the content width and view
1847         width (see: r237743).
1848
1849         This means that in the case where (1) the viewport is forced to be user-scalable, and (2) we're ignoring meta
1850         viewport parameters, and (3) `_viewScale` exceeds 1, we may end up computing a slightly different minimum scale
1851         than the default minimum scale multiplied by the layout size scale factor; subsequently, the page scale factor
1852         will be slightly different from initial scale, such that we'll no longer zoom to the new initial scale when
1853         changing view scale.
1854
1855         This patch adjusts `forceAlwaysUserScalableMinimumScale` and `forceAlwaysUserScalableMaximumScale` to take the
1856         current layout scale factor into account when computing min and max scales when the viewport is forced to be
1857         always scalable.
1858
1859         Test: fast/viewport/ios/minimum-scale-after-changing-view-scale.html
1860
1861         * page/ViewportConfiguration.cpp:
1862         (WebCore::ViewportConfiguration::minimumScale const):
1863         * page/ViewportConfiguration.h:
1864         (WebCore::ViewportConfiguration::maximumScale const):
1865         (WebCore::ViewportConfiguration::forceAlwaysUserScalableMaximumScale const):
1866         (WebCore::ViewportConfiguration::forceAlwaysUserScalableMinimumScale const):
1867
1868         Turn these from constant values to const functions on ViewportConfiguration, which factor in the current
1869         viewport layout size scale factor.
1870
1871 2018-11-05  Dean Jackson  <dino@apple.com>
1872
1873         Expose a constructor for PointerEvent from PlatformTouchEvent
1874         https://bugs.webkit.org/show_bug.cgi?id=191238
1875         <rdar://problem/45795682>
1876
1877         Reviewed by Antoine Quint.
1878
1879         Implement a constructor that takes a PlatformTouchEvent to
1880         create a PointerEvent. At the moment the code to call this
1881         constructor will live in WebKitAdditions, so no new tests
1882         yet.
1883
1884         * SourcesCocoa.txt: Add PointerEventIOS.cpp.
1885         * WebCore.xcodeproj/project.pbxproj: Ditto.
1886         * dom/EventNames.h: Add macros for pointerdown, pointermove,
1887              pointerup, pointercancel.
1888         * dom/PointerEvent.cpp: Remove JSC namespace.
1889         * dom/PointerEvent.h: Add create and constructor that takes
1890              a PlatformTouchEvent.
1891         * dom/ios/PointerEventIOS.cpp: Added.
1892
1893 2018-11-05  Ryan Haddad  <ryanhaddad@apple.com>
1894
1895         Unreviewed, rolling out r237785.
1896
1897         Introduced layout test and API test failures on macOS and iOS.
1898
1899         Reverted changeset:
1900
1901         "[iOS] Issue initial paint soon after the visuallyNonEmpty
1902         milestone is fired."
1903         https://bugs.webkit.org/show_bug.cgi?id=191078
1904         https://trac.webkit.org/changeset/237785
1905
1906 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
1907
1908         [GStreamer][WebRTC] Error out when simulcast is activated
1909         https://bugs.webkit.org/show_bug.cgi?id=190678
1910
1911         Reviewed by Philippe Normand.
1912
1913         Implementing it is not for now yet.
1914
1915         Tests for simulcast have been disabled as they now fail (instead of crashing).
1916
1917         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1918         (WebCore::GStreamerVideoEncoder::InitEncode):
1919
1920 2018-11-05  Youenn Fablet  <youenn@apple.com>
1921
1922         RealtimeOutgoingAudioSource subclasses should observe its source when fully constructed
1923         https://bugs.webkit.org/show_bug.cgi?id=191241
1924
1925         Reviewed by Eric Carlson.
1926
1927         Moving the logic to observe the audio source to the point where the
1928         RealtimeOutgoingAudioSource subclass is fully initialized.
1929         Covered by existing tests.
1930
1931         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
1932         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
1933         (WebCore::RealtimeOutgoingAudioSource::observeSource):
1934         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1935         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
1936         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::RealtimeOutgoingAudioSourceLibWebRTC):
1937         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1938         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
1939
1940 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
1941
1942         [GStreamer][WebRTC] Add webrtcencoder bin to cleanup and refactor the way we set encoders
1943         https://bugs.webkit.org/show_bug.cgi?id=190674
1944
1945         Reviewed by Philippe Normand.
1946
1947         webrtcencoder is a simple GstBin with a set of well known GStreamer encoders which
1948         it can use to implement encoding for different formats exposing a trimmed down unified API.
1949
1950         It also adds proper handling of H264 profiles.
1951
1952         The added files follow GStreamer coding style as we aim at upstreaming the element
1953         in the future.
1954
1955         This is a refactoring so current tests already cover it.
1956
1957         * platform/GStreamer.cmake:
1958         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1959         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
1960         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: Added.
1961         (gst_webrtc_video_encoder_get_property):
1962         (gst_webrtc_video_encoder_set_bitrate):
1963         (gst_webrtc_video_encoder_set_format):
1964         (gst_webrtc_video_encoder_set_property):
1965         (register_known_encoder):
1966         (setup_x264enc):
1967         (setup_vp8enc):
1968         (setup_openh264enc):
1969         (set_bitrate_kbit_per_sec):
1970         (set_bitrate_bit_per_sec):
1971         (gst_webrtc_video_encoder_class_init):
1972         (gst_webrtc_video_encoder_init):
1973         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: Added.
1974         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1975         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
1976         (WebCore::GStreamerVideoEncoder::InitEncode):
1977         (WebCore::GStreamerVideoEncoder::createEncoder):
1978         (WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
1979         (WebCore::GStreamerVideoEncoder::ImplementationName const):
1980         (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
1981
1982 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
1983
1984         [GStreamer][WebRTC] properly mark H.264 stream type in the "decoder"
1985         https://bugs.webkit.org/show_bug.cgi?id=190676
1986
1987         Reviewed by Philippe Normand.
1988
1989         Avoiding to have h264parse make assumption (which might be wrong at some
1990         point).
1991
1992         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
1993         (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
1994
1995 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
1996
1997         [GStreamer] Do not sync libwerbtc stream on the clock
1998         https://bugs.webkit.org/show_bug.cgi?id=190677
1999
2000         The approach here is basically to let libwebrtc do all the
2001         synchronisation for us, and the same way as it is done in apple ports,
2002         we basically try to display what libwebrtc outputs as fast as possible.
2003
2004         Reviewed by Philippe Normand.
2005
2006         Manually tested
2007
2008         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2009         (WebCore::setSyncOnSink):
2010         (WebCore::MediaPlayerPrivateGStreamer::syncOnClock):
2011         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2012         (WebCore::MediaPlayerPrivateGStreamer::load):
2013         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2014
2015 2018-11-05  Ali Juma  <ajuma@chromium.org>
2016
2017         [IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
2018         https://bugs.webkit.org/show_bug.cgi?id=191210
2019
2020         Reviewed by Simon Fraser.
2021
2022         isIntersecting should be false if the intersection ratio is smaller than the
2023         smallest threshold value. Update the computation of isIntersecting to depend on
2024         the current thresholdIndex.
2025
2026         Test: imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.html
2027
2028         * dom/Document.cpp:
2029         (WebCore::Document::updateIntersectionObservations):
2030
2031 2018-11-05  Rob Buis  <rbuis@igalia.com>
2032
2033         Remove some virtual methods in CachedRawResource
2034         https://bugs.webkit.org/show_bug.cgi?id=191251
2035
2036         Reviewed by Frédéric Wang.
2037
2038         Since CachedRawResource is final no need to introduce new virtual
2039         methods in CachedRawResource. This patch also removes an outdated
2040         comment and forward declaration.
2041
2042         No new tests since no change in functionality.
2043
2044         * loader/cache/CachedRawResource.h:
2045
2046 2018-11-05  Philippe Normand  <pnormand@igalia.com>
2047
2048         [GStreamer] Move elements registration to GStreamerCommon
2049         https://bugs.webkit.org/show_bug.cgi?id=191189
2050
2051         Reviewed by Xabier Rodriguez-Calvar.
2052
2053         It was a bit odd to have this in the base player class and to have
2054         sub-classes calling a static function of the super-class.
2055
2056         Covered by existing tests.
2057
2058         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2059         (WebCore::initializeGStreamerAndRegisterWebKitElements):
2060         * platform/graphics/gstreamer/GStreamerCommon.h:
2061         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2062         (WebCore::MediaPlayerPrivateGStreamer::isAvailable):
2063         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2064         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
2065         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2066         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2067         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2068         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
2069         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
2070         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
2071         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
2072
2073 2018-11-04  Rob Buis  <rbuis@igalia.com>
2074
2075         Remove ENABLE_OPENCL fully
2076         https://bugs.webkit.org/show_bug.cgi?id=191172
2077
2078         Reviewed by Yusuke Suzuki.
2079
2080         Forgot to simplify this, no need for applyAll anymore
2081         since it just calls apply.
2082
2083         No new tests since no change in functionality.
2084
2085         * platform/graphics/filters/FilterEffect.h:
2086         (WebCore::FilterEffect::applyAll): Deleted.
2087         * rendering/svg/RenderSVGResourceFilter.cpp:
2088         (WebCore::RenderSVGResourceFilter::postApplyResource):
2089
2090 2018-11-04  Zalan Bujtas  <zalan@apple.com>
2091
2092         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
2093         https://bugs.webkit.org/show_bug.cgi?id=191078
2094         <rdar://problem/45736178>
2095
2096         Reviewed by Antti Koivisto.
2097
2098         1. Improve visuallyNonEmpty milestone confidence level.
2099             Ignore whitespace and non visible text content.
2100             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
2101             Check if the html/body is actually visible.
2102
2103         2. Issue initial paint soon after the milestone fires.
2104             Use a 0ms timer to flush the initial paint.
2105             Throttle additional flushes for 500ms (remove the non-initial 1.5 throttling)
2106
2107         3. Suspend optional style recalcs and layouts while painting is being throttled.
2108            When parsing yields we initiate a 0ms style recalc/layout timer.
2109            These optional layouts produce content that we have no intention to paint. 
2110
2111         * dom/Document.cpp:
2112         (WebCore::Document::scheduleStyleRecalc):
2113         (WebCore::Document::shouldScheduleLayout):
2114         * page/ChromeClient.h:
2115         * page/FrameView.cpp:
2116         (WebCore::FrameView::resetLayoutMilestones):
2117         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
2118         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
2119         (WebCore::FrameView::updateIsVisuallyNonEmpty):
2120         * page/FrameView.h:
2121         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
2122         * platform/graphics/FontCascade.h:
2123         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
2124         (WebCore::RenderText::RenderText):
2125
2126 2018-11-04  Zalan Bujtas  <zalan@apple.com>
2127
2128         [LFC][BFC] Add support for percentage height in quirks mode.
2129         https://bugs.webkit.org/show_bug.cgi?id=191232
2130
2131         Reviewed by Antti Koivisto.
2132
2133         In quirks mode, we go and travers the containing block chain to find a block level
2134         box with fixed height value to resolve the percentage value.
2135
2136         Test: fast/block/basic/quirk-mode-percent-height.html
2137
2138         * layout/FormattingContextGeometry.cpp:
2139         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
2140         * layout/Verification.cpp:
2141         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2142
2143 2018-11-04  Zalan Bujtas  <zalan@apple.com>
2144
2145         [LFC][BCF] Add support for block level non-replaced inflow height percentage
2146         https://bugs.webkit.org/show_bug.cgi?id=191229
2147
2148         Reviewed by Antti Koivisto.
2149
2150         Test: fast/block/basic/child-block-level-box-with-height-percent.html
2151
2152         * layout/FormattingContext.h:
2153         * layout/FormattingContextGeometry.cpp:
2154         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
2155         (WebCore::Layout::computedHeightValue): Deleted.
2156         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2157         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2158
2159 2018-11-04  Youenn Fablet  <youenn@apple.com>
2160
2161         RealtimeOutgoingAudioSource should use DestructionThread::Main
2162         https://bugs.webkit.org/show_bug.cgi?id=191230
2163
2164         Reviewed by Eric Carlson.
2165
2166         Covered by imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html
2167         that should no longer crash in debug.
2168
2169         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2170
2171 2018-11-04  Youenn Fablet  <youenn@apple.com>
2172
2173         IDB should allow storing RTCCertificate
2174         https://bugs.webkit.org/show_bug.cgi?id=191077
2175
2176         Reviewed by Chris Dumez.
2177
2178         Add support for serialization/deserialization of RTCCertificate.
2179         Store the origin in RTCCertificate and make sure that a certificate
2180         with a different origin cannot be used to create a RTCPeerConnection.
2181
2182         Test: imported/w3c/web-platform-tests/webrtc/RTCCertificate-postMessage.html
2183
2184         * Modules/mediastream/PeerConnectionBackend.cpp:
2185         (WebCore::PeerConnectionBackend::generateCertificate):
2186         * Modules/mediastream/RTCCertificate.cpp:
2187         (WebCore::RTCCertificate::create):
2188         (WebCore::RTCCertificate::RTCCertificate):
2189         * Modules/mediastream/RTCCertificate.h:
2190         (WebCore::RTCCertificate::origin const):
2191         * Modules/mediastream/RTCPeerConnection.cpp:
2192         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
2193         * Modules/mediastream/RTCPeerConnection.h:
2194         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
2195         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
2196         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
2197         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h:
2198         * bindings/js/SerializedScriptValue.cpp:
2199         (WebCore::CloneSerializer::dumpIfTerminal):
2200         (WebCore::CloneDeserializer::CachedString::takeString):
2201         (WebCore::CloneDeserializer::readRTCCertificate):
2202         (WebCore::CloneDeserializer::readTerminal):
2203
2204 2018-11-04  Youenn Fablet  <youenn@apple.com>
2205
2206         Add support for RTCMuxPolicy
2207         https://bugs.webkit.org/show_bug.cgi?id=191188
2208
2209         Reviewed by Eric Carlson.
2210
2211         Add support for RTCMuxPolicy dictionary option for both constructor and setConfiguration.
2212         Make sure setConfiguration throws if trying to change this policy.
2213         Pipe this parameter up to libwebrtc.
2214         Covered by rebased test.
2215
2216         * Modules/mediastream/RTCConfiguration.h:
2217         * Modules/mediastream/RTCConfiguration.idl:
2218         * Modules/mediastream/RTCPeerConnection.cpp:
2219         (WebCore::iceServersFromConfiguration):
2220         (WebCore::RTCPeerConnection::initializeConfiguration):
2221         (WebCore::RTCPeerConnection::setConfiguration):
2222         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2223         (WebCore::rtcpMuxPolicyfromConfiguration):
2224         (WebCore::configurationFromMediaEndpointConfiguration):
2225         * WebCore.xcodeproj/project.pbxproj:
2226         * platform/mediastream/MediaEndpointConfiguration.cpp:
2227         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
2228         * platform/mediastream/MediaEndpointConfiguration.h:
2229         * platform/mediastream/RTCPMuxPolicy.h: Added.
2230
2231 2018-11-03  Devin Rousso  <drousso@apple.com>
2232
2233         Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
2234         https://bugs.webkit.org/show_bug.cgi?id=190854
2235
2236         Reviewed by Matt Baker.
2237
2238         Updated existing tests: inspector/canvas/recording-2d.html
2239                                 inspector/canvas/recording-bitmaprenderer.html
2240                                 inspector/canvas/recording-webgl.html
2241
2242         * html/HTMLCanvasElement.idl:
2243         Apply `CallTracingCallback=recordCanvasAction` to the `width` and `height` attributes so
2244         that they are recorded through the same path as `CanvasRenderingContext`.
2245
2246         * html/CanvasBase.h:
2247         * html/CanvasBase.cpp:
2248         (WebCore::CanvasBase::callTracingActive const): Added.
2249
2250         * bindings/js/CallTracer.h:
2251         * bindings/js/CallTracer.cpp:
2252         (WebCore::CallTracer::recordCanvasAction):
2253
2254
2255 2018-11-03  Andy Estes  <aestes@apple.com>
2256
2257         [Payment Request] PaymentResponse.retry()'s errorFields should be optional
2258         https://bugs.webkit.org/show_bug.cgi?id=191212
2259
2260         Reviewed by Youenn Fablet.
2261
2262         Per WebIDL, the errorFields argument to PaymentResponse.retry() should be optional. See
2263         <https://github.com/w3c/payment-request/issues/804> for details.
2264
2265         Added test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
2266
2267         * Modules/paymentrequest/PaymentResponse.idl:
2268
2269 2018-11-02  Zalan Bujtas  <zalan@apple.com>
2270
2271         [LFC][BFC] Resolve percentage height values.
2272         https://bugs.webkit.org/show_bug.cgi?id=191224
2273
2274         Reviewed by Antti Koivisto.
2275
2276         10.5 Content height: the 'height' property
2277         The percentage is calculated with respect to the height of the generated box's containing block.
2278         If the height of the containing block is not specified explicitly (i.e., it depends on content height),
2279         and this element is not absolutely positioned, the used height is calculated as if 'auto' was specified.
2280
2281         https://www.w3.org/TR/CSS22/visudet.html#propdef-height
2282
2283         Test: fast/block/basic/height-percentage-simple.html
2284
2285         * layout/FormattingContextGeometry.cpp:
2286         (WebCore::Layout::isHeightAuto):
2287         (WebCore::Layout::computedHeightValue):
2288         (WebCore::Layout::contentHeightForFormattingContextRoot):
2289         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
2290         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
2291         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2292         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2293         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2294         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2295
2296 2018-11-03  Eric Carlson  <eric.carlson@apple.com>
2297
2298         [MediaStream] enumerateDevices should not expose devices that are not available to getUserMedia
2299         https://bugs.webkit.org/show_bug.cgi?id=191177
2300         <rdar://problem/45747873>
2301
2302         Reviewed by Jer Noble.
2303
2304         Test: http/tests/media/media-stream/enumerate-devices-iframe-allow-attribute.html
2305
2306         * Modules/mediastream/MediaDevicesRequest.cpp:
2307         (WebCore::MediaDevicesRequest::start): Only expose devices that are available to gUM.
2308
2309         * Modules/mediastream/UserMediaController.cpp:
2310         (WebCore::isSecure): Moved from UserMediaRequest.cpp.
2311         (WebCore::isAllowedToUse): Ditto.
2312         (WebCore::UserMediaController::canCallGetUserMedia): Modified from UserMediaRequest.cpp.
2313         (WebCore::UserMediaController::logGetUserMediaDenial): Log reason for denial.
2314         * Modules/mediastream/UserMediaController.h:
2315
2316         * Modules/mediastream/UserMediaRequest.cpp:
2317         (WebCore::UserMediaRequest::start): Use UserMediaController::canCallGetUserMedia.
2318         (WebCore::isSecure): Deleted.
2319         (WebCore::isAllowedToUse): Deleted.
2320         (WebCore::canCallGetUserMedia): Deleted.
2321
2322 2018-11-02  Justin Michaud  <justin_michaud@apple.com>
2323
2324         Add new global object and preliminary Worklets support for CSS painting api
2325         https://bugs.webkit.org/show_bug.cgi?id=190979
2326
2327         Reviewed by Chris Dumez.
2328
2329         Test: fast/css-custom-paint/worklet.html
2330
2331         Add a new ScriptExecutionContext and global object to run worklets in. This is mostly copy+paste
2332         from Workers, but without any of the threading. Worklet.addModule does not yet support loading scripts
2333         or doing cross origin checking. There are quite a few parts of the ScriptExecutionContext api that are
2334         left as ASSERT_NOT_REACHED().
2335
2336         * CMakeLists.txt:
2337         * DerivedSources.make:
2338         * Sources.txt:
2339         * WebCore.xcodeproj/project.pbxproj:
2340         * bindings/js/JSDOMGlobalObject.cpp:
2341         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
2342         * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp.
2343         (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
2344         (WebCore::JSPaintWorkletGlobalScope::registerPaint):
2345         * bindings/js/JSWorkletGlobalScopeBase.cpp: Added.
2346         (WebCore::JSWorkletGlobalScopeBase::JSWorkletGlobalScopeBase):
2347         (WebCore::JSWorkletGlobalScopeBase::finishCreation):
2348         (WebCore::JSWorkletGlobalScopeBase::clearDOMGuardedObjects):
2349         (WebCore::JSWorkletGlobalScopeBase::visitChildren):
2350         (WebCore::JSWorkletGlobalScopeBase::destroy):
2351         (WebCore::JSWorkletGlobalScopeBase::scriptExecutionContext const):
2352         (WebCore::JSWorkletGlobalScopeBase::supportsRichSourceInfo):
2353         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScript):
2354         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScriptBeforeTimeout):
2355         (WebCore::JSWorkletGlobalScopeBase::javaScriptRuntimeFlags):
2356         (WebCore::toJS):
2357         (WebCore::toJSWorkletGlobalScope):
2358         * bindings/js/JSWorkletGlobalScopeBase.h: Added.
2359         (WebCore::JSWorkletGlobalScopeBase::wrapped const):
2360         (WebCore::JSWorkletGlobalScopeBase::proxy const):
2361         (WebCore::JSWorkletGlobalScopeBase::createStructure):
2362         (WebCore::toJS):
2363         * bindings/js/ScriptState.cpp:
2364         (WebCore::execStateFromWorkerGlobalScope):
2365         (WebCore::execStateFromWorkletGlobalScope):
2366         * bindings/js/ScriptState.h:
2367         * bindings/js/WebCoreBuiltinNames.h:
2368         * bindings/scripts/CodeGeneratorJS.pm:
2369         (IsDOMGlobalObject):
2370         (ShouldUseGlobalObjectPrototype):
2371         (GenerateHeader):
2372         (GenerateRuntimeEnableConditionalStringForExposed):
2373         (GenerateImplementation):
2374         * bindings/scripts/preprocess-idls.pl:
2375         * css/CSSPaintImageValue.cpp:
2376         (WebCore::CSSPaintImageValue::image):
2377         * css/DOMCSSPaintWorklet.cpp:
2378         (WebCore::DOMCSSPaintWorklet::ensurePaintWorklet):
2379         (WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope): Deleted.
2380         * css/DOMCSSPaintWorklet.h:
2381         * css/DOMCSSPaintWorklet.idl:
2382         * dom/Document.cpp:
2383         (WebCore::Document::ensureCSSPaintWorklet):
2384         (WebCore::Document::setCSSPaintWorkletGlobalScope):
2385         (WebCore::Document::ensureCSSPaintWorkletGlobalScope): Deleted.
2386         * dom/Document.h:
2387         (WebCore::Document::getCSSPaintWorkletGlobalScope):
2388         * dom/EventTargetFactory.in:
2389         * dom/ScriptExecutionContext.cpp:
2390         (WebCore::ScriptExecutionContext::vm):
2391         (WebCore::ScriptExecutionContext::execState):
2392         * dom/ScriptExecutionContext.h:
2393         (WebCore::ScriptExecutionContext::isWorkletGlobalScope const):
2394         * inspector/agents/worker/WorkerDebuggerAgent.cpp:
2395         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
2396         * inspector/agents/worker/WorkerRuntimeAgent.cpp:
2397         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
2398         * platform/graphics/CustomPaintImage.cpp:
2399         (WebCore::CustomPaintImage::CustomPaintImage):
2400         (WebCore::CustomPaintImage::doCustomPaint):
2401         * platform/graphics/CustomPaintImage.h:
2402         * worklets/PaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
2403         (WebCore::PaintWorkletGlobalScope::create):
2404         (WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope):
2405         (WebCore::PaintWorkletGlobalScope::devicePixelRatio):
2406         (WebCore::PaintWorkletGlobalScope::addRegisteredPaint):
2407         * worklets/PaintWorkletGlobalScope.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.h.
2408         * worklets/PaintWorkletGlobalScope.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
2409         * worklets/Worklet.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
2410         (WebCore::Worklet::create):
2411         (WebCore::Worklet::Worklet):
2412         (WebCore::Worklet::addModule):
2413         * worklets/Worklet.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
2414         * worklets/Worklet.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
2415         * worklets/WorkletConsoleClient.cpp: Copied from Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.cpp.
2416         (WebCore::WorkletConsoleClient::WorkletConsoleClient):
2417         (WebCore::WorkletConsoleClient::messageWithTypeAndLevel):
2418         (WebCore::WorkletConsoleClient::count):
2419         (WebCore::WorkletConsoleClient::time):
2420         (WebCore::WorkletConsoleClient::timeEnd):
2421         (WebCore::WorkletConsoleClient::profile):
2422         (WebCore::WorkletConsoleClient::profileEnd):
2423         (WebCore::WorkletConsoleClient::takeHeapSnapshot):
2424         (WebCore::WorkletConsoleClient::timeStamp):
2425         (WebCore::WorkletConsoleClient::record):
2426         (WebCore::WorkletConsoleClient::recordEnd):
2427         * worklets/WorkletConsoleClient.h: Added.
2428         * worklets/WorkletGlobalScope.cpp: Added.
2429         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
2430         (WebCore::WorkletGlobalScope::~WorkletGlobalScope):
2431         (WebCore::WorkletGlobalScope::evaluate):
2432         (WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
2433         (WebCore::WorkletGlobalScope::disableEval):
2434         (WebCore::WorkletGlobalScope::disableWebAssembly):
2435         (WebCore::WorkletGlobalScope::completeURL const):
2436         (WebCore::WorkletGlobalScope::logExceptionToConsole):
2437         (WebCore::WorkletGlobalScope::addConsoleMessage):
2438         (WebCore::WorkletGlobalScope::addMessage):
2439         * worklets/WorkletGlobalScope.h: Added.
2440         (WebCore::WorkletGlobalScope::isPaintWorkletGlobalScope const):
2441         (WebCore::WorkletGlobalScope::identifier const):
2442         (WebCore::WorkletGlobalScope::script):
2443         (WebCore::WorkletGlobalScope::jsRuntimeFlags const):
2444         (isType):
2445         * worklets/WorkletGlobalScope.idl: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
2446         * worklets/WorkletScriptController.cpp: Added.
2447         (WebCore::WorkletScriptController::WorkletScriptController):
2448         (WebCore::WorkletScriptController::~WorkletScriptController):
2449         (WebCore::WorkletScriptController::forbidExecution):
2450         (WebCore::WorkletScriptController::isExecutionForbidden const):
2451         (WebCore::WorkletScriptController::disableEval):
2452         (WebCore::WorkletScriptController::disableWebAssembly):
2453         (WebCore::WorkletScriptController::initScriptWithSubclass):
2454         (WebCore::WorkletScriptController::initScript):
2455         (WebCore::WorkletScriptController::evaluate):
2456         (WebCore::WorkletScriptController::setException):
2457         * worklets/WorkletScriptController.h: Added.
2458         (WebCore::WorkletScriptController::workletGlobalScopeWrapper):
2459         (WebCore::WorkletScriptController::vm):
2460         (WebCore::WorkletScriptController::initScriptIfNeeded):
2461
2462 2018-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
2463
2464         Clean up drawLineForDocumentMarker()
2465         https://bugs.webkit.org/show_bug.cgi?id=191215
2466
2467         Reviewed by Zalan Bujtas.
2468
2469         In preparation for https://bugs.webkit.org/show_bug.cgi?id=190764, I need to do a little bit of refactoring.
2470         This patch has no behavior change; it just does the following:
2471
2472         1. Renames drawLineForDocumentMarker() to drawDotsForDocumentMarker(), because 2 of the 3 implementations draw dots
2473         2. Moves our implementation back into GraphicsContext, because it's simpler and  GraphicsContext is already platform-
2474                specific.
2475         3. The signature used to accept a location and a width, but without a height, it's difficult to know what the bounding
2476                box is. In particular, knowing the bounding box must be possible without a GraphicsContext. So, I've modified
2477                the signature to accept a rectangle instead. The GraphicsContext draws only within this rectangle.
2478
2479         No new tests because there is no behavior change.
2480
2481         * platform/graphics/GraphicsContext.h:
2482         * platform/graphics/GraphicsContextImpl.h:
2483         * platform/graphics/cairo/CairoOperations.cpp:
2484         (WebCore::Cairo::drawDotsForDocumentMarker):
2485         (WebCore::Cairo::drawLineForDocumentMarker): Deleted.
2486         * platform/graphics/cairo/CairoOperations.h:
2487         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2488         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2489         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
2490         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
2491         (WebCore::GraphicsContextImplCairo::drawDotsForDocumentMarker):
2492         (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker): Deleted.
2493         * platform/graphics/cairo/GraphicsContextImplCairo.h:
2494         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2495         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2496         (WebCore::colorForMarkerLineStyle):
2497         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2498         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
2499         * platform/graphics/displaylists/DisplayListItems.cpp:
2500         (WebCore::DisplayList::Item::sizeInBytes):
2501         (WebCore::DisplayList::DrawDotsForDocumentMarker::apply const):
2502         (WebCore::DisplayList::DrawDotsForDocumentMarker::localBounds const):
2503         (WebCore::DisplayList::operator<<):
2504         (WebCore::DisplayList::DrawLineForDocumentMarker::apply const): Deleted.
2505         (WebCore::DisplayList::DrawLineForDocumentMarker::localBounds const): Deleted.
2506         * platform/graphics/displaylists/DisplayListItems.h:
2507         (WebCore::DisplayList::DrawDotsForDocumentMarker::create):
2508         (WebCore::DisplayList::DrawDotsForDocumentMarker::rect const):
2509         (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker):
2510         (WebCore::DisplayList::DrawLineForDocumentMarker::create): Deleted.
2511         (WebCore::DisplayList::DrawLineForDocumentMarker::point const): Deleted.
2512         (WebCore::DisplayList::DrawLineForDocumentMarker::width const): Deleted.
2513         (WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker): Deleted.
2514         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2515         (WebCore::DisplayList::Recorder::drawDotsForDocumentMarker):
2516         (WebCore::DisplayList::Recorder::drawLineForDocumentMarker): Deleted.
2517         * platform/graphics/displaylists/DisplayListRecorder.h:
2518         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
2519         (Nicosia::CairoOperationRecorder::drawDotsForDocumentMarker):
2520         (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker): Deleted.
2521         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
2522         * platform/graphics/win/GraphicsContextCGWin.cpp:
2523         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2524         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
2525         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2526         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2527         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
2528         * rendering/InlineTextBox.cpp:
2529         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
2530         * rendering/RenderTheme.cpp:
2531         (WebCore::RenderTheme::drawLineForDocumentMarker): Deleted.
2532         * rendering/RenderTheme.h:
2533         * rendering/RenderThemeCocoa.h:
2534         * rendering/RenderThemeCocoa.mm:
2535         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Deleted.
2536         * rendering/RenderThemeIOS.h:
2537         * rendering/RenderThemeIOS.mm:
2538         (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Deleted.
2539         * rendering/RenderThemeMac.h:
2540         * rendering/RenderThemeMac.mm:
2541         (WebCore::RenderThemeMac::colorForMarkerLineStyle): Deleted.
2542
2543 2018-11-02  Ali Juma  <ajuma@chromium.org>
2544
2545         requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe
2546         https://bugs.webkit.org/show_bug.cgi?id=176243
2547
2548         Reviewed by Simon Fraser.
2549
2550         When a new layer tree is committed to the UIProcess, the positions of layers for fixed
2551         or sticky nodes in the newly-committed tree can be stale, because of scrolling that has
2552         happened in the UIProcess since the tree was updated in the WebProcess. To handle this,
2553         RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers
2554         by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which
2555         leads to a recursive traversal of the ScrollingTree to update each such layer. However,
2556         since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange,
2557         this traversal never descended into scrolling nodes within an iframe, so the layers for
2558         these nodes were left with stale positions.
2559
2560         Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that
2561         fixed and sticky layers within an iframe do get their positions updated when a new layer
2562         tree is committed.
2563
2564         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2565         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2566         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange):
2567
2568 2018-11-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2569
2570         [iOS] Changing view scale sometimes does not zoom the page to the new initial scale, when the page is at initial scale
2571         https://bugs.webkit.org/show_bug.cgi?id=191180
2572         <rdar://problem/45744786>
2573
2574         Reviewed by Simon Fraser.
2575
2576         When computing the minimum scale in ViewportConfiguration::minimumScale, if our content width or height is
2577         shorter than the view width or height, then we recompute the minimum scale such that the content dimensions will
2578         fill the bounds of the view by setting the minimum scale to the view width or height divided by the content
2579         width or height.
2580
2581         Suppose the minimum scale is equal to some value `s`; additionally, let `w_c` denote the content width and `w_v`
2582         denote the view width (as integers). If `w_v / s` is not an integral value, the computed content width `w_c` may
2583         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
2584         slightly larger than `s`, we will end up overriding the minimum scale `s` with `w_v / w_c`.
2585
2586         As a result, specifying a viewport with a decimal `minimum-scale` will sometimes cause the computed minimum
2587         scale of the viewport (and platform view) to be very slightly different from the minimum scale. The new layout
2588         test below exercises this scenario, specifying a viewport with minimum and initial scales of 0.94 that results
2589         in `ViewportConfiguration::minimumScale` returning 0.94158.
2590
2591         With the `WebPage::setViewportConfigurationViewLayoutSize` check added in r237127, this means setting
2592         `_viewScale:` when the page is at initial scale sometimes doesn't zoom the page to the new initial scale when it
2593         should, since the page scale factor and the initial scale are different enough such that
2594         `areEssentiallyEqualAsFloat` returns false.
2595
2596         This patch addresses these issues by snapping to the minimum scale if the computed scale that fits content
2597         dimensions to view dimensions results in a minimum scale that is close enough to the configuration's minimum
2598         scale, such that the difference can be attributed to rounding error when computing content or view dimensions.
2599
2600         Test: fast/viewport/ios/viewport-minimum-and-initial-scale.html
2601
2602         * page/ViewportConfiguration.cpp:
2603         (WebCore::ViewportConfiguration::minimumScale const):
2604
2605 2018-11-02  Philippe Normand  <pnormand@igalia.com>
2606
2607         [GTK][WPE] Unreviewed, another --no-video --no-web-audio build fix following r237677
2608
2609         * inspector/agents/InspectorDOMAgent.cpp:
2610         (WebCore::InspectorDOMAgent::addEventListenersToNode):
2611
2612 2018-11-02  Daniel Bates  <dabates@apple.com>
2613
2614         [iOS] Normalize character string based on key code
2615         https://bugs.webkit.org/show_bug.cgi?id=191120
2616
2617         Reviewed by Tim Horton.
2618
2619         Following r236417 (https://bugs.webkit.org/show_bug.cgi?id=189604) we always have a valid key code
2620         for a special key (e.g. page up) and can simplify the character string normalization code.
2621
2622         No functionality changed. So, no new tests.
2623
2624         * platform/ios/WebEvent.mm:
2625         (normalizedStringWithAppKitCompatibilityMapping): Modified to take a key code and wrote algorithm
2626         in terms of it.
2627
2628         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
2629         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
2630         Pass the key code for the event to normalizedStringWithAppKitCompatibilityMapping().
2631
2632 2018-11-02  Daniel Bates  <dabates@apple.com>
2633
2634         [iOS] WebKit should dispatch DOM events when a modifier key is pressed
2635         https://bugs.webkit.org/show_bug.cgi?id=190487
2636
2637         Reviewed by Tim Horton.
2638
2639         Add support for modifier flags change events.
2640
2641         * platform/ios/PlatformEventFactoryIOS.mm:
2642         (WebCore::modifiersForEvent): Modifier keys do not have an associated character and do not
2643         participate in key repeat.
2644         (WebCore::keyIdentifierForKeyEvent): Identify modifier keys, returning "Unidentified" if
2645         the modifier key is unidentified. This matches the behavior on Mac.
2646         (WebCore::keyForKeyEvent): Identify modifier keys, returning the empty string if the modifier
2647         key is unidentified. This matches the behavior on Mac.
2648         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2649         * platform/ios/WebEvent.h:
2650
2651         * platform/ios/WebEvent.mm:
2652         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
2653         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
2654         Modifier keys do not have an associated character and do not participate in key repeat.
2655
2656         (-[WebEvent _eventDescription]): Modified to print a description for a keydown or keyup event
2657         that represents a modifier flags change.
2658         (-[WebEvent characters]): Modifier keys do not have an associated character. Assert this
2659         invariant as it is a programming error. On Mac, the same operation would result in a
2660         NSInternalInconsistencyException exception being raised.
2661         (-[WebEvent charactersIgnoringModifiers]): Ditto.
2662
2663 2018-11-02  Ali Juma  <ajuma@chromium.org>
2664
2665         Allow cross-document intersection observing
2666         https://bugs.webkit.org/show_bug.cgi?id=165746
2667
2668         Reviewed by Simon Fraser.
2669
2670         Add logic to compute the intersection between the viewport and an element in a
2671         subframe.
2672
2673         Add a FloatRect version of ScrollView::rootViewToContents, and FloatRect versions
2674         of the methods it calls.
2675
2676         Test: http/tests/intersection-observer/intermediate-frame-changes.html
2677         Also covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
2678
2679         * dom/Document.cpp:
2680         (WebCore::computeClippedRectInRootContentsSpace):
2681         (WebCore::computeIntersectionState):
2682         (WebCore::Document::updateIntersectionObservations):
2683         * page/FrameView.cpp:
2684         (WebCore::FrameView::viewportContentsChanged):
2685         (WebCore::FrameView::convertFromContainingViewToRenderer const):
2686         (WebCore::FrameView::convertFromContainingView const):
2687         * page/FrameView.h:
2688         * platform/ScrollView.cpp:
2689         (WebCore::ScrollView::viewToContents const):
2690         (WebCore::ScrollView::contentsToView const):
2691         (WebCore::ScrollView::rootViewToContents const):
2692         * platform/ScrollView.h:
2693         * platform/Widget.cpp:
2694         (WebCore::Widget::convertFromRootView const):
2695         (WebCore::Widget::convertFromContainingView const):
2696         * platform/Widget.h:
2697
2698 2018-11-02  Rob Buis  <rbuis@igalia.com>
2699
2700         Remove ENABLE_OPENCL fully
2701         https://bugs.webkit.org/show_bug.cgi?id=191172
2702
2703         Reviewed by Yusuke Suzuki.
2704
2705         No new tests since no change in functionality.
2706
2707         * platform/graphics/filters/FilterEffect.h:
2708         (WebCore::FilterEffect::hasResult const):
2709         (WebCore::FilterEffect::applyAll):
2710         (WebCore::FilterEffect::openCLImage): Deleted.
2711         (WebCore::FilterEffect::setOpenCLImage): Deleted.
2712
2713 2018-11-02  Zalan Bujtas  <zalan@apple.com>
2714
2715         [LFC][IFC] Add support for intrinsic width calculation
2716         https://bugs.webkit.org/show_bug.cgi?id=191144
2717
2718         Reviewed by Antti Koivisto.
2719
2720         This is the inline formatting version of the shrink-to-fit computation. It generates inline runs
2721         and uses InlineLineBreaker to compute min/max width. This is very similar to ::layout.
2722
2723         Test: fast/inline/simple-shrink-to-fit-inline-block.html
2724
2725         * layout/inlineformatting/InlineFormattingContext.cpp:
2726         (WebCore::Layout::InlineFormattingContext::layout const):
2727         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
2728         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2729         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2730         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
2731         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
2732         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2733         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): Deleted.
2734         * layout/inlineformatting/InlineFormattingContext.h:
2735
2736 2018-11-02  Zalan Bujtas  <zalan@apple.com>
2737
2738         [LFC][BFC] BlockFormattingContext::instrinsicWidthConstraints logic should look similar to ::layout
2739         https://bugs.webkit.org/show_bug.cgi?id=191181
2740
2741         Reviewed by Antti Koivisto.
2742
2743         * layout/blockformatting/BlockFormattingContext.cpp:
2744         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2745
2746 2018-11-02  Zalan Bujtas  <zalan@apple.com>
2747
2748         [LFC] Align shrink-to-fit width computation with the layout implementation.
2749         https://bugs.webkit.org/show_bug.cgi?id=191179
2750
2751         Reviewed by Antti Koivisto.
2752
2753         There are many similarities between layout and shrink-to-fit.
2754         They both operate on formatting roots only (shrink-to-fit -> float, out-of-flow, inline-block) and in both cases
2755         the algoritm depends on what type of formatting context the element establishes.
2756
2757         This patch is in preparation for transforming the "shrink-to-fit" width computation to make it behave more like layout.
2758         With this change the instrinsicWidthConstraints() computation happens in the formatting context that the element establishes (similar to layout).
2759
2760         * layout/FormattingContext.cpp:
2761         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2762         * layout/FormattingContext.h:
2763         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
2764         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
2765         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2766         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2767         * layout/FormattingContextGeometry.cpp:
2768         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2769         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2770         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2771         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
2772         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
2773         * layout/blockformatting/BlockFormattingContext.cpp:
2774         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2775         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2776         * layout/blockformatting/BlockFormattingContext.h:
2777         * layout/inlineformatting/InlineFormattingContext.cpp:
2778         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2779         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2780         * layout/inlineformatting/InlineFormattingContext.h:
2781         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2782         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2783
2784 2018-11-01  Antoine Quint  <graouts@apple.com>
2785
2786         [Web Animations] Make document.getAnimations() return declarative animations in the correct order
2787         https://bugs.webkit.org/show_bug.cgi?id=191153
2788
2789         Reviewed by Dean Jackson.
2790
2791         The Web Animations spec has the notion of "composite order" which determines the order in which animations should
2792         be returned when document.getAnimations() is called. The CSS Transitions and CSS Animations specifications also
2793         determine the composite order of their respective animation classes, as well as the notion of "owning element",
2794         the element that was the animation target when specified through style, prior to any manipulation via the Web
2795         Animations API. We implement these two notions so that we can pass the document.getAnimations() tests for
2796         declarative animations.
2797
2798         It is important that we have the notion of an "owning element" since when a CSS Transition or CSS Animation is
2799         modified via the Web Animations API in a way that an animation created through CSS we must consider no longer
2800         as a declarative animation but as a regular Web Animation. In this patch, we remove the DeclarativeAnimation's
2801         target(), which returned a reference, to owningElement(), which returns a pointer and return nullptr once the
2802         declarative animation has been modified.
2803
2804         In order to also keep a correct count of declarative animations applied to elements, we correctly add transitions
2805         that have completed to a list of completed transitions, as specified by the CSS Transitions spec. We have had this
2806         list declared in AnimationTimeline.h for a while but never actually did the work to add items to it. Thanks to that,
2807         AnimationTimeline::updateCSSTransitionsForElement() now correctly accounts for completed transitions so that they
2808         may be canceled if overridden with a new animation, correctly removing their "owning element".
2809
2810         Finally, now that we have saner lists of animations per classes, we can apply the right sorting routines to match
2811         the composite order for CSS Transitions, CSS Animations and Web Animations, keeping a list of all animations created
2812         in order as the final criterion for sorting.
2813
2814         * animation/AnimationTimeline.cpp:
2815         (WebCore::AnimationTimeline::animationTimingDidChange): Make sure this animation is tracked on the list of all animations
2816         created for this timeline in the order in which they were created, which is needed to sort animations correctly when
2817         document.getAnimations() is called.
2818         (WebCore::AnimationTimeline::animationWasAddedToElement): We've removed the relevantMapForAnimation() method which we used
2819         to determine which map we should add an animation to based on its class and instead have code that accounts for not just
2820         the animation's class, but also whether it has an owning element since a valid owning element is required to qualify as
2821         a CSS Transition or CSS Animation, regardless of the animation's original class.
2822         (WebCore::removeAnimationFromMapForElement): Adding this helper to remove an animation from the provided animation map so
2823         that animationWasRemovedFromElement() can call this with all of the various animation maps.
2824         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Check all of the various animation maps to see which may
2825         contain the animation we're trying to remove as the owning element might have been cleared by the time this function is
2826         called and looking at the animation's class would not be sufficient to determine which animation map the animation was in.
2827         (WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): New function in which the logic from
2828         animationWasRemovedFromElement() that dealt with removing animations from the list of running CSS Animations/Transitions as
2829         well as completed CSS Transitions was factored out. This allowed us to also call this function from
2830         DeclarativeAnimation::disassociateFromOwningElement().
2831         (WebCore::AnimationTimeline::elementWasRemoved): We no longer need to remove an animation as canceling it will remove it
2832         correctly when DocumentTimeline::updateAnimationsAndSendEvents() is called.
2833         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Call cancelDeclarativeAnimation() instead of the removed
2834         cancelOrRemoveDeclarativeAnimation() when a CSS Animation should be canceled.
2835         (WebCore::AnimationTimeline::ensureRunningTransitionsByProperty): Now that we correctly remove transitions from the list
2836         of running transitions once they've completed or have been canceled, we need a helper to always get a valid map of running
2837         transitions for a given element as that map can be cleared while updateCSSTransitionsForElement() is running. 
2838         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Call cancelDeclarativeAnimation() instead of the removed
2839         cancelOrRemoveDeclarativeAnimation() when a CSS Transition should be canceled. Additionally we always get the list of running
2840         transitions for a given element as it can be cleared by a prior cancelation.
2841         (WebCore::AnimationTimeline::cancelDeclarativeAnimation): New function replacing cancelOrRemoveDeclarativeAnimation() in which
2842         we call the new DeclarativeAnimation::cancelFromStyle() function on the provided animation and then remove the animation from
2843         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
2844         were a new animation since canceling a declarative animation via a style change removes its declarative-ness. This guarantees
2845         that a declarative animation that is canceled through style but then resumed through the Web Animations API sorts after any
2846         declarative animation with an owning element.
2847         (WebCore::AnimationTimeline::relevantMapForAnimation): Deleted.
2848         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Deleted.
2849         * animation/AnimationTimeline.h:
2850         (WebCore::AnimationTimeline::timingModelDidChange): Deleted. This was left over in the patch where we implemented the "update
2851         animations and send events" procedure.
2852         (WebCore::AnimationTimeline::animations const): Deleted.
2853         * animation/CSSAnimation.cpp:
2854         (WebCore::CSSAnimation::create): Some refactoring to make the handling of a declarative animation's owning element part of the
2855         DeclarativeAnimation constructor.
2856         * animation/CSSTransition.cpp:
2857         (WebCore::CSSTransition::create): Some refactoring to make the handling of a declarative animation's owning element part of the
2858         DeclarativeAnimation constructor.
2859         * animation/DeclarativeAnimation.cpp:
2860         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
2861         (WebCore::DeclarativeAnimation::tick): Make sure we disassociate from the animation's owning element once we transition from a
2862         relevant state to an idle state. This will catch any changes made via the Web Animations API to a declarative animation when the
2863         "update animations and send events" procedure is run.
2864         (WebCore::DeclarativeAnimation::disassociateFromOwningElement): Remove this animation from the list of declarative animations on
2865         the associated timeline and make owningElement() nullptr so that document.getAnimations() will know to sort this animation with other
2866         Web Animations created via the Web Animations API.
2867         (WebCore::DeclarativeAnimation::initialize):
2868         (WebCore::DeclarativeAnimation::cancelFromStyle): New method called from AnimationTimeline::cancelDeclarativeAnimation() which
2869         cancels the animation but also disassociates it from its owning element.
2870         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
2871         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
2872         * animation/DeclarativeAnimation.h:
2873         (WebCore::DeclarativeAnimation::owningElement const):
2874         (WebCore::DeclarativeAnimation::target const): Deleted.
2875         * animation/DocumentTimeline.cpp:
2876         (WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Adding a new utility used when sorting both
2877         CSS Transitions and CSS Animations by tree order when their owning element differ, with special logic for pseudo-elements.
2878         (WebCore::DocumentTimeline::getAnimations const): Filter and sort animations according to their composite order.
2879         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Compile a list of transitions that move to a finished state to
2880         the list of completed transitions so that they may be canceled correctly in AnimationTimeline::updateCSSTransitionsForElement().
2881         (WebCore::DocumentTimeline::transitionDidComplete):
2882         * animation/DocumentTimeline.h:
2883
2884 2018-11-02  Zan Dobersek  <zdobersek@igalia.com>
2885
2886         PNGImageDecoder: report no repetition for non-animated images
2887         https://bugs.webkit.org/show_bug.cgi?id=191068
2888
2889         Reviewed by Michael Catanzaro.
2890
2891         When building with APNG support enabled, the
2892         PNGImageDecoder::repetitionCount() method until now reported  infinite
2893         repetition count for all PNG images, even the ones that were not
2894         animated. This is now changed so that no repetition is reported for
2895         non-animated images.
2896
2897         * platform/image-decoders/png/PNGImageDecoder.cpp:
2898         (WebCore::PNGImageDecoder::repetitionCount const):
2899
2900 2018-11-02  Justin Fan  <justin_fan@apple.com>
2901
2902         [WebGPU] Experimental prototype for MSL shaders
2903         https://bugs.webkit.org/show_bug.cgi?id=191084
2904
2905         Reviewed by Dean Jackson.
2906
2907         Begin implementation for WebGPUDevice and WebGPUShaderModule and associated descriptor objects.
2908
2909         Test: webgpu/webgpu-basics.html
2910         Test: webgpu/shader-modules.html
2911
2912         * CMakeLists.txt:
2913         * DerivedSources.make:
2914         * Modules/webgpu/GPUDevice.cpp: 
2915         (WebCore::GPUDevice::createShaderModule const):
2916         * Modules/webgpu/GPUDevice.h: 
2917         (WebCore::GPUDevice::platformDevice const):
2918         * Modules/webgpu/GPUShaderModule.h:
2919         (WebCore::GPUShaderModule::platformShaderModule const):
2920         * Modules/webgpu/GPUShaderModuleDescriptor.h:
2921         * Modules/webgpu/WebGPU.cpp:
2922         (WebCore::WebGPU::requestAdapter const):
2923         * Modules/webgpu/WebGPUAdapter.cpp:
2924         (WebCore::WebGPUAdapter::create):
2925         (WebCore::WebGPUAdapter::createDevice):
2926         * Modules/webgpu/WebGPUAdapter.h:
2927         * Modules/webgpu/WebGPUAdapter.idl:
2928         * Modules/webgpu/WebGPUDevice.cpp:
2929         (WebCore::WebGPUDevice::create):
2930         (WebCore::WebGPUDevice::WebGPUDevice):
2931         (WebCore::WebGPUDevice::createShaderModule const):
2932         * Modules/webgpu/WebGPUDevice.h:
2933         * Modules/webgpu/WebGPUDevice.idl:
2934         * Modules/webgpu/WebGPUShaderModule.cpp:
2935         (WebCore::WebGPUShaderModule::create):
2936         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
2937         * Modules/webgpu/WebGPUShaderModule.h:
2938         * Modules/webgpu/WebGPUShaderModule.idl:
2939         * Modules/webgpu/WebGPUShaderModuleDescriptor.h:
2940         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
2941         * Modules/webgpu/WebGPUSwapChain.cpp:
2942         (WebCore::WebGPUSwapChain::configure):
2943         * Modules/webgpu/WebGPUSwapChain.h:
2944         * Modules/webgpu/WebGPUSwapChain.idl:
2945         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
2946         (WebCore::GPUDevice::create):
2947         (WebCore::GPUDevice::GPUDevice):
2948         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
2949         (WebCore::GPUShaderModule::create):
2950         (WebCore::GPUShaderModule::GPUShaderModule):
2951         * Sources.txt:
2952         * SourcesCocoa.txt:
2953         * WebCore.xcodeproj/project.pbxproj:
2954         * bindings/js/WebCoreBuiltinNames.h:
2955         * platform/Logging.h:
2956
2957 2018-11-01  Jiewen Tan  <jiewen_tan@apple.com>
2958
2959         Replace CommonRandom SPI with API
2960         https://bugs.webkit.org/show_bug.cgi?id=191178
2961         <rdar://problem/45722391>
2962
2963         Reviewed by Brent Fulgham.
2964
2965         The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
2966         all SPI usages with API.
2967
2968         No change of behaviors.
2969
2970         * crypto/CommonCryptoUtilities.h:
2971         * crypto/mac/CryptoKeyMac.cpp:
2972         (WebCore::CryptoKey::randomData):
2973         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
2974         (WebCore::createAndStoreMasterKey):
2975         (WebCore::wrapSerializedCryptoKey):
2976         * page/Crypto.cpp:
2977         (WebCore::Crypto::getRandomValues):
2978
2979 2018-11-01  Chris Dumez  <cdumez@apple.com>
2980
2981         [WebIDL] Rename CallWith=ScriptState to CallWith=ExecState
2982         https://bugs.webkit.org/show_bug.cgi?id=191162
2983
2984         Reviewed by Alex Christensen.
2985
2986         Rename CallWith=ScriptState to CallWith=ExecState in our Web IDL as ScriptState is no longer a thing
2987         in modern WebKit. The implementation is actually passed an ExecState nowadays.
2988
2989         * Modules/applepay/ApplePaySession.idl:
2990         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
2991         * Modules/fetch/FetchBody.idl:
2992         * Modules/indexeddb/IDBCursor.idl:
2993         * Modules/indexeddb/IDBFactory.idl:
2994         * Modules/indexeddb/IDBIndex.idl:
2995         * Modules/indexeddb/IDBKeyRange.idl:
2996         * Modules/indexeddb/IDBObjectStore.idl:
2997         * Modules/mediastream/RTCPeerConnection.idl:
2998         * animation/Animatable.idl:
2999         * animation/KeyframeEffect.idl:
3000         * animation/KeyframeEffectReadOnly.idl:
3001         * bindings/scripts/CodeGeneratorJS.pm:
3002         (GenerateCallWith):
3003         (GenerateConstructorDefinition):
3004         * bindings/scripts/IDLAttributes.json:
3005         * bindings/scripts/test/JS/JSTestObj.cpp:
3006         (WebCore::jsTestObjWithExecStateAttributeGetter):
3007         (WebCore::jsTestObjWithExecStateAttribute):
3008         (WebCore::setJSTestObjWithExecStateAttributeSetter):
3009         (WebCore::setJSTestObjWithExecStateAttribute):
3010         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter):
3011         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttribute):
3012         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter):
3013         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttribute):
3014         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter):
3015         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
3016         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter):
3017         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
3018         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody):
3019         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoid):
3020         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody):
3021         (WebCore::jsTestObjPrototypeFunctionWithExecStateObj):
3022         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody):
3023         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException):
3024         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody):
3025         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjException):
3026         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody):
3027         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState):
3028         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody):
3029         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException):
3030         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody):
3031         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces):
3032         (WebCore::jsTestObjWithScriptStateAttributeGetter): Deleted.
3033         (WebCore::jsTestObjWithScriptStateAttribute): Deleted.
3034         (WebCore::setJSTestObjWithScriptStateAttributeSetter): Deleted.
3035         (WebCore::setJSTestObjWithScriptStateAttribute): Deleted.
3036         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter): Deleted.
3037         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
3038         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeSetter): Deleted.
3039         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
3040         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter): Deleted.
3041         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
3042         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeSetter): Deleted.
3043         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
3044         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidBody): Deleted.
3045         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid): Deleted.
3046         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjBody): Deleted.
3047         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj): Deleted.
3048         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidExceptionBody): Deleted.
3049         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException): Deleted.
3050         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjExceptionBody): Deleted.
3051         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException): Deleted.
3052         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateBody): Deleted.
3053         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState): Deleted.
3054         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjExceptionBody): Deleted.
3055         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException): Deleted.
3056         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpacesBody): Deleted.
3057         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces): Deleted.
3058         * bindings/scripts/test/TestObj.idl:
3059         * bindings/scripts/test/TestPromiseRejectionEvent.idl:
3060         * crypto/SubtleCrypto.idl:
3061         * dom/Element.idl:
3062         * dom/ErrorEvent.idl:
3063         * dom/MessagePort.idl:
3064         * dom/MouseEvent.idl:
3065         * html/HTMLCanvasElement.idl:
3066         * html/HTMLFrameElement.idl:
3067         * html/OffscreenCanvas.idl:
3068         * html/track/DataCue.idl:
3069         * inspector/CommandLineAPIHost.idl:
3070         * page/DOMWindow.idl:
3071         * page/RemoteDOMWindow.idl:
3072         * page/WindowOrWorkerGlobalScope.idl:
3073         * testing/Internals.idl:
3074         * workers/DedicatedWorkerGlobalScope.idl:
3075         * workers/Worker.idl:
3076
3077 2018-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
3078
3079         Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
3080         https://bugs.webkit.org/show_bug.cgi?id=189693
3081
3082         Reviewed by Yusuke Suzuki.
3083
3084         No new tests because there's no behaviro changes.
3085
3086         * platform/SharedBuffer.cpp: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
3087         * xml/XSLTProcessorLibxslt.cpp: Ditto.
3088         * xml/parser/XMLDocumentParserLibxml2.cpp: Ditto.
3089
3090 2018-11-01  John Wilander  <wilander@apple.com>
3091
3092         In WebCore::ResourceLoadObserver, use document.sessionID().isEphemeral() when possible and check for page existence when not
3093         https://bugs.webkit.org/show_bug.cgi?id=191119
3094         <rdar://problem/44176965>
3095
3096         Reviewed by Chris Dumez.
3097
3098         New API test added.
3099
3100         * loader/ResourceLoadObserver.cpp:
3101         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3102         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3103
3104 2018-11-01  Devin Rousso  <drousso@apple.com>
3105
3106         Web Inspector: Network: remove unnecessary media event tracking
3107         https://bugs.webkit.org/show_bug.cgi?id=191174
3108
3109         Reviewed by Joseph Pecoraro.
3110
3111         No new tests, as this simply removes some event listeners for the WebInspector frontend.
3112
3113         * inspector/agents/InspectorDOMAgent.cpp:
3114         (WebCore::InspectorDOMAgent::addEventListenersToNode):
3115
3116 2018-11-01  Chris Dumez  <cdumez@apple.com>
3117
3118         Location object sans browsing context
3119         https://bugs.webkit.org/show_bug.cgi?id=191060
3120
3121         Reviewed by Geoffrey Garen.
3122
3123         As per https://github.com/whatwg/html/pull/4076, a Location object's URL should be "about:blank" when
3124         it does not have a browsing context (Frame), not "".
3125
3126         No new tests, rebaselined existing tests.
3127
3128         * page/Location.cpp:
3129         (WebCore::Location::url const):
3130         (WebCore::Location::href const):
3131         (WebCore::Location::protocol const):
3132         (WebCore::Location::host const):
3133         (WebCore::Location::hostname const):
3134         (WebCore::Location::port const):
3135         (WebCore::Location::pathname const):
3136         (WebCore::Location::search const):
3137         (WebCore::Location::origin const):
3138         (WebCore::Location::hash const):
3139
3140 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
3141
3142         Add a storage limit for IndexedDB
3143         https://bugs.webkit.org/show_bug.cgi?id=190598
3144         <rdar://problem/44654715>
3145
3146         Reviewed by Chris Dumez.
3147
3148         Set a storage limit in IndexedDB for each pair of mainFrameOrigin and openingOrigin. 
3149         IndexedDB will return a QuotaExceededError if limit is reached.
3150
3151         If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is 
3152         half the free disk space.
3153
3154         Test: storage/indexeddb/storage-limit.html
3155
3156         * Modules/indexeddb/server/IDBBackingStore.h:
3157         * Modules/indexeddb/server/IDBServer.cpp:
3158         (WebCore::IDBServer::IDBServer::createBackingStore):
3159         (WebCore::IDBServer::IDBServer::setPerOriginQuota):
3160         * Modules/indexeddb/server/IDBServer.h:
3161         (WebCore::IDBServer::IDBServer::perOriginQuota const):
3162         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3163         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3164         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
3165         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
3166         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
3167         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
3168         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
3169         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
3170         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3171         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
3172         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
3173         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
3174         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
3175         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3176         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3177         (WebCore::IDBServer::UniqueIDBDatabase::setQuota):
3178         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3179
3180 2018-11-01  Justin Michaud  <justin_michaud@apple.com>
3181
3182         CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly
3183         https://bugs.webkit.org/show_bug.cgi?id=191042
3184
3185         Reviewed by Antti Koivisto.
3186
3187         Refactor code so that:
3188         - All properties applied in StyleResolver::applyMatchedProperties are only applied once. 
3189         - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
3190           every time they were referenced, and again in RenderStyle.
3191         - The font-size property is applied after its variable references, but before custom properties that depend on it.
3192         - Cycles are detected at the same time as resolution.
3193         - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
3194           If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
3195           This behaviour matches chrome, but is not documented in the spec. 
3196         - Custom property values have more explicit resolved/unresolved state.
3197         - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
3198
3199         Tests: css-custom-properties-api/crash.html
3200                css-custom-properties-api/cycles.html
3201                css-custom-properties-api/inline.html
3202
3203         * css/CSSComputedStyleDeclaration.cpp:
3204         (WebCore::ComputedStyleExtractor::customPropertyValue):
3205         * css/CSSCustomPropertyValue.cpp:
3206         (WebCore::CSSCustomPropertyValue::equals const):
3207         (WebCore::CSSCustomPropertyValue::customCSSText const):
3208         (WebCore::CSSCustomPropertyValue::tokens const):
3209         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
3210         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
3211         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
3212         * css/CSSCustomPropertyValue.h:
3213         * css/CSSRegisteredCustomProperty.cpp:
3214         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
3215         * css/CSSRegisteredCustomProperty.h:
3216         * css/CSSVariableData.cpp:
3217         (WebCore::CSSVariableData::CSSVariableData):
3218         (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
3219         (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
3220         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
3221         (WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
3222         (WebCore::CSSVariableData::resolveVariableReference const): Deleted.
3223         (WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
3224         (WebCore::CSSVariableData::resolveTokenRange const): Deleted.
3225         * css/CSSVariableData.h:
3226         (WebCore::CSSVariableData::create):
3227         (WebCore::CSSVariableData::createResolved): Deleted.
3228         (WebCore::CSSVariableData::needsVariableResolution const): Deleted.
3229         (WebCore::CSSVariableData::CSSVariableData): Deleted.
3230         * css/CSSVariableReferenceValue.cpp:
3231         (WebCore::resolveVariableFallback):
3232         (WebCore::resolveVariableReference):
3233         (WebCore::resolveTokenRange):
3234         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
3235         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
3236         * css/CSSVariableReferenceValue.h:
3237         (WebCore::CSSVariableReferenceValue::create):
3238         (WebCore::CSSVariableReferenceValue::equals const):
3239         (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
3240         * css/DOMCSSRegisterCustomProperty.cpp:
3241         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
3242         * css/PropertySetCSSStyleDeclaration.cpp:
3243         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
3244         * css/StyleBuilderCustom.h:
3245         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
3246         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
3247         * css/StyleProperties.cpp:
3248         (WebCore::MutableStyleProperties::setCustomProperty):
3249         * css/StyleProperties.h:
3250         * css/StyleResolver.cpp:
3251         (WebCore::StyleResolver::State::setStyle):
3252         (WebCore::StyleResolver::styleForKeyframe):
3253         (WebCore::StyleResolver::styleForPage):
3254         (WebCore::StyleResolver::applyMatchedProperties):
3255         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
3256         (WebCore::StyleResolver::applyProperty):
3257         (WebCore::StyleResolver::resolvedVariableValue const):
3258         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
3259         (WebCore::StyleResolver::CascadedProperties::Property::apply):
3260         (WebCore::StyleResolver::applyCascadedCustomProperty):
3261         (WebCore::StyleResolver::applyCascadedProperties):
3262         * css/StyleResolver.h:
3263         * css/parser/CSSParser.cpp:
3264         (WebCore::CSSParser::parseValueWithVariableReferences):
3265         * css/parser/CSSParser.h:
3266         * css/parser/CSSPropertyParser.cpp:
3267         (WebCore::CSSPropertyParser::CSSPropertyParser):
3268         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
3269         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
3270         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
3271         (WebCore::CSSPropertyParser::parseValueStart):
3272         (WebCore::CSSPropertyParser::parseSingleValue):
3273         * css/parser/CSSPropertyParser.h:
3274         * css/parser/CSSVariableParser.cpp:
3275         (WebCore::CSSVariableParser::parseDeclarationValue):
3276         * dom/ConstantPropertyMap.cpp:
3277         (WebCore::ConstantPropertyMap::setValueForProperty):
3278         (WebCore::variableDataForPositivePixelLength):
3279         (WebCore::variableDataForPositiveDuration):
3280         * rendering/style/RenderStyle.cpp:
3281         (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
3282         * rendering/style/RenderStyle.h:
3283         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
3284         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
3285         * rendering/style/StyleCustomPropertyData.h:
3286         (WebCore::StyleCustomPropertyData::operator== const):
3287         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
3288         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
3289         (): Deleted.
3290
3291 2018-11-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
3292
3293         [CG] Adopt CG SPI for non-even cornered rounded rects
3294         https://bugs.webkit.org/show_bug.cgi?id=190155
3295
3296         Reviewed by Simon Fraser.
3297
3298         Instead of creating bezier curves for the non-even corners of the rounded
3299         rects, we should use the optimized SPI provided by CG.
3300
3301         * platform/graphics/cg/PathCG.cpp:
3302         (WebCore::Path::platformAddPathForRoundedRect):
3303
3304 2018-11-01  Youenn Fablet  <youenn@apple.com>
3305
3306         RTCTrackEvent.streams should be SameObject
3307         https://bugs.webkit.org/show_bug.cgi?id=191130
3308
3309         Reviewed by Eric Carlson.
3310
3311         Mimick SameObject using CachedAttribute.
3312         Covered by rebased test.
3313
3314         * Modules/mediastream/RTCTrackEvent.idl:
3315
3316 2018-10-31  Zalan Bujtas  <zalan@apple.com>
3317
3318         [LFC][IFC] Add support for inline-block elements.
3319         https://bugs.webkit.org/show_bug.cgi?id=191143
3320
3321         Reviewed by Antti Koivisto.
3322
3323         This patch add support for laying out non-shrink-to-width inline-block elements.
3324
3325         Test: fast/inline/simple-inline-block.html
3326
3327         * layout/FormattingContext.h:
3328         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3329         * layout/FormattingContextGeometry.cpp:
3330         (WebCore::Layout::contentHeightForFormattingContextRoot):
3331         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
3332         * layout/inlineformatting/InlineFormattingContext.cpp:
3333         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3334         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3335         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
3336         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
3337         * layout/layouttree/LayoutInlineContainer.cpp:
3338         (WebCore::Layout::InlineContainer::establishesInlineFormattingContext const):
3339         * layout/layouttree/LayoutInlineContainer.h:
3340         * layout/layouttree/LayoutTreeBuilder.cpp:
3341         (WebCore::Layout::TreeBuilder::createSubTree):
3342
3343 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
3344
3345         Fix build with VIDEO and WEB_AUDIO disabled
3346         https://bugs.webkit.org/show_bug.cgi?id=191147
3347
3348         Reviewed by Philippe Normand.
3349
3350         Supported or not, there were a few build fixes needed
3351         to be able to build WebKit with media disabled. Mostly
3352         low-hanging fruits.
3353
3354         * Modules/mediasource/VideoPlaybackQuality.cpp:
3355         * Modules/mediasource/VideoPlaybackQuality.h:
3356         * Modules/mediasource/VideoPlaybackQuality.idl:
3357         * dom/Document.cpp:
3358         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
3359         * inspector/agents/InspectorDOMAgent.cpp:
3360         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
3361         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
3362         * inspector/agents/InspectorDOMAgent.h:
3363         * rendering/RenderThemeGtk.cpp:
3364
3365 2018-10-31  Devin Rousso  <drousso@apple.com>
3366
3367         Web Inspector: Canvas: create a setting for auto-recording newly created contexts
3368         https://bugs.webkit.org/show_bug.cgi?id=190856
3369
3370         Reviewed by Brian Burg.
3371
3372         Test: inspector/canvas/setRecordingAutoCaptureFrameCount.html
3373
3374         * inspector/agents/InspectorCanvasAgent.h:
3375         (WebCore::InspectorCanvasAgent::RecordingOptions): Added.
3376         * inspector/agents/InspectorCanvasAgent.cpp:
3377         (WebCore::InspectorCanvasAgent::enable):
3378         (WebCore::InspectorCanvasAgent::disable):
3379         (WebCore::InspectorCanvasAgent::setRecordingAutoCaptureFrameCount): Added.
3380         (WebCore::InspectorCanvasAgent::startRecording):
3381         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
3382         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
3383         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
3384         (WebCore::InspectorCanvasAgent::startRecording): Added.
3385         Unify the different functions that are able to start a recording to use a single path.
3386
3387         * inspector/InspectorCanvas.h:
3388         * inspector/InspectorCanvas.cpp:
3389         (WebCore::InspectorCanvas::resetRecordingData):
3390         (WebCore::InspectorCanvas::recordAction):
3391         (WebCore::InspectorCanvas::setFrameCount): Added.
3392         (WebCore::InspectorCanvas::overFrameCount const): Added.
3393
3394 2018-10-31  Devin Rousso  <drousso@apple.com>
3395
3396         Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
3397         https://bugs.webkit.org/show_bug.cgi?id=190641
3398         <rdar://problem/45319049>
3399
3400         Reviewed by Joseph Pecoraro.
3401
3402         No new tests, as low power mode is indeterminate. Should not affect functionality.
3403
3404         * inspector/agents/InspectorDOMAgent.h:
3405         * inspector/agents/InspectorDOMAgent.cpp:
3406         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
3407         (WebCore::InspectorDOMAgent::addEventListenersToNode):
3408         (WebCore::InspectorDOMAgent::mediaMetricsTimerFired): Added.
3409
3410 2018-10-31  Alicia Boya García  <aboya@igalia.com>
3411
3412         [MSE] Use tolerance when growing the coded frame group
3413         https://bugs.webkit.org/show_bug.cgi?id=190085
3414
3415         Reviewed by Jer Noble.
3416
3417         Test: media/media-source/media-source-append-acb-tolerance.html
3418
3419         This patch introduces a millisecond tolerance in the range of
3420         potential frames that should be erased frame from the track buffer
3421         when the coded frame group is growing.
3422
3423         This is necessary because some files have imprecise overlapping
3424         timestamps (especially WebM files).
3425
3426         This fixes a stall when seeking back and forth in YouTube with WebM
3427         video.
3428
3429         A test case simulating the problem with video/mock using timestamps
3430         similar to those of a typical 30 fps WebM video is also added.
3431
3432         * Modules/mediasource/SourceBuffer.cpp:
3433         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3434
3435 2018-10-31  Jer Noble  <jer.noble@apple.com>
3436
3437         MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.B0') is inproperly rejected
3438         https://bugs.webkit.org/show_bug.cgi?id=191129
3439
3440         Reviewed by Eric Carlson.
3441
3442         Test: media/media-source/media-source-istypesupported-case-sensitive.html
3443
3444         According to RFC 2045: "All media type values, subtype values, and parameter names as
3445         defined are case-insensitive. However, parameter values are case-sensitive unless otherwise
3446         specified for the specific parameter." So rather than fold the entire ContentType into lower-
3447         case, leave the original string intact and require clients to enforce case-insensitivity.
3448
3449         * Modules/mediasource/MediaSource.cpp:
3450         (WebCore::MediaSource::isTypeSupported):
3451
3452 2018-10-31  Jer Noble  <jer.noble@apple.com>
3453
3454         Unreivewed build fix; fix the non-HAVE_AVCONTENTKEYSESSION builds by adding guards around
3455         access of m_cdmInstance.
3456
3457         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3458         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
3459
3460 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
3461
3462         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
3463         https://bugs.webkit.org/show_bug.cgi?id=190778
3464         <rdar://problem/45703574>
3465
3466         Reviewed by Youenn Fablet.
3467
3468         Add a include to fix the unified build error.
3469
3470         No tests since no new functionality.
3471
3472         * Modules/webgpu/WebGPUDevice.cpp:
3473
3474 2018-10-26  Jer Noble  <jer.noble@apple.com>
3475
3476         [EME][Cocoa] Cannot play unmuxed video and audio fMP4 streams encrypted with different keys via MSE
3477         https://bugs.webkit.org/show_bug.cgi?id=190946
3478
3479         Reviewed by Eric Carlson.
3480
3481         Use separate AVContentKeySessions per CDMInstanceSession (rather than one AVContentKeySession per
3482         CDMInstance).
3483
3484         - Add a mechanism for sending a message out from platform/CDMInstance to MediaKeySession without
3485           requiring MediaKeySession to send a callback first.
3486
3487         - Move all the AVContentKeySession delegate methods from CDMInstanceFairPlayStreamingAVFObjC to
3488           CDMInstanceSessionFairPlayStreamingAVFObjC.
3489
3490         - Add a mechanism for requesting the correct CDMInstanceSession for a given KeyID.
3491
3492         - Support key renewal through a "renew" message.
3493
3494         - Remember the keyID in SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID()
3495           and ask for the correct CDMInstanceSession for that keyID in attemptToDecrypt().
3496
3497         - Pass the CDMInstance down from MediaPlayerPrivateMediaSourceAVFObjC -> SourceBufferPrivateAVFObjC.
3498
3499         * Modules/encryptedmedia/MediaKeySession.cpp:
3500         (WebCore::MediaKeySession::sendMessage):
3501         * Modules/encryptedmedia/MediaKeySession.h:
3502         * platform/encryptedmedia/CDMInstanceSession.h:
3503         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
3504         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3505         (-[WebCoreFPSContentKeySessionDelegate initWithParent:]):
3506         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
3507         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
3508         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3509         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
3510         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
3511         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::~CDMInstanceSessionFairPlayStreamingAVFObjC):
3512         (WebCore::keyIDsForRequest):
3513         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
3514         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
3515         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
3516         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
3517         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
3518         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
3519         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
3520         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
3521         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
3522         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
3523         (WebCore::requestStatusToCDMStatus):
3524         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
3525         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3526         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
3527         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3528         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3529         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
3530         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
3531         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
3532         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
3533         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3534         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3535         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3536         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
3537         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
3538         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
3539         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
3540         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
3541         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
3542         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
3543         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached):
3544         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceDetached):
3545         (WebCore::MediaSourcePrivateAVFObjC::attemptToDecryptWithInstance):
3546         (WebCore::MediaSourcePrivateAVFObjC::waitingForKey const):
3547         (WebCore::MediaSourcePrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3548         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3549         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3550         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
3551         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
3552         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
3553         (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
3554         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3555
3556 2018-10-31  Zach Li  <zacharyli323@gmail.com>
3557
3558         Add credit card autofill button
3559         https://bugs.webkit.org/show_bug.cgi?id=191051
3560         <rdar://problem/45657011>
3561
3562         Reviewed by Wenson Hsieh.
3563
3564         Test: fast/forms/auto-fill-button/input-credit-card-auto-fill-button.html
3565
3566         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3567         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3568         * css/html.css:
3569         (input::-webkit-credit-card-auto-fill-button):
3570         Add credit card autofill button.
3571         (input::-webkit-credit-card-auto-fill-button:hover):
3572         (input::-webkit-credit-card-auto-fill-button:active):
3573         * html/HTMLTextFormControlElement.h:
3574         * html/TextFieldInputType.cpp:
3575         (WebCore::autoFillButtonTypeToAccessibilityLabel):
3576         (WebCore::autoFillButtonTypeToAutoFillButtonText):
3577         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
3578         (WebCore::isAutoFillButtonTypeChanged):
3579         * platform/LocalizedStrings.cpp:
3580         (WebCore::AXAutoFillCreditCardLabel):
3581         * platform/LocalizedStrings.h:
3582         * testing/Internals.cpp:
3583         (WebCore::toAutoFillButtonType):
3584         (WebCore::toInternalsAutoFillButtonType):
3585         * testing/Internals.h:
3586         * testing/Internals.idl:
3587
3588 2018-10-31  Eric Carlson  <eric.carlson@apple.com>
3589
3590         [MediaStream] Don't reveal device IDs until the user has granted permission to capture
3591         https://bugs.webkit.org/show_bug.cgi?id=191112
3592         <rdar://problem/45699932>
3593
3594         Reviewed by Youenn Fablet.
3595
3596         No new tests, existing tests updated.
3597
3598         * Modules/mediastream/MediaDevicesRequest.cpp:
3599         (WebCore::MediaDevicesRequest::start): Don't reveal device ID or group ID until the user 
3600         has granted permssion to capture.
3601
3602 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
3603
3604         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
3605         https://bugs.webkit.org/show_bug.cgi?id=190778
3606
3607         Reviewed by Youenn Fablet.
3608
3609         Implement JavaScript dispatch event dataavailable and JavaScript exposed method stop().
3610         Implement a mock string as the output buffer of MediaRecorder.
3611         Remove the declaration of timecode in BlobEvent since it has not been implemented in MediaRecorder and MediaRecorderPrivate. 
3612
3613         Tests: http/wpt/mediarecorder/MediaRecorder-dataavailable.html
3614                http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html
3615                imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html
3616                imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html
3617
3618         * CMakeLists.txt:
3619         * Modules/mediarecorder/BlobEvent.cpp: Added.
3620         (WebCore::BlobEvent::create):
3621         (WebCore::BlobEvent::BlobEvent):
3622         (WebCore::BlobEvent::eventInterface const):
3623         * Modules/mediarecorder/BlobEvent.h:
3624         * Modules/mediarecorder/BlobEvent.idl:
3625         * Modules/mediarecorder/MediaRecorder.cpp:
3626         (WebCore::MediaRecorder::MediaRecorder):
3627         (WebCore::MediaRecorder::~MediaRecorder):
3628         (WebCore::MediaRecorder::stop):
3629         (WebCore::MediaRecorder::startRecording):
3630         (WebCore::MediaRecorder::stopRecording):
3631         (WebCore::MediaRecorder::stopRecordingInternal):
3632         (WebCore::MediaRecorder::didAddOrRemoveTrack):
3633         (WebCore::MediaRecorder::trackEnded):
3634         (WebCore::MediaRecorder::sampleBufferUpdated):
3635         (WebCore::MediaRecorder::audioSamplesAvailable):
3636         (WebCore::MediaRecorder::scheduleDeferredTask):
3637         * Modules/mediarecorder/MediaRecorder.h:
3638         * Modules/mediarecorder/MediaRecorder.idl:
3639         * Sources.txt:
3640         * WebCore.xcodeproj/project.pbxproj:
3641         * dom/EventNames.h:
3642         * dom/EventNames.in:
3643         * platform/mediarecorder/MediaRecorderPrivate.h: Added.
3644         * platform/mediarecorder/MediaRecorderPrivateMock.cpp: Added.
3645         (WebCore::MediaRecorderPrivateMock::sampleBufferUpdated):
3646         (WebCore::MediaRecorderPrivateMock::audioSamplesAvailable):
3647         (WebCore::MediaRecorderPrivateMock::generateMockString):
3648         (WebCore::MediaRecorderPrivateMock::fetchData):
3649         * platform/mediarecorder/MediaRecorderPrivateMock.h: Added.
3650
3651 2018-10-31  Claudio Saavedra  <csaavedra@igalia.com>
3652
3653         [GTK][WPE] Remaining topPrivatelyControlledDomain() fixes
3654         https://bugs.webkit.org/show_bug.cgi?id=191110
3655
3656         Reviewed by Michael Catanzaro.
3657
3658         Covered by existing tests.
3659
3660         Turns out that this method is expected to reject domains that
3661         are not registrable. Also sync with the Mac implementation in
3662         that given domains that are not all ASCII should be returned
3663         back as is. This fixes the remaining Public Suffix API tests.
3664
3665         * platform/soup/PublicSuffixSoup.cpp:
3666         (WebCore::topPrivatelyControlledDomain):
3667
3668 2018-10-31  Antti Koivisto  <antti@apple.com>
3669
3670         Remove LayerFlushScheduler
3671         https://bugs.webkit.org/show_bug.cgi?id=191103
3672
3673         Reviewed by Anders Carlsson.
3674
3675         It is only used in WK1.
3676
3677         * SourcesCocoa.txt:
3678         * WebCore.xcodeproj/project.pbxproj:
3679         * platform/graphics/ca/LayerFlushScheduler.cpp: Removed.
3680         * platform/graphics/ca/LayerFlushScheduler.h: Removed.
3681         * platform/graphics/ca/LayerFlushSchedulerClient.h: Removed.
3682         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed.
3683
3684 2018-10-31  Zalan Bujtas  <zalan@apple.com>
3685
3686         Missing from r237634
3687
3688         * layout/inlineformatting/InlineFormattingState.cpp:
3689         (WebCore::Layout::InlineFormattingState::formattingContext):
3690
3691 2018-10-31  Zalan Bujtas  <zalan@apple.com>
3692
3693         [LFC] Do not pass LayoutState& to compute* and layout* functions
3694         https://bugs.webkit.org/show_bug.cgi?id=191100
3695
3696         Reviewed by Antti Koivisto.
3697
3698         Reduce noise by removing LayoutState& parameter where possible.
3699
3700         * layout/FormattingContext.cpp:
3701         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3702         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3703         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
3704         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
3705         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3706         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3707         * layout/FormattingContext.h:
3708         * layout/FormattingContextGeometry.cpp:
3709         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
3710         * layout/LayoutFormattingState.cpp:
3711         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
3712         * layout/blockformatting/BlockFormattingContext.cpp:
3713         (WebCore::Layout::BlockFormattingContext::layout const):
3714         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3715         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3716         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
3717         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
3718         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
3719         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3720         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
3721         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3722         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
3723         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3724         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3725         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
3726         * layout/blockformatting/BlockFormattingContext.h:
3727         * layout/inlineformatting/InlineFormattingContext.cpp:
3728         (WebCore::Layout::InlineFormattingContext::layout const):
3729         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
3730         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3731         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3732         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
3733         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
3734         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
3735         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
3736         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
3737         * layout/inlineformatting/InlineFormattingContext.h:
3738
3739 2018-10-31  Zalan Bujtas  <zalan@apple.com>
3740
3741         [LFC] FormattingContext class should take FormattingState&
3742         https://bugs.webkit.org/show_bug.cgi?id=191099
3743
3744         Reviewed by Antti Koivisto.
3745
3746         This is in preparation for not passing LayoutState& into every layout functions.
3747         FormattingContext has FormattingState now and LayoutState can be acquired through FormattingState.
3748         LayoutState <- FormattingState <- FormattingContext
3749
3750         * layout/FormattingContext.cpp:
3751         (WebCore::Layout::FormattingContext::FormattingContext):
3752         (WebCore::Layout::FormattingContext::formattingState const):
3753         (WebCore::Layout::FormattingContext::layoutState const):
3754         * layout/FormattingContext.h:
3755         * layout/FormattingState.cpp:
3756         (WebCore::Layout::FormattingState::FormattingState):
3757         * layout/FormattingState.h:
3758         (WebCore::Layout::FormattingState::layoutState const):
3759         * layout/LayoutFormattingState.h:
3760         * layout/blockformatting/BlockFormattingContext.cpp:
3761         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
3762         * layout/blockformatting/BlockFormattingContext.h:
3763         * layout/blockformatting/BlockFormattingState.cpp:
3764         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
3765         (WebCore::Layout::BlockFormattingState::formattingContext):
3766         (WebCore::Layout::BlockFormattingState::formattingContext const): Deleted.
3767         * layout/blockformatting/BlockFormattingState.h:
3768         * layout/inlineformatting/InlineFormattingContext.cpp:
3769         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
3770         * layout/inlineformatting/InlineFormattingContext.h:
3771         * layout/inlineformatting/InlineFormattingState.cpp:
3772         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
3773         (WebCore::Layout::InlineFormattingState::formattingContext):
3774         (WebCore::Layout::InlineFormattingState::formattingContext const): Deleted.
3775         * layout/inlineformatting/InlineFormattingState.h:
3776
3777 2018-10-31  Zalan Bujtas  <zalan@apple.com>
3778
3779         [LFC] The *FormattingState class should provide the *FormattingContext.
3780         https://bugs.webkit.org/show_bug.cgi?id=191089
3781
3782         Reviewed by Antti Koivisto.
3783
3784         BlockFormattingState provides the BlockFormattingContext object, while InlineFormattingState provides the InlineFormattingContext.
3785
3786         * layout/FormattingContext.cpp:
3787         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3788         * layout/FormattingState.h:
3789         * layout/LayoutFormattingState.cpp:
3790         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
3791         (WebCore::Layout::LayoutState::formattingContext const): Deleted.
3792         * layout/LayoutFormattingState.h:
3793         * layout/blockformatting/BlockFormattingContext.cpp:
3794         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3795         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
3796         * layout/blockformatting/BlockFormattingState.cpp:
3797         (WebCore::Layout::BlockFormattingState::formattingContext const):
3798         * layout/blockformatting/BlockFormattingState.h:
3799         * layout/inlineformatting/InlineFormattingContext.cpp:
3800         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3801         * layout/inlineformatting/InlineFormattingState.cpp:
3802         (WebCore::Layout::InlineFormattingState::formattingContext const):
3803         * layout/inlineformatting/InlineFormattingState.h:
3804
3805 2018-10-31  Zalan Bujtas  <zalan@apple.com>
3806
3807         [LFC] Rename LayoutContext to LayoutState
3808         https://bugs.webkit.org/show_bug.cgi?id=191080
3809
3810         Reviewed by Antti Koivisto.
3811
3812         LayoutContext naming was a bit misleading since none of the other *FormattingContext classes (BlockFormattingContext etc) hold states.
3813         (LayoutContext.cpp -> LayoutFormattingState.cpp because LayoutState.cpp name is already taken.)
3814
3815         Now the current state is as follows:
3816
3817         LayoutState has
3818         1. Layout tree
3819         2. State content for each formatting subtrees
3820         3. Display tree
3821
3822         * Sources.txt:
3823         * WebCore.xcodeproj/project.pbxproj:
3824         * layout/FormattingContext.cpp:
3825         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3826         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3827         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
3828         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
3829         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3830         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
3831         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
3832         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
3833         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3834         * layout/FormattingContext.h:
3835         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
3836         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
3837         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
3838         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
3839         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3840         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3841         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3842         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3843         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3844         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3845         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3846         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
3847         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3848         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3849         * layout/FormattingContextGeometry.cpp:
3850         (WebCore::Layout::contentHeightForFormattingContextRoot):
3851         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
3852         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
3853         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
3854         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
3855         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
3856         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3857         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3858         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3859         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3860         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3861         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3862         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
3863         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3864         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
3865         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
3866         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
3867         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
3868         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3869         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3870         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
3871         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
3872         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
3873         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
3874         * layout/FormattingState.cpp:
3875         (WebCore::Layout::FormattingState::FormattingState):
3876         * layout/FormattingState.h:
3877         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints):
3878         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const):
3879         * layout/LayoutFormattingState.cpp: Renamed from Source/WebCore/layout/LayoutContext.cpp.
3880         (WebCore::Layout::LayoutState::LayoutState):
3881         (WebCore::Layout::LayoutState::initializeRoot):
3882         (WebCore::Layout::LayoutState::updateLayout):
3883         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
3884         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
3885         (WebCore::Layout::LayoutState::styleChanged):
3886         (WebCore::Layout::LayoutState::markNeedsUpdate):
3887         (WebCore::Layout::LayoutState::formattingStateForBox const):
3888         (WebCore::Layout::LayoutState::establishedFormattingState const):
3889         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
3890         (WebCore::Layout::LayoutState::formattingContext const):
3891         * layout/LayoutFormattingState.h: Renamed from Source/WebCore/layout/LayoutContext.h.
3892         (WebCore::Layout::LayoutState::setInQuirksMode):
3893         (WebCore::Layout::LayoutState::hasDisplayBox const):
3894         (WebCore::Layout::LayoutState::inQuirksMode const):
3895         * layout/Verification.cpp:
3896         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
3897         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
3898         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3899         (WebCore::Layout::verifyAndOutputSubtree):
3900         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
3901         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): Deleted.
3902         * layout/blockformatting/BlockFormattingContext.cpp:
3903         (WebCore::Layout::BlockFormattingContext::layout const):
3904         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3905         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3906         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
3907         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
3908         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
3909         (WebCore::Layout::hasPrecomputedMarginTop):
3910         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3911         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
3912         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3913         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
3914         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3915         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3916         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
3917         * layout/blockformatting/BlockFormattingContext.h:
3918         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3919         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
3920         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3921         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3922         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
3923         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3924         (WebCore::Layout::isStretchedToInitialContainingBlock):
3925         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3926         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):