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