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