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