[AX] Fix compile error in AXObjectCache constructor when !HAVE(ACCESSIBILITY)
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-07  Don Olmstead  <don.olmstead@sony.com>
2
3         [AX] Fix compile error in AXObjectCache constructor when !HAVE(ACCESSIBILITY)
4         https://bugs.webkit.org/show_bug.cgi?id=189423
5         <rdar://problem/44231775>
6
7         Reviewed by Yusuke Suzuki.
8
9         No new tests. Compilation fix.
10
11         * accessibility/AXObjectCache.h:
12         (WebCore::AXObjectCache::AXObjectCache):
13
14 2018-09-07  Zalan Bujtas  <zalan@apple.com>
15
16         [LFC] Replace "computed" value with "used" value to match spec language
17         https://bugs.webkit.org/show_bug.cgi?id=189414
18
19         Reviewed by Antti Koivisto.
20
21         * layout/FormattingContext.cpp:
22         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
23         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
24         * layout/FormattingContext.h:
25         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
26         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
27         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
28         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
29         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
30         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
31         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
32         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
33         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
34         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
35         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
36         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
37         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
38         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
39         * layout/FormattingContextGeometry.cpp:
40         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
41         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
42         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
43         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
44         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
45         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
46         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
47         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
48         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
49         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
50         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
51         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
52         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
53         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
54         * layout/blockformatting/BlockFormattingContext.cpp:
55         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
56         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
57         * layout/blockformatting/BlockFormattingContext.h:
58         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
59         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
60         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
61         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
62         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
63         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
64         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
65         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
66         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
67         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
68         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
69
70 2018-09-06  Ryosuke Niwa  <rniwa@webkit.org>
71
72         ShadowRoot should have its own node flag
73         https://bugs.webkit.org/show_bug.cgi?id=189392
74
75         Reviewed by Antti Koivisto.
76
77         Added IsShadowRootFlag and IsDocumentNodeFlag, and removed IsDocumentFragmentFlag and IsStyledElementFlag.
78         Also re-ordered flags to group flags used by subclasses below ones directly used by Node in
79         accordinate with the comment.
80
81         No new tests since there should be no behavioral change.
82
83         * dom/ContainerNode.h:
84         (WebCore::Node::isTreeScope const): Deleted.
85         * dom/Node.h:
86         (WebCore::Node::isStyledElement const): Check if this is a HTML, SVG, or MathML element instead.
87         (WebCore::Node::isDocumentNode const): Simply check IsDocumentNodeFlag.
88         (WebCore::Node::isTreeScope const): Check if this is a document or a shadow root Instead of comparing
89         the tree scope to this.
90         (WebCore::Node::isDocumentFragment const): Check if this is a container node which is neither document,
91         element, nor shadow root.
92         (WebCore::Node::isShadowRoot const): Simply check IsShadowRootFlag. This is the change needed to fix
93         the blockign bug 166748.
94         (WebCore::Node::flagIsShadowRoot): Added. Will be used in the bug 166748.
95
96 2018-09-06  Zalan Bujtas  <zalan@apple.com>
97
98         [LFC] Inline replaced height calculation should use "used value"
99         https://bugs.webkit.org/show_bug.cgi?id=189395
100
101         Reviewed by Antti Koivisto.
102
103         Use the already assigned width value (aka used value) instead of the computed value when computing the inline's height.
104         see https://www.w3.org/TR/CSS22/cascade.html#value-stages for "used" and "computed" value.
105
106         * layout/FormattingContextGeometry.cpp:
107         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
108
109 2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
110
111         Refactor WebCore::EditAction to be an 8-bit enum class
112         https://bugs.webkit.org/show_bug.cgi?id=189383
113
114         Reviewed by Dan Bernstein.
115
116         Currently, EditAction.h defines an EditAction as an enum. This patch changes EditAction to instead be an 8-bit-
117         wide enum class, and renames all EditAction values from EditAction(*) to EditAction::(*).
118
119         No change in behavior.
120
121         * editing/ApplyStyleCommand.h:
122         (WebCore::ApplyStyleCommand::create):
123         * editing/CompositeEditCommand.cpp:
124         (WebCore::CompositeEditCommand::apply):
125         (WebCore::deleteSelectionEditingActionForEditingAction):
126         * editing/CompositeEditCommand.h:
127         (WebCore::EditCommandComposition::wasCreateLinkCommand const):
128         * editing/CreateLinkCommand.h:
129         * editing/DeleteFromTextNodeCommand.h:
130         (WebCore::DeleteFromTextNodeCommand::create):
131         * editing/DeleteSelectionCommand.h:
132         (WebCore::DeleteSelectionCommand::create):
133         * editing/DictationCommand.cpp:
134         (WebCore::DictationCommand::insertTextRunWithoutNewlines):
135         (WebCore::DictationCommand::insertParagraphSeparator):
136         * editing/EditAction.h:
137         (): Deleted.
138         * editing/EditCommand.cpp:
139         (WebCore::inputTypeNameForEditingAction):
140         * editing/EditCommand.h:
141         * editing/Editor.cpp:
142         (WebCore::inputEventDataForEditingStyleAndAction):
143         (WebCore::ClearTextCommand::editingAction const):
144         (WebCore::Editor::handleTextEvent):
145         (WebCore::Editor::replaceSelectionWithFragment):
146         (WebCore::Editor::performCutOrCopy):
147         (WebCore::Editor::setBaseWritingDirection):
148         (WebCore::Editor::markMisspellingsAfterTypingToWord):
149         (WebCore::Editor::changeBackToReplacedString):
150         (WebCore::Editor::transpose):
151         * editing/Editor.h:
152         * editing/EditorCommand.cpp:
153         (WebCore::applyCommandToFrame):
154         (WebCore::executeInsertFragment):
155         (WebCore::executeBackColor):
156         (WebCore::executeFontName):
157         (WebCore::executeFontSize):
158         (WebCore::executeFontSizeDelta):
159         (WebCore::executeForeColor):
160         (WebCore::executeJustifyCenter):
161         (WebCore::executeJustifyFull):
162         (WebCore::executeJustifyLeft):
163         (WebCore::executeJustifyRight):
164         (WebCore::executeMakeTextWritingDirectionLeftToRight):
165         (WebCore::executeMakeTextWritingDirectionNatural):
166         (WebCore::executeMakeTextWritingDirectionRightToLeft):
167         (WebCore::executeStrikethrough):
168         (WebCore::executeSubscript):
169         (WebCore::executeSuperscript):
170         (WebCore::executeToggleBold):
171         (WebCore::executeToggleItalic):
172         (WebCore::executeUnderline):
173         (WebCore::executeUnscript):
174         * editing/FormatBlockCommand.h:
175         * editing/IndentOutdentCommand.h:
176         * editing/InsertIntoTextNodeCommand.h:
177         (WebCore::InsertIntoTextNodeCommand::create):
178         * editing/InsertListCommand.cpp:
179         (WebCore::InsertListCommand::editingAction const):
180         * editing/InsertNodeBeforeCommand.h:
181         (WebCore::InsertNodeBeforeCommand::create):
182         * editing/InsertParagraphSeparatorCommand.h:
183         (WebCore::InsertParagraphSeparatorCommand::create):
184         * editing/InsertTextCommand.h:
185         (WebCore::InsertTextCommand::create):
186         (WebCore::InsertTextCommand::createWithMarkerSupplier):
187         * editing/MoveSelectionCommand.cpp:
188         (WebCore::MoveSelectionCommand::doApply):
189         (WebCore::MoveSelectionCommand::editingAction const):
190         * editing/RemoveFormatCommand.h:
191         * editing/RemoveNodeCommand.h:
192         (WebCore::RemoveNodeCommand::create):
193         * editing/ReplaceRangeWithTextCommand.cpp:
194         (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
195         (WebCore::ReplaceRangeWithTextCommand::doApply):
196         * editing/ReplaceSelectionCommand.cpp:
197         (WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
198         (WebCore::ReplaceSelectionCommand::performTrivialReplace):
199         * editing/ReplaceSelectionCommand.h:
200         (WebCore::ReplaceSelectionCommand::create):
201         * editing/SpellingCorrectionCommand.cpp:
202         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
203         (WebCore::SpellingCorrectionCommand::doApply):
204         * editing/TextInsertionBaseCommand.h:
205         * editing/TypingCommand.cpp:
206         (WebCore::editActionForTypingCommand):
207         (WebCore::editActionIsDeleteByTyping):
208         (WebCore::TypingCommand::isBeforeInputEventCancelable const):
209         (WebCore::TypingCommand::inputEventData const):
210         (WebCore::TypingCommand::inputEventDataTransfer const):
211         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
212         (WebCore::TypingCommand::insertParagraphSeparator):
213         * editing/UnlinkCommand.h:
214         * editing/ios/DictationCommandIOS.cpp:
215         (WebCore::DictationCommandIOS::DictationCommandIOS):
216         * editing/ios/EditorIOS.mm:
217         (WebCore::Editor::removeUnchangeableStyles):
218         * page/DragController.cpp:
219         (WebCore::DragController::concludeEditDrag):
220
221 2018-09-06  Simon Fraser  <simon.fraser@apple.com>
222
223         Fix the build for non-Cocoa platforms after r235772.
224
225         * platform/graphics/cairo/GradientCairo.cpp:
226         (WebCore::Gradient::createPlatformGradient):
227         * platform/graphics/win/GradientDirect2D.cpp:
228         (WebCore::Gradient::generateGradient):
229         (WebCore::Gradient::fill):
230
231 2018-09-06  Zalan Bujtas  <zalan@apple.com>
232
233         [LFC] Add support for min/max-height percentage values.
234         https://bugs.webkit.org/show_bug.cgi?id=189391
235
236         Reviewed by Antti Koivisto.
237
238         The percentage is calculated with respect to the height of the generated box's containing block.
239         If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element
240         is not absolutely positioned, the percentage value is treated as '0' (for 'min-height') or 'none' (for 'max-height').
241
242         Test: fast/block/block-only/min-max-height-percentage.html
243
244         * layout/FormattingContext.cpp:
245         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
246         * layout/FormattingContext.h:
247         * layout/FormattingContextGeometry.cpp:
248         (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto):
249         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
250         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
251         * layout/blockformatting/BlockFormattingContext.cpp:
252         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
253
254 2018-09-06  Megan Gardner  <megan_gardner@apple.com>
255
256         Add Support for Conic Gradients
257         https://bugs.webkit.org/show_bug.cgi?id=189329
258         <rdar://problem/21444701>
259
260         Reviewed by Simon Fraser.
261
262         Add support for rendering CSS conic gradients.
263         The parsing work was already done, this just hooks up the data we have
264         with the CG functionality for conic gradients. Add the needed plumbing
265         to allow for this additional type and fill in the creation of 
266         a conic gradient.
267
268         Tests: fast/gradients/conic-repeating.html
269                fast/gradients/conic.html
270
271         * css/CSSGradientValue.cpp:
272         (WebCore::createGradient):
273         (WebCore::LinearGradientAdapter::gradientLength const):
274         (WebCore::RadialGradientAdapter::gradientLength const):
275         (WebCore::ConicGradientAdapter::ConicGradientAdapter):
276         (WebCore::ConicGradientAdapter::gradientLength const):
277         (WebCore::ConicGradientAdapter::maxExtent const):
278         (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
279
280         Compute what the color stops should be if they extend past 0-1
281
282         (WebCore::CSSGradientValue::computeStops):
283         (WebCore::CSSConicGradientValue::createGradient):
284         (WebCore::LinearGradientAdapter::startPoint const): Deleted.
285         (WebCore::LinearGradientAdapter::endPoint const): Deleted.
286         (WebCore::RadialGradientAdapter::startPoint const): Deleted.
287         (WebCore::RadialGradientAdapter::endPoint const): Deleted.
288
289         Start and End points weren't very universal. All we really need from these
290         gradientAdapters is their length, so just ask for that instead.
291
292         * inspector/InspectorCanvas.cpp:
293         (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
294         * platform/graphics/Gradient.cpp:
295         (WebCore::Gradient::create):
296         (WebCore::Gradient::Gradient):
297         (WebCore::Gradient::type const):
298         (WebCore::Gradient::adjustParametersForTiledDrawing):
299         (WebCore::Gradient::isZeroSize const):
300         (WebCore::Gradient::hash const):
301         * platform/graphics/Gradient.h:
302         * platform/graphics/cg/GradientCG.cpp:
303         (WebCore::Gradient::paint):
304
305 2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
306
307         [macOS] [WK2] Support changing attributes for selected text (text shadow, underline, strike-through)
308         https://bugs.webkit.org/show_bug.cgi?id=189356
309         <rdar://problem/44185674>
310
311         Reviewed by Tim Horton.
312
313         Add support for encoding and decoding FontAttributeChanges, so that we can send FontAttributeChanges over IPC in
314         WebKit2. Also change m_verticalAlign to a new VerticalAlignChange enum type, so that it's no longer tied to the
315         CSS property values of "vertical-align", and can be encoded/decoded separately from VerticalAlign in
316         RenderStyleConstants.
317
318         Test: FontManagerTests.ChangeAttributesWithFontEffectsBox
319
320         * editing/FontAttributeChanges.cpp:
321         (WebCore::FontAttributeChanges::createEditingStyle const):
322         * editing/FontAttributeChanges.h:
323         (WebCore::FontAttributeChanges::setVerticalAlign):
324         (WebCore::FontShadow::encode const):
325         (WebCore::FontShadow::decode):
326         (WebCore::FontAttributeChanges::encode const):
327         (WebCore::FontAttributeChanges::decode):
328         * platform/mac/WebCoreNSFontManagerExtras.mm:
329         (WebCore::computedFontAttributeChanges):
330
331 2018-09-06  Zalan Bujtas  <zalan@apple.com>
332
333         [LFC][BFC] Add support for min(max)-height
334         https://bugs.webkit.org/show_bug.cgi?id=189377
335
336         Reviewed by Antti Koivisto.
337
338         See https://www.w3.org/TR/CSS22/visudet.html#min-max-heights for details.
339
340         Tests: fast/block/block-only/absolute-position-min-max-height.html
341                fast/block/block-only/float-min-max-height.html
342                fast/block/block-only/inflow-min-max-height.html
343
344         * layout/FormattingContext.cpp:
345         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
346         * layout/FormattingContext.h:
347         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
348         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
349         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
350         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
351         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
352         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
353         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
354         * layout/FormattingContextGeometry.cpp:
355         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
356         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
357         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
358         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
359         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
360         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
361         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
362         * layout/blockformatting/BlockFormattingContext.cpp:
363         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
364         * layout/blockformatting/BlockFormattingContext.h:
365         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
366         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
367         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
368         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
369         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
370
371 2018-09-06  Eric Carlson  <eric.carlson@apple.com>
372
373         [MediaStream] Include supported frame rates in video capture presets
374         https://bugs.webkit.org/show_bug.cgi?id=189351
375         <rdar://problem/44188917>
376
377         Reviewed by Youenn Fablet.
378
379         No new tests, no functionality changed.
380
381         Include frame rates as well as width/height in video capture presets, so the mock video
382         capture devices model real camera devices more closely.
383
384         * platform/mediastream/RealtimeMediaSource.cpp:
385         (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Renamed from applySizeAndFrameRate. Use
386         setSize instead of setWidth and setHeight.
387         (WebCore::RealtimeMediaSource::applyConstraints): applySizeAndFrameRate -> setSizeAndFrameRate.
388         (WebCore::RealtimeMediaSource::applySizeAndFrameRate): Deleted.
389         (WebCore::RealtimeMediaSource::setWidth): Deleted.
390         (WebCore::RealtimeMediaSource::setHeight): Deleted.
391         * platform/mediastream/RealtimeMediaSource.h:
392
393         * platform/mediastream/RealtimeVideoSource.cpp:
394         (WebCore::RealtimeVideoSource::setSupportedPresets): New.
395         (WebCore::updateMinMax):
396         (WebCore::RealtimeVideoSource::addSupportedCapabilities const): Calculate capabilities from
397         presets.
398         (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate): Use bestSupportedSizeAndFrameRate.
399         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): 
400         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
401         (WebCore::RealtimeVideoSource::setSupportedFrameRates): Deleted.
402         (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight): Deleted.
403         (WebCore::RealtimeVideoSource::applySizeAndFrameRate): Deleted.
404         (WebCore::RealtimeVideoSource::supportsFrameRate): Deleted.
405         * platform/mediastream/RealtimeVideoSource.h:
406         (WebCore::RealtimeVideoSource::setSupportedCaptureSizes): Deleted.
407         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
408         (WebCore::GStreamerVideoCaptureSource::stopProducingData):
409         * platform/mediastream/mac/AVVideoCaptureSource.h:
410         * platform/mediastream/mac/AVVideoCaptureSource.mm:
411         (WebCore::AVVideoCaptureSource::setSizeAndFrameRate):
412         (WebCore::AVVideoCaptureSource::applySizeAndFrameRate): Deleted.
413         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
414         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
415         * platform/mock/MockMediaDevice.h:
416         (WebCore::MockCameraProperties::encode const):
417         (WebCore::MockCameraProperties::decode):
418         (WebCore::MockDisplayProperties::encode const):
419         (WebCore::MockDisplayProperties::decode):
420         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
421         (WebCore::defaultDevices):
422         * platform/mock/MockRealtimeVideoSource.cpp:
423         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
424         (WebCore::MockRealtimeVideoSource::capabilities const):
425         (WebCore::MockRealtimeVideoSource::settings const):
426
427 2018-09-06  Antti Koivisto  <antti@apple.com>
428
429         Actively prewarm processes created for prewarm pool
430         https://bugs.webkit.org/show_bug.cgi?id=189364
431
432         Reviewed by Chris Dumez.
433
434         Do some basic prewarming for newly created processes.
435
436         * Sources.txt:
437         * WebCore.xcodeproj/project.pbxproj:
438         * css/CSSDefaultStyleSheets.cpp:
439         (WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
440         * css/CSSDefaultStyleSheets.h:
441         * page/Frame.cpp:
442         (WebCore::Frame::Frame):
443         * page/ProcessWarming.cpp: Added.
444         (WebCore::ProcessWarming::initializeNames):
445
446         Factor name initialization into a function.
447
448         (WebCore::ProcessWarming::prewarm):
449
450         Prewarm
451         - names
452         - settings (system fonts)
453         - user agent stylesheet
454         - JavaScript VM
455         - telephone number detection
456
457         * page/ProcessWarming.h: Added.
458
459 2018-09-06  Youenn Fablet  <youenn@apple.com>
460
461         Move replaceTrack logic to RTCRtpSender backend
462         https://bugs.webkit.org/show_bug.cgi?id=189359
463
464         Reviewed by Eric Carlson.
465
466         Move replaceTrack handling from LibWebRTCPeerConnectionBackend to LibWebRTCRtpSenderBackend.
467         This will allow using SetTrack when fully implementing unified plan.
468         No change of behavior.
469
470         * Modules/mediastream/RTCRtpSender.cpp:
471         (WebCore::RTCRtpSender::replaceTrack):
472         * Modules/mediastream/RTCRtpSender.h:
473         * Modules/mediastream/RTCRtpSender.idl:
474         * Modules/mediastream/RTCRtpSenderBackend.h:
475         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
476         (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): Deleted.
477         (WebCore::LibWebRTCPeerConnectionBackend::enqueueReplaceTrackTask): Deleted.
478         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
479         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
480         (WebCore::updateTrackSource):
481         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
482         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
483
484 2018-09-06  Andy Estes  <aestes@apple.com>
485
486         [Apple Pay] Rename the -apple-pay-button-type value "checkout" to "check-out"
487         https://bugs.webkit.org/show_bug.cgi?id=189366
488         <rdar://problem/44193218>
489
490         Reviewed by Sam Weinig.
491
492         The button title is "Check out with Apple Pay", so we should use the verb phrase "check out"
493         rather than the noun "checkout" for naming this value.
494
495         Updated http/tests/ssl/applepay/ApplePayButtonV4.html.
496
497         * css/CSSPrimitiveValueMappings.h:
498         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
499         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
500         * css/CSSValueKeywords.in:
501         * css/parser/CSSParserFastPaths.cpp:
502         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
503         * rendering/RenderThemeCocoa.mm:
504         (WebCore::toPKPaymentButtonType):
505         * rendering/style/RenderStyleConstants.h:
506
507 2018-09-06  Jer Noble  <jer.noble@apple.com>
508
509         Don't pause playback when locking screen if video is being displayed on second screen.
510         https://bugs.webkit.org/show_bug.cgi?id=189321
511
512         Reviewed by Eric Carlson.
513
514         Expand the existing behavior when AirPlaying to an external device to playing to a local
515         external screen. Don't pause when the screen locks, and don't stop buffering in that mode either.
516
517         Add a KVO-observer to the WebAVPlayerController's playingOnSecondScreen property, and pass
518         that observed value on to the media element.
519
520         * html/HTMLMediaElement.cpp:
521         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
522         (WebCore::HTMLMediaElement::setPlayingOnSecondScreen):
523         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
524         (WebCore::HTMLMediaElement::processingUserGestureForMedia const):
525         (WebCore::HTMLMediaElement::mediaState const):
526         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
527         (WebCore::HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction const):
528         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
529         (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget const): Deleted.
530         (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget const): Deleted.
531         * html/HTMLMediaElement.h:
532         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
533         (WebCore::HTMLMediaElement::isPlayingToExternalTarget const):
534         * html/MediaElementSession.cpp:
535         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget const): Deleted.
536         * html/MediaElementSession.h:
537         * platform/audio/PlatformMediaSession.h:
538         (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
539         (WebCore::PlatformMediaSessionClient::isPlayingOnSecondScreen const):
540         (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget const): Deleted.
541         (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget const): Deleted.
542         * platform/cocoa/PlaybackSessionModel.h:
543         * platform/cocoa/PlaybackSessionModelMediaElement.h:
544         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
545         (WebCore::PlaybackSessionModelMediaElement::setPlayingOnSecondScreen):
546         * platform/ios/WebAVPlayerController.mm:
547         (-[WebAVPlayerController init]):
548         (-[WebAVPlayerController dealloc]):
549         (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
550         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
551         (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
552
553 2018-09-06  Frederic Wang  <fwang@igalia.com>
554
555         Group options of scrollRectToVisible into a struct
556         https://bugs.webkit.org/show_bug.cgi?id=189352
557
558         Reviewed by Simon Fraser.
559
560         RenderLayer::scrollRectToVisible and RenderObject::scrollRectToVisible have several
561         parameters to configure the type of scrolling. This patch groups the const options into a
562         single struct to make easier to handle them in the future. For example, an #ifdefed scroll
563         behavior option will be added in bug 188043. This refactoring can maybe help too for other
564         scroll extensions (e.g. bug 176454 and bug 161611).
565
566         No new tests, behavior unchanged.
567
568         * accessibility/AccessibilityObject.cpp:
569         (WebCore::AccessibilityObject::scrollToMakeVisible const): Pass options via a struct.
570         * dom/Element.cpp:
571         (WebCore::Element::scrollIntoView): Ditto.
572         (WebCore::Element::scrollIntoViewIfNeeded): Ditto.
573         (WebCore::Element::scrollIntoViewIfNotVisible): Ditto.
574         * editing/FrameSelection.cpp: Include RenderLayer.h in all WebKit ports in order to define
575         ScrollRectToVisibleOptions.
576         (WebCore::FrameSelection::revealSelection): Pass options via a struct.
577         * page/FrameView.cpp:
578         (WebCore::FrameView::scrollToFocusedElementInternal): Ditto.
579         (WebCore::FrameView::scrollToAnchor): Ditto.
580         * rendering/RenderLayer.cpp:
581         (WebCore::RenderLayer::scrollRectToVisible): Pass options via a struct. Note that
582         absoluteRect and insideFixed are modified in this function.
583         (WebCore::RenderLayer::autoscroll): Pass options via a struct.
584         * rendering/RenderLayer.h: Add ScrollRectToVisibleOptions and use it in order to pass
585         scrollRectToVisible options.
586         * rendering/RenderObject.cpp:
587         (WebCore::RenderObject::scrollRectToVisible): Pass options via a struct
588         * rendering/RenderObject.h: Forward-declare ScrollRectToVisibleOptions and use in order to
589         pass scrollRectToVisible options.
590
591 2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
592
593         [macOS] Cannot change font size at selection until font panel is shown
594         https://bugs.webkit.org/show_bug.cgi?id=189295
595         <rdar://problem/35593389>
596
597         Reviewed by Ryosuke Niwa.
598
599         Currently, attempting to alter the font size of currently selected editable text in WKWebView via menu items
600         will fail if the font panel has never been shown. This is because WebViewImpl::changeFontFromFontPanel, which is
601         responsible for converting the current font at the selection to the new font using -[NSFontManager convertFont:]
602         bails as a result of NSFontManager's currently selected font always being nil.
603
604         WKWebView is responsible for keeping NSFontManager up-to-date with the currently selected font; in fact, this
605         was initially the case in r180465, which introduced NSFontManager support in WebKit2 by propagating EditorState
606         updates that contained font information for the current selection. However, this regressed performance due to
607         selected font computation triggering extra layout passes; r180768 addressed this by introducing a mechanism for
608         requesting the font at the current selection, and only updating NSFontManager with the new selected font when
609         the shared font panel is visible (determined by KVO on NSFontPanel). However, this again regressed WKWebView
610         launch performance, due to KVO registration always forcing the shared NSFontPanel to be created. r182037
611         addressed this by only registering for KVO on the font panel if the WKWebView has been made editable (SPI on
612         WKWebView).
613
614         This leads to two issues when attempting to alter font attributes using macOS UI: (1) in web views that have not
615         been made editable using SPI, showing the font panel and attempting to change the font fails due to the selected
616         font staying nil, because we've never begun registering for KVO notifications on the font panel so we don't try
617         to keep the font manager up to date. (2) Even if the web view is made editable, if the font panel is never
618         shown, then the font manager still won't be kept up to date with the current selection, so changing fonts using
619         menu items still does not work.
620
621         We fix both of these problems by refactoring font manager support on WebKit2 such that an up-to-date selected
622         font in the UI process is no longer necessary in order to alter the font at the current selection. To do this,
623         we figure out what changes the NSFontManager would've made to the currently selected font in the UI process, and
624         then propagate this information to the web process, where we convert this information into an EditingStyle which
625         we apply to the current selection.
626
627         The code to both determine the attributes changed by NSFontManager and to convert these attributes into editing
628         styles to be applied via Editor already exists in WebKitLegacy, in WebHTMLView.mm. This patch moves this
629         existing logic into WebCore and teases it apart into two portions: the first portion probes NSFontManager to
630         determine which aspects of the font changed and constructs FontChanges, which captures these differences. The
631         second portion maps FontChanges to an EditingStyle, which can then be applied to the current selection. In
632         WebKitLegacy, we construct FontChanges using the font manager, and then immediately use it to create and apply
633         an EditingStyle. In WebKit, we construct FontChanges in the UI process using the font manager, and then send
634         this over to the web process via WebPage::changeFont, which then creates and applies the EditingStyle.
635
636         Note that this patch also introduces FontAttributeChanges, which is similar in concept to FontChanges, but
637         captures a broader range of changes possible via NSFontPanel. This was done so that we can eliminate all of the
638         font manager probing code (along with the two specimen fonts) from WebHTMLView, but is also necessary in order
639         to allow changing font shadow, strikethrough, and underlines via the font panel to work in WebKit2. This will be
640         fixed in a followup, by making FontAttributeChanges IPC encodable and by making WKWebView/WKView respond to the
641         -changeAttributes: selector.
642
643         Changes in behavior to WebKit2 are covered by new API tests; legacy WebKit behavior should remain unchanged.
644
645         Tests:  FontManagerTests.ChangeFontSizeWithMenuItems
646                 FontManagerTests.ChangeFontWithPanel
647
648         * SourcesCocoa.txt:
649         * WebCore.xcodeproj/project.pbxproj:
650         * editing/Editor.h:
651
652         Remove applyFontStyles.
653
654         * editing/FontAttributeChanges.cpp: Added.
655         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
656
657         Given a font family name and a font name, returns the string to use as the "font-family" style property value.
658         Originally from WebHTMLView.mm.
659
660         (WebCore::FontChanges::createEditingStyle const):
661
662         Converts font changes to an EditingStyle that can be used to apply these changes.
663
664         (WebCore::FontChanges::createStyleProperties const):
665
666         Introduce FontChanges, which encapsulates changes which are to be applied to the font in the current selection.
667
668         (WebCore::cssValueListForShadow):
669         (WebCore::FontAttributeChanges::createEditingStyle const):
670
671         Converts font attribute changes to an EditingStyle that can be used to apply these changes.
672
673         * editing/FontAttributeChanges.h: Added.
674
675         Introduce FontAttributeChanges, which encapsulates changes which are to be applied to the font attributes in the
676         current selection. This includes a set of FontChanges, as well as additional attributes such as strike-through
677         and underlines.
678
679         (WebCore::FontChanges::setFontName):
680         (WebCore::FontChanges::setFontFamily):
681         (WebCore::FontChanges::setFontSize):
682         (WebCore::FontChanges::setFontSizeDelta):
683         (WebCore::FontChanges::setBold):
684         (WebCore::FontChanges::setItalic):
685         (WebCore::FontAttributeChanges::setVerticalAlign):
686         (WebCore::FontAttributeChanges::setBackgroundColor):
687         (WebCore::FontAttributeChanges::setForegroundColor):
688         (WebCore::FontAttributeChanges::setShadow):
689         (WebCore::FontAttributeChanges::setStrikeThrough):
690         (WebCore::FontAttributeChanges::setUnderline):
691         (WebCore::FontAttributeChanges::setFontChanges):
692
693         Setters for FontChanges and FontAttributeChanges. Initially, most of these values are optional, indicating that
694         there should be no change.
695
696         (WebCore::FontChanges::encode const):
697         (WebCore::FontChanges::decode):
698
699         Add encoding/decoding support to FontChanges, so that it can be sent over IPC for WebKit2.
700
701         * editing/cocoa/FontAttributeChangesCocoa.mm: Added.
702         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
703
704         Helper method to determine whether the font family or the font name should be used, by looking up the PostScript
705         font name using a FontDescriptor and comparing it against the result of -[NSFont fontName]. This logic was
706         originally in WebHTMLView.mm.
707
708         * editing/mac/EditorMac.mm:
709         (WebCore::Editor::applyFontStyles): Deleted.
710         * platform/mac/WebCoreNSFontManagerExtras.h: Added.
711         * platform/mac/WebCoreNSFontManagerExtras.mm: Added.
712
713         Add helper functions to compute FontChanges and FontAttributeChanges from NSFontManager.
714
715         (WebCore::firstFontConversionSpecimen):
716         (WebCore::secondFontConversionSpecimen):
717
718         Two "specimen fonts" used to determine what changes NSFontManager or NSFontPanel makes when performing font or
719         font attribute conversion. Moved from WebHTMLView.mm.
720
721         (WebCore::computedFontChanges):
722         (WebCore::computedFontAttributeChanges):
723
724         Moved here from WebHTMLView.mm. Instead of converting font attributes to NSStrings and setting properties on
725         DOMCSSStyleDeclaration, we instead specify properties on MutableStyleProperties using CSSValues.
726
727 2018-09-06  Zalan Bujtas  <zalan@apple.com>
728
729         [LFC][BFC] Add support for min(max)-width
730         https://bugs.webkit.org/show_bug.cgi?id=189358
731
732         Reviewed by Antti Koivisto.
733
734         See https://www.w3.org/TR/CSS22/visudet.html#min-max-widths for details.
735
736         Tests: fast/block/block-only/absolute-position-min-max-width.html
737                fast/block/block-only/float-min-max-width.html
738                fast/block/block-only/inflow-min-max-width.html
739
740         * layout/FormattingContext.cpp:
741         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
742         * layout/FormattingContext.h:
743         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
744         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
745         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
746         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
747         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
748         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
749         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
750         * layout/FormattingContextGeometry.cpp:
751         (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto):
752         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
753         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
754         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
755         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
756         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
757         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
758         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
759         * layout/blockformatting/BlockFormattingContext.cpp:
760         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
761         * layout/blockformatting/BlockFormattingContext.h:
762         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
763         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
764         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
765         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
766         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
767         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
768         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
769
770 2018-09-06  Eric Carlson  <eric.carlson@apple.com>
771
772         [MediaStream] Initialize AVVideoCapture video presets
773         https://bugs.webkit.org/show_bug.cgi?id=189355
774
775         Reviewed by Youenn Fablet.
776
777         No new tests, no functionality changed.
778
779         * platform/mediastream/mac/AVVideoCaptureSource.mm:
780         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Don't try to load symbols if they
781         aren't available.
782
783 2018-09-06  Ali Juma  <ajuma@chromium.org>
784
785         IntersectionObserver leaks documents
786         https://bugs.webkit.org/show_bug.cgi?id=189128
787
788         Reviewed by Simon Fraser.
789
790         Currently, Documents own IntersectionObservers while IntersectionObservers own callbacks
791         that have strong references to Documents. To break this cycle, make Documents only have
792         weak pointers to IntersectionObservers. Instead, manage the lifetime of an
793         IntersectionObserver as an ActiveDOMObject, overriding hasPendingActivity to keep
794         the observer alive while there are ongoing observations.
795
796         However, there is a still a potential reference cycle. The callback keeps global
797         references alive, so if there's a global reference to the observer in JavaScript,
798         we have an observer->callback->observer cycle, keeping the callback (and hence the Document)
799         alive. To break this cycle, make IntersectionObserver release the callback when its
800         Document is stopped.
801
802         With these changes, there are no longer any leaks reported with run-webkit-tests --world-leaks
803         on LayoutTests/intersection-observer and LayoutTests/imported/w3c/web-platform-tests/intersection-observer.
804
805         Tests: intersection-observer/no-document-leak.html
806                intersection-observer/observer-and-callback-without-js-references.html
807
808         * dom/Document.cpp:
809         (WebCore::Document::addIntersectionObserver):
810         (WebCore::Document::removeIntersectionObserver):
811         * dom/Document.h:
812         * dom/Element.cpp:
813         (WebCore::Element::didMoveToNewDocument):
814         * page/IntersectionObserver.cpp:
815         (WebCore::IntersectionObserver::IntersectionObserver):
816         (WebCore::IntersectionObserver::~IntersectionObserver):
817         (WebCore::IntersectionObserver::observe):
818         (WebCore::IntersectionObserver::rootDestroyed):
819         (WebCore::IntersectionObserver::createTimestamp const):
820         (WebCore::IntersectionObserver::notify):
821         (WebCore::IntersectionObserver::hasPendingActivity const):
822         (WebCore::IntersectionObserver::activeDOMObjectName const):
823         (WebCore::IntersectionObserver::canSuspendForDocumentSuspension const):
824         (WebCore::IntersectionObserver::stop):
825         * page/IntersectionObserver.h:
826         (WebCore::IntersectionObserver::trackingDocument const):
827         (WebCore::IntersectionObserver::trackingDocument): Deleted.
828         * page/IntersectionObserver.idl:
829
830 2018-09-05  Zalan Bujtas  <zalan@apple.com>
831
832         [LFC] Adapt to the new const WeakPtr<>
833         https://bugs.webkit.org/show_bug.cgi?id=189334
834
835         Reviewed by Antti Koivisto.
836
837         * layout/FormattingContext.cpp:
838         (WebCore::Layout::FormattingContext::FormattingContext):
839         * layout/FormattingContext.h:
840         * layout/LayoutContext.cpp:
841         (WebCore::Layout::LayoutContext::initializeRoot):
842         * layout/LayoutContext.h:
843         * layout/floats/FloatAvoider.cpp:
844         (WebCore::Layout::FloatAvoider::FloatAvoider):
845         * layout/floats/FloatAvoider.h:
846         * layout/floats/FloatingState.cpp:
847         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
848         (WebCore::Layout::FloatingState::FloatingState):
849         * layout/floats/FloatingState.h:
850         * layout/layouttree/LayoutContainer.cpp:
851         (WebCore::Layout::Container::addOutOfFlowDescendant):
852         * layout/layouttree/LayoutContainer.h:
853         (WebCore::Layout::Container::outOfFlowDescendants const):
854
855 2018-09-06  Xabier Rodriguez Calvar  <calvaris@igalia.com>
856
857         [GStreamer] Extra ASSERTs at MainThreadNotifier
858         https://bugs.webkit.org/show_bug.cgi?id=188786
859
860         Reviewed by Carlos Garcia Campos.
861
862         We add a couple of checks in debug mode: there is only one bit on
863         per notification and ensure a notifier was invalidated before
864         being destroyed.
865
866         * platform/graphics/gstreamer/MainThreadNotifier.h:
867
868 2018-09-05  Youenn Fablet  <youenn@apple.com>
869
870         Move ownership of outgoing source to RTCRtpSender backend
871         https://bugs.webkit.org/show_bug.cgi?id=189310
872
873         Reviewed by Alex Christensen.
874
875         RTCRtpSender should own the source so that it can replace/stop it.
876         Since this is libwebrtc specific, the source is actually owned by the backend.
877         Simplified replaceTrack a bit based on that.
878
879         No change of behavior.
880
881         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
882         (WebCore::LibWebRTCMediaEndpoint::addTrack):
883         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
884         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
885         (WebCore::updateTrackSource):
886         (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
887         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
888         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
889         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
890
891 2018-09-05  Brent Fulgham  <bfulgham@apple.com>
892
893         The width of an empty or nullptr TextRun should be zero
894         https://bugs.webkit.org/show_bug.cgi?id=189154
895         <rdar://problem/43685926>
896
897         Reviewed by Zalan Bujtas.
898
899         If a page has an empty TextRun and attempts to paint it we can crash with a nullptr.
900
901         This patch recognizes that an empty TextRun should always produce a zero width, rather than
902         attempt to compute this value from font data. It also prevents ListBox from attempting to
903         paint a null string.
904
905         Test: fast/text/null-string-textrun.html
906
907         * platform/graphics/FontCascade.cpp:
908         (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width.
909         (WebCore::FontCascade::width const): Ditto.
910         * platform/graphics/TextRun.h:
911         (WebCore::TextRun::TextRun): ASSERT that the supplied String is non-null.
912         (WebCore::TextRun::setText): Ditto.
913         * rendering/RenderListBox.cpp:
914         (WebCore::RenderListBox::paintItemForeground): Don't attempt to paint a null string.
915
916 2018-09-05  Zalan Bujtas  <zalan@apple.com>
917
918         [LFC][BFC] ComputeFloat* methods should take a const FloatingContext&
919         https://bugs.webkit.org/show_bug.cgi?id=189333
920
921         Reviewed by Antti Koivisto.
922
923         Only layoutFormattingContextRoot() needs a non-const FloatingContext& object (to add the floating box to the floating state).
924
925         * layout/blockformatting/BlockFormattingContext.cpp:
926         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
927         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
928         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
929         * layout/blockformatting/BlockFormattingContext.h:
930
931 2018-09-05  Youenn Fablet  <youenn@apple.com>
932
933         Introduce a backend for RTCRtpTransceiver
934         https://bugs.webkit.org/show_bug.cgi?id=189322
935
936         Reviewed by Eric Carlson.
937
938         Introduce RTCRtpTransceiverBackend to implement the transceiver functionality using libwebrtc.
939         Remove provisional mids as it will be done by the webrtc backend.
940
941         No observable change of behavior yet since there is no transceiver backend yet.
942
943         * Modules/mediastream/PeerConnectionBackend.h:
944         * Modules/mediastream/RTCRtpTransceiver.cpp:
945         (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
946         (WebCore::RTCRtpTransceiver::mid const):
947         (WebCore::RTCRtpTransceiver::direction const):
948         (WebCore::RTCRtpTransceiver::setDirection):
949         (WebCore::RTCRtpTransceiver::stop):
950         (WebCore::RTCRtpTransceiver::getNextMid): Deleted.
951         (WebCore::RTCRtpTransceiver::directionString const): Deleted.
952         * Modules/mediastream/RTCRtpTransceiver.h:
953         (WebCore::RTCRtpTransceiver::create):
954         (WebCore::RTCRtpTransceiver::provisionalMid const): Deleted.
955         (WebCore::RTCRtpTransceiver::setMid): Deleted.
956         * Modules/mediastream/RTCRtpTransceiverBackend.h: Added.
957         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
958         (WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
959         (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
960         (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
961         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
962         (WebCore::LibWebRTCPeerConnectionBackend::completeAddTransceiver):
963         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
964         * WebCore.xcodeproj/project.pbxproj:
965
966 2018-09-05  Zalan Bujtas  <zalan@apple.com>
967
968         [LFC] Pass in const LayoutContext& to geometry methods when possible
969         https://bugs.webkit.org/show_bug.cgi?id=189331
970
971         Reviewed by Antti Koivisto.
972
973         Only layout and layout-like methods (intrinsic width computation -> shrink to fit -> out-of-flow/floating boxes) should take a
974         non-const LayoutContext&. Other geometry functions should not mutate the the context.
975
976         * layout/FormattingContext.cpp:
977         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
978         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
979         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
980         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
981         * layout/FormattingContext.h:
982         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
983         * layout/FormattingContextGeometry.cpp:
984         (WebCore::Layout::contentHeightForFormattingContextRoot):
985         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
986         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
987         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
988         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
989         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
990         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
991         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
992         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
993         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
994         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
995         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
996         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
997         * layout/LayoutContext.cpp:
998         (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
999         (WebCore::Layout::LayoutContext::establishedFormattingState const):
1000         (WebCore::Layout::LayoutContext::createFormattingStateForFormattingRootIfNeeded):
1001         (WebCore::Layout::LayoutContext::formattingContext const):
1002         (WebCore::Layout::LayoutContext::establishedFormattingState): Deleted.
1003         (WebCore::Layout::LayoutContext::formattingContext): Deleted.
1004         * layout/LayoutContext.h:
1005         * layout/blockformatting/BlockFormattingContext.cpp:
1006         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1007         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1008         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1009         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1010         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1011         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1012         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1013         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1014         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1015         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1016         * layout/blockformatting/BlockFormattingContext.h:
1017         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1018         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1019         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1020         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1021         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1022         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
1023         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1024         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1025         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1026         * layout/inlineformatting/InlineFormattingContext.cpp:
1027         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
1028         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
1029         * layout/inlineformatting/InlineFormattingContext.h:
1030
1031 2018-09-05  Youenn Fablet  <youenn@apple.com>
1032
1033         Expose RTCRtpSender.setParameters
1034         https://bugs.webkit.org/show_bug.cgi?id=189307
1035
1036         Reviewed by Eric Carlson.
1037
1038         Implement RTCRtpSender.setParameters.
1039         This is an incomplete implementation as we need to refresh parameters as per the spec and testing is much easier with full transceiver support.
1040         Implementation uses sender backend to set the parameters at libwebrtc level.
1041         Fix the case of a stopped sender/transceiver in which case promise should be rejected.
1042         Covered by rebased and modified tests.
1043
1044         * Modules/mediastream/RTCRtpParameters.h:
1045         * Modules/mediastream/RTCRtpSender.cpp:
1046         (WebCore::RTCRtpSender::setParameters):
1047         * Modules/mediastream/RTCRtpSender.h:
1048         * Modules/mediastream/RTCRtpSender.idl:
1049         * Modules/mediastream/RTCRtpSenderBackend.h:
1050         * Modules/mediastream/RTCRtpTransceiver.cpp:
1051         (WebCore::RTCRtpTransceiver::stop):
1052         * Modules/mediastream/RTCRtpTransceiver.h:
1053         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
1054         (WebCore::LibWebRTCRtpReceiverBackend::getParameters):
1055         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1056         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
1057         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
1058         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1059         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1060         (WebCore::toRTCEncodingParameters):
1061         (WebCore::fromRTCEncodingParameters):
1062         (WebCore::toRTCHeaderExtensionParameters):
1063         (WebCore::fromRTCHeaderExtensionParameters):
1064         (WebCore::toRTCCodecParameters):
1065         (WebCore::toRTCRtpParameters):
1066         (WebCore::fromRTCRtpParameters):
1067         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
1068
1069 2018-09-05  Simon Fraser  <simon.fraser@apple.com>
1070
1071         Remove some logging that I committed by mistake.
1072
1073         * rendering/RenderLayerFilters.cpp:
1074         (WebCore::RenderLayerFilters::RenderLayerFilters):
1075         (WebCore::RenderLayerFilters::~RenderLayerFilters):
1076
1077 2018-09-05  Zalan Bujtas  <zalan@apple.com>
1078
1079         [LFC] Construct the Display::Box objects on demand.
1080         https://bugs.webkit.org/show_bug.cgi?id=189320
1081
1082         Reviewed by Antti Koivisto.
1083
1084         * layout/FormattingContext.cpp:
1085         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1086         * layout/LayoutContext.cpp:
1087         (WebCore::Layout::LayoutContext::initializeRoot):
1088         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
1089         (WebCore::Layout::LayoutContext::createDisplayBox): Deleted.
1090         * layout/LayoutContext.h:
1091         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const): Deleted.
1092         * layout/Verification.cpp:
1093         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
1094         * layout/blockformatting/BlockFormattingContext.cpp:
1095         (WebCore::Layout::BlockFormattingContext::layout const):
1096         * layout/displaytree/DisplayBox.h:
1097
1098 2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>
1099
1100         Add infrastructure to dump resource load statistics
1101         https://bugs.webkit.org/show_bug.cgi?id=189213
1102
1103         Reviewed by Daniel Bates. 
1104
1105         The dumping functionality is not currently used, but will be included in tests for
1106         <https://bugs.webkit.org/show_bug.cgi?id=187773>.
1107
1108         * loader/ResourceLoadStatistics.h:
1109
1110 2018-09-05  Ryan Haddad  <ryanhaddad@apple.com>
1111
1112         Unreviewed, fix the build with recent SDKs.
1113
1114         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1115         (WebCore::exernalDeviceDisplayNameForPlayer):
1116
1117 2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>
1118
1119         Added runtime feature flag for web API statistics
1120         https://bugs.webkit.org/show_bug.cgi?id=189211
1121
1122         Reviewed by Daniel Bates.
1123
1124         Added functionality to get and set the runtime flag.
1125
1126         * page/RuntimeEnabledFeatures.h:
1127         (WebCore::RuntimeEnabledFeatures::setWebAPIStatisticsEnabled):
1128         (WebCore::RuntimeEnabledFeatures::webAPIStatisticsEnabled const):
1129
1130 2018-09-05  Youenn Fablet  <youenn@apple.com>
1131
1132         Move replaceTrack logic to LibWebRTCPeerConnectionBackend
1133         https://bugs.webkit.org/show_bug.cgi?id=189281
1134
1135         Reviewed by Eric Carlson.
1136
1137         Move replaceTrack handling code from RTCPeerConnection to LibWebRTCPeerConnectionBackend.
1138         This makes the logic easier to understand.
1139         Future refactoring will further try to put more handling in RTCRtpSenderBackend.
1140         No change of behavior.
1141
1142         * Modules/mediastream/RTCPeerConnection.cpp:
1143         * Modules/mediastream/RTCPeerConnection.h:
1144         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1145         (WebCore::tryUpdatingTrackSource):
1146         (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
1147         (WebCore::LibWebRTCPeerConnectionBackend::enqueueReplaceTrackTask):
1148         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1149         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1150         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
1151
1152 2018-09-05  Zalan Bujtas  <zalan@apple.com>
1153
1154         [LFC] LayoutContext::displayBoxForLayoutBox() should return a Display::Box&
1155         https://bugs.webkit.org/show_bug.cgi?id=189311
1156
1157         Reviewed by Antti Koivisto.
1158
1159         When the layout logic needs a Display::Box, we must have already created one for the associated Layout::Box.
1160         (It does not necessarily mean that evey Layout::Box has a Display::Box. For example in case of inline formatting context,
1161         we don't create a Display::Box for every inline box, but the formatting logic does not require such pairs.)
1162
1163         * layout/FormattingContext.cpp:
1164         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1165         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1166         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1167         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
1168         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
1169         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
1170         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1171         * layout/FormattingContextGeometry.cpp:
1172         (WebCore::Layout::contentHeightForFormattingContextRoot):
1173         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
1174         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
1175         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1176         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1177         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1178         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1179         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1180         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1181         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1182         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1183         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1184         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1185         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1186         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1187         * layout/LayoutContext.h:
1188         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
1189         * layout/Verification.cpp:
1190         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1191         * layout/blockformatting/BlockFormattingContext.cpp:
1192         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1193         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1194         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1195         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1196         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1197         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1198         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1199         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1200         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1201         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1202         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1203         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1204         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1205         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
1206         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1207         * layout/blockformatting/BlockMarginCollapse.cpp:
1208         (WebCore::Layout::isMarginTopCollapsedWithParent):
1209         (WebCore::Layout::isMarginBottomCollapsedThrough):
1210         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
1211         * layout/floats/FloatingContext.cpp:
1212         (WebCore::Layout::FloatingContext::positionForFloat const):
1213         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1214         * layout/floats/FloatingState.cpp:
1215         (WebCore::Layout::FloatingState::append):
1216         * layout/inlineformatting/InlineFormattingContext.cpp:
1217         (WebCore::Layout::InlineFormattingContext::layout const):
1218         * layout/layouttree/LayoutTreeBuilder.cpp:
1219         (WebCore::Layout::outputLayoutTree):
1220         (WebCore::Layout::showLayoutTree):
1221
1222 2018-09-05  Zalan Bujtas  <zalan@apple.com>
1223
1224         [LFC] Drop Display:Box from FormattingContext::compute* functions
1225         https://bugs.webkit.org/show_bug.cgi?id=189309
1226
1227         Reviewed by Antti Koivisto.
1228
1229         They are redundant and could get out of sync.
1230
1231         * layout/FormattingContext.cpp:
1232         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1233         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1234         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1235         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
1236         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1237         * layout/FormattingContext.h:
1238         * layout/blockformatting/BlockFormattingContext.cpp:
1239         (WebCore::Layout::BlockFormattingContext::layout const):
1240         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1241         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1242         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1243         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1244         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1245         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1246         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1247         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1248         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1249         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1250         * layout/blockformatting/BlockFormattingContext.h:
1251         * layout/inlineformatting/InlineFormattingContext.cpp:
1252         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
1253         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
1254         * layout/inlineformatting/InlineFormattingContext.h:
1255
1256 2018-09-05  Jer Noble  <jer.noble@apple.com>
1257
1258         Add MediaCapabilities as an Experimental Feature
1259         https://bugs.webkit.org/show_bug.cgi?id=189209
1260
1261         Reviewed by Eric Carlson.
1262
1263         Move mediaCapabilitiesEnabled out of RuntimeEnabledFeatures. It already (also) exists in Settings.
1264
1265         * Modules/mediacapabilities/MediaCapabilities.idl:
1266         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
1267         * Modules/mediacapabilities/NavigatorMediaCapabilities.idl:
1268         * Modules/mediacapabilities/ScreenLuminance.idl:
1269         * page/RuntimeEnabledFeatures.h:
1270         (WebCore::RuntimeEnabledFeatures::setMediaCapabilitiesEnabled): Deleted.
1271         (WebCore::RuntimeEnabledFeatures::mediaCapabilitiesEnabled const): Deleted.
1272
1273 2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>
1274
1275         Add functionality to encode and decode a uint64_t in KeyedCoding
1276         https://bugs.webkit.org/show_bug.cgi?id=189216
1277
1278         Reviewed by Daniel Bates.
1279
1280         I've added this functionality in order to be able to encode and decode the raw uint64_t 
1281         representation of an OptionSet for my patch here <https://bugs.webkit.org/show_bug.cgi?id=187773>. 
1282
1283         The changes in the KeyedEncoder/KeyedDecoder for Glib were made because they are derived classes
1284         of KeyedCoding which contains pure virtual functions that need to be implemented.
1285
1286         * platform/KeyedCoding.h:
1287         * platform/cf/KeyedDecoderCF.cpp:
1288         (WebCore::KeyedDecoderCF::decodeUInt64):
1289         * platform/cf/KeyedDecoderCF.h:
1290         * platform/cf/KeyedEncoderCF.cpp:
1291         (WebCore::KeyedEncoderCF::encodeUInt64):
1292         * platform/cf/KeyedEncoderCF.h:
1293         * platform/glib/KeyedDecoderGlib.cpp:
1294         (WebCore::KeyedDecoderGlib::decodeUInt64):
1295         * platform/glib/KeyedDecoderGlib.h:
1296         * platform/glib/KeyedEncoderGlib.cpp:
1297         (WebCore::KeyedEncoderGlib::encodeUInt64):
1298         * platform/glib/KeyedEncoderGlib.h:
1299
1300 2018-09-05  Zan Dobersek  <zdobersek@igalia.com>
1301
1302         [GTK] ASSERT(!m_nicosia.imageBacking) when starting any YouTube video
1303         https://bugs.webkit.org/show_bug.cgi?id=189215
1304
1305         Reviewed by Carlos Garcia Campos.
1306
1307         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1308         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
1309         Manually clear out any layer-side state of any image backing that is
1310         associated with this layer, much like we do for backing stores.
1311
1312 2018-09-05  Eric Carlson  <eric.carlson@apple.com>
1313
1314         [MediaStream] Simplify logic when changing RealtimeMediaSource settings
1315         https://bugs.webkit.org/show_bug.cgi?id=189284
1316         <rdar://problem/44117948>
1317
1318         Reviewed by Youenn Fablet.
1319
1320         Remove all "apply<setting>" methods from RealtimeMediaSource and derived classes, and
1321         add a bitfield to settingsDidChange so classes can do setting-specific setup and
1322         configuration by overriding settingsDidChange.
1323
1324         No new tests, no functionality changed.
1325
1326         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1327         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
1328         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
1329         * platform/mediastream/MediaConstraints.h:
1330         (WebCore::NumericConstraint::fitnessDistance const):
1331         (WebCore::NumericConstraint::valueForDiscreteCapabilityValues const):
1332         * platform/mediastream/RealtimeIncomingVideoSource.h:
1333         (): Deleted.
1334         * platform/mediastream/RealtimeMediaSource.cpp:
1335         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
1336         (WebCore::RealtimeMediaSource::settingsDidChange):
1337         (WebCore::RealtimeMediaSource::fitnessDistance):
1338         (WebCore::applyNumericConstraint):
1339         (WebCore::RealtimeMediaSource::applyConstraint):
1340         (WebCore::RealtimeMediaSource::applyConstraints):
1341         (WebCore::RealtimeMediaSource::setSize):
1342         (WebCore::RealtimeMediaSource::setWidth):
1343         (WebCore::RealtimeMediaSource::setHeight):
1344         (WebCore::RealtimeMediaSource::setFrameRate):
1345         (WebCore::RealtimeMediaSource::setAspectRatio):
1346         (WebCore::RealtimeMediaSource::setFacingMode):
1347         (WebCore::RealtimeMediaSource::setVolume):
1348         (WebCore::RealtimeMediaSource::setSampleRate):
1349         (WebCore::RealtimeMediaSource::setSampleSize):
1350         (WebCore::RealtimeMediaSource::setEchoCancellation):
1351         * platform/mediastream/RealtimeMediaSource.h:
1352         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
1353         (WebCore::RealtimeMediaSourceSettings::diff const):
1354         * platform/mediastream/RealtimeMediaSourceSettings.h:
1355         (WebCore::RealtimeMediaSourceSettings::allFlags):
1356         * platform/mediastream/RealtimeVideoSource.cpp:
1357         (WebCore::RealtimeVideoSource::applySize): Deleted.
1358         (WebCore::RealtimeVideoSource::applyFrameRate): Deleted.
1359         * platform/mediastream/RealtimeVideoSource.h:
1360         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
1361         (WebCore::GStreamerAudioCaptureSource::settingsDidChange):
1362         (WebCore::GStreamerAudioCaptureSource::applySampleRate): Deleted.
1363         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
1364         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1365         (WebCore::GStreamerVideoCaptureSource::settingsDidChange):
1366         (WebCore::GStreamerVideoCaptureSource::applySize): Deleted.
1367         (WebCore::GStreamerVideoCaptureSource::applyFrameRate): Deleted.
1368         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
1369         * platform/mediastream/mac/AVVideoCaptureSource.h:
1370         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1371         (WebCore::AVVideoCaptureSource::settingsDidChange):
1372         (WebCore::AVVideoCaptureSource::setPreset):
1373         (WebCore::AVVideoCaptureSource::setFrameRate):
1374         (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
1375         (WebCore::AVVideoCaptureSource::processNewFrame):
1376         (WebCore::AVVideoCaptureSource::applySize): Deleted.
1377         (WebCore::AVVideoCaptureSource::applyFrameRate): Deleted.
1378         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1379         (WebCore::CoreAudioCaptureSource::settingsDidChange):
1380         (WebCore::CoreAudioCaptureSource::applySampleRate): Deleted.
1381         (WebCore::CoreAudioCaptureSource::applyEchoCancellation): Deleted.
1382         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1383         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1384         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
1385         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
1386         (WebCore::DisplayCaptureSourceCocoa::applySize): Deleted.
1387         (WebCore::DisplayCaptureSourceCocoa::applyFrameRate): Deleted.
1388         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
1389         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1390         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1391         (WebCore::MockRealtimeAudioSourceMac::settingsDidChange):
1392         (WebCore::MockRealtimeAudioSourceMac::applySampleRate): Deleted.
1393         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
1394         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1395         (WebCore::MockRealtimeVideoSourceMac::settingsDidChange):
1396         (WebCore::MockRealtimeVideoSourceMac::applySize): Deleted.
1397         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1398         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
1399         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
1400         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1401         (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange):
1402         (WebCore::ScreenDisplayCaptureSourceMac::applySize): Deleted.
1403         (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Deleted.
1404         * platform/mock/MockRealtimeAudioSource.cpp:
1405         (WebCore::MockRealtimeAudioSource::settingsDidChange):
1406         * platform/mock/MockRealtimeAudioSource.h:
1407         * platform/mock/MockRealtimeVideoSource.cpp:
1408         (WebCore::MockRealtimeVideoSource::settingsDidChange):
1409         (WebCore::MockRealtimeVideoSource::applySize): Deleted.
1410         * platform/mock/MockRealtimeVideoSource.h:
1411
1412 2018-09-05  Zalan Bujtas <zalan@apple.com>
1413
1414         [LFC][BFC] Move MarginCollapse class under BlockFormattingContext::Geometry
1415         https://bugs.webkit.org/show_bug.cgi?id=189296
1416
1417         Reviewed by Antti Koivisto.
1418
1419         Margin collapsing is part of geometry after all.
1420
1421         * layout/blockformatting/BlockFormattingContext.cpp:
1422         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1423         * layout/blockformatting/BlockFormattingContext.h:
1424         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1425         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
1426         * layout/blockformatting/BlockMarginCollapse.cpp:
1427         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
1428         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
1429         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
1430         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
1431         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
1432         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
1433         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
1434         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
1435         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
1436         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
1437         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
1438         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop): Deleted.
1439         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
1440         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
1441         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop): Deleted.
1442         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom): Deleted.
1443         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
1444         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
1445         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
1446         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom): Deleted.
1447         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop): Deleted.
1448
1449 2018-09-04  Zalan Bujtas  <zalan@apple.com>
1450
1451         [LFC] Make BlockFormattingContext::Geometry a subclass of FormattingContext::Geometry
1452         https://bugs.webkit.org/show_bug.cgi?id=189294
1453
1454         Reviewed by Antti Koivisto.
1455
1456         This simplifies some of the call sites.
1457
1458         * layout/blockformatting/BlockFormattingContext.cpp:
1459         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1460         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1461         * layout/blockformatting/BlockFormattingContext.h:
1462         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1463         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1464         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1465         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1466         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
1467         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1468         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1469
1470 2018-09-04  Frederic Wang  <fwang@igalia.com>
1471
1472         Add basic support for ScrollIntoViewOptions
1473         https://bugs.webkit.org/show_bug.cgi?id=189258
1474
1475         Reviewed by Simon Fraser.
1476
1477         This patch introduces a new ScrollIntoViewOptions parameter that can be passed into
1478         Element.scrollIntoView instead of a boolean. A basic support for scroll alignments is
1479         implemented, so that it is closer to the behavior of the CSSOMView spec while still remaining
1480         compatible with the current boolean-parameter implementation. Full implementation that
1481         takes into account orientation/direction will be handled in bug 161611. This patch is also a
1482         preliminary step to support the ScrollBehavior (bug 188043) for ScrollIntoView.
1483
1484         Tests: web-platform-tests/css/cssom-view/scrollintoview-html
1485                web-platform-tests/css/cssom-view/scrollIntoView-smooth.html
1486
1487         * CMakeLists.txt: Add new IDL files.
1488         * DerivedSources.make: Ditto.
1489         * Sources.txt: Add new generated cpp JS bindings.
1490         * WebCore.xcodeproj/project.pbxproj: Add files to build to XCode.
1491         * dom/Element.cpp:
1492         (WebCore::toScrollAlignment): Convert ScrollLogicalPosition to scroll alignment. Orientation
1493         and direction are not implemented yet.
1494         (WebCore::Element::scrollIntoView): Implement new scrollIntoView version accepting
1495         ScrollIntoViewOptions parameter.
1496         * dom/Element.h: Declare new scrollIntoView.
1497         * dom/Element.idl: Make scrollIntoView accept a ScrollIntoViewOptions parameter.
1498         * page/ScrollIntoViewOptions.h: Added.
1499         * page/ScrollIntoViewOptions.idl: Added.
1500         * page/ScrollLogicalPosition.h: Added.
1501         * page/ScrollLogicalPosition.idl: Added.
1502
1503 2018-09-04  Oriol Brufau  <obrufau@igalia.com>
1504
1505         Check important flags when serializing shorthand with "initial" values
1506         https://bugs.webkit.org/show_bug.cgi?id=188984
1507
1508         Reviewed by Antti Koivisto.
1509
1510         Test: imported/w3c/web-platform-tests/css/cssom/shorthand-serialization.html
1511
1512         The test still has some failures due to https://bugs.webkit.org/show_bug.cgi?id=185953
1513         but without this patch it would fail earlier.
1514
1515         * css/StyleProperties.cpp:
1516         (WebCore::StyleProperties::get4Values const):
1517
1518 2018-09-04  Antti Koivisto  <antti@apple.com>
1519
1520         Remove pointless RenderSVGResourceMode::ApplyToDefault enum value
1521         https://bugs.webkit.org/show_bug.cgi?id=189260
1522
1523         Reviewed by Sam Weinig.
1524
1525         Default does not need a bit, it is better represented with an empty OptionSet.
1526
1527         * rendering/svg/RenderSVGResource.cpp:
1528         (WebCore::requestPaintingResource):
1529         * rendering/svg/RenderSVGResource.h:
1530         * rendering/svg/RenderSVGResourceClipper.cpp:
1531         (WebCore::RenderSVGResourceClipper::applyResource):
1532         * rendering/svg/RenderSVGResourceFilter.cpp:
1533         (WebCore::RenderSVGResourceFilter::applyResource):
1534         (WebCore::RenderSVGResourceFilter::postApplyResource):
1535         * rendering/svg/RenderSVGResourceGradient.cpp:
1536         (WebCore::RenderSVGResourceGradient::applyResource):
1537         * rendering/svg/RenderSVGResourceMasker.cpp:
1538         (WebCore::RenderSVGResourceMasker::applyResource):
1539         * rendering/svg/RenderSVGResourcePattern.cpp:
1540         (WebCore::RenderSVGResourcePattern::applyResource):
1541         (WebCore::RenderSVGResourcePattern::postApplyResource):
1542         * rendering/svg/RenderSVGResourceSolidColor.cpp:
1543         (WebCore::RenderSVGResourceSolidColor::applyResource):
1544         (WebCore::RenderSVGResourceSolidColor::postApplyResource):
1545         * rendering/svg/SVGInlineTextBox.cpp:
1546         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
1547         (WebCore::SVGInlineTextBox::paintSelectionBackground):
1548         (WebCore::SVGInlineTextBox::paint):
1549         (WebCore::SVGInlineTextBox::acquirePaintingResource):
1550         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
1551         * rendering/svg/SVGRenderingContext.cpp:
1552         (WebCore::SVGRenderingContext::~SVGRenderingContext):
1553         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1554
1555 2018-08-29  Emilio Cobos Álvarez  <emilio@crisal.io>
1556
1557         Remove PseudoElementUserAgentCustom.
1558         https://bugs.webkit.org/show_bug.cgi?id=189089
1559
1560         Reviewed by Ryosuke Niwa.
1561
1562         Tests at https://github.com/web-platform-tests/wpt/pull/12743.
1563
1564         * css/CSSSelector.cpp:
1565         (WebCore::CSSSelector::pseudoId):
1566         (WebCore::CSSSelector::parsePseudoElementType):
1567         * css/CSSSelector.h:
1568         (WebCore::CSSSelector::isCustomPseudoElement const):
1569         * css/RuleSet.cpp:
1570         (WebCore::RuleSet::addRule):
1571         * css/parser/CSSParserSelector.h:
1572         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const):
1573
1574 2018-09-04  Dean Jackson  <dino@apple.com>
1575
1576         Post review Weinig fix-ups
1577         https://bugs.webkit.org/show_bug.cgi?id=189288
1578
1579         Reviewed by Sam Weinig.
1580
1581         Fix-ups from https://bugs.webkit.org/show_bug.cgi?id=189252
1582
1583         * platform/MIMETypeRegistry.cpp:
1584         (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes):
1585         (WebCore::initializeSystemPreviewMIMETypes): Deleted.
1586         * rendering/RenderThemeIOS.mm:
1587         (WebCore::arKitBundle):
1588         (WebCore::loadARKitPDFPage):
1589         (WebCore::systemPreviewLogo):
1590
1591 2018-09-04  Ryosuke Niwa  <rniwa@webkit.org>
1592
1593         slotchange event doesn't get fired when inserting, removing, or renaming slot elements
1594         https://bugs.webkit.org/show_bug.cgi?id=189144
1595         <rdar://problem/43871061>
1596
1597         Reviewed by Antti Koivisto.
1598
1599         This patch implements `slotchange` event when a slot element is inserted, removed, or renamed in the DOM tree.
1600         Let us consider each scenario separately.
1601
1602         Insertion (https://dom.spec.whatwg.org/#concept-node-insert): In this case, we must fire `slotchange` event on
1603         slot elements whose assigned nodes have changed in the tree order. When there is at most one slot element for
1604         each name, this can be done by simply checking whether each slot has assigned nodes or not. When there are more
1605         than one slot element, however, the newly inserted slot element may now become the first slot of a given name,
1606         and gain assined nodes while the previously first element loses its assigned nodes. To see if the newly inserted
1607         slot element is the first of its kind, we must travere the DOM tree to check the order of that and the previously
1608         first slot element. To do this, we resolve the slot elements before start inserting nodes in
1609         executeNodeInsertionWithScriptAssertion via SlotAssignment::resolveSlotsBeforeNodeInsertionOrRemoval. Note that
1610         when the DOM tree has at most one slot element of its kind, resolveSlotsBeforeNodeInsertionOrRemoval is a no-op
1611         and addSlotElementByName continues to operate in O(1). Becasue addSlotElementByName is called on each inserted
1612         slot element in the tree order, we do the tree traversal upon finding the first slot element which has more than
1613         one of its kind in the current tree. In this case, we resolve all other slot elements and enqueues slotchange
1614         event as needed to avoid doing the tree traversal more than once.
1615
1616         Removal (https://dom.spec.whatwg.org/#concept-node-remove): In removal, we're concerned with removing the first
1617         slot element of its kind. We must fire slotchange event on the remaining slot elements which became the first of
1618         its kind after the removal as well as the ones which got removed from the tree if they had assigned nodes.
1619         Furthermore, the DOM specification mandates that we first fire slotchange events in the tree from which a node
1620         was removed and then in the removed subtree. Because we must only fire slotchange event on the first slot element
1621         of its kind which has been removed, we must resolve the first slot elements of each kind before a node removal
1622         in removeAllChildrenWithScriptAssertion and removeNodeWithScriptAssertion as we've done for insertion. Again,
1623         in the case there was at most one slot element of each kind, resolveSlotsBeforeNodeInsertionOrRemoval is a no-op
1624         and removeSlotElementByName would continue to operate in O(1). When there are multiple slot elements for a given
1625         kind, we immediately enqueue slotchange event on the slot elements which newly became the first of its kind but
1626         delay the enqueuing of slotchange event on the removed slot elements until removeSlotElementByName is called on
1627         that element so that enqueuing of slotchange events on the slot elements still remaining in the in the tree would
1628         happen before those which got removed as the DOM specification mandates.
1629
1630         Rename (https://dom.spec.whatwg.org/#shadow-tree-slots): In the case the slot element's name content attribute
1631         is changed, the renamed element might have become the first of its kind or ceased to be the first of its kind.
1632         There could be two other slot elements appearing later in the tree order which might have gained or lost assigned
1633         nodes as a result. In this case, we invoke the algorithms for removing & inserting the slot with a key difference:
1634         we enqueue slotchange event on the renamed slot immediately if it has assigned nodes.
1635
1636         To enqueue slotchange event in the tree order, this patch adds oldElement, which is a WeakPtr to a slot element,
1637         to SlotAssignment::Slot. This WeakPtr is set to the slot element which used to have assigned nodes prior to the
1638         node insertion, removal, or rename but no longer has after the mutation. This patch also adds a slot mutation
1639         version number, m_slotMutationVersion, which is incremented whenever a node is about to be inserted or removed,
1640         and slot resolution version, m_slotResolutionVersion, which is set to the current slot mutation version number
1641         when the full slot resolution is triggered during slot mutations. They are used to avoid redundant tree traversals
1642         in resolveSlotsAfterSlotMutation. This patch also makes m_needsToResolveSlotElements compiled in release builds
1643         to avoid resolving slot elements when there is at most one slot element of each kind.
1644
1645         For insertion, oldElement is set to the slot which used to be the first of its kind before getting set to a slot
1646         element being inserted in resolveSlotsAfterSlotMutation. We enqueue slotchange event on the newly inserted slot
1647         element at that point (1). Since the slot element which used to be the first of its kind appears after the newly
1648         inserted slot element by definition, we're guaranteed to see this oldElement later in the tree traversal upon
1649         which we enqueue slotchange event. Note that if this slot element was the first of its kind, then we're simply
1650         hitting (1), which is O(1) and does not invoke the tree traversal.
1651
1652         For removal, oldElement is set to the slot which used to be the first of its kind. Because this slot element is
1653         getting removed, slotchange event must be enqueud after slotchange events have been enqueued on all slot elements
1654         still remaining in the tree. To do this, we enqueue slotchange event immediately on the first slot element of
1655         its kind during the tree traversal as we encounter it (2), and set oldElement to the previosuly-first-but-removed
1656         slot element. slotchange event is enqueued on this slot element when removeSlotElementByName is later invoked via
1657         HTMLSlotElement::removedFromAncestor which traverses each removed element in the tree order. Again, if this was
1658         the last slot of its kind, we'd simply expedite (2) by enqueuing slotchange event during removeSlotElementByName,
1659         which is O(1).
1660
1661         When the DOM invokes the concept to replace all children (https://dom.spec.whatwg.org/#concept-node-replace-all),
1662         however, this algorithm isn't sufficient because the removal of each child happens one after another. We would
1663         either need to resolve slots between each removal, or treat the removal of all children as a single operation.
1664         While the DOM specification currently specifies the former behavior, this patch implements the latter behavior
1665         to avoid useless work. See the DOM spec issue: https://github.com/w3c/webcomponents/issues/764
1666
1667         Test: fast/shadow-dom/slotchange-for-slot-mutation.html
1668
1669         * dom/ContainerNode.cpp:
1670         (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Call resolveSlotsBeforeNodeInsertionOrRemoval
1671         before start removing children.
1672         (WebCore::ContainerNode::removeNodeWithScriptAssertion): Ditto.
1673         (WebCore::executeNodeInsertionWithScriptAssertion): Ditto before inserting children.
1674         * dom/ShadowRoot.cpp:
1675         (WebCore::ShadowRoot::~ShadowRoot): Set m_hasBegunDeletingDetachedChildren to true. This flag is used to supress
1676         slotchange events during the shadow tree destruction.
1677         (WebCore::ShadowRoot::renameSlotElement): Added.
1678         (WebCore::ShadowRoot::removeSlotElementByName): Added oldParentOfRemovedTree as an argument.
1679         * dom/ShadowRoot.h:
1680         (WebCore::ShadowRoot::shouldFireSlotchangeEvent): Added.
1681         * dom/SlotAssignment.cpp:
1682         (WebCore::findSlotElement): Added.
1683         (WebCore::nextSlotElementSkippingSubtree): Added.
1684         (WebCore::SlotAssignment::hasAssignedNodes): Added. Returns true if the slot of a given name has assigned nodes.
1685         (WebCore::SlotAssignment::renameSlotElement): Added.
1686         (WebCore::SlotAssignment::addSlotElementByName): Call resolveSlotsAfterSlotMutation when slotchange event needs
1687         to be dispatched for the current slot and there are more than one slot elements.
1688         (WebCore::SlotAssignment::removeSlotElementByName): Ditto. When the slot's oldElement is set to the current slot
1689         element, meaning that this slot element used to have assigned nodes, then enqueue slotchange event. It also has
1690         a special case for oldParentOfRemovedTree is null when renaming a slot element. In this case, we want to enqueue
1691         slot change event immediately on the renamed slot element and any affected elements as in a node insertion since
1692         removeSlotElementByName would never be called on a slot element which newly become the first of its kind after
1693         a slot rename.
1694         (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): Added. This is the slot resolution algorithm invoked
1695         when there are more than one slot elements for a given name. It has two modes dealing with insertion & removal.
1696         The insertion mode is also used for renaming a slot element. The firs
1697         (WebCore::SlotAssignment::resolveSlotsBeforeNodeInsertionOrRemoval): Added. Resolves all slot elements prior to
1698         inserting or removing nodes. In many cases, this should be a no-op since m_needsToResolveSlotElements is set to
1699         true only when there are more than one slot element of its kind.
1700         (WebCore::SlotAssignment::willRemoveAllChildren): Ditto. Also sets m_willBeRemovingAllChildren to true.
1701         (WebCore::SlotAssignment::didChangeSlot):
1702         (WebCore::SlotAssignment::resolveAllSlotElements): Use seenFirstElement instead of element to indicate whether
1703         we have seen a slot element of given name for consistency with resolveSlotsAfterSlotMutation.
1704         * dom/SlotAssignment.h:
1705         (WebCore::SlotAssignment::Slot): Added oldElement and seenFirstElement.
1706         (WebCore::SlotAssignment): Always compile m_needsToResolveSlotElements. Added m_willBeRemovingAllChildren,
1707         m_slotMutationVersion, and m_slotResolutionVersion.
1708         (WebCore::ShadowRoot::resolveSlotsBeforeNodeInsertionOrRemoval): Added. Calls the one in SlotAssignment.
1709         (WebCore::ShadowRoot::willRemoveAllChildren): Ditto.
1710         * html/HTMLSlotElement.cpp:
1711         (WebCore::HTMLSlotElement::removedFromAncestor):
1712         (WebCore::HTMLSlotElement::attributeChanged): Calls ShadowRoot::renameSlotElement instead of
1713         removeSlotElementByName and addSlotElementByName pair.
1714
1715 2018-09-04  Youenn Fablet  <youenn@apple.com>
1716
1717         Make LibWebRTCRtpSenderBackend own its libwebrtc RTP sender backend
1718         https://bugs.webkit.org/show_bug.cgi?id=189270
1719
1720         Reviewed by Eric Carlson.
1721
1722         Previously, the libwebrtc senders were owned in LibWebRTCMediaEndpoint.
1723         This patch makes them be owned by LibWebRTCRtpSenderBackend.
1724         This simplifies the implementation of RTCRtpSender::getParameters.
1725         This will help simplify the implementation of RTCRtpSender::replaceTrack.
1726
1727         removeTrack is also refactored so that LibWebRTCMediaEndpoint directly uses libwebrtc constructs and not WebCore libwebrtc-agnostic ones.
1728
1729         No change of behavior.
1730
1731         * Modules/mediastream/PeerConnectionBackend.h:
1732         (WebCore::PeerConnectionBackend::removeTrack):
1733         (WebCore::PeerConnectionBackend::notifyRemovedTrack): Deleted.
1734         * Modules/mediastream/RTCPeerConnection.cpp:
1735         (WebCore::RTCPeerConnection::removeTrack):
1736         * Modules/mediastream/RTCRtpSender.cpp:
1737         (WebCore::RTCRtpSender::getParameters):
1738         * Modules/mediastream/RTCRtpSender.h:
1739         (WebCore::RTCRtpSender::backend):
1740         * Modules/mediastream/RTCRtpSenderBackend.h:
1741         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1742         (WebCore::LibWebRTCMediaEndpoint::addTrack):
1743         (WebCore::LibWebRTCMediaEndpoint::removeTrack):
1744         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
1745         (WebCore::LibWebRTCMediaEndpoint::stop):
1746         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const): Deleted.
1747         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const): Deleted.
1748         (WebCore::LibWebRTCMediaEndpoint::getRTCRtpSenderParameters): Deleted.
1749         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1750         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1751         (WebCore::backendFromRTPSender):
1752         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1753         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
1754         (WebCore::LibWebRTCPeerConnectionBackend::removeTrack):
1755         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
1756         (WebCore::LibWebRTCPeerConnectionBackend::notifyRemovedTrack): Deleted.
1757         (WebCore::LibWebRTCPeerConnectionBackend::getParameters const): Deleted.
1758         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1759         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1760         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
1761         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1762
1763 2018-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1764
1765         Populate "text/uri-list" with multiple URLs when the pasteboard contains multiple URLs
1766         https://bugs.webkit.org/show_bug.cgi?id=188890
1767         <rdar://problem/43648605>
1768
1769         Reviewed by Tim Horton.
1770
1771         Adds support for exposing a newline separated list of URLs via DataTransfer's "text/uri-list" type when pasting
1772         or dropping multiple items on the pasteboard that can be represented as URLs. Currently on iOS, only the URL of
1773         the first item (if present) is exposed, and on macOS, only the first out of all the URLs in the pasteboard is
1774         exposed.
1775
1776         To fix this, we introduce `Pasteboard::readAllStrings`, which reads a list of pasteboard strings collected from
1777         all available items on the platform pasteboard. Currently, this is only used to provide a list of URL strings
1778         when fetching data for the "text/uri-list" type when calling `DataTransfer.getData()` and
1779         `DataTransferItem.getAsString()`.
1780
1781         Tests:  DragAndDropTests.ExposeMultipleURLsInDataTransfer
1782                 UIPasteboardTests.DataTransferURIListContainsMultipleURLs
1783                 PasteMixedContent.PasteOneOrMoreURLs
1784
1785         * dom/DataTransfer.cpp:
1786         (WebCore::readURLsFromPasteboardAsString):
1787
1788         Add a helper method that reads all URL strings from the pasteboard (for the MIME type "text/uri-list", which
1789         corresponds to NSURLPboardType and "public.url" on macOS and iOS, respectively) and returns a single string
1790         containing all non-empty URLs joined by newline characters. Also takes a filtering block which may be used to
1791         reject URLs from being included in "text/uri-list" output.
1792
1793         (WebCore::DataTransfer::getDataForItem const):
1794         (WebCore::DataTransfer::readStringFromPasteboard const):
1795
1796         Insteading of reading a single string from the pasteboard for "text/uri-list", call the above helper function to
1797         read all URL strings in the pasteboard. If there are files present in the pasteboard, we also filter out URLs
1798         whose schemes are not in the set of schemes that are safe to expose to the page (i.e. http(s), blob, and data).
1799
1800         * platform/Pasteboard.cpp:
1801         (WebCore::Pasteboard::readAllStrings):
1802
1803         Add a default non-Cocoa implementation of readAllStrings() that returns a vector, which may contain the result
1804         of readString().
1805
1806         * platform/Pasteboard.h:
1807         * platform/PasteboardStrategy.h:
1808         * platform/PlatformPasteboard.h:
1809
1810         Add plumbing to grab a list of strings from the pasteboard for a given type.
1811
1812         * platform/cocoa/PasteboardCocoa.mm:
1813         (WebCore::Pasteboard::readAllStrings):
1814         (WebCore::Pasteboard::readString):
1815
1816         Implement these two methods in terms of `readPlatformValuesAsStrings`. `readAllStrings` returns the full list of
1817         results, while `readString` only returns the first result.
1818
1819         * platform/ios/PasteboardIOS.mm:
1820         (WebCore::Pasteboard::readPlatformValuesAsStrings):
1821         (WebCore::Pasteboard::readPlatformValueAsString): Deleted.
1822
1823         Refactor this Cocoa helper function to return a list of pasteboard string values for the given type, rather than
1824         a single string.
1825
1826         * platform/ios/PlatformPasteboardIOS.mm:
1827         (WebCore::PlatformPasteboard::allStringsForType const):
1828
1829         Grab a string for each item (represented by an NSItemProvider) in the pasteboard that has data for the given
1830         type identifier.
1831
1832         (WebCore::PlatformPasteboard::readString const):
1833
1834         Return the absolute string of the NSURL, instead of WebCore::URL::string(). This is needed to handle the case
1835         where the NSURL is constructed from absolute and relative parts using a Plist. While -absoluteString gets us the
1836         full URL string, URL::string() only returns the relative portion.
1837
1838         * platform/mac/PasteboardMac.mm:
1839         (WebCore::Pasteboard::readPlatformValuesAsStrings):
1840         (WebCore::Pasteboard::readPlatformValueAsString): Deleted.
1841
1842         Also refactor this to retrieve a list of pasteboard strings, rather than a single result.
1843
1844         * platform/mac/PlatformPasteboardMac.mm:
1845         (WebCore::typeIdentifierForPasteboardType):
1846         (WebCore::PlatformPasteboard::allStringsForType const):
1847
1848         Add an implementation for `allStringsForType` on macOS. Unlike iOS, it's much trickier to get this right since
1849         we need to maintain compatibility with legacy "NS*Pboard" types, and `NSPasteboardItem` can only provide data
1850         for `NSPasteboardType`s (i.e. UTIs), so there's no way to just iterate through each pasteboard item and ask it
1851         for data that matches the given type, if the types are not UTIs. However, in the case where we have multiple
1852         items, the client must have used NSPasteboardWriting-conformant objects and/or NSPasteboardItem itself to write
1853         data to the pasteboard. Since NSPasteboardWriting-conformant objects register modern pasteboard types when
1854         writing to the pasteboard, we can simply iterate over these pasteboard items and ask for property lists using
1855         type identifiers instead of having to worry about legacy pasteboard types. Furthermore, in the case where there
1856         is only a single item in the pasteboard and we do need to handle legacy pasteboard types, using `-[NSPasteboard
1857         stringForType:]` in the same way we do currently should yield the correct result.
1858
1859         As such, in the case where there is a single pasteboard item, we use `-[NSPasteboard stringForType:]` with the
1860         original legacy type, and in the case where there are multiple items on the pasteboard, we iterate over each of
1861         the pasteboard items and call `-[NSPasteboardItem propertyListForType:]` with the modern pasteboard type
1862         corresponding to the given legacy pasteboard type.
1863
1864         The different corner cases in this logic are tested by the new API test, PasteMixedContent.PasteOneOrMoreURLs,
1865         which exercises several different ways of writing one or more URLs to the pasteboard on macOS, which each result
1866         in different legacy and modern pasteboard types being written to the pasteboard; our implementation of
1867         `PlatformPasteboard::allStringsForType` on macOS handles all cases correctly.
1868
1869 2018-09-04  Simon Fraser  <simon.fraser@apple.com>
1870
1871         CSS reference filter that references a tiled feTurbulence is blank
1872         https://bugs.webkit.org/show_bug.cgi?id=188950
1873
1874         Reviewed by Dean Jackson.
1875         
1876         We need to run the code that was in RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion()
1877         for CSS reference filters, to set up the various rects in the filter effects.
1878         
1879         Do this by moving the code to FilterEffect::determineFilterPrimitiveSubregion(), which makes sense
1880         because it recurses on the FilterEffect input chain. To make it CSS/SVGFilter agnostic, we move filterRegionInUserSpace()
1881         to the Filter base class (for CSSFilter, it just returns m_filterRegion).
1882
1883         Test: css3/filters/reference-filter-set-filter-regions.html
1884
1885         * platform/graphics/filters/Filter.h:
1886         * platform/graphics/filters/FilterEffect.cpp:
1887         (WebCore::FilterEffect::determineFilterPrimitiveSubregion):
1888         * platform/graphics/filters/FilterEffect.h:
1889         * rendering/CSSFilter.cpp:
1890         (WebCore::CSSFilter::determineFilterPrimitiveSubregion):
1891         * rendering/CSSFilter.h:
1892         * rendering/RenderLayerFilters.cpp:
1893         (WebCore::RenderLayerFilters::beginFilterEffect):
1894         * rendering/svg/RenderSVGResourceFilter.cpp:
1895         (WebCore::RenderSVGResourceFilter::applyResource):
1896         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
1897         (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Deleted.
1898         * rendering/svg/RenderSVGResourceFilterPrimitive.h:
1899         * svg/graphics/filters/SVGFilter.h:
1900
1901 2018-09-04  Zalan Bujtas  <zalan@apple.com>
1902
1903         [LFC] Rename LayoutPair to BoxPair
1904         https://bugs.webkit.org/show_bug.cgi?id=189276
1905
1906         Reviewed by Antti Koivisto.
1907
1908         * layout/FormattingContext.h:
1909         * layout/blockformatting/BlockFormattingContext.cpp:
1910         (WebCore::Layout::BlockFormattingContext::layout const):
1911
1912 2018-09-04  Youenn Fablet  <youenn@apple.com>
1913
1914         Disable WebRTC unified plan runtime flag by default
1915         https://bugs.webkit.org/show_bug.cgi?id=189264
1916
1917         Reviewed by Jer Noble.
1918
1919         Covered by existing tests.
1920
1921         * testing/Internals.cpp:
1922         (WebCore::Internals::resetToConsistentState):
1923         Activate unified plan for testing.
1924
1925 2018-09-04  Zalan Bujtas  <zalan@apple.com>
1926
1927         [LFC][BFC] Merge computeInFlowWidth(Height)AndMargin and computeFloatingWidth(Height)AndMargin.
1928         https://bugs.webkit.org/show_bug.cgi?id=189271
1929
1930         Reviewed by Antti Koivisto.
1931
1932         This is in preparation for adding min/max-widht(height).
1933
1934         * layout/FormattingContext.cpp:
1935         (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const): Deleted.
1936         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const): Deleted.
1937         * layout/FormattingContext.h:
1938         * layout/blockformatting/BlockFormattingContext.cpp:
1939         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1940         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1941         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const): Deleted.
1942         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const): Deleted.
1943         * layout/blockformatting/BlockFormattingContext.h:
1944
1945 2018-09-04  Rob Buis  <rbuis@igalia.com>
1946
1947         Adjust XMLHttpRequest username/password precedence rules
1948         https://bugs.webkit.org/show_bug.cgi?id=184910
1949
1950         Reviewed by Chris Dumez.
1951
1952         Steps 9.1 and 9.2 in the XMLHTTPRequest::open [1] algorithm
1953         specify that non null user or non null password ought
1954         to be set on the URL, so implement this.
1955
1956         Behavior matches Firefox and Chrome.
1957
1958         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-open
1959
1960         Test: xhr/send-authentication-competing-names-passwords.htm
1961
1962         * xml/XMLHttpRequest.cpp:
1963         (WebCore::XMLHttpRequest::open):
1964
1965 2018-09-04  Simon Fraser  <simon.fraser@apple.com>
1966
1967         Simplify RenderLayer filter code
1968         https://bugs.webkit.org/show_bug.cgi?id=189248
1969
1970         Reviewed by Dean Jackson.
1971         
1972         Painting filters in RenderLayer involved the confusingly named RenderLayer::FilterInfo,
1973         and FilterEffectRenderer/FilterEffectRendererHelper. Reduce confusion by just collapsing
1974         these together into RenderLayerFilters. RenderLayerFilters stores a reference to the
1975         CSSFilter, and knows how to set it up, and vend a GraphicsContext* for painting the content
1976         to be filtered.
1977         
1978         It's also simpler to just give RenderLayer a member variable for RenderLayerFilters, rather
1979         than using a side hash (we can recoup the space in other ways layer).
1980
1981         * Sources.txt:
1982         * WebCore.xcodeproj/project.pbxproj:
1983         * css/CSSFilterImageValue.cpp:
1984         * rendering/CSSFilter.h:
1985         * rendering/FilterEffectRenderer.cpp: Removed.
1986         * rendering/FilterEffectRenderer.h: Removed.
1987         * rendering/RenderLayer.cpp:
1988         (WebCore::RenderLayer::RenderLayer):
1989         (WebCore::RenderLayer::~RenderLayer):
1990         (WebCore::RenderLayer::paintsWithFilters const):
1991         (WebCore::RenderLayer::requiresFullLayerImageForFilters const):
1992         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
1993         (WebCore::RenderLayer::filtersForPainting const):
1994         (WebCore::RenderLayer::setupFilters):
1995         (WebCore::RenderLayer::applyFilters):
1996         (WebCore::RenderLayer::paintLayerContents):
1997         (WebCore::RenderLayer::calculateClipRects const):
1998         (WebCore::RenderLayer::filter const): Deleted.
1999         (WebCore::RenderLayer::filterPainter const): Deleted.
2000         (WebCore::RenderLayer::hasFilterThatIsPainting const): Deleted.
2001         * rendering/RenderLayer.h:
2002         * rendering/RenderLayerFilterInfo.cpp: Removed.
2003         * rendering/RenderLayerFilters.cpp: Added.
2004         (WebCore::RenderLayerFilters::RenderLayerFilters):
2005         (WebCore::RenderLayerFilters::~RenderLayerFilters):
2006         (WebCore::RenderLayerFilters::setFilter):
2007         (WebCore::RenderLayerFilters::hasFilterThatMovesPixels const):
2008         (WebCore::RenderLayerFilters::hasFilterThatShouldBeRestrictedBySecurityOrigin const):
2009         (WebCore::RenderLayerFilters::notifyFinished):
2010         (WebCore::RenderLayerFilters::updateReferenceFilterClients):
2011         (WebCore::RenderLayerFilters::removeReferenceFilterClients):
2012         (WebCore::RenderLayerFilters::buildFilter):
2013         (WebCore::RenderLayerFilters::beginFilterEffect):
2014         (WebCore::RenderLayerFilters::applyFilterEffect):
2015         * rendering/RenderLayerFilters.h: Renamed from Source/WebCore/rendering/RenderLayerFilterInfo.h.
2016
2017 2018-09-04  Dean Jackson  <dino@apple.com>
2018
2019         Build fix.
2020
2021         * testing/Internals.cpp:
2022
2023 2018-09-03  Dean Jackson  <dino@apple.com>
2024
2025         Move SystemPreview code from WebKitAdditions to WebKit
2026         https://bugs.webkit.org/show_bug.cgi?id=189252
2027         <rdar://problem/44080245>
2028
2029         Reviewed by Wenson Hsieh.
2030
2031         Move the WebKitAdditions code into WebKit/WebCore.
2032
2033         * html/HTMLAnchorElement.cpp:
2034         (WebCore::HTMLAnchorElement::relList const): Look for "ar".
2035         (WebCore::HTMLAnchorElement::isSystemPreviewLink const): Ditto.
2036
2037         * platform/MIMETypeRegistry.cpp: Add a couple of new static methods
2038         for System Preview MIME types.
2039         (WebCore::initializeSystemPreviewMIMETypes):
2040         (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes):
2041         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
2042         * platform/MIMETypeRegistry.h:
2043
2044         * rendering/RenderThemeIOS.mm: Load the ARKit artwork from the framework.
2045         (WebCore::arKitBundle):
2046         (WebCore::loadARKitPDFPage):
2047         (WebCore::systemPreviewLogo):
2048         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
2049
2050         * testing/Internals.cpp: Remove internal helper.
2051         (WebCore::Internals::systemPreviewRelType): Deleted.
2052         * testing/Internals.h:
2053         * testing/Internals.idl:
2054
2055 2018-09-04  Andy Estes  <aestes@apple.com>
2056
2057         [Payment Request] PaymentResponse should have an onpayerdetailchange event handler
2058         https://bugs.webkit.org/show_bug.cgi?id=189249
2059
2060         Reviewed by Alex Christensen.
2061
2062         Implemented the onpayerdetailchange event handler as defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
2063
2064         The "payer detail changed" algorithm will be implemented in a follow-up patch.
2065
2066         Covered by existing web platform tests.
2067
2068         * Modules/paymentrequest/PaymentResponse.cpp:
2069         (WebCore::PaymentResponse::scriptExecutionContext const):
2070         * Modules/paymentrequest/PaymentResponse.h:
2071         * Modules/paymentrequest/PaymentResponse.idl:
2072         * dom/EventNames.h:
2073         * dom/EventTargetFactory.in:
2074
2075 2018-09-04  Youenn Fablet  <youenn@apple.com>
2076
2077         Introduce LibWebRTC backends for sender and receiver
2078         https://bugs.webkit.org/show_bug.cgi?id=189171
2079
2080         Reviewed by Alejandro G. Castro.
2081
2082         Rename RTCRtpSender::Backend to RTCRtpSenderBackend, ditto for RTCRtpReceiver::Backend.
2083         Make RTCRtpSender/RTCRtpReceiver own their backend.
2084         This will allow the backends to own a libwebrtc sender/receiver ref counted object
2085         and might allow us to cleanly separate code from unified plan vs plan B.
2086
2087         Update code so that libwebrtc code specific code is now creating senders and receivers.
2088         This moves code from RTCPeerConnection down to LibWebRTCPeerConnectionBackend, in particular for
2089         addTrack and addTransceiver methods.
2090
2091         Moved some code from LibWebRTCMediaEndpoint to LibWebRTCUtils to ease readability.
2092
2093         A future patch will allow to tie the libwebrtc sender/receiver to WebKit DOM sender/receiver.
2094
2095         Covered by existing tests.
2096
2097         * Modules/mediastream/PeerConnectionBackend.cpp:
2098         (WebCore::PeerConnectionBackend::addTrack):
2099         (WebCore::PeerConnectionBackend::addTransceiver):
2100         * Modules/mediastream/PeerConnectionBackend.h:
2101         * Modules/mediastream/RTCPeerConnection.cpp:
2102         (WebCore::RTCPeerConnection::addTrack):
2103         (WebCore::RTCPeerConnection::addTransceiver):
2104         (WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
2105         * Modules/mediastream/RTCPeerConnection.h:
2106         * Modules/mediastream/RTCRtpReceiver.cpp:
2107         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
2108         * Modules/mediastream/RTCRtpReceiver.h:
2109         (WebCore::RTCRtpReceiver::create):
2110         (WebCore::RTCRtpReceiver::setBackend):
2111         * Modules/mediastream/RTCRtpReceiverBackend.h: Added.
2112         (WebCore::RTCRtpReceiverBackend::getParameters):
2113         * Modules/mediastream/RTCRtpSender.cpp:
2114         (WebCore::RTCRtpSender::create):
2115         (WebCore::RTCRtpSender::RTCRtpSender):
2116         * Modules/mediastream/RTCRtpSender.h:
2117         * Modules/mediastream/RTCRtpSenderBackend.h: Added.
2118         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2119         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
2120         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2121         (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
2122         (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
2123         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
2124         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
2125         (WebCore::LibWebRTCPeerConnectionBackend::completeAddTransceiver):
2126         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2127         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: Added.
2128         (WebCore::LibWebRTCRtpReceiverBackend::getParameters):
2129         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h: Added.
2130         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: Added.
2131         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
2132         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
2133         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: Added.
2134         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
2135         (WebCore::fillEncodingParameters):
2136         (WebCore::fillHeaderExtensionParameters):
2137         (WebCore::fillCodecParameters):
2138         (WebCore::fillRtpParameters):
2139         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
2140         (WebCore::fromStdString):
2141         * WebCore.xcodeproj/project.pbxproj:
2142
2143 2018-09-04  Antoine Quint  <graouts@apple.com>
2144
2145         [Modern Media Controls] Disabling both fullscreen and picture-in-picture shows an empty top left container
2146         https://bugs.webkit.org/show_bug.cgi?id=189259
2147         <rdar://problem/42026625>
2148
2149         Reviewed by Dean Jackson.
2150
2151         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html
2152
2153         Ensure the top left controls bar is hidden when none of its children are visible.
2154
2155         * Modules/modern-media-controls/controls/inline-media-controls.js:
2156         (InlineMediaControls.prototype.layout):
2157
2158 2018-09-04  Daniel Bates  <dabates@apple.com>
2159
2160         Attempt to fix failing tests following r235615 (https://bugs.webkit.org/show_bug.cgi?id=187925)
2161
2162         An inline text box that does not have combined text and contains a single character
2163         should be considered as having text content.
2164
2165         * rendering/InlineTextBox.cpp:
2166         (WebCore::InlineTextBox::hasTextContent const):
2167
2168 2018-09-04  Per Arne Vollan  <pvollan@apple.com>
2169
2170         Add test for fix in https://bugs.webkit.org/show_bug.cgi?id=187922
2171         https://bugs.webkit.org/show_bug.cgi?id=187925
2172
2173         Reviewed by Simon Fraser.
2174
2175         This will test that the function primaryScreenDisplayID() returns a valid display ID.
2176
2177         Test: fast/misc/valid-primary-screen-displayID.html
2178
2179         * platform/PlatformScreen.h:
2180         * platform/mac/PlatformScreenMac.mm:
2181         (WebCore::primaryScreenDisplayID):
2182         * testing/Internals.cpp:
2183         (WebCore::Internals::primaryScreenDisplayID):
2184         * testing/Internals.h:
2185         * testing/Internals.idl:
2186
2187 2018-09-04  Daniel Bates  <dabates@apple.com>
2188
2189         Add helper function to create a potential CORS request
2190         https://bugs.webkit.org/show_bug.cgi?id=189251
2191
2192         Reviewed by Andy Estes.
2193
2194         Add a new function, createPotentialAccessControlRequest, that we will use to implement the algorithm Create a potential-
2195         CORS request from the HTML standard: <https://html.spec.whatwg.org/multipage/urls-and-fetching.html#create-a-potential-cors-request> (31 August 2018).
2196         This function replaces CachedResourceRequest::setAsPotentiallyCrossOrigin() and is the first step towards separating
2197         the concepts of CORS settings states and module script credentials mode as well as implementing the aforementioned
2198         algorithm. Rename CachedResourceRequest::setAsPotentiallyCrossOrigin() to deprecatedSetAsPotentiallyCrossOrigin()
2199         and switch existing callers to use createPotentialAccessControlRequest(). For now, createPotentialAccessControlRequest()
2200         is implemented in terms of deprecatedSetAsPotentiallyCrossOrigin().
2201
2202         No functionality changed. So, no new tests.
2203
2204         * bindings/js/CachedScriptFetcher.cpp:
2205         (WebCore::CachedScriptFetcher::requestScriptWithCache const): Write in terms of WebCore::createPotentialAccessControlRequest().
2206         * html/HTMLLinkElement.cpp:
2207         (WebCore::HTMLLinkElement::process): Ditto.
2208         * html/parser/HTMLResourcePreloader.cpp:
2209         (WebCore::PreloadRequest::resourceRequest): Ditto.
2210         * loader/CrossOriginAccessControl.cpp:
2211         (WebCore::createPotentialAccessControlRequest): For now, implemented in terms of CachedResourceRequest::deprecatedSetAsPotentiallyCrossOrigin().
2212         * loader/CrossOriginAccessControl.h:
2213         * loader/ImageLoader.cpp:
2214         (WebCore::ImageLoader::updateFromElement): Write in terms of WebCore::createPotentialAccessControlRequest().
2215         * loader/LinkLoader.cpp:
2216         (WebCore::LinkLoader::preloadIfNeeded): Ditto.
2217         * loader/MediaResourceLoader.cpp:
2218         (WebCore::MediaResourceLoader::requestResource): Ditto. Also renamed local variable cacheRequest to cachedRequest.
2219         * loader/TextTrackLoader.cpp:
2220         (WebCore::TextTrackLoader::load): Write in terms of WebCore::createPotentialAccessControlRequest(). Also change local variable
2221         document from a pointer to a reference since this function asserts that the script execution context is a non-null Document.
2222         * loader/cache/CachedResourceRequest.cpp:
2223         (WebCore::CachedResourceRequest::deprecatedSetAsPotentiallyCrossOrigin): Renamed; formerly named setAsPotentiallyCrossOrigin.
2224         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin): Deleted.
2225         * loader/cache/CachedResourceRequest.h:
2226         (WebCore::CachedResourceRequest::setPriority): Added.
2227
2228 2018-09-04  Daniel Bates  <dabates@apple.com>
2229
2230         Remove redundant inline text boxes for empty combined text
2231         https://bugs.webkit.org/show_bug.cgi?id=189119
2232
2233         Reviewed by Zalan Bujtas.
2234
2235         We should consider inline text boxes that have a combined text renderer (RenderCombineText)
2236         whose composed string is empty as "redundant" just as we do for inline text boxes that have
2237         a non-combined text renderer that have zero length so that we remove them. Such boxes are
2238         visibly empty and do not take up space visually. By removing them we reduce memory and make
2239         it easier to reason about the line box tree.
2240
2241         Currently RenderBlockFlow::computeBlockDirectionPositionsForLine() tests if an inline text
2242         box is empty by checking if it has a zero length (InlineTextBox::len()). However an inline
2243         text box associated with a RenderCombineText always has length 1 regardless of whether the
2244         composed string it represents is the empty string. Instead we should expose a way to check
2245         if an inline text box is visually empty and have RenderBlockFlow::computeBlockDirectionPositionsForLine()
2246         query the inline text box for this answer.
2247
2248         * rendering/InlineTextBox.cpp:
2249         (WebCore::InlineTextBox::hasTextContent const): Added. Returns whether an inline text box
2250         has text content. We do not need to consider hypenation since hypens are an embellishment (i.e.
2251         they are not part of the markup of the page).
2252         (WebCore::InlineTextBox::paint): Write in terms of hasTextContent().
2253         (WebCore::InlineTextBox::subdivideAndResolveStyle): Assert that WebCore::subdivide() always
2254         returns a non-empty list of subdivisions. A non-empty text box should always have at least
2255         one subdivision, say for the unmarked text. I left the existing conditonal (though marked
2256         it as UNLIKELY()) so as to be forgiving and avoid a bad user experience should WebCore::subdivide()
2257         return an empty vector in a non-debug build.
2258         * rendering/InlineTextBox.h:
2259         * rendering/RenderBlockLineLayout.cpp:
2260         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine): Write in terms of InlineTextBox::hasTextContent()
2261         so that we remove empty inline text boxes associated with combined text.
2262         * rendering/RenderText.cpp:
2263         (WebCore::RenderText::positionLineBox): Write in terms of InlineTextBox::hasTextContent().
2264
2265 2018-09-04  Zan Dobersek  <zdobersek@igalia.com> and Ms2ger  <Ms2ger@igalia.com>
2266
2267         Implement support for passing ImageBitmap to texImage2D/texSubImage2D
2268         https://bugs.webkit.org/show_bug.cgi?id=187584
2269
2270         Reviewed by Dean Jackson.
2271
2272         Test: fast/canvas/webgl/gl-teximage-imagebitmap.html
2273
2274         * html/canvas/WebGL2RenderingContext.h: Update union type definition.
2275         * html/canvas/WebGL2RenderingContext.idl: Update union type definition.
2276         * html/canvas/WebGLRenderingContext.idl: Update union type definition.
2277         * html/canvas/WebGLRenderingContextBase.cpp:
2278         (WebCore::WebGLRenderingContextBase::texSubImage2D): implement.
2279         (WebCore::WebGLRenderingContextBase::texImage2D): implement.
2280         * html/canvas/WebGLRenderingContextBase.h: Update union type definition; add to TexFuncValidationSourceType.
2281         * html/canvas/WebGLRenderingContextBase.idl: Remove unused union type definition.
2282
2283 2018-09-04  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2284
2285         [EME] Add the WebM initData support in ClearKey CDM
2286         https://bugs.webkit.org/show_bug.cgi?id=189240
2287
2288         Reviewed by Xabier Rodriguez-Calvar.
2289
2290         Add the "webm" initDataType support in ClearKey CDM.
2291         Read the WebM initData by following the W3C spec https://www.w3.org/TR/eme-initdata-webm/#common-system,
2292         and put it in JSON object format like is specified in https://www.w3.org/TR/encrypted-media/#clear-key-request-format.
2293
2294         Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-event-mse.html
2295                media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html
2296
2297         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2298         (WebCore::extractKeyIdFromWebMInitData):
2299         (WebCore::CDMPrivateClearKey::supportsInitDataType const):
2300         (WebCore::CDMPrivateClearKey::supportsInitData const):
2301         (WebCore::CDMInstanceClearKey::requestLicense):
2302
2303 2018-09-03  Andy Estes  <aestes@apple.com>
2304
2305         [Payment Request] Remove PaymentAddress.languageCode
2306         https://bugs.webkit.org/show_bug.cgi?id=189254
2307
2308         Reviewed by Sam Weinig.
2309
2310         PaymentAddress.languageCode is marked as "at risk" in the latest Payment Request Editor's
2311         Draft (30 August 2018). Firefox has already removed it, and Chrome is considering it.
2312
2313         There is some compatibility risk in removing this attribute, but considering we never
2314         populated it with a meaningful value, the risk seems very low. If we learn about
2315         compatibility problems, we can address them by evangelising or even reverting this change.
2316
2317         Updated existing tests.
2318
2319         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2320         (WebCore::convert):
2321         * Modules/paymentrequest/PaymentAddress.cpp:
2322         (WebCore::PaymentAddress::PaymentAddress):
2323         * Modules/paymentrequest/PaymentAddress.h:
2324         * Modules/paymentrequest/PaymentAddress.idl:
2325
2326 2018-09-03  Andy Estes  <aestes@apple.com>
2327
2328         [Payment Request] Add a stub for PaymentResponse.retry
2329         https://bugs.webkit.org/show_bug.cgi?id=189253
2330
2331         Reviewed by Sam Weinig.
2332
2333         Implemented the AddressErrors, PayerErrorFields, and PaymentValidationErrors dictionaries as
2334         defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
2335
2336         Also added a stub implementation of PaymentResponse.retry. This method will be implemented
2337         with tests in a follow-up patch.
2338
2339         * CMakeLists.txt:
2340         * DerivedSources.make:
2341         * Modules/paymentrequest/AddressErrors.h: Added.
2342         * Modules/paymentrequest/AddressErrors.idl: Added.
2343         * Modules/paymentrequest/PayerErrorFields.h: Added.
2344         * Modules/paymentrequest/PayerErrorFields.idl: Added.
2345         * Modules/paymentrequest/PaymentResponse.cpp:
2346         (WebCore::PaymentResponse::retry):
2347         * Modules/paymentrequest/PaymentResponse.h:
2348         * Modules/paymentrequest/PaymentResponse.idl:
2349         * Modules/paymentrequest/PaymentValidationErrors.h: Added.
2350         * Modules/paymentrequest/PaymentValidationErrors.idl: Added.
2351         * Sources.txt:
2352         * WebCore.xcodeproj/project.pbxproj:
2353
2354 2018-09-03  Andy Estes  <aestes@apple.com>
2355
2356         [Payment Request] MerchantValidationEvent should be enabled by the PaymentRequest setting
2357         https://bugs.webkit.org/show_bug.cgi?id=189250
2358
2359         Reviewed by Daniel Bates.
2360
2361         * Modules/paymentrequest/MerchantValidationEvent.idl:
2362
2363 2018-09-03  Youenn Fablet  <youenn@apple.com>
2364
2365         REGRESSION: Layout Test http/tests/security/bypassing-cors-checks-for-extension-urls.html is Flaky
2366         https://bugs.webkit.org/show_bug.cgi?id=187658
2367         <rdar://problem/42306442>
2368
2369         Reviewed by Alexey Proskuryakov.
2370
2371         Test is flaky as a previous test was setting the isRunningUserScripts state on the Page and it was never reset.
2372         This patch moves this state to the topDocument so that it will be reset for every navigation.
2373         Covered by existing test being no longer flaky.
2374
2375         * dom/Document.h:
2376         (WebCore::Document::setAsRunningUserScripts):
2377         (WebCore::Document::isRunningUserScripts const):
2378         * loader/DocumentThreadableLoader.cpp:
2379         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2380         * page/Frame.cpp:
2381         (WebCore::Frame::injectUserScriptImmediately):
2382         * page/Page.h:
2383         (WebCore::Page::setAsRunningUserScripts): Deleted.
2384         (WebCore::Page::isRunningUserScripts const): Deleted.
2385         * testing/Internals.cpp:
2386         (WebCore::Internals::setAsRunningUserScripts):
2387
2388 2018-09-03  Andy Estes  <aestes@apple.com>
2389
2390         [Payment Request] Implement the MerchantValidationEvent constructor
2391         https://bugs.webkit.org/show_bug.cgi?id=189235
2392
2393         Reviewed by Daniel Bates.
2394
2395         Implemented the constructor for MerchantValidationEvent as defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
2396
2397         Updated the payment-request web platform tests to include MerchantValidationEvent tests.
2398
2399         Tests: imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html
2400                imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html
2401                imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html
2402                imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html
2403                imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html
2404                imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html
2405
2406         * CMakeLists.txt:
2407         * DerivedSources.make:
2408         * Modules/paymentrequest/MerchantValidationEvent.cpp:
2409         (WebCore::MerchantValidationEvent::create):
2410         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
2411         (WebCore::MerchantValidationEvent::complete):
2412         * Modules/paymentrequest/MerchantValidationEvent.h:
2413         * Modules/paymentrequest/MerchantValidationEvent.idl:
2414         * Modules/paymentrequest/MerchantValidationEventInit.h: Added.
2415         * Modules/paymentrequest/MerchantValidationEventInit.idl: Added.
2416         * Modules/paymentrequest/PaymentRequest.idl:
2417         * Sources.txt:
2418         * WebCore.xcodeproj/project.pbxproj:
2419         * bindings/js/WebCoreBuiltinNames.h:
2420
2421 2018-09-03  Philippe Normand  <pnormand@igalia.com>
2422
2423         [GStreamer] elements registration clean-ups
2424         https://bugs.webkit.org/show_bug.cgi?id=189192
2425
2426         Reviewed by Xabier Rodriguez-Calvar.
2427
2428         Register all our elements from the base player class. This
2429         simplifies the MSE player by removing duplicated code.
2430
2431         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2432         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2433         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
2434         (WebCore::registerWebKitGStreamerElements): Deleted.
2435         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2436         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
2437         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
2438         (WebCore::mimeTypeCache):
2439         (WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Deleted.
2440         (WebCore::MediaPlayerPrivateGStreamerMSE::isAvailable): Deleted.
2441         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2442
2443 2018-09-02  Zalan Bujtas  <zalan@apple.com>
2444
2445         REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value()
2446         https://bugs.webkit.org/show_bug.cgi?id=189232
2447         <rdar://problem/43886373>
2448
2449         Reviewed by Brent Fulgham.
2450
2451         It's not guaranteed that RenderFlexibleBox::computeMainAxisExtentForChild() always returns with a valid value.
2452
2453         Test: fast/flexbox/crash-when-min-max-content-is-not-computed.html
2454
2455         * rendering/RenderFlexibleBox.cpp:
2456         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2457
2458 2018-09-01  Simon Fraser  <simon.fraser@apple.com>
2459
2460         Rename FilterEffectRenderer to CSSFilter
2461         https://bugs.webkit.org/show_bug.cgi?id=189223
2462
2463         Reviewed by Sam Weinig.
2464
2465         Filter was subclassed by SVGFilter for SVG, and FilterEffectRenderer for CSS,
2466         which was very confusing, especially when the code uses renderer() to get it.
2467         
2468         Rename FilterEffectRenderer to CSSFilter, and access via filter().
2469         
2470         Future cleanup will deal with FilterEffectRendererHelper.
2471
2472         * Sources.txt:
2473         * WebCore.xcodeproj/project.pbxproj:
2474         * css/CSSFilterImageValue.cpp:
2475         (WebCore::CSSFilterImageValue::image):
2476         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
2477         * platform/graphics/filters/Filter.h:
2478         (WebCore::Filter::isCSSFilter const):
2479         * rendering/CSSFilter.cpp: Copied from Source/WebCore/rendering/FilterEffectRenderer.cpp.
2480         (WebCore::endMatrixRow):
2481         (WebCore::lastMatrixRow):
2482         (WebCore::CSSFilter::create):
2483         (WebCore::CSSFilter::CSSFilter):
2484         (WebCore::m_sourceGraphic):
2485         (WebCore::CSSFilter::inputContext):
2486         (WebCore::CSSFilter::buildReferenceFilter):
2487         (WebCore::CSSFilter::build):
2488         (WebCore::CSSFilter::updateBackingStoreRect):
2489         (WebCore::CSSFilter::allocateBackingStoreIfNeeded):
2490         (WebCore::CSSFilter::clearIntermediateResults):
2491         (WebCore::CSSFilter::apply):
2492         (WebCore::CSSFilter::computeSourceImageRectForDirtyRect):
2493         (WebCore::CSSFilter::output const):
2494         (WebCore::CSSFilter::setSourceImageRect):
2495         (WebCore::CSSFilter::setMaxEffectRects):
2496         (WebCore::CSSFilter::outputRect const):
2497         * rendering/CSSFilter.h: Copied from Source/WebCore/rendering/FilterEffectRenderer.h.
2498         (isType):
2499         * rendering/FilterEffectRenderer.cpp:
2500         (WebCore::FilterEffectRendererHelper::prepareFilterEffect):
2501         (WebCore::FilterEffectRendererHelper::filterContext const):
2502         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
2503         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
2504         (WebCore::endMatrixRow): Deleted.
2505         (WebCore::lastMatrixRow): Deleted.
2506         (WebCore::FilterEffectRenderer::FilterEffectRenderer): Deleted.
2507         (WebCore::m_sourceGraphic): Deleted.
2508         (WebCore::FilterEffectRenderer::create): Deleted.
2509         (WebCore::FilterEffectRenderer::inputContext): Deleted.
2510         (WebCore::FilterEffectRenderer::buildReferenceFilter): Deleted.
2511         (WebCore::FilterEffectRenderer::build): Deleted.
2512         (WebCore::FilterEffectRenderer::updateBackingStoreRect): Deleted.
2513         (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Deleted.
2514         (WebCore::FilterEffectRenderer::clearIntermediateResults): Deleted.
2515         (WebCore::FilterEffectRenderer::apply): Deleted.
2516         (WebCore::FilterEffectRenderer::computeSourceImageRectForDirtyRect): Deleted.
2517         (WebCore::FilterEffectRenderer::output const): Deleted.
2518         (WebCore::FilterEffectRenderer::setMaxEffectRects): Deleted.
2519         (WebCore::FilterEffectRenderer::outputRect const): Deleted.
2520         * rendering/FilterEffectRenderer.h:
2521         (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper):
2522         (WebCore::FilterEffectRenderer::setSourceImageRect): Deleted.
2523         * rendering/RenderBlockFlow.cpp:
2524         * rendering/RenderFrame.cpp:
2525         * rendering/RenderImage.cpp:
2526         * rendering/RenderLayer.cpp:
2527         (WebCore::RenderLayer::requiresFullLayerImageForFilters const):
2528         (WebCore::RenderLayer::filter const):
2529         (WebCore::RenderLayer::filterPainter const):
2530         (WebCore::RenderLayer::setupFilters):
2531         (WebCore::RenderLayer::calculateClipRects const):
2532         (WebCore::RenderLayer::filterRenderer const): Deleted.
2533         * rendering/RenderLayer.h:
2534         * rendering/RenderLayerBacking.cpp:
2535         * rendering/RenderLayerFilterInfo.cpp:
2536         (WebCore::RenderLayer::FilterInfo::setFilter):
2537         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
2538         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
2539         (WebCore::RenderLayer::FilterInfo::setRenderer): Deleted.
2540         * rendering/RenderLayerFilterInfo.h:
2541         * rendering/updating/RenderTreeBuilderBlock.cpp:
2542
2543 2018-09-01  Darin Adler  <darin@apple.com>
2544
2545         [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently
2546         https://bugs.webkit.org/show_bug.cgi?id=189072
2547
2548         Reviewed by Dan Bernstein.
2549
2550         * platform/mac/WebCoreNSURLExtras.mm: Include CFNetworkSPI.h and remove a
2551         declaration of +[NSURLProtocol _protocolClassForRequest:].
2552
2553         * platform/network/mac/ResourceHandleMac.mm: Remove a declaration of
2554         -[NSURLConnection _initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:].
2555         (WebCore::ResourceHandle::createNSURLConnection): Add ignore of
2556         "-Wdeprecated-declarations" around use of the above method, since it
2557         is deprecated.
2558
2559 2018-09-01  Simon Fraser  <simon.fraser@apple.com>
2560
2561         Add some more filter logging
2562         https://bugs.webkit.org/show_bug.cgi?id=189221
2563
2564         Reviewed by Anders Carlsson.
2565
2566         Add logging in FilterEffect::apply() that shows all the filter rects, and logging
2567         that brackets the application of a whole filter chain, for both SVG and CSS filters.
2568
2569         * platform/graphics/filters/FilterEffect.cpp:
2570         (WebCore::FilterEffect::apply):
2571         * rendering/FilterEffectRenderer.cpp:
2572         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
2573         * rendering/svg/RenderSVGResourceFilter.cpp:
2574         (WebCore::RenderSVGResourceFilter::postApplyResource):
2575
2576 2018-08-31  Youenn Fablet  <youenn@apple.com>
2577
2578         Move stats gathering out of LibWebRTCMediaEndpoint
2579         https://bugs.webkit.org/show_bug.cgi?id=189180
2580
2581         Reviewed by Alejandro G. Castro.
2582
2583         Move stats gathering in LibWebRTCStatsCollector.
2584         Make sure that the lambda given to the collector is always called and destroyed from the main thread.
2585         This allows capturing the promise here instead of storing it into the peer connection backend.
2586         No change of behavior.
2587
2588         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2589         (WebCore::LibWebRTCMediaEndpoint::getStats):
2590         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2591         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2592         (WebCore::LibWebRTCPeerConnectionBackend::getStats):
2593         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
2594         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2595         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: Added.
2596         (WebCore::LibWebRTCStatsCollector::LibWebRTCStatsCollector):
2597         (WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
2598         (WebCore::fromStdString):
2599         (WebCore::fillRTCStats):
2600         (WebCore::fillRTCRTPStreamStats):
2601         (WebCore::fillInboundRTPStreamStats):
2602         (WebCore::fillOutboundRTPStreamStats):
2603         (WebCore::fillRTCMediaStreamTrackStats):
2604         (WebCore::fillRTCDataChannelStats):
2605         (WebCore::iceCandidatePairState):
2606         (WebCore::fillRTCIceCandidatePairStats):
2607         (WebCore::fillRTCCertificateStats):
2608         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
2609         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: Added.
2610         (WebCore::LibWebRTCStatsCollector::create):
2611         * WebCore.xcodeproj/project.pbxproj:
2612
2613 2018-08-31  Jer Noble  <jer.noble@apple.com>
2614
2615         Compile error in RealtimeOutgoingVideoSource.cpp; unused parameter in libwebrtc header
2616         https://bugs.webkit.org/show_bug.cgi?id=189203
2617
2618         Reviewed by Youenn Fablet.
2619
2620         If RealtimeOutgoingVideoSource.cpp is compiled alone (non-unified) or if it is the first file compiled in
2621         a unified build, there is no pragma set to ignore unused parameter warnings in place.
2622
2623         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2624
2625 2018-08-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2626
2627         [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
2628         https://bugs.webkit.org/show_bug.cgi?id=189054
2629         <rdar://problem/43819779>
2630
2631         Reviewed by Tim Horton.
2632
2633         Remove redundant and unnecessary logic for reading from the pasteboard on iOS.
2634
2635         * platform/PlatformPasteboard.h:
2636         * platform/ios/PlatformPasteboardIOS.mm:
2637         (WebCore::PlatformPasteboard::stringForType const):
2638
2639         This currently grabs a string corresponding to the given type from the first item in the pasteboard. Make
2640         stringForType instead call readString with pasteboard item index 0.
2641
2642         (WebCore::PlatformPasteboard::count const):
2643         (WebCore::PlatformPasteboard::readBuffer const):
2644         (WebCore::PlatformPasteboard::readString const):
2645
2646         Make readString with "public.url" call readURL.
2647
2648         (WebCore::PlatformPasteboard::readURL const):
2649
2650         Remove logic for reading URLs from the pasteboard as property lists deserialized from properly lists. This was
2651         added in r223195 due to fix a case "when UIPasteboard serializes NSURL as a plist" when grabbing pasteboard data
2652         using -valuesForPasteboardType:inItemSet:. However, this case only arises in non-UI applications (i.e. when
2653         UIApplicationInitialize() has not been invoked); this is currently exercised by the test CopyURL.ValidURL, but
2654         doesn't really correspond to a real-world use case, since all UI applications where a user would be able to
2655         paste in a web view already invoke UIApplicationInitialize().
2656
2657         Instead of handling the case where the pasteboard contains a property list that has not been coerced to an
2658         NSURL, simply remove the code from PlatformPasteboard::readURL and allow UIKit to perform the coercion when
2659         running the test.
2660
2661         (WebCore::PlatformPasteboard::count): Deleted.
2662         (WebCore::PlatformPasteboard::readBuffer): Deleted.
2663         (WebCore::PlatformPasteboard::readString): Deleted.
2664         (WebCore::PlatformPasteboard::readURL): Deleted.
2665
2666         Mark these functions as `const`.
2667
2668         * platform/wpe/PlatformPasteboardWPE.cpp:
2669         (WebCore::PlatformPasteboard::readString const):
2670         (WebCore::PlatformPasteboard::readString): Deleted.
2671
2672         Mark this function as const.
2673
2674 2018-08-31  Jer Noble  <jer.noble@apple.com>
2675
2676         Compilation error in FormData.cpp: incomplete type 'WebCore::SharedBuffer'
2677         https://bugs.webkit.org/show_bug.cgi?id=189207
2678
2679         Reviewed by Youenn Fablet.
2680
2681         If FormData.cpp is compiled alone (non-unified) or if it is the first file compiled in
2682         a unified build, SharedBuffer.h is not included.
2683
2684         * platform/network/FormData.cpp:
2685
2686 2018-08-31  Chris Dumez  <cdumez@apple.com>
2687
2688         [ WK2 ] http/tests/workers/service/client-*-page-cache.html LayoutTests are flaky
2689         https://bugs.webkit.org/show_bug.cgi?id=183705
2690         <rdar://problem/42440606>
2691
2692         Reviewed by Youenn Fablet.
2693
2694         Add internals.serviceWorkerClientIdentifier() utility function so that a layout test can get the
2695         service worker client identifier of a document.
2696
2697         * testing/Internals.cpp:
2698         (WebCore::Internals::serviceWorkerClientIdentifier const):
2699         * testing/Internals.h:
2700         * testing/Internals.idl:
2701
2702 2018-08-31  John Wilander  <wilander@apple.com>
2703
2704         Storage Access API: Maintain access through same-site navigations
2705         https://bugs.webkit.org/show_bug.cgi?id=188564
2706         <rdar://problem/43445160>
2707
2708         Reviewed by Alex Christensen.
2709
2710         Tests: http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html
2711                http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html
2712
2713         * dom/Document.h:
2714             Removed unused member variable m_hasFrameSpecificStorageAccess.
2715         * loader/DocumentLoader.cpp:
2716         (WebCore::DocumentLoader::willSendRequest):
2717         * loader/FrameLoaderClient.h:
2718
2719 2018-08-31  Youenn Fablet  <youenn@apple.com>
2720
2721         WebAudioBufferList.cpp/.h is named as cocoa/WebAudioBufferList.cpp/.h
2722         https://bugs.webkit.org/show_bug.cgi?id=189160
2723
2724         Reviewed by Jer Noble.
2725
2726         Add WebAudioBufferList.cpp to unified build.
2727         Update XCode project so that the file names are right.
2728         No change of behavior.
2729
2730         * PlatformMac.cmake:
2731         * SourcesCocoa.txt:
2732         * WebCore.xcodeproj/project.pbxproj:
2733
2734 2018-08-31  Chris Dumez  <cdumez@apple.com>
2735
2736         Assertion hit in ~CompletionHandler() from ~WebFrame()
2737         https://bugs.webkit.org/show_bug.cgi?id=189199
2738         <rdar://problem/42657233>
2739
2740         Reviewed by Youenn Fablet.
2741
2742         The issue was caused by WebFrame::m_willSubmitFormCompletionHandlers implicitly containing
2743         CompletionHandlers (wrapped in WTF::Functions) and not calling them upon WebFrame
2744         destruction.
2745
2746         No new tests, covered by fast/frames/iframe-target.html.
2747
2748         * loader/EmptyClients.cpp:
2749         (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm):
2750         * loader/EmptyFrameLoaderClient.h:
2751         * loader/FrameLoaderClient.h:
2752
2753 2018-08-31  Zalan Bujtas  <zalan@apple.com>
2754
2755         [LFC] Add margin box verification back now that Display::Box has non-computed horizontal margin.
2756         https://bugs.webkit.org/show_bug.cgi?id=189193
2757
2758         Reviewed by Antti Koivisto.
2759
2760         Use the non-computed margin values to verify correctness.
2761         This patch also fixes a margin collapsing issue when the inflow box has a float sibling. The float
2762         sibling does not prevent collapsing with the parent's top/bottom margin.
2763
2764         Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html
2765
2766         * layout/Verification.cpp:
2767         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2768         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
2769         * layout/blockformatting/BlockMarginCollapse.cpp:
2770         (WebCore::Layout::isMarginTopCollapsedWithParent):
2771         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
2772
2773 2018-08-31  Antti Koivisto  <antti@apple.com>
2774
2775         Replace OptionSet |= and -= operators with add() and remove() functions
2776         https://bugs.webkit.org/show_bug.cgi?id=189169
2777
2778         Reviewed by Anders Carlsson.
2779
2780         * accessibility/AccessibilityObject.cpp:
2781         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
2782         * css/StyleBuilderConverter.h:
2783         (WebCore::StyleBuilderConverter::convertTextDecoration):
2784         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
2785         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
2786         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
2787         (WebCore::StyleBuilderConverter::convertSpeakAs):
2788         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
2789         * css/parser/CSSParser.cpp:
2790         (WebCore::CSSParser::parseSystemColor):
2791         * dom/Document.cpp:
2792         (WebCore::Document::styleColorOptions const):
2793         * dom/DocumentMarkerController.cpp:
2794         (WebCore::DocumentMarkerController::addMarker):
2795         (WebCore::DocumentMarkerController::removeMarkers):
2796         * dom/ScriptedAnimationController.cpp:
2797         (WebCore::ScriptedAnimationController::addThrottlingReason):
2798         (WebCore::ScriptedAnimationController::removeThrottlingReason):
2799         * dom/SecurityContext.h:
2800         (WebCore::SecurityContext::setFoundMixedContent):
2801         * dom/UIEventWithKeyState.cpp:
2802         (WebCore::UIEventWithKeyState::modifiersFromInitializer):
2803         (WebCore::UIEventWithKeyState::setModifierKeys):
2804         * dom/UserActionElementSet.cpp:
2805         (WebCore::UserActionElementSet::setFlags):
2806         * editing/CompositeEditCommand.cpp:
2807         (WebCore::CompositeEditCommand::moveParagraphs):
2808         * editing/Editor.cpp:
2809         (WebCore::Editor::replaceSelectionWithFragment):
2810         (WebCore::Editor::appliedEditing):
2811         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2812         (WebCore::Editor::markMisspellingsAndBadGrammar):
2813         (WebCore::Editor::resolveTextCheckingTypeMask):
2814         * editing/FrameSelection.cpp:
2815         (WebCore::FrameSelection::moveWithoutValidationTo):
2816         (WebCore::FrameSelection::setSelectedRange):
2817         * editing/FrameSelection.h:
2818         (WebCore::FrameSelection::defaultSetSelectionOptions):
2819         * editing/MoveSelectionCommand.cpp:
2820         (WebCore::MoveSelectionCommand::doApply):
2821         * editing/SpellChecker.cpp:
2822         (WebCore::SpellChecker::didCheckSucceed):
2823         * editing/TextCheckingHelper.cpp:
2824         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2825         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
2826         * editing/TextIterator.cpp:
2827         (WebCore::SearchBuffer::SearchBuffer):
2828         * html/HTMLAnchorElement.cpp:
2829         (WebCore::HTMLAnchorElement::parseAttribute):
2830         * inspector/agents/InspectorPageAgent.cpp:
2831         (WebCore::InspectorPageAgent::reload):
2832         * page/ContextMenuController.cpp:
2833         (WebCore::ContextMenuController::contextMenuItemSelected):
2834         * page/DOMWindow.cpp:
2835         (WebCore::DOMWindow::find const):
2836         * page/DragController.cpp:
2837         (WebCore::DragController::concludeEditDrag):
2838         * page/FrameSnapshotting.cpp:
2839         (WebCore::snapshotFrameRectWithClip):
2840         * page/FrameView.cpp:
2841         (WebCore::updateLayerPositionFlags):
2842         (WebCore::FrameView::willPaintContents):
2843         * page/Page.cpp:
2844         (WebCore::Page::setIsVisible):
2845         * page/PerformanceObserver.cpp:
2846         (WebCore::PerformanceObserver::observe):
2847         * page/TextIndicator.cpp:
2848         (WebCore::TextIndicator::createWithRange):
2849         * page/WindowFeatures.cpp:
2850         (WebCore::parseDisabledAdaptations):
2851         * page/csp/ContentSecurityPolicy.h:
2852         (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts):
2853         (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets):
2854         * page/csp/ContentSecurityPolicySourceList.cpp:
2855         (WebCore::ContentSecurityPolicySourceList::parseHashSource):
2856         * platform/PlatformEvent.h:
2857         (WebCore::PlatformEvent::PlatformEvent):
2858         * platform/ios/PlatformEventFactoryIOS.mm:
2859         (WebCore::modifiersForEvent):
2860         * platform/mac/PlatformEventFactoryMac.mm:
2861         (WebCore::modifiersForEvent):
2862         * rendering/RenderLayer.cpp:
2863         (WebCore::RenderLayer::updateLayerPositions):
2864         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
2865         (WebCore::RenderLayer::paintLayer):
2866         (WebCore::RenderLayer::paintLayerContentsAndReflection):
2867         (WebCore::RenderLayer::paintLayerContents):
2868         (WebCore::RenderLayer::paintForegroundForFragments):
2869         * rendering/RenderLayerBacking.cpp:
2870         (WebCore::RenderLayerBacking::paintIntoLayer):
2871         (WebCore::RenderLayerBacking::paintContents):
2872         * rendering/RenderLayerCompositor.cpp:
2873         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2874         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
2875         * rendering/TextDecorationPainter.cpp:
2876         (WebCore::collectStylesForRenderer):
2877         * rendering/TextPaintStyle.cpp:
2878         (WebCore::computeTextPaintStyle):
2879         * rendering/style/RenderStyle.cpp:
2880         (WebCore::RenderStyle::changeRequiresLayout const):
2881         (WebCore::RenderStyle::changeRequiresLayerRepaint const):
2882         (WebCore::RenderStyle::changeRequiresRepaint const):
2883         * testing/Internals.cpp:
2884         (WebCore::parseFindOptions):
2885         (WebCore::Internals::forceReload):
2886         (WebCore::Internals::setPageVisibility):
2887         (WebCore::Internals::setPageIsFocusedAndActive):
2888
2889 2018-08-31  Aditya Keerthi  <akeerthi@apple.com>
2890
2891         [Datalist][iOS] Add suggestions UI for TextFieldInputTypes
2892         https://bugs.webkit.org/show_bug.cgi?id=186714
2893
2894         Reviewed by Wenson Hsieh.
2895
2896         On iOS, the datalist button should appear as a downward triangle. Furthermore, the
2897         button should only be displayed if the input has focus and there are suggested
2898         values.
2899
2900         * css/html.css:
2901         (input::-webkit-list-button): Draw the triangle using an SVG.
2902         * html/DataListSuggestionInformation.h:
2903         * html/HTMLInputElement.h:
2904         * html/TextFieldInputType.cpp: Added logic to show and hide the datalist button as necessary.
2905         (WebCore::TextFieldInputType::handleFocusEvent):
2906         (WebCore::TextFieldInputType::handleBlurEvent):
2907         (WebCore::TextFieldInputType::didSetValueByUserEdit):
2908         (WebCore::TextFieldInputType::listAttributeTargetChanged):
2909         (WebCore::TextFieldInputType::displaySuggestions):
2910
2911 2018-08-31  Youenn Fablet  <youenn@apple.com>
2912
2913         Move LibWebRTCMediaEndpoint data channel code to LibWebRTCDataChannelHandler
2914         https://bugs.webkit.org/show_bug.cgi?id=189182
2915
2916         Reviewed by Alejandro G. Castro.
2917
2918         Moving data channel code outside of LibWebRTCMediaEndpoint.
2919         This will allow future development to support unified plan.
2920         No change of behavior.
2921
2922         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
2923         (WebCore::LibWebRTCDataChannelHandler::fromRTCDataChannelInit):
2924         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
2925         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
2926         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2927         (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
2928         (WebCore::LibWebRTCMediaEndpoint::OnDataChannel):
2929         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2930
2931 2018-08-31  Youenn Fablet  <youenn@apple.com>
2932
2933         Move session observers outside LibWebRTCMediaEndpoint
2934         https://bugs.webkit.org/show_bug.cgi?id=189181
2935
2936         Reviewed by Alejandro G. Castro.
2937
2938         Move classes of LibWebRTCMediaEndpoint to a separate file.
2939         No change of behavior.
2940
2941         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2942         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: Added.
2943         * WebCore.xcodeproj/project.pbxproj:
2944
2945 2018-08-31  Eric Carlson  <eric.carlson@apple.com>
2946
2947         [MediaStream] Remove AVMediaCaptureSource
2948         https://bugs.webkit.org/show_bug.cgi?id=189159
2949
2950         Reviewed by Youenn Fablet.
2951
2952         No new tests, no change in functionality.
2953
2954         Refactor video capture to get rid of a base class we don't 
2955         need any more.
2956
2957         * WebCore.xcodeproj/project.pbxproj:
2958         * platform/mediastream/mac/AVMediaCaptureSource.h: Removed.
2959         * platform/mediastream/mac/AVMediaCaptureSource.mm: Removed.
2960         * platform/mediastream/mac/AVVideoCaptureSource.h:
2961         (WebCore::AVVideoCaptureSource::session const):
2962         (WebCore::AVVideoCaptureSource::device const):
2963         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2964         (WebCore::globaVideoCaptureSerialQueue):
2965         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
2966         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
2967         (WebCore::AVVideoCaptureSource::startProducingData):
2968         (WebCore::AVVideoCaptureSource::stopProducingData):
2969         (WebCore::AVVideoCaptureSource::beginConfiguration):
2970         (WebCore::AVVideoCaptureSource::commitConfiguration):
2971         (WebCore::AVVideoCaptureSource::settingsDidChange):
2972         (WebCore::AVVideoCaptureSource::settings const):
2973         (WebCore::AVVideoCaptureSource::capabilities const):
2974         (WebCore::AVVideoCaptureSource::setPreset):
2975         (WebCore::AVVideoCaptureSource::setupSession):
2976         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2977         (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
2978         (WebCore::AVVideoCaptureSource::interrupted const):
2979         (WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
2980         (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
2981         (WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
2982         (-[WebCoreAVVideoCaptureSourceObserver initWithCallback:]):
2983         (-[WebCoreAVVideoCaptureSourceObserver disconnect]):
2984         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
2985         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
2986         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
2987         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
2988         (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
2989         (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
2990         (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
2991         (WebCore::AVVideoCaptureSource::initializeCapabilities): Deleted.
2992         (WebCore::AVVideoCaptureSource::initializeSupportedConstraints): Deleted.
2993         (WebCore::AVVideoCaptureSource::updateSettings): Deleted.
2994
2995 2018-08-31  Philippe Normand  <pnormand@igalia.com>
2996
2997         Unreviewed, GTK Ubuntu LTS build fix after r235543.
2998
2999         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3000
3001 2018-08-31  Philippe Normand  <pnormand@igalia.com>
3002
3003         Unreviewed, fix compilation warning in EME GStreamer backend.
3004
3005         Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:1293:19:
3006         warning: format ‘%lu’ expects argument of type ‘long unsigned
3007         int’, but argument 9 has type ‘unsigned int’ [-Wformat=]
3008
3009         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3010         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
3011
3012 2018-08-31  Philippe Normand  <philn@igalia.com>
3013
3014         [GStreamer][GL] useless ifdef in pushTextureToCompositor
3015         https://bugs.webkit.org/show_bug.cgi?id=188552
3016
3017         Reviewed by Xabier Rodriguez-Calvar.
3018
3019         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3020         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
3021         There's no need for an ifdef because the frame holder already
3022         ensures a valid texture ID will be set if it maps a GL video frame.
3023
3024 2018-08-31  David Kilzer  <ddkilzer@apple.com>
3025
3026         REGRESSION (r235190): Fix name of WebAudioBufferList.{cpp,h} in Xcode project
3027
3028         * WebCore.xcodeproj/project.pbxproj:
3029         - Add the 'name' parameter to the file references, then fix the
3030           visual name everywhere else, so these files don't appear as
3031           "cocoa/WebAudioBufferList.{cpp,h}" in the project.
3032
3033 2018-08-31  Frederic Wang  <fwang@igalia.com>
3034
3035         Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement
3036         https://bugs.webkit.org/show_bug.cgi?id=182053
3037
3038         Reviewed by Simon Fraser.
3039
3040         This commit introduces a new CSSOMViewScrollingAPIEnabled flag that will be used to implement
3041         the standard behavior of DOM scroll* API as specified by the CSSOM View spec (see bug 5991).
3042         It changes the behavior of document.scrollingElement so that it follows the spec when the
3043         flag is enabled. This will allow to pass the WPT test cssom-view/scrollingElement.html when
3044         it becomes the default behavior. WPT tests cssom-view/scrollingElement-quirks-dynamic*.html
3045         still fail; comparing with Chromium's code, we might need to propagate the style of <html>
3046         and <body> to the viewport element. Behaviors for other scrolling attributes will be changed
3047         in follow-up bugs.
3048
3049         Tests: fast/dom/Document/scrollingElement-quirks-mode.html
3050                fast/dom/Document/scrollingElement-standard-mode.html
3051
3052         * dom/Document.cpp:
3053         (WebCore::Document::isBodyPotentiallyScrollable): Helper function to verify whether the body
3054         is potentially scrollable, as defined by the CSSOM View spec. It seems that
3055         RenderObject::hasOverflowClip() may return incorrect value at this point and we might need
3056         to do something similar to Chromium's style propagation to make it work. For now, we just
3057         use the computed style. See bug 182292.
3058         (WebCore::Document::scrollingElement): When CSSOMViewScrollingAPIEnabled is enabled, we
3059         implement the algorithm of the CSSOM View spec.
3060         (WebCore::Document::body const): Verify that the root is actually a <html> element or
3061         otherwise return null. This is required by the CSSOM View spec and for WPT test
3062         scrollingElement.html. It is consistent  with bodyOrFrameset().
3063         * dom/Document.h: Add spec references for body() and bodyOrFrameset() and declare
3064         isBodyPotentiallyScrollable().
3065         * page/Settings.yaml: Add developer option for enabling the CSSOM View behavior.
3066         * rendering/style/RenderStyle.h:
3067         (WebCore::RenderStyle::isOverflowVisible const): Add helper function to check whether the
3068         style implies visible overflow.
3069
3070 2018-08-30  Zalan Bujtas  <zalan@apple.com>
3071
3072         CounterMaps should hold a unique_ptr of CounterMap.
3073         https://bugs.webkit.org/show_bug.cgi?id=189174
3074         <rdar://problem/43686458>
3075
3076         Reviewed by Ryosuke Niwa.
3077
3078         In certain cases calls to CounterMaps might lead to unexpected deletion of the CounterMap object.
3079
3080         Test: fast/css/counters/crash-when-cloning-body.html
3081
3082         * rendering/RenderCounter.cpp:
3083         (WebCore::makeCounterNode):
3084         (WebCore::destroyCounterNodeWithoutMapRemoval):
3085         (WebCore::RenderCounter::destroyCounterNodes):
3086         (WebCore::RenderCounter::destroyCounterNode):
3087         (WebCore::updateCounters):
3088         (showCounterRendererTree):
3089
3090 2018-08-30  Ross Kirsling  <ross.kirsling@sony.com>
3091
3092         Speculative build fix for WPE after r235531.
3093
3094         * platform/graphics/filters/PointLightSource.cpp:
3095         Add missing include.
3096
3097 2018-08-30  Ryosuke Niwa  <rniwa@webkit.org>
3098
3099         Add assignedElements to HTMLSlotElement
3100         https://bugs.webkit.org/show_bug.cgi?id=189146
3101
3102         Reviewed by Darin Adler.
3103
3104         Added assignedElements to HTMLSlotElement. For now, we simply filter the results returned by assignedNodes.
3105
3106         Also fixed a bug that assignedNodes was returning the fallback content when the slot is not in a shadow tree,
3107         which is specified in step 2 of the concept to find flattened slotables for a slot.
3108
3109         Spec: https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignedelements
3110               https://dom.spec.whatwg.org/#find-flattened-slotables
3111
3112         Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html
3113                imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html
3114
3115         * html/HTMLSlotElement.cpp:
3116         (WebCore::flattenAssignedNodes): Updated to take Vector<Ref<Node>> for consistency.
3117         (WebCore::HTMLSlotElement::assignedNodes const): Ditto.
3118         (WebCore::HTMLSlotElement::assignedElements const):
3119         * html/HTMLSlotElement.h:
3120         * html/HTMLSlotElement.idl:
3121
3122 2018-08-30  Don Olmstead  <don.olmstead@sony.com>
3123
3124         [CMake] Replace AVFoundationSupport.py using CMake
3125         https://bugs.webkit.org/show_bug.cgi?id=182891
3126
3127         Reviewed by Per Arne Vollan.
3128
3129         No new tests. No change in behavior.
3130
3131         Remove refernces to PAL derived sources.
3132
3133         * PlatformWin.cmake:
3134         * config.h:
3135
3136 2018-08-30  Olivia Barnett  <obarnett@apple.com>
3137
3138         REGRESSION(r235489): fast/dom/navigator-detached-no-crash.html crashes under Navigator::share
3139         https://bugs.webkit.org/show_bug.cgi?id=189170
3140
3141         Reviewed by Tim Horton.
3142
3143         No new tests; fixing a failing existing test.
3144
3145         * page/Navigator.cpp:
3146         (WebCore::Navigator::share):
3147         Added null check for frame.
3148
3149 2018-08-30  Truitt Savell  <tsavell@apple.com>
3150
3151         Unreviewed, rolling out r235516.
3152
3153         Caused 50 Crashes on Sierra
3154
3155         Reverted changeset:
3156
3157         "The width of a nullptr TextRun should be zero"
3158         https://bugs.webkit.org/show_bug.cgi?id=189154
3159         https://trac.webkit.org/changeset/235516
3160
3161 2018-08-30  Tim Horton  <timothy_horton@apple.com>
3162
3163         Bundle unified sources more tightly in projects with deep directory structures
3164         https://bugs.webkit.org/show_bug.cgi?id=189009
3165
3166         Reviewed by Simon Fraser.
3167
3168         Fix a variety of unification errors due to reshuffling the bundles.
3169
3170         * Modules/mediastream/RTCController.cpp:
3171         * SourcesCocoa.txt:
3172         * WebCore.xcodeproj/project.pbxproj:
3173         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
3174         (WebCore::CryptoAlgorithmECDSA::importKey):
3175         * dom/Document.h:
3176         * html/parser/HTMLTreeBuilder.cpp:
3177         * loader/appcache/ApplicationCacheResourceLoader.h:
3178         * page/AlternativeTextClient.h:
3179         * platform/Pasteboard.h:
3180         * platform/graphics/DisplayRefreshMonitor.cpp:
3181         * platform/graphics/FontFamilySpecificationNull.cpp:
3182         * platform/graphics/cocoa/WebGLLayer.mm:
3183         (-[WebGLLayer initWithGraphicsContext3D:]):
3184         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
3185         (-[WebGLLayer display]):
3186         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
3187         * platform/graphics/cocoa/WebGPULayer.mm:
3188         (-[WebGPULayer initWithGPUDevice:]):
3189         * platform/graphics/metal/GPUCommandQueueMetal.mm:
3190         * platform/mac/PasteboardMac.mm:
3191         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
3192         * platform/network/ResourceRequestBase.cpp:
3193         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
3194         * rendering/updating/RenderTreeBuilderInline.cpp:
3195
3196 2018-08-30  Andy Estes  <aestes@apple.com>
3197
3198         [Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEventInit interfaces
3199         https://bugs.webkit.org/show_bug.cgi?id=189100
3200
3201         Reviewed by Daniel Bates.
3202
3203         Implement the PaymentMethodChangeEvent interface and PaymentMethodChangeEventInit dictionary
3204         defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
3205
3206         <https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>
3207
3208         The "payment method changed" algorithm will be implemented in a follow-up.
3209
3210         Covered by existing web platform tests.
3211
3212         * CMakeLists.txt:
3213         * DerivedSources.make:
3214         * Modules/paymentrequest/PaymentMethodChangeEvent.cpp: Added.
3215         (WebCore::PaymentMethodChangeEvent::eventInterface const):
3216         (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
3217         * Modules/paymentrequest/PaymentMethodChangeEvent.h: Added.
3218         * Modules/paymentrequest/PaymentMethodChangeEvent.idl: Added.
3219         * Modules/paymentrequest/PaymentMethodChangeEventInit.h: Added.
3220         * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Added.
3221         * Modules/paymentrequest/PaymentRequest.idl:
3222         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
3223         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
3224         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
3225         * Modules/paymentrequest/PaymentRequestUpdateEventInit.h:
3226         * Sources.txt:
3227         * WebCore.xcodeproj/project.pbxproj:
3228         * bindings/js/WebCoreBuiltinNames.h:
3229         * dom/EventNames.h:
3230         * dom/EventNames.in:
3231
3232 2018-08-30  Brent Fulgham  <bfulgham@apple.com>
3233
3234         The width of a nullptr TextRun should be zero
3235         https://bugs.webkit.org/show_bug.cgi?id=189154
3236         <rdar://problem/43685926>
3237
3238         Reviewed by Zalan Bujtas.
3239
3240         If a page has an empty TextRun and attempts to paint it we can crash with a nullptr.
3241
3242         This patch recognizes that an empty TextRun should always produce a zero width, rather than
3243         attempt to compute this value from font data.
3244
3245         Test: fast/text/null-string-textrun.html
3246
3247         * platform/graphics/FontCascade.cpp:
3248         (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width.
3249         (WebCore::FontCascade::width const): Ditto.
3250         (WebCore::FontCascade::codePath const): ASSERT that the TextRun is non-empty.
3251
3252 2018-08-30  Eric Carlson  <eric.carlson@apple.com>
3253
3254         Mock video devices should only support discrete sizes
3255         https://bugs.webkit.org/show_bug.cgi?id=189000
3256         <rdar://problem/43766551>
3257
3258         Reviewed by Youenn Fablet.
3259         
3260         While many/most video capture devices only support a finite number of discrete width/height
3261         pairs, our mock video capture devices supported arbitrary width and height combinations which
3262         made it difficult to write realistic tests using them. Change the mock devices to support
3263         finite "presets" like those supported by AVFoundation. Create a RealtimeVideoSource base
3264         class with support for these presets, so the same code will eventually be used by the mock
3265         and real capture devices.
3266
3267         No new tests, existing tests updated for these changes.
3268
3269         * Sources.txt: Add RealtimeVideoSource.cpp, remove MockRealtimeMediaSource.cpp.
3270
3271         * WebCore.xcodeproj/project.pbxproj: Ditto.
3272
3273         * platform/mediastream/MediaConstraints.h: Deal with min constraint less than the supported minimum
3274         and max larger than the supported maximum when there is no ideal.
3275
3276         * platform/mediastream/RealtimeMediaSource.cpp:
3277         (WebCore::RealtimeMediaSource::selectSettings): Use supportsSizeAndFrameRate for widths,
3278         heights, and framerates in advanced constraints so a width and height that are supported but
3279         in the same preset are filtered out.
3280         (WebCore::RealtimeMediaSource::setSize): New.
3281         * platform/mediastream/RealtimeMediaSource.h:
3282
3283         * platform/mediastream/RealtimeMediaSourceSettings.h: Remove an unneeded include.
3284
3285         * platform/mediastream/RealtimeVideoSource.cpp: Added.
3286         (WebCore::RealtimeVideoSource::RealtimeVideoSource):
3287         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
3288         (WebCore::RealtimeVideoSource::startProducingData):
3289         (WebCore::RealtimeVideoSource::setSupportedFrameRates):
3290         (WebCore::RealtimeVideoSource::addSupportedCapabilities const):
3291         (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate):
3292         (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight):
3293         (WebCore::RealtimeVideoSource::applySize):
3294         (WebCore::RealtimeVideoSource::applySizeAndFrameRate):
3295         (WebCore::RealtimeVideoSource::videoSampleAvailable):
3296         (WebCore::RealtimeVideoSource::applyFrameRate):
3297         (WebCore::RealtimeVideoSource::supportsFrameRate):
3298
3299         * platform/mediastream/RealtimeVideoSource.h: Copied from Source/WebCore/platform/mock/MockRealtimeAudioSource.h.
3300         (WebCore::RealtimeVideoSource::setSupportedCaptureSizes):
3301         (WebCore::RealtimeVideoSource::setDefaultSize):
3302         (WebCore::RealtimeVideoSource::observedFrameRate const):
3303
3304         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3305         (WebCore::AVMediaCaptureSource::initializeSettings): Don't set label, it isn't used.
3306
3307         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3308         (WebCore::MockRealtimeVideoSourceMac::applySize): Call the base class.
3309
3310         * platform/mock/MockMediaDevice.h:
3311         (WebCore::MockCameraProperties::encode const): Add frame rates, sizes, and facing mode.
3312         (WebCore::MockCameraProperties::decode): Ditto.
3313
3314         * platform/mock/MockRealtimeAudioSource.cpp:
3315         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): No more MockRealtimeMediaSource.
3316         (WebCore::MockRealtimeAudioSource::settings const): Clean up.
3317         (WebCore::MockRealtimeAudioSource::capabilities const): Ditto.
3318         (WebCore::MockRealtimeAudioSource::settingsDidChange): Ditto.
3319         (WebCore::MockRealtimeAudioSource::stopProducingData): m_elapsedTime isn't used, delete it.
3320         (WebCore::MockRealtimeAudioSource::updateSettings): Deleted.
3321         (WebCore::MockRealtimeAudioSource::initializeCapabilities): Deleted.
3322         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints): Deleted.
3323         (WebCore::MockRealtimeAudioSource::elapsedTime): Deleted.
3324         * platform/mock/MockRealtimeAudioSource.h:
3325
3326         * platform/mock/MockRealtimeMediaSourceCenter.cpp: Moved all of the mock device management
3327         code from MockRealtimeMediaSource.cpp here.
3328         (WebCore::defaultDevices):
3329         (WebCore::devices):
3330         (WebCore::deviceMap):
3331         (WebCore::deviceListForDevice):
3332         (WebCore::createCaptureDevice):
3333         (WebCore::MockRealtimeMediaSourceCenter::resetDevices):
3334         (WebCore::MockRealtimeMediaSourceCenter::setDevices):
3335         (WebCore::MockRealtimeMediaSourceCenter::addDevice):
3336         (WebCore::MockRealtimeMediaSourceCenter::removeDevice):
3337         (WebCore::MockRealtimeMediaSourceCenter::mockDeviceWithPersistentID):
3338         (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
3339         (WebCore::MockRealtimeMediaSourceCenter::audioDevices):
3340         (WebCore::MockRealtimeMediaSourceCenter::videoDevices):
3341         (WebCore::MockRealtimeMediaSourceCenter::displayDevices):
3342
3343         * platform/mock/MockRealtimeVideoSource.cpp:
3344         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Use RealtimeVideoSource, no
3345         more MockRealtimeMediaSource.
3346         (WebCore::MockRealtimeVideoSource::capabilities const): Ditto, cleanup.
3347         (WebCore::MockRealtimeVideoSource::settings const): Ditto.
3348         (WebCore::MockRealtimeVideoSource::settingsDidChange): Ditto.
3349         (WebCore::MockRealtimeVideoSource::startCaptureTimer): Ditto.
3350         (WebCore::MockRealtimeVideoSource::startProducingData): Ditto.
3351         (WebCore::MockRealtimeVideoSource::stopProducingData): Ditto.
3352         (WebCore::MockRealtimeVideoSource::elapsedTime): Ditto.
3353         (WebCore::MockRealtimeVideoSource::applySize): Ditto.
3354         (WebCore::MockRealtimeVideoSource::drawText): Render the actual frame rate.
3355         (WebCore::MockRealtimeVideoSource::generateFrame): Use m_fillColor.
3356         (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted.
3357         (WebCore::MockRealtimeVideoSource::updateSettings): Deleted.
3358         (WebCore::MockRealtimeVideoSource::initializeCapabilities): Deleted.
3359         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Deleted.
3360         (WebCore::MockRealtimeVideoSource::applyFrameRate): Deleted.
3361         * platform/mock/MockRealtimeVideoSource.h:
3362         (WebCore::MockRealtimeVideoSource::updateSampleBuffer): Deleted.
3363
3364 2018-08-30  Zalan Bujtas  <zalan@apple.com>
3365
3366         [LFC][Floating] Block formatting context roots avoid floats.
3367         https://bugs.webkit.org/show_bug.cgi?id=189150
3368
3369         Reviewed by Antti Koivisto.
3370
3371         This patch implements the float avoiding behaviour for block formatting context roots.
3372
3373         When a box establishes a block formatting context, floats from outside of the context can't interfere with content inside. In order
3374         to achive this, such formatting root boxes need to be positioned so that they don't overlap with floats (floats that share the same
3375         context with the formatting root). In ltr block direction, roots start with avoiding floats on the left, while in rtl on the right.
3376
3377         Tests: fast/block/block-only/float-avoider-multiple-roots.html
3378                fast/block/block-only/float-avoider-simple-left.html
3379                fast/block/block-only/float-avoider-simple-right.html
3380                fast/block/block-only/float-avoider-with-margins.html
3381
3382         * layout/blockformatting/BlockFormattingContext.cpp:
3383         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3384         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
3385         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
3386         * layout/blockformatting/BlockFormattingContext.h:
3387         * layout/floats/FloatAvoider.cpp:
3388         (WebCore::Layout::FloatAvoider::FloatAvoider):
3389         * layout/floats/FloatingContext.cpp:
3390         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
3391         * layout/floats/FloatingContext.h:
3392
3393 2018-08-30  Zalan Bujtas  <zalan@apple.com>
3394
3395         [LFC][Floating] Move containing block constraint logic from FloatAvoider to FloatingContext
3396         https://bugs.webkit.org/show_bug.cgi?id=189145
3397
3398         Reviewed by Antti Koivisto.
3399
3400         When the float avoider is constrained horizontally, simply align it with the left/right edge of its containing block (with the combination of the constraints)
3401         and check the overflow as part of the FloatingContext::floatingPosition() logic. It simplifies the constraint logic/helps implementing the non-float avoider
3402         case.
3403
3404         * layout/floats/FloatAvoider.cpp:
3405         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
3406         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
3407         * layout/floats/FloatAvoider.h:
3408         * layout/floats/FloatingContext.cpp:
3409         (WebCore::Layout::FloatingContext::floatingPosition const):
3410
3411 2018-08-30  Zalan Bujtas  <zalan@apple.com>
3412
3413         [LFC][Floating] Use non-computed horizontal margins when intersecting floats with float avoiders.
3414         https://bugs.webkit.org/show_bug.cgi?id=189143
3415
3416         Reviewed by Antti Koivisto.
3417
3418         * layout/Verification.cpp:
3419         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
3420         * layout/floats/FloatAvoider.cpp:
3421         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
3422         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
3423         * layout/floats/FloatAvoider.h:
3424         (WebCore::Layout::FloatAvoider::marginTop const):
3425         (WebCore::Layout::FloatAvoider::marginBottom const):
3426         (WebCore::Layout::FloatAvoider::marginLeft const):
3427         (WebCore::Layout::FloatAvoider::marginRight const):
3428         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
3429         * layout/floats/FloatBox.cpp:
3430         (WebCore::Layout::FloatBox::rect const):
3431         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
3432         (WebCore::Layout::FloatBox::verticalPositionCandidate):
3433         (WebCore::Layout::FloatBox::initialVerticalPosition const):
3434         * layout/floats/FloatBox.h:
3435
3436 2018-08-30  Zalan Bujtas  <zalan@apple.com>
3437
3438         [LFC][Margins] Add non-computed horizontal margins to DisplayBox
3439         https://bugs.webkit.org/show_bug.cgi?id=189141
3440
3441         Reviewed by Antti Koivisto.
3442
3443         Inflow block boxes' horizontal margins extend all the way to the left/right edge of their containing block.
3444         See https://www.w3.org/TR/CSS22/visudet.html#blockwidth for example
3445         "...
3446         10.3.3 Block-level, non-replaced elements in normal flow
3447         'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block
3448         ..."
3449
3450         In certain cases (float avoiding) we need to know the original (non-extended) horiztonal margin values.
3451
3452         * layout/FormattingContext.cpp:
3453         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
3454         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3455         * layout/FormattingContextGeometry.cpp:
3456         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3457         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3458         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3459         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3460         * layout/LayoutContext.cpp:
3461         (WebCore::Layout::LayoutContext::initializeRoot):
3462         * layout/LayoutUnits.h:
3463         * layout/blockformatting/BlockFormattingContext.cpp:
3464         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
3465         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3466         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3467         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
3468         * layout/displaytree/DisplayBox.h:
3469         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin):
3470         (WebCore::Display::Box::setHorizontalNonComputedMargin):
3471         (WebCore::Display::Box::nonComputedMarginLeft const):
3472         (WebCore::Display::Box::nonComputedMarginRight const):
3473
3474 2018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3475
3476         Unreviewed, add comments about enum names to bitfields
3477         https://bugs.webkit.org/show_bug.cgi?id=188944
3478
3479         * xml/XMLHttpRequest.h:
3480
3481 2018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3482
3483         Unreviewed, add comments about enum names to bitfields
3484         https://bugs.webkit.org/show_bug.cgi?id=188945
3485
3486         * html/HTMLCollection.h:
3487
3488 2018-08-29  Andy Estes  <aestes@apple.com>
3489
3490         Addressed additional review feedback after r235342.
3491
3492         * Modules/applepay/ApplePayRequestBase.cpp:
3493         (WebCore::convertAndValidate):
3494
3495         Used '"' instead of "\"" with makeString().
3496
3497 2018-08-29  Aditya Keerthi  <akeerthi@apple.com>
3498
3499         [Datalist] Display prefix-matched suggestions first
3500         https://bugs.webkit.org/show_bug.cgi?id=189106
3501
3502         Reviewed by Tim Horton.
3503
3504         In order to increase suggestion relevancy, we should display suggestions that have
3505         the same prefix as the input value first. In order to achieve this, we can place
3506         the suggestions into two buckets, one that contains prefix-matched values and
3507         another that contains only substring-matched values.
3508
3509         TextFieldInputType::suggestions() can be called up to three times before we
3510         display the values. In order to avoid generating the same suggestions multiple
3511         times, the most recent values can be stored and reused. We clear the cached values
3512         whenever the datalist element is modified or when the suggestions view is hidden.
3513
3514         Finally, removed logic to de-duplicate the list of suggested values. This behavior
3515         is not a part of the specification and leads to unnecessary slowdown when
3516         populating the suggestions view.
3517
3518         Test: fast/forms/datalist/datalist-textinput-suggestions-order.html
3519
3520         * html/TextFieldInputType.cpp:
3521         (WebCore::TextFieldInputType::listAttributeTargetChanged):
3522         (WebCore::TextFieldInputType::suggestions):
3523         (WebCore::TextFieldInputType::didCloseSuggestions):
3524         * html/TextFieldInputType.h:
3525         * platform/DataListSuggestionsClient.h:
3526
3527 2018-08-29  Olivia Barnett  <obarnett@apple.com>
3528
3529         Implement the Web Share API
3530         https://bugs.webkit.org/show_bug.cgi?id=171100
3531         <rdar://problem/31751734>
3532
3533         Reviewed by Tim Horton.
3534
3535         Added one test in fast/events/ios called share.html; adjusted expectations for existing tests.
3536
3537         * DerivedSources.make:
3538         * Sources.txt:
3539         * WebCore.xcodeproj/project.pbxproj:
3540         * features.json:
3541         * loader/EmptyClients.cpp:
3542         (WebCore::EmptyChromeClient::showShareSheet):
3543         * loader/EmptyClients.h:
3544         Added empty showShareSheet function.
3545
3546         * page/Chrome.cpp:
3547         (WebCore::Chrome::showShareSheet):
3548         * page/Chrome.h:
3549         Added call to showShareSheet on client.
3550
3551         * page/ChromeClient.h:
3552         Virtual showShareSheet function.
3553
3554         * page/Navigator.cpp:
3555         (WebCore::Navigator::share):
3556         * page/Navigator.h:
3557         Share function that returns a promise and invokes the share sheet.
3558
3559         * page/Navigator.idl:
3560         Implements NavigatorShare
3561
3562         * page/NavigatorShare.idl: Added.
3563         Added definition of share function returning a promise.
3564
3565         * page/RuntimeEnabledFeatures.h:
3566         (WebCore::RuntimeEnabledFeatures::setWebShareEnabled):
3567         (WebCore::RuntimeEnabledFeatures::webShareEnabled const):
3568         Added RuntimeEnabledFeature switch.
3569
3570         * page/ShareData.h: Added.
3571         * page/ShareData.idl: Added.
3572         Definition of ShareData struct.
3573
3574 2018-08-29  Daniel Bates  <dabates@apple.com>
3575
3576         REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany
3577         https://bugs.webkit.org/show_bug.cgi?id=184390
3578         <rdar://problem/41804994>
3579         And
3580         <rdar://problem/39771867>
3581
3582         Reviewed by Simon Fraser.
3583
3584         Speculative fix for Epiphany.
3585
3586         In theory, WebCore::subdivide() should never return an empty vector - no subdivisions - as such a
3587         result represents a programmer error. In practice, InlineTextBox can invoke WebCore::subdivide()
3588         such that it returns an empty vector. One way this can happen is when subdividing an empty inline
3589         text box associated with combined text (RenderCombineText). For now we add a check to bail out of
3590         resolving the style of subdivisions when WebCore::subdivide() returns no subdivisions. In a
3591         subsequent patch we will look to assert that WebCore::subdivide() always returns subdivisions.
3592
3593         Test: fast/text/text-combine-surroundContents-crash.html
3594
3595         * rendering/InlineTextBox.cpp:
3596         (WebCore::InlineTextBox::subdivideAndResolveStyle):
3597
3598 2018-08-29  Youenn Fablet  <youenn@apple.com>
3599
3600         Remove WebRTC legacy API implementation
3601         https://bugs.webkit.org/show_bug.cgi?id=189040
3602
3603         Reviewed by Eric Carlson.
3604
3605         This API is no longer needed as the runtime flag is off by default.
3606         Removing this option allows removing some code and will ease future WebRTC improvements.
3607         Covered by existing tests.
3608
3609         * CMakeLists.txt:
3610         * DerivedSources.make:
3611         * Modules/mediastream/MediaStreamEvent.cpp: Removed.
3612         * Modules/mediastream/MediaStreamEvent.h: Removed.
3613         * Modules/mediastream/MediaStreamEvent.idl: Removed.
3614         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
3615         * Modules/mediastream/NavigatorUserMedia.js: Removed.
3616         * Modules/mediastream/PeerConnectionBackend.cpp:
3617         * Modules/mediastream/PeerConnectionBackend.h:
3618         * Modules/mediastream/RTCPeerConnection.h:
3619         * Modules/mediastream/RTCPeerConnection.idl:
3620         * Modules/mediastream/RTCPeerConnection.js:
3621         (initializeRTCPeerConnection):
3622         (createOffer):
3623         (createAnswer):
3624         (setLocalDescription):
3625         (setRemoteDescription):
3626         (addIceCandidate):
3627         (getLocalStreams): Deleted.
3628         (getStreamById): Deleted.
3629         (addStream): Deleted.
3630         (): Deleted.
3631         * Modules/mediastream/RTCPeerConnectionInternals.js:
3632         (callbacksAndDictionaryOverload):
3633         (if): Deleted.
3634         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3635         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
3636         (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
3637         (WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
3638         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3639         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3640         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
3641         (WebCore::LibWebRTCPeerConnectionBackend::removeRemoteStream): Deleted.
3642         (WebCore::LibWebRTCPeerConnectionBackend::addRemoteStream): Deleted.
3643         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3644         * Sources.txt:
3645         * WebCore.xcodeproj/project.pbxproj:
3646         * bindings/js/JSDOMGlobalObject.cpp:
3647         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
3648         (WebCore::isWebRTCLegacyAPIEnabled): Deleted.
3649         * bindings/js/WebCoreBuiltinNames.h:
3650         * dom/EventNames.in:
3651         * page/RuntimeEnabledFeatures.h:
3652         (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
3653         (WebCore::RuntimeEnabledFeatures::webRTCLegacyAPIEnabled const): Deleted.
3654         (WebCore::RuntimeEnabledFeatures::setWebRTCLegacyAPIEnabled): Deleted.
3655
3656 2018-08-29  Ryosuke Niwa  <rniwa@webkit.org>
3657
3658         Modernize SlotAssignment
3659         https://bugs.webkit.org/show_bug.cgi?id=189075
3660
3661         Reviewed by Antti Koivisto.
3662
3663         Modernized the code related to SlotAssignment. Namely, use HashMap<>::get instead of HashMap<>::find,
3664         and use HashMap<>::ensure instead of HashMap<>::add. Also use WeakPtr to keep track of HTMLSlotElement
3665         instead of a raw pointer.
3666
3667         * dom/SlotAssignment.cpp:
3668         (WebCore::SlotAssignment::findAssignedSlot):
3669         (WebCore::SlotAssignment::addSlotElementByName):
3670         (WebCore::SlotAssignment::removeSlotElementByName):
3671         (WebCore::SlotAssignment::didChangeSlot):
3672         (WebCore::SlotAssignment::findFirstSlotElement):
3673         (WebCore::SlotAssignment::resolveAllSlotElements):
3674         (WebCore::SlotAssignment::assignToSlot):
3675         * dom/SlotAssignment.h:
3676         (WebCore::SlotAssignment::Slot::Slot): Renamed from SlotInfo since "Info" doesn't add any value.
3677         * html/HTMLSlotElement.h:
3678
3679 2018-08-29  Chris Dumez  <cdumez@apple.com>
3680
3681         [PSON] We should only process-swap when eTLD+1 changes on navigation
3682         https://bugs.webkit.org/show_bug.cgi?id=189090
3683         <rdar://problem/43799225>
3684
3685         Reviewed by Geoffrey Garen.
3686
3687         Add toRegistrableDomain() utility function to get the eTLD+1 (aka "registrable
3688         domain") from an URL.
3689
3690         * platform/network/ResourceRequestBase.h:
3691         (WebCore::toRegistrableDomain):
3692         (WebCore::registrableDomainsAreEqual):
3693
3694 2018-08-29  Youenn Fablet  <youenn@apple.com>
3695
3696         Add a runtime flag for WebRTC unified plan
3697         https://bugs.webkit.org/show_bug.cgi?id=189068
3698
3699         Reviewed by Eric Carlson.
3700
3701         Covered by existing updated tests.
3702         Main change is to call addTrack with a stream parameter so that on the other side, the track will be tied to a stream.
3703         Receive-only case in unified plan is not yet supported.
3704         This will be supported in follow-up patches.
3705
3706         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3707         (WebCore::LibWebRTCMediaEndpoint::setConfiguration): Activate unified plan based on runtime flag.
3708         (WebCore::LibWebRTCMediaEndpoint::addTrack): Do not use AddStream in case of unified plan.
3709         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const):
3710         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const):
3711         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): Use legacy webrtc option for receive only cases only in plan B case.
3712         * page/RuntimeEnabledFeatures.h:
3713         (WebCore::RuntimeEnabledFeatures::webRTCUnifiedPlanEnabled const):
3714         (WebCore::RuntimeEnabledFeatures::setWebRTCUnifiedPlanEnabled):
3715
3716 2018-08-28  Simon Fraser  <simon.fraser@apple.com>
3717
3718         Fix crash when reflections and backdrop filter are combined
3719         https://bugs.webkit.org/show_bug.cgi?id=188504
3720         rdar://problem/43225590
3721
3722         Reviewed by Dan Bates.
3723         
3724         GraphicsLayerCA::updateBackdropFiltersRect() was confused about which hash map to modify
3725         when changes to the clipping rect affect whether we make backdrop clipping layers;
3726         we need to add/remove from backdropClippingLayerClones, not backdropLayerClones.
3727
3728         Test: compositing/filters/backdrop-filter-update-rect.html
3729
3730         * platform/graphics/ca/GraphicsLayerCA.cpp:
3731         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
3732
3733 2018-08-29  Jer Noble  <jer.noble@apple.com>
3734
3735         Muted elements do not have their Now Playing status updated when unmuted.
3736         https://bugs.webkit.org/show_bug.cgi?id=189069
3737
3738         Reviewed by Eric Carlson.
3739
3740         Schedule an updateNowPlayingInfo() when an element becomes unmuted.
3741
3742         * platform/audio/PlatformMediaSessionManager.h:
3743         * platform/audio/mac/MediaSessionManagerMac.h:
3744         * platform/audio/mac/MediaSessionManagerMac.mm:
3745         (WebCore::MediaSessionManagerMac::sessionCanProduceAudioChanged):
3746
3747 2018-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3748
3749         Use the null string instead of std::nullopt for missing attachment file names and content types
3750         https://bugs.webkit.org/show_bug.cgi?id=189080
3751
3752         Reviewed by Tim Horton.
3753
3754         Replace instances of std::optional<String> with just String instead, and use the null string to represent a
3755         missing value instead of std::nullopt. No change in behavior.
3756
3757         * html/HTMLAttachmentElement.cpp:
3758         (WebCore::HTMLAttachmentElement::updateAttributes):
3759         * html/HTMLAttachmentElement.h:
3760
3761 2018-08-29  David Kilzer  <ddkilzer@apple.com>
3762
3763         Remove empty directories from from svn.webkit.org repository
3764         <https://webkit.org/b/189081>
3765
3766         * Modules/proximity: Removed.
3767
3768 2018-08-28  Zalan Bujtas  <zalan@apple.com>
3769
3770         [LFC][Floating] Introduce FloatBox, a FloatAvoider subclass.
3771         https://bugs.webkit.org/show_bug.cgi?id=189074
3772
3773         Reviewed by Antti Koivisto.
3774
3775         FloatBox is a float avoider and a float positioned box as well.
3776         This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.
3777
3778         * Sources.txt:
3779         * WebCore.xcodeproj/project.pbxproj:
3780         * layout/displaytree/DisplayBox.h:
3781         * layout/floats/FloatAvoider.cpp:
3782         (WebCore::Layout::FloatAvoider::FloatAvoider):
3783         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
3784         (WebCore::Layout::FloatAvoider::setVerticalConstraint):
3785         (WebCore::Layout::FloatAvoider::horizontalPositionCandidate):
3786         (WebCore::Layout::FloatAvoider::verticalPositionCandidate):
3787         (WebCore::Layout::FloatAvoider::resetPosition):
3788         (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
3789         (WebCore::Layout::FloatAvoider::initializePosition): Deleted.
3790         (WebCore::Layout::FloatAvoider::isLeftAligned const): Deleted.
3791         (WebCore::Layout::FloatAvoider::rect const): Deleted.
3792         (WebCore::Layout::FloatAvoider::resetHorizontalConstraints): Deleted.
3793         (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
3794         * layout/floats/FloatAvoider.h:
3795         (WebCore::Layout::FloatAvoider::rect const):
3796         (WebCore::Layout::FloatAvoider::isLeftAligned const):
3797         (WebCore::Layout::FloatAvoider::initialVerticalPosition const):
3798         (WebCore::Layout::FloatAvoider::floatingState const):
3799         (WebCore::Layout::FloatAvoider::layoutBox const):
3800         (WebCore::Layout::FloatAvoider::displayBox const):
3801         * layout/floats/FloatBox.cpp: Copied from Source/WebCore/layout/floats/FloatAvoider.h.
3802         (WebCore::Layout::FloatBox::FloatBox):
3803         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
3804         (WebCore::Layout::FloatBox::verticalPositionCandidate):
3805         (WebCore::Layout::FloatBox::initialVerticalPosition const):
3806         * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatAvoider.h.
3807         * layout/floats/FloatingContext.cpp:
3808         (WebCore::Layout::FloatingContext::positionForFloat const):
3809         (WebCore::Layout::FloatingContext::floatingPosition const):
3810
3811 2018-08-29  Ali Juma  <ajuma@chromium.org>
3812
3813         [IntersectionObserver]  Implement intersection logic for the same-document implicit root case
3814         https://bugs.webkit.org/show_bug.cgi?id=189055
3815
3816         Reviewed by Simon Fraser.
3817
3818         Extend the intersection logic to handle computing the intersection of the target and the
3819         viewport, for the case where the target is in the main frame.
3820
3821         Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.
3822
3823         * dom/Document.cpp:
3824         (WebCore::computeIntersectionRects):
3825         (WebCore::Document::updateIntersectionObservations):
3826
3827 2018-08-28  Ryosuke Niwa  <rniwa@webkit.org>
3828
3829         Changes to slot children should trigger slotchange
3830         https://bugs.webkit.org/show_bug.cgi?id=169718
3831         <rdar://problem/43317496>
3832
3833         Reviewed by Darin Adler.
3834
3835         Fix the bug that slotchange event is not fired when a slot's fallback content is updated now that slotchange event
3836         is more formally specified.
3837
3838         This particular behavior corresponds to step 7.5. of the concept *to insert a node* where it says:
3839         "[I]f parent’s root is a shadow root, and parent is a slot whose assigned nodes is the empty list, then run signal
3840         a slot change for parent."
3841
3842         See https://dom.spec.whatwg.org/#concept-node-insert
3843
3844         Tests: fast/shadow-dom/slotchange-in-fallback.html
3845                imported/w3c/web-platform-tests/shadow-dom/slotchange.html 
3846
3847         * dom/Element.cpp:
3848         (WebCore::Element::childrenChanged): Updated the comment.
3849         * dom/ShadowRoot.cpp:
3850         (WebCore::ShadowRoot::addSlotElementByName): Added an assertion.
3851         (WebCore::ShadowRoot::slotFallbackDidChange): Added.
3852         * dom/ShadowRoot.h:
3853         * dom/SlotAssignment.cpp:
3854         (WebCore::SlotAssignment::slotFallbackDidChange): Added. When the assigned nodes is empty, we enqueue a slotchange.
3855         Because assignedNodesForSlot invokes assignSlots, this can be O(n) but we don't expect mutating slot's fallback
3856         contents and shadow host's children in turn to be a common scenario so this shouldn't be an issue in practice.
3857         * dom/SlotAssignment.h:
3858         * html/HTMLSlotElement.cpp:
3859         (WebCore::HTMLSlotElement::insertedIntoAncestor): Be explicit about auto* being used here.
3860         (WebCore::HTMLSlotElement::childrenChanged): Added. Invokes slotFallbackDidChange whenver child node is muated.
3861         * html/HTMLSlotElement.h:
3862
3863 2018-08-28  Don Olmstead  <don.olmstead@sony.com>
3864
3865         Check for null renderer in canBeScrolledIntoView
3866         https://bugs.webkit.org/show_bug.cgi?id=188935
3867
3868         Reviewed by Simon Fraser.
3869
3870         Test: fast/spatial-navigation/snav-display-contents-crash.html
3871
3872         * page/SpatialNavigation.cpp:
3873         (WebCore::canBeScrolledIntoView):
3874
3875 2018-08-28  Youenn Fablet  <youenn@apple.com>
3876
3877         IDBDatabase should not return true to hasPendingActivity after being stopped
3878         https://bugs.webkit.org/show_bug.cgi?id=189073
3879
3880         Reviewed by Darin Adler.
3881
3882         There is a chance that IDBDatabase::hasPendingActivity returns true.
3883         The case that might happen is when stop() is called but there are still some active/being committed transactions.
3884         In that case, hasPendingActivity will return true until these transactions get finalized.
3885         While these transactions will probably be finalized at some point, it delays GC for no good reason.
3886         And we might want in a follow-up patch to assert that ActiveDOMObject are GC-able whenever their context is stopped.
3887         For that purpose, make sure hasPendingActivity returns false when context is stopped.
3888
3889         * Modules/indexeddb/IDBDatabase.cpp:
3890         (WebCore::IDBDatabase::hasPendingActivity const):
3891
3892 2018-08-28  Don Olmstead  <don.olmstead@sony.com>