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