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