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