Remove superfluous LayoutUnit initializations
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-17  Ross Kirsling  <ross.kirsling@sony.com>
2
3         Remove superfluous LayoutUnit initializations
4         https://bugs.webkit.org/show_bug.cgi?id=191791
5
6         Reviewed by Simon Fraser.
7
8         First step toward making LayoutUnit constructors explicit:
9         eliminate `= 0` when constructing LayoutUnit lvalues.
10
11         * editing/Editor.cpp:
12         (WebCore::Editor::firstRectForRange const):
13         * editing/FrameSelection.cpp:
14         (WebCore::FrameSelection::modify):
15         (WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
16         * html/shadow/SliderThumbElement.cpp:
17         (WebCore::RenderSliderContainer::computeLogicalHeight const):
18         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
19         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
20         * page/FrameView.cpp:
21         (WebCore::FrameView::forceLayoutForPagination):
22         * page/SpatialNavigation.cpp:
23         (WebCore::scrollInDirection):
24         (WebCore::distanceDataForNode):
25         * rendering/AutoTableLayout.cpp:
26         (WebCore::AutoTableLayout::layout):
27         * rendering/GridTrackSizingAlgorithm.cpp:
28         (WebCore::marginIntrinsicLogicalWidthForChild):
29         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
30         * rendering/InlineFlowBox.cpp:
31         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
32         (WebCore::InlineFlowBox::paintFillLayer):
33         (WebCore::InlineFlowBox::paintBoxDecorations):
34         (WebCore::InlineFlowBox::paintMask):
35         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
36         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
37         * rendering/RenderBlock.cpp:
38         (WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
39         (WebCore::RenderBlock::layoutPositionedObject):
40         (WebCore::RenderBlock::selectionGapRectsForRepaint):
41         (WebCore::RenderBlock::paintSelection):
42         (WebCore::RenderBlock::textIndentOffset const):
43         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
44         * rendering/RenderBlockFlow.cpp:
45         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
46         (WebCore::RenderBlockFlow::layoutBlock):
47         (WebCore::RenderBlockFlow::layoutBlockChildren):
48         (WebCore::RenderBlockFlow::marginValuesForChild const):
49         (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
50         (WebCore::RenderBlockFlow::applyBeforeBreak):
51         (WebCore::RenderBlockFlow::applyAfterBreak):
52         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
53         (WebCore::RenderBlockFlow::clearFloats):
54         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
55         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
56         (WebCore::RenderBlockFlow::addOverhangingFloats):
57         (WebCore::RenderBlockFlow::getClearDelta):
58         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
59         * rendering/RenderBlockLineLayout.cpp:
60         (WebCore::setLogicalWidthForTextRun):
61         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
62         (WebCore::RenderBlockFlow::determineStartPosition):
63         * rendering/RenderBox.cpp:
64         (WebCore::RenderBox::fillAvailableMeasure const):
65         (WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
66         (WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
67         (WebCore::RenderBox::computePercentageLogicalHeight const):
68         (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
69         (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
70         (WebCore::RenderBox::computePositionedLogicalHeightUsing const):
71         (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
72         (WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
73         * rendering/RenderBoxModelObject.cpp:
74         (WebCore::RenderBoxModelObject::computedCSSPadding const):
75         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
76         * rendering/RenderDeprecatedFlexibleBox.cpp:
77         (WebCore::marginWidthForChild):
78         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
79         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
80         * rendering/RenderFileUploadControl.cpp:
81         (WebCore::RenderFileUploadControl::paintObject):
82         * rendering/RenderFragmentedFlow.cpp:
83         (WebCore::RenderFragmentedFlow::validateFragments):
84         (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
85         (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
86         * rendering/RenderFrameSet.cpp:
87         (WebCore::RenderFrameSet::paint):
88         * rendering/RenderListItem.cpp:
89         (WebCore::RenderListItem::positionListMarker):
90         * rendering/RenderListMarker.cpp:
91         (WebCore::RenderListMarker::computePreferredLogicalWidths):
92         (WebCore::RenderListMarker::updateMargins):
93         * rendering/RenderMultiColumnSet.cpp:
94         (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
95         * rendering/RenderRubyRun.cpp:
96         (WebCore::RenderRubyRun::layoutBlock):
97         * rendering/RenderTable.cpp:
98         (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
99         (WebCore::RenderTable::layout):
100         (WebCore::RenderTable::offsetWidthForColumn const):
101         (WebCore::RenderTable::offsetHeightForColumn const):
102         (WebCore::RenderTable::outerBorderBefore const):
103         (WebCore::RenderTable::outerBorderAfter const):
104         (WebCore::RenderTable::outerBorderStart const):
105         (WebCore::RenderTable::outerBorderEnd const):
106         * rendering/RenderTableCell.cpp:
107         (WebCore::RenderTableCell::logicalWidthFromColumns const):
108         (WebCore::RenderTableCell::computeIntrinsicPadding):
109         * rendering/RenderTableSection.cpp:
110         (WebCore::RenderTableSection::calcRowLogicalHeight):
111         (WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
112         (WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
113         (WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
114         (WebCore::RenderTableSection::layoutRows):
115         (WebCore::RenderTableSection::calcOuterBorderBefore const):
116         (WebCore::RenderTableSection::calcOuterBorderAfter const):
117         (WebCore::RenderTableSection::calcOuterBorderStart const):
118         (WebCore::RenderTableSection::calcOuterBorderEnd const):
119         * rendering/RootInlineBox.cpp:
120         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
121         (WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
122         (WebCore::RootInlineBox::lineSnapAdjustment const):
123         (WebCore::RootInlineBox::verticalPositionForBox):
124         * rendering/line/BreakingContext.h:
125         (WebCore::inlineLogicalWidth):
126         * rendering/mathml/RenderMathMLBlock.cpp:
127         (WebCore::RenderMathMLBlock::layoutItems):
128         * rendering/mathml/RenderMathMLFraction.cpp:
129         (WebCore::RenderMathMLFraction::layoutBlock):
130         * rendering/mathml/RenderMathMLOperator.cpp:
131         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
132         * rendering/mathml/RenderMathMLRoot.cpp:
133         (WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
134         (WebCore::RenderMathMLRoot::paint):
135         * rendering/mathml/RenderMathMLRow.cpp:
136         (WebCore::RenderMathMLRow::computePreferredLogicalWidths):
137         * rendering/mathml/RenderMathMLScripts.cpp:
138         (WebCore::RenderMathMLScripts::layoutBlock):
139         * rendering/mathml/RenderMathMLUnderOver.cpp:
140         (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
141         (WebCore::RenderMathMLUnderOver::layoutBlock):
142         * rendering/style/RenderStyle.cpp:
143         (WebCore::RenderStyle::getShadowInsetExtent const):
144         * rendering/svg/RenderSVGText.cpp:
145         (WebCore::RenderSVGText::layout):
146
147 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
148
149         Avoid triggering compositing updates when only the root layer is composited
150         https://bugs.webkit.org/show_bug.cgi?id=191813
151
152         Reviewed by Zalan Bujtas.
153
154         If we know that the only composited layer is the root, we can avoid triggering deep
155         compositing updates sometimes, for example when layout changes size or position,
156         or when z-order lists change.
157
158         * rendering/RenderLayer.cpp:
159         (WebCore::RenderLayer::addChild):
160         (WebCore::RenderLayer::removeChild):
161         (WebCore::RenderLayer::updateLayerPosition):
162         (WebCore::RenderLayer::scrollTo):
163         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
164         (WebCore::outputPaintOrderTreeRecursive):
165         * rendering/RenderLayerCompositor.cpp:
166         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
167         flag to cut off descendants traversal when possible.
168         (WebCore::RenderLayerCompositor::layerStyleChanged):
169
170 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
171
172         Fix an error in 238354 - !=, not ==.
173         
174         Fixes test failures.
175
176         * rendering/RenderLayerCompositor.cpp:
177         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
178
179 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
180
181         Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code.
182         https://bugs.webkit.org/show_bug.cgi?id=191810
183
184         Reviewed by Zalan Bujtas.
185
186         Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other
187         than the RenderView's layer.
188
189         hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing
190         because no content layer is composited, and overlays don't require compositing, so
191         rename it.
192
193         * rendering/RenderLayerCompositor.cpp:
194         (WebCore::RenderLayerCompositor::updateCompositingLayers):
195         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
196         (WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const):
197         (WebCore::RenderLayerCompositor::layerBecameComposited):
198         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
199         (WebCore::RenderLayerCompositor::layerTreeAsText):
200         (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted.
201         * rendering/RenderLayerCompositor.h:
202
203 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
204
205         Rename RenderLayerCompositor::inCompositingMode() to usesCompositing()
206         https://bugs.webkit.org/show_bug.cgi?id=191808
207
208         Reviewed by Zalan Bujtas.
209
210         Other code uses "usesCompositing" so standardize on that (future changes will make
211         "compositing mode" more ambiguous). Also remove a FrameView function that only
212         had one caller.
213
214         * page/FrameView.cpp:
215         (WebCore::FrameView::clearBackingStores):
216         (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange):
217         (WebCore::FrameView::delegatesScrollingDidChange):
218         (WebCore::FrameView::hasCompositedContent const): Deleted.
219         * page/FrameView.h:
220         * rendering/RenderLayer.cpp:
221         (WebCore::RenderLayer::addChild):
222         (WebCore::RenderLayer::removeChild):
223         (WebCore::RenderLayer::rebuildZOrderLists):
224         (WebCore::RenderLayer::updateLayerPosition):
225         (WebCore::RenderLayer::scrollTo):
226         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
227         * rendering/RenderLayerCompositor.cpp:
228         (WebCore::RenderLayerCompositor::updateCompositingPolicy):
229         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
230         (WebCore::RenderLayerCompositor::layerStyleChanged):
231         (WebCore::RenderLayerCompositor::updateBacking):
232         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
233         (WebCore::RenderLayerCompositor::setIsInWindow):
234         (WebCore::RenderLayerCompositor::needsToBeComposited const):
235         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
236         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
237         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
238         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
239         * rendering/RenderLayerCompositor.h:
240         * rendering/RenderView.cpp:
241         (WebCore::RenderView::repaintViewAndCompositedLayers):
242         (WebCore::RenderView::usesCompositing const):
243
244 2018-11-17  Devin Rousso  <drousso@apple.com>
245
246         Web Inspector: Network: add button to show system certificate dialog
247         https://bugs.webkit.org/show_bug.cgi?id=191458
248         <rdar://problem/45977019>
249
250         Reviewed by Joseph Pecoraro.
251
252         Test: http/tests/inspector/network/getSerializedCertificate.html
253
254         * inspector/agents/InspectorNetworkAgent.h:
255         * inspector/agents/InspectorNetworkAgent.cpp:
256         (WebCore::InspectorNetworkAgent::getSerializedCertificate): Added.
257
258         * inspector/InspectorFrontendHost.idl:
259         * inspector/InspectorFrontendHost.h:
260         * inspector/InspectorFrontendHost.cpp:
261         (WebCore::InspectorFrontendHost::supportsShowCertificate): Added.
262         (WebCore::InspectorFrontendHost::showCertificate): Added.
263         * inspector/InspectorFrontendClient.h:
264         (InspectorFrontendClient::showCertificate): Added.
265         * testing/Internals.cpp:
266         (InspectorStubFrontend::showCertificate): Added.
267
268         * platform/network/cf/CertificateInfo.h:
269         (WTF::Persistence::encodeCFData): Added.
270         (WTF::Persistence::decodeCFData): Added.
271         (WTF::Persistence::encodeSecTrustRef): Added.
272         (WTF::Persistence::decodeSecTrustRef): Added.
273         (WTF::Persistence::encodeCertificateChain): Added.
274         (WTF::Persistence::decodeCertificateChain): Added.
275         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
276         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
277         * platform/network/cf/CertificateInfoCFNet.cpp:
278         * platform/network/cocoa/CertificateInfoCocoa.mm:
279
280         * platform/network/curl/CertificateInfo.h:
281         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
282         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
283
284         * platform/network/soup/CertificateInfo.h:
285         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added.
286         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added.
287         (WTF::Persistence::certificatesDataListFromCertificateInfo): Added.
288         (WTF::Persistence::certificateFromCertificatesDataList): Added.
289         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
290         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
291
292 2018-11-17  Zalan Bujtas  <zalan@apple.com>
293
294         [LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules.
295         https://bugs.webkit.org/show_bug.cgi?id=191801
296
297         Reviewed by Antti Koivisto.
298
299         before<span style="position: relative">positioned</span>after
300         In the example above the <positioned> inline box has both the BreakAtStart and the BreakAtEnd rules.
301         While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too,
302         we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule.
303
304         Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html
305
306         * layout/inlineformatting/InlineFormattingContext.cpp:
307         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
308         * layout/inlineformatting/InlineFormattingState.cpp:
309         (WebCore::Layout::InlineFormattingState::addDetachingRule):
310         * layout/inlineformatting/InlineFormattingState.h:
311         (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
312
313 2018-11-17  Jonathan Hammer  <jonathan@e3software.com>
314
315         Caret stops blinking after context menu shown
316         https://bugs.webkit.org/show_bug.cgi?id=191715
317
318         Reviewed by Ryosuke Niwa.
319
320         Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
321         the caret continues to blink even after the context menu is dismissed. The normal
322         way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
323         not apply in the case of context menus because handleMouseReleaseEvent is not
324         called once the context menu is up.
325
326         Test: fast/events/contextmenu-dismiss-blink-caret.html
327
328         * page/EventHandler.cpp:
329         (WebCore::EventHandler::sendContextMenuEvent):
330         * testing/Internals.cpp:
331         (WebCore::Internals::isCaretBlinkingSuspended):
332         * testing/Internals.h:
333         * testing/Internals.idl:
334
335 2018-11-16  Antoine Quint  <graouts@apple.com>
336
337         [Pointer Events] event.isPrimary doesn't always represent the oldest active touch
338         https://bugs.webkit.org/show_bug.cgi?id=191752
339         <rdar://problem/46129270>
340
341         Reviewed by Dean Jackson.
342
343         Provide isPrimary to the constructor so its value can be determined at the call site.
344
345         Test: pointerevents/ios/pointer-events-is-primary.html
346
347         * dom/PointerEvent.h:
348         * dom/ios/PointerEventIOS.cpp:
349         (WebCore::PointerEvent::create):
350         (WebCore::PointerEvent::PointerEvent):
351         (WebCore::m_isPrimary):
352
353 2018-11-16  Alex Christensen  <achristensen@webkit.org>
354
355         Tweak _showSafeBrowsingWarningWithTitle SPI
356         https://bugs.webkit.org/show_bug.cgi?id=191799
357
358         Reviewed by Wenson Hsieh.
359
360         It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari.
361         Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning.
362         The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings.
363
364         Covered by updated API tests.
365
366         * en.lproj/Localizable.strings:
367         * platform/LocalizedStrings.cpp:
368         (WebCore::formControlCancelButtonTitle):
369         Make "Cancel"'s description a little more generic.
370
371 2018-11-16  Simon Fraser  <simon.fraser@apple.com>
372
373         Optimize composited iframe layer hookup
374         https://bugs.webkit.org/show_bug.cgi?id=191778
375
376         Reviewed by Zalan Bujtas.
377
378         The change made in r238229 can be more targeted; we only need to hook up iframe content
379         layers when the layer is already composited (otherwise the updateBacking() above would have triggered
380         the work), and when it's a RenderWidget layer.
381         
382         Tested by existing tests.
383
384         * rendering/RenderLayer.cpp:
385         (WebCore::outputPaintOrderTreeRecursive):
386         * rendering/RenderLayerCompositor.cpp:
387         (WebCore::RenderLayerCompositor::layerStyleChanged):
388
389 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
390
391         Provide default implementation of Widget
392         https://bugs.webkit.org/show_bug.cgi?id=191784
393
394         Reviewed by Michael Catanzaro.
395
396         * SourcesWPE.txt:
397         * platform/Widget.cpp:
398         (WebCore::Widget::Widget):
399         (WebCore::Widget::frameRect const):
400         (WebCore::Widget::~Widget):
401         (WebCore::Widget::setFrameRect):
402         (WebCore::Widget::paint):
403         (WebCore::Widget::setFocus):
404         (WebCore::Widget::setCursor):
405         (WebCore::Widget::show):
406         (WebCore::Widget::hide):
407         (WebCore::Widget::setIsSelected):
408         * platform/gtk/WidgetGtk.cpp:
409         (WebCore::Widget::Widget): Deleted.
410         (WebCore::Widget::frameRect const): Deleted.
411         * platform/win/WidgetWin.cpp:
412         (WebCore::Widget::Widget): Deleted.
413         (WebCore::Widget::frameRect const): Deleted.
414         * platform/wpe/WidgetWPE.cpp: Removed.
415
416 2018-11-16  Chris Dumez  <cdumez@apple.com>
417
418         [macOS] Label "prewarmed" WebContent processes in Activity Monitor
419         https://bugs.webkit.org/show_bug.cgi?id=191765
420         <rdar://problem/45953463>
421
422         Reviewed by Geoffrey Garen.
423
424         * en.lproj/Localizable.strings:
425
426 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
427
428         Enable external playback for video in element fullscreen.
429         https://bugs.webkit.org/show_bug.cgi?id=190359
430         rdar://problem/42560085
431
432         Reviewed by Jer Noble.
433
434         No new tests because we don't have a good way to test external playback.
435
436         Any video that might be auto-pipped from element fullscreen should also enable external playback for video out.
437         PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active,
438         allow PiP, but disable external playback while PiP is active.
439
440         * html/HTMLMediaElement.cpp:
441         (WebCore::HTMLMediaElement::setVideoFullscreenStandby):
442         * html/HTMLMediaElement.h:
443         * platform/graphics/MediaPlayer.cpp:
444         (WebCore::MediaPlayer::setVideoFullscreenStandby):
445         (WebCore::MediaPlayer::videoFullscreenStandby const):
446         * platform/graphics/MediaPlayer.h:
447         (WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const):
448         * platform/graphics/MediaPlayerPrivate.h:
449         (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby):
450         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
451         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby):
452         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
453
454 2018-11-16  Jer Noble  <jer.noble@apple.com>
455
456         Regression(r233865): Causes synchronous IPC in the middle of layout
457         https://bugs.webkit.org/show_bug.cgi?id=188307
458         <rdar://problem/42807306>
459
460         Reviewed by Eric Carlson.
461
462         Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to
463         query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the
464         steps of the requestFullscreen() method on the next run loop, allowing messages from the
465         UIProcess about page visibilty to be delivered first.
466
467         * dom/Document.cpp:
468         (WebCore::Document::requestFullScreenForElement):
469         * html/HTMLMediaElement.cpp:
470         (WebCore::HTMLMediaElement::enterFullscreen):
471         * html/HTMLMediaElement.h:
472         * page/ChromeClient.h:
473
474 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
475
476         Provide default implementation of Cursor
477         https://bugs.webkit.org/show_bug.cgi?id=191772
478
479         Reviewed by Michael Catanzaro.
480
481         * SourcesWPE.txt:
482         * platform/Cursor.cpp:
483         (WebCore::Cursor::ensurePlatformCursor const):
484         * platform/wpe/CursorWPE.cpp: Removed.
485
486 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
487
488         EditorWPE should be EditorLibWPE
489         https://bugs.webkit.org/show_bug.cgi?id=191774
490
491         Reviewed by Michael Catanzaro.
492
493         The platform specific implementations of Editor are all around the
494         platform's Pasteboard. Since the Pasteboard implementation is now based
495         around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE.
496
497         * SourcesWPE.txt:
498         * editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp.
499
500 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
501
502         Include AirPlay destination name in AirPlay placard.
503         https://bugs.webkit.org/show_bug.cgi?id=191574
504         rdar://problem/45536144
505
506         Reviewed by Eric Carlson.
507
508         Updated existing tests.
509
510         Include the name of the AirPlay destination in the video element's AirPlay placard.
511
512         * Modules/modern-media-controls/controls/airplay-placard.js:
513         (AirplayPlacard):
514         * Modules/modern-media-controls/controls/placard.js:
515         * Modules/modern-media-controls/media/placard-support.js:
516         (PlacardSupport.prototype._updatePlacard):
517         (PlacardSupport.prototype._updateAirPlayPlacard):
518         (PlacardSupport):
519         * en.lproj/modern-media-controls-localized-strings.js:
520
521 2018-11-16  Zalan Bujtas  <zalan@apple.com>
522
523         Add DidFirstMeaningfulPaint milestone.
524         https://bugs.webkit.org/show_bug.cgi?id=191754
525
526         Reviewed by Simon Fraser.
527
528         This milestone fires sone after the paint triggered by the first visually non-empty layout.
529
530         * page/FrameView.cpp:
531         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
532         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
533         * page/LayoutMilestone.h:
534
535 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
536
537         Provide default implementations of Image and Icon
538         https://bugs.webkit.org/show_bug.cgi?id=191764
539
540         Reviewed by Michael Catanzaro.
541
542         Makes IconWPE and ImageWPE implementations the default.
543
544         * Sources.txt:
545         * SourcesWPE.txt:
546         * platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp.
547         * platform/graphics/Image.cpp:
548         (WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports.
549         (WebCore::Image::loadPlatformResource):
550         * platform/graphics/wpe/ImageWPE.cpp: Removed.
551
552 2018-11-16  Brent Fulgham  <bfulgham@apple.com>
553
554         [Win] Reduce the use of WKSI library calls: CFNetwork
555         https://bugs.webkit.org/show_bug.cgi?id=191718
556         <rdar://problem/46108732>
557
558         Reviewed by Alex Christensen.
559
560         Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just
561         make the same calls on Windows, like we did for iOS and macOS back in 2017.
562
563         Stop including WebKitSystemInterface.h for files that used to rely on it
564         for font-related features.
565         
566         Tested by existing Windows regression tests. There should be no change in behavior.
567
568         * platform/graphics/win/FontCacheWin.cpp:
569         * platform/graphics/win/FontCustomPlatformData.cpp:
570         * platform/graphics/win/FontPlatformDataCGWin.cpp:
571         * platform/network/cf/CookieStorageCFNet.cpp:
572         * platform/network/cf/CredentialStorageCFNet.cpp:
573         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
574         (WebCore::createPrivateStorageSession):
575         (WebCore::NetworkStorageSession::switchToNewTestingSession):
576         (WebCore::NetworkStorageSession::ensureSession):
577         * platform/network/cf/ResourceError.h:
578         * platform/network/cf/ResourceErrorCF.cpp:
579         (WebCore::getSSLPeerCertificateData):
580         (WebCore::setSSLPeerCertificateData):
581         (WebCore::ResourceError::getSSLPeerCertificateDataBytePtr):
582         (WebCore::ResourceError::platformLazyInit):
583         (WebCore::ResourceError::cfError const):
584         * platform/network/cf/ResourceHandleCFNet.cpp:
585         (WebCore::setClientCertificateInSSLProperties):
586         (WebCore::ResourceHandle::createCFURLConnection):
587         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
588         * platform/network/cf/ResourceRequestCFNet.cpp:
589         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
590
591 2018-11-16  Timothy Hatcher  <timothy@apple.com>
592
593         Add html{color:text} to the simpleUserAgentStyleSheet on macOS.
594         https://bugs.webkit.org/show_bug.cgi?id=191760
595
596         Reviewed by Antti Koivisto.
597
598         * css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside
599         a PLATFORM(MAC) copy of the string.
600
601 2018-11-16  Jer Noble  <jer.noble@apple.com>
602
603         An early return from updateSchedulingInfo can leave some variables uninitialized.
604         https://bugs.webkit.org/show_bug.cgi?id=191755
605         <rdar://problem/39910089>
606
607         Reviewed by Brent Fulgham.
608
609         * Modules/webaudio/AudioBufferSourceNode.cpp:
610         (WebCore::AudioBufferSourceNode::process):
611         * Modules/webaudio/AudioScheduledSourceNode.cpp:
612         (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
613         * Modules/webaudio/OscillatorNode.cpp:
614         (WebCore::OscillatorNode::process):
615
616 2018-11-16  Alicia Boya García  <aboya@igalia.com>
617
618         [MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
619         https://bugs.webkit.org/show_bug.cgi?id=191578
620
621         Reviewed by Xabier Rodriguez-Calvar.
622
623         Changing the demuxer to READY state (which is done only in the main
624         thread) triggers the unlinking of its srcpads, which in turns emits a
625         caps change notification in the previously linked element since they
626         become unnegotiated again.
627
628         We are not interested in caps notifications in these cases, so let's
629         just ignore caps notifications emitted from the main thread.
630
631         This fixes an assertion failure in the debug builds.
632
633         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
634         (WebCore::AppendPipeline::AppendPipeline):
635
636 2018-11-16  Sihui Liu  <sihui_liu@apple.com>
637
638         Storing blobs in IDB on iOS: "Error preparing blob/file"
639         https://bugs.webkit.org/show_bug.cgi?id=188438
640         <rdar://problem/43097279>
641
642         Reviewed by Alex Christensen.
643
644         Grant sandbox extension of temp folder to network process, because we suggested network process had access to 
645         the folder on iOS device but it didn't. 
646
647         This makes some existing tests about IDB blob pass on iOS device.
648
649         * Modules/indexeddb/server/IDBBackingStore.h:
650         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
651         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
652         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
653         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
654         * Modules/indexeddb/shared/InProcessIDBServer.h:
655
656 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
657
658         Add USE(LIBWPE) to WebCore
659         https://bugs.webkit.org/show_bug.cgi?id=191401
660
661         Reviewed by Michael Catanzaro.
662
663         No new tests. No change in behavior.
664
665         Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to
666         USE(LIBWPE) instead.
667
668         Renames classes and files to use the suffix LibWPE.
669
670         * PlatformWPE.cmake:
671         * SourcesWPE.txt:
672         * platform/Pasteboard.h:
673         * platform/PasteboardStrategy.h:
674         * platform/PlatformKeyboardEvent.h:
675         * platform/PlatformPasteboard.h:
676         * platform/graphics/PlatformDisplay.cpp:
677         (WebCore::PlatformDisplay::createPlatformDisplay):
678         * platform/graphics/PlatformDisplay.h:
679         * platform/graphics/egl/GLContextEGL.h:
680         * platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp.
681         (WebCore::GLContextEGL::createWPEContext):
682         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
683         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
684         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp.
685         (WebCore::PlatformDisplayLibWPE::create):
686         (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE):
687         (WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE):
688         (WebCore::PlatformDisplayLibWPE::initialize):
689         * platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h.
690         * platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp.
691         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp.
692         * platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp.
693
694 2018-11-16  Zalan Bujtas  <zalan@apple.com>
695
696         [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
697         https://bugs.webkit.org/show_bug.cgi?id=191712
698         <rdar://problem/45612900>
699
700         Reviewed by Simon Fraser.
701
702         In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
703         In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
704         and no need to dispatch a click event.
705         The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
706         only for tooltip-like reasons and it's ok to proceed with the click event.
707
708         Test: fast/events/touch/ios/click-instead-of-hover-simple.html
709
710         * rendering/updating/RenderTreeUpdater.cpp:
711         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
712
713 2018-11-16  Zalan Bujtas  <zalan@apple.com>
714
715         [LFC][IFC] Add support for out-of-flow positioned boxes
716         https://bugs.webkit.org/show_bug.cgi?id=191726
717
718         Reviewed by Antti Koivisto.
719
720         While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure
721         that their out-of-flow descendants get laid out as well.
722
723         Test: fast/inline/simple-inline-with-out-of-flow-descendant.html
724
725         * layout/inlineformatting/InlineFormattingContext.cpp:
726         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
727         * layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root.
728         (WebCore::Layout::TreeBuilder::createSubTree):
729
730 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
731
732         [GStreamer][WebRTC] Add API to enable/disable device mocks
733         https://bugs.webkit.org/show_bug.cgi?id=191699
734
735         This basically us to test MediaStream/WebRTC support without
736         requiring cameras or microphones and is quite useful.
737
738         Also fix the GStreamerAudioMock by:
739           - Stop setting `leaky-upstream` on the GStreamerCapturer queue,
740             this was usefull when we were trying to bring the MediaStream
741             sources inside the main pipeline, it is not the case anymore
742             (and not doable with latest version of LibWebRTC).
743           - Use a 'ticks' wave on the gstreamer audiotestsrc so the test
744             stream is similar to what Apple port does.
745
746         Reviewed by Xabier Rodriguez-Calvar.
747
748         The mocks are already tested and the API is really simple.
749
750         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
751         (WebCore::GStreamerAudioCapturer::createSource):
752         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
753         * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
754         (WebCore::GStreamerCapturer::addSink):
755         * platform/mediastream/gstreamer/GStreamerCapturer.h:
756
757 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
758
759         [GStreamer][MediaStream] Handle track addition and removal
760         https://bugs.webkit.org/show_bug.cgi?id=191599
761
762         Reviewed by Xabier Rodriguez-Calvar.
763
764         Test: fast/mediastream/MediaStream-video-element-remove-track.html
765
766         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
767         (WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
768         (WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
769         (WebCore::webkitMediaStreamSrcFinalize):
770         (WebCore::webkitMediaStreamSrcChangeState):
771         (WebCore::webkit_media_stream_src_init):
772         (WebCore::webkitMediaStreamSrcSetupSrc):
773         (WebCore::webkitMediaStreamSrcAddTrack):
774         (WebCore::webkitMediaStreamSrcRemoveTrackByType):
775         (WebCore::webkitMediaStreamSrcSetStream):
776
777 2018-11-16  Zan Dobersek  <zdobersek@igalia.com>
778
779         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
780         https://bugs.webkit.org/show_bug.cgi?id=191354
781
782         Reviewed by Michael Catanzaro.
783
784         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
785         index validity and, if the index is valid, check for completeness of the
786         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
787         also only retrieve duration for already-complete frames.
788
789         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
790         as that method goes on and decodes image data to determine specific
791         information. The ImageSource class that's querying this information
792         doesn't anticipate this, and doesn't handle the increased memory
793         consumption of the decoded data, leaving MemoryCache in the blind about
794         the image resource's actual amount of consumed memory. ImageSource can
795         instead gracefully handle any incomplete frame by marking the decoding
796         status for this frame as only partial.
797
798         * platform/image-decoders/ScalableImageDecoder.cpp:
799         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
800         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
801         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
802
803 2018-11-16  Antoine Quint  <graouts@apple.com>
804
805         PointerEvents should not require touch event listeners to be registered
806         https://bugs.webkit.org/show_bug.cgi?id=191333
807         <rdar://problem/45857523>
808
809         Reviewed by Dean Jackson.
810
811         Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html
812                pointerevents/ios/pointer-events-prevent-default.html
813
814         * dom/EventNames.h:
815         (WebCore::EventNames::isTouchEventType const):
816         (WebCore::EventNames::touchAndPointerEventNames const):
817         (WebCore::EventNames::touchEventNames const): Deleted.
818         * dom/Node.cpp:
819         (WebCore::Node::moveNodeToNewDocument):
820
821 2018-11-15  Zalan Bujtas  <zalan@apple.com>
822
823         [iOS] Do not get stuck in indeterminate content observation state.
824         https://bugs.webkit.org/show_bug.cgi?id=191719
825
826         Reviewed by Simon Fraser.
827
828         Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in
829         the "can't decide yet if it's a hover or click" state.
830         This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch.
831
832         Test: fast/events/touch/ios/stuck-with-hover-state.html
833
834         * platform/ios/wak/WKContentObservation.cpp:
835         (WebThreadRemoveObservedContentModifier):
836
837 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
838
839         REGRESSION (r238090) Composited iframes that resize from zero don't show
840         https://bugs.webkit.org/show_bug.cgi?id=191733
841         rdar://problem/46107764
842
843         Reviewed by Zalan Bujtas.
844         
845         A zero-sized iframe whose contents are composited should not trigger compositing in the
846         parent document (see code in requiresCompositingForFrame()), but when the <iframe> element
847         was resized without a style change (e.g. because it's width: 100%, height: 100% and the
848         parent resizes), there was no code that triggered a compositing update.
849
850         Fix by having RenderLayer::updateLayerPosition() trigger an update when the size changes,
851         for a RenderWidget whose contents are composited.
852
853         Test: compositing/iframes/resize-from-zero-size.html
854
855         * rendering/RenderLayer.cpp:
856         (WebCore::RenderLayer::updateLayerPosition):
857
858 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
859
860         Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
861         https://bugs.webkit.org/show_bug.cgi?id=158342
862         rdar://problem/26652811
863
864         Reviewed by Zalan Bujtas.
865         
866         Patch partly by Frédéric Wang.
867
868         This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
869         overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
870         created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
871         assertion in debug mode and prevents the user from scrolling the overflow node in release
872         mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
873         the remaining issues by forcing a configuration update after layout in order to ensure that
874         RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
875         composited, trigger a post-layout update that is necessary to check if we need to make it
876         composited when it gains scrollable overflow.
877
878         Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html
879                fast/scrolling/ios/change-scrollability-on-content-resize.html
880
881         * rendering/RenderLayer.cpp:
882         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
883         RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
884         RenderLayerBacking::m_scrollingLayer.
885
886 2018-11-15  Fujii Hironori  <Hironori.Fujii@sony.com>
887
888         [curl] warning: delete called on non-final 'WebCore::CurlDownload' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
889         https://bugs.webkit.org/show_bug.cgi?id=191582
890
891         Reviewed by Alex Christensen.
892
893         No new tests because there's no behaviour change.
894
895         * platform/network/curl/CurlDownload.h: Marked CurlDownload final.
896
897 2018-11-15  Truitt Savell  <tsavell@apple.com>
898
899         Unreviewed, rolling out r238244.
900
901         Caused High Sierra test runs to fail early with 50 crashes and
902         casued 25 API failures.
903
904         Reverted changeset:
905
906         "[css-logical] Implement flow-relative margin, padding and
907         border shorthands"
908         https://bugs.webkit.org/show_bug.cgi?id=188697
909         https://trac.webkit.org/changeset/238244
910
911 2018-11-15  Jer Noble  <jer.noble@apple.com>
912
913         AVKit will set videoGravity to a nil string when building against iosmac
914         https://bugs.webkit.org/show_bug.cgi?id=191573
915
916         Reviewed by Dean Jackson.
917
918         Workaround AVKit behavior by treating nil videoGravity as the default,
919         which is AVLayerVideoGravityResizeAspect.
920
921         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
922         (-[WebAVPlayerLayer setVideoGravity:]):
923
924 2018-11-15  Brent Fulgham  <bfulgham@apple.com>
925
926         [Win] Reduce the use of WKSI library calls: Font Handling
927         https://bugs.webkit.org/show_bug.cgi?id=191701
928         <rdar://problem/46104809>
929
930         Reviewed by Myles C. Maxfield.
931
932         Move the old Windows font handling code out of WKSI to our regular
933         repository. We now handle SPI differently, and don't need to keep
934         these implementations in a separate library. This should also help
935         avoid the somewhat frequent build failures caused when WKSI is not
936         updated in sync with WebKit.
937
938         Tested by existing Windows test cases.
939
940         * platform/graphics/FontCascade.h:
941         * platform/graphics/win/FontCGWin.cpp:
942         (WebCore::FontCascade::drawGlyphs):
943         (WebCore::FontCascade::setFontSmoothingLevel):
944         (WebCore::setCGFontSmoothingStyle):
945         (WebCore::FontCascade::setFontSmoothingStyle):
946         (WebCore::FontCascade::setFontSmoothingContrast):
947         (WebCore::clearTypeContrast):
948         (WebCore::FontCascade::systemFontSmoothingChanged):
949         (WebCore::FontCascade::setCGContextFontRenderingStyle):
950         (WebCore::renderingStyleForFont):
951         (WebCore::FontCascade::getGlyphAdvances):
952         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
953         (WebCore::GlyphPage::fill):
954         * platform/graphics/win/GraphicsContextCGWin.cpp:
955         (WebCore::GraphicsContext::drawFocusRing):
956         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
957         * platform/graphics/win/SimpleFontDataCGWin.cpp:
958         (WebCore::Font::platformWidthForGlyph const):
959         * rendering/RenderMediaControls.cpp:
960         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
961
962 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
963
964         [WebAuthN] Use a real nonce for CTAPHID_INIT
965         https://bugs.webkit.org/show_bug.cgi?id=191533
966         <rdar://problem/46103502>
967
968         Reviewed by Brent Fulgham.
969
970         New tests are added into existing test files.
971
972         * Modules/webauthn/fido/FidoConstants.h:
973
974 2018-11-15  Justin Fan  <justin_fan@apple.com>
975
976         [WebGPU] WebGPUCommandBuffer prototype
977         https://bugs.webkit.org/show_bug.cgi?id=191663
978
979         Reviewed by Dean Jackson.
980
981         Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue).
982
983         Test: webgpu/command-buffers.html
984
985         * CMakeLists.txt:
986         * DerivedSources.make:
987         * Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer.
988         * Modules/webgpu/GPUDevice.cpp:
989         (WebCore::GPUDevice::createCommandBuffer): Added.
990         (WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue.
991         * Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue.
992         (WebCore::GPUDevice::platformDevice const):
993         * Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue.
994         (WebCore::GPUQueue::platformQueue const):
995         * Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h.
996         (WebCore::GPURenderPipeline::platformRenderPipeline const):
997         * Modules/webgpu/GPUShaderModule.h:
998         (WebCore::GPUShaderModule::platformShaderModule const):
999         * Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h.
1000         (WebCore::GPUSwapChain::platformLayer const):
1001         * Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer.
1002         (WebCore::WebGPUCommandBuffer::create):
1003         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
1004         * Modules/webgpu/WebGPUCommandBuffer.h: Added.
1005         * Modules/webgpu/WebGPUCommandBuffer.idl: Added.
1006         * Modules/webgpu/WebGPUDevice.cpp:
1007         (WebCore::WebGPUDevice::createCommandBuffer const): Added.
1008         * Modules/webgpu/WebGPUDevice.h:
1009         * Modules/webgpu/WebGPUDevice.idl:
1010         * Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer.
1011         (WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue.
1012         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
1013         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
1014         (WebCore::GPUDevice::GPUDevice):
1015         * Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue.
1016         (WebCore::GPUQueue::create):
1017         (WebCore::GPUQueue::GPUQueue):
1018         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
1019         (WebCore::GPURenderPipeline::GPURenderPipeline):
1020         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
1021         (WebCore::GPUShaderModule::create):
1022         (WebCore::GPUShaderModule::GPUShaderModule):
1023         * Sources.txt:
1024         * SourcesCocoa.txt:
1025         * WebCore.xcodeproj/project.pbxproj:
1026         * bindings/js/WebCoreBuiltinNames.h:
1027
1028 2018-11-15  Oriol Brufau  <obrufau@igalia.com>
1029
1030         [css-logical] Implement flow-relative margin, padding and border shorthands
1031         https://bugs.webkit.org/show_bug.cgi?id=188697
1032
1033         Reviewed by Simon Fraser and Antti Koivisto.
1034
1035         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
1036                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
1037                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
1038                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
1039                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
1040                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
1041                webexposed/css-properties-as-js-properties.html
1042                webexposed/css-properties-behind-flags.html
1043                webexposed/css-property-listing.html
1044
1045         * css/CSSComputedStyleDeclaration.cpp:
1046         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1047         Allow the new properties to serialize their computed value.
1048
1049         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
1050         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
1051         * css/CSSComputedStyleDeclaration.h:
1052         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
1053         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
1054         shorthands.
1055
1056         * css/CSSProperties.json:
1057         Add the new properties behind the CSSLogicalEnabled runtime flag.
1058
1059         * css/CSSStyleDeclaration.cpp:
1060         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
1061         Prevent CSS properties disabled behind a runtime flag from being exposed in
1062         style declarations.
1063
1064         * css/StyleProperties.cpp:
1065         (WebCore::StyleProperties::getPropertyValue const):
1066         Allow the new properties to serialize their specified value.
1067
1068         (WebCore::StyleProperties::get2Values const):
1069         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
1070
1071         (WebCore::StyleProperties::borderPropertyValue const):
1072         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
1073         corresponding to width, style and color.
1074
1075         (WebCore::MutableStyleProperties::setProperty):
1076         Prevent CSS properties disabled behind a runtime flag from being set a value.
1077
1078         (WebCore::StyleProperties::asText const):
1079         Allow the new properties to be serialized in cssText.
1080         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
1081         and serialize the longhands instead. Note that there could be another shorthand
1082         available which is enabled, but a proper solution would require bug 190496.
1083
1084         * css/StyleProperties.h:
1085         Update declarations of borderPropertyValue and get2Values.
1086
1087         * css/makeprop.pl:
1088         (addProperty):
1089         Add isEnabledCSSProperty function for checking that a CSS property is not
1090         disabled behind a runtime flag.
1091
1092         * css/parser/CSSPropertyParser.cpp:
1093         (WebCore::cssPropertyID):
1094         Prevent CSS properties disabled behind a runtime flag from being exposed in
1095         computed styles.
1096
1097         (WebCore::CSSPropertyParser::addProperty):
1098         Prevent CSS properties disabled behind a runtime flag from being set a value.
1099
1100         (WebCore::CSSPropertyParser::consumeBorder):
1101         Change consumeBorder to provide the caller with the parsed values instead of
1102         setting properties. Then the caller can decide to which properties the values
1103         should be set, and whether border-image should be reset or not.
1104
1105         (WebCore::CSSPropertyParser::consume2ValueShorthand):
1106         (WebCore::CSSPropertyParser::consume4ValueShorthand):
1107         Rename consume4Values to consume4ValueShorthand, and add analogous
1108         consume2ValueShorthand for parsing shorthands with two longhands.
1109
1110         (WebCore::CSSPropertyParser::parseShorthand):
1111         Allow the new properties to be parsed.
1112
1113         * css/parser/CSSPropertyParser.h:
1114         Update declarations of consumeBorder, consume2ValueShorthand and
1115         consume4ValueShorthand.
1116
1117         * inspector/agents/InspectorCSSAgent.cpp:
1118         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
1119         Prevent CSS properties disabled behind a runtime flag from being exposed in
1120         the CSS inspector tool.
1121
1122         * page/RuntimeEnabledFeatures.h:
1123         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
1124         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
1125         Add the CSSLogicalEnabled runtime flag.
1126
1127 2018-11-15  Truitt Savell  <tsavell@apple.com>
1128
1129         Unreviewed, rolling out r238220.
1130
1131         Introduced failing tests to iOS and is slowing down EWS
1132
1133         Reverted changeset:
1134
1135         "[css-grid] Consider scrollbars in
1136         populateGridPositionsForDirection()"
1137         https://bugs.webkit.org/show_bug.cgi?id=191656
1138         https://trac.webkit.org/changeset/238220
1139
1140 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
1141
1142         [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
1143         https://bugs.webkit.org/show_bug.cgi?id=191522
1144
1145         Reviewed by Brent Fulgham.
1146
1147         Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
1148         https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
1149
1150         Covered by existing tests.
1151
1152         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1153         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
1154
1155 2018-11-15  Ross Kirsling  <ross.kirsling@sony.com>
1156
1157         DragImage should have a complete default implementation
1158         https://bugs.webkit.org/show_bug.cgi?id=191666
1159
1160         Reviewed by Dean Jackson.
1161
1162         Move WPE's stub implementation down into the base implementation file.
1163
1164         * SourcesWPE.txt:
1165         * platform/DragImage.cpp:
1166         (WebCore::dragImageSize):
1167         (WebCore::deleteDragImage):
1168         (WebCore::scaleDragImage):
1169         (WebCore::dissolveDragImageToFraction):
1170         (WebCore::createDragImageFromImage):
1171         (WebCore::createDragImageIconForCachedImageFilename):
1172         (WebCore::createDragImageForLink):
1173         * platform/wpe/DragImageWPE.cpp: Removed.
1174
1175 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
1176
1177         [WebAuthN] UserHandle can be null
1178         https://bugs.webkit.org/show_bug.cgi?id=191521
1179
1180         Reviewed by Alex Christensen.
1181
1182         According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f.
1183         UserHandle can now be null.
1184
1185         Covered by existing tests.
1186
1187         * Modules/webauthn/AuthenticatorAssertionResponse.h:
1188         (WebCore::AuthenticatorAssertionResponse::create):
1189         (WebCore::AuthenticatorAssertionResponse::userHandle const):
1190         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
1191         * Modules/webauthn/AuthenticatorAssertionResponse.idl:
1192         * Modules/webauthn/PublicKeyCredential.cpp:
1193         (WebCore::PublicKeyCredential::tryCreate):
1194         * Modules/webauthn/PublicKeyCredentialData.h:
1195         (WebCore::PublicKeyCredentialData::encode const):
1196         (WebCore::PublicKeyCredentialData::decode):
1197         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
1198         (fido::readCTAPGetAssertionResponse):
1199
1200 2018-11-15  Youenn Fablet  <youenn@apple.com>
1201
1202         Modernize RTCPeerConnection handling of pendingActivity
1203         https://bugs.webkit.org/show_bug.cgi?id=191661
1204
1205         Reviewed by Eric Carlson.
1206
1207         makePendingActivity is the modern way to handle set/unset of pending activity.
1208         No change of behavior.
1209
1210         * Modules/mediastream/RTCPeerConnection.cpp:
1211         (WebCore::RTCPeerConnection::create):
1212         (WebCore::RTCPeerConnection::doStop):
1213         * Modules/mediastream/RTCPeerConnection.h:
1214
1215 2018-11-15  Keith Rollin  <krollin@apple.com>
1216
1217         Delete old .xcfilelist files
1218         https://bugs.webkit.org/show_bug.cgi?id=191669
1219         <rdar://problem/46081994>
1220
1221         Reviewed by Chris Dumez.
1222
1223         .xcfilelist files were created and added to the Xcode project files in
1224         https://trac.webkit.org/changeset/238008/webkit. However, they caused
1225         build issues and they were removed from the Xcode projects in
1226         https://trac.webkit.org/changeset/238055/webkit. This check-in removes
1227         the files from the repository altogether. They'll ultimately be
1228         replaced with new files with names that indicate whether the
1229         associated files are inputs to the Run Script phase or are files
1230         created by the Run Script phase.
1231
1232         No new tests -- no changed functionality.
1233
1234         * DerivedSources.xcfilelist: Removed.
1235         * UnifiedSources.xcfilelist: Removed.
1236
1237 2018-11-15  Youenn Fablet  <youenn@apple.com>
1238
1239         Update RTCPeerConnection JS built-ins to be closer to specWe
1240         https://bugs.webkit.org/show_bug.cgi?id=191665
1241
1242         Reviewed by Eric Carlson.
1243
1244         Simplify JS built-ins since we no longer need to support callback versions of the API.
1245         Make sure to have the right number of parameters in the JS built-in functions.
1246         Make some simplification to the code.
1247         Covered by existing tests and rebased test.
1248
1249         * Modules/mediastream/RTCPeerConnection.js:
1250         (createOffer):
1251         (createAnswer):
1252         (setLocalDescription):
1253         (setRemoteDescription):
1254         (addIceCandidate):
1255         * Modules/mediastream/RTCPeerConnectionInternals.js:
1256         (enqueueOperation):
1257         (callbacksAndDictionaryOverload): Deleted.
1258
1259 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
1260
1261         REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
1262         https://bugs.webkit.org/show_bug.cgi?id=191673
1263         rdar://problem/46083440
1264
1265         Reviewed by Antti Koivisto.
1266
1267         Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
1268         tree for every Frame. They get re-attached on tab show, and for subframes this involves
1269         the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
1270         
1271         The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
1272         fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
1273         layer configuration update that gets iframe layers parented.
1274         
1275         This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
1276         patch will optimize this, and add a layout test.
1277
1278         * rendering/RenderLayerCompositor.cpp:
1279         (WebCore::RenderLayerCompositor::layerStyleChanged):
1280
1281 2018-11-15  Zalan Bujtas  <zalan@apple.com>
1282
1283         [LFC][IFC] Skip non-inflow boxes while splitting the inline runs.
1284         https://bugs.webkit.org/show_bug.cgi?id=191690
1285
1286         Reviewed by Antti Koivisto.
1287
1288         Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context.
1289
1290         * layout/Verification.cpp:
1291         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
1292         * layout/inlineformatting/InlineFormattingContext.cpp:
1293         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1294
1295 2018-11-15  Zalan Bujtas  <zalan@apple.com>
1296
1297         [LFC] FormattingContext base class should not declare computeStaticPosition.
1298         https://bugs.webkit.org/show_bug.cgi?id=191683
1299
1300         Reviewed by Antti Koivisto.
1301
1302         Apparently only BlockFormattingContext uses it.
1303
1304         * layout/FormattingContext.h:
1305         * layout/blockformatting/BlockFormattingContext.h:
1306         * layout/inlineformatting/InlineFormattingContext.cpp:
1307         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted.
1308         * layout/inlineformatting/InlineFormattingContext.h:
1309
1310 2018-11-14  Zalan Bujtas  <zalan@apple.com>
1311
1312         [LFC][IFC] Add support for in-flow positioned inline boxes.
1313         https://bugs.webkit.org/show_bug.cgi?id=191672
1314
1315         Reviewed by Antti Koivisto.
1316
1317         We might offset the in-flow positioned runs differently once runs are moved over to the display tree.
1318
1319         Test: fast/inline/simple-inline-inflow-positioned.html
1320
1321         * layout/Verification.cpp:
1322         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
1323         * layout/inlineformatting/InlineFormattingContext.cpp:
1324         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const):
1325         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
1326         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
1327         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1328         * layout/inlineformatting/InlineFormattingContext.h:
1329         * layout/inlineformatting/InlineRun.h:
1330         (WebCore::Layout::InlineRun::moveVertically):
1331         * layout/layouttree/LayoutTreeBuilder.cpp:
1332         (WebCore::Layout::outputInlineRuns):
1333
1334 2018-11-15  Thibault Saunier  <tsaunier@igalia.com>
1335
1336         [GStreamer][WebRTC] Add support for sending silence or silencing an incoming track
1337         https://bugs.webkit.org/show_bug.cgi?id=191631
1338
1339         Reviewed by Xabier Rodriguez-Calvar.
1340
1341         This will be tested once webkit.org/b/186933 is implemented.
1342
1343         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
1344         (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
1345         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
1346         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
1347
1348 2018-11-15  Antti Koivisto  <antti@apple.com>
1349
1350         REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out
1351         https://bugs.webkit.org/show_bug.cgi?id=191642
1352
1353         Reviewed by Zalan Bujtas.
1354
1355         Invalidate access key map even when thorttling style recalcs.
1356
1357         * dom/Document.cpp:
1358         (WebCore::Document::scheduleStyleRecalc):
1359
1360 2018-11-15  Antti Koivisto  <antti@apple.com>
1361
1362         Remove fonts from CSSFontFaceSet safely
1363         https://bugs.webkit.org/show_bug.cgi?id=191676
1364
1365         Reviewed by Zalan Bujtas.
1366
1367         Test: fast/text/font-face-set-remove-safely.html
1368
1369         * css/CSSFontFaceSet.cpp:
1370         (WebCore::CSSFontFaceSet::remove):
1371
1372 2018-11-15  Manuel Rego Casasnovas  <rego@igalia.com>
1373
1374         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
1375         https://bugs.webkit.org/show_bug.cgi?id=191656
1376
1377         Reviewed by Javier Fernandez.
1378
1379         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
1380         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
1381         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
1382
1383         The patch modifies the method so it takes into account scrollbar size
1384         in order to compute the position of the columns/rows depending on the direction and the writing mode.
1385
1386         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
1387                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
1388                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
1389
1390         * rendering/RenderGrid.cpp:
1391         (WebCore::RenderGrid::populateGridPositionsForDirection):
1392
1393 2018-11-14  Keith Rollin  <krollin@apple.com>
1394
1395         Move scripts for Derived and Unified Sources to external files
1396         https://bugs.webkit.org/show_bug.cgi?id=191670
1397         <rdar://problem/46082278>
1398
1399         Reviewed by Keith Miller.
1400
1401         Move the scripts in the Generate Derived Sources and Generate Unified
1402         Sources Run Script phases from the Xcode projects to external shell
1403         script files. Then invoke those scripts from the Run Script phases.
1404         This refactoring is being performed to support later work that will
1405         invoke these scripts in other contexts.
1406
1407         The scripts were maintained as-is when making the move. I did a little
1408         reformatting and added 'set -e' to the top of each file, but that's
1409         it.
1410
1411         No new tests -- no changed functionality.
1412
1413         * Scripts/generate-derived-sources.sh: Added.
1414         * Scripts/generate-unified-sources.sh: Added.
1415         * WebCore.xcodeproj/project.pbxproj:
1416
1417 2018-11-14  Keith Rollin  <krollin@apple.com>
1418
1419         Fix #end vs. #endif typo.
1420         https://bugs.webkit.org/show_bug.cgi?id=191668
1421         <rdar://problem/46081704>
1422
1423         Reviewed by Alexey Proskuryakov.
1424
1425         Source/WebCore/SourcesCocoa.txt had a #end that should have been a
1426         #endif. Fix this, an add a check to generate-unified-source-bundles.rb
1427         to detect similar typos.
1428
1429         No new tests -- no changed functionality.
1430
1431         * SourcesCocoa.txt:
1432
1433 2018-11-14  Keith Rollin  <krollin@apple.com>
1434
1435         Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt
1436         https://bugs.webkit.org/show_bug.cgi?id=191667
1437         <rdar://problem/46081286>
1438
1439         Reviewed by Eric Carlson.
1440
1441         VideoFullscreenLayerManager.mm no longer exists.
1442
1443         No new tests -- No changed functionality.
1444
1445         * SourcesCocoa.txt:
1446
1447 2018-11-14  Timothy Hatcher  <timothy@apple.com>
1448
1449         Enabled dark mode CSS support by default.
1450         https://bugs.webkit.org/show_bug.cgi?id=191609
1451         rdar://problem/46046861
1452
1453         Reviewed by Megan Gardner.
1454
1455         * page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true.
1456
1457 2018-11-14  Timothy Hatcher  <timothy@apple.com>
1458
1459         Default the view background color and text color to different values when in dark mode.
1460         https://bugs.webkit.org/show_bug.cgi?id=191607
1461         rdar://problem/46045854
1462
1463         Reviewed by Dean Jackson.
1464
1465         Test: css-dark-mode/default-colors.html
1466
1467         * css/html.css:
1468         (html): Set color: text on macOS.
1469         * dom/Document.cpp:
1470         (WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor().
1471         * editing/EditingStyle.cpp:
1472         (WebCore::caretColorFromStyle): Added.
1473         (WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for
1474         caret-color directly since removeEquivalentProperties fails with semantic colors.
1475         (WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color
1476         directly since removeEquivalentProperties fails with semantic colors.
1477         * page/Frame.cpp:
1478         (WebCore::Frame::createView): Drop backgroundColor.
1479         * page/Frame.h:
1480         * page/FrameView.cpp:
1481         (WebCore::FrameView::recalculateBaseBackgroundColor): Added.
1482         (WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument.
1483         Calculate the backgroundColor based on the transparent argument only.
1484         * page/FrameView.h:
1485         * platform/graphics/Color.h:
1486         (WebCore::equalIgnoringSemanticColor): Added for EditingStyle.
1487         * rendering/RenderBox.cpp:
1488         (WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor().
1489         * rendering/RenderLayerBacking.cpp:
1490         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor()
1491         since it ignores the semantic color flag.
1492         * testing/Internals.cpp:
1493         (WebCore::Internals::setViewIsTransparent): Drop backgroundColor.
1494         (WebCore::Internals::viewBaseBackgroundColor): Added.
1495         * testing/Internals.h:
1496         * testing/Internals.idl: Added viewBaseBackgroundColor.
1497
1498 2018-11-14  Justin Fan  <justin_fan@apple.com>
1499
1500         [WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
1501         https://bugs.webkit.org/show_bug.cgi?id=191383
1502
1503         Reviewed by Dean Jackson.
1504
1505         Covered by existing WebGPU tests introduced in original patch.
1506
1507         * Modules/webgpu/GPUDevice.h:
1508         * Modules/webgpu/GPUPipelineStageDescriptor.h:
1509         * Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member.
1510         (): Refactored into enum class.
1511         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction.
1512         (WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member.
1513         * Modules/webgpu/GPUShaderModule.h:
1514         * Modules/webgpu/WebGPUDevice.cpp:
1515         (WebCore::WebGPUDevice::createRenderPipeline const):
1516         * Modules/webgpu/WebGPUShaderModule.h:
1517         (WebCore::WebGPUShaderModule::module const):
1518         * Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL.
1519         * Modules/webgpu/cocoa/GPURenderPipeline.h:
1520         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
1521         (WebCore::setFunctionsForPipelineDescriptor):
1522         (WebCore::GPURenderPipeline::create):
1523         * Modules/webgpu/cocoa/GPUSwapChain.h:
1524         * WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase.
1525
1526 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
1527
1528         Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
1529         https://bugs.webkit.org/show_bug.cgi?id=191612
1530
1531         Reviewed by Matt Baker.
1532
1533         * inspector/InspectorController.cpp:
1534         (WebCore::InspectorController::connectFrontend):
1535         (WebCore::InspectorController::disconnectFrontend):
1536         (WebCore::InspectorController::show):
1537         * inspector/InspectorController.h:
1538         * inspector/WorkerInspectorController.cpp:
1539         (WebCore::WorkerInspectorController::connectFrontend):
1540         (WebCore::WorkerInspectorController::disconnectFrontend):
1541         * page/PageDebuggable.cpp:
1542         (WebCore::PageDebuggable::connect):
1543         (WebCore::PageDebuggable::disconnect):
1544         * page/PageDebuggable.h:
1545         * testing/Internals.cpp:
1546         (WebCore::InspectorStubFrontend::InspectorStubFrontend):
1547         (WebCore::InspectorStubFrontend::closeWindow):
1548         * workers/service/context/ServiceWorkerDebuggable.cpp:
1549         (WebCore::ServiceWorkerDebuggable::connect):
1550         (WebCore::ServiceWorkerDebuggable::disconnect):
1551         * workers/service/context/ServiceWorkerDebuggable.h:
1552         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
1553         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
1554         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
1555         * workers/service/context/ServiceWorkerInspectorProxy.h:
1556
1557 2018-11-14  Timothy Hatcher  <timothy@apple.com>
1558
1559         Update prefers-color-scheme media query matching based on GitHub issue #3278.
1560         https://bugs.webkit.org/show_bug.cgi?id=191654
1561         rdar://problem/46074307
1562
1563         Reviewed by Simon Fraser.
1564
1565         Test: css-dark-mode/prefers-color-scheme.html
1566
1567         * css/MediaQueryEvaluator.cpp:
1568         (WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
1569         for `no-preference` since there is no macOS option for no user preference.
1570         * css/MediaQueryExpression.cpp:
1571         (WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.
1572
1573 2018-11-14  Devin Rousso  <drousso@apple.com>
1574
1575         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
1576         https://bugs.webkit.org/show_bug.cgi?id=191628
1577
1578         Reviewed by Dean Jackson.
1579
1580         Updated existing test: inspector/model/recording.html
1581
1582         * inspector/InspectorCanvas.h:
1583         * inspector/InspectorCanvas.cpp:
1584         (WebCore::InspectorCanvas::indexForData):
1585         (WebCore::InspectorCanvas::buildInitialState):
1586         (WebCore::InspectorCanvas::buildAction):
1587         Drive-by: prevent de-duplicated objects from being destroyed while recording.
1588
1589 2018-11-14  Stephan Szabo  <stephan.szabo@sony.com>
1590
1591         [Win] Compile Service Worker support
1592         https://bugs.webkit.org/show_bug.cgi?id=191409
1593
1594         Reviewed by Youenn Fablet.
1595
1596         Fix compilation errors when ENABLE(SERVICE_WORKER)
1597         on Windows with clang-cl. Clang on dllexport
1598         platforms does not support specifying the
1599         dllexport on both a class and members of the class
1600         and unistd.h isn't provided but also appeared to
1601         not be used.
1602
1603         No new tests, should be covered by existing tests.
1604
1605         * workers/service/ServiceWorkerProvider.h:
1606         * workers/service/context/SWContextManager.cpp:
1607
1608 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
1609
1610         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
1611         https://bugs.webkit.org/show_bug.cgi?id=191494
1612         <rdar://problem/45469854>
1613
1614         Reviewed by Devin Rousso.
1615
1616         * inspector/InspectorClient.h:
1617         (WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const):
1618         Provide a hook so that a client may wish to allow direct remote inspection of the Page.
1619         This is used by WebKitLegacy only.
1620
1621         * page/Page.cpp:
1622         (Page::Page):
1623         Only enable the PageDebuggable if the client wishes remote inspection of the Page directly.
1624         This is used by WebKitLegacy only.
1625
1626         * inspector/InspectorController.cpp:
1627         (WebCore::InspectorController::connectFrontend):
1628         * inspector/InspectorController.h:
1629         * page/PageDebuggable.cpp:
1630         (WebCore::PageDebuggable::connect):
1631         (WebCore::PageDebuggable::disconnect):
1632         * page/PageDebuggable.h:
1633         When a frontend connects, always enable the developer extras for the Page.
1634         This is pretty much only for the remote path, which allows inspection if developer
1635         extras were not already enabled (iOS). This simplifies the logic, and toggling
1636         developer extras after it was already enabled is not really important.
1637
1638 2018-11-14  Per Arne Vollan  <pvollan@apple.com>
1639
1640         REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
1641         https://bugs.webkit.org/show_bug.cgi?id=190884
1642
1643         Reviewed by Dean Jackson.
1644
1645         Only notify display refresh monitors with matching display ID.
1646
1647         Test: fast/animation/request-animation-frame-in-two-pages.html
1648
1649         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1650         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
1651         * platform/graphics/DisplayRefreshMonitorManager.h:
1652
1653 2018-11-14  Youenn Fablet  <youenn@apple.com>
1654
1655         Convert libwebrtc error types to DOM exceptions
1656         https://bugs.webkit.org/show_bug.cgi?id=191590
1657
1658         Reviewed by Alex Christensen.
1659
1660         Make use of overloaded callback method that provides an error type.
1661         This type is then used to create a DOM exception with the correct type.
1662         Covered by existing tests.
1663
1664         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1665         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
1666         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
1667         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
1668         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
1669         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1670         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
1671         (WebCore::toExceptionCode):
1672
1673 2018-11-14  Youenn Fablet  <youenn@apple.com>
1674
1675         Allow to remove MediaStreamPrivate observers when iterating over observers
1676         https://bugs.webkit.org/show_bug.cgi?id=187256
1677
1678         Reviewed by Eric Carlson.
1679
1680         Migrate the observer list from a Vector to a HashSet.
1681         This is more robust to multiple observing and keeping of order of observers is not required.
1682         Copy the set of observers to a vector before iterating over it.
1683         This allows to remove an observer while iterating, which is now used in UserMediaRequest.
1684
1685         Covered by existing tests.
1686
1687         * Modules/mediastream/UserMediaRequest.cpp:
1688         (WebCore::UserMediaRequest::mediaStreamIsReady):
1689         * platform/mediastream/MediaStreamPrivate.cpp:
1690         (WebCore::MediaStreamPrivate::addObserver):
1691         (WebCore::MediaStreamPrivate::removeObserver):
1692         (WebCore::MediaStreamPrivate::forEachObserver const):
1693         (WebCore::MediaStreamPrivate::updateActiveState):
1694         (WebCore::MediaStreamPrivate::addTrack):
1695         (WebCore::MediaStreamPrivate::removeTrack):
1696         (WebCore::MediaStreamPrivate::characteristicsChanged):
1697         * platform/mediastream/MediaStreamPrivate.h:
1698
1699 2018-11-14  Youenn Fablet  <youenn@apple.com>
1700
1701         Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
1702         https://bugs.webkit.org/show_bug.cgi?id=191603
1703
1704         Reviewed by Chris Dumez.
1705
1706         Make sure to check that the sender peer connection backend is matching.
1707         Covered by rebased WPT test.
1708
1709         * Modules/mediastream/RTCPeerConnection.cpp:
1710         (WebCore::RTCPeerConnection::removeTrack):
1711         * Modules/mediastream/RTCRtpSender.cpp:
1712         (WebCore::RTCRtpSender::isCreatedBy const):
1713         * Modules/mediastream/RTCRtpSender.h:
1714
1715 2018-11-14  Fujii Hironori  <Hironori.Fujii@sony.com>
1716
1717         [curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
1718         https://bugs.webkit.org/show_bug.cgi?id=191620
1719
1720         Reviewed by Alex Christensen.
1721
1722         Remove a abstract class CookieJarCurl which is not needed anymore.
1723         And, rename CookieJarCurlDatabase to CookieJarCurl.
1724
1725         No new tests because there's no behaviour change in WebCore.
1726
1727         * platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
1728         * platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
1729         * platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
1730         * platform/network/curl/CookieJarCurlDatabase.h: Removed.
1731         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1732         (WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
1733
1734 2018-11-14  Christopher Reid  <chris.reid@sony.com>
1735
1736         [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
1737         https://bugs.webkit.org/show_bug.cgi?id=191606
1738
1739         Reviewed by Michael Catanzaro.
1740
1741         No behavior change.
1742
1743         Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
1744
1745         * platform/wpe/PlatformKeyboardEventWPE.cpp:
1746         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
1747         (WebCore::PlatformKeyboardEvent::singleCharacterString):
1748
1749 2018-11-13  Zalan Bujtas  <zalan@apple.com>
1750
1751         [LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
1752         https://bugs.webkit.org/show_bug.cgi?id=191623
1753
1754         Reviewed by Antti Koivisto.
1755
1756         This patch expands the breaking behaviour to support separate start/end breaks.
1757
1758         <span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
1759
1760         input to line breaking -> <parent start middle end parent>
1761         output of line breaking (considering infinite constraint) -> <parent start middle end parent>
1762         due to padding, final runs -> <parent><start middle end><parent>
1763
1764         "parent" -> n/a
1765         "start" -> BreakAtStart
1766         " middle " -> n/a
1767         "end" -> BreakAtEnd
1768         "parent" -> n/a
1769
1770         Another example:
1771         <span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
1772
1773         line breaking -> <parent start middle end parent>
1774         due to padding-right, final runs -> <parent start middle end><parent>
1775
1776         "parent" -> n/a
1777         "start" -> n/a
1778         " middle " -> n/a
1779         "end" -> BreakAtEnd
1780         "parent" -> n/a
1781
1782         * layout/inlineformatting/InlineFormattingContext.cpp:
1783         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1784         (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
1785         (WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
1786         * layout/inlineformatting/InlineFormattingContext.h:
1787         * layout/inlineformatting/InlineFormattingState.cpp:
1788         (WebCore::Layout::InlineFormattingState::detachingRules const):
1789         * layout/inlineformatting/InlineFormattingState.h:
1790         (WebCore::Layout::InlineFormattingState::lastInlineItem const):
1791         (WebCore::Layout::InlineFormattingState::addDetachingRule):
1792
1793 2018-11-14  Youenn Fablet  <youenn@apple.com>
1794
1795         Add support for RTCRtpCodecParameters.sdpFmtpLine
1796         https://bugs.webkit.org/show_bug.cgi?id=191591
1797
1798         Reviewed by Eric Carlson.
1799
1800         Covered by rebased test.
1801
1802         * Modules/mediastream/RTCRtpCodecParameters.h:
1803         * Modules/mediastream/RTCRtpCodecParameters.idl:
1804         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1805         (WebCore::toRTCCodecParameters):
1806
1807 2018-11-14  Youenn Fablet  <youenn@apple.com>
1808
1809         Add support for transport and peerConnection stats
1810         https://bugs.webkit.org/show_bug.cgi?id=191592
1811
1812         Reviewed by Alex Christensen.
1813
1814         Covered by rebased tests.
1815
1816         * Modules/mediastream/RTCStatsReport.h:
1817         (WebCore::RTCStatsReport::TransportStats::TransportStats):
1818         (WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
1819         * Modules/mediastream/RTCStatsReport.idl:
1820         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
1821         (WebCore::fillRTCTransportStats):
1822         (WebCore::fillRTCPeerConnectionStats):
1823         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
1824
1825 2018-11-14  Ali Juma  <ajuma@chromium.org>
1826
1827         Transform of composited layer not updated when layer also needs repaint
1828         https://bugs.webkit.org/show_bug.cgi?id=191598
1829
1830         Reviewed by Simon Fraser.
1831
1832         Trigger a compositing geometry update whenever a RenderLayer's transform changes,
1833         even when other parts of its style have changed in a way that produces a
1834         StyleDifference greater than RecompositeLayer.
1835
1836         Test: compositing/geometry/transform-and-repaint-updates-geometry.html
1837
1838         * rendering/RenderLayerCompositor.cpp:
1839         (WebCore::RenderLayerCompositor::layerStyleChanged):
1840
1841 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
1842
1843         [WebAuthN] Support CTAP HID authenticators on macOS
1844         https://bugs.webkit.org/show_bug.cgi?id=188623
1845         <rdar://problem/43353777>
1846
1847         Reviewed by Brent Fulgham and Chris Dumez.
1848
1849         This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore
1850         any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic
1851         dependency. Also, it adds a hack to temporarily deal with nullable userhandle.
1852
1853         Tests: http/wpt/webauthn/ctap-hid-failure.https.html
1854                http/wpt/webauthn/ctap-hid-success.https.html
1855                http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
1856                http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
1857                http/wpt/webauthn/public-key-credential-create-success-hid.https.html
1858                http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html
1859                http/wpt/webauthn/public-key-credential-get-failure-hid.https.html
1860                http/wpt/webauthn/public-key-credential-get-success-hid.https.html
1861
1862         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
1863         (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted.
1864         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
1865         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1866         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
1867         (fido::readCTAPGetAssertionResponse):
1868         * Modules/webauthn/fido/FidoConstants.h:
1869
1870 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1871
1872         [WebRTC] Provide default implementation of LibWebRTCProvider
1873         https://bugs.webkit.org/show_bug.cgi?id=191611
1874
1875         Reviewed by Michael Catanzaro.
1876
1877         Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
1878
1879         * PlatformWin.cmake:
1880         * platform/GStreamer.cmake:
1881         * platform/SourcesGLib.txt:
1882         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1883         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1884         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
1885         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
1886         * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
1887
1888 2018-11-13  Timothy Hatcher  <timothy@apple.com>
1889
1890         Use a light scrollbar for transparent web views in dark mode.
1891         https://bugs.webkit.org/show_bug.cgi?id=191559
1892         rdar://problem/46000489
1893
1894         Reviewed by Dean Jackson.
1895
1896         Test: css-dark-mode/supported-color-schemes-scrollbar.html
1897
1898         * css/CSSProperties.json: Marked supported-color-schemes as a custom Value.
1899         * css/StyleBuilderCustom.h:
1900         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes):
1901         * editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance().
1902         (WebCore::createFragment):
1903         * inspector/InspectorOverlay.cpp:
1904         (WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance().
1905         * page/FrameView.cpp:
1906         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for
1907         transparent web views in dark mode.
1908         (WebCore::FrameView::rendererForSupportedColorSchemes const): Added.
1909         Return the body for document element renderer.
1910         (WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes.
1911         (WebCore::FrameView::styleColorOptions const): Added. Ditto.
1912         * page/FrameView.h:
1913         * rendering/style/RenderStyle.cpp:
1914         (WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes.
1915         * rendering/style/RenderStyle.h:
1916         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added.
1917         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added.
1918         (WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes.
1919         * svg/graphics/SVGImage.cpp:
1920         (WebCore::SVGImage::draw): Use FrameView's useDarkAppearance().
1921         * testing/Internals.cpp:
1922         (WebCore::Internals::setViewIsTransparent): Added.
1923         (WebCore::Internals::scrollbarOverlayStyle const): Added.
1924         * testing/Internals.h:
1925         * testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle.
1926
1927 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1928
1929         [AppleWin] Unreviewed build fix after r238108.
1930
1931         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1932         (printLayer):
1933         (PlatformCALayerWin::embeddedViewID const):
1934         * platform/graphics/ca/win/PlatformCALayerWin.h:
1935
1936 2018-11-13  Youenn Fablet  <youenn@apple.com>
1937
1938         RTCPeerConnection.getTransceivers is not always exposing all transceivers
1939         https://bugs.webkit.org/show_bug.cgi?id=191589
1940
1941         Reviewed by Eric Carlson.
1942
1943         Implement the collect transceiver algorithm using libwebrtc backend.
1944         Call this algorithm everytime transceivers are retrieved from JS.
1945         For Plan B, make this a no-op as this is not supported.
1946         Introduce senders/receivers/transceivers getters where we just look at already created transceivers.
1947
1948         Covered by existing and rebased tests.
1949
1950         * Modules/mediastream/PeerConnectionBackend.h:
1951         (WebCore::PeerConnectionBackend::collectTransceivers):
1952         * Modules/mediastream/RTCPeerConnection.cpp:
1953         (WebCore::RTCPeerConnection::getSenders const):
1954         (WebCore::RTCPeerConnection::getReceivers const):
1955         (WebCore::RTCPeerConnection::getTransceivers const):
1956         * Modules/mediastream/RTCPeerConnection.h:
1957         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1958         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
1959         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1960         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1961         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1962         (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
1963         (WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers):
1964         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
1965         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
1966         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1967
1968 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1969
1970         [iOS] Do not show selection UI for editable elements with opacity near zero
1971         https://bugs.webkit.org/show_bug.cgi?id=191442
1972         <rdar://problem/45958625>
1973
1974         Reviewed by Simon Fraser.
1975
1976         Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html
1977                editing/selection/ios/hide-selection-after-hiding-contenteditable.html
1978                editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html
1979                editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html
1980                editing/selection/ios/hide-selection-in-hidden-contenteditable.html
1981
1982         * rendering/RenderObject.cpp:
1983         (WebCore::RenderObject::isTransparentRespectingParentFrames const):
1984
1985         Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent
1986         frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01).
1987         Opacity on ancestor elements is applied multiplicatively.
1988
1989         * rendering/RenderObject.h:
1990
1991 2018-11-13  Eric Carlson  <eric.carlson@apple.com>
1992
1993         [MediaStream] Observer AVCaptureDevice "suspended" property
1994         https://bugs.webkit.org/show_bug.cgi?id=191587
1995         <rdar://problem/46030598>
1996
1997         Reviewed by Youenn Fablet.
1998
1999         No new tests, AVCapture can only be tested manually.
2000
2001         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2002         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2003         (WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes"
2004         the first time the device list is scanned.
2005         (WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't
2006         change device availability.
2007         (WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all 
2008         devices and add them to the cached list.
2009         (WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above.
2010         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of
2011         devices.
2012         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices.
2013         (WebCore::AVCaptureDeviceManager::registerForDeviceNotifications):
2014         (-[WebCoreAVCaptureDeviceManagerObserver disconnect]):
2015         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]):
2016         (-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]):
2017         (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted.
2018         (WebCore::AVCaptureDeviceManager::deviceConnected): Deleted.
2019         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted.
2020         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted.
2021         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted.
2022
2023         * platform/mediastream/mac/AVVideoCaptureSource.h:
2024         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2025         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate")
2026         and "suspended".
2027         (WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended".
2028         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
2029         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
2030
2031 2018-11-13  Devin Rousso  <drousso@apple.com>
2032
2033         Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers
2034         https://bugs.webkit.org/show_bug.cgi?id=191597
2035
2036         Reviewed by Joseph Pecoraro.
2037
2038         When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched,
2039         meaning that we may try to fetch in situations previously unexpected.
2040
2041         * platform/network/cocoa/ResourceResponseCocoa.mm:
2042         (WebCore::ResourceResponse::platformCertificateInfo const):
2043
2044 2018-11-13  Timothy Hatcher  <timothy@apple.com>
2045
2046         Treat supported-color-schemes as the second highest priority property.
2047         https://bugs.webkit.org/show_bug.cgi?id=191556
2048         rdar://problem/46000076
2049
2050         Reviewed by Dean Jackson.
2051
2052         Test: css-dark-mode/supported-color-schemes-priority.html
2053
2054         * css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment.
2055         * css/StyleResolver.cpp:
2056         (WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes
2057         after -webkit-ruby-position, before other properties, so it can affect resolved colors.
2058
2059 2018-11-13  Charlie Turner  <cturner@igalia.com>
2060
2061         [EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes.
2062         https://bugs.webkit.org/show_bug.cgi?id=191316
2063
2064         Reviewed by Xabier Rodriguez-Calvar.
2065
2066         Another preparation in patch getting ready to move the decryption
2067         logic behind the CDMInstance and out of the GStreamer decryptors
2068         themselves. The first step taken here is to arrange for the
2069         instances to always be available in the decryptors when they need
2070         to decrypt content.
2071
2072         In doing so, there were a number of hairy bits of code that could
2073         use some abstraction, so the opportunity was taken to do that as
2074         well.
2075
2076         Covered by tests in media/encrypted-media and
2077         imported/w3c/web-platform-tests/encrypted-media.
2078
2079         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2080         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove
2081         drm-key-needed since it was not being used anywhere.
2082         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2083         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
2084         Factor out the parsing of decryption system information from
2085         GStreamer, since it was not clear what that code was doing unless
2086         you squinted pretty hard. Also remove the duplicated
2087         initialization-data-encountered posting.
2088         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
2089         Refactored to make it a more general method and usable in more
2090         situations. It now has an optional to stop it from eliding init
2091         datas for a different key system. This is required the first time
2092         we post them, since if a CDM instance has already been set, and if
2093         the stream init datas are for different systems, we ended up never
2094         posting an encrypted event.
2095         (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
2096         Actually send a CDMInstance now when in regular playback mode.
2097         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
2098         Remove m_needToSendCredentials, it was not being used.
2099         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
2100         Refactored to use the new initializationDataEncountered.
2101         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
2102         Log the waiting state, since it was currently not clear what that
2103         logging message was even telling you!
2104         (WebCore::extractEventsAndSystemsFromMessage): Deleted.
2105         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2106         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
2107         (WebCore::InitData::InitData): New class that encapsulates both
2108         single instantiation and streaming instantiation.
2109         (WebCore::InitData::append): Used for the streaming mode, when you
2110         are concatenating init datas together.
2111         (WebCore::InitData::payload const):
2112         (WebCore::InitData::systemId const):
2113         (WebCore::InitData::payloadContainerType const):
2114         (WebCore::InitData::isFromDifferentContainer):
2115         (WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
2116         (WebCore::ProtectionSystemEvents::events const):
2117         (WebCore::ProtectionSystemEvents::availableSystems const):
2118         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2119         (webkitMediaCommonEncryptionDecryptTransformInPlace): If you post
2120         waiting-for-key after requesting a CDM instance, it will flap back
2121         to not waiting for a key almost immediately, didn't make sense
2122         positing after requesting an instance. Also post key-received when
2123         we receive the key.
2124         (webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now
2125         been arranged that a CDMInstance will always be present in an OOB
2126         message, so parse it out here.
2127         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2128         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
2129         As above, make sure when posting the OOB that a CDMInstance is present.
2130
2131 2018-11-13  Charlie Turner  <cturner@igalia.com>
2132
2133         Various compiler warnings/errors fixes.
2134         https://bugs.webkit.org/show_bug.cgi?id=191583
2135
2136         Reviewed by Frédéric Wang.
2137
2138         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2139         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
2140         ASSERT is only compiled in DEBUG mode, so guarding with
2141         !LOG_DISABLED is wrong.
2142         * rendering/RenderLayerCompositor.cpp:
2143         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2144         showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING)
2145         mode, so guarding with !LOG_DISABLED was wrong.
2146         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2147         Ditto, this time with member .depth.
2148         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto.
2149         * rendering/svg/SVGRenderSupport.cpp:
2150         (WebCore::SVGRenderSupport::styleChanged): Add another unused
2151         parameter.
2152
2153 2018-11-12  Antoine Quint  <graouts@apple.com>
2154
2155         [Web Animations] Don't schedule animation frames or update style while an accelerated animation is running
2156         https://bugs.webkit.org/show_bug.cgi?id=191542
2157         <rdar://problem/45356027>
2158
2159         Reviewed by Simon Fraser.
2160
2161         Test: animations/no-style-recalc-during-accelerated-animation.html
2162
2163         In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated
2164         animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and
2165         when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated
2166         animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled
2167         for that time when we'll schedule animation resolution.
2168
2169         By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure
2170         we also update animations in-flight to dispatch "animationiteration" events.
2171
2172         * animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick().
2173         * animation/DocumentTimeline.cpp:
2174         (WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded().
2175         (WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time.
2176         (WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next.
2177         (WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can
2178         cache the current time in suspendAnimations() without also automatically clearing the current time.
2179         (WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been
2180         factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly
2181         by virtue of using cacheCurrentTime(). This fixes some flakiness.
2182         (WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime(). 
2183         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended.
2184         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already,
2185         scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead.
2186         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution.
2187         (WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents()
2188         and call scheduleNextTick().
2189         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running.
2190         (WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated.
2191         Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations.
2192         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function.
2193         * animation/DocumentTimeline.h:
2194         * animation/WebAnimation.cpp:
2195         (WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new
2196         function to get that information directly through the WebAnimation object without bothering about its effect.
2197         (WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential
2198         change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated.
2199         (WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration.
2200         * animation/WebAnimation.h:
2201
2202 2018-11-13  Miguel Gomez  <magomez@igalia.com>
2203
2204         [GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area
2205         https://bugs.webkit.org/show_bug.cgi?id=191545
2206
2207         Reviewed by Žan Doberšek.
2208
2209         Keep track of layer size changes even if they happen when the layer is not in the visible
2210         area, so we can update edge tiles when the layer gets visible.
2211
2212         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
2213         (WebCore::TiledBackingStore::createTiles):
2214         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
2215
2216 2018-11-12  Rob Buis  <rbuis@igalia.com>
2217
2218         Content-Type parameter values should allow empty quoted strings
2219         https://bugs.webkit.org/show_bug.cgi?id=191388
2220
2221         Reviewed by Dean Jackson.
2222
2223         According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty
2224         quoted strings are acceptable for Content-Type parameter values. They
2225         are accepted by Firefox and Chrome implementations as well.
2226
2227         Test: web-platform-tests/xhr/overridemimetype-blob.html
2228
2229         * platform/network/ParsedContentType.cpp:
2230         (WebCore::parseToken):
2231         (WebCore::parseQuotedString):
2232         (WebCore::parseContentType):
2233         * platform/network/ParsedContentType.h:
2234
2235 2018-11-12  Christopher Reid  <chris.reid@sony.com>
2236
2237         [Curl] Reject entire cookie if the domain fails a tailmatch.
2238         https://bugs.webkit.org/show_bug.cgi?id=191406
2239
2240         Reviewed by Youenn Fablet.
2241
2242         Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox
2243         and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead.
2244         Also cleanup Cookie database implementation to make them testable better.
2245
2246         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
2247
2248         * platform/network/curl/CookieJarDB.cpp:
2249         (WebCore::CookieJarDB::canAcceptCookie): Added.
2250         (WebCore::CookieJarDB::setCookie):
2251         * platform/network/curl/CookieUtil.cpp:
2252         (WebCore::CookieUtil::parseCookieAttributes):
2253         (WebCore::CookieUtil::parseCookieHeader):
2254         * platform/network/curl/CookieUtil.h:
2255
2256 2018-11-12  Devin Rousso  <drousso@apple.com>
2257
2258         Web Inspector: Network: show secure certificate details per-request
2259         https://bugs.webkit.org/show_bug.cgi?id=191447
2260         <rdar://problem/30019476>
2261
2262         Reviewed by Joseph Pecoraro.
2263
2264         Test: http/tests/inspector/network/resource-response-security.html
2265
2266         * loader/ResourceLoader.h:
2267         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
2268         * loader/ResourceLoader.cpp:
2269         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
2270         Always save certificate information when WebInspector is open.
2271
2272         * platform/network/CertificateInfoBase.h: Added.
2273         (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
2274         (WebCore::CertificateInfoBase::summaryInfo const):
2275         (WebCore::CertificateInfoBase::isEmpty const):
2276         * platform/network/cf/CertificateInfo.h:
2277         (WebCore::CertificateInfo::summaryInfo const): Added.
2278         * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
2279         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
2280         (WebCore::CertificateInfo::summaryInfo const): Added.
2281         * platform/network/curl/CertificateInfo.h:
2282         (WebCore::CertificateInfo::summaryInfo const): Added.
2283         (WebCore::CertificateInfo::isEmpty const): Added.
2284         * platform/network/soup/CertificateInfo.h:
2285         (WebCore::CertificateInfo::summaryInfo const): Added.
2286         (WebCore::CertificateInfo::isEmpty const): Added.
2287         Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
2288         platform-specific code in its implementation.
2289
2290         * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
2291         * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
2292         * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
2293
2294         * inspector/NetworkResourcesData.h:
2295         (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
2296         (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
2297         * inspector/NetworkResourcesData.cpp:
2298         (WebCore::NetworkResourcesData::responseReceived):
2299
2300         * inspector/agents/InspectorNetworkAgent.cpp:
2301         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
2302
2303         * PlatformAppleWin.cmake:
2304         * PlatformMac.cmake:
2305         * SourcesCocoa.txt:
2306         * WebCore.xcodeproj/project.pbxproj:
2307         * platform/Curl.cmake:
2308         * platform/SourcesSoup.txt:
2309
2310 2018-11-12  Zalan Bujtas  <zalan@apple.com>
2311
2312         Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer.
2313         https://bugs.webkit.org/show_bug.cgi?id=191554
2314         <rdar://problem/45825265>
2315
2316         Reviewed by Antti Koivisto.
2317
2318         While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block.
2319         Moving a renderer is a 2 step process:
2320         1. Detach the renderer from its current parent
2321         2. Attach it to its new parent.
2322         During step #1, we check if there is a chance to collapse anonymous blocks. In this case the soon-to-be-parent is a sibling anonymous block which, after detaching the marker sibling
2323         is not needed anymore (except we use it as the new parent).
2324
2325         Test: fast/inline/marker-list-item-move-should-not-crash.html
2326
2327         * rendering/updating/RenderTreeBuilder.cpp:
2328         (WebCore::RenderTreeBuilder::detach):
2329         * rendering/updating/RenderTreeBuilder.h:
2330         * rendering/updating/RenderTreeBuilderBlock.cpp:
2331         (WebCore::RenderTreeBuilder::Block::detach):
2332         * rendering/updating/RenderTreeBuilderBlock.h:
2333         * rendering/updating/RenderTreeBuilderList.cpp:
2334         (WebCore::RenderTreeBuilder::List::updateItemMarker):
2335
2336 2018-11-12  Javier Fernandez  <jfernandez@igalia.com>
2337
2338         [css-grid] Refactoring to make more explicit the orthogonal items' pre-layout logic
2339         https://bugs.webkit.org/show_bug.cgi?id=191358
2340
2341         Reviewed by Manuel Rego Casasnovas.
2342
2343         These changes are just a refactoring to ease the integration of the new Baseline Alignment
2344         logic in a follow up patch.
2345
2346         We need to properly estimate the grid area size of orthogonal items so that we can perform
2347         an accurate pre-layout. This is important because orthogonal items will synthesize their baseline
2348         if they participate in any baseline alignment context.
2349
2350         No new tests, since no behavior change has been introduced in this patch.
2351
2352         * rendering/Grid.cpp:
2353         (WebCore::Grid::setNeedsItemsPlacement):
2354         * rendering/Grid.h:
2355         * rendering/GridTrackSizingAlgorithm.cpp:
2356         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
2357         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
2358         (WebCore::GridTrackSizingAlgorithm::isRelativeGridLengthAsAuto const):
2359         (WebCore::GridTrackSizingAlgorithm::isRelativeSizedTrackAsAuto const):
2360         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
2361         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
2362         (WebCore::GridTrackSizingAlgorithm::run):
2363         (WebCore::GridTrackSizingAlgorithm::reset):
2364         * rendering/GridTrackSizingAlgorithm.h:
2365         (WebCore::GridTrackSizingAlgorithmStrategy::gridTrackSize const):
2366         * rendering/RenderGrid.cpp:
2367         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
2368         (WebCore::RenderGrid::layoutBlock):
2369         (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
2370         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
2371         (WebCore::RenderGrid::placeItemsOnGrid const):
2372         (WebCore::RenderGrid::performGridItemsPreLayout const):
2373         (WebCore::overrideSizeChanged):
2374         (WebCore::hasRelativeBlockAxisSize):
2375         (WebCore::RenderGrid::updateGridAreaLogicalSize const):
2376         (WebCore::RenderGrid::layoutGridItems):
2377         * rendering/RenderGrid.h:
2378
2379 2018-11-12  Sihui Liu  <sihui_liu@apple.com>
2380
2381         imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
2382         https://bugs.webkit.org/show_bug.cgi?id=191500
2383
2384         Reviewed by Dean Jackson.
2385
2386         When double value is bigger than maximum unsigned int, converting double to unsigned int has
2387         different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
2388         maximum unsigned int.
2389
2390         Covered by existing test.
2391
2392         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2393         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
2394         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
2395
2396 2018-11-12  Basuke Suzuki  <basuke.suzuki@sony.com>
2397
2398         [Curl] Add API Test for Curl cookie backend.
2399         https://bugs.webkit.org/show_bug.cgi?id=191493
2400
2401         Reviewed by Youenn Fablet.
2402
2403         Refactoring for cookie backend interface.
2404
2405         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
2406
2407         * platform/FileSystem.h:
2408         * platform/network/curl/CookieJarCurlDatabase.cpp:
2409         (WebCore::cookiesForSession):
2410         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
2411         (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
2412         (WebCore::CookieJarCurlDatabase::getRawCookies const):
2413         * platform/network/curl/CookieJarDB.cpp:
2414         (WebCore::CookieJarDB::openDatabase):
2415         (WebCore::CookieJarDB::checkSQLiteReturnCode):
2416         (WebCore::CookieJarDB::isEnabled const):
2417         (WebCore::CookieJarDB::searchCookies):
2418         (WebCore::CookieJarDB::setCookie):
2419         (WebCore::CookieJarDB::deleteCookie):
2420         (WebCore::CookieJarDB::deleteCookieInternal):
2421         (WebCore::CookieJarDB::deleteCookies):
2422         (WebCore::CookieJarDB::deleteAllCookies):
2423         (WebCore::CookieJarDB::executeSimpleSql):
2424         (WebCore::CookieJarDB::isEnabled): Deleted.
2425         * platform/network/curl/CookieJarDB.h:
2426         * platform/network/curl/CookieUtil.cpp:
2427         (WebCore::CookieUtil::parseCookieHeader):
2428         * platform/network/curl/CookieUtil.h:
2429         * platform/win/FileSystemWin.cpp:
2430         (WebCore::FileSystem::generateTemporaryPath):
2431         (WebCore::FileSystem::openTemporaryFile):
2432         (WebCore::FileSystem::createTemporaryDirectory):
2433         (WebCore::FileSystem::deleteNonEmptyDirectory):
2434
2435 2018-11-12  Tim Horton  <timothy_horton@apple.com>
2436
2437         Make it possible to edit images inline
2438         https://bugs.webkit.org/show_bug.cgi?id=191352
2439         <rdar://problem/30107985>
2440
2441         Reviewed by Dean Jackson.
2442
2443         Tests: editing/images/basic-editable-image.html
2444                editing/images/reparent-editable-image-maintains-strokes.html
2445
2446         Add the beginnings of a mechanism to replace images with a special attribute
2447         with a native drawing view in the UI process.
2448
2449         * page/Settings.yaml:
2450         Add a setting to control whether images become natively editable when they
2451         have the x-apple-editable-image attribute.
2452
2453         * html/HTMLImageElement.cpp:
2454         (WebCore::HTMLImageElement::editableImageViewID const):
2455         Lazily generate an EmbeddedViewID and persist it on the <img> element.
2456
2457         * html/HTMLImageElement.h:
2458         Rearrange the service controls methods to sit before the members.
2459         Add m_editableImageViewID and editableImageViewID().
2460
2461         * platform/graphics/GraphicsLayer.cpp:
2462         (WebCore::GraphicsLayer::nextEmbeddedViewID):
2463         * platform/graphics/GraphicsLayer.h:
2464         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
2465         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
2466         on Cocoa platforms and when using RemoteLayerTree.
2467         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
2468         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
2469         and an EmbeddedViewID to uniquely identify and communicate about the
2470         embedded view (which may move between layers, since it is tied to an element).
2471
2472         * platform/graphics/ca/GraphicsLayerCA.cpp:
2473         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
2474         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
2475         When setting GraphicsLayer's contents to an embedded view, we use
2476         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
2477         GraphicsLayerCARemote will override this and make a correctly-initialized
2478         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
2479
2480         * platform/graphics/ca/GraphicsLayerCA.h:
2481         * platform/graphics/ca/PlatformCALayer.cpp:
2482         (WebCore::operator<<):
2483         * platform/graphics/ca/PlatformCALayer.h:
2484         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2485         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2486         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2487         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
2488         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
2489         These will be overridden by PlatformCALayerRemote to do more interesting things.
2490
2491         * rendering/RenderImage.cpp:
2492         (WebCore::RenderImage::isEditableImage const):
2493         Add a getter that return true if the setting is enabled and
2494         x-apple-editable-image is empty or true.
2495
2496         (WebCore::RenderImage::requiresLayer const):
2497         RenderImage requires a layer either if RenderReplaced does, or we are an
2498         editable image.
2499
2500         * rendering/RenderImage.h:
2501         * rendering/RenderLayer.cpp:
2502         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
2503         (WebCore::RenderLayer::calculateClipRects const):
2504         * rendering/RenderLayerBacking.cpp:
2505         (WebCore::RenderLayerBacking::updateConfiguration):
2506         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
2507
2508         * rendering/RenderLayerCompositor.cpp:
2509         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2510         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2511         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2512         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
2513         * rendering/RenderLayerCompositor.h:
2514         Make editable images require compositing implicitly.
2515
2516 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
2517
2518         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
2519         https://bugs.webkit.org/show_bug.cgi?id=189230
2520         <rdar://problem/44050379>
2521
2522         Reviewed by Joseph Pecoraro.
2523
2524         Runs all png images through zopflipng. This results in a smaller file
2525         size and takes care of this issue as a byproduct.
2526
2527         * Modules/modern-media-controls/images/iOS/airplay-placard@1x.png:
2528         * Modules/modern-media-controls/images/iOS/airplay-placard@2x.png:
2529         * Modules/modern-media-controls/images/iOS/airplay-placard@3x.png:
2530         * Modules/modern-media-controls/images/iOS/invalid-placard@1x.png:
2531         * Modules/modern-media-controls/images/iOS/invalid-placard@2x.png:
2532         * Modules/modern-media-controls/images/iOS/invalid-placard@3x.png:
2533         * Modules/modern-media-controls/images/iOS/pip-placard@1x.png:
2534         * Modules/modern-media-controls/images/iOS/pip-placard@2x.png:
2535         * Modules/modern-media-controls/images/iOS/pip-placard@3x.png:
2536         * Modules/modern-media-controls/images/macOS/airplay-placard@1x.png:
2537         * Modules/modern-media-controls/images/macOS/airplay-placard@2x.png:
2538         * Modules/modern-media-controls/images/macOS/invalid-placard@1x.png:
2539         * Modules/modern-media-controls/images/macOS/invalid-placard@2x.png:
2540         * Modules/modern-media-controls/images/macOS/pip-placard@1x.png:
2541         * Modules/modern-media-controls/images/macOS/pip-placard@2x.png:
2542         * Resources/AttachmentPlaceholder.png:
2543         * Resources/AttachmentPlaceholder@2x.png:
2544         * Resources/ListButtonArrow.png:
2545         * Resources/ListButtonArrow@2x.png:
2546         * Resources/missingImage.png:
2547         * Resources/missingImage@2x.png:
2548         * Resources/missingImage@3x.png:
2549         * Resources/moveCursor.png:
2550         * Resources/northEastSouthWestResizeCursor.png:
2551         * Resources/northSouthResizeCursor.png:
2552         * Resources/northWestSouthEastResizeCursor.png:
2553         * Resources/nullPlugin.png:
2554         * Resources/nullPlugin@2x.png:
2555         * Resources/panIcon.png:
2556         * Resources/textAreaResizeCorner.png:
2557         * Resources/textAreaResizeCorner@2x.png:
2558         * Resources/urlIcon.png:
2559
2560 2018-11-12  Youenn Fablet  <youenn@apple.com>
2561
2562         RealtimeOutgoing A/V sources should observe their sources only if having a sink
2563         https://bugs.webkit.org/show_bug.cgi?id=191490
2564
2565         Reviewed by Eric Carlson.
2566
2567         Observe the source that generates media based on the sinks:
2568         - Do not observe at creation time
2569         - For first sink, start observing
2570         - When no more sink, stop observing
2571         Apply this principle for both outgoing audio and video sources.
2572         Add locks for the sinks to ensure thread-safety.
2573         Make sinks HashSet which is more robust.
2574
2575         Do some refactoring to better isolate generic outgoing sources from Cocoa/GTK implementations.
2576
2577         Covered by existing tests and updated webrtc/remove-track.html.
2578
2579         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2580         (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
2581         (WebCore::RealtimeOutgoingAudioSource::stop):
2582         (WebCore::RealtimeOutgoingAudioSource::AddSink):
2583         (WebCore::RealtimeOutgoingAudioSource::RemoveSink):
2584         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
2585         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2586         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2587         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
2588         (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
2589         (WebCore::RealtimeOutgoingVideoSource::observeSource):
2590         (WebCore::RealtimeOutgoingVideoSource::setSource):
2591         (WebCore::RealtimeOutgoingVideoSource::stop):
2592         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
2593         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
2594         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2595         (WebCore::RealtimeOutgoingVideoSource::isSilenced const):
2596         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
2597         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
2598         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
2599         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
2600         (WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):
2601         (WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
2602         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
2603         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2604         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
2605
2606 2018-11-12  Youenn Fablet  <youenn@apple.com>
2607
2608         Support setting stream ids when adding a transceiver
2609         https://bugs.webkit.org/show_bug.cgi?id=191307
2610
2611         Reviewed by Eric Carlson.
2612
2613         Add support for streams in RTCTransceiverInit.
2614         Add plumbing down to libwebrtc.
2615         Covered by rebased tests.
2616
2617         * Modules/mediastream/RTCPeerConnection.h:
2618         * Modules/mediastream/RTCPeerConnection.idl:
2619         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
2620         (WebCore::fromRtpTransceiverInit):
2621
2622 2018-11-12  Antti Koivisto  <antti@apple.com>
2623
2624         Support dynamic pseudo-classes on elements with display: contents
2625         https://bugs.webkit.org/show_bug.cgi?id=181640
2626         <rdar://problem/36605415>
2627
2628         Reviewed by Dean Jackson.
2629
2630         The code for :hover and :active style invalidation assumes that only elements with renderer need invalidation.
2631
2632         This patch fixes '.display-content-element:hover span' case but not '.display-content-element:hover' case but
2633         includes tests for both. The latter is not super useful anyway (as it only affects rendering with inherited
2634         text properties).
2635
2636         Test: fast/css/display-contents-hover-active.html
2637
2638         * dom/Document.cpp:
2639         (WebCore::Document::updateHoverActiveState):
2640
2641             Traverse up in composed tree instead of render tree when invalidating. This has the same order as render tree
2642             but also includes display:content elements. This also allows removing the special display:none case.
2643
2644         * dom/Element.cpp:
2645         (WebCore::Element::setActive):
2646         (WebCore::Element::setHovered):
2647
2648             Also look into display:contents style for invalidation checks.
2649
2650         (WebCore::Element::renderOrDisplayContentsStyle const):
2651
2652             Make this helper an Element member.
2653
2654         * dom/Element.h:
2655         * dom/Node.cpp:
2656         (WebCore::Node::parentElementInComposedTree const):
2657
2658             Support starting from a PseudoElement. This is consistent with ComposedTreeAncestorIterator.
2659
2660         * rendering/updating/RenderTreePosition.cpp:
2661         (WebCore::RenderTreePosition::nextSiblingRenderer const):
2662         * style/StyleTreeResolver.cpp:
2663         (WebCore::Style::TreeResolver::resolveElement):
2664         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2665         (WebCore::Style::shouldResolveElement):
2666         (WebCore::Style::TreeResolver::resolveComposedTree):
2667         (WebCore::Style::renderOrDisplayContentsStyle): Deleted.
2668
2669             Use the Element::renderOrDisplayContentsStyle() instead.
2670
2671 2018-11-12  Antoine Quint  <graouts@apple.com>
2672
2673         [Web Animations] Turn Web Animations experimental
2674         https://bugs.webkit.org/show_bug.cgi?id=191543
2675
2676         Reviewed by Dean Jackson.
2677
2678         * page/RuntimeEnabledFeatures.h:
2679
2680 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
2681
2682         feFlood with alpha color doesn't work correctly
2683         https://bugs.webkit.org/show_bug.cgi?id=163666
2684
2685         Reviewed by Zalan Bujtas.
2686         
2687         FEFlood::platformApplySoftware() erroneously used colorWithOverrideAlpha()
2688         rather than multiplying the flood color with the flood opacity as other browsers do.
2689
2690         Test: svg/filters/feFlood-with-alpha-color.html
2691
2692         * platform/graphics/Color.cpp:
2693         (WebCore::Color::colorWithAlpha const): I tried using colorWithAlphaMultipliedBy() elsewhere,
2694         and it triggered a behavior change, so add a comment.
2695         * platform/graphics/filters/FEFlood.cpp:
2696         (WebCore::FEFlood::platformApplySoftware):
2697         * svg/SVGStopElement.cpp:
2698         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
2699
2700 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
2701
2702         Require <iframe allow="display"> for an iframe to use getDisplayMedia
2703         https://bugs.webkit.org/show_bug.cgi?id=191505
2704         <rdar://problem/45968811>
2705
2706         Reviewed by Jer Noble.
2707
2708         Test: http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html
2709
2710         * Modules/mediastream/MediaDevicesRequest.cpp:
2711         (WebCore::MediaDevicesRequest::start):
2712         * Modules/mediastream/UserMediaController.cpp:
2713         (WebCore::isAllowedToUse):
2714         (WebCore::UserMediaController::canCallGetUserMedia):
2715         (WebCore::UserMediaController::logGetUserMediaDenial):
2716         * Modules/mediastream/UserMediaController.h:
2717         * Modules/mediastream/UserMediaRequest.cpp:
2718         (WebCore::UserMediaRequest::start):
2719
2720 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
2721
2722         Make compositing updates incremental
2723         https://bugs.webkit.org/show_bug.cgi?id=90342
2724
2725         Reviewed by Antti Koivisto.
2726
2727         Previously, updating compositing layers required two full RenderLayer tree traversals,
2728         and all the work was done for every RenderLayer on each composting update. This could be expensive
2729         on pages with lots of RenderLayers.
2730
2731         These changes make compositing updates more incremental. Compositing updates still require
2732         two tree traversals. The first determines which RenderLayers need to be composited (of those which
2733         weren't already made composited at style-change time), because of reasons that can only be determined
2734         post-layout, and indirect reasons including overlap. The second traversal updates the configuration, geometry
2735         and GraphicsLayer tree for the composited layers. Dependencies on both descendant and ancestor state make
2736         it hard to fold these two traversals together.
2737
2738         In order to minimize the work done during these traversals, dirty bits are stored on RenderLayers,
2739         and propagated to ancestor layers in paint order. There are two sets of bits: those related to the first
2740         "compositing requirements" traversal, and those related to the second "update backing and hierarchy" traversal.
2741         When a RenderLayer gets a dirty bit set, bits are propagated to ancestors to indicate that children need
2742         to be visited.
2743
2744         Sadly entire subtrees can't be skipped during the "compositing requirements" traversal because we still have
2745         to accumulate overlap rects, but RenderLayerCompositor::traverseUnchangedSubtree() is used to minimize
2746         work in that case. Subtrees can be skipped in the "update backing and hierarchy" traversal. Entire traversals can
2747         be skipped if no change has triggered the need for that traversal.
2748         
2749         These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
2750         more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
2751         triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
2752         excluding composited filters from the composited bounds (but still taking them into account for overlap).
2753
2754         Care is taken to avoid triggering traversals in non-composited documents (tested by no-updates-in-non-composited-iframe.html).
2755
2756         Code to set the dirty bits is added in various places that change properties that compositing depends on.
2757         
2758         These changes also subsume the patch in 176196; we now never consult properties that rely on layout from the
2759         style change code path, and the only call stack for geometry updates is from the "update backing and hierarchy"
2760         traversal, which is always a pre-order traversal.
2761
2762         Tests: compositing/geometry/stacking-context-change-layer-reparent.html
2763                compositing/layer-creation/change-to-overlap.html
2764                compositing/updates/no-updates-in-non-composited-iframe.html
2765
2766         * html/canvas/WebGLRenderingContextBase.cpp:
2767         (WebCore::WebGLRenderingContextBase::markContextChanged): Need to differentiate between a canvas becoming composited
2768         for the first time, and its pixels changing with a new 'CanvasPixelsChanged' value.
2769         * page/FrameView.cpp:
2770         (WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
2771         * page/Page.cpp:
2772         (WebCore::Page::setPageScaleFactor):
2773         * platform/graphics/ca/GraphicsLayerCA.cpp:
2774         (WebCore::GraphicsLayerCA::updateBackdropFilters): If we just made a layer for backdrops, we need to update sublayers.
2775         * rendering/RenderBox.cpp:
2776         (WebCore::RenderBox::styleWillChange):
2777         * rendering/RenderLayer.cpp:
2778         (WebCore::RenderLayer::RenderLayer):
2779         (WebCore::RenderLayer::~RenderLayer):
2780         (WebCore::RenderLayer::addChild):
2781         (WebCore::RenderLayer::removeChild):
2782         (WebCore::RenderLayer::shouldBeStackingContext const):
2783         (WebCore::RenderLayer::stackingContext const):
2784         (WebCore::RenderLayer::dirtyZOrderLists):
2785         (WebCore::RenderLayer::dirtyNormalFlowList):
2786         (WebCore::RenderLayer::updateNormalFlowList):
2787         (WebCore::RenderLayer::rebuildZOrderLists):
2788         (WebCore::RenderLayer::setAncestorsHaveCompositingDirtyFlag):
2789         (WebCore::RenderLayer::contentChanged):
2790         (WebCore::RenderLayer::updateLayerPositions):
2791         (WebCore::RenderLayer::updateTransform):
2792         (WebCore::RenderLayer::updateLayerPosition):
2793         (WebCore::RenderLayer::enclosingCompositingLayer const):
2794         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
2795         (WebCore::RenderLayer::clippingRootForPainting const):
2796         (WebCore::RenderLayer::scrollTo):
2797         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
2798         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2799         (WebCore::RenderLayer::paintLayerContents):
2800         (WebCore::RenderLayer::hitTest):
2801         (WebCore::RenderLayer::hitTestLayer):
2802         (WebCore::RenderLayer::calculateClipRects const):
2803         (WebCore::outputPaintOrderTreeLegend):
2804         (WebCore::outputPaintOrderTreeRecursive):
2805         (WebCore::compositingContainer): Deleted.
2806         * rendering/RenderLayer.h:
2807         (WebCore::RenderLayer::clearZOrderLists):
2808         (WebCore::RenderLayer::paintOrderParent const):
2809         * rendering/RenderLayerBacking.cpp:
2810         (WebCore::RenderLayerBacking::updateCompositedBounds):
2811         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
2812         (WebCore::RenderLayerBacking::updateAfterLayout):
2813         (WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
2814         (WebCore::RenderLayerBacking::updateConfiguration):
2815         (WebCore::RenderLayerBacking::updateGeometry):
2816         (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
2817         (WebCore::RenderLayerBacking::updateMaskingLayer):
2818         (WebCore::RenderLayerBacking::paintsContent const):
2819         (WebCore::RenderLayerBacking::contentChanged):
2820         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
2821         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
2822         (WebCore::RenderLayerBacking::startAnimation):
2823         (WebCore::RenderLayerBacking::animationFinished):
2824         (WebCore::RenderLayerBacking::startTransition):
2825         (WebCore::RenderLayerBacking::transitionFinished):
2826         (WebCore::RenderLayerBacking::setCompositedBounds):
2827         * rendering/RenderLayerBacking.h:
2828         * rendering/RenderLayerCompositor.cpp:
2829         (WebCore::RenderLayerCompositor::CompositingState::CompositingState):
2830         (WebCore::RenderLayerCompositor::enableCompositingMode):
2831         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
2832         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout):
2833         (WebCore::RenderLayerCompositor::willRecalcStyle):
2834         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2835         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2836         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2837         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2838         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2839         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
2840         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
2841         (WebCore::RenderLayerCompositor::logLayerInfo):
2842         (WebCore::clippingChanged):
2843         (WebCore::styleAffectsLayerGeometry):
2844         (WebCore::RenderLayerCompositor::layerStyleChanged):
2845         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
2846         (WebCore::RenderLayerCompositor::updateBacking):
2847         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
2848         (WebCore::RenderLayerCompositor::layerWasAdded):
2849         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
2850         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
2851         (WebCore::RenderLayerCompositor::computeExtent const):
2852         (WebCore::RenderLayerCompositor::addToOverlapMap):
2853         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2854         (WebCore::RenderLayerCompositor::rootLayerConfigurationChanged):
2855         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2856         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
2857         (WebCore::RenderLayerCompositor::needsToBeComposited const):
2858         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2859         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2860         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2861         (WebCore::RenderLayerCompositor::clippedByAncestor const):
2862         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
2863         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
2864         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
2865         (WebCore::RenderLayerCompositor::requiresCompositingForFilters const):
2866         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
2867         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
2868         (WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
2869         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
2870         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2871         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
2872         (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
2873         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
2874         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
2875         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
2876         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
2877         (WebCore::operator<<):
2878         (WebCore::RenderLayerCompositor::setCompositingLayersNeedRebuild): Deleted.
2879         (WebCore::checkIfDescendantClippingContextNeedsUpdate): Deleted.
2880         (WebCore::isScrollableOverflow): Deleted.
2881         (WebCore::styleHasTouchScrolling): Deleted.
2882         (WebCore::styleChangeRequiresLayerRebuild): Deleted.
2883         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Deleted.
2884         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): Deleted.
2885         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Deleted.
2886         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Deleted.
2887         * rendering/RenderLayerCompositor.h:
2888         * rendering/RenderTreeAsText.cpp:
2889         (WebCore::writeLayers):
2890
2891 2018-11-12  Rob Buis  <rbuis@igalia.com>
2892
2893         CSSCalcOperation constructor wastes 6KB of Vector capacity on cnn.com
2894         https://bugs.webkit.org/show_bug.cgi?id=190839
2895
2896         Reviewed by Frédéric Wang.
2897
2898         The CSSCalcOperation ctor that takes a leftSide and rightSide parameter
2899         wastes memory since it will always have size 2 but claims the
2900         default Vector size. So make sure to reserve an initial capacity of 2.
2901
2902         * css/CSSCalculationValue.cpp:
2903
2904 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2905
2906         WTFMove(xxx) is used in arguments while other arguments touch xxx
2907         https://bugs.webkit.org/show_bug.cgi?id=191544
2908
2909         Reviewed by Alex Christensen.
2910
2911         The order of the evaluation of C++ arguments is undefined. If we use WTFMove(xxx),
2912         xxx should not be touched in the other arguments. This patch fixes such uses in
2913         IDB code.
2914
2915         * Modules/indexeddb/IDBObjectStore.cpp:
2916         (WebCore::IDBObjectStore::deleteIndex):
2917         * Modules/indexeddb/IDBTransaction.cpp:
2918         (WebCore::IDBTransaction::scheduleOperation):
2919         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2920         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
2921         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2922         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
2923
2924 2018-11-12  Zalan Bujtas  <zalan@apple.com>
2925
2926         [LFC][IFC] Construct dedicated runs when the inline element requires it.
2927         https://bugs.webkit.org/show_bug.cgi?id=191509
2928
2929         Reviewed by Antti Koivisto.
2930
2931         In certain cases, a run can overlap multiple inline elements like this:
2932
2933         <span>normal text content</span><span style="position: relative; left: 10px;">but this one needs a dedicated run</span><span>end of text</span>
2934
2935         The content above generates one long run <normal text contentbut this one needs dedicated runend of text> <- input to line breaking.
2936         However, since the middle run is positioned, it needs to be moved independently from the rest of the content, hence it needs a dedicated inline run.
2937
2938         * layout/inlineformatting/InlineFormattingContext.cpp:
2939         (WebCore::Layout::InlineFormattingContext::layout const):
2940         (WebCore::Layout::contentRequiresSeparateRun):
2941         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2942         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
2943         (WebCore::Layout::InlineFormattingContext::closeLine const):
2944         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
2945         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2946         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2947         * layout/inlineformatting/InlineFormattingContext.h:
2948         (WebCore::Layout::InlineFormattingContext::inlineFormattingState const):
2949         * layout/inlineformatting/InlineLineBreaker.cpp:
2950         (WebCore::Layout::InlineLineBreaker::nextRun): mid-word breaking is not implemented yet.
2951         * layout/inlineformatting/InlineRun.h:
2952         (WebCore::Layout::InlineRun::overlapsMultipleInlineItems const):
2953         * layout/inlineformatting/InlineRunProvider.cpp:
2954         (WebCore::Layout::InlineRunProvider::processInlineTextItem):
2955         * layout/inlineformatting/InlineRunProvider.h:
2956         (WebCore::Layout::InlineRunProvider::Run::TextContext::expand):
2957         (WebCore::Layout::InlineRunProvider::Run::textContext):
2958         (WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): Deleted.
2959         (WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): Deleted.
2960
2961 2018-11-12  Jer Noble  <jer.noble@apple.com>
2962
2963         [MSE] Frame re-ordering can cause iframes to never be enqueued
2964         https://bugs.webkit.org/show_bug.cgi?id=191485
2965
2966         Reviewed by Eric Carlson.
2967
2968         Test: media/media-source/media-source-dropped-iframe.html
2969
2970         Some frame re-ordering techniques result in files where the first frame has a
2971         decode timestamp < 0, but a presentation timestamp >= 0. When appending these
2972         samples to existing content, we can fail to enqueue the first frame because its
2973         DTS overlaps an existing sample, but the presentation timestamp does not.
2974         Rather than try to only enqueue samples whose decode timestamps are > than the
2975         greatest decode end timestamp (minus some fudge factor), allow all frames to be
2976         added to the decode queue if they are strictly ordered greater than the last
2977         enqueued frame.
2978
2979         * Modules/mediasource/SourceBuffer.cpp:
2980         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
2981         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2982         (WebCore::SourceBuffer::provideMediaData):
2983         (WebCore::SourceBuffer::reenqueueMediaForTime):
2984
2985 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2986
2987         IDBTransaction does not use "RefPtr<IDBTransaction> self"
2988         https://bugs.webkit.org/show_bug.cgi?id=190436
2989
2990         Reviewed by Alex Christensen.
2991
2992         It seems that `RefPtr<IDBTransaction> self;` is not effective since it does not capture anything.
2993         Use `protectedThis = makeRef(*this)` instead.
2994
2995         No behavior change.
2996
2997         * Modules/indexeddb/IDBTransaction.cpp:
2998         (WebCore::IDBTransaction::IDBTransaction):
2999
3000 2018-11-12  Alicia Boya García  <aboya@igalia.com>
3001
3002         [MSE][GStreamer] Introduce AbortableTaskQueue
3003         https://bugs.webkit.org/show_bug.cgi?id=190902
3004
3005         Reviewed by Xabier Rodriguez-Calvar.
3006
3007         A new synchronization primitive is introduced: AbortableTaskQueue,
3008         which allows to send work to the main thread from a background thread
3009         with the option to perform two-phase cancellation (startAborting() and
3010         finishAborting()).
3011
3012         This new primitive has been used to overhaul GstBus messaging in
3013         AppendPipeline. A lot of code made redundant has been deleted in the
3014         process and lots of internal functions were now able to be made
3015         private. As part of the refactor all glib signals in AppendPipeline
3016         now use lambdas. All usages of WTF::isMainThread() in AppendPipeline
3017         have been replaced by isMainThread() for consistency with the rest of
3018         WebKit.
3019
3020         Two-phase cancellation is still not used in AppendPipeline as of this
3021         patch, but it will be used in a future patch that makes use of
3022         GStreamer flushes to implement correct MSE abort semantics. There are
3023         unit tests to ensure it works correctly, even if it's still not used.
3024
3025         * WebCore.xcodeproj/project.pbxproj:
3026         * platform/AbortableTaskQueue.h: Added.
3027         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3028         (WebCore::AppendPipeline::dumpAppendState):
3029         (WebCore::AppendPipeline::AppendPipeline):
3030         (WebCore::AppendPipeline::~AppendPipeline):
3031         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
3032         (WebCore::AppendPipeline::handleAppsinkNewSampleFromAnyThread):
3033         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
3034         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3035         (WebCore::AppendPipeline::sourceBufferPrivate):
3036         (WebCore::AppendPipeline::appsinkCaps):
3037         (WebCore::AppendPipeline::track):
3038         (WebCore::AppendPipeline::demuxerSrcPadCaps):
3039         (WebCore::AppendPipeline::playerPrivate):
3040
3041 2018-11-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3042
3043         [GStreamer][EME] waitingforkey event should consider decryptors' waiting status
3044         https://bugs.webkit.org/show_bug.cgi?id=191459
3045
3046         Reviewed by Carlos Garcia Campos.
3047
3048         The new cross platform architecture to report waitingforkey and
3049         recover from it requires a more accurate knowledge of what is
3050         going on with the decryptors because events are reported only once
3051         (per key exchange run) and crossplatform only continues if we are
3052         actually ready to continue, meaning that no decryptors are
3053         waiting.
3054
3055         * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added
3056         GstIterator deleter.
3057         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3058         (WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): Bail
3059         out if we are requested to not wait anymore but there are still
3060         waiting decryptors.
3061         (WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
3062         Query the pipeline, just a query after pipeline is built and
3063         manual inspection during build. The query is optimal but sometimes
3064         we can get this request when the pipeline is under construction so
3065         queries do not arrive at the decryptors and we have to deliver it
3066         by ourselves.
3067         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
3068         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3069         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
3070         Deleted because it is now inlined.
3071         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
3072         (webKitMediaClearKeyDecryptorDecrypt): Fixed small compiler warning.
3073         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3074         (webkit_media_common_encryption_decrypt_class_init): Override
3075         query method.
3076         (webkitMediaCommonEncryptionDecryptTransformInPlace): When the
3077         decryptor is going to block to wait, report before. When the
3078         decryptor receives the key, report it got it.
3079         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not
3080         handle waitingforkey here.
3081         (webkitMediaCommonEncryptionDecryptorQueryHandler): Report if the
3082         decryptor is waiting.
3083
3084 2018-11-12  Michael Catanzaro  <mcatanzaro@igalia.com>
3085
3086         [GTK] Silence ATK_XY_PARENT warnings
3087         https://bugs.webkit.org/show_bug.cgi?id=191504
3088
3089         Reviewed by Carlos Garcia Campos.
3090
3091         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
3092         (atkToContents):
3093         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3094         (textExtents):
3095         * accessibility/atk/WebKitAccessibleUtil.cpp:
3096         (contentsRelativeToAtkCoordinateType):
3097
3098 2018-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3099
3100         Implement a new edit command to change the enclosing list type
3101         https://bugs.webkit.org/show_bug.cgi?id=191487
3102         <rdar://problem/45955922>
3103
3104         Reviewed by Ryosuke Niwa.
3105
3106         Add support for a new edit command that changes the type of the enclosing list element around the selection from
3107         unordered to ordered list and vice versa. This new edit command is exposed only to internal WebKit2 clients, via
3108         SPI on WKWebView (`-_changeListType:`).
3109
3110         This is currently intended for use in Mail compose, but may also be adopted by legacy Notes in the future. As
3111         such, the behavior of this editing command mostly matches shipping behavior in Mail compose (which is currently
3112         implemented entirely by Mail). See below for more details.
3113
3114         Test:   editing/execCommand/change-list-type.html
3115                 WKWebViewEditActions.ChangeListType
3116
3117         * Sources.txt:
3118         * WebCore.xcodeproj/project.pbxproj:
3119         * editing/ChangeListTypeCommand.cpp: Added.
3120         (WebCore::listConversionTypeForSelection):
3121         (WebCore::ChangeListTypeCommand::listConversionType):
3122
3123         Helper that returns a potential list conversion command that may be executed at the given document's selection,
3124         if any exists. We also use existing logic from Mail here to determine which list to change, by walking up the
3125         DOM from the lowest common ancestor container of the current selection until we hit the first list element.
3126
3127         (WebCore::ChangeListTypeCommand::createNewList):
3128
3129         Helper method to create a new list element to replace the given list, and then clone element data from the given
3130         list to the new list. This addresses an existing bug in Mail, wherein changing list type for an enclosing list
3131         which contains inline style properties drops the inline styles, because existing logic in Mail that implements
3132         this editing command only copies the `class` attribute of the old list to the new list.
3133
3134         (WebCore::ChangeListTypeCommand::doApply):
3135
3136         Apply the edit command by running the following steps:
3137         -   Find the enclosing list element, if any (see above).
3138         -   Create a new list element of the opposite type as the enclosing list, and clone over element data from the
3139             list element being replaced.
3140         -   Insert the new list next to the original list.
3141         -   Move all children of the original list to the new list.
3142         -   Remove the original list.
3143         -   Set the selection to the end of the new list.
3144
3145         * editing/ChangeListTypeCommand.h: Added.
3146         * editing/EditAction.h:
3147
3148         Add a pair of new edit actions for conversion from unordered list to ordered list and vice versa.
3149
3150         * editing/Editor.cpp:
3151         (WebCore::Editor::changeSelectionListType):
3152
3153         Implement this by creating and applying a new ChangeListTypeCommand.
3154
3155         (WebCore::Editor::canChangeSelectionListType): Deleted.
3156
3157         Remove this for now, since there's no need for it until full support for edit command validation is implemented.
3158
3159         * editing/Editor.h:
3160         * testing/Internals.cpp:
3161         (WebCore::Internals::changeSelectionListType):
3162         * testing/Internals.h:
3163         * testing/Internals.idl:
3164
3165         Add internal hooks to change list type from layout tests.
3166
3167 2018-11-11  Daniel Bates  <dabates@apple.com>
3168
3169         [iOS] Draw caps lock indicator in password fields
3170         https://bugs.webkit.org/show_bug.cgi?id=190565
3171         <rdar://problem/45262343>
3172
3173         Reviewed by Dean Jackson.
3174
3175         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
3176         fields on iOS more closely match the behavior of password fields on Mac.
3177
3178         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
3179         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
3180         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
3181         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
3182         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
3183         web views listen for keyboard availability changes so as to update the the caps lock state when
3184         a hardware keyboard is detached or attached.
3185
3186         * WebCore.xcodeproj/project.pbxproj:
3187         * page/EventHandler.cpp:
3188         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
3189         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
3190         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
3191         * page/EventHandler.h:
3192         * platform/cocoa/KeyEventCocoa.mm:
3193         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
3194         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
3195         * platform/ios/KeyEventIOS.mm:
3196         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
3197         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
3198         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
3199         * platform/ios/WebEvent.h:
3200         * platform/ios/WebEvent.mm:
3201         (+[WebEvent modifierFlags]): Added.
3202         * platform/mac/KeyEventMac.mm:
3203         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
3204         by both Mac and iOS.
3205         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
3206         by both Mac and iOS.
3207         * rendering/RenderThemeCocoa.h:
3208         * rendering/RenderThemeCocoa.mm:
3209         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
3210         * rendering/RenderThemeIOS.h:
3211         * rendering/RenderThemeIOS.mm:
3212         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
3213         * rendering/RenderThemeMac.h:
3214         * rendering/RenderThemeMac.mm:
3215         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
3216         shared by both Mac and iOS.
3217
3218 2018-11-11  Zalan Bujtas  <zalan@apple.com>
3219
3220         [LFC][BFC] In-flow positioned logic is really formatting context dependent.
3221         https://bugs.webkit.org/show_bug.cgi?id=191512
3222
3223         Reviewed by Simon Fraser.
3224
3225         Move block formatting context specific code from FormattingContext to BlockFormattingContext.
3226
3227         * layout/FormattingContext.cpp:
3228         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): Deleted.
3229         * layout/FormattingContext.h:
3230         * layout/FormattingContextGeometry.cpp:
3231         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
3232         * layout/blockformatting/BlockFormattingContext.cpp:
3233         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
3234         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): Deleted.
3235         * layout/blockformatting/BlockFormattingContext.h:
3236         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3237         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): Deleted.
3238         * layout/inlineformatting/InlineFormattingContext.cpp:
3239         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): Deleted.
3240         * layout/inlineformatting/InlineFormattingContext.h:
3241
3242 2018-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
3243
3244         Address post-review comments after r237955
3245         https://bugs.webkit.org/show_bug.cgi?id=191496
3246
3247         Reviewed by Darin Adler.
3248
3249         * rendering/TextDecorationPainter.cpp:
3250         (WebCore::TextDecorationPainter::paintTextDecoration):
3251         * style/InlineTextBoxStyle.cpp:
3252         (WebCore::computeUnderlineOffset):
3253         * style/InlineTextBoxStyle.h:
3254
3255 2018-11-11  Benjamin Poulain  <benjamin@webkit.org>
3256
3257         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
3258         https://bugs.webkit.org/show_bug.cgi?id=191492
3259
3260         Reviewed by Alex Christensen.
3261
3262         Rename file.
3263
3264         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3265         * page/mac/EventHandlerMac.mm:
3266         * platform/mac/URLMac.mm:
3267         * platform/mac/WebCoreNSURLExtras.mm:
3268         * platform/mac/WebCoreObjCExtras.mm:
3269         * rendering/RenderThemeMac.mm:
3270
3271 2018-11-10  Benjamin Poulain  <benjamin@webkit.org>
3272
3273         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
3274         https://bugs.webkit.org/show_bug.cgi?id=191492
3275
3276         Reviewed by Alex Christensen.
3277
3278         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3279         * page/mac/EventHandlerMac.mm:
3280         * platform/mac/URLMac.mm:
3281         * platform/mac/WebCoreNSURLExtras.mm:
3282         * platform/mac/WebCoreObjCExtras.mm:
3283         * rendering/RenderThemeMac.mm:
3284         (WebCore::RenderThemeMac::systemColor const):
3285
3286 2018-11-10  Megan Gardner  <megan_gardner@apple.com>
3287
3288         Fix build for 32bit Mac
3289         https://bugs.webkit.org/show_bug.cgi?id=191511
3290
3291         Unreviewed Build Fix.
3292
3293         Build fix, not tests needed.
3294
3295         Make the apporiate delecrations for 32-bit mac support.
3296
3297         * editing/mac/DictionaryLookup.mm:
3298
3299 2018-11-10  Simon Fraser  <simon.fraser@apple.com>
3300
3301         Remove support for -webkit-svg-shadow
3302         https://bugs.webkit.org/show_bug.cgi?id=187429
3303         <rdar://problem/41920735>
3304
3305         Reviewed by Dean Jackson.
3306         
3307         -webkit-svg-shadow was a non-standard hack for online iWork, and they no longer use it,
3308         so remove it. No other browser supports it, and chromestatus say it's used on less than
3309         0.000001% of pages.
3310
3311         * css/CSSComputedStyleDeclaration.cpp:
3312         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3313         * css/CSSProperties.json:
3314         * css/SVGCSSComputedStyleDeclaration.cpp:
3315         (WebCore::ComputedStyleExtractor::svgPropertyValue):
3316         * css/StyleBuilderCustom.h:
3317         (WebCore::StyleBuilderCustom::applyInitialWebkitSvgShadow): Deleted.
3318         (WebCore::StyleBuilderCustom::applyInheritWebkitSvgShadow): Deleted.
3319         (WebCore::StyleBuilderCustom::applyValueWebkitSvgShadow): Deleted.
3320         * css/parser/CSSPropertyParser.cpp:
3321         (WebCore::CSSPropertyParser::parseSingleValue):
3322         * rendering/RenderElement.cpp:
3323         (WebCore::RenderElement::didAttachChild):
3324         * rendering/svg/RenderSVGImage.cpp:
3325         (WebCore::RenderSVGImage::layout):
3326         * rendering/svg/RenderSVGImage.h:
3327         * rendering/svg/RenderSVGModelObject.cpp:
3328         (WebCore::RenderSVGModelObject::RenderSVGModelObject):
3329         * rendering/svg/RenderSVGModelObject.h:
3330         (WebCore::RenderSVGModelObject::repaintRectInLocalCoordinatesExcludingSVGShadow const): Deleted.
3331         (WebCore::RenderSVGModelObject::hasSVGShadow const): Deleted.
3332         (WebCore::RenderSVGModelObject::setHasSVGShadow): Deleted.
3333         * rendering/svg/RenderSVGRoot.cpp:
3334         (WebCore::RenderSVGRoot::RenderSVGRoot):
3335         (WebCore::RenderSVGRoot::updateCachedBoundaries):
3336         * rendering/svg/RenderSVGRoot.h:
3337         * rendering/svg/RenderSVGShape.cpp:
3338         (WebCore::RenderSVGShape::updateRepaintBoundingBox):
3339         * rendering/svg/RenderSVGShape.h:
3340         * rendering/svg/SVGRenderSupport.cpp:
3341         (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
3342         (WebCore::SVGRenderSupport::layoutChildren):
3343         (WebCore::SVGRenderSupport::styleChanged):
3344         (WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow): Deleted.
3345         (WebCore::SVGRenderSupport::rendererHasSVGShadow): Deleted.
3346         (WebCore::SVGRenderSupport::setRendererHasSVGShadow): Deleted.
3347         (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows): Deleted.
3348         (WebCore::SVGRenderSupport::childAdded): Deleted.
3349         * rendering/svg/SVGRenderSupport.h:
3350
3351 2018-11-10  Ryan Haddad  <ryanhaddad@apple.com>
3352
3353         Unreviewed, rolling out r238065.
3354
3355         Breaks internal builds.
3356
3357         Reverted changeset:
3358
3359         "Make it possible to edit images inline"
3360         https://bugs.webkit.org/show_bug.cgi?id=191352
3361         https://trac.webkit.org/changeset/238065
3362
3363 2018-11-10  Tim Horton  <timothy_horton@apple.com>
3364
3365         Make it possible to edit images inline
3366         https://bugs.webkit.org/show_bug.cgi?id=191352
3367         <rdar://problem/30107985>
3368
3369         Reviewed by Dean Jackson.
3370
3371         Tests: editing/images/basic-editable-image.html
3372                editing/images/reparent-editable-image-maintains-strokes.html
3373
3374         Add the beginnings of a mechanism to replace images with a special attribute
3375         with a native drawing view in the UI process.
3376
3377         * page/Settings.yaml:
3378         Add a setting to control whether images become natively editable when they
3379         have the x-apple-editable-image attribute.
3380
3381         * html/HTMLImageElement.cpp:
3382         (WebCore::HTMLImageElement::editableImageViewID const):
3383         Lazily generate an EmbeddedViewID and persist it on the <img> element.
3384
3385         * html/HTMLImageElement.h:
3386         Rearrange the service controls methods to sit before the members.
3387         Add m_editableImageViewID and editableImageViewID().
3388
3389         * platform/graphics/GraphicsLayer.cpp:
3390         (WebCore::GraphicsLayer::nextEmbeddedViewID):
3391         * platform/graphics/GraphicsLayer.h:
3392         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
3393         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
3394         on Cocoa platforms and when using RemoteLayerTree.
3395         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
3396         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
3397         and an EmbeddedViewID to uniquely identify and communicate about the
3398         embedded view (which may move between layers, since it is tied to an element).
3399
3400         * platform/graphics/ca/GraphicsLayerCA.cpp:
3401         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
3402         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
3403         When setting GraphicsLayer's contents to an embedded view, we use
3404         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
3405         GraphicsLayerCARemote will override this and make a correctly-initialized
3406         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
3407
3408         * platform/graphics/ca/GraphicsLayerCA.h:
3409         * platform/graphics/ca/PlatformCALayer.cpp:
3410         (WebCore::operator<<):
3411         * platform/graphics/ca/PlatformCALayer.h:
3412         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
3413         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3414         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
3415         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
3416         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
3417         These will be overridden by PlatformCALayerRemote to do more interesting things.
3418
3419         * rendering/RenderImage.cpp:
3420         (WebCore::RenderImage::isEditableImage const):
3421         Add a getter that return true if the setting is enabled and
3422         x-apple-editable-image is empty or true.
3423
3424         (WebCore::RenderImage::requiresLayer const):
3425         RenderImage requires a layer either if RenderReplaced does, or we are an
3426         editable image.
3427
3428         * rendering/RenderImage.h:
3429         * rendering/RenderLayer.cpp:
3430         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
3431         (WebCore::RenderLayer::calculateClipRects const):
3432         * rendering/RenderLayerBacking.cpp:
3433         (WebCore::RenderLayerBacking::updateConfiguration):
3434         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
3435
3436         * rendering/RenderLayerCompositor.cpp:
3437         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
3438         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
3439         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
3440         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
3441         * rendering/RenderLayerCompositor.h:
3442         Make editable images require compositing implicitly.
3443
3444 2018-11-09  Zalan Bujtas  <zalan@apple.com>
3445
3446         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
3447         https://bugs.webkit.org/show_bug.cgi?id=191078
3448         <rdar://problem/45736178>
3449
3450         Reviewed by Antti Koivisto.
3451
3452         1. Improve visuallyNonEmpty milestone confidence level.
3453             Ignore whitespace and non visible text content.
3454             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
3455             Check if the html/body is actually visible.
3456
3457         2. Issue initial paint soon after the milestone fires.
3458             Use a 0ms timer to flush the initial paint.
3459             Throttle additional flushes for 500ms and 1.5s (original behaviour).
3460
3461         3. Suspend optional style recalcs and layouts while painting is being throttled.
3462            When parsing yields we initiate a 0ms style recalc/layout timer.
3463            These optional layouts produce content that we have no intention to paint. 
3464
3465         * dom/Document.cpp:
3466         (WebCore::Document::scheduleStyleRecalc):
3467         (WebCore::Document::shouldScheduleLayout):
3468         * page/ChromeClient.h:
3469         * page/FrameView.cpp:
3470         (WebCore::FrameView::resetLayoutMilestones):
3471         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
3472         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
3473         (WebCore::FrameView::updateIsVisuallyNonEmpty):
3474         * page/FrameView.h:
3475         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
3476         * platform/graphics/FontCascade.h:
3477         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
3478         (WebCore::RenderText::RenderText):
3479
3480 2018-11-09  John Wilander  <wilander@apple.com>
3481
3482         Add ability to configure document.cookie lifetime cap through user defaults
3483         https://bugs.webkit.org/show_bug.cgi?id=191480
3484         <rdar://problem/45240871>
3485
3486         Reviewed by Chris Dumez.
3487
3488         No new tests. Existing test makes sure we don't regress.
3489
3490         This change makes the capped lifetime in seconds configurable through
3491         user defaults.
3492
3493         * platform/network/NetworkStorageSession.h:
3494         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3495         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
3496         (WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): Deleted.
3497             Renamed setAgeCapForClientSideCookies().
3498         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3499         (WebCore::filterCookies):
3500         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
3501
3502 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
3503
3504         Unreviewed, rolling out r238047.
3505
3506         Introduced layout test failures on iOS simulator.
3507
3508         Reverted changeset:
3509
3510         "[iOS] Draw caps lock indicator in password fields"
3511         https://bugs.webkit.org/show_bug.cgi?id=190565
3512         https://trac.webkit.org/changeset/238047
3513
3514 2018-11-09  Tim Horton  <timothy_horton@apple.com>
3515
3516         Normal-flow-only flex items don't correctly respect z-index
3517         https://bugs.webkit.org/show_bug.cgi?id=191486
3518
3519         Reviewed by Simon Fraser.
3520
3521         Test: css3/flexbox/z-index-with-normal-flow-only.html
3522
3523         * rendering/RenderLayer.cpp:
3524         (WebCore::canCreateStackingContext):
3525         r125693 did not ensure that flex items which would otherwise be
3526         normal-flow-only would be put into the z-order tree when necessary.
3527         Fix by respecting the same trigger we use to make layers for flex items;
3528         namely, not having auto z-index.
3529
3530 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
3531
3532         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels
3533         https://bugs.webkit.org/show_bug.cgi?id=191471
3534         <rdar://problem/45952472>
3535
3536         Reviewed by Tim Horton.
3537
3538         Add new method stubs for changing the list type for the current selection (to be implemented in a future patch).
3539
3540         * editing/Editor.cpp:
3541         (WebCore::Editor::canChangeSelectionListType):
3542         (WebCore::Editor::changeSelectionListType):
3543         * editing/Editor.h:
3544
3545 2018-11-09  Keith Rollin  <krollin@apple.com>
3546
3547         Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
3548
3549         Remove the use of .xcfilelists until their side-effects are better
3550         understood.
3551
3552         * WebCore.xcodeproj/project.pbxproj:
3553
3554 2018-11-09  Jer Noble  <jer.noble@apple.com>
3555
3556         SourceBuffer throws an error when appending a second init segment after changeType().
3557         https://bugs.webkit.org/show_bug.cgi?id=191474
3558
3559         Reviewed by Eric Carlson.
3560
3561         Test: media/media-source/media-source-changetype-second-init.html
3562
3563         When encountering an initialization segment after changeType(), add the parsed codec types
3564         to the list of allowed codecs.
3565
3566         * Modules/mediasource/SourceBuffer.cpp:
3567         (WebCore::SourceBuffer::validateInitializationSegment):
3568         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3569         (WebCore::MockMediaPlayerMediaSource::supportsType):
3570         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
3571         (WebCore::MockSourceBufferPrivate::canSwitchToType):
3572         * platform/mock/mediasource/MockSourceBufferPrivate.h:
3573
3574 2018-11-09  Eric Carlson  <eric.carlson@apple.com>
3575
3576         [MediaStream] AVVideoCaptureSource reports incorrect size when frames are scaled
3577         https://bugs.webkit.org/show_bug.cgi?id=191479
3578         <rdar://problem/45952201>
3579
3580         Reviewed by Jer Noble.
3581
3582         No new tests, tested manually.
3583
3584         * platform/mediastream/RealtimeVideoSource.cpp:
3585         (WebCore::RealtimeVideoSource::standardVideoSizes): Drive-by fix: add a few more standard
3586         video frame sizes, correct a typo.
3587         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): Drive-by fix: don't consider
3588         rescaled sized when we already have an exact or aspect ratio match because it won't be used.
3589
3590         * platform/mediastream/mac/AVVideoCaptureSource.h:
3591         (WebCore::AVVideoCaptureSource::width const): Deleted.
3592         (WebCore::AVVideoCaptureSource::height const): Deleted.
3593         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3594         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): Delete m_requestedSize.
3595         (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete m_width and m_height.
3596         (WebCore::AVVideoCaptureSource::processNewFrame): Don't call setSize with captured size,
3597         the frame may be resized before deliver.
3598
3599 2018-11-09  Ross Kirsling  <ross.kirsling@sony.com>
3600
3601         Unreviewed MSVC build fix after r238039 (and r238046).
3602
3603         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3604         * bindings/js/JSWorkerGlobalScopeBase.h:
3605
3606 2018-11-09  Basuke Suzuki  <basuke.suzuki@sony.com>
3607
3608         [Curl][WebKit] Implement Proxy configuration API.
3609         https://bugs.webkit.org/show_bug.cgi?id=189053
3610
3611         Reviewed by Youenn Fablet.
3612
3613         Added API to set proxy from the app.
3614
3615         No new tests because there's no behaviour change in WebCore.
3616
3617         * platform/network/NetworkStorageSession.h:
3618         * platform/network/curl/CurlContext.h:
3619         (WebCore::CurlContext::setProxySettings):
3620         * platform/network/curl/CurlProxySettings.h:
3621         * platform/network/curl/NetworkStorageSessionCurl.cpp:
3622         (WebCore::NetworkStorageSession::setProxySettings const):
3623
3624 2018-11-09  Antti Koivisto  <antti@apple.com>
3625
3626         Use OptionSet for layout milestones
3627         https://bugs.webkit.org/show_bug.cgi?id=191470
3628
3629         Reviewed by Dean Jackson.
3630
3631         * WebCore.xcodeproj/project.pbxproj:
3632         * loader/EmptyFrameLoaderClient.h:
3633         * loader/FrameLoader.cpp:
3634         (WebCore::FrameLoader::didReachLayoutMilestone):
3635         * loader/FrameLoader.h:
3636         * loader/FrameLoaderClient.h:
3637         * page/FrameView.cpp:
3638         (WebCore::FrameView::FrameView):
3639         (WebCore::FrameView::addPaintPendingMilestones):
3640         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
3641         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
3642         * page/FrameView.h:
3643         * page/LayoutMilestone.h: Copied from Source/WebCore/page/LayoutMilestones.h.
3644
3645         Renamed to appease WK2 IPC code generation.
3646
3647         * page/LayoutMilestones.h: Removed.
3648         * page/Page.cpp:
3649         (WebCore::Page::addLayoutMilestones):
3650         (WebCore::Page::removeLayoutMilestones):
3651         (WebCore::Page::isCountingRelevantRepaintedObjects const):
3652         * page/Page.h:
3653         (WebCore::Page::requestedLayoutMilestones const):
3654
3655 2018-11-09  Daniel Bates  <dabates@apple.com>
3656
3657         [iOS] Draw caps lock indicator in password fields
3658         https://bugs.webkit.org/show_bug.cgi?id=190565
3659         <rdar://problem/45262343>
3660
3661         Reviewed by Dean Jackson.
3662
3663         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
3664         fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the
3665         indicator when caps locks is enabled via the hardware keyboard. We will look to support the software
3666         keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>).
3667
3668         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
3669         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
3670         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
3671         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
3672         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
3673         web views listen for keyboard availability changes so as to update the the caps lock state when
3674         a hardware keyboard is detached or attached.
3675
3676         * WebCore.xcodeproj/project.pbxproj:
3677         * page/EventHandler.cpp:
3678         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
3679         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
3680         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
3681         * page/EventHandler.h:
3682         * platform/cocoa/KeyEventCocoa.mm:
3683         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
3684         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
3685         * platform/ios/KeyEventIOS.mm:
3686         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
3687         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
3688         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
3689         * platform/ios/WebEvent.h:
3690         * platform/ios/WebEvent.mm:
3691         (+[WebEvent modifierFlags]): Added.
3692         * platform/mac/KeyEventMac.mm:
3693         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
3694         by both Mac and iOS.
3695         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
3696         by both Mac and iOS.
3697         * rendering/RenderThemeCocoa.h:
3698         * rendering/RenderThemeCocoa.mm:
3699         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
3700         * rendering/RenderThemeIOS.h:
3701         * rendering/RenderThemeIOS.mm:
3702         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
3703         * rendering/RenderThemeMac.h:
3704         * rendering/RenderThemeMac.mm:
3705         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
3706         shared by both Mac and iOS.
3707
3708 2018-11-09  Chris Dumez  <cdumez@apple.com>
3709
3710         Unreviewed attempt to fix WinCairo build after r238039.
3711
3712         * bindings/js/JSWorkerGlobalScopeBase.h:
3713
3714 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
3715
3716         Extensions3DOpenGLES.h:  warning: 'blitFramebuffer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
3717         https://bugs.webkit.org/show_bug.cgi?id=191451
3718
3719         Reviewed by Dean Jackson.
3720
3721         No new tests because there is no behavior change.
3722
3723         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
3724         (WebCore::Extensions3DOpenGLES::setEXTContextLostCallback): Deleted unused method.
3725         * platform/graphics/opengl/Extensions3DOpenGLES.h: Marked 'override'.
3726
3727 2018-11-09  Andy Estes  <aestes@apple.com>
3728
3729         [Payment Request] canMakePayment() should not consider serialized payment method data
3730         https://bugs.webkit.org/show_bug.cgi?id=191432
3731
3732         Reviewed by Dean Jackson.
3733
3734         In https://github.com/w3c/payment-request/pull/806, we're changing the specification of
3735         canMakePayment() to not consider serialized payment method data when deciding if a payment
3736         method is supported. For Apple Pay, this means we resolve to true for
3737         "https://apple.com/apple-pay", even if an ApplePayRequest is omitted or is missing required
3738         fields.
3739
3740         Added test cases to
3741         http/tests/paymentrequest/payment-request-canmakepayment-method.https.html and
3742         http/tests/paymentrequest/payment-request-show-method.https.html.
3743
3744         * Modules/paymentrequest/PaymentRequest.cpp:
3745         (WebCore::PaymentRequest::canMakePayment):
3746
3747 2018-11-09  Andy Estes  <aestes@apple.com>
3748
3749         [Payment Request] PaymentResponse.details should be updated when the user accepts a retried payment
3750         https://bugs.webkit.org/show_bug.cgi?id=191440
3751
3752         Reviewed by Dean Jackson.
3753
3754         PaymentResponse.details was being initialized in the PaymentResponse constructor and never
3755         updated when the user accepts a retried payment. We need to update it.
3756
3757         Added a test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
3758
3759         * Modules/paymentrequest/PaymentRequest.cpp:
3760         (WebCore::PaymentRequest::accept):
3761         * Modules/paymentrequest/PaymentResponse.cpp:
3762         (WebCore::PaymentResponse::PaymentResponse):
3763         (WebCore::PaymentResponse::setDetailsFunction):
3764         * Modules/paymentrequest/PaymentResponse.h:
3765
3766 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
3767
3768         MediaPlayerPrivateMediaFoundation.h: warning: 'GetService' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
3769         https://bugs.webkit.org/show_bug.cgi?id=191453
3770
3771         Reviewed by Per Arne Vollan.
3772
3773         No new tests because there is no behavior change.
3774
3775         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Marked with 'override' and removed 'virtual'.
3776
3777 2018-11-09  Chris Dumez  <cdumez@apple.com>
3778
3779         Unreviewed attempt to fix internal build on macOS.
3780
3781         'Export' is defined in several headers.
3782
3783         * bindings/js/JSDOMGlobalObject.cpp:
3784         * bindings/js/JSDOMGlobalObject.h:
3785         * bridge/jsc/BridgeJSC.cpp:
3786         * bridge/jsc/BridgeJSC.h:
3787
3788 2018-11-09  Chris Dumez  <cdumez@apple.com>
3789
3790         HTML form validation bubble disappears
3791         https://bugs.webkit.org/show_bug.cgi?id=191418
3792
3793         Reviewed by Simon Fraser.
3794
3795         If we validate a form and find an invalid form control, we'll scroll it into view and show
3796         the validation bubble. However, scrolling the element into view may be an asynchronous
3797         operation, in which case it would discard the validation bubble prematurely because scrolling
3798         hides the validation bubble. To address the issue, we now show the validation message
3799         asynchronously after focusing the element (and potentially scrolling it into view).
3800
3801         Test: fast/forms/scroll-into-view-and-show-validation-message.html
3802
3803         * html/HTMLFormControlElement.cpp:
3804         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
3805
3806 2018-11-09  Brent Fulgham  <bfulgham@apple.com>
3807
3808         [Windows][DirectX] Be more rigors about BeginFigure/EndFigure and Close operations. 
3809         https://bugs.webkit.org/show_bug.cgi?id=191452
3810         <rdar://problem/45933964>
3811
3812         Reviewed by Zalan Bujtas.
3813
3814         Do a better job of balancing the BeginFigure/EndFigure calls in
3815         the PathDirect2D implementation. Failure to do so puts the Geometry sink
3816         into an error state that prevents it from producing drawing output.
3817       
3818
3819         * platform/graphics/Path.h:
3820         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3821         (WebCore::GraphicsContext::drawPath): Flush is needed here.
3822         (WebCore::GraphicsContext::fillPath): Ditto.
3823         (WebCore::GraphicsContext::strokePath): Ditto.
3824         * platform/graphics/win/PathDirect2D.cpp:
3825         (WebCore::Path::drawDidComplete):
3826         (WebCore::Path::closeAnyOpenGeometries):
3827         (WebCore::Path::transform):
3828         (WebCore::Path::openFigureAtCurrentPointIfNecessary):
3829         (WebCore::Path::moveTo):
3830         (WebCore::Path::closeSubpath):
3831
3832 2018-11-09  Jer Noble  <jer.noble@apple.com>
3833
3834         [Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
3835         https://bugs.webkit.org/show_bug.cgi?id=191396
3836
3837         Reviewed by Eric Carlson.
3838
3839         When changeType() is called, exempt video and text tracks (in addition to just audio tracks)
3840         from "same codec" requirements.
3841
3842         * Modules/mediasource/SourceBuffer.cpp:
3843         (WebCore::SourceBuffer::validateInitializationSegment):
3844
3845 2018-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3846
3847         REGRESSION(r236365): [GTK] Many form-related tests are failing
3848         https://bugs.webkit.org/show_bug.cgi?id=189993
3849
3850         Reviewed by Michael Catanzaro.
3851
3852         Only the first form data element is added to the message body due to a return added by mistake in r236365.
3853
3854         * platform/network/soup/ResourceRequestSoup.cpp:
3855         (WebCore::ResourceRequest::updateSoupMessageBody const): Remove return.
3856
3857 2018-11-09  Zalan Bujtas  <zalan@apple.com>
3858
3859         [LFC][IFC] Move some code from InlineFormattingContext::Line to InlineFormattingContext/Geometry
3860         https://bugs.webkit.org/show_bug.cgi?id=191445
3861
3862         Reviewed by Antti Koivisto.
3863
3864         The idea here is that Line should not have to deal with all the post processig tasks like the runs final aligments.
3865         (The line class would eventually turn into a collection of random things).
3866
3867         * layout/inlineformatting/InlineFormattingContext.cpp:
3868         (WebCore::Layout::InlineFormattingContext::closeLine const):
3869         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
3870         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3871         * layout/inlineformatting/InlineFormattingContext.h:
3872         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
3873         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const):
3874         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3875         (WebCore::Layout::InlineFormattingContext::Geometry::adjustedLineLogicalLeft):
3876         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
3877         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
3878         * layout/inlineformatting/Line.cpp:
3879         (WebCore::Layout::InlineFormattingContext::Line::Line):
3880         (WebCore::Layout::InlineFormattingContext::Line::init):
3881         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
3882         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
3883         (WebCore::Layout::InlineFormattingContext::Line::close):
3884         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
3885         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): Deleted.
3886         (WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities): Deleted.
3887         (WebCore::Layout::InlineFormattingContext::Line::justifyRuns): Deleted.
3888
3889 2018-11-09  Philippe Normand  <pnormand@igalia.com>
3890
3891         Unreviewed, GStreamer build warning fix
3892
3893         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
3894         (WebCore::GStreamerVideoEncoder::newSampleCallback): Timesamp()
3895         returns a uint32_t, fix format string accordingly.
3896
3897 2018-11-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3898
3899         Add an SPI to allow WebView clients to add additional supported image formats
3900         https://bugs.webkit.org/show_bug.cgi?id=190454
3901
3902         Reviewed by Simon Fraser.
3903
3904         Add an SPI to allow additional supported image formats in WebView. These
3905         additional formats can be set in the WKWebViewConfiguration as an NSArray
3906         of NStrings. Each string represents an image source type aka UTI.
3907
3908         The ImageSourceType in the functions' names will be replaced by ImageType.
3909         ImageType in this context is the image UTI (Uniform Type Identifier).
3910
3911         * platform/MIMETypeRegistry.cpp:
3912         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
3913         (WebCore::MIMETypeRegistry::additionalSupportedImageMIMETypes):
3914         (WebCore::supportedImageMIMETypesForEncoding):
3915         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
3916         * platform/MIMETypeRegistry.h:
3917         * platform/graphics/cg/ImageDecoderCG.cpp:
3918         (WebCore::ImageDecoderCG::filenameExtension const):
3919         (WebCore::ImageDecoderCG::encodedDataStatus const):
3920         * platform/graphics/cg/ImageSourceCG.h:
3921         * platform/graphics/cg/ImageSourceCGMac.mm:
3922         (WebCore::MIMETypeForImageType):
3923         (WebCore::preferredExtensionForImageType):
3924         (WebCore::MIMETypeForImageSourceType): Deleted.
3925         (WebCore::preferredExtensionForImageSourceType): Deleted.
3926         * platform/graphics/cg/ImageSourceCGWin.cpp:
3927         (WebCore::MIMETypeForImageType):
3928         (WebCore::preferredExtensionForImageType):
3929         (WebCore::MIMETypeForImageSourceType): Deleted.
3930         (WebCore::preferredExtensionForImageSourceType): Deleted.
3931         * platform/graphics/cg/UTIRegistry.cpp:
3932         (WebCore::defaultSupportedImageTypes):
3933         (WebCore::additionalSupportedImageTypes):
3934         (WebCore::setAdditionalSupportedImageTypes):
3935         (WebCore::isSupportedImageType):
3936         (WebCore::supportedDefaultImageSourceTypes): Deleted.
3937         (WebCore::isSupportImageSourceType): Deleted.
3938         * platform/graphics/cg/UTIRegistry.h:
3939
3940 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
3941
3942         Adopt Reveal Framework to replace Lookup
3943         https://bugs.webkit.org/show_bug.cgi?id=191097
3944
3945         Reviewed by Tim Horton.
3946
3947         Reveal is not currently testable.
3948
3949         The Reveal framework does the same job as Lookup and DataDectors.
3950         In this patch we switch from using Lookup to determine what text
3951         to select and define to using Reveal and RVItems. Since this
3952         code needs to work on older systems, and Reveal is newer, we also need
3953         to keep around the old code for old systems so that they can also
3954         continue to work. Eventually we will remove this code and also likly switch
3955         to passing RVItems across from the web process rather than making them
3956         on each side.
3957
3958         * SourcesCocoa.txt:
3959         * WebCore.xcodeproj/project.pbxproj: