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