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