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