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