[GStreamer][WebRTC] Add API to enable/disable device mocks
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
2
3         [GStreamer][WebRTC] Add API to enable/disable device mocks
4         https://bugs.webkit.org/show_bug.cgi?id=191699
5
6         This basically us to test MediaStream/WebRTC support without
7         requiring cameras or microphones and is quite useful.
8
9         Also fix the GStreamerAudioMock by:
10           - Stop setting `leaky-upstream` on the GStreamerCapturer queue,
11             this was usefull when we were trying to bring the MediaStream
12             sources inside the main pipeline, it is not the case anymore
13             (and not doable with latest version of LibWebRTC).
14           - Use a 'ticks' wave on the gstreamer audiotestsrc so the test
15             stream is similar to what Apple port does.
16
17         Reviewed by Xabier Rodriguez-Calvar.
18
19         The mocks are already tested and the API is really simple.
20
21         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
22         (WebCore::GStreamerAudioCapturer::createSource):
23         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
24         * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
25         (WebCore::GStreamerCapturer::addSink):
26         * platform/mediastream/gstreamer/GStreamerCapturer.h:
27
28 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
29
30         [GStreamer][MediaStream] Handle track addition and removal
31         https://bugs.webkit.org/show_bug.cgi?id=191599
32
33         Reviewed by Xabier Rodriguez-Calvar.
34
35         Test: fast/mediastream/MediaStream-video-element-remove-track.html
36
37         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
38         (WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
39         (WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
40         (WebCore::webkitMediaStreamSrcFinalize):
41         (WebCore::webkitMediaStreamSrcChangeState):
42         (WebCore::webkit_media_stream_src_init):
43         (WebCore::webkitMediaStreamSrcSetupSrc):
44         (WebCore::webkitMediaStreamSrcAddTrack):
45         (WebCore::webkitMediaStreamSrcRemoveTrackByType):
46         (WebCore::webkitMediaStreamSrcSetStream):
47
48 2018-11-16  Zan Dobersek  <zdobersek@igalia.com>
49
50         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
51         https://bugs.webkit.org/show_bug.cgi?id=191354
52
53         Reviewed by Michael Catanzaro.
54
55         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
56         index validity and, if the index is valid, check for completeness of the
57         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
58         also only retrieve duration for already-complete frames.
59
60         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
61         as that method goes on and decodes image data to determine specific
62         information. The ImageSource class that's querying this information
63         doesn't anticipate this, and doesn't handle the increased memory
64         consumption of the decoded data, leaving MemoryCache in the blind about
65         the image resource's actual amount of consumed memory. ImageSource can
66         instead gracefully handle any incomplete frame by marking the decoding
67         status for this frame as only partial.
68
69         * platform/image-decoders/ScalableImageDecoder.cpp:
70         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
71         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
72         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
73
74 2018-11-16  Antoine Quint  <graouts@apple.com>
75
76         PointerEvents should not require touch event listeners to be registered
77         https://bugs.webkit.org/show_bug.cgi?id=191333
78         <rdar://problem/45857523>
79
80         Reviewed by Dean Jackson.
81
82         Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html
83                pointerevents/ios/pointer-events-prevent-default.html
84
85         * dom/EventNames.h:
86         (WebCore::EventNames::isTouchEventType const):
87         (WebCore::EventNames::touchAndPointerEventNames const):
88         (WebCore::EventNames::touchEventNames const): Deleted.
89         * dom/Node.cpp:
90         (WebCore::Node::moveNodeToNewDocument):
91
92 2018-11-15  Zalan Bujtas  <zalan@apple.com>
93
94         [iOS] Do not get stuck in indeterminate content observation state.
95         https://bugs.webkit.org/show_bug.cgi?id=191719
96
97         Reviewed by Simon Fraser.
98
99         Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in
100         the "can't decide yet if it's a hover or click" state.
101         This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch.
102
103         Test: fast/events/touch/ios/stuck-with-hover-state.html
104
105         * platform/ios/wak/WKContentObservation.cpp:
106         (WebThreadRemoveObservedContentModifier):
107
108 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
109
110         REGRESSION (r238090) Composited iframes that resize from zero don't show
111         https://bugs.webkit.org/show_bug.cgi?id=191733
112         rdar://problem/46107764
113
114         Reviewed by Zalan Bujtas.
115         
116         A zero-sized iframe whose contents are composited should not trigger compositing in the
117         parent document (see code in requiresCompositingForFrame()), but when the <iframe> element
118         was resized without a style change (e.g. because it's width: 100%, height: 100% and the
119         parent resizes), there was no code that triggered a compositing update.
120
121         Fix by having RenderLayer::updateLayerPosition() trigger an update when the size changes,
122         for a RenderWidget whose contents are composited.
123
124         Test: compositing/iframes/resize-from-zero-size.html
125
126         * rendering/RenderLayer.cpp:
127         (WebCore::RenderLayer::updateLayerPosition):
128
129 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
130
131         Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
132         https://bugs.webkit.org/show_bug.cgi?id=158342
133         rdar://problem/26652811
134
135         Reviewed by Zalan Bujtas.
136         
137         Patch partly by Frédéric Wang.
138
139         This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
140         overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
141         created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
142         assertion in debug mode and prevents the user from scrolling the overflow node in release
143         mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
144         the remaining issues by forcing a configuration update after layout in order to ensure that
145         RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
146         composited, trigger a post-layout update that is necessary to check if we need to make it
147         composited when it gains scrollable overflow.
148
149         Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html
150                fast/scrolling/ios/change-scrollability-on-content-resize.html
151
152         * rendering/RenderLayer.cpp:
153         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
154         RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
155         RenderLayerBacking::m_scrollingLayer.
156
157 2018-11-15  Fujii Hironori  <Hironori.Fujii@sony.com>
158
159         [curl] warning: delete called on non-final 'WebCore::CurlDownload' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
160         https://bugs.webkit.org/show_bug.cgi?id=191582
161
162         Reviewed by Alex Christensen.
163
164         No new tests because there's no behaviour change.
165
166         * platform/network/curl/CurlDownload.h: Marked CurlDownload final.
167
168 2018-11-15  Truitt Savell  <tsavell@apple.com>
169
170         Unreviewed, rolling out r238244.
171
172         Caused High Sierra test runs to fail early with 50 crashes and
173         casued 25 API failures.
174
175         Reverted changeset:
176
177         "[css-logical] Implement flow-relative margin, padding and
178         border shorthands"
179         https://bugs.webkit.org/show_bug.cgi?id=188697
180         https://trac.webkit.org/changeset/238244
181
182 2018-11-15  Jer Noble  <jer.noble@apple.com>
183
184         AVKit will set videoGravity to a nil string when building against iosmac
185         https://bugs.webkit.org/show_bug.cgi?id=191573
186
187         Reviewed by Dean Jackson.
188
189         Workaround AVKit behavior by treating nil videoGravity as the default,
190         which is AVLayerVideoGravityResizeAspect.
191
192         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
193         (-[WebAVPlayerLayer setVideoGravity:]):
194
195 2018-11-15  Brent Fulgham  <bfulgham@apple.com>
196
197         [Win] Reduce the use of WKSI library calls: Font Handling
198         https://bugs.webkit.org/show_bug.cgi?id=191701
199         <rdar://problem/46104809>
200
201         Reviewed by Myles C. Maxfield.
202
203         Move the old Windows font handling code out of WKSI to our regular
204         repository. We now handle SPI differently, and don't need to keep
205         these implementations in a separate library. This should also help
206         avoid the somewhat frequent build failures caused when WKSI is not
207         updated in sync with WebKit.
208
209         Tested by existing Windows test cases.
210
211         * platform/graphics/FontCascade.h:
212         * platform/graphics/win/FontCGWin.cpp:
213         (WebCore::FontCascade::drawGlyphs):
214         (WebCore::FontCascade::setFontSmoothingLevel):
215         (WebCore::setCGFontSmoothingStyle):
216         (WebCore::FontCascade::setFontSmoothingStyle):
217         (WebCore::FontCascade::setFontSmoothingContrast):
218         (WebCore::clearTypeContrast):
219         (WebCore::FontCascade::systemFontSmoothingChanged):
220         (WebCore::FontCascade::setCGContextFontRenderingStyle):
221         (WebCore::renderingStyleForFont):
222         (WebCore::FontCascade::getGlyphAdvances):
223         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
224         (WebCore::GlyphPage::fill):
225         * platform/graphics/win/GraphicsContextCGWin.cpp:
226         (WebCore::GraphicsContext::drawFocusRing):
227         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
228         * platform/graphics/win/SimpleFontDataCGWin.cpp:
229         (WebCore::Font::platformWidthForGlyph const):
230         * rendering/RenderMediaControls.cpp:
231         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
232
233 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
234
235         [WebAuthN] Use a real nonce for CTAPHID_INIT
236         https://bugs.webkit.org/show_bug.cgi?id=191533
237         <rdar://problem/46103502>
238
239         Reviewed by Brent Fulgham.
240
241         New tests are added into existing test files.
242
243         * Modules/webauthn/fido/FidoConstants.h:
244
245 2018-11-15  Justin Fan  <justin_fan@apple.com>
246
247         [WebGPU] WebGPUCommandBuffer prototype
248         https://bugs.webkit.org/show_bug.cgi?id=191663
249
250         Reviewed by Dean Jackson.
251
252         Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue).
253
254         Test: webgpu/command-buffers.html
255
256         * CMakeLists.txt:
257         * DerivedSources.make:
258         * Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer.
259         * Modules/webgpu/GPUDevice.cpp:
260         (WebCore::GPUDevice::createCommandBuffer): Added.
261         (WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue.
262         * Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue.
263         (WebCore::GPUDevice::platformDevice const):
264         * Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue.
265         (WebCore::GPUQueue::platformQueue const):
266         * Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h.
267         (WebCore::GPURenderPipeline::platformRenderPipeline const):
268         * Modules/webgpu/GPUShaderModule.h:
269         (WebCore::GPUShaderModule::platformShaderModule const):
270         * Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h.
271         (WebCore::GPUSwapChain::platformLayer const):
272         * Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer.
273         (WebCore::WebGPUCommandBuffer::create):
274         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
275         * Modules/webgpu/WebGPUCommandBuffer.h: Added.
276         * Modules/webgpu/WebGPUCommandBuffer.idl: Added.
277         * Modules/webgpu/WebGPUDevice.cpp:
278         (WebCore::WebGPUDevice::createCommandBuffer const): Added.
279         * Modules/webgpu/WebGPUDevice.h:
280         * Modules/webgpu/WebGPUDevice.idl:
281         * Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer.
282         (WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue.
283         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
284         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
285         (WebCore::GPUDevice::GPUDevice):
286         * Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue.
287         (WebCore::GPUQueue::create):
288         (WebCore::GPUQueue::GPUQueue):
289         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
290         (WebCore::GPURenderPipeline::GPURenderPipeline):
291         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
292         (WebCore::GPUShaderModule::create):
293         (WebCore::GPUShaderModule::GPUShaderModule):
294         * Sources.txt:
295         * SourcesCocoa.txt:
296         * WebCore.xcodeproj/project.pbxproj:
297         * bindings/js/WebCoreBuiltinNames.h:
298
299 2018-11-15  Oriol Brufau  <obrufau@igalia.com>
300
301         [css-logical] Implement flow-relative margin, padding and border shorthands
302         https://bugs.webkit.org/show_bug.cgi?id=188697
303
304         Reviewed by Simon Fraser and Antti Koivisto.
305
306         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
307                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
308                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
309                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
310                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
311                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
312                webexposed/css-properties-as-js-properties.html
313                webexposed/css-properties-behind-flags.html
314                webexposed/css-property-listing.html
315
316         * css/CSSComputedStyleDeclaration.cpp:
317         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
318         Allow the new properties to serialize their computed value.
319
320         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
321         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
322         * css/CSSComputedStyleDeclaration.h:
323         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
324         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
325         shorthands.
326
327         * css/CSSProperties.json:
328         Add the new properties behind the CSSLogicalEnabled runtime flag.
329
330         * css/CSSStyleDeclaration.cpp:
331         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
332         Prevent CSS properties disabled behind a runtime flag from being exposed in
333         style declarations.
334
335         * css/StyleProperties.cpp:
336         (WebCore::StyleProperties::getPropertyValue const):
337         Allow the new properties to serialize their specified value.
338
339         (WebCore::StyleProperties::get2Values const):
340         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
341
342         (WebCore::StyleProperties::borderPropertyValue const):
343         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
344         corresponding to width, style and color.
345
346         (WebCore::MutableStyleProperties::setProperty):
347         Prevent CSS properties disabled behind a runtime flag from being set a value.
348
349         (WebCore::StyleProperties::asText const):
350         Allow the new properties to be serialized in cssText.
351         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
352         and serialize the longhands instead. Note that there could be another shorthand
353         available which is enabled, but a proper solution would require bug 190496.
354
355         * css/StyleProperties.h:
356         Update declarations of borderPropertyValue and get2Values.
357
358         * css/makeprop.pl:
359         (addProperty):
360         Add isEnabledCSSProperty function for checking that a CSS property is not
361         disabled behind a runtime flag.
362
363         * css/parser/CSSPropertyParser.cpp:
364         (WebCore::cssPropertyID):
365         Prevent CSS properties disabled behind a runtime flag from being exposed in
366         computed styles.
367
368         (WebCore::CSSPropertyParser::addProperty):
369         Prevent CSS properties disabled behind a runtime flag from being set a value.
370
371         (WebCore::CSSPropertyParser::consumeBorder):
372         Change consumeBorder to provide the caller with the parsed values instead of
373         setting properties. Then the caller can decide to which properties the values
374         should be set, and whether border-image should be reset or not.
375
376         (WebCore::CSSPropertyParser::consume2ValueShorthand):
377         (WebCore::CSSPropertyParser::consume4ValueShorthand):
378         Rename consume4Values to consume4ValueShorthand, and add analogous
379         consume2ValueShorthand for parsing shorthands with two longhands.
380
381         (WebCore::CSSPropertyParser::parseShorthand):
382         Allow the new properties to be parsed.
383
384         * css/parser/CSSPropertyParser.h:
385         Update declarations of consumeBorder, consume2ValueShorthand and
386         consume4ValueShorthand.
387
388         * inspector/agents/InspectorCSSAgent.cpp:
389         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
390         Prevent CSS properties disabled behind a runtime flag from being exposed in
391         the CSS inspector tool.
392
393         * page/RuntimeEnabledFeatures.h:
394         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
395         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
396         Add the CSSLogicalEnabled runtime flag.
397
398 2018-11-15  Truitt Savell  <tsavell@apple.com>
399
400         Unreviewed, rolling out r238220.
401
402         Introduced failing tests to iOS and is slowing down EWS
403
404         Reverted changeset:
405
406         "[css-grid] Consider scrollbars in
407         populateGridPositionsForDirection()"
408         https://bugs.webkit.org/show_bug.cgi?id=191656
409         https://trac.webkit.org/changeset/238220
410
411 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
412
413         [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
414         https://bugs.webkit.org/show_bug.cgi?id=191522
415
416         Reviewed by Brent Fulgham.
417
418         Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
419         https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
420
421         Covered by existing tests.
422
423         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
424         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
425
426 2018-11-15  Ross Kirsling  <ross.kirsling@sony.com>
427
428         DragImage should have a complete default implementation
429         https://bugs.webkit.org/show_bug.cgi?id=191666
430
431         Reviewed by Dean Jackson.
432
433         Move WPE's stub implementation down into the base implementation file.
434
435         * SourcesWPE.txt:
436         * platform/DragImage.cpp:
437         (WebCore::dragImageSize):
438         (WebCore::deleteDragImage):
439         (WebCore::scaleDragImage):
440         (WebCore::dissolveDragImageToFraction):
441         (WebCore::createDragImageFromImage):
442         (WebCore::createDragImageIconForCachedImageFilename):
443         (WebCore::createDragImageForLink):
444         * platform/wpe/DragImageWPE.cpp: Removed.
445
446 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
447
448         [WebAuthN] UserHandle can be null
449         https://bugs.webkit.org/show_bug.cgi?id=191521
450
451         Reviewed by Alex Christensen.
452
453         According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f.
454         UserHandle can now be null.
455
456         Covered by existing tests.
457
458         * Modules/webauthn/AuthenticatorAssertionResponse.h:
459         (WebCore::AuthenticatorAssertionResponse::create):
460         (WebCore::AuthenticatorAssertionResponse::userHandle const):
461         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
462         * Modules/webauthn/AuthenticatorAssertionResponse.idl:
463         * Modules/webauthn/PublicKeyCredential.cpp:
464         (WebCore::PublicKeyCredential::tryCreate):
465         * Modules/webauthn/PublicKeyCredentialData.h:
466         (WebCore::PublicKeyCredentialData::encode const):
467         (WebCore::PublicKeyCredentialData::decode):
468         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
469         (fido::readCTAPGetAssertionResponse):
470
471 2018-11-15  Youenn Fablet  <youenn@apple.com>
472
473         Modernize RTCPeerConnection handling of pendingActivity
474         https://bugs.webkit.org/show_bug.cgi?id=191661
475
476         Reviewed by Eric Carlson.
477
478         makePendingActivity is the modern way to handle set/unset of pending activity.
479         No change of behavior.
480
481         * Modules/mediastream/RTCPeerConnection.cpp:
482         (WebCore::RTCPeerConnection::create):
483         (WebCore::RTCPeerConnection::doStop):
484         * Modules/mediastream/RTCPeerConnection.h:
485
486 2018-11-15  Keith Rollin  <krollin@apple.com>
487
488         Delete old .xcfilelist files
489         https://bugs.webkit.org/show_bug.cgi?id=191669
490         <rdar://problem/46081994>
491
492         Reviewed by Chris Dumez.
493
494         .xcfilelist files were created and added to the Xcode project files in
495         https://trac.webkit.org/changeset/238008/webkit. However, they caused
496         build issues and they were removed from the Xcode projects in
497         https://trac.webkit.org/changeset/238055/webkit. This check-in removes
498         the files from the repository altogether. They'll ultimately be
499         replaced with new files with names that indicate whether the
500         associated files are inputs to the Run Script phase or are files
501         created by the Run Script phase.
502
503         No new tests -- no changed functionality.
504
505         * DerivedSources.xcfilelist: Removed.
506         * UnifiedSources.xcfilelist: Removed.
507
508 2018-11-15  Youenn Fablet  <youenn@apple.com>
509
510         Update RTCPeerConnection JS built-ins to be closer to specWe
511         https://bugs.webkit.org/show_bug.cgi?id=191665
512
513         Reviewed by Eric Carlson.
514
515         Simplify JS built-ins since we no longer need to support callback versions of the API.
516         Make sure to have the right number of parameters in the JS built-in functions.
517         Make some simplification to the code.
518         Covered by existing tests and rebased test.
519
520         * Modules/mediastream/RTCPeerConnection.js:
521         (createOffer):
522         (createAnswer):
523         (setLocalDescription):
524         (setRemoteDescription):
525         (addIceCandidate):
526         * Modules/mediastream/RTCPeerConnectionInternals.js:
527         (enqueueOperation):
528         (callbacksAndDictionaryOverload): Deleted.
529
530 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
531
532         REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
533         https://bugs.webkit.org/show_bug.cgi?id=191673
534         rdar://problem/46083440
535
536         Reviewed by Antti Koivisto.
537
538         Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
539         tree for every Frame. They get re-attached on tab show, and for subframes this involves
540         the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
541         
542         The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
543         fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
544         layer configuration update that gets iframe layers parented.
545         
546         This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
547         patch will optimize this, and add a layout test.
548
549         * rendering/RenderLayerCompositor.cpp:
550         (WebCore::RenderLayerCompositor::layerStyleChanged):
551
552 2018-11-15  Zalan Bujtas  <zalan@apple.com>
553
554         [LFC][IFC] Skip non-inflow boxes while splitting the inline runs.
555         https://bugs.webkit.org/show_bug.cgi?id=191690
556
557         Reviewed by Antti Koivisto.
558
559         Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context.
560
561         * layout/Verification.cpp:
562         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
563         * layout/inlineformatting/InlineFormattingContext.cpp:
564         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
565
566 2018-11-15  Zalan Bujtas  <zalan@apple.com>
567
568         [LFC] FormattingContext base class should not declare computeStaticPosition.
569         https://bugs.webkit.org/show_bug.cgi?id=191683
570
571         Reviewed by Antti Koivisto.
572
573         Apparently only BlockFormattingContext uses it.
574
575         * layout/FormattingContext.h:
576         * layout/blockformatting/BlockFormattingContext.h:
577         * layout/inlineformatting/InlineFormattingContext.cpp:
578         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted.
579         * layout/inlineformatting/InlineFormattingContext.h:
580
581 2018-11-14  Zalan Bujtas  <zalan@apple.com>
582
583         [LFC][IFC] Add support for in-flow positioned inline boxes.
584         https://bugs.webkit.org/show_bug.cgi?id=191672
585
586         Reviewed by Antti Koivisto.
587
588         We might offset the in-flow positioned runs differently once runs are moved over to the display tree.
589
590         Test: fast/inline/simple-inline-inflow-positioned.html
591
592         * layout/Verification.cpp:
593         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
594         * layout/inlineformatting/InlineFormattingContext.cpp:
595         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const):
596         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
597         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
598         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
599         * layout/inlineformatting/InlineFormattingContext.h:
600         * layout/inlineformatting/InlineRun.h:
601         (WebCore::Layout::InlineRun::moveVertically):
602         * layout/layouttree/LayoutTreeBuilder.cpp:
603         (WebCore::Layout::outputInlineRuns):
604
605 2018-11-15  Thibault Saunier  <tsaunier@igalia.com>
606
607         [GStreamer][WebRTC] Add support for sending silence or silencing an incoming track
608         https://bugs.webkit.org/show_bug.cgi?id=191631
609
610         Reviewed by Xabier Rodriguez-Calvar.
611
612         This will be tested once webkit.org/b/186933 is implemented.
613
614         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
615         (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
616         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
617         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
618
619 2018-11-15  Antti Koivisto  <antti@apple.com>
620
621         REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out
622         https://bugs.webkit.org/show_bug.cgi?id=191642
623
624         Reviewed by Zalan Bujtas.
625
626         Invalidate access key map even when thorttling style recalcs.
627
628         * dom/Document.cpp:
629         (WebCore::Document::scheduleStyleRecalc):
630
631 2018-11-15  Antti Koivisto  <antti@apple.com>
632
633         Remove fonts from CSSFontFaceSet safely
634         https://bugs.webkit.org/show_bug.cgi?id=191676
635
636         Reviewed by Zalan Bujtas.
637
638         Test: fast/text/font-face-set-remove-safely.html
639
640         * css/CSSFontFaceSet.cpp:
641         (WebCore::CSSFontFaceSet::remove):
642
643 2018-11-15  Manuel Rego Casasnovas  <rego@igalia.com>
644
645         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
646         https://bugs.webkit.org/show_bug.cgi?id=191656
647
648         Reviewed by Javier Fernandez.
649
650         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
651         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
652         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
653
654         The patch modifies the method so it takes into account scrollbar size
655         in order to compute the position of the columns/rows depending on the direction and the writing mode.
656
657         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
658                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
659                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
660
661         * rendering/RenderGrid.cpp:
662         (WebCore::RenderGrid::populateGridPositionsForDirection):
663
664 2018-11-14  Keith Rollin  <krollin@apple.com>
665
666         Move scripts for Derived and Unified Sources to external files
667         https://bugs.webkit.org/show_bug.cgi?id=191670
668         <rdar://problem/46082278>
669
670         Reviewed by Keith Miller.
671
672         Move the scripts in the Generate Derived Sources and Generate Unified
673         Sources Run Script phases from the Xcode projects to external shell
674         script files. Then invoke those scripts from the Run Script phases.
675         This refactoring is being performed to support later work that will
676         invoke these scripts in other contexts.
677
678         The scripts were maintained as-is when making the move. I did a little
679         reformatting and added 'set -e' to the top of each file, but that's
680         it.
681
682         No new tests -- no changed functionality.
683
684         * Scripts/generate-derived-sources.sh: Added.
685         * Scripts/generate-unified-sources.sh: Added.
686         * WebCore.xcodeproj/project.pbxproj:
687
688 2018-11-14  Keith Rollin  <krollin@apple.com>
689
690         Fix #end vs. #endif typo.
691         https://bugs.webkit.org/show_bug.cgi?id=191668
692         <rdar://problem/46081704>
693
694         Reviewed by Alexey Proskuryakov.
695
696         Source/WebCore/SourcesCocoa.txt had a #end that should have been a
697         #endif. Fix this, an add a check to generate-unified-source-bundles.rb
698         to detect similar typos.
699
700         No new tests -- no changed functionality.
701
702         * SourcesCocoa.txt:
703
704 2018-11-14  Keith Rollin  <krollin@apple.com>
705
706         Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt
707         https://bugs.webkit.org/show_bug.cgi?id=191667
708         <rdar://problem/46081286>
709
710         Reviewed by Eric Carlson.
711
712         VideoFullscreenLayerManager.mm no longer exists.
713
714         No new tests -- No changed functionality.
715
716         * SourcesCocoa.txt:
717
718 2018-11-14  Timothy Hatcher  <timothy@apple.com>
719
720         Enabled dark mode CSS support by default.
721         https://bugs.webkit.org/show_bug.cgi?id=191609
722         rdar://problem/46046861
723
724         Reviewed by Megan Gardner.
725
726         * page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true.
727
728 2018-11-14  Timothy Hatcher  <timothy@apple.com>
729
730         Default the view background color and text color to different values when in dark mode.
731         https://bugs.webkit.org/show_bug.cgi?id=191607
732         rdar://problem/46045854
733
734         Reviewed by Dean Jackson.
735
736         Test: css-dark-mode/default-colors.html
737
738         * css/html.css:
739         (html): Set color: text on macOS.
740         * dom/Document.cpp:
741         (WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor().
742         * editing/EditingStyle.cpp:
743         (WebCore::caretColorFromStyle): Added.
744         (WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for
745         caret-color directly since removeEquivalentProperties fails with semantic colors.
746         (WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color
747         directly since removeEquivalentProperties fails with semantic colors.
748         * page/Frame.cpp:
749         (WebCore::Frame::createView): Drop backgroundColor.
750         * page/Frame.h:
751         * page/FrameView.cpp:
752         (WebCore::FrameView::recalculateBaseBackgroundColor): Added.
753         (WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument.
754         Calculate the backgroundColor based on the transparent argument only.
755         * page/FrameView.h:
756         * platform/graphics/Color.h:
757         (WebCore::equalIgnoringSemanticColor): Added for EditingStyle.
758         * rendering/RenderBox.cpp:
759         (WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor().
760         * rendering/RenderLayerBacking.cpp:
761         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor()
762         since it ignores the semantic color flag.
763         * testing/Internals.cpp:
764         (WebCore::Internals::setViewIsTransparent): Drop backgroundColor.
765         (WebCore::Internals::viewBaseBackgroundColor): Added.
766         * testing/Internals.h:
767         * testing/Internals.idl: Added viewBaseBackgroundColor.
768
769 2018-11-14  Justin Fan  <justin_fan@apple.com>
770
771         [WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
772         https://bugs.webkit.org/show_bug.cgi?id=191383
773
774         Reviewed by Dean Jackson.
775
776         Covered by existing WebGPU tests introduced in original patch.
777
778         * Modules/webgpu/GPUDevice.h:
779         * Modules/webgpu/GPUPipelineStageDescriptor.h:
780         * Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member.
781         (): Refactored into enum class.
782         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction.
783         (WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member.
784         * Modules/webgpu/GPUShaderModule.h:
785         * Modules/webgpu/WebGPUDevice.cpp:
786         (WebCore::WebGPUDevice::createRenderPipeline const):
787         * Modules/webgpu/WebGPUShaderModule.h:
788         (WebCore::WebGPUShaderModule::module const):
789         * Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL.
790         * Modules/webgpu/cocoa/GPURenderPipeline.h:
791         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
792         (WebCore::setFunctionsForPipelineDescriptor):
793         (WebCore::GPURenderPipeline::create):
794         * Modules/webgpu/cocoa/GPUSwapChain.h:
795         * WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase.
796
797 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
798
799         Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
800         https://bugs.webkit.org/show_bug.cgi?id=191612
801
802         Reviewed by Matt Baker.
803
804         * inspector/InspectorController.cpp:
805         (WebCore::InspectorController::connectFrontend):
806         (WebCore::InspectorController::disconnectFrontend):
807         (WebCore::InspectorController::show):
808         * inspector/InspectorController.h:
809         * inspector/WorkerInspectorController.cpp:
810         (WebCore::WorkerInspectorController::connectFrontend):
811         (WebCore::WorkerInspectorController::disconnectFrontend):
812         * page/PageDebuggable.cpp:
813         (WebCore::PageDebuggable::connect):
814         (WebCore::PageDebuggable::disconnect):
815         * page/PageDebuggable.h:
816         * testing/Internals.cpp:
817         (WebCore::InspectorStubFrontend::InspectorStubFrontend):
818         (WebCore::InspectorStubFrontend::closeWindow):
819         * workers/service/context/ServiceWorkerDebuggable.cpp:
820         (WebCore::ServiceWorkerDebuggable::connect):
821         (WebCore::ServiceWorkerDebuggable::disconnect):
822         * workers/service/context/ServiceWorkerDebuggable.h:
823         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
824         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
825         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
826         * workers/service/context/ServiceWorkerInspectorProxy.h:
827
828 2018-11-14  Timothy Hatcher  <timothy@apple.com>
829
830         Update prefers-color-scheme media query matching based on GitHub issue #3278.
831         https://bugs.webkit.org/show_bug.cgi?id=191654
832         rdar://problem/46074307
833
834         Reviewed by Simon Fraser.
835
836         Test: css-dark-mode/prefers-color-scheme.html
837
838         * css/MediaQueryEvaluator.cpp:
839         (WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
840         for `no-preference` since there is no macOS option for no user preference.
841         * css/MediaQueryExpression.cpp:
842         (WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.
843
844 2018-11-14  Devin Rousso  <drousso@apple.com>
845
846         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
847         https://bugs.webkit.org/show_bug.cgi?id=191628
848
849         Reviewed by Dean Jackson.
850
851         Updated existing test: inspector/model/recording.html
852
853         * inspector/InspectorCanvas.h:
854         * inspector/InspectorCanvas.cpp:
855         (WebCore::InspectorCanvas::indexForData):
856         (WebCore::InspectorCanvas::buildInitialState):
857         (WebCore::InspectorCanvas::buildAction):
858         Drive-by: prevent de-duplicated objects from being destroyed while recording.
859
860 2018-11-14  Stephan Szabo  <stephan.szabo@sony.com>
861
862         [Win] Compile Service Worker support
863         https://bugs.webkit.org/show_bug.cgi?id=191409
864
865         Reviewed by Youenn Fablet.
866
867         Fix compilation errors when ENABLE(SERVICE_WORKER)
868         on Windows with clang-cl. Clang on dllexport
869         platforms does not support specifying the
870         dllexport on both a class and members of the class
871         and unistd.h isn't provided but also appeared to
872         not be used.
873
874         No new tests, should be covered by existing tests.
875
876         * workers/service/ServiceWorkerProvider.h:
877         * workers/service/context/SWContextManager.cpp:
878
879 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
880
881         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
882         https://bugs.webkit.org/show_bug.cgi?id=191494
883         <rdar://problem/45469854>
884
885         Reviewed by Devin Rousso.
886
887         * inspector/InspectorClient.h:
888         (WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const):
889         Provide a hook so that a client may wish to allow direct remote inspection of the Page.
890         This is used by WebKitLegacy only.
891
892         * page/Page.cpp:
893         (Page::Page):
894         Only enable the PageDebuggable if the client wishes remote inspection of the Page directly.
895         This is used by WebKitLegacy only.
896
897         * inspector/InspectorController.cpp:
898         (WebCore::InspectorController::connectFrontend):
899         * inspector/InspectorController.h:
900         * page/PageDebuggable.cpp:
901         (WebCore::PageDebuggable::connect):
902         (WebCore::PageDebuggable::disconnect):
903         * page/PageDebuggable.h:
904         When a frontend connects, always enable the developer extras for the Page.
905         This is pretty much only for the remote path, which allows inspection if developer
906         extras were not already enabled (iOS). This simplifies the logic, and toggling
907         developer extras after it was already enabled is not really important.
908
909 2018-11-14  Per Arne Vollan  <pvollan@apple.com>
910
911         REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
912         https://bugs.webkit.org/show_bug.cgi?id=190884
913
914         Reviewed by Dean Jackson.
915
916         Only notify display refresh monitors with matching display ID.
917
918         Test: fast/animation/request-animation-frame-in-two-pages.html
919
920         * platform/graphics/DisplayRefreshMonitorManager.cpp:
921         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
922         * platform/graphics/DisplayRefreshMonitorManager.h:
923
924 2018-11-14  Youenn Fablet  <youenn@apple.com>
925
926         Convert libwebrtc error types to DOM exceptions
927         https://bugs.webkit.org/show_bug.cgi?id=191590
928
929         Reviewed by Alex Christensen.
930
931         Make use of overloaded callback method that provides an error type.
932         This type is then used to create a DOM exception with the correct type.
933         Covered by existing tests.
934
935         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
936         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
937         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
938         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
939         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
940         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
941         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
942         (WebCore::toExceptionCode):
943
944 2018-11-14  Youenn Fablet  <youenn@apple.com>
945
946         Allow to remove MediaStreamPrivate observers when iterating over observers
947         https://bugs.webkit.org/show_bug.cgi?id=187256
948
949         Reviewed by Eric Carlson.
950
951         Migrate the observer list from a Vector to a HashSet.
952         This is more robust to multiple observing and keeping of order of observers is not required.
953         Copy the set of observers to a vector before iterating over it.
954         This allows to remove an observer while iterating, which is now used in UserMediaRequest.
955
956         Covered by existing tests.
957
958         * Modules/mediastream/UserMediaRequest.cpp:
959         (WebCore::UserMediaRequest::mediaStreamIsReady):
960         * platform/mediastream/MediaStreamPrivate.cpp:
961         (WebCore::MediaStreamPrivate::addObserver):
962         (WebCore::MediaStreamPrivate::removeObserver):
963         (WebCore::MediaStreamPrivate::forEachObserver const):
964         (WebCore::MediaStreamPrivate::updateActiveState):
965         (WebCore::MediaStreamPrivate::addTrack):
966         (WebCore::MediaStreamPrivate::removeTrack):
967         (WebCore::MediaStreamPrivate::characteristicsChanged):
968         * platform/mediastream/MediaStreamPrivate.h:
969
970 2018-11-14  Youenn Fablet  <youenn@apple.com>
971
972         Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
973         https://bugs.webkit.org/show_bug.cgi?id=191603
974
975         Reviewed by Chris Dumez.
976
977         Make sure to check that the sender peer connection backend is matching.
978         Covered by rebased WPT test.
979
980         * Modules/mediastream/RTCPeerConnection.cpp:
981         (WebCore::RTCPeerConnection::removeTrack):
982         * Modules/mediastream/RTCRtpSender.cpp:
983         (WebCore::RTCRtpSender::isCreatedBy const):
984         * Modules/mediastream/RTCRtpSender.h:
985
986 2018-11-14  Fujii Hironori  <Hironori.Fujii@sony.com>
987
988         [curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
989         https://bugs.webkit.org/show_bug.cgi?id=191620
990
991         Reviewed by Alex Christensen.
992
993         Remove a abstract class CookieJarCurl which is not needed anymore.
994         And, rename CookieJarCurlDatabase to CookieJarCurl.
995
996         No new tests because there's no behaviour change in WebCore.
997
998         * platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
999         * platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
1000         * platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
1001         * platform/network/curl/CookieJarCurlDatabase.h: Removed.
1002         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1003         (WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
1004
1005 2018-11-14  Christopher Reid  <chris.reid@sony.com>
1006
1007         [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
1008         https://bugs.webkit.org/show_bug.cgi?id=191606
1009
1010         Reviewed by Michael Catanzaro.
1011
1012         No behavior change.
1013
1014         Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
1015
1016         * platform/wpe/PlatformKeyboardEventWPE.cpp:
1017         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
1018         (WebCore::PlatformKeyboardEvent::singleCharacterString):
1019
1020 2018-11-13  Zalan Bujtas  <zalan@apple.com>
1021
1022         [LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
1023         https://bugs.webkit.org/show_bug.cgi?id=191623
1024
1025         Reviewed by Antti Koivisto.
1026
1027         This patch expands the breaking behaviour to support separate start/end breaks.
1028
1029         <span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
1030
1031         input to line breaking -> <parent start middle end parent>
1032         output of line breaking (considering infinite constraint) -> <parent start middle end parent>
1033         due to padding, final runs -> <parent><start middle end><parent>
1034
1035         "parent" -> n/a
1036         "start" -> BreakAtStart
1037         " middle " -> n/a
1038         "end" -> BreakAtEnd
1039         "parent" -> n/a
1040
1041         Another example:
1042         <span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
1043
1044         line breaking -> <parent start middle end parent>
1045         due to padding-right, final runs -> <parent start middle end><parent>
1046
1047         "parent" -> n/a
1048         "start" -> n/a
1049         " middle " -> n/a
1050         "end" -> BreakAtEnd
1051         "parent" -> n/a
1052
1053         * layout/inlineformatting/InlineFormattingContext.cpp:
1054         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1055         (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
1056         (WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
1057         * layout/inlineformatting/InlineFormattingContext.h:
1058         * layout/inlineformatting/InlineFormattingState.cpp:
1059         (WebCore::Layout::InlineFormattingState::detachingRules const):
1060         * layout/inlineformatting/InlineFormattingState.h:
1061         (WebCore::Layout::InlineFormattingState::lastInlineItem const):
1062         (WebCore::Layout::InlineFormattingState::addDetachingRule):
1063
1064 2018-11-14  Youenn Fablet  <youenn@apple.com>
1065
1066         Add support for RTCRtpCodecParameters.sdpFmtpLine
1067         https://bugs.webkit.org/show_bug.cgi?id=191591
1068
1069         Reviewed by Eric Carlson.
1070
1071         Covered by rebased test.
1072
1073         * Modules/mediastream/RTCRtpCodecParameters.h:
1074         * Modules/mediastream/RTCRtpCodecParameters.idl:
1075         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1076         (WebCore::toRTCCodecParameters):
1077
1078 2018-11-14  Youenn Fablet  <youenn@apple.com>
1079
1080         Add support for transport and peerConnection stats
1081         https://bugs.webkit.org/show_bug.cgi?id=191592
1082
1083         Reviewed by Alex Christensen.
1084
1085         Covered by rebased tests.
1086
1087         * Modules/mediastream/RTCStatsReport.h:
1088         (WebCore::RTCStatsReport::TransportStats::TransportStats):
1089         (WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
1090         * Modules/mediastream/RTCStatsReport.idl:
1091         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
1092         (WebCore::fillRTCTransportStats):
1093         (WebCore::fillRTCPeerConnectionStats):
1094         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
1095
1096 2018-11-14  Ali Juma  <ajuma@chromium.org>
1097
1098         Transform of composited layer not updated when layer also needs repaint
1099         https://bugs.webkit.org/show_bug.cgi?id=191598
1100
1101         Reviewed by Simon Fraser.
1102
1103         Trigger a compositing geometry update whenever a RenderLayer's transform changes,
1104         even when other parts of its style have changed in a way that produces a
1105         StyleDifference greater than RecompositeLayer.
1106
1107         Test: compositing/geometry/transform-and-repaint-updates-geometry.html
1108
1109         * rendering/RenderLayerCompositor.cpp:
1110         (WebCore::RenderLayerCompositor::layerStyleChanged):
1111
1112 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
1113
1114         [WebAuthN] Support CTAP HID authenticators on macOS
1115         https://bugs.webkit.org/show_bug.cgi?id=188623
1116         <rdar://problem/43353777>
1117
1118         Reviewed by Brent Fulgham and Chris Dumez.
1119
1120         This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore
1121         any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic
1122         dependency. Also, it adds a hack to temporarily deal with nullable userhandle.
1123
1124         Tests: http/wpt/webauthn/ctap-hid-failure.https.html
1125                http/wpt/webauthn/ctap-hid-success.https.html
1126                http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
1127                http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
1128                http/wpt/webauthn/public-key-credential-create-success-hid.https.html
1129                http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html
1130                http/wpt/webauthn/public-key-credential-get-failure-hid.https.html
1131                http/wpt/webauthn/public-key-credential-get-success-hid.https.html
1132
1133         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
1134         (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted.
1135         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
1136         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1137         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
1138         (fido::readCTAPGetAssertionResponse):
1139         * Modules/webauthn/fido/FidoConstants.h:
1140
1141 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1142
1143         [WebRTC] Provide default implementation of LibWebRTCProvider
1144         https://bugs.webkit.org/show_bug.cgi?id=191611
1145
1146         Reviewed by Michael Catanzaro.
1147
1148         Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
1149
1150         * PlatformWin.cmake:
1151         * platform/GStreamer.cmake:
1152         * platform/SourcesGLib.txt:
1153         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1154         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1155         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
1156         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
1157         * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
1158
1159 2018-11-13  Timothy Hatcher  <timothy@apple.com>
1160
1161         Use a light scrollbar for transparent web views in dark mode.
1162         https://bugs.webkit.org/show_bug.cgi?id=191559
1163         rdar://problem/46000489
1164
1165         Reviewed by Dean Jackson.
1166
1167         Test: css-dark-mode/supported-color-schemes-scrollbar.html
1168
1169         * css/CSSProperties.json: Marked supported-color-schemes as a custom Value.
1170         * css/StyleBuilderCustom.h:
1171         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes):
1172         * editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance().
1173         (WebCore::createFragment):
1174         * inspector/InspectorOverlay.cpp:
1175         (WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance().
1176         * page/FrameView.cpp:
1177         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for
1178         transparent web views in dark mode.
1179         (WebCore::FrameView::rendererForSupportedColorSchemes const): Added.
1180         Return the body for document element renderer.
1181         (WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes.
1182         (WebCore::FrameView::styleColorOptions const): Added. Ditto.
1183         * page/FrameView.h:
1184         * rendering/style/RenderStyle.cpp:
1185         (WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes.
1186         * rendering/style/RenderStyle.h:
1187         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added.
1188         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added.
1189         (WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes.
1190         * svg/graphics/SVGImage.cpp:
1191         (WebCore::SVGImage::draw): Use FrameView's useDarkAppearance().
1192         * testing/Internals.cpp:
1193         (WebCore::Internals::setViewIsTransparent): Added.
1194         (WebCore::Internals::scrollbarOverlayStyle const): Added.
1195         * testing/Internals.h:
1196         * testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle.
1197
1198 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1199
1200         [AppleWin] Unreviewed build fix after r238108.
1201
1202         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1203         (printLayer):
1204         (PlatformCALayerWin::embeddedViewID const):
1205         * platform/graphics/ca/win/PlatformCALayerWin.h:
1206
1207 2018-11-13  Youenn Fablet  <youenn@apple.com>
1208
1209         RTCPeerConnection.getTransceivers is not always exposing all transceivers
1210         https://bugs.webkit.org/show_bug.cgi?id=191589
1211
1212         Reviewed by Eric Carlson.
1213
1214         Implement the collect transceiver algorithm using libwebrtc backend.
1215         Call this algorithm everytime transceivers are retrieved from JS.
1216         For Plan B, make this a no-op as this is not supported.
1217         Introduce senders/receivers/transceivers getters where we just look at already created transceivers.
1218
1219         Covered by existing and rebased tests.
1220
1221         * Modules/mediastream/PeerConnectionBackend.h:
1222         (WebCore::PeerConnectionBackend::collectTransceivers):
1223         * Modules/mediastream/RTCPeerConnection.cpp:
1224         (WebCore::RTCPeerConnection::getSenders const):
1225         (WebCore::RTCPeerConnection::getReceivers const):
1226         (WebCore::RTCPeerConnection::getTransceivers const):
1227         * Modules/mediastream/RTCPeerConnection.h:
1228         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1229         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
1230         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1231         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1232         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1233         (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
1234         (WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers):
1235         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
1236         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
1237         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1238
1239 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1240
1241         [iOS] Do not show selection UI for editable elements with opacity near zero
1242         https://bugs.webkit.org/show_bug.cgi?id=191442
1243         <rdar://problem/45958625>
1244
1245         Reviewed by Simon Fraser.
1246
1247         Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html
1248                editing/selection/ios/hide-selection-after-hiding-contenteditable.html
1249                editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html
1250                editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html
1251                editing/selection/ios/hide-selection-in-hidden-contenteditable.html
1252
1253         * rendering/RenderObject.cpp:
1254         (WebCore::RenderObject::isTransparentRespectingParentFrames const):
1255
1256         Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent
1257         frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01).
1258         Opacity on ancestor elements is applied multiplicatively.
1259
1260         * rendering/RenderObject.h:
1261
1262 2018-11-13  Eric Carlson  <eric.carlson@apple.com>
1263
1264         [MediaStream] Observer AVCaptureDevice "suspended" property
1265         https://bugs.webkit.org/show_bug.cgi?id=191587
1266         <rdar://problem/46030598>
1267
1268         Reviewed by Youenn Fablet.
1269
1270         No new tests, AVCapture can only be tested manually.
1271
1272         * platform/mediastream/mac/AVCaptureDeviceManager.h:
1273         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1274         (WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes"
1275         the first time the device list is scanned.
1276         (WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't
1277         change device availability.
1278         (WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all 
1279         devices and add them to the cached list.
1280         (WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above.
1281         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of
1282         devices.
1283         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices.
1284         (WebCore::AVCaptureDeviceManager::registerForDeviceNotifications):
1285         (-[WebCoreAVCaptureDeviceManagerObserver disconnect]):
1286         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]):
1287         (-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]):
1288         (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted.
1289         (WebCore::AVCaptureDeviceManager::deviceConnected): Deleted.
1290         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted.
1291         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted.
1292         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted.
1293
1294         * platform/mediastream/mac/AVVideoCaptureSource.h:
1295         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1296         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate")
1297         and "suspended".
1298         (WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended".
1299         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
1300         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
1301
1302 2018-11-13  Devin Rousso  <drousso@apple.com>
1303
1304         Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers
1305         https://bugs.webkit.org/show_bug.cgi?id=191597
1306
1307         Reviewed by Joseph Pecoraro.
1308
1309         When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched,
1310         meaning that we may try to fetch in situations previously unexpected.
1311
1312         * platform/network/cocoa/ResourceResponseCocoa.mm:
1313         (WebCore::ResourceResponse::platformCertificateInfo const):
1314
1315 2018-11-13  Timothy Hatcher  <timothy@apple.com>
1316
1317         Treat supported-color-schemes as the second highest priority property.
1318         https://bugs.webkit.org/show_bug.cgi?id=191556
1319         rdar://problem/46000076
1320
1321         Reviewed by Dean Jackson.
1322
1323         Test: css-dark-mode/supported-color-schemes-priority.html
1324
1325         * css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment.
1326         * css/StyleResolver.cpp:
1327         (WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes
1328         after -webkit-ruby-position, before other properties, so it can affect resolved colors.
1329
1330 2018-11-13  Charlie Turner  <cturner@igalia.com>
1331
1332         [EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes.
1333         https://bugs.webkit.org/show_bug.cgi?id=191316
1334
1335         Reviewed by Xabier Rodriguez-Calvar.
1336
1337         Another preparation in patch getting ready to move the decryption
1338         logic behind the CDMInstance and out of the GStreamer decryptors
1339         themselves. The first step taken here is to arrange for the
1340         instances to always be available in the decryptors when they need
1341         to decrypt content.
1342
1343         In doing so, there were a number of hairy bits of code that could
1344         use some abstraction, so the opportunity was taken to do that as
1345         well.
1346
1347         Covered by tests in media/encrypted-media and
1348         imported/w3c/web-platform-tests/encrypted-media.
1349
1350         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1351         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove
1352         drm-key-needed since it was not being used anywhere.
1353         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1354         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1355         Factor out the parsing of decryption system information from
1356         GStreamer, since it was not clear what that code was doing unless
1357         you squinted pretty hard. Also remove the duplicated
1358         initialization-data-encountered posting.
1359         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
1360         Refactored to make it a more general method and usable in more
1361         situations. It now has an optional to stop it from eliding init
1362         datas for a different key system. This is required the first time
1363         we post them, since if a CDM instance has already been set, and if
1364         the stream init datas are for different systems, we ended up never
1365         posting an encrypted event.
1366         (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
1367         Actually send a CDMInstance now when in regular playback mode.
1368         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
1369         Remove m_needToSendCredentials, it was not being used.
1370         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
1371         Refactored to use the new initializationDataEncountered.
1372         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
1373         Log the waiting state, since it was currently not clear what that
1374         logging message was even telling you!
1375         (WebCore::extractEventsAndSystemsFromMessage): Deleted.
1376         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1377         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
1378         (WebCore::InitData::InitData): New class that encapsulates both
1379         single instantiation and streaming instantiation.
1380         (WebCore::InitData::append): Used for the streaming mode, when you
1381         are concatenating init datas together.
1382         (WebCore::InitData::payload const):
1383         (WebCore::InitData::systemId const):
1384         (WebCore::InitData::payloadContainerType const):
1385         (WebCore::InitData::isFromDifferentContainer):
1386         (WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
1387         (WebCore::ProtectionSystemEvents::events const):
1388         (WebCore::ProtectionSystemEvents::availableSystems const):
1389         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1390         (webkitMediaCommonEncryptionDecryptTransformInPlace): If you post
1391         waiting-for-key after requesting a CDM instance, it will flap back
1392         to not waiting for a key almost immediately, didn't make sense
1393         positing after requesting an instance. Also post key-received when
1394         we receive the key.
1395         (webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now
1396         been arranged that a CDMInstance will always be present in an OOB
1397         message, so parse it out here.
1398         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1399         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
1400         As above, make sure when posting the OOB that a CDMInstance is present.
1401
1402 2018-11-13  Charlie Turner  <cturner@igalia.com>
1403
1404         Various compiler warnings/errors fixes.
1405         https://bugs.webkit.org/show_bug.cgi?id=191583
1406
1407         Reviewed by Frédéric Wang.
1408
1409         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1410         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
1411         ASSERT is only compiled in DEBUG mode, so guarding with
1412         !LOG_DISABLED is wrong.
1413         * rendering/RenderLayerCompositor.cpp:
1414         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1415         showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING)
1416         mode, so guarding with !LOG_DISABLED was wrong.
1417         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1418         Ditto, this time with member .depth.
1419         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto.
1420         * rendering/svg/SVGRenderSupport.cpp:
1421         (WebCore::SVGRenderSupport::styleChanged): Add another unused
1422         parameter.
1423
1424 2018-11-12  Antoine Quint  <graouts@apple.com>
1425
1426         [Web Animations] Don't schedule animation frames or update style while an accelerated animation is running
1427         https://bugs.webkit.org/show_bug.cgi?id=191542
1428         <rdar://problem/45356027>
1429
1430         Reviewed by Simon Fraser.
1431
1432         Test: animations/no-style-recalc-during-accelerated-animation.html
1433
1434         In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated
1435         animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and
1436         when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated
1437         animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled
1438         for that time when we'll schedule animation resolution.
1439
1440         By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure
1441         we also update animations in-flight to dispatch "animationiteration" events.
1442
1443         * animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick().
1444         * animation/DocumentTimeline.cpp:
1445         (WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded().
1446         (WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time.
1447         (WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next.
1448         (WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can
1449         cache the current time in suspendAnimations() without also automatically clearing the current time.
1450         (WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been
1451         factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly
1452         by virtue of using cacheCurrentTime(). This fixes some flakiness.
1453         (WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime(). 
1454         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended.
1455         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already,
1456         scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead.
1457         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution.
1458         (WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents()
1459         and call scheduleNextTick().
1460         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running.
1461         (WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated.
1462         Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations.
1463         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function.
1464         * animation/DocumentTimeline.h:
1465         * animation/WebAnimation.cpp:
1466         (WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new
1467         function to get that information directly through the WebAnimation object without bothering about its effect.
1468         (WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential
1469         change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated.
1470         (WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration.
1471         * animation/WebAnimation.h:
1472
1473 2018-11-13  Miguel Gomez  <magomez@igalia.com>
1474
1475         [GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area
1476         https://bugs.webkit.org/show_bug.cgi?id=191545
1477
1478         Reviewed by Žan Doberšek.
1479
1480         Keep track of layer size changes even if they happen when the layer is not in the visible
1481         area, so we can update edge tiles when the layer gets visible.
1482
1483         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1484         (WebCore::TiledBackingStore::createTiles):
1485         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1486
1487 2018-11-12  Rob Buis  <rbuis@igalia.com>
1488
1489         Content-Type parameter values should allow empty quoted strings
1490         https://bugs.webkit.org/show_bug.cgi?id=191388
1491
1492         Reviewed by Dean Jackson.
1493
1494         According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty
1495         quoted strings are acceptable for Content-Type parameter values. They
1496         are accepted by Firefox and Chrome implementations as well.
1497
1498         Test: web-platform-tests/xhr/overridemimetype-blob.html
1499
1500         * platform/network/ParsedContentType.cpp:
1501         (WebCore::parseToken):
1502         (WebCore::parseQuotedString):
1503         (WebCore::parseContentType):
1504         * platform/network/ParsedContentType.h:
1505
1506 2018-11-12  Christopher Reid  <chris.reid@sony.com>
1507
1508         [Curl] Reject entire cookie if the domain fails a tailmatch.
1509         https://bugs.webkit.org/show_bug.cgi?id=191406
1510
1511         Reviewed by Youenn Fablet.
1512
1513         Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox
1514         and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead.
1515         Also cleanup Cookie database implementation to make them testable better.
1516
1517         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
1518
1519         * platform/network/curl/CookieJarDB.cpp:
1520         (WebCore::CookieJarDB::canAcceptCookie): Added.
1521         (WebCore::CookieJarDB::setCookie):
1522         * platform/network/curl/CookieUtil.cpp:
1523         (WebCore::CookieUtil::parseCookieAttributes):
1524         (WebCore::CookieUtil::parseCookieHeader):
1525         * platform/network/curl/CookieUtil.h:
1526
1527 2018-11-12  Devin Rousso  <drousso@apple.com>
1528
1529         Web Inspector: Network: show secure certificate details per-request
1530         https://bugs.webkit.org/show_bug.cgi?id=191447
1531         <rdar://problem/30019476>
1532
1533         Reviewed by Joseph Pecoraro.
1534
1535         Test: http/tests/inspector/network/resource-response-security.html
1536
1537         * loader/ResourceLoader.h:
1538         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
1539         * loader/ResourceLoader.cpp:
1540         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
1541         Always save certificate information when WebInspector is open.
1542
1543         * platform/network/CertificateInfoBase.h: Added.
1544         (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
1545         (WebCore::CertificateInfoBase::summaryInfo const):
1546         (WebCore::CertificateInfoBase::isEmpty const):
1547         * platform/network/cf/CertificateInfo.h:
1548         (WebCore::CertificateInfo::summaryInfo const): Added.
1549         * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
1550         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
1551         (WebCore::CertificateInfo::summaryInfo const): Added.
1552         * platform/network/curl/CertificateInfo.h:
1553         (WebCore::CertificateInfo::summaryInfo const): Added.
1554         (WebCore::CertificateInfo::isEmpty const): Added.
1555         * platform/network/soup/CertificateInfo.h:
1556         (WebCore::CertificateInfo::summaryInfo const): Added.
1557         (WebCore::CertificateInfo::isEmpty const): Added.
1558         Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
1559         platform-specific code in its implementation.
1560
1561         * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
1562         * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
1563         * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
1564
1565         * inspector/NetworkResourcesData.h:
1566         (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
1567         (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
1568         * inspector/NetworkResourcesData.cpp:
1569         (WebCore::NetworkResourcesData::responseReceived):
1570
1571         * inspector/agents/InspectorNetworkAgent.cpp:
1572         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
1573
1574         * PlatformAppleWin.cmake:
1575         * PlatformMac.cmake:
1576         * SourcesCocoa.txt:
1577         * WebCore.xcodeproj/project.pbxproj:
1578         * platform/Curl.cmake:
1579         * platform/SourcesSoup.txt:
1580
1581 2018-11-12  Zalan Bujtas  <zalan@apple.com>
1582
1583         Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer.
1584         https://bugs.webkit.org/show_bug.cgi?id=191554
1585         <rdar://problem/45825265>
1586
1587         Reviewed by Antti Koivisto.
1588
1589         While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block.
1590         Moving a renderer is a 2 step process:
1591         1. Detach the renderer from its current parent
1592         2. Attach it to its new parent.
1593         During step #1, we check if there is a chance to collapse anonymous blocks. In this case the soon-to-be-parent is a sibling anonymous block which, after detaching the marker sibling
1594         is not needed anymore (except we use it as the new parent).
1595
1596         Test: fast/inline/marker-list-item-move-should-not-crash.html
1597
1598         * rendering/updating/RenderTreeBuilder.cpp:
1599         (WebCore::RenderTreeBuilder::detach):
1600         * rendering/updating/RenderTreeBuilder.h:
1601         * rendering/updating/RenderTreeBuilderBlock.cpp:
1602         (WebCore::RenderTreeBuilder::Block::detach):
1603         * rendering/updating/RenderTreeBuilderBlock.h:
1604         * rendering/updating/RenderTreeBuilderList.cpp:
1605         (WebCore::RenderTreeBuilder::List::updateItemMarker):
1606
1607 2018-11-12  Javier Fernandez  <jfernandez@igalia.com>
1608
1609         [css-grid] Refactoring to make more explicit the orthogonal items' pre-layout logic
1610         https://bugs.webkit.org/show_bug.cgi?id=191358
1611
1612         Reviewed by Manuel Rego Casasnovas.
1613
1614         These changes are just a refactoring to ease the integration of the new Baseline Alignment
1615         logic in a follow up patch.
1616
1617         We need to properly estimate the grid area size of orthogonal items so that we can perform
1618         an accurate pre-layout. This is important because orthogonal items will synthesize their baseline
1619         if they participate in any baseline alignment context.
1620
1621         No new tests, since no behavior change has been introduced in this patch.
1622
1623         * rendering/Grid.cpp:
1624         (WebCore::Grid::setNeedsItemsPlacement):
1625         * rendering/Grid.h:
1626         * rendering/GridTrackSizingAlgorithm.cpp:
1627         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
1628         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
1629         (WebCore::GridTrackSizingAlgorithm::isRelativeGridLengthAsAuto const):
1630         (WebCore::GridTrackSizingAlgorithm::isRelativeSizedTrackAsAuto const):
1631         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
1632         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
1633         (WebCore::GridTrackSizingAlgorithm::run):
1634         (WebCore::GridTrackSizingAlgorithm::reset):
1635         * rendering/GridTrackSizingAlgorithm.h:
1636         (WebCore::GridTrackSizingAlgorithmStrategy::gridTrackSize const):
1637         * rendering/RenderGrid.cpp:
1638         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
1639         (WebCore::RenderGrid::layoutBlock):
1640         (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
1641         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
1642         (WebCore::RenderGrid::placeItemsOnGrid const):
1643         (WebCore::RenderGrid::performGridItemsPreLayout const):
1644         (WebCore::overrideSizeChanged):
1645         (WebCore::hasRelativeBlockAxisSize):
1646         (WebCore::RenderGrid::updateGridAreaLogicalSize const):
1647         (WebCore::RenderGrid::layoutGridItems):
1648         * rendering/RenderGrid.h:
1649
1650 2018-11-12  Sihui Liu  <sihui_liu@apple.com>
1651
1652         imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
1653         https://bugs.webkit.org/show_bug.cgi?id=191500
1654
1655         Reviewed by Dean Jackson.
1656
1657         When double value is bigger than maximum unsigned int, converting double to unsigned int has
1658         different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
1659         maximum unsigned int.
1660
1661         Covered by existing test.
1662
1663         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1664         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
1665         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
1666
1667 2018-11-12  Basuke Suzuki  <basuke.suzuki@sony.com>
1668
1669         [Curl] Add API Test for Curl cookie backend.
1670         https://bugs.webkit.org/show_bug.cgi?id=191493
1671
1672         Reviewed by Youenn Fablet.
1673
1674         Refactoring for cookie backend interface.
1675
1676         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
1677
1678         * platform/FileSystem.h:
1679         * platform/network/curl/CookieJarCurlDatabase.cpp:
1680         (WebCore::cookiesForSession):
1681         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
1682         (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
1683         (WebCore::CookieJarCurlDatabase::getRawCookies const):
1684         * platform/network/curl/CookieJarDB.cpp:
1685         (WebCore::CookieJarDB::openDatabase):
1686         (WebCore::CookieJarDB::checkSQLiteReturnCode):
1687         (WebCore::CookieJarDB::isEnabled const):
1688         (WebCore::CookieJarDB::searchCookies):
1689         (WebCore::CookieJarDB::setCookie):
1690         (WebCore::CookieJarDB::deleteCookie):
1691         (WebCore::CookieJarDB::deleteCookieInternal):
1692         (WebCore::CookieJarDB::deleteCookies):
1693         (WebCore::CookieJarDB::deleteAllCookies):
1694         (WebCore::CookieJarDB::executeSimpleSql):
1695         (WebCore::CookieJarDB::isEnabled): Deleted.
1696         * platform/network/curl/CookieJarDB.h:
1697         * platform/network/curl/CookieUtil.cpp:
1698         (WebCore::CookieUtil::parseCookieHeader):
1699         * platform/network/curl/CookieUtil.h:
1700         * platform/win/FileSystemWin.cpp:
1701         (WebCore::FileSystem::generateTemporaryPath):
1702         (WebCore::FileSystem::openTemporaryFile):
1703         (WebCore::FileSystem::createTemporaryDirectory):
1704         (WebCore::FileSystem::deleteNonEmptyDirectory):
1705
1706 2018-11-12  Tim Horton  <timothy_horton@apple.com>
1707
1708         Make it possible to edit images inline
1709         https://bugs.webkit.org/show_bug.cgi?id=191352
1710         <rdar://problem/30107985>
1711
1712         Reviewed by Dean Jackson.
1713
1714         Tests: editing/images/basic-editable-image.html
1715                editing/images/reparent-editable-image-maintains-strokes.html
1716
1717         Add the beginnings of a mechanism to replace images with a special attribute
1718         with a native drawing view in the UI process.
1719
1720         * page/Settings.yaml:
1721         Add a setting to control whether images become natively editable when they
1722         have the x-apple-editable-image attribute.
1723
1724         * html/HTMLImageElement.cpp:
1725         (WebCore::HTMLImageElement::editableImageViewID const):
1726         Lazily generate an EmbeddedViewID and persist it on the <img> element.
1727
1728         * html/HTMLImageElement.h:
1729         Rearrange the service controls methods to sit before the members.
1730         Add m_editableImageViewID and editableImageViewID().
1731
1732         * platform/graphics/GraphicsLayer.cpp:
1733         (WebCore::GraphicsLayer::nextEmbeddedViewID):
1734         * platform/graphics/GraphicsLayer.h:
1735         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
1736         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
1737         on Cocoa platforms and when using RemoteLayerTree.
1738         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
1739         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
1740         and an EmbeddedViewID to uniquely identify and communicate about the
1741         embedded view (which may move between layers, since it is tied to an element).
1742
1743         * platform/graphics/ca/GraphicsLayerCA.cpp:
1744         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
1745         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
1746         When setting GraphicsLayer's contents to an embedded view, we use
1747         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
1748         GraphicsLayerCARemote will override this and make a correctly-initialized
1749         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
1750
1751         * platform/graphics/ca/GraphicsLayerCA.h:
1752         * platform/graphics/ca/PlatformCALayer.cpp:
1753         (WebCore::operator<<):
1754         * platform/graphics/ca/PlatformCALayer.h:
1755         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1756         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1757         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1758         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
1759         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
1760         These will be overridden by PlatformCALayerRemote to do more interesting things.
1761
1762         * rendering/RenderImage.cpp:
1763         (WebCore::RenderImage::isEditableImage const):
1764         Add a getter that return true if the setting is enabled and
1765         x-apple-editable-image is empty or true.
1766
1767         (WebCore::RenderImage::requiresLayer const):
1768         RenderImage requires a layer either if RenderReplaced does, or we are an
1769         editable image.
1770
1771         * rendering/RenderImage.h:
1772         * rendering/RenderLayer.cpp:
1773         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
1774         (WebCore::RenderLayer::calculateClipRects const):
1775         * rendering/RenderLayerBacking.cpp:
1776         (WebCore::RenderLayerBacking::updateConfiguration):
1777         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
1778
1779         * rendering/RenderLayerCompositor.cpp:
1780         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
1781         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1782         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1783         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
1784         * rendering/RenderLayerCompositor.h:
1785         Make editable images require compositing implicitly.
1786
1787 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
1788
1789         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
1790         https://bugs.webkit.org/show_bug.cgi?id=189230
1791         <rdar://problem/44050379>
1792
1793         Reviewed by Joseph Pecoraro.
1794
1795         Runs all png images through zopflipng. This results in a smaller file
1796         size and takes care of this issue as a byproduct.
1797
1798         * Modules/modern-media-controls/images/iOS/airplay-placard@1x.png:
1799         * Modules/modern-media-controls/images/iOS/airplay-placard@2x.png:
1800         * Modules/modern-media-controls/images/iOS/airplay-placard@3x.png:
1801         * Modules/modern-media-controls/images/iOS/invalid-placard@1x.png:
1802         * Modules/modern-media-controls/images/iOS/invalid-placard@2x.png:
1803         * Modules/modern-media-controls/images/iOS/invalid-placard@3x.png:
1804         * Modules/modern-media-controls/images/iOS/pip-placard@1x.png:
1805         * Modules/modern-media-controls/images/iOS/pip-placard@2x.png:
1806         * Modules/modern-media-controls/images/iOS/pip-placard@3x.png:
1807         * Modules/modern-media-controls/images/macOS/airplay-placard@1x.png:
1808         * Modules/modern-media-controls/images/macOS/airplay-placard@2x.png:
1809         * Modules/modern-media-controls/images/macOS/invalid-placard@1x.png:
1810         * Modules/modern-media-controls/images/macOS/invalid-placard@2x.png:
1811         * Modules/modern-media-controls/images/macOS/pip-placard@1x.png:
1812         * Modules/modern-media-controls/images/macOS/pip-placard@2x.png:
1813         * Resources/AttachmentPlaceholder.png:
1814         * Resources/AttachmentPlaceholder@2x.png:
1815         * Resources/ListButtonArrow.png:
1816         * Resources/ListButtonArrow@2x.png:
1817         * Resources/missingImage.png:
1818         * Resources/missingImage@2x.png:
1819         * Resources/missingImage@3x.png:
1820         * Resources/moveCursor.png:
1821         * Resources/northEastSouthWestResizeCursor.png:
1822         * Resources/northSouthResizeCursor.png:
1823         * Resources/northWestSouthEastResizeCursor.png:
1824         * Resources/nullPlugin.png:
1825         * Resources/nullPlugin@2x.png:
1826         * Resources/panIcon.png:
1827         * Resources/textAreaResizeCorner.png:
1828         * Resources/textAreaResizeCorner@2x.png:
1829         * Resources/urlIcon.png:
1830
1831 2018-11-12  Youenn Fablet  <youenn@apple.com>
1832
1833         RealtimeOutgoing A/V sources should observe their sources only if having a sink
1834         https://bugs.webkit.org/show_bug.cgi?id=191490
1835
1836         Reviewed by Eric Carlson.
1837
1838         Observe the source that generates media based on the sinks:
1839         - Do not observe at creation time
1840         - For first sink, start observing
1841         - When no more sink, stop observing
1842         Apply this principle for both outgoing audio and video sources.
1843         Add locks for the sinks to ensure thread-safety.
1844         Make sinks HashSet which is more robust.
1845
1846         Do some refactoring to better isolate generic outgoing sources from Cocoa/GTK implementations.
1847
1848         Covered by existing tests and updated webrtc/remove-track.html.
1849
1850         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
1851         (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
1852         (WebCore::RealtimeOutgoingAudioSource::stop):
1853         (WebCore::RealtimeOutgoingAudioSource::AddSink):
1854         (WebCore::RealtimeOutgoingAudioSource::RemoveSink):
1855         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
1856         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1857         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
1858         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
1859         (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
1860         (WebCore::RealtimeOutgoingVideoSource::observeSource):
1861         (WebCore::RealtimeOutgoingVideoSource::setSource):
1862         (WebCore::RealtimeOutgoingVideoSource::stop):
1863         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
1864         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
1865         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1866         (WebCore::RealtimeOutgoingVideoSource::isSilenced const):
1867         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
1868         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
1869         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1870         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
1871         (WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):
1872         (WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
1873         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
1874         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1875         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
1876
1877 2018-11-12  Youenn Fablet  <youenn@apple.com>
1878
1879         Support setting stream ids when adding a transceiver
1880         https://bugs.webkit.org/show_bug.cgi?id=191307
1881
1882         Reviewed by Eric Carlson.
1883
1884         Add support for streams in RTCTransceiverInit.
1885         Add plumbing down to libwebrtc.
1886         Covered by rebased tests.
1887
1888         * Modules/mediastream/RTCPeerConnection.h:
1889         * Modules/mediastream/RTCPeerConnection.idl:
1890         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1891         (WebCore::fromRtpTransceiverInit):
1892
1893 2018-11-12  Antti Koivisto  <antti@apple.com>
1894
1895         Support dynamic pseudo-classes on elements with display: contents
1896         https://bugs.webkit.org/show_bug.cgi?id=181640
1897         <rdar://problem/36605415>
1898
1899         Reviewed by Dean Jackson.
1900
1901         The code for :hover and :active style invalidation assumes that only elements with renderer need invalidation.
1902
1903         This patch fixes '.display-content-element:hover span' case but not '.display-content-element:hover' case but
1904         includes tests for both. The latter is not super useful anyway (as it only affects rendering with inherited
1905         text properties).
1906
1907         Test: fast/css/display-contents-hover-active.html
1908
1909         * dom/Document.cpp:
1910         (WebCore::Document::updateHoverActiveState):
1911
1912             Traverse up in composed tree instead of render tree when invalidating. This has the same order as render tree
1913             but also includes display:content elements. This also allows removing the special display:none case.
1914
1915         * dom/Element.cpp:
1916         (WebCore::Element::setActive):
1917         (WebCore::Element::setHovered):
1918
1919             Also look into display:contents style for invalidation checks.
1920
1921         (WebCore::Element::renderOrDisplayContentsStyle const):
1922
1923             Make this helper an Element member.
1924
1925         * dom/Element.h:
1926         * dom/Node.cpp:
1927         (WebCore::Node::parentElementInComposedTree const):
1928
1929             Support starting from a PseudoElement. This is consistent with ComposedTreeAncestorIterator.
1930
1931         * rendering/updating/RenderTreePosition.cpp:
1932         (WebCore::RenderTreePosition::nextSiblingRenderer const):
1933         * style/StyleTreeResolver.cpp:
1934         (WebCore::Style::TreeResolver::resolveElement):
1935         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1936         (WebCore::Style::shouldResolveElement):
1937         (WebCore::Style::TreeResolver::resolveComposedTree):
1938         (WebCore::Style::renderOrDisplayContentsStyle): Deleted.
1939
1940             Use the Element::renderOrDisplayContentsStyle() instead.
1941
1942 2018-11-12  Antoine Quint  <graouts@apple.com>
1943
1944         [Web Animations] Turn Web Animations experimental
1945         https://bugs.webkit.org/show_bug.cgi?id=191543
1946
1947         Reviewed by Dean Jackson.
1948
1949         * page/RuntimeEnabledFeatures.h:
1950
1951 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
1952
1953         feFlood with alpha color doesn't work correctly
1954         https://bugs.webkit.org/show_bug.cgi?id=163666
1955
1956         Reviewed by Zalan Bujtas.
1957         
1958         FEFlood::platformApplySoftware() erroneously used colorWithOverrideAlpha()
1959         rather than multiplying the flood color with the flood opacity as other browsers do.
1960
1961         Test: svg/filters/feFlood-with-alpha-color.html
1962
1963         * platform/graphics/Color.cpp:
1964         (WebCore::Color::colorWithAlpha const): I tried using colorWithAlphaMultipliedBy() elsewhere,
1965         and it triggered a behavior change, so add a comment.
1966         * platform/graphics/filters/FEFlood.cpp:
1967         (WebCore::FEFlood::platformApplySoftware):
1968         * svg/SVGStopElement.cpp:
1969         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
1970
1971 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
1972
1973         Require <iframe allow="display"> for an iframe to use getDisplayMedia
1974         https://bugs.webkit.org/show_bug.cgi?id=191505
1975         <rdar://problem/45968811>
1976
1977         Reviewed by Jer Noble.
1978
1979         Test: http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html
1980
1981         * Modules/mediastream/MediaDevicesRequest.cpp:
1982         (WebCore::MediaDevicesRequest::start):
1983         * Modules/mediastream/UserMediaController.cpp:
1984         (WebCore::isAllowedToUse):
1985         (WebCore::UserMediaController::canCallGetUserMedia):
1986         (WebCore::UserMediaController::logGetUserMediaDenial):
1987         * Modules/mediastream/UserMediaController.h:
1988         * Modules/mediastream/UserMediaRequest.cpp:
1989         (WebCore::UserMediaRequest::start):
1990
1991 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
1992
1993         Make compositing updates incremental
1994         https://bugs.webkit.org/show_bug.cgi?id=90342
1995
1996         Reviewed by Antti Koivisto.
1997
1998         Previously, updating compositing layers required two full RenderLayer tree traversals,
1999         and all the work was done for every RenderLayer on each composting update. This could be expensive
2000         on pages with lots of RenderLayers.
2001
2002         These changes make compositing updates more incremental. Compositing updates still require
2003         two tree traversals. The first determines which RenderLayers need to be composited (of those which
2004         weren't already made composited at style-change time), because of reasons that can only be determined
2005         post-layout, and indirect reasons including overlap. The second traversal updates the configuration, geometry
2006         and GraphicsLayer tree for the composited layers. Dependencies on both descendant and ancestor state make
2007         it hard to fold these two traversals together.
2008
2009         In order to minimize the work done during these traversals, dirty bits are stored on RenderLayers,
2010         and propagated to ancestor layers in paint order. There are two sets of bits: those related to the first
2011         "compositing requirements" traversal, and those related to the second "update backing and hierarchy" traversal.
2012         When a RenderLayer gets a dirty bit set, bits are propagated to ancestors to indicate that children need
2013         to be visited.
2014
2015         Sadly entire subtrees can't be skipped during the "compositing requirements" traversal because we still have
2016         to accumulate overlap rects, but RenderLayerCompositor::traverseUnchangedSubtree() is used to minimize
2017         work in that case. Subtrees can be skipped in the "update backing and hierarchy" traversal. Entire traversals can
2018         be skipped if no change has triggered the need for that traversal.
2019         
2020         These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
2021         more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
2022         triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
2023         excluding composited filters from the composited bounds (but still taking them into account for overlap).
2024
2025         Care is taken to avoid triggering traversals in non-composited documents (tested by no-updates-in-non-composited-iframe.html).
2026
2027         Code to set the dirty bits is added in various places that change properties that compositing depends on.
2028         
2029         These changes also subsume the patch in 176196; we now never consult properties that rely on layout from the
2030         style change code path, and the only call stack for geometry updates is from the "update backing and hierarchy"
2031         traversal, which is always a pre-order traversal.
2032
2033         Tests: compositing/geometry/stacking-context-change-layer-reparent.html
2034                compositing/layer-creation/change-to-overlap.html
2035                compositing/updates/no-updates-in-non-composited-iframe.html
2036
2037         * html/canvas/WebGLRenderingContextBase.cpp:
2038         (WebCore::WebGLRenderingContextBase::markContextChanged): Need to differentiate between a canvas becoming composited
2039         for the first time, and its pixels changing with a new 'CanvasPixelsChanged' value.
2040         * page/FrameView.cpp:
2041         (WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
2042         * page/Page.cpp:
2043         (WebCore::Page::setPageScaleFactor):
2044         * platform/graphics/ca/GraphicsLayerCA.cpp:
2045         (WebCore::GraphicsLayerCA::updateBackdropFilters): If we just made a layer for backdrops, we need to update sublayers.
2046         * rendering/RenderBox.cpp:
2047         (WebCore::RenderBox::styleWillChange):
2048         * rendering/RenderLayer.cpp:
2049         (WebCore::RenderLayer::RenderLayer):
2050         (WebCore::RenderLayer::~RenderLayer):
2051         (WebCore::RenderLayer::addChild):
2052         (WebCore::RenderLayer::removeChild):
2053         (WebCore::RenderLayer::shouldBeStackingContext const):
2054         (WebCore::RenderLayer::stackingContext const):
2055         (WebCore::RenderLayer::dirtyZOrderLists):
2056         (WebCore::RenderLayer::dirtyNormalFlowList):
2057         (WebCore::RenderLayer::updateNormalFlowList):
2058         (WebCore::RenderLayer::rebuildZOrderLists):
2059         (WebCore::RenderLayer::setAncestorsHaveCompositingDirtyFlag):
2060         (WebCore::RenderLayer::contentChanged):
2061         (WebCore::RenderLayer::updateLayerPositions):
2062         (WebCore::RenderLayer::updateTransform):
2063         (WebCore::RenderLayer::updateLayerPosition):
2064         (WebCore::RenderLayer::enclosingCompositingLayer const):
2065         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
2066         (WebCore::RenderLayer::clippingRootForPainting const):
2067         (WebCore::RenderLayer::scrollTo):
2068         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
2069         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2070         (WebCore::RenderLayer::paintLayerContents):
2071         (WebCore::RenderLayer::hitTest):
2072         (WebCore::RenderLayer::hitTestLayer):
2073         (WebCore::RenderLayer::calculateClipRects const):
2074         (WebCore::outputPaintOrderTreeLegend):
2075         (WebCore::outputPaintOrderTreeRecursive):
2076         (WebCore::compositingContainer): Deleted.
2077         * rendering/RenderLayer.h:
2078         (WebCore::RenderLayer::clearZOrderLists):
2079         (WebCore::RenderLayer::paintOrderParent const):
2080         * rendering/RenderLayerBacking.cpp:
2081         (WebCore::RenderLayerBacking::updateCompositedBounds):
2082         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
2083         (WebCore::RenderLayerBacking::updateAfterLayout):
2084         (WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
2085         (WebCore::RenderLayerBacking::updateConfiguration):
2086         (WebCore::RenderLayerBacking::updateGeometry):
2087         (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
2088         (WebCore::RenderLayerBacking::updateMaskingLayer):
2089         (WebCore::RenderLayerBacking::paintsContent const):
2090         (WebCore::RenderLayerBacking::contentChanged):
2091         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
2092         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
2093         (WebCore::RenderLayerBacking::startAnimation):
2094         (WebCore::RenderLayerBacking::animationFinished):
2095         (WebCore::RenderLayerBacking::startTransition):
2096         (WebCore::RenderLayerBacking::transitionFinished):
2097         (WebCore::RenderLayerBacking::setCompositedBounds):
2098         * rendering/RenderLayerBacking.h:
2099         * rendering/RenderLayerCompositor.cpp:
2100         (WebCore::RenderLayerCompositor::CompositingState::CompositingState):
2101         (WebCore::RenderLayerCompositor::enableCompositingMode):
2102         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
2103         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout):
2104         (WebCore::RenderLayerCompositor::willRecalcStyle):
2105         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2106         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2107         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2108         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2109         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2110         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
2111         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
2112         (WebCore::RenderLayerCompositor::logLayerInfo):
2113         (WebCore::clippingChanged):
2114         (WebCore::styleAffectsLayerGeometry):
2115         (WebCore::RenderLayerCompositor::layerStyleChanged):
2116         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
2117         (WebCore::RenderLayerCompositor::updateBacking):
2118         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
2119         (WebCore::RenderLayerCompositor::layerWasAdded):
2120         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
2121         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
2122         (WebCore::RenderLayerCompositor::computeExtent const):
2123         (WebCore::RenderLayerCompositor::addToOverlapMap):
2124         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2125         (WebCore::RenderLayerCompositor::rootLayerConfigurationChanged):
2126         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2127         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
2128         (WebCore::RenderLayerCompositor::needsToBeComposited const):
2129         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2130         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2131         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2132         (WebCore::RenderLayerCompositor::clippedByAncestor const):
2133         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
2134         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
2135         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
2136         (WebCore::RenderLayerCompositor::requiresCompositingForFilters const):
2137         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
2138         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
2139         (WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
2140         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
2141         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2142         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
2143         (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
2144         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
2145         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
2146         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
2147         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
2148         (WebCore::operator<<):
2149         (WebCore::RenderLayerCompositor::setCompositingLayersNeedRebuild): Deleted.
2150         (WebCore::checkIfDescendantClippingContextNeedsUpdate): Deleted.
2151         (WebCore::isScrollableOverflow): Deleted.
2152         (WebCore::styleHasTouchScrolling): Deleted.
2153         (WebCore::styleChangeRequiresLayerRebuild): Deleted.
2154         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Deleted.
2155         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): Deleted.
2156         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Deleted.
2157         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Deleted.
2158         * rendering/RenderLayerCompositor.h:
2159         * rendering/RenderTreeAsText.cpp:
2160         (WebCore::writeLayers):
2161
2162 2018-11-12  Rob Buis  <rbuis@igalia.com>
2163
2164         CSSCalcOperation constructor wastes 6KB of Vector capacity on cnn.com
2165         https://bugs.webkit.org/show_bug.cgi?id=190839
2166
2167         Reviewed by Frédéric Wang.
2168
2169         The CSSCalcOperation ctor that takes a leftSide and rightSide parameter
2170         wastes memory since it will always have size 2 but claims the
2171         default Vector size. So make sure to reserve an initial capacity of 2.
2172
2173         * css/CSSCalculationValue.cpp:
2174
2175 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2176
2177         WTFMove(xxx) is used in arguments while other arguments touch xxx
2178         https://bugs.webkit.org/show_bug.cgi?id=191544
2179
2180         Reviewed by Alex Christensen.
2181
2182         The order of the evaluation of C++ arguments is undefined. If we use WTFMove(xxx),
2183         xxx should not be touched in the other arguments. This patch fixes such uses in
2184         IDB code.
2185
2186         * Modules/indexeddb/IDBObjectStore.cpp:
2187         (WebCore::IDBObjectStore::deleteIndex):
2188         * Modules/indexeddb/IDBTransaction.cpp:
2189         (WebCore::IDBTransaction::scheduleOperation):
2190         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2191         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
2192         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2193         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
2194
2195 2018-11-12  Zalan Bujtas  <zalan@apple.com>
2196
2197         [LFC][IFC] Construct dedicated runs when the inline element requires it.
2198         https://bugs.webkit.org/show_bug.cgi?id=191509
2199
2200         Reviewed by Antti Koivisto.
2201
2202         In certain cases, a run can overlap multiple inline elements like this:
2203
2204         <span>normal text content</span><span style="position: relative; left: 10px;">but this one needs a dedicated run</span><span>end of text</span>
2205
2206         The content above generates one long run <normal text contentbut this one needs dedicated runend of text> <- input to line breaking.
2207         However, since the middle run is positioned, it needs to be moved independently from the rest of the content, hence it needs a dedicated inline run.
2208
2209         * layout/inlineformatting/InlineFormattingContext.cpp:
2210         (WebCore::Layout::InlineFormattingContext::layout const):
2211         (WebCore::Layout::contentRequiresSeparateRun):
2212         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2213         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
2214         (WebCore::Layout::InlineFormattingContext::closeLine const):
2215         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
2216         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2217         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2218         * layout/inlineformatting/InlineFormattingContext.h:
2219         (WebCore::Layout::InlineFormattingContext::inlineFormattingState const):
2220         * layout/inlineformatting/InlineLineBreaker.cpp:
2221         (WebCore::Layout::InlineLineBreaker::nextRun): mid-word breaking is not implemented yet.
2222         * layout/inlineformatting/InlineRun.h:
2223         (WebCore::Layout::InlineRun::overlapsMultipleInlineItems const):
2224         * layout/inlineformatting/InlineRunProvider.cpp:
2225         (WebCore::Layout::InlineRunProvider::processInlineTextItem):
2226         * layout/inlineformatting/InlineRunProvider.h:
2227         (WebCore::Layout::InlineRunProvider::Run::TextContext::expand):
2228         (WebCore::Layout::InlineRunProvider::Run::textContext):
2229         (WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): Deleted.
2230         (WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): Deleted.
2231
2232 2018-11-12  Jer Noble  <jer.noble@apple.com>
2233
2234         [MSE] Frame re-ordering can cause iframes to never be enqueued
2235         https://bugs.webkit.org/show_bug.cgi?id=191485
2236
2237         Reviewed by Eric Carlson.
2238
2239         Test: media/media-source/media-source-dropped-iframe.html
2240
2241         Some frame re-ordering techniques result in files where the first frame has a
2242         decode timestamp < 0, but a presentation timestamp >= 0. When appending these
2243         samples to existing content, we can fail to enqueue the first frame because its
2244         DTS overlaps an existing sample, but the presentation timestamp does not.
2245         Rather than try to only enqueue samples whose decode timestamps are > than the
2246         greatest decode end timestamp (minus some fudge factor), allow all frames to be
2247         added to the decode queue if they are strictly ordered greater than the last
2248         enqueued frame.
2249
2250         * Modules/mediasource/SourceBuffer.cpp:
2251         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
2252         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2253         (WebCore::SourceBuffer::provideMediaData):
2254         (WebCore::SourceBuffer::reenqueueMediaForTime):
2255
2256 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2257
2258         IDBTransaction does not use "RefPtr<IDBTransaction> self"
2259         https://bugs.webkit.org/show_bug.cgi?id=190436
2260
2261         Reviewed by Alex Christensen.
2262
2263         It seems that `RefPtr<IDBTransaction> self;` is not effective since it does not capture anything.
2264         Use `protectedThis = makeRef(*this)` instead.
2265
2266         No behavior change.
2267
2268         * Modules/indexeddb/IDBTransaction.cpp:
2269         (WebCore::IDBTransaction::IDBTransaction):
2270
2271 2018-11-12  Alicia Boya García  <aboya@igalia.com>
2272
2273         [MSE][GStreamer] Introduce AbortableTaskQueue
2274         https://bugs.webkit.org/show_bug.cgi?id=190902
2275
2276         Reviewed by Xabier Rodriguez-Calvar.
2277
2278         A new synchronization primitive is introduced: AbortableTaskQueue,
2279         which allows to send work to the main thread from a background thread
2280         with the option to perform two-phase cancellation (startAborting() and
2281         finishAborting()).
2282
2283         This new primitive has been used to overhaul GstBus messaging in
2284         AppendPipeline. A lot of code made redundant has been deleted in the
2285         process and lots of internal functions were now able to be made
2286         private. As part of the refactor all glib signals in AppendPipeline
2287         now use lambdas. All usages of WTF::isMainThread() in AppendPipeline
2288         have been replaced by isMainThread() for consistency with the rest of
2289         WebKit.
2290
2291         Two-phase cancellation is still not used in AppendPipeline as of this
2292         patch, but it will be used in a future patch that makes use of
2293         GStreamer flushes to implement correct MSE abort semantics. There are
2294         unit tests to ensure it works correctly, even if it's still not used.
2295
2296         * WebCore.xcodeproj/project.pbxproj:
2297         * platform/AbortableTaskQueue.h: Added.
2298         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2299         (WebCore::AppendPipeline::dumpAppendState):
2300         (WebCore::AppendPipeline::AppendPipeline):
2301         (WebCore::AppendPipeline::~AppendPipeline):
2302         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
2303         (WebCore::AppendPipeline::handleAppsinkNewSampleFromAnyThread):
2304         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
2305         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2306         (WebCore::AppendPipeline::sourceBufferPrivate):
2307         (WebCore::AppendPipeline::appsinkCaps):
2308         (WebCore::AppendPipeline::track):
2309         (WebCore::AppendPipeline::demuxerSrcPadCaps):
2310         (WebCore::AppendPipeline::playerPrivate):
2311
2312 2018-11-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2313
2314         [GStreamer][EME] waitingforkey event should consider decryptors' waiting status
2315         https://bugs.webkit.org/show_bug.cgi?id=191459
2316
2317         Reviewed by Carlos Garcia Campos.
2318
2319         The new cross platform architecture to report waitingforkey and
2320         recover from it requires a more accurate knowledge of what is
2321         going on with the decryptors because events are reported only once
2322         (per key exchange run) and crossplatform only continues if we are
2323         actually ready to continue, meaning that no decryptors are
2324         waiting.
2325
2326         * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added
2327         GstIterator deleter.
2328         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2329         (WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): Bail
2330         out if we are requested to not wait anymore but there are still
2331         waiting decryptors.
2332         (WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
2333         Query the pipeline, just a query after pipeline is built and
2334         manual inspection during build. The query is optimal but sometimes
2335         we can get this request when the pipeline is under construction so
2336         queries do not arrive at the decryptors and we have to deliver it
2337         by ourselves.
2338         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
2339         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2340         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
2341         Deleted because it is now inlined.
2342         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2343         (webKitMediaClearKeyDecryptorDecrypt): Fixed small compiler warning.
2344         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2345         (webkit_media_common_encryption_decrypt_class_init): Override
2346         query method.
2347         (webkitMediaCommonEncryptionDecryptTransformInPlace): When the
2348         decryptor is going to block to wait, report before. When the
2349         decryptor receives the key, report it got it.
2350         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not
2351         handle waitingforkey here.
2352         (webkitMediaCommonEncryptionDecryptorQueryHandler): Report if the
2353         decryptor is waiting.
2354
2355 2018-11-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2356
2357         [GTK] Silence ATK_XY_PARENT warnings
2358         https://bugs.webkit.org/show_bug.cgi?id=191504
2359
2360         Reviewed by Carlos Garcia Campos.
2361
2362         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
2363         (atkToContents):
2364         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2365         (textExtents):
2366         * accessibility/atk/WebKitAccessibleUtil.cpp:
2367         (contentsRelativeToAtkCoordinateType):
2368
2369 2018-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2370
2371         Implement a new edit command to change the enclosing list type
2372         https://bugs.webkit.org/show_bug.cgi?id=191487
2373         <rdar://problem/45955922>
2374
2375         Reviewed by Ryosuke Niwa.
2376
2377         Add support for a new edit command that changes the type of the enclosing list element around the selection from
2378         unordered to ordered list and vice versa. This new edit command is exposed only to internal WebKit2 clients, via
2379         SPI on WKWebView (`-_changeListType:`).
2380
2381         This is currently intended for use in Mail compose, but may also be adopted by legacy Notes in the future. As
2382         such, the behavior of this editing command mostly matches shipping behavior in Mail compose (which is currently
2383         implemented entirely by Mail). See below for more details.
2384
2385         Test:   editing/execCommand/change-list-type.html
2386                 WKWebViewEditActions.ChangeListType
2387
2388         * Sources.txt:
2389         * WebCore.xcodeproj/project.pbxproj:
2390         * editing/ChangeListTypeCommand.cpp: Added.
2391         (WebCore::listConversionTypeForSelection):
2392         (WebCore::ChangeListTypeCommand::listConversionType):
2393
2394         Helper that returns a potential list conversion command that may be executed at the given document's selection,
2395         if any exists. We also use existing logic from Mail here to determine which list to change, by walking up the
2396         DOM from the lowest common ancestor container of the current selection until we hit the first list element.
2397
2398         (WebCore::ChangeListTypeCommand::createNewList):
2399
2400         Helper method to create a new list element to replace the given list, and then clone element data from the given
2401         list to the new list. This addresses an existing bug in Mail, wherein changing list type for an enclosing list
2402         which contains inline style properties drops the inline styles, because existing logic in Mail that implements
2403         this editing command only copies the `class` attribute of the old list to the new list.
2404
2405         (WebCore::ChangeListTypeCommand::doApply):
2406
2407         Apply the edit command by running the following steps:
2408         -   Find the enclosing list element, if any (see above).
2409         -   Create a new list element of the opposite type as the enclosing list, and clone over element data from the
2410             list element being replaced.
2411         -   Insert the new list next to the original list.
2412         -   Move all children of the original list to the new list.
2413         -   Remove the original list.
2414         -   Set the selection to the end of the new list.
2415
2416         * editing/ChangeListTypeCommand.h: Added.
2417         * editing/EditAction.h:
2418
2419         Add a pair of new edit actions for conversion from unordered list to ordered list and vice versa.
2420
2421         * editing/Editor.cpp:
2422         (WebCore::Editor::changeSelectionListType):
2423
2424         Implement this by creating and applying a new ChangeListTypeCommand.
2425
2426         (WebCore::Editor::canChangeSelectionListType): Deleted.
2427
2428         Remove this for now, since there's no need for it until full support for edit command validation is implemented.
2429
2430         * editing/Editor.h:
2431         * testing/Internals.cpp:
2432         (WebCore::Internals::changeSelectionListType):
2433         * testing/Internals.h:
2434         * testing/Internals.idl:
2435
2436         Add internal hooks to change list type from layout tests.
2437
2438 2018-11-11  Daniel Bates  <dabates@apple.com>
2439
2440         [iOS] Draw caps lock indicator in password fields
2441         https://bugs.webkit.org/show_bug.cgi?id=190565
2442         <rdar://problem/45262343>
2443
2444         Reviewed by Dean Jackson.
2445
2446         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
2447         fields on iOS more closely match the behavior of password fields on Mac.
2448
2449         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
2450         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
2451         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
2452         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
2453         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
2454         web views listen for keyboard availability changes so as to update the the caps lock state when
2455         a hardware keyboard is detached or attached.
2456
2457         * WebCore.xcodeproj/project.pbxproj:
2458         * page/EventHandler.cpp:
2459         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
2460         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
2461         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
2462         * page/EventHandler.h:
2463         * platform/cocoa/KeyEventCocoa.mm:
2464         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
2465         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
2466         * platform/ios/KeyEventIOS.mm:
2467         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
2468         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
2469         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
2470         * platform/ios/WebEvent.h:
2471         * platform/ios/WebEvent.mm:
2472         (+[WebEvent modifierFlags]): Added.
2473         * platform/mac/KeyEventMac.mm:
2474         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
2475         by both Mac and iOS.
2476         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
2477         by both Mac and iOS.
2478         * rendering/RenderThemeCocoa.h:
2479         * rendering/RenderThemeCocoa.mm:
2480         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
2481         * rendering/RenderThemeIOS.h:
2482         * rendering/RenderThemeIOS.mm:
2483         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
2484         * rendering/RenderThemeMac.h:
2485         * rendering/RenderThemeMac.mm:
2486         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
2487         shared by both Mac and iOS.
2488
2489 2018-11-11  Zalan Bujtas  <zalan@apple.com>
2490
2491         [LFC][BFC] In-flow positioned logic is really formatting context dependent.
2492         https://bugs.webkit.org/show_bug.cgi?id=191512
2493
2494         Reviewed by Simon Fraser.
2495
2496         Move block formatting context specific code from FormattingContext to BlockFormattingContext.
2497
2498         * layout/FormattingContext.cpp:
2499         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): Deleted.
2500         * layout/FormattingContext.h:
2501         * layout/FormattingContextGeometry.cpp:
2502         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
2503         * layout/blockformatting/BlockFormattingContext.cpp:
2504         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
2505         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): Deleted.
2506         * layout/blockformatting/BlockFormattingContext.h:
2507         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2508         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): Deleted.
2509         * layout/inlineformatting/InlineFormattingContext.cpp:
2510         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): Deleted.
2511         * layout/inlineformatting/InlineFormattingContext.h:
2512
2513 2018-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
2514
2515         Address post-review comments after r237955
2516         https://bugs.webkit.org/show_bug.cgi?id=191496
2517
2518         Reviewed by Darin Adler.
2519
2520         * rendering/TextDecorationPainter.cpp:
2521         (WebCore::TextDecorationPainter::paintTextDecoration):
2522         * style/InlineTextBoxStyle.cpp:
2523         (WebCore::computeUnderlineOffset):
2524         * style/InlineTextBoxStyle.h:
2525
2526 2018-11-11  Benjamin Poulain  <benjamin@webkit.org>
2527
2528         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
2529         https://bugs.webkit.org/show_bug.cgi?id=191492
2530
2531         Reviewed by Alex Christensen.
2532
2533         Rename file.
2534
2535         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2536         * page/mac/EventHandlerMac.mm:
2537         * platform/mac/URLMac.mm:
2538         * platform/mac/WebCoreNSURLExtras.mm:
2539         * platform/mac/WebCoreObjCExtras.mm:
2540         * rendering/RenderThemeMac.mm:
2541
2542 2018-11-10  Benjamin Poulain  <benjamin@webkit.org>
2543
2544         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
2545         https://bugs.webkit.org/show_bug.cgi?id=191492
2546
2547         Reviewed by Alex Christensen.
2548
2549         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2550         * page/mac/EventHandlerMac.mm:
2551         * platform/mac/URLMac.mm:
2552         * platform/mac/WebCoreNSURLExtras.mm:
2553         * platform/mac/WebCoreObjCExtras.mm:
2554         * rendering/RenderThemeMac.mm:
2555         (WebCore::RenderThemeMac::systemColor const):
2556
2557 2018-11-10  Megan Gardner  <megan_gardner@apple.com>
2558
2559         Fix build for 32bit Mac
2560         https://bugs.webkit.org/show_bug.cgi?id=191511
2561
2562         Unreviewed Build Fix.
2563
2564         Build fix, not tests needed.
2565
2566         Make the apporiate delecrations for 32-bit mac support.
2567
2568         * editing/mac/DictionaryLookup.mm:
2569
2570 2018-11-10  Simon Fraser  <simon.fraser@apple.com>
2571
2572         Remove support for -webkit-svg-shadow
2573         https://bugs.webkit.org/show_bug.cgi?id=187429
2574         <rdar://problem/41920735>
2575
2576         Reviewed by Dean Jackson.
2577         
2578         -webkit-svg-shadow was a non-standard hack for online iWork, and they no longer use it,
2579         so remove it. No other browser supports it, and chromestatus say it's used on less than
2580         0.000001% of pages.
2581
2582         * css/CSSComputedStyleDeclaration.cpp:
2583         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2584         * css/CSSProperties.json:
2585         * css/SVGCSSComputedStyleDeclaration.cpp:
2586         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2587         * css/StyleBuilderCustom.h:
2588         (WebCore::StyleBuilderCustom::applyInitialWebkitSvgShadow): Deleted.
2589         (WebCore::StyleBuilderCustom::applyInheritWebkitSvgShadow): Deleted.
2590         (WebCore::StyleBuilderCustom::applyValueWebkitSvgShadow): Deleted.
2591         * css/parser/CSSPropertyParser.cpp:
2592         (WebCore::CSSPropertyParser::parseSingleValue):
2593         * rendering/RenderElement.cpp:
2594         (WebCore::RenderElement::didAttachChild):
2595         * rendering/svg/RenderSVGImage.cpp:
2596         (WebCore::RenderSVGImage::layout):
2597         * rendering/svg/RenderSVGImage.h:
2598         * rendering/svg/RenderSVGModelObject.cpp:
2599         (WebCore::RenderSVGModelObject::RenderSVGModelObject):
2600         * rendering/svg/RenderSVGModelObject.h:
2601         (WebCore::RenderSVGModelObject::repaintRectInLocalCoordinatesExcludingSVGShadow const): Deleted.
2602         (WebCore::RenderSVGModelObject::hasSVGShadow const): Deleted.
2603         (WebCore::RenderSVGModelObject::setHasSVGShadow): Deleted.
2604         * rendering/svg/RenderSVGRoot.cpp:
2605         (WebCore::RenderSVGRoot::RenderSVGRoot):
2606         (WebCore::RenderSVGRoot::updateCachedBoundaries):
2607         * rendering/svg/RenderSVGRoot.h:
2608         * rendering/svg/RenderSVGShape.cpp:
2609         (WebCore::RenderSVGShape::updateRepaintBoundingBox):
2610         * rendering/svg/RenderSVGShape.h:
2611         * rendering/svg/SVGRenderSupport.cpp:
2612         (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
2613         (WebCore::SVGRenderSupport::layoutChildren):
2614         (WebCore::SVGRenderSupport::styleChanged):
2615         (WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow): Deleted.
2616         (WebCore::SVGRenderSupport::rendererHasSVGShadow): Deleted.
2617         (WebCore::SVGRenderSupport::setRendererHasSVGShadow): Deleted.
2618         (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows): Deleted.
2619         (WebCore::SVGRenderSupport::childAdded): Deleted.
2620         * rendering/svg/SVGRenderSupport.h:
2621
2622 2018-11-10  Ryan Haddad  <ryanhaddad@apple.com>
2623
2624         Unreviewed, rolling out r238065.
2625
2626         Breaks internal builds.
2627
2628         Reverted changeset:
2629
2630         "Make it possible to edit images inline"
2631         https://bugs.webkit.org/show_bug.cgi?id=191352
2632         https://trac.webkit.org/changeset/238065
2633
2634 2018-11-10  Tim Horton  <timothy_horton@apple.com>
2635
2636         Make it possible to edit images inline
2637         https://bugs.webkit.org/show_bug.cgi?id=191352
2638         <rdar://problem/30107985>
2639
2640         Reviewed by Dean Jackson.
2641
2642         Tests: editing/images/basic-editable-image.html
2643                editing/images/reparent-editable-image-maintains-strokes.html
2644
2645         Add the beginnings of a mechanism to replace images with a special attribute
2646         with a native drawing view in the UI process.
2647
2648         * page/Settings.yaml:
2649         Add a setting to control whether images become natively editable when they
2650         have the x-apple-editable-image attribute.
2651
2652         * html/HTMLImageElement.cpp:
2653         (WebCore::HTMLImageElement::editableImageViewID const):
2654         Lazily generate an EmbeddedViewID and persist it on the <img> element.
2655
2656         * html/HTMLImageElement.h:
2657         Rearrange the service controls methods to sit before the members.
2658         Add m_editableImageViewID and editableImageViewID().
2659
2660         * platform/graphics/GraphicsLayer.cpp:
2661         (WebCore::GraphicsLayer::nextEmbeddedViewID):
2662         * platform/graphics/GraphicsLayer.h:
2663         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
2664         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
2665         on Cocoa platforms and when using RemoteLayerTree.
2666         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
2667         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
2668         and an EmbeddedViewID to uniquely identify and communicate about the
2669         embedded view (which may move between layers, since it is tied to an element).
2670
2671         * platform/graphics/ca/GraphicsLayerCA.cpp:
2672         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
2673         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
2674         When setting GraphicsLayer's contents to an embedded view, we use
2675         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
2676         GraphicsLayerCARemote will override this and make a correctly-initialized
2677         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
2678
2679         * platform/graphics/ca/GraphicsLayerCA.h:
2680         * platform/graphics/ca/PlatformCALayer.cpp:
2681         (WebCore::operator<<):
2682         * platform/graphics/ca/PlatformCALayer.h:
2683         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2684         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2685         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2686         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
2687         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
2688         These will be overridden by PlatformCALayerRemote to do more interesting things.
2689
2690         * rendering/RenderImage.cpp:
2691         (WebCore::RenderImage::isEditableImage const):
2692         Add a getter that return true if the setting is enabled and
2693         x-apple-editable-image is empty or true.
2694
2695         (WebCore::RenderImage::requiresLayer const):
2696         RenderImage requires a layer either if RenderReplaced does, or we are an
2697         editable image.
2698
2699         * rendering/RenderImage.h:
2700         * rendering/RenderLayer.cpp:
2701         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
2702         (WebCore::RenderLayer::calculateClipRects const):
2703         * rendering/RenderLayerBacking.cpp:
2704         (WebCore::RenderLayerBacking::updateConfiguration):
2705         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
2706
2707         * rendering/RenderLayerCompositor.cpp:
2708         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2709         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2710         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2711         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
2712         * rendering/RenderLayerCompositor.h:
2713         Make editable images require compositing implicitly.
2714
2715 2018-11-09  Zalan Bujtas  <zalan@apple.com>
2716
2717         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
2718         https://bugs.webkit.org/show_bug.cgi?id=191078
2719         <rdar://problem/45736178>
2720
2721         Reviewed by Antti Koivisto.
2722
2723         1. Improve visuallyNonEmpty milestone confidence level.
2724             Ignore whitespace and non visible text content.
2725             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
2726             Check if the html/body is actually visible.
2727
2728         2. Issue initial paint soon after the milestone fires.
2729             Use a 0ms timer to flush the initial paint.
2730             Throttle additional flushes for 500ms and 1.5s (original behaviour).
2731
2732         3. Suspend optional style recalcs and layouts while painting is being throttled.
2733            When parsing yields we initiate a 0ms style recalc/layout timer.
2734            These optional layouts produce content that we have no intention to paint. 
2735
2736         * dom/Document.cpp:
2737         (WebCore::Document::scheduleStyleRecalc):
2738         (WebCore::Document::shouldScheduleLayout):
2739         * page/ChromeClient.h:
2740         * page/FrameView.cpp:
2741         (WebCore::FrameView::resetLayoutMilestones):
2742         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
2743         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
2744         (WebCore::FrameView::updateIsVisuallyNonEmpty):
2745         * page/FrameView.h:
2746         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
2747         * platform/graphics/FontCascade.h:
2748         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
2749         (WebCore::RenderText::RenderText):
2750
2751 2018-11-09  John Wilander  <wilander@apple.com>
2752
2753         Add ability to configure document.cookie lifetime cap through user defaults
2754         https://bugs.webkit.org/show_bug.cgi?id=191480
2755         <rdar://problem/45240871>
2756
2757         Reviewed by Chris Dumez.
2758
2759         No new tests. Existing test makes sure we don't regress.
2760
2761         This change makes the capped lifetime in seconds configurable through
2762         user defaults.
2763
2764         * platform/network/NetworkStorageSession.h:
2765         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2766         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
2767         (WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): Deleted.
2768             Renamed setAgeCapForClientSideCookies().
2769         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2770         (WebCore::filterCookies):
2771         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
2772
2773 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
2774
2775         Unreviewed, rolling out r238047.
2776
2777         Introduced layout test failures on iOS simulator.
2778
2779         Reverted changeset:
2780
2781         "[iOS] Draw caps lock indicator in password fields"
2782         https://bugs.webkit.org/show_bug.cgi?id=190565
2783         https://trac.webkit.org/changeset/238047
2784
2785 2018-11-09  Tim Horton  <timothy_horton@apple.com>
2786
2787         Normal-flow-only flex items don't correctly respect z-index
2788         https://bugs.webkit.org/show_bug.cgi?id=191486
2789
2790         Reviewed by Simon Fraser.
2791
2792         Test: css3/flexbox/z-index-with-normal-flow-only.html
2793
2794         * rendering/RenderLayer.cpp:
2795         (WebCore::canCreateStackingContext):
2796         r125693 did not ensure that flex items which would otherwise be
2797         normal-flow-only would be put into the z-order tree when necessary.
2798         Fix by respecting the same trigger we use to make layers for flex items;
2799         namely, not having auto z-index.
2800
2801 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2802
2803         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels
2804         https://bugs.webkit.org/show_bug.cgi?id=191471
2805         <rdar://problem/45952472>
2806
2807         Reviewed by Tim Horton.
2808
2809         Add new method stubs for changing the list type for the current selection (to be implemented in a future patch).
2810
2811         * editing/Editor.cpp:
2812         (WebCore::Editor::canChangeSelectionListType):
2813         (WebCore::Editor::changeSelectionListType):
2814         * editing/Editor.h:
2815
2816 2018-11-09  Keith Rollin  <krollin@apple.com>
2817
2818         Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
2819
2820         Remove the use of .xcfilelists until their side-effects are better
2821         understood.
2822
2823         * WebCore.xcodeproj/project.pbxproj:
2824
2825 2018-11-09  Jer Noble  <jer.noble@apple.com>
2826
2827         SourceBuffer throws an error when appending a second init segment after changeType().
2828         https://bugs.webkit.org/show_bug.cgi?id=191474
2829
2830         Reviewed by Eric Carlson.
2831
2832         Test: media/media-source/media-source-changetype-second-init.html
2833
2834         When encountering an initialization segment after changeType(), add the parsed codec types
2835         to the list of allowed codecs.
2836
2837         * Modules/mediasource/SourceBuffer.cpp:
2838         (WebCore::SourceBuffer::validateInitializationSegment):
2839         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2840         (WebCore::MockMediaPlayerMediaSource::supportsType):
2841         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2842         (WebCore::MockSourceBufferPrivate::canSwitchToType):
2843         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2844
2845 2018-11-09  Eric Carlson  <eric.carlson@apple.com>
2846
2847         [MediaStream] AVVideoCaptureSource reports incorrect size when frames are scaled
2848         https://bugs.webkit.org/show_bug.cgi?id=191479
2849         <rdar://problem/45952201>
2850
2851         Reviewed by Jer Noble.
2852
2853         No new tests, tested manually.
2854
2855         * platform/mediastream/RealtimeVideoSource.cpp:
2856         (WebCore::RealtimeVideoSource::standardVideoSizes): Drive-by fix: add a few more standard
2857         video frame sizes, correct a typo.
2858         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): Drive-by fix: don't consider
2859         rescaled sized when we already have an exact or aspect ratio match because it won't be used.
2860
2861         * platform/mediastream/mac/AVVideoCaptureSource.h:
2862         (WebCore::AVVideoCaptureSource::width const): Deleted.
2863         (WebCore::AVVideoCaptureSource::height const): Deleted.
2864         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2865         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): Delete m_requestedSize.
2866         (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete m_width and m_height.
2867         (WebCore::AVVideoCaptureSource::processNewFrame): Don't call setSize with captured size,
2868         the frame may be resized before deliver.
2869
2870 2018-11-09  Ross Kirsling  <ross.kirsling@sony.com>
2871
2872         Unreviewed MSVC build fix after r238039 (and r238046).
2873
2874         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2875         * bindings/js/JSWorkerGlobalScopeBase.h:
2876
2877 2018-11-09  Basuke Suzuki  <basuke.suzuki@sony.com>
2878
2879         [Curl][WebKit] Implement Proxy configuration API.
2880         https://bugs.webkit.org/show_bug.cgi?id=189053
2881
2882         Reviewed by Youenn Fablet.
2883
2884         Added API to set proxy from the app.
2885
2886         No new tests because there's no behaviour change in WebCore.
2887
2888         * platform/network/NetworkStorageSession.h:
2889         * platform/network/curl/CurlContext.h:
2890         (WebCore::CurlContext::setProxySettings):
2891         * platform/network/curl/CurlProxySettings.h:
2892         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2893         (WebCore::NetworkStorageSession::setProxySettings const):
2894
2895 2018-11-09  Antti Koivisto  <antti@apple.com>
2896
2897         Use OptionSet for layout milestones
2898         https://bugs.webkit.org/show_bug.cgi?id=191470
2899
2900         Reviewed by Dean Jackson.
2901
2902         * WebCore.xcodeproj/project.pbxproj:
2903         * loader/EmptyFrameLoaderClient.h:
2904         * loader/FrameLoader.cpp:
2905         (WebCore::FrameLoader::didReachLayoutMilestone):
2906         * loader/FrameLoader.h:
2907         * loader/FrameLoaderClient.h:
2908         * page/FrameView.cpp:
2909         (WebCore::FrameView::FrameView):
2910         (WebCore::FrameView::addPaintPendingMilestones):
2911         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2912         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
2913         * page/FrameView.h:
2914         * page/LayoutMilestone.h: Copied from Source/WebCore/page/LayoutMilestones.h.
2915
2916         Renamed to appease WK2 IPC code generation.
2917
2918         * page/LayoutMilestones.h: Removed.
2919         * page/Page.cpp:
2920         (WebCore::Page::addLayoutMilestones):
2921         (WebCore::Page::removeLayoutMilestones):
2922         (WebCore::Page::isCountingRelevantRepaintedObjects const):
2923         * page/Page.h:
2924         (WebCore::Page::requestedLayoutMilestones const):
2925
2926 2018-11-09  Daniel Bates  <dabates@apple.com>
2927
2928         [iOS] Draw caps lock indicator in password fields
2929         https://bugs.webkit.org/show_bug.cgi?id=190565
2930         <rdar://problem/45262343>
2931
2932         Reviewed by Dean Jackson.
2933
2934         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
2935         fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the
2936         indicator when caps locks is enabled via the hardware keyboard. We will look to support the software
2937         keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>).
2938
2939         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
2940         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
2941         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
2942         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
2943         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
2944         web views listen for keyboard availability changes so as to update the the caps lock state when
2945         a hardware keyboard is detached or attached.
2946
2947         * WebCore.xcodeproj/project.pbxproj:
2948         * page/EventHandler.cpp:
2949         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
2950         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
2951         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
2952         * page/EventHandler.h:
2953         * platform/cocoa/KeyEventCocoa.mm:
2954         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
2955         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
2956         * platform/ios/KeyEventIOS.mm:
2957         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
2958         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
2959         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
2960         * platform/ios/WebEvent.h:
2961         * platform/ios/WebEvent.mm:
2962         (+[WebEvent modifierFlags]): Added.
2963         * platform/mac/KeyEventMac.mm:
2964         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
2965         by both Mac and iOS.
2966         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
2967         by both Mac and iOS.
2968         * rendering/RenderThemeCocoa.h:
2969         * rendering/RenderThemeCocoa.mm:
2970         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
2971         * rendering/RenderThemeIOS.h:
2972         * rendering/RenderThemeIOS.mm:
2973         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
2974         * rendering/RenderThemeMac.h:
2975         * rendering/RenderThemeMac.mm:
2976         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
2977         shared by both Mac and iOS.
2978
2979 2018-11-09  Chris Dumez  <cdumez@apple.com>
2980
2981         Unreviewed attempt to fix WinCairo build after r238039.
2982
2983         * bindings/js/JSWorkerGlobalScopeBase.h:
2984
2985 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
2986
2987         Extensions3DOpenGLES.h:  warning: 'blitFramebuffer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
2988         https://bugs.webkit.org/show_bug.cgi?id=191451
2989
2990         Reviewed by Dean Jackson.
2991
2992         No new tests because there is no behavior change.
2993
2994         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2995         (WebCore::Extensions3DOpenGLES::setEXTContextLostCallback): Deleted unused method.
2996         * platform/graphics/opengl/Extensions3DOpenGLES.h: Marked 'override'.
2997
2998 2018-11-09  Andy Estes  <aestes@apple.com>
2999
3000         [Payment Request] canMakePayment() should not consider serialized payment method data
3001         https://bugs.webkit.org/show_bug.cgi?id=191432
3002
3003         Reviewed by Dean Jackson.
3004
3005         In https://github.com/w3c/payment-request/pull/806, we're changing the specification of
3006         canMakePayment() to not consider serialized payment method data when deciding if a payment
3007         method is supported. For Apple Pay, this means we resolve to true for
3008         "https://apple.com/apple-pay", even if an ApplePayRequest is omitted or is missing required
3009         fields.
3010
3011         Added test cases to
3012         http/tests/paymentrequest/payment-request-canmakepayment-method.https.html and
3013         http/tests/paymentrequest/payment-request-show-method.https.html.
3014
3015         * Modules/paymentrequest/PaymentRequest.cpp:
3016         (WebCore::PaymentRequest::canMakePayment):
3017
3018 2018-11-09  Andy Estes  <aestes@apple.com>
3019
3020         [Payment Request] PaymentResponse.details should be updated when the user accepts a retried payment
3021         https://bugs.webkit.org/show_bug.cgi?id=191440
3022
3023         Reviewed by Dean Jackson.
3024
3025         PaymentResponse.details was being initialized in the PaymentResponse constructor and never
3026         updated when the user accepts a retried payment. We need to update it.
3027
3028         Added a test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
3029
3030         * Modules/paymentrequest/PaymentRequest.cpp:
3031         (WebCore::PaymentRequest::accept):
3032         * Modules/paymentrequest/PaymentResponse.cpp:
3033         (WebCore::PaymentResponse::PaymentResponse):
3034         (WebCore::PaymentResponse::setDetailsFunction):
3035         * Modules/paymentrequest/PaymentResponse.h:
3036
3037 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
3038
3039         MediaPlayerPrivateMediaFoundation.h: warning: 'GetService' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
3040         https://bugs.webkit.org/show_bug.cgi?id=191453
3041
3042         Reviewed by Per Arne Vollan.
3043
3044         No new tests because there is no behavior change.
3045
3046         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Marked with 'override' and removed 'virtual'.
3047
3048 2018-11-09  Chris Dumez  <cdumez@apple.com>
3049
3050         Unreviewed attempt to fix internal build on macOS.
3051
3052         'Export' is defined in several headers.
3053
3054         * bindings/js/JSDOMGlobalObject.cpp:
3055         * bindings/js/JSDOMGlobalObject.h:
3056         * bridge/jsc/BridgeJSC.cpp:
3057         * bridge/jsc/BridgeJSC.h:
3058
3059 2018-11-09  Chris Dumez  <cdumez@apple.com>
3060
3061         HTML form validation bubble disappears
3062         https://bugs.webkit.org/show_bug.cgi?id=191418
3063
3064         Reviewed by Simon Fraser.
3065
3066         If we validate a form and find an invalid form control, we'll scroll it into view and show
3067         the validation bubble. However, scrolling the element into view may be an asynchronous
3068         operation, in which case it would discard the validation bubble prematurely because scrolling
3069         hides the validation bubble. To address the issue, we now show the validation message
3070         asynchronously after focusing the element (and potentially scrolling it into view).
3071
3072         Test: fast/forms/scroll-into-view-and-show-validation-message.html
3073
3074         * html/HTMLFormControlElement.cpp:
3075         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
3076
3077 2018-11-09  Brent Fulgham  <bfulgham@apple.com>
3078
3079         [Windows][DirectX] Be more rigors about BeginFigure/EndFigure and Close operations. 
3080         https://bugs.webkit.org/show_bug.cgi?id=191452
3081         <rdar://problem/45933964>
3082
3083         Reviewed by Zalan Bujtas.
3084
3085         Do a better job of balancing the BeginFigure/EndFigure calls in
3086         the PathDirect2D implementation. Failure to do so puts the Geometry sink
3087         into an error state that prevents it from producing drawing output.
3088       
3089
3090         * platform/graphics/Path.h:
3091         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3092         (WebCore::GraphicsContext::drawPath): Flush is needed here.
3093         (WebCore::GraphicsContext::fillPath): Ditto.
3094         (WebCore::GraphicsContext::strokePath): Ditto.
3095         * platform/graphics/win/PathDirect2D.cpp:
3096         (WebCore::Path::drawDidComplete):
3097         (WebCore::Path::closeAnyOpenGeometries):
3098         (WebCore::Path::transform):
3099         (WebCore::Path::openFigureAtCurrentPointIfNecessary):
3100         (WebCore::Path::moveTo):
3101         (WebCore::Path::closeSubpath):
3102
3103 2018-11-09  Jer Noble  <jer.noble@apple.com>
3104
3105         [Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
3106         https://bugs.webkit.org/show_bug.cgi?id=191396
3107
3108         Reviewed by Eric Carlson.
3109
3110         When changeType() is called, exempt video and text tracks (in addition to just audio tracks)
3111         from "same codec" requirements.
3112
3113         * Modules/mediasource/SourceBuffer.cpp:
3114         (WebCore::SourceBuffer::validateInitializationSegment):
3115
3116 2018-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3117
3118         REGRESSION(r236365): [GTK] Many form-related tests are failing
3119         https://bugs.webkit.org/show_bug.cgi?id=189993
3120
3121         Reviewed by Michael Catanzaro.
3122
3123         Only the first form data element is added to the message body due to a return added by mistake in r236365.
3124
3125         * platform/network/soup/ResourceRequestSoup.cpp:
3126         (WebCore::ResourceRequest::updateSoupMessageBody const): Remove return.
3127
3128 2018-11-09  Zalan Bujtas  <zalan@apple.com>
3129
3130         [LFC][IFC] Move some code from InlineFormattingContext::Line to InlineFormattingContext/Geometry
3131         https://bugs.webkit.org/show_bug.cgi?id=191445
3132
3133         Reviewed by Antti Koivisto.
3134
3135         The idea here is that Line should not have to deal with all the post processig tasks like the runs final aligments.
3136         (The line class would eventually turn into a collection of random things).
3137
3138         * layout/inlineformatting/InlineFormattingContext.cpp:
3139         (WebCore::Layout::InlineFormattingContext::closeLine const):
3140         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
3141         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3142         * layout/inlineformatting/InlineFormattingContext.h:
3143         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
3144         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const):
3145         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3146         (WebCore::Layout::InlineFormattingContext::Geometry::adjustedLineLogicalLeft):
3147         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
3148         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
3149         * layout/inlineformatting/Line.cpp:
3150         (WebCore::Layout::InlineFormattingContext::Line::Line):
3151         (WebCore::Layout::InlineFormattingContext::Line::init):
3152         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
3153         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
3154         (WebCore::Layout::InlineFormattingContext::Line::close):
3155         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
3156         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): Deleted.
3157         (WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities): Deleted.
3158         (WebCore::Layout::InlineFormattingContext::Line::justifyRuns): Deleted.
3159
3160 2018-11-09  Philippe Normand  <pnormand@igalia.com>
3161
3162         Unreviewed, GStreamer build warning fix
3163
3164         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
3165         (WebCore::GStreamerVideoEncoder::newSampleCallback): Timesamp()
3166         returns a uint32_t, fix format string accordingly.
3167
3168 2018-11-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3169
3170         Add an SPI to allow WebView clients to add additional supported image formats
3171         https://bugs.webkit.org/show_bug.cgi?id=190454
3172
3173         Reviewed by Simon Fraser.
3174
3175         Add an SPI to allow additional supported image formats in WebView. These
3176         additional formats can be set in the WKWebViewConfiguration as an NSArray
3177         of NStrings. Each string represents an image source type aka UTI.
3178
3179         The ImageSourceType in the functions' names will be replaced by ImageType.
3180         ImageType in this context is the image UTI (Uniform Type Identifier).
3181
3182         * platform/MIMETypeRegistry.cpp:
3183         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
3184         (WebCore::MIMETypeRegistry::additionalSupportedImageMIMETypes):
3185         (WebCore::supportedImageMIMETypesForEncoding):
3186         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
3187         * platform/MIMETypeRegistry.h:
3188         * platform/graphics/cg/ImageDecoderCG.cpp:
3189         (WebCore::ImageDecoderCG::filenameExtension const):
3190         (WebCore::ImageDecoderCG::encodedDataStatus const):
3191         * platform/graphics/cg/ImageSourceCG.h:
3192         * platform/graphics/cg/ImageSourceCGMac.mm:
3193         (WebCore::MIMETypeForImageType):
3194         (WebCore::preferredExtensionForImageType):
3195         (WebCore::MIMETypeForImageSourceType): Deleted.
3196         (WebCore::preferredExtensionForImageSourceType): Deleted.
3197         * platform/graphics/cg/ImageSourceCGWin.cpp:
3198         (WebCore::MIMETypeForImageType):
3199         (WebCore::preferredExtensionForImageType):
3200         (WebCore::MIMETypeForImageSourceType): Deleted.
3201         (WebCore::preferredExtensionForImageSourceType): Deleted.
3202         * platform/graphics/cg/UTIRegistry.cpp:
3203         (WebCore::defaultSupportedImageTypes):
3204         (WebCore::additionalSupportedImageTypes):
3205         (WebCore::setAdditionalSupportedImageTypes):
3206         (WebCore::isSupportedImageType):
3207         (WebCore::supportedDefaultImageSourceTypes): Deleted.
3208         (WebCore::isSupportImageSourceType): Deleted.
3209         * platform/graphics/cg/UTIRegistry.h:
3210
3211 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
3212
3213         Adopt Reveal Framework to replace Lookup
3214         https://bugs.webkit.org/show_bug.cgi?id=191097
3215
3216         Reviewed by Tim Horton.
3217
3218         Reveal is not currently testable.
3219
3220         The Reveal framework does the same job as Lookup and DataDectors.
3221         In this patch we switch from using Lookup to determine what text
3222         to select and define to using Reveal and RVItems. Since this
3223         code needs to work on older systems, and Reveal is newer, we also need
3224         to keep around the old code for old systems so that they can also
3225         continue to work. Eventually we will remove this code and also likly switch
3226         to passing RVItems across from the web process rather than making them
3227         on each side.
3228
3229         * SourcesCocoa.txt:
3230         * WebCore.xcodeproj/project.pbxproj:
3231         * editing/mac/DictionaryLookup.h:
3232         * editing/mac/DictionaryLookup.mm:
3233
3234         Create a delegate to respond to Reveal and help draw the string or highlight.
3235
3236         (-[WebRevealHighlight initWithHighlightRect:useDefaultHighlight:attributedString:]):
3237         (-[WebRevealHighlight setClearTextIndicator:]):
3238         (-[WebRevealHighlight revealContext:rectsForItem:]):
3239         (-[WebRevealHighlight revealContext:drawRectsForItem:]):
3240         (-[WebRevealHighlight revealContext:shouldUseDefaultHighlightForItem:]):
3241         (-[WebRevealHighlight revealContext:stopHighlightingItem:]):
3242         (WebCore::showPopupOrCreateAnimationController):
3243
3244         Unify the code paths and utalize the Reveal framework to create and/or display the popovers.
3245
3246         (WebCore::DictionaryLookup::showPopup):
3247         (WebCore::DictionaryLookup::animationControllerForPopup):
3248
3249         Pipe the new callback through.
3250
3251         (WebCore::tokenRange): Deleted.
3252
3253         Only used with Lookup
3254
3255         (WebCore::selectionContainsPosition): Deleted.
3256
3257         Only used with Lookup.
3258
3259         * editing/mac/DictionaryLookupLegacy.mm: Copied from Source/WebCore/editing/mac/DictionaryLookup.mm.
3260
3261         Keep a copy of the previous implementation of DictionaryLookup, because Reveal not available on older
3262         system.
3263
3264         (WebCore::tokenRange):
3265         (WebCore::selectionContainsPosition):
3266         (WebCore::expandSelectionByCharacters):
3267         (WebCore::showPopupOrCreateAnimationController):
3268         (WebCore::DictionaryLookup::showPopup):
3269         (WebCore::DictionaryLookup::hidePopup):
3270         (WebCore::DictionaryLookup::animationControllerForPopup):
3271
3272 2018-11-08  Keith Rollin  <krollin@apple.com>
3273
3274         Create .xcfilelist files
3275         https://bugs.webkit.org/show_bug.cgi?id=191324
3276         <rdar://problem/45852819>
3277
3278         Reviewed by Alex Christensen.
3279
3280         As part of preparing for enabling XCBuild, create and use .xcfilelist
3281         files. These files are using during Run Script build phases in an
3282         Xcode project. If a Run Script build phase produces new files that are
3283         used later as inputs to subsequent build phases, XCBuild needs to know
3284         about these files. These files can be either specified in an "output
3285         files" section of the Run Script phase editor, or in .xcfilelist files
3286         that are associated with the Run Script build phase.
3287
3288         This patch takes the second approach. It consists of three sets of changes:
3289
3290         - Modify the DerivedSources.make files to have a
3291           'print_all_generated_files" target that produces a list of the files
3292           they create.
3293
3294         - Create a shell script that produces .xcfilelist files from the
3295           output of the previous step, as well as for the files created in the
3296           Generate Unified Sources build steps.
3297
3298         - Add the new .xcfilelist files to the associated projects.
3299
3300         Note that, with these changes, the Xcode workspace and projects can no
3301         longer be fully loaded into Xcode 9. Xcode will attempt to load the
3302         projects that have .xcfilelist files associated with them, but will
3303         fail and display a placeholder for those projects instead. It's
3304         expected that all developers are using Xcode 10 by now and that not
3305         being able to load into Xcode 9 is not a practical issue. Keep in mind
3306         that this is strictly an IDE issue, and that the projects can still be
3307         built with `xcodebuild`.
3308
3309         Also note that the shell script that creates the .xcfilelist files can
3310         also be used to verify that the set of files that's currently checked
3311         in is up-to-date. This checking can be used as part of a check-in hook
3312         or part of check-webkit-style to sooner catch cases where the
3313         .xcfilelist files need to be regenerated.
3314
3315         No new tests -- no changed functionality.
3316
3317         * DerivedSources.make:
3318         * DerivedSources.xcfilelist: Added.
3319         * UnifiedSources.xcfilelist: Added.
3320         * WebCore.xcodeproj/project.pbxproj:
3321
3322 2018-11-08  Don Olmstead  <don.olmstead@sony.com>
3323
3324         Provide generic implementation of SSLKeyGenerator functions
3325         https://bugs.webkit.org/show_bug.cgi?id=191428
3326
3327         Reviewed by Michael Catanzaro.
3328
3329         No new tests. No change in behavior.
3330
3331         Both SSLKeyGeneratorGLib and SSLKeyGeneratorIOS were stub
3332         implementations. Since <keygen> is deprecated it looks unlikely that
3333         an implementation is actually needed, however an implementation is
3334         needed until support is reomved.
3335
3336         * Sources.txt:
3337         * SourcesCocoa.txt:
3338         * WebCore.xcodeproj/project.pbxproj:
3339         * platform/SSLKeyGenerator.cpp: Added.
3340         (WebCore::getSupportedKeySizes):
3341         (WebCore::signedPublicKeyAndChallengeString):
3342         * platform/SourcesGLib.txt:
3343         * platform/glib/SSLKeyGeneratorGLib.cpp: Removed.
3344         * platform/ios/SSLKeyGeneratorIOS.cpp: Removed.
3345
3346 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
3347
3348         Unprefix text-decoration CSS3 properties
3349         https://bugs.webkit.org/show_bug.cgi?id=127193
3350
3351         Reviewed by Dean Jackson.
3352
3353         The properties are stable, and there is interop.
3354
3355         Test: fast/css3-text/css3-text-decoration/unprefix.html
3356
3357         * css/CSSComputedStyleDeclaration.cpp:
3358         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3359         * css/CSSProperties.json:
3360         * css/StyleResolver.cpp:
3361         (WebCore::shouldApplyPropertyInParseOrder):
3362         (WebCore::isValidVisitedLinkProperty):
3363         * css/parser/CSSParserFastPaths.cpp:
3364         (WebCore::isColorPropertyID):
3365         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3366         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3367         * css/parser/CSSPropertyParser.cpp:
3368         (WebCore::CSSPropertyParser::parseSingleValue):
3369         * editing/cocoa/DataDetection.mm:
3370         (WebCore::DataDetection::detectContentInRange):
3371         * rendering/TextDecorationPainter.cpp:
3372         (WebCore::decorationColor):
3373         * rendering/style/RenderStyle.cpp:
3374         (WebCore::RenderStyle::colorIncludingFallback const):
3375         (WebCore::RenderStyle::visitedDependentColor const):
3376
3377 2018-11-08  Timothy Hatcher  <timothy@apple.com>
3378
3379         Add experimental support for a `supported-color-schemes` CSS property.
3380         https://bugs.webkit.org/show_bug.cgi?id=191319
3381         rdar://problem/45852261
3382
3383         Reviewed by Dean Jackson.
3384
3385         Tests: css-dark-mode/parse-supported-color-schemes.html
3386                css-dark-mode/supported-color-schemes-css.html
3387
3388         * WebCore.xcodeproj/project.pbxproj:
3389         * css/CSSComputedStyleDeclaration.cpp:
3390         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3391         * css/CSSProperties.json:
3392         * css/CSSValueKeywords.in:
3393         * css/StyleBuilderConverter.h:
3394         (WebCore::StyleBuilderConverter::updateSupportedColorSchemes):
3395         (WebCore::StyleBuilderConverter::convertSupportedColorSchemes):
3396         * css/StyleResolver.cpp:
3397         (WebCore::StyleResolver::colorFromPrimitiveValue const):