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