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