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