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