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