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