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