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