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