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