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