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