CounterMaps should hold a unique_ptr of CounterMap.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-30  Zalan Bujtas  <zalan@apple.com>
2
3         CounterMaps should hold a unique_ptr of CounterMap.
4         https://bugs.webkit.org/show_bug.cgi?id=189174
5         <rdar://problem/43686458>
6
7         Reviewed by Ryosuke Niwa.
8
9         In certain cases calls to CounterMaps might lead to unexpected deletion of the CounterMap object.
10
11         Test: fast/css/counters/crash-when-cloning-body.html
12
13         * rendering/RenderCounter.cpp:
14         (WebCore::makeCounterNode):
15         (WebCore::destroyCounterNodeWithoutMapRemoval):
16         (WebCore::RenderCounter::destroyCounterNodes):
17         (WebCore::RenderCounter::destroyCounterNode):
18         (WebCore::updateCounters):
19         (showCounterRendererTree):
20
21 2018-08-30  Ross Kirsling  <ross.kirsling@sony.com>
22
23         Speculative build fix for WPE after r235531.
24
25         * platform/graphics/filters/PointLightSource.cpp:
26         Add missing include.
27
28 2018-08-30  Ryosuke Niwa  <rniwa@webkit.org>
29
30         Add assignedElements to HTMLSlotElement
31         https://bugs.webkit.org/show_bug.cgi?id=189146
32
33         Reviewed by Darin Adler.
34
35         Added assignedElements to HTMLSlotElement. For now, we simply filter the results returned by assignedNodes.
36
37         Also fixed a bug that assignedNodes was returning the fallback content when the slot is not in a shadow tree,
38         which is specified in step 2 of the concept to find flattened slotables for a slot.
39
40         Spec: https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignedelements
41               https://dom.spec.whatwg.org/#find-flattened-slotables
42
43         Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html
44                imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html
45
46         * html/HTMLSlotElement.cpp:
47         (WebCore::flattenAssignedNodes): Updated to take Vector<Ref<Node>> for consistency.
48         (WebCore::HTMLSlotElement::assignedNodes const): Ditto.
49         (WebCore::HTMLSlotElement::assignedElements const):
50         * html/HTMLSlotElement.h:
51         * html/HTMLSlotElement.idl:
52
53 2018-08-30  Don Olmstead  <don.olmstead@sony.com>
54
55         [CMake] Replace AVFoundationSupport.py using CMake
56         https://bugs.webkit.org/show_bug.cgi?id=182891
57
58         Reviewed by Per Arne Vollan.
59
60         No new tests. No change in behavior.
61
62         Remove refernces to PAL derived sources.
63
64         * PlatformWin.cmake:
65         * config.h:
66
67 2018-08-30  Olivia Barnett  <obarnett@apple.com>
68
69         REGRESSION(r235489): fast/dom/navigator-detached-no-crash.html crashes under Navigator::share
70         https://bugs.webkit.org/show_bug.cgi?id=189170
71
72         Reviewed by Tim Horton.
73
74         No new tests; fixing a failing existing test.
75
76         * page/Navigator.cpp:
77         (WebCore::Navigator::share):
78         Added null check for frame.
79
80 2018-08-30  Truitt Savell  <tsavell@apple.com>
81
82         Unreviewed, rolling out r235516.
83
84         Caused 50 Crashes on Sierra
85
86         Reverted changeset:
87
88         "The width of a nullptr TextRun should be zero"
89         https://bugs.webkit.org/show_bug.cgi?id=189154
90         https://trac.webkit.org/changeset/235516
91
92 2018-08-30  Tim Horton  <timothy_horton@apple.com>
93
94         Bundle unified sources more tightly in projects with deep directory structures
95         https://bugs.webkit.org/show_bug.cgi?id=189009
96
97         Reviewed by Simon Fraser.
98
99         Fix a variety of unification errors due to reshuffling the bundles.
100
101         * Modules/mediastream/RTCController.cpp:
102         * SourcesCocoa.txt:
103         * WebCore.xcodeproj/project.pbxproj:
104         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
105         (WebCore::CryptoAlgorithmECDSA::importKey):
106         * dom/Document.h:
107         * html/parser/HTMLTreeBuilder.cpp:
108         * loader/appcache/ApplicationCacheResourceLoader.h:
109         * page/AlternativeTextClient.h:
110         * platform/Pasteboard.h:
111         * platform/graphics/DisplayRefreshMonitor.cpp:
112         * platform/graphics/FontFamilySpecificationNull.cpp:
113         * platform/graphics/cocoa/WebGLLayer.mm:
114         (-[WebGLLayer initWithGraphicsContext3D:]):
115         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
116         (-[WebGLLayer display]):
117         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
118         * platform/graphics/cocoa/WebGPULayer.mm:
119         (-[WebGPULayer initWithGPUDevice:]):
120         * platform/graphics/metal/GPUCommandQueueMetal.mm:
121         * platform/mac/PasteboardMac.mm:
122         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
123         * platform/network/ResourceRequestBase.cpp:
124         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
125         * rendering/updating/RenderTreeBuilderInline.cpp:
126
127 2018-08-30  Andy Estes  <aestes@apple.com>
128
129         [Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEventInit interfaces
130         https://bugs.webkit.org/show_bug.cgi?id=189100
131
132         Reviewed by Daniel Bates.
133
134         Implement the PaymentMethodChangeEvent interface and PaymentMethodChangeEventInit dictionary
135         defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
136
137         <https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>
138
139         The "payment method changed" algorithm will be implemented in a follow-up.
140
141         Covered by existing web platform tests.
142
143         * CMakeLists.txt:
144         * DerivedSources.make:
145         * Modules/paymentrequest/PaymentMethodChangeEvent.cpp: Added.
146         (WebCore::PaymentMethodChangeEvent::eventInterface const):
147         (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
148         * Modules/paymentrequest/PaymentMethodChangeEvent.h: Added.
149         * Modules/paymentrequest/PaymentMethodChangeEvent.idl: Added.
150         * Modules/paymentrequest/PaymentMethodChangeEventInit.h: Added.
151         * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Added.
152         * Modules/paymentrequest/PaymentRequest.idl:
153         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
154         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
155         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
156         * Modules/paymentrequest/PaymentRequestUpdateEventInit.h:
157         * Sources.txt:
158         * WebCore.xcodeproj/project.pbxproj:
159         * bindings/js/WebCoreBuiltinNames.h:
160         * dom/EventNames.h:
161         * dom/EventNames.in:
162
163 2018-08-30  Brent Fulgham  <bfulgham@apple.com>
164
165         The width of a nullptr TextRun should be zero
166         https://bugs.webkit.org/show_bug.cgi?id=189154
167         <rdar://problem/43685926>
168
169         Reviewed by Zalan Bujtas.
170
171         If a page has an empty TextRun and attempts to paint it we can crash with a nullptr.
172
173         This patch recognizes that an empty TextRun should always produce a zero width, rather than
174         attempt to compute this value from font data.
175
176         Test: fast/text/null-string-textrun.html
177
178         * platform/graphics/FontCascade.cpp:
179         (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width.
180         (WebCore::FontCascade::width const): Ditto.
181         (WebCore::FontCascade::codePath const): ASSERT that the TextRun is non-empty.
182
183 2018-08-30  Eric Carlson  <eric.carlson@apple.com>
184
185         Mock video devices should only support discrete sizes
186         https://bugs.webkit.org/show_bug.cgi?id=189000
187         <rdar://problem/43766551>
188
189         Reviewed by Youenn Fablet.
190         
191         While many/most video capture devices only support a finite number of discrete width/height
192         pairs, our mock video capture devices supported arbitrary width and height combinations which
193         made it difficult to write realistic tests using them. Change the mock devices to support
194         finite "presets" like those supported by AVFoundation. Create a RealtimeVideoSource base
195         class with support for these presets, so the same code will eventually be used by the mock
196         and real capture devices.
197
198         No new tests, existing tests updated for these changes.
199
200         * Sources.txt: Add RealtimeVideoSource.cpp, remove MockRealtimeMediaSource.cpp.
201
202         * WebCore.xcodeproj/project.pbxproj: Ditto.
203
204         * platform/mediastream/MediaConstraints.h: Deal with min constraint less than the supported minimum
205         and max larger than the supported maximum when there is no ideal.
206
207         * platform/mediastream/RealtimeMediaSource.cpp:
208         (WebCore::RealtimeMediaSource::selectSettings): Use supportsSizeAndFrameRate for widths,
209         heights, and framerates in advanced constraints so a width and height that are supported but
210         in the same preset are filtered out.
211         (WebCore::RealtimeMediaSource::setSize): New.
212         * platform/mediastream/RealtimeMediaSource.h:
213
214         * platform/mediastream/RealtimeMediaSourceSettings.h: Remove an unneeded include.
215
216         * platform/mediastream/RealtimeVideoSource.cpp: Added.
217         (WebCore::RealtimeVideoSource::RealtimeVideoSource):
218         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
219         (WebCore::RealtimeVideoSource::startProducingData):
220         (WebCore::RealtimeVideoSource::setSupportedFrameRates):
221         (WebCore::RealtimeVideoSource::addSupportedCapabilities const):
222         (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate):
223         (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight):
224         (WebCore::RealtimeVideoSource::applySize):
225         (WebCore::RealtimeVideoSource::applySizeAndFrameRate):
226         (WebCore::RealtimeVideoSource::videoSampleAvailable):
227         (WebCore::RealtimeVideoSource::applyFrameRate):
228         (WebCore::RealtimeVideoSource::supportsFrameRate):
229
230         * platform/mediastream/RealtimeVideoSource.h: Copied from Source/WebCore/platform/mock/MockRealtimeAudioSource.h.
231         (WebCore::RealtimeVideoSource::setSupportedCaptureSizes):
232         (WebCore::RealtimeVideoSource::setDefaultSize):
233         (WebCore::RealtimeVideoSource::observedFrameRate const):
234
235         * platform/mediastream/mac/AVMediaCaptureSource.mm:
236         (WebCore::AVMediaCaptureSource::initializeSettings): Don't set label, it isn't used.
237
238         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
239         (WebCore::MockRealtimeVideoSourceMac::applySize): Call the base class.
240
241         * platform/mock/MockMediaDevice.h:
242         (WebCore::MockCameraProperties::encode const): Add frame rates, sizes, and facing mode.
243         (WebCore::MockCameraProperties::decode): Ditto.
244
245         * platform/mock/MockRealtimeAudioSource.cpp:
246         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): No more MockRealtimeMediaSource.
247         (WebCore::MockRealtimeAudioSource::settings const): Clean up.
248         (WebCore::MockRealtimeAudioSource::capabilities const): Ditto.
249         (WebCore::MockRealtimeAudioSource::settingsDidChange): Ditto.
250         (WebCore::MockRealtimeAudioSource::stopProducingData): m_elapsedTime isn't used, delete it.
251         (WebCore::MockRealtimeAudioSource::updateSettings): Deleted.
252         (WebCore::MockRealtimeAudioSource::initializeCapabilities): Deleted.
253         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints): Deleted.
254         (WebCore::MockRealtimeAudioSource::elapsedTime): Deleted.
255         * platform/mock/MockRealtimeAudioSource.h:
256
257         * platform/mock/MockRealtimeMediaSourceCenter.cpp: Moved all of the mock device management
258         code from MockRealtimeMediaSource.cpp here.
259         (WebCore::defaultDevices):
260         (WebCore::devices):
261         (WebCore::deviceMap):
262         (WebCore::deviceListForDevice):
263         (WebCore::createCaptureDevice):
264         (WebCore::MockRealtimeMediaSourceCenter::resetDevices):
265         (WebCore::MockRealtimeMediaSourceCenter::setDevices):
266         (WebCore::MockRealtimeMediaSourceCenter::addDevice):
267         (WebCore::MockRealtimeMediaSourceCenter::removeDevice):
268         (WebCore::MockRealtimeMediaSourceCenter::mockDeviceWithPersistentID):
269         (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
270         (WebCore::MockRealtimeMediaSourceCenter::audioDevices):
271         (WebCore::MockRealtimeMediaSourceCenter::videoDevices):
272         (WebCore::MockRealtimeMediaSourceCenter::displayDevices):
273
274         * platform/mock/MockRealtimeVideoSource.cpp:
275         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Use RealtimeVideoSource, no
276         more MockRealtimeMediaSource.
277         (WebCore::MockRealtimeVideoSource::capabilities const): Ditto, cleanup.
278         (WebCore::MockRealtimeVideoSource::settings const): Ditto.
279         (WebCore::MockRealtimeVideoSource::settingsDidChange): Ditto.
280         (WebCore::MockRealtimeVideoSource::startCaptureTimer): Ditto.
281         (WebCore::MockRealtimeVideoSource::startProducingData): Ditto.
282         (WebCore::MockRealtimeVideoSource::stopProducingData): Ditto.
283         (WebCore::MockRealtimeVideoSource::elapsedTime): Ditto.
284         (WebCore::MockRealtimeVideoSource::applySize): Ditto.
285         (WebCore::MockRealtimeVideoSource::drawText): Render the actual frame rate.
286         (WebCore::MockRealtimeVideoSource::generateFrame): Use m_fillColor.
287         (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted.
288         (WebCore::MockRealtimeVideoSource::updateSettings): Deleted.
289         (WebCore::MockRealtimeVideoSource::initializeCapabilities): Deleted.
290         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Deleted.
291         (WebCore::MockRealtimeVideoSource::applyFrameRate): Deleted.
292         * platform/mock/MockRealtimeVideoSource.h:
293         (WebCore::MockRealtimeVideoSource::updateSampleBuffer): Deleted.
294
295 2018-08-30  Zalan Bujtas  <zalan@apple.com>
296
297         [LFC][Floating] Block formatting context roots avoid floats.
298         https://bugs.webkit.org/show_bug.cgi?id=189150
299
300         Reviewed by Antti Koivisto.
301
302         This patch implements the float avoiding behaviour for block formatting context roots.
303
304         When a box establishes a block formatting context, floats from outside of the context can't interfere with content inside. In order
305         to achive this, such formatting root boxes need to be positioned so that they don't overlap with floats (floats that share the same
306         context with the formatting root). In ltr block direction, roots start with avoiding floats on the left, while in rtl on the right.
307
308         Tests: fast/block/block-only/float-avoider-multiple-roots.html
309                fast/block/block-only/float-avoider-simple-left.html
310                fast/block/block-only/float-avoider-simple-right.html
311                fast/block/block-only/float-avoider-with-margins.html
312
313         * layout/blockformatting/BlockFormattingContext.cpp:
314         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
315         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
316         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
317         * layout/blockformatting/BlockFormattingContext.h:
318         * layout/floats/FloatAvoider.cpp:
319         (WebCore::Layout::FloatAvoider::FloatAvoider):
320         * layout/floats/FloatingContext.cpp:
321         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
322         * layout/floats/FloatingContext.h:
323
324 2018-08-30  Zalan Bujtas  <zalan@apple.com>
325
326         [LFC][Floating] Move containing block constraint logic from FloatAvoider to FloatingContext
327         https://bugs.webkit.org/show_bug.cgi?id=189145
328
329         Reviewed by Antti Koivisto.
330
331         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)
332         and check the overflow as part of the FloatingContext::floatingPosition() logic. It simplifies the constraint logic/helps implementing the non-float avoider
333         case.
334
335         * layout/floats/FloatAvoider.cpp:
336         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
337         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
338         * layout/floats/FloatAvoider.h:
339         * layout/floats/FloatingContext.cpp:
340         (WebCore::Layout::FloatingContext::floatingPosition const):
341
342 2018-08-30  Zalan Bujtas  <zalan@apple.com>
343
344         [LFC][Floating] Use non-computed horizontal margins when intersecting floats with float avoiders.
345         https://bugs.webkit.org/show_bug.cgi?id=189143
346
347         Reviewed by Antti Koivisto.
348
349         * layout/Verification.cpp:
350         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
351         * layout/floats/FloatAvoider.cpp:
352         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
353         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
354         * layout/floats/FloatAvoider.h:
355         (WebCore::Layout::FloatAvoider::marginTop const):
356         (WebCore::Layout::FloatAvoider::marginBottom const):
357         (WebCore::Layout::FloatAvoider::marginLeft const):
358         (WebCore::Layout::FloatAvoider::marginRight const):
359         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
360         * layout/floats/FloatBox.cpp:
361         (WebCore::Layout::FloatBox::rect const):
362         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
363         (WebCore::Layout::FloatBox::verticalPositionCandidate):
364         (WebCore::Layout::FloatBox::initialVerticalPosition const):
365         * layout/floats/FloatBox.h:
366
367 2018-08-30  Zalan Bujtas  <zalan@apple.com>
368
369         [LFC][Margins] Add non-computed horizontal margins to DisplayBox
370         https://bugs.webkit.org/show_bug.cgi?id=189141
371
372         Reviewed by Antti Koivisto.
373
374         Inflow block boxes' horizontal margins extend all the way to the left/right edge of their containing block.
375         See https://www.w3.org/TR/CSS22/visudet.html#blockwidth for example
376         "...
377         10.3.3 Block-level, non-replaced elements in normal flow
378         'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block
379         ..."
380
381         In certain cases (float avoiding) we need to know the original (non-extended) horiztonal margin values.
382
383         * layout/FormattingContext.cpp:
384         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
385         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
386         * layout/FormattingContextGeometry.cpp:
387         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
388         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
389         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
390         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
391         * layout/LayoutContext.cpp:
392         (WebCore::Layout::LayoutContext::initializeRoot):
393         * layout/LayoutUnits.h:
394         * layout/blockformatting/BlockFormattingContext.cpp:
395         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
396         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
397         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
398         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
399         * layout/displaytree/DisplayBox.h:
400         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin):
401         (WebCore::Display::Box::setHorizontalNonComputedMargin):
402         (WebCore::Display::Box::nonComputedMarginLeft const):
403         (WebCore::Display::Box::nonComputedMarginRight const):
404
405 2018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
406
407         Unreviewed, add comments about enum names to bitfields
408         https://bugs.webkit.org/show_bug.cgi?id=188944
409
410         * xml/XMLHttpRequest.h:
411
412 2018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
413
414         Unreviewed, add comments about enum names to bitfields
415         https://bugs.webkit.org/show_bug.cgi?id=188945
416
417         * html/HTMLCollection.h:
418
419 2018-08-29  Andy Estes  <aestes@apple.com>
420
421         Addressed additional review feedback after r235342.
422
423         * Modules/applepay/ApplePayRequestBase.cpp:
424         (WebCore::convertAndValidate):
425
426         Used '"' instead of "\"" with makeString().
427
428 2018-08-29  Aditya Keerthi  <akeerthi@apple.com>
429
430         [Datalist] Display prefix-matched suggestions first
431         https://bugs.webkit.org/show_bug.cgi?id=189106
432
433         Reviewed by Tim Horton.
434
435         In order to increase suggestion relevancy, we should display suggestions that have
436         the same prefix as the input value first. In order to achieve this, we can place
437         the suggestions into two buckets, one that contains prefix-matched values and
438         another that contains only substring-matched values.
439
440         TextFieldInputType::suggestions() can be called up to three times before we
441         display the values. In order to avoid generating the same suggestions multiple
442         times, the most recent values can be stored and reused. We clear the cached values
443         whenever the datalist element is modified or when the suggestions view is hidden.
444
445         Finally, removed logic to de-duplicate the list of suggested values. This behavior
446         is not a part of the specification and leads to unnecessary slowdown when
447         populating the suggestions view.
448
449         Test: fast/forms/datalist/datalist-textinput-suggestions-order.html
450
451         * html/TextFieldInputType.cpp:
452         (WebCore::TextFieldInputType::listAttributeTargetChanged):
453         (WebCore::TextFieldInputType::suggestions):
454         (WebCore::TextFieldInputType::didCloseSuggestions):
455         * html/TextFieldInputType.h:
456         * platform/DataListSuggestionsClient.h:
457
458 2018-08-29  Olivia Barnett  <obarnett@apple.com>
459
460         Implement the Web Share API
461         https://bugs.webkit.org/show_bug.cgi?id=171100
462         <rdar://problem/31751734>
463
464         Reviewed by Tim Horton.
465
466         Added one test in fast/events/ios called share.html; adjusted expectations for existing tests.
467
468         * DerivedSources.make:
469         * Sources.txt:
470         * WebCore.xcodeproj/project.pbxproj:
471         * features.json:
472         * loader/EmptyClients.cpp:
473         (WebCore::EmptyChromeClient::showShareSheet):
474         * loader/EmptyClients.h:
475         Added empty showShareSheet function.
476
477         * page/Chrome.cpp:
478         (WebCore::Chrome::showShareSheet):
479         * page/Chrome.h:
480         Added call to showShareSheet on client.
481
482         * page/ChromeClient.h:
483         Virtual showShareSheet function.
484
485         * page/Navigator.cpp:
486         (WebCore::Navigator::share):
487         * page/Navigator.h:
488         Share function that returns a promise and invokes the share sheet.
489
490         * page/Navigator.idl:
491         Implements NavigatorShare
492
493         * page/NavigatorShare.idl: Added.
494         Added definition of share function returning a promise.
495
496         * page/RuntimeEnabledFeatures.h:
497         (WebCore::RuntimeEnabledFeatures::setWebShareEnabled):
498         (WebCore::RuntimeEnabledFeatures::webShareEnabled const):
499         Added RuntimeEnabledFeature switch.
500
501         * page/ShareData.h: Added.
502         * page/ShareData.idl: Added.
503         Definition of ShareData struct.
504
505 2018-08-29  Daniel Bates  <dabates@apple.com>
506
507         REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany
508         https://bugs.webkit.org/show_bug.cgi?id=184390
509         <rdar://problem/41804994>
510         And
511         <rdar://problem/39771867>
512
513         Reviewed by Simon Fraser.
514
515         Speculative fix for Epiphany.
516
517         In theory, WebCore::subdivide() should never return an empty vector - no subdivisions - as such a
518         result represents a programmer error. In practice, InlineTextBox can invoke WebCore::subdivide()
519         such that it returns an empty vector. One way this can happen is when subdividing an empty inline
520         text box associated with combined text (RenderCombineText). For now we add a check to bail out of
521         resolving the style of subdivisions when WebCore::subdivide() returns no subdivisions. In a
522         subsequent patch we will look to assert that WebCore::subdivide() always returns subdivisions.
523
524         Test: fast/text/text-combine-surroundContents-crash.html
525
526         * rendering/InlineTextBox.cpp:
527         (WebCore::InlineTextBox::subdivideAndResolveStyle):
528
529 2018-08-29  Youenn Fablet  <youenn@apple.com>
530
531         Remove WebRTC legacy API implementation
532         https://bugs.webkit.org/show_bug.cgi?id=189040
533
534         Reviewed by Eric Carlson.
535
536         This API is no longer needed as the runtime flag is off by default.
537         Removing this option allows removing some code and will ease future WebRTC improvements.
538         Covered by existing tests.
539
540         * CMakeLists.txt:
541         * DerivedSources.make:
542         * Modules/mediastream/MediaStreamEvent.cpp: Removed.
543         * Modules/mediastream/MediaStreamEvent.h: Removed.
544         * Modules/mediastream/MediaStreamEvent.idl: Removed.
545         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
546         * Modules/mediastream/NavigatorUserMedia.js: Removed.
547         * Modules/mediastream/PeerConnectionBackend.cpp:
548         * Modules/mediastream/PeerConnectionBackend.h:
549         * Modules/mediastream/RTCPeerConnection.h:
550         * Modules/mediastream/RTCPeerConnection.idl:
551         * Modules/mediastream/RTCPeerConnection.js:
552         (initializeRTCPeerConnection):
553         (createOffer):
554         (createAnswer):
555         (setLocalDescription):
556         (setRemoteDescription):
557         (addIceCandidate):
558         (getLocalStreams): Deleted.
559         (getStreamById): Deleted.
560         (addStream): Deleted.
561         (): Deleted.
562         * Modules/mediastream/RTCPeerConnectionInternals.js:
563         (callbacksAndDictionaryOverload):
564         (if): Deleted.
565         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
566         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
567         (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
568         (WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
569         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
570         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
571         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
572         (WebCore::LibWebRTCPeerConnectionBackend::removeRemoteStream): Deleted.
573         (WebCore::LibWebRTCPeerConnectionBackend::addRemoteStream): Deleted.
574         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
575         * Sources.txt:
576         * WebCore.xcodeproj/project.pbxproj:
577         * bindings/js/JSDOMGlobalObject.cpp:
578         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
579         (WebCore::isWebRTCLegacyAPIEnabled): Deleted.
580         * bindings/js/WebCoreBuiltinNames.h:
581         * dom/EventNames.in:
582         * page/RuntimeEnabledFeatures.h:
583         (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
584         (WebCore::RuntimeEnabledFeatures::webRTCLegacyAPIEnabled const): Deleted.
585         (WebCore::RuntimeEnabledFeatures::setWebRTCLegacyAPIEnabled): Deleted.
586
587 2018-08-29  Ryosuke Niwa  <rniwa@webkit.org>
588
589         Modernize SlotAssignment
590         https://bugs.webkit.org/show_bug.cgi?id=189075
591
592         Reviewed by Antti Koivisto.
593
594         Modernized the code related to SlotAssignment. Namely, use HashMap<>::get instead of HashMap<>::find,
595         and use HashMap<>::ensure instead of HashMap<>::add. Also use WeakPtr to keep track of HTMLSlotElement
596         instead of a raw pointer.
597
598         * dom/SlotAssignment.cpp:
599         (WebCore::SlotAssignment::findAssignedSlot):
600         (WebCore::SlotAssignment::addSlotElementByName):
601         (WebCore::SlotAssignment::removeSlotElementByName):
602         (WebCore::SlotAssignment::didChangeSlot):
603         (WebCore::SlotAssignment::findFirstSlotElement):
604         (WebCore::SlotAssignment::resolveAllSlotElements):
605         (WebCore::SlotAssignment::assignToSlot):
606         * dom/SlotAssignment.h:
607         (WebCore::SlotAssignment::Slot::Slot): Renamed from SlotInfo since "Info" doesn't add any value.
608         * html/HTMLSlotElement.h:
609
610 2018-08-29  Chris Dumez  <cdumez@apple.com>
611
612         [PSON] We should only process-swap when eTLD+1 changes on navigation
613         https://bugs.webkit.org/show_bug.cgi?id=189090
614         <rdar://problem/43799225>
615
616         Reviewed by Geoffrey Garen.
617
618         Add toRegistrableDomain() utility function to get the eTLD+1 (aka "registrable
619         domain") from an URL.
620
621         * platform/network/ResourceRequestBase.h:
622         (WebCore::toRegistrableDomain):
623         (WebCore::registrableDomainsAreEqual):
624
625 2018-08-29  Youenn Fablet  <youenn@apple.com>
626
627         Add a runtime flag for WebRTC unified plan
628         https://bugs.webkit.org/show_bug.cgi?id=189068
629
630         Reviewed by Eric Carlson.
631
632         Covered by existing updated tests.
633         Main change is to call addTrack with a stream parameter so that on the other side, the track will be tied to a stream.
634         Receive-only case in unified plan is not yet supported.
635         This will be supported in follow-up patches.
636
637         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
638         (WebCore::LibWebRTCMediaEndpoint::setConfiguration): Activate unified plan based on runtime flag.
639         (WebCore::LibWebRTCMediaEndpoint::addTrack): Do not use AddStream in case of unified plan.
640         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const):
641         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const):
642         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): Use legacy webrtc option for receive only cases only in plan B case.
643         * page/RuntimeEnabledFeatures.h:
644         (WebCore::RuntimeEnabledFeatures::webRTCUnifiedPlanEnabled const):
645         (WebCore::RuntimeEnabledFeatures::setWebRTCUnifiedPlanEnabled):
646
647 2018-08-28  Simon Fraser  <simon.fraser@apple.com>
648
649         Fix crash when reflections and backdrop filter are combined
650         https://bugs.webkit.org/show_bug.cgi?id=188504
651         rdar://problem/43225590
652
653         Reviewed by Dan Bates.
654         
655         GraphicsLayerCA::updateBackdropFiltersRect() was confused about which hash map to modify
656         when changes to the clipping rect affect whether we make backdrop clipping layers;
657         we need to add/remove from backdropClippingLayerClones, not backdropLayerClones.
658
659         Test: compositing/filters/backdrop-filter-update-rect.html
660
661         * platform/graphics/ca/GraphicsLayerCA.cpp:
662         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
663
664 2018-08-29  Jer Noble  <jer.noble@apple.com>
665
666         Muted elements do not have their Now Playing status updated when unmuted.
667         https://bugs.webkit.org/show_bug.cgi?id=189069
668
669         Reviewed by Eric Carlson.
670
671         Schedule an updateNowPlayingInfo() when an element becomes unmuted.
672
673         * platform/audio/PlatformMediaSessionManager.h:
674         * platform/audio/mac/MediaSessionManagerMac.h:
675         * platform/audio/mac/MediaSessionManagerMac.mm:
676         (WebCore::MediaSessionManagerMac::sessionCanProduceAudioChanged):
677
678 2018-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>
679
680         Use the null string instead of std::nullopt for missing attachment file names and content types
681         https://bugs.webkit.org/show_bug.cgi?id=189080
682
683         Reviewed by Tim Horton.
684
685         Replace instances of std::optional<String> with just String instead, and use the null string to represent a
686         missing value instead of std::nullopt. No change in behavior.
687
688         * html/HTMLAttachmentElement.cpp:
689         (WebCore::HTMLAttachmentElement::updateAttributes):
690         * html/HTMLAttachmentElement.h:
691
692 2018-08-29  David Kilzer  <ddkilzer@apple.com>
693
694         Remove empty directories from from svn.webkit.org repository
695         <https://webkit.org/b/189081>
696
697         * Modules/proximity: Removed.
698
699 2018-08-28  Zalan Bujtas  <zalan@apple.com>
700
701         [LFC][Floating] Introduce FloatBox, a FloatAvoider subclass.
702         https://bugs.webkit.org/show_bug.cgi?id=189074
703
704         Reviewed by Antti Koivisto.
705
706         FloatBox is a float avoider and a float positioned box as well.
707         This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.
708
709         * Sources.txt:
710         * WebCore.xcodeproj/project.pbxproj:
711         * layout/displaytree/DisplayBox.h:
712         * layout/floats/FloatAvoider.cpp:
713         (WebCore::Layout::FloatAvoider::FloatAvoider):
714         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
715         (WebCore::Layout::FloatAvoider::setVerticalConstraint):
716         (WebCore::Layout::FloatAvoider::horizontalPositionCandidate):
717         (WebCore::Layout::FloatAvoider::verticalPositionCandidate):
718         (WebCore::Layout::FloatAvoider::resetPosition):
719         (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
720         (WebCore::Layout::FloatAvoider::initializePosition): Deleted.
721         (WebCore::Layout::FloatAvoider::isLeftAligned const): Deleted.
722         (WebCore::Layout::FloatAvoider::rect const): Deleted.
723         (WebCore::Layout::FloatAvoider::resetHorizontalConstraints): Deleted.
724         (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
725         * layout/floats/FloatAvoider.h:
726         (WebCore::Layout::FloatAvoider::rect const):
727         (WebCore::Layout::FloatAvoider::isLeftAligned const):
728         (WebCore::Layout::FloatAvoider::initialVerticalPosition const):
729         (WebCore::Layout::FloatAvoider::floatingState const):
730         (WebCore::Layout::FloatAvoider::layoutBox const):
731         (WebCore::Layout::FloatAvoider::displayBox const):
732         * layout/floats/FloatBox.cpp: Copied from Source/WebCore/layout/floats/FloatAvoider.h.
733         (WebCore::Layout::FloatBox::FloatBox):
734         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
735         (WebCore::Layout::FloatBox::verticalPositionCandidate):
736         (WebCore::Layout::FloatBox::initialVerticalPosition const):
737         * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatAvoider.h.
738         * layout/floats/FloatingContext.cpp:
739         (WebCore::Layout::FloatingContext::positionForFloat const):
740         (WebCore::Layout::FloatingContext::floatingPosition const):
741
742 2018-08-29  Ali Juma  <ajuma@chromium.org>
743
744         [IntersectionObserver]  Implement intersection logic for the same-document implicit root case
745         https://bugs.webkit.org/show_bug.cgi?id=189055
746
747         Reviewed by Simon Fraser.
748
749         Extend the intersection logic to handle computing the intersection of the target and the
750         viewport, for the case where the target is in the main frame.
751
752         Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.
753
754         * dom/Document.cpp:
755         (WebCore::computeIntersectionRects):
756         (WebCore::Document::updateIntersectionObservations):
757
758 2018-08-28  Ryosuke Niwa  <rniwa@webkit.org>
759
760         Changes to slot children should trigger slotchange
761         https://bugs.webkit.org/show_bug.cgi?id=169718
762         <rdar://problem/43317496>
763
764         Reviewed by Darin Adler.
765
766         Fix the bug that slotchange event is not fired when a slot's fallback content is updated now that slotchange event
767         is more formally specified.
768
769         This particular behavior corresponds to step 7.5. of the concept *to insert a node* where it says:
770         "[I]f parent’s root is a shadow root, and parent is a slot whose assigned nodes is the empty list, then run signal
771         a slot change for parent."
772
773         See https://dom.spec.whatwg.org/#concept-node-insert
774
775         Tests: fast/shadow-dom/slotchange-in-fallback.html
776                imported/w3c/web-platform-tests/shadow-dom/slotchange.html 
777
778         * dom/Element.cpp:
779         (WebCore::Element::childrenChanged): Updated the comment.
780         * dom/ShadowRoot.cpp:
781         (WebCore::ShadowRoot::addSlotElementByName): Added an assertion.
782         (WebCore::ShadowRoot::slotFallbackDidChange): Added.
783         * dom/ShadowRoot.h:
784         * dom/SlotAssignment.cpp:
785         (WebCore::SlotAssignment::slotFallbackDidChange): Added. When the assigned nodes is empty, we enqueue a slotchange.
786         Because assignedNodesForSlot invokes assignSlots, this can be O(n) but we don't expect mutating slot's fallback
787         contents and shadow host's children in turn to be a common scenario so this shouldn't be an issue in practice.
788         * dom/SlotAssignment.h:
789         * html/HTMLSlotElement.cpp:
790         (WebCore::HTMLSlotElement::insertedIntoAncestor): Be explicit about auto* being used here.
791         (WebCore::HTMLSlotElement::childrenChanged): Added. Invokes slotFallbackDidChange whenver child node is muated.
792         * html/HTMLSlotElement.h:
793
794 2018-08-28  Don Olmstead  <don.olmstead@sony.com>
795
796         Check for null renderer in canBeScrolledIntoView
797         https://bugs.webkit.org/show_bug.cgi?id=188935
798
799         Reviewed by Simon Fraser.
800
801         Test: fast/spatial-navigation/snav-display-contents-crash.html
802
803         * page/SpatialNavigation.cpp:
804         (WebCore::canBeScrolledIntoView):
805
806 2018-08-28  Youenn Fablet  <youenn@apple.com>
807
808         IDBDatabase should not return true to hasPendingActivity after being stopped
809         https://bugs.webkit.org/show_bug.cgi?id=189073
810
811         Reviewed by Darin Adler.
812
813         There is a chance that IDBDatabase::hasPendingActivity returns true.
814         The case that might happen is when stop() is called but there are still some active/being committed transactions.
815         In that case, hasPendingActivity will return true until these transactions get finalized.
816         While these transactions will probably be finalized at some point, it delays GC for no good reason.
817         And we might want in a follow-up patch to assert that ActiveDOMObject are GC-able whenever their context is stopped.
818         For that purpose, make sure hasPendingActivity returns false when context is stopped.
819
820         * Modules/indexeddb/IDBDatabase.cpp:
821         (WebCore::IDBDatabase::hasPendingActivity const):
822
823 2018-08-28  Don Olmstead  <don.olmstead@sony.com>
824
825         [CMake] Use CMake's FindFreetype
826         https://bugs.webkit.org/show_bug.cgi?id=189071
827
828         Reviewed by Michael Catanzaro.
829
830         No new tests. No change in behavior.
831
832         * platform/FreeType.cmake:
833
834 2018-08-28  Wenson Hsieh  <wenson_hsieh@apple.com>
835
836         Work towards: [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
837         https://bugs.webkit.org/show_bug.cgi?id=189054
838
839         Reviewed by Andy Estes.
840
841         Remove the pasteboard type argument from PlatformPasteboard::readURL(). Currently, we only ever pass it
842         "public.url" anyways; for reading other types of strings, readString() already exists, which takes an arbitrary
843         pasteboard type.
844
845         * platform/PasteboardStrategy.h:
846         * platform/PlatformPasteboard.h:
847         * platform/ios/PasteboardIOS.mm:
848         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
849         (WebCore::Pasteboard::readPlatformValueAsString):
850         * platform/ios/PlatformPasteboardIOS.mm:
851         (WebCore::PlatformPasteboard::readURL):
852
853 2018-08-28  Youenn Fablet  <youenn@apple.com>
854
855         MediaDevices should be collectable as soon as its document is stopped
856         https://bugs.webkit.org/show_bug.cgi?id=189021
857
858         Reviewed by Eric Carlson.
859
860         Introduce ActiveDOMObject::isContextStopped to check whether the context is stopped.
861         Use this check in MediaDevices::hasPendingActivity so that it returns false as soon as active dom objects are stopped.
862
863         Test: http/tests/media/collect-media-devices.https.html
864
865         * Modules/mediastream/MediaDevices.cpp:
866         (WebCore::MediaDevices::hasPendingActivity const):
867         * dom/ActiveDOMObject.cpp:
868         (WebCore::ActiveDOMObject::hasPendingActivity const):
869         (WebCore::ActiveDOMObject::isContextStopped const):
870         * dom/ActiveDOMObject.h:
871
872 2018-08-28  Basuke Suzuki  <Basuke.Suzuki@sony.com>
873
874         [Curl] Fix issue that extra cookie is added when redirect happens.
875         https://bugs.webkit.org/show_bug.cgi?id=187874
876
877         Reviewed by Alex Christensen.
878
879         When initial request has cookie set and redirect happens, it add extra Cookie header to that
880         abd request was broken. Just stop modifying the original request by passing a value.
881
882         Test: http/tests/cookies/multiple-redirect-and-set-cookie.php
883
884         * platform/network/ResourceHandle.h:
885         * platform/network/curl/ResourceHandleCurl.cpp:
886         (WebCore::ResourceHandle::createCurlRequest):
887
888 2018-08-28  Aditya Keerthi  <akeerthi@apple.com>
889
890         [macOS] Color wells should appear rounded and textured
891         https://bugs.webkit.org/show_bug.cgi?id=189039
892
893         Reviewed by Tim Horton.
894
895         Color wells should have a rounded and textured appearance on macOS. We can use
896         NSBezelStyleTexturedSquare to achieve this appearance.
897
898         Also updated the user-agent stylesheet to match the system appearance.
899
900         Rebaselined existing test: fast/forms/color/input-appearance-color.html
901
902         * css/html.css:
903         (input[type="color"]::-webkit-color-swatch-wrapper):
904         (input[type="color"]::-webkit-color-swatch):
905         * platform/mac/ThemeMac.mm:
906         (WebCore::setUpButtonCell):
907         * rendering/RenderThemeMac.h: Build fix.
908
909 2018-08-28  Youenn Fablet  <youenn@apple.com>
910
911         WebKitMediaSession should be GC collectable when its document is being stopped
912         https://bugs.webkit.org/show_bug.cgi?id=189016
913
914         Reviewed by Eric Carlson.
915
916         Make sure WebKitMediaSession is  collectable after its document is stopped.
917         This is done by nullifying m_session when calling close.
918         This way hasPendingActivity() returns false when stop() is called.
919
920         Test: http/tests/media/clearkey/collect-webkit-media-session.html
921
922         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
923         (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
924         (WebCore::WebKitMediaKeySession::close):
925         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
926
927 2018-08-28  Ali Juma  <ajuma@chromium.org>
928
929         [IntersectionObserver] Fix build after r235424
930         https://bugs.webkit.org/show_bug.cgi?id=189051
931
932         Rubber-stamped by Simon Fraser.
933
934         Fix unused variable warning by using the variable.
935
936         * page/FrameView.cpp:
937         (WebCore::FrameView::viewportContentsChanged):
938
939 2018-08-28  Aditya Keerthi  <akeerthi@apple.com>
940
941         [iOS] Support inputmode=none
942         https://bugs.webkit.org/show_bug.cgi?id=188896
943
944         Reviewed by Tim Horton.
945
946         Updated InputMode.cpp to ensure that "none" is recognized as a valid value for the
947         inputmode attribute. This keyword is useful for content that renders its own
948         keyboard control.
949
950         Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities%3A-the-inputmode-attribute
951
952         Test: fast/forms/ios/inputmode-none.html
953
954         * html/InputMode.cpp:
955         (WebCore::inputModeForAttributeValue):
956         (WebCore::stringForInputMode):
957         (WebCore::InputModeNames::none):
958         * html/InputMode.h:
959
960 2018-08-28  Ali Juma  <ajuma@chromium.org>
961
962         [IntersectionObserver] Schedule intersection observation updates
963         https://bugs.webkit.org/show_bug.cgi?id=189007
964
965         Reviewed by Simon Fraser.
966
967         Schedule intersection observation updates in the following situations:
968         1) A new observation target is added.
969         2) FrameView::viewportContentsChanged -- this covers changes to layout and
970            to scroll positions for same-document observation. Scheduling for
971            cross-document observation will be handled in a future patch.
972         3) Style is resolved without triggering layout -- this handles updates that
973            were deferred because of a pending style recalculation.
974
975         Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.
976
977         * dom/Document.cpp:
978         (WebCore::Document::resolveStyle):
979         (WebCore::Document::updateIntersectionObservations):
980         (WebCore::Document::scheduleIntersectionObservationUpdate):
981         * dom/Document.h:
982         * page/FrameView.cpp:
983         (WebCore::FrameView::viewportContentsChanged):
984         * page/IntersectionObserver.cpp:
985         (WebCore::IntersectionObserver::observe):
986
987 2018-08-28  Zalan Bujtas  <zalan@apple.com>
988
989         [LFC][Floating] Remove redundant FloatAvoider functions.
990         https://bugs.webkit.org/show_bug.cgi?id=189035
991
992         Reviewed by Antti Koivisto.
993
994         and move some code from FloatContext to FloatAvoider.
995
996         * layout/floats/FloatAvoider.cpp:
997         (WebCore::Layout::FloatAvoider::initializePosition):
998         (WebCore::Layout::FloatAvoider::rect const):
999         (WebCore::Layout::FloatAvoider::setVerticalConstraint):
1000         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
1001         (WebCore::Layout::FloatAvoider::resetHorizontalConstraint):
1002         (WebCore::Layout::FloatAvoider::initialVerticalPosition const):
1003         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
1004         (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
1005         (WebCore::Layout::FloatAvoider::setLeft): Deleted.
1006         (WebCore::Layout::FloatAvoider::setTopLeft): Deleted.
1007         (WebCore::Layout::FloatAvoider::resetVertically): Deleted.
1008         (WebCore::Layout::FloatAvoider::resetHorizontally): Deleted.
1009         (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const): Deleted.
1010         * layout/floats/FloatAvoider.h:
1011         (WebCore::Layout::FloatAvoider::top const): Deleted.
1012         (WebCore::Layout::FloatAvoider::left const): Deleted.
1013         (WebCore::Layout::FloatAvoider::marginTop const): Deleted.
1014         (WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
1015         (WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
1016         (WebCore::Layout::FloatAvoider::marginRight const): Deleted.
1017         (WebCore::Layout::FloatAvoider::rectWithMargin const): Deleted.
1018         (WebCore::Layout::FloatAvoider::setTop): Deleted.
1019         * layout/floats/FloatingContext.cpp:
1020         (WebCore::Layout::FloatingContext::positionForFloat const):
1021         (WebCore::Layout::FloatingContext::floatingPosition const):
1022         (WebCore::Layout::FloatingPair::horizontalConstraints const):
1023         (WebCore::Layout::FloatingPair::horiztonalPosition const): Deleted.
1024
1025 2018-08-28  Eric Carlson  <eric.carlson@apple.com>
1026
1027         Revert changes to RealtimeMediaSource.cpp made in r235086
1028         https://bugs.webkit.org/show_bug.cgi?id=189046
1029         <rdar://problem/43794875>
1030
1031         Unreviewed, reverting an accidental change.
1032
1033         * platform/mediastream/RealtimeMediaSource.cpp:
1034         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): 
1035
1036 2018-08-28  Alejandro G. Castro  <alex@igalia.com>
1037
1038         Fix gcc compilation warnings after r235230
1039         https://bugs.webkit.org/show_bug.cgi?id=188981
1040
1041         Reviewed by Eric Carlson.
1042
1043         Replace the pragma clang with pragma GCC, it is understood by
1044         clang and gcc.
1045
1046         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
1047         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1048         * platform/mediastream/RealtimeIncomingAudioSource.h:
1049         * platform/mediastream/RealtimeIncomingVideoSource.h:
1050         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1051         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1052         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
1053         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1054         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1055         * testing/MockLibWebRTCPeerConnection.h:
1056
1057 2018-08-27  Justin Fan  <justin_fan@apple.com>
1058
1059         WebGL 2 conformance: framebuffer-test
1060         https://bugs.webkit.org/show_bug.cgi?id=188812
1061
1062         Reviewed by Jon Lee.
1063
1064         Update WebGL 2 implementation to handle READ_FRAMEBUFFER and default framebuffer conformance. Also taking this
1065         chance to fix memory leak in PlatformScreenMac/gpuIDForDisplayMask().
1066
1067         Covered by existing WebGL tests as well as newly-enabled webgl/2.0.0/conformance2/renderbuffers/framebuffer-test.html.
1068
1069         * html/canvas/WebGL2RenderingContext.cpp:
1070         (WebCore::WebGL2RenderingContext::blitFramebuffer):
1071         (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
1072         (WebCore::validateDefaultFramebufferAttachment):
1073         (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
1074         (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters):
1075         (WebCore::WebGL2RenderingContext::validateFramebufferTarget):
1076         (WebCore::WebGL2RenderingContext::validateNonDefaultFramebufferAttachment):
1077         (WebCore::WebGL2RenderingContext::getParameter):
1078         * html/canvas/WebGL2RenderingContext.h:
1079         * html/canvas/WebGLFramebuffer.cpp:
1080         (WebCore::WebGLFramebuffer::isBound const):
1081         * html/canvas/WebGLRenderingContextBase.cpp:
1082         (WebCore::WebGLRenderingContextBase::initializeNewContext):
1083         (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
1084         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
1085         (WebCore::WebGLRenderingContextBase::checkFramebufferStatus):
1086         (WebCore::WebGLRenderingContextBase::deleteFramebuffer):
1087         (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
1088         (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
1089         * html/canvas/WebGLRenderingContextBase.h:
1090         * platform/graphics/GraphicsContext3D.h:
1091         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1092         (WebCore::GraphicsContext3D::blitFramebuffer):
1093         * platform/mac/PlatformScreenMac.mm:
1094         (WebCore::gpuIDForDisplayMask):
1095
1096 2018-08-27  Myles C. Maxfield  <mmaxfield@apple.com>
1097
1098         Null pointer deref in WidthIterator
1099         https://bugs.webkit.org/show_bug.cgi?id=188993
1100
1101         Reviewed by Brent Fulgham.
1102
1103         Test: fast/text/rtl-justification.html
1104
1105         We simply need to guard glyphBuffer like we do in the rest of the function.
1106
1107         * platform/graphics/WidthIterator.cpp:
1108         (WebCore::WidthIterator::advanceInternal):
1109
1110 2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1111
1112         [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends
1113         https://bugs.webkit.org/show_bug.cgi?id=189004
1114
1115         Reviewed by Dan Bernstein.
1116
1117         No new tests, since there is no change in behavior.
1118
1119         * WebCore.xcodeproj/project.pbxproj:
1120         * editing/Editor.cpp:
1121         (WebCore::Editor::insertAttachment):
1122         * editing/Editor.h:
1123         * html/AttachmentTypes.h: Removed.
1124         * html/HTMLAttachmentElement.h:
1125
1126 2018-08-27  Keith Rollin  <krollin@apple.com>
1127
1128         Unreviewed build fix -- disable LTO for production builds
1129
1130         * Configurations/Base.xcconfig:
1131
1132 2018-08-27  Youenn Fablet  <youenn@apple.com>
1133
1134         Various IndexDB tests abandon documents
1135         https://bugs.webkit.org/show_bug.cgi?id=188728
1136         <rdar://problem/43651095>
1137
1138         Reviewed by Alex Christensen.
1139
1140         Some IDB objects implement hasPendingActivity but there are some possibilities that they continue returning true after being stopped.
1141         This is the case for requests that get stopped while still waiting for some pending activity.
1142         This is also the case for requests that emits upgradeneeded or blocked events.
1143
1144         Enforce that these objects return false to hasPendingActivity once being stopped.
1145         This ensures that they can be garbage collected once their context is preparing for destruction like in Document::prepareForDestruction.
1146
1147         Test: http/tests/IndexedDB/collect-IDB-objects.https.html
1148
1149         * Modules/indexeddb/IDBIndex.cpp:
1150         (WebCore::IDBIndex::hasPendingActivity const):
1151         * Modules/indexeddb/IDBObjectStore.cpp:
1152         (WebCore::IDBObjectStore::hasPendingActivity const):
1153         * Modules/indexeddb/IDBRequest.cpp:
1154         (WebCore::IDBRequest::hasPendingActivity const):
1155         (WebCore::IDBRequest::enqueueEvent):
1156         * Modules/indexeddb/IDBTransaction.cpp:
1157         (WebCore::IDBTransaction::notifyDidAbort):
1158         In case the context is stopped, IDBTransaction should not ask IDBRequest to fire an event.
1159
1160 2018-08-27  Simon Fraser  <simon.fraser@apple.com>
1161
1162         Teach WebKitTestRunner and DumpRenderTree about detecting world leaks
1163         https://bugs.webkit.org/show_bug.cgi?id=188994
1164
1165         Reviewed by Tim Horton.
1166
1167         Export Document::postTask() for use by WTR's injected bundle.
1168
1169         * dom/Document.h:
1170
1171 2018-08-27  Aditya Keerthi  <akeerthi@apple.com>
1172
1173         Consolidate ENABLE_INPUT_TYPE_COLOR and ENABLE_INPUT_TYPE_COLOR_POPOVER
1174         https://bugs.webkit.org/show_bug.cgi?id=188931
1175
1176         Reviewed by Wenson Hsieh.
1177
1178         * Configurations/FeatureDefines.xcconfig: Removed ENABLE_INPUT_TYPE_COLOR_POPOVER.
1179
1180 2018-08-27  Simon Fraser  <simon.fraser@apple.com>
1181
1182         Improve the showAllDocuments logging
1183         https://bugs.webkit.org/show_bug.cgi?id=188990
1184
1185         Reviewed by Tim Horton.
1186         
1187         Improve the output triggered by "notifyutil -p com.apple.WebKit.showAllDocuments" to denote
1188         SVG documents (which often have no URL), and to show the refCount and referencingNodeCount,
1189         which helps with leak debugging.
1190         
1191         Sample output:
1192
1193         2 live documents:
1194         Document 0x1236f1200 3 (refCount 6, referencingNodeCount 580) https://webkit.org/
1195         SVGDocument 0x134b60000 13 (refCount 1, referencingNodeCount 197) 
1196
1197         * page/mac/PageMac.mm:
1198         (WebCore::Page::platformInitialize):
1199
1200 2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1201
1202         [Cocoa] Exception (fileType 'dyn.agq8u' is not a valid UTI) raised when dragging an attachment whose file wrapper is a directory
1203         https://bugs.webkit.org/show_bug.cgi?id=188903
1204         <rdar://problem/43702993>
1205
1206         Reviewed by Tim Horton.
1207
1208         Fixes the exception for attachments that are created when dropping files with extensions that don't map to any
1209         known UTIs, and when dropping folders. See below for more detail.
1210
1211         Tests:  WKAttachmentTests.InsertFolderAndFileWithUnknownExtension
1212                 WKAttachmentTests.DropFolderAsAttachmentAndMoveByDragging
1213                 WKAttachmentTests.ChangeAttachmentDataAndFileInformation
1214
1215         * editing/Editor.cpp:
1216         (WebCore::Editor::insertAttachment):
1217         * editing/Editor.h:
1218         * editing/cocoa/WebContentReaderCocoa.mm:
1219         (WebCore::WebContentReader::readFilePaths):
1220
1221         When creating an attachment by dropping or pasting a file backed by a file path, handle the cases where…
1222         (1)     the dropped path is a directory, by setting the UTI to "public.directory". This allows us to show a
1223                 folder icon for the dropped attachment element on macOS.
1224         (2)     the dropped path is a file whose UTI is unknown, by defaulting to "public.data".
1225
1226         By ensuring that the UTI of a dropped file-backed attachment is set to a concrete type in any case, we avoid an
1227         exception when dragging the attachment on macOS, and on iOS, avoid silently failing to drag an attachment.
1228
1229         * html/HTMLAttachmentElement.cpp:
1230         (WebCore::HTMLAttachmentElement::updateAttributes):
1231
1232         Change this method to take an optional file size (the subtitle attribute will only be set if the file size is
1233         not `std::nullopt`). Furthermore, allow callers of this method to clear attributes on the attachment element by
1234         passing in `std::nullopt` for any of the three arguments. This allows us to handle the case where an
1235         attachment's file wrapper is changed from a regular file to a folder whose total size is currently unknown.
1236         Instead of showing "0 bytes", we'll simply refrain from showing a subtitle at all (in the future, this should
1237         be improved by implementing a way to estimate the size of the files in the folder, or perhaps show the number of
1238         items in the folder as the subtitle).
1239
1240         * html/HTMLAttachmentElement.h:
1241
1242 2018-08-27  Devin Rousso  <drousso@apple.com>
1243
1244         Web Inspector: provide autocompletion for event breakpoints
1245         https://bugs.webkit.org/show_bug.cgi?id=188717
1246
1247         Reviewed by Brian Burg.
1248
1249         Test: inspector/dom/getSupportedEventNames.html
1250
1251         * inspector/agents/InspectorDOMAgent.h:
1252         * inspector/agents/InspectorDOMAgent.cpp:
1253         (WebCore::InspectorDOMAgent::getSupportedEventNames): Added.
1254
1255 2018-08-27  Keith Rollin  <krollin@apple.com>
1256
1257         Build system support for LTO
1258         https://bugs.webkit.org/show_bug.cgi?id=187785
1259         <rdar://problem/42353132>
1260
1261         Reviewed by Dan Bernstein.
1262
1263         Update Base.xcconfig and DebugRelease.xcconfig to optionally enable
1264         LTO.
1265
1266         No new tests -- no new WebKit functionality.
1267
1268         * Configurations/Base.xcconfig:
1269         * Configurations/DebugRelease.xcconfig:
1270
1271 2018-08-27  Daniel Bates  <dabates@apple.com>
1272
1273         [iOS] Make color of spelling dots match UIKit
1274         https://bugs.webkit.org/show_bug.cgi?id=188861
1275
1276         Reviewed by Simon Fraser.
1277
1278         * rendering/RenderThemeCocoa.h:
1279         * rendering/RenderThemeCocoa.mm:
1280         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Modified to call colorForMarkerLineStyle()
1281         for the color to use for the line style.
1282         (WebCore::colorForStyle): Deleted.
1283         * rendering/RenderThemeIOS.h:
1284         * rendering/RenderThemeIOS.mm:
1285         (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Added.
1286         * rendering/RenderThemeMac.h:
1287         * rendering/RenderThemeMac.mm:
1288         (WebCore::RenderThemeMac::colorForMarkerLineStyle): Added.
1289
1290 2018-08-27  Daniel Bates  <dabates@apple.com>
1291
1292         Spelling dots do not scale with page on iOS; share spelling dot painting code between Mac and iOS
1293         https://bugs.webkit.org/show_bug.cgi?id=188828
1294         <rdar://problem/15966403>
1295
1296         Reviewed by Simon Fraser.
1297
1298         The look of the spelling dots on Mac and iOS are identical up to color. Towards making the
1299         spelling dots in WebKit on iOS more closely match the look of the spelling dots in UIKit-
1300         apps, standardize on using the same painting code for both Mac and iOS.
1301
1302         Currently iOS uses bitmaps to render the spelling dots and does not account for user/CSS
1303         zooming. As a result, the spelling dots on iOS render with artifacts (e.g. truncated dots).
1304         A side benefit of having iOS share the same painting code as Mac is that iOS will now paint
1305         the dots programmatically and we avoid both the need to use bitmaps and fix the bugs in
1306         the painting of the bitmap dots with respect to zooming.
1307
1308         * Resources/DictationPhraseWithAlternativesDot.png: Removed.
1309         * Resources/DictationPhraseWithAlternativesDot@2x.png: Removed.
1310         * Resources/SpellingDot.png: Removed.
1311         * Resources/SpellingDot@2x.png: Removed.
1312         * Resources/SpellingDot@3x.png: Removed.
1313         * WebCore.xcodeproj/project.pbxproj:
1314         * page/Page.cpp:
1315         (WebCore::Page::setDeviceScaleFactor):
1316         * platform/graphics/GraphicsContext.h:
1317         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1318         (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
1319         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1320         (WebCore::GraphicsContext::drawLineForDocumentMarker):
1321         (WebCore::findImage): Deleted.
1322         (WebCore::createDotPattern): Deleted.
1323         (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
1324         * platform/graphics/win/GraphicsContextCGWin.cpp:
1325         (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
1326         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1327         (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
1328         * platform/ios/wak/WKGraphics.mm:
1329         (WKRectFill): Incorporated the logic from _FillRectUsingOperation().
1330         (_FillRectUsingOperation): Deleted; moved the logic into WKRectFill() since WKRectFill()
1331         is now the only caller of this function.
1332         (WKRectFillUsingOperation): Deleted.
1333         (imageResourcePath): Deleted.
1334         (WKGraphicsCreateImageFromBundleWithName): Deleted.
1335         (WKDrawPatternBitmap): Deleted.
1336         (WKReleasePatternBitmap): Deleted.
1337         (WKSetPattern): Deleted.
1338         * platform/ios/wak/WKGraphicsInternal.h: Removed.
1339         * rendering/InlineTextBox.cpp:
1340         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
1341         * rendering/RenderThemeCocoa.h: Add headers RenderText.h and GraphicsContextCG.h. Fix some style nits while I am here;
1342         substitute #import for #include and remove some unnecessary headers TranslateTransformOperation.h, RenderStyle.h, and
1343         RenderElement.h.
1344         * rendering/RenderThemeCocoa.mm:
1345         (WebCore::colorForStyle):
1346         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Moved from RenderThemeMac. I renamed
1347         the local variable ctx to context and fixed a type in a comment while moving this code.
1348         * rendering/RenderThemeMac.h:
1349         * rendering/RenderThemeMac.mm:
1350         (WebCore::colorForStyle): Deleted; moved to class RenderThemeCocoa.
1351         (WebCore::RenderThemeMac::drawLineForDocumentMarker): Deleted; moved to class RenderThemeCocoa.
1352
1353 2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1354
1355         [Attachment Support] [WK2] Images copied from Mail message view paste with the wrong file name in compose
1356         https://bugs.webkit.org/show_bug.cgi?id=188957
1357         <rdar://problem/43737715>
1358
1359         Reviewed by Darin Adler.
1360
1361         Allow the alt attribute of a pasted image element to determine the name of an image attachment, rather than
1362         using the source URL's last path component first. This is because in some clients, such as Mail, the source of
1363         the image element is some nondescript UUID, and the alt text contains the real name of the image.
1364
1365         Test: WKAttachmentTests.PasteWebArchiveContainingImages
1366
1367         * editing/cocoa/WebContentReaderCocoa.mm:
1368         (WebCore::replaceRichContentWithAttachments):
1369
1370 2018-08-27  Alex Christensen  <achristensen@webkit.org>
1371
1372         Fix IOSMAC build
1373         https://bugs.webkit.org/show_bug.cgi?id=188934
1374         <rdar://problem/43694979>
1375
1376         Reviewed by Darin Adler.
1377
1378         * platform/network/cf/FormDataStreamCFNet.cpp:
1379
1380 2018-08-27  Rob Buis  <rbuis@igalia.com>
1381
1382         XMLHTTPRequest.send for Document should have same Content-Type processing rules as String
1383         https://bugs.webkit.org/show_bug.cgi?id=188953
1384
1385         Reviewed by Darin Adler.
1386
1387         Processing rules for Content-Type have been implemented for send with String as parameter, but
1388         not for Document, but both should be treated the same according to the spec [1]. This patch
1389         implements this.
1390
1391         Behavior matches Firefox.
1392
1393         [1] https://xhr.spec.whatwg.org/#the-send()-method
1394
1395         Test: web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm
1396
1397         * xml/XMLHttpRequest.cpp:
1398         (WebCore::XMLHttpRequest::send):
1399
1400 2018-08-27  Ali Juma  <ajuma@chromium.org>
1401
1402         [IntersectionObserver] Implement intersection logic for the explicit root case
1403         https://bugs.webkit.org/show_bug.cgi?id=188809
1404
1405         Reviewed by Simon Fraser.
1406
1407         Add logic to Document::updateIntersectionObservations to compute the intersection
1408         between the target and root elements, for the case where an IntersectionObserver
1409         has a root element.
1410
1411         There are no changes to the scheduling of intersection observations in this patch,
1412         so observations are still only computed once for each observer.
1413
1414         * dom/Document.cpp:
1415         (WebCore::computeIntersectionRects):
1416         (WebCore::Document::updateIntersectionObservations):
1417         * page/FrameView.cpp:
1418         (WebCore::FrameView::absoluteToClientRect const):
1419         * page/FrameView.h:
1420         * page/IntersectionObserver.cpp:
1421         (WebCore::IntersectionObserver::IntersectionObserver):
1422         (WebCore::IntersectionObserver::createTimestamp const):
1423         * page/IntersectionObserver.h:
1424         * platform/graphics/FloatRect.h:
1425         (WebCore::FloatRect::area const):
1426         * rendering/RenderBlock.cpp:
1427         (WebCore::RenderBlock::isContainingBlockAncestorFor const):
1428         * rendering/RenderBlock.h:
1429
1430 2018-08-25  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1431
1432         Shrink size of HTMLCollection
1433         https://bugs.webkit.org/show_bug.cgi?id=188945
1434
1435         Reviewed by Darin Adler.
1436
1437         Shrink the size of HTMLCollection by reordering members.
1438
1439         No behavior change.
1440
1441         * html/HTMLCollection.cpp:
1442         (WebCore::HTMLCollection::HTMLCollection):
1443         * html/HTMLCollection.h:
1444
1445 2018-08-25  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1446
1447         Shrink size of XMLHttpRequest
1448         https://bugs.webkit.org/show_bug.cgi?id=188944
1449
1450         Reviewed by Saam Barati.
1451
1452         Shrink the size of XMLHttpRequest by packing bits and reordering members.
1453         It reduces the size from 1248 to 1176.
1454
1455         No behavior change.
1456
1457         * xml/XMLHttpRequest.cpp:
1458         (WebCore::XMLHttpRequest::XMLHttpRequest):
1459         (WebCore::XMLHttpRequest::responseText):
1460         (WebCore::XMLHttpRequest::createResponseBlob):
1461         (WebCore::XMLHttpRequest::createResponseArrayBuffer):
1462         (WebCore::XMLHttpRequest::setResponseType):
1463         (WebCore::XMLHttpRequest::changeState):
1464         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
1465         (WebCore::XMLHttpRequest::setWithCredentials):
1466         (WebCore::XMLHttpRequest::open):
1467         (WebCore::XMLHttpRequest::prepareToSend):
1468         (WebCore::XMLHttpRequest::createRequest):
1469         (WebCore::XMLHttpRequest::abort):
1470         (WebCore::XMLHttpRequest::overrideMimeType):
1471         (WebCore::XMLHttpRequest::setRequestHeader):
1472         (WebCore::XMLHttpRequest::getAllResponseHeaders const):
1473         (WebCore::XMLHttpRequest::getResponseHeader const):
1474         (WebCore::XMLHttpRequest::status const):
1475         (WebCore::XMLHttpRequest::statusText const):
1476         (WebCore::XMLHttpRequest::didFinishLoading):
1477         (WebCore::XMLHttpRequest::createDecoder const):
1478         (WebCore::XMLHttpRequest::didReceiveData):
1479         (WebCore::XMLHttpRequest::didReachTimeout):
1480         (WebCore::XMLHttpRequest::readyState const): Deleted.
1481         * xml/XMLHttpRequest.h:
1482         (WebCore::XMLHttpRequest::responseType const):
1483         (WebCore::XMLHttpRequest::readyState const):
1484         * xml/XMLHttpRequestProgressEventThrottle.cpp:
1485         (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle):
1486         * xml/XMLHttpRequestProgressEventThrottle.h:
1487
1488 2018-08-26  Zalan Bujtas  <zalan@apple.com>
1489
1490         [LFC][Floating] FloatBox -> FloatAvoider
1491         https://bugs.webkit.org/show_bug.cgi?id=188941
1492
1493         Reviewed by Antti Koivisto.
1494
1495         This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.
1496
1497         * Sources.txt:
1498         * WebCore.xcodeproj/project.pbxproj:
1499         * layout/displaytree/DisplayBox.h:
1500         * layout/floats/FloatAvoider.cpp: Renamed from Source/WebCore/layout/floats/FloatBox.cpp.
1501         (WebCore::Layout::FloatAvoider::FloatAvoider):
1502         (WebCore::Layout::FloatAvoider::initializePosition):
1503         (WebCore::Layout::FloatAvoider::isLeftAligned const):
1504         (WebCore::Layout::FloatAvoider::setLeft):
1505         (WebCore::Layout::FloatAvoider::setTopLeft):
1506         (WebCore::Layout::FloatAvoider::resetVertically):
1507         (WebCore::Layout::FloatAvoider::resetHorizontally):
1508         (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const):
1509         * layout/floats/FloatAvoider.h: Renamed from Source/WebCore/layout/floats/FloatBox.h.
1510         (WebCore::Layout::FloatAvoider::top const):
1511         (WebCore::Layout::FloatAvoider::left const):
1512         (WebCore::Layout::FloatAvoider::marginTop const):
1513         (WebCore::Layout::FloatAvoider::marginLeft const):
1514         (WebCore::Layout::FloatAvoider::marginBottom const):
1515         (WebCore::Layout::FloatAvoider::marginRight const):
1516         (WebCore::Layout::FloatAvoider::rectWithMargin const):
1517         (WebCore::Layout::FloatAvoider::setTop):
1518         * layout/floats/FloatingContext.cpp:
1519         (WebCore::Layout::FloatingContext::positionForFloat const):
1520         (WebCore::Layout::FloatingContext::floatingPosition const):
1521         * layout/floats/FloatingContext.h:
1522
1523 2018-08-26  Christopher Reid  <chris.reid@sony.com>
1524
1525         [Curl] Implement deleteCookie()
1526         https://bugs.webkit.org/show_bug.cgi?id=188908
1527
1528         Reviewed by Fujii Hironori.
1529
1530         Support deleting cookies from the web inspector
1531
1532         Tested from the web inspector.
1533
1534         * platform/network/curl/CookieJarCurlDatabase.cpp:
1535         (WebCore::CookieJarCurlDatabase::deleteCookie const):
1536
1537 2018-08-26  Zalan Bujtas  <zalan@apple.com>
1538
1539         [LFC][Floating] Simplify FloatingState::FloatItem class
1540         https://bugs.webkit.org/show_bug.cgi?id=188912
1541
1542         Reviewed by Antti Koivisto.
1543
1544         Let's remove some redundant code now that FloatingState::FloatItem is not used for incoming floats anymore.
1545
1546         * layout/Verification.cpp:
1547         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
1548         * layout/floats/FloatBox.cpp:
1549         (WebCore::Layout::FloatBox::resetVertically):
1550         * layout/floats/FloatingContext.cpp:
1551         (WebCore::Layout::FloatingPair::left const):
1552         (WebCore::Layout::FloatingPair::right const):
1553         (WebCore::Layout::FloatingPair::intersects const):
1554         (WebCore::Layout::previousFloatingIndex):
1555         (WebCore::Layout::Iterator::operator++):
1556         (WebCore::Layout::Iterator::set):
1557         * layout/floats/FloatingState.cpp:
1558         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
1559         (WebCore::Layout::FloatingState::remove):
1560         (WebCore::Layout::FloatingState::bottom const):
1561         * layout/floats/FloatingState.h:
1562         (WebCore::Layout::FloatingState::FloatItem::operator== const):
1563         (WebCore::Layout::FloatingState::FloatItem::isLeftPositioned const):
1564         (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
1565         (WebCore::Layout::FloatingState::FloatItem::bottom const):
1566         (WebCore::Layout::FloatingState::leftBottom const):
1567         (WebCore::Layout::FloatingState::rightBottom const):
1568         (WebCore::Layout::FloatingState::bottom const):
1569         (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const):
1570         (WebCore::Layout::FloatingState::FloatItem::layoutBox const): Deleted.
1571         (WebCore::Layout::FloatingState::FloatItem::containingBlock const): Deleted.
1572         (WebCore::Layout::FloatingState::FloatItem::displayBox const): Deleted.
1573         (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const): Deleted.
1574
1575 2018-08-26  Andy Estes  <aestes@apple.com>
1576
1577         [Apple Pay] Introduce new values for -apple-pay-button-type
1578         https://bugs.webkit.org/show_bug.cgi?id=188949
1579         <rdar://problem/39992228>
1580
1581         Reviewed by Anders Carlsson.
1582
1583         Added "in-store", "checkout", "book", and "subscribe" keywords for -apple-pay-button-type,
1584         and mapped those values to their equivalent PKPaymentButtonTypes.
1585
1586         Tests: http/tests/ssl/applepay/ApplePayButton.html
1587                http/tests/ssl/applepay/ApplePayButtonV4.html
1588
1589         * css/CSSPrimitiveValueMappings.h:
1590         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1591         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
1592         * css/CSSValueKeywords.in:
1593         * css/parser/CSSParserFastPaths.cpp:
1594         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1595         * rendering/RenderThemeCocoa.mm:
1596         (WebCore::toPKPaymentButtonType):
1597         * rendering/style/RenderStyleConstants.h:
1598
1599 2018-08-26  Youenn Fablet  <youenn@apple.com>
1600
1601         Make IDBCursor::m_request a WeakPtr
1602         https://bugs.webkit.org/show_bug.cgi?id=188938
1603
1604         Reviewed by Alex Christensen.
1605
1606         Make m_request a WeakPtr so that if m_request is destroyed, the related cursor will not use the invalid pointer.
1607
1608         Covered by existing tests.
1609
1610         * Modules/indexeddb/IDBCursor.cpp:
1611         (WebCore::IDBCursor::continuePrimaryKey): Other continue and advance methods that are calling uncheckedIterateCursor do check for m_request.
1612         Apply the same check for continuePrimaryKey.
1613         (WebCore::IDBCursor::uncheckedIterateCursor):
1614         * Modules/indexeddb/IDBCursor.h:
1615         (WebCore::IDBCursor::setRequest):
1616         (WebCore::IDBCursor::clearRequest):
1617         (WebCore::IDBCursor::request):
1618         * Modules/indexeddb/IDBRequest.h:
1619
1620 2018-08-26  Youenn Fablet  <youenn@apple.com>
1621
1622         IDBCursor does not need to be an ActiveDOMObject
1623         https://bugs.webkit.org/show_bug.cgi?id=188937
1624
1625         Reviewed by Alex Christensen.
1626
1627         Remove ActiveDOMObject from IDBCursor IDL.
1628         Update constructors and call sites accordingly.
1629         This allows removing m_outstandingRequestCount and related code in IDBRequest.
1630
1631         Covered by existing tests.
1632
1633         * Modules/indexeddb/IDBCursor.cpp:
1634         (WebCore::IDBCursor::create):
1635         (WebCore::IDBCursor::IDBCursor):
1636         (WebCore::IDBCursor::update):
1637         (WebCore::IDBCursor::uncheckedIterateCursor):
1638         (WebCore::IDBCursor::deleteFunction):
1639         (WebCore::IDBCursor::activeDOMObjectName const): Deleted.
1640         (WebCore::IDBCursor::canSuspendForDocumentSuspension const): Deleted.
1641         (WebCore::IDBCursor::hasPendingActivity const): Deleted.
1642         (WebCore::IDBCursor::decrementOutstandingRequestCount): Deleted.
1643         * Modules/indexeddb/IDBCursor.h:
1644         * Modules/indexeddb/IDBCursor.idl:
1645         * Modules/indexeddb/IDBCursorWithValue.cpp:
1646         (WebCore::IDBCursorWithValue::create):
1647         (WebCore::IDBCursorWithValue::IDBCursorWithValue):
1648         * Modules/indexeddb/IDBCursorWithValue.h:
1649         * Modules/indexeddb/IDBCursorWithValue.idl:
1650         * Modules/indexeddb/IDBRequest.cpp:
1651         (WebCore::IDBRequest::setSource):
1652         (WebCore::IDBRequest::dispatchEvent):
1653         (WebCore::IDBRequest::willIterateCursor):
1654         (WebCore::IDBRequest::didOpenOrIterateCursor):
1655         * Modules/indexeddb/IDBRequest.h:
1656         * Modules/indexeddb/IDBTransaction.cpp:
1657         (WebCore::IDBTransaction::requestOpenCursor):
1658         * WebCore.xcodeproj/project.pbxproj:
1659
1660 2018-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1661
1662         [Attachment Support] Dropping and pasting images should insert inline image elements with _WKAttachments
1663         https://bugs.webkit.org/show_bug.cgi?id=188933
1664         <rdar://problem/43699724>
1665
1666         Reviewed by Darin Adler.
1667
1668         Support the ability to drop and paste images as image elements, with attachment elements, only if attachment
1669         elements are enabled. See changes below for more detail.
1670
1671         Tests:  WKAttachmentTests.CutAndPastePastedImage
1672                 WKAttachmentTests.MovePastedImageByDragging
1673                 WKAttachmentTests.RemoveNewlinesBeforePastedImage
1674
1675         * editing/Editor.h:
1676         * editing/cocoa/EditorCocoa.mm:
1677         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
1678
1679         Adjust this helper to take an Element& rather than an HTMLAttachmentElement&, and address a FIXME by writing the
1680         document origin identifier to the pasteboard via custom pasteboard data when dragging an attachment. This allows
1681         us to avoid creating extra image and attachment elements when dragging an image backed by an attachment within
1682         the same document.
1683
1684         * editing/cocoa/WebContentReaderCocoa.mm:
1685         (WebCore::contentTypeIsSuitableForInlineImageRepresentation):
1686
1687         Add a helper to determine whether a content type (UTI or MIME type) should be read as an inline image.
1688
1689         (WebCore::createFragmentForImageAttachment):
1690         (WebCore::replaceRichContentWithAttachments):
1691         (WebCore::WebContentReader::readFilePaths):
1692
1693         Teach codepaths where we currently create attachment elements to instead create image elements if the MIME type,
1694         is something suitable for display via an inline image element; add the attachment element under the shadow root
1695         of the image element.
1696
1697         * editing/markup.cpp:
1698         (WebCore::StyledMarkupAccumulator::appendCustomAttributes):
1699         (WebCore::restoreAttachmentElementsInFragment):
1700
1701         When dragging or copying an image element, we need to make sure that any attachment element backing the image
1702         is preserved in the pasted or dropped fragment. To do this, we use a technique similar to what was done for
1703         r180785 and r224593 and write a temporary "webkitattachmentid" attribute to the serialized markup on copy. Upon
1704         deserializing the markup back to a fragment, we then create an attachment element with the same identifier under
1705         the image.
1706
1707         (WebCore::createFragmentFromMarkup):
1708         * html/HTMLAttachmentElement.h:
1709         * html/HTMLImageElement.cpp:
1710         (WebCore::HTMLImageElement::setAttachmentElement):
1711         (WebCore::HTMLImageElement::attachmentElement const):
1712
1713         Helper methods to get and set an attachment element under an image element. Setting an image's attachment
1714         element puts that attachment element under the shadow root of the image, and also hides the attachment element.
1715
1716         (WebCore::HTMLImageElement::attachmentIdentifier const):
1717
1718         Returns the identifier of an attachment element associated with the image element, or null.
1719
1720         * html/HTMLImageElement.h:
1721         * html/HTMLImageElement.idl:
1722
1723         Add HTMLImageElement.webkitAttachmentIdentifier, a readonly attribute guarded by runtime-enabled attachment
1724         element feature.
1725
1726         * page/DragController.cpp:
1727         (WebCore::DragController::startDrag):
1728
1729         In the case of dragging an image, if that image element is backed by an attachment element, don't bother writing
1730         the image data to the clipboard; instead, write the attachment data as a promise.
1731
1732         (WebCore::DragController::doImageDrag):
1733
1734         Plumb promised attachment information to DragController::doSystemDrag.
1735
1736         (WebCore::DragController::promisedAttachmentInfo):
1737
1738         Teach this to handle attachment elements as well as image elements that are backed by attachment elements.
1739
1740         * page/DragController.h:
1741         * platform/PromisedAttachmentInfo.h:
1742         (WebCore::PromisedAttachmentInfo::operator bool const):
1743
1744         A valid PromisedAttachmentInfo no longer requires a contentType to be set; instead, an attachment identifier
1745         alone is sufficient, since an up-to-date content type can be requested in the UI process from the API attachment
1746         object.
1747
1748 2018-08-26  Andy Estes  <aestes@apple.com>
1749
1750         [Apple Pay] PaymentRequest.show() should reject when an unsupported ApplePayRequest version is specified
1751         https://bugs.webkit.org/show_bug.cgi?id=188954
1752
1753         Reviewed by Darin Adler.
1754
1755         In Apple Pay JS, calling the ApplePaySession constructor with an unsupported version results
1756         in an exception being thrown. We need to do something similar for Payment Request.
1757
1758         This patch moves the logic for validating the version from ApplePaySession to a common
1759         routine in ApplePayRequestBase that both APIs call to convert requests into a common format.
1760
1761         In Apple Pay JS, an exception will still be thrown when constructing an ApplePaySession. In
1762         Payment Request, the promise returned by show() will be rejected.
1763
1764         Added test cases to http/tests/ssl/applepay/PaymentRequest.https.html.
1765
1766         * Modules/applepay/ApplePayRequestBase.cpp:
1767         (WebCore::convertAndValidate):
1768         * Modules/applepay/ApplePaySession.cpp:
1769         (WebCore::ApplePaySession::create):
1770
1771 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
1772
1773         Click event from click() is not composed
1774         https://bugs.webkit.org/show_bug.cgi?id=170211
1775
1776         Reviewed by Wenson Hsieh.
1777
1778         Fixed the bug. All simulated clicks should be composed regardless of whether it's trusted or not.
1779         See: https://html.spec.whatwg.org/multipage/interaction.html#dom-click
1780              https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-synthetic-mouse-event
1781
1782         * dom/SimulatedClick.cpp:
1783
1784 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
1785
1786         Avoid calling setUntrusted in SimulatedMouseEvent
1787         https://bugs.webkit.org/show_bug.cgi?id=188929
1788
1789         Reviewed by Simon Fraser.
1790
1791         Added IsTrusted flag to Event constructors instead of creating a trusted event
1792         and making it untrusted in the constructor of SimulatedMouseEvent.
1793
1794         This makes EventTarget::dispatchEventForBindings the only caller of setUntrusted().
1795
1796         * dom/Event.cpp:
1797         (WebCore::Event::Event):
1798         * dom/Event.h:
1799         * dom/KeyboardEvent.cpp:
1800         (WebCore::KeyboardEvent::KeyboardEvent):
1801         * dom/MouseEvent.cpp:
1802         (WebCore::MouseEvent::create):
1803         (WebCore::MouseEvent::MouseEvent):
1804         * dom/MouseEvent.h:
1805         * dom/MouseRelatedEvent.cpp:
1806         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
1807         * dom/MouseRelatedEvent.h:
1808         * dom/SimulatedClick.cpp:
1809         * dom/UIEvent.cpp:
1810         (WebCore::UIEvent::UIEvent):
1811         * dom/UIEvent.h:
1812         * dom/UIEventWithKeyState.h:
1813         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
1814         * dom/WheelEvent.cpp:
1815         (WebCore::WheelEvent::WheelEvent):
1816
1817 2018-08-24  Jer Noble  <jer.noble@apple.com>
1818
1819         Using Touch Bar to scrub video on Youtube results in video playback freeze
1820         https://bugs.webkit.org/show_bug.cgi?id=188926
1821
1822         Reviewed by Eric Carlson.
1823
1824         Test: media/media-source/media-source-seek-twice.html
1825
1826         When converting from a double-precision float to a MediaTime, a certain amount of precision is lost. If that
1827         results in a round-trip between `float in -> MediaTime -> float out` where in != out, we will wait forever for
1828         the time jump observer to fire. Break the cycle by comparing m_lastSeekTime to the synchronizerTime only after
1829         m_lastSeekTime has been normalized into a rational-time value.
1830
1831         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1832         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
1833
1834 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
1835
1836         Pass in IsComposed flag to Event constructors
1837         https://bugs.webkit.org/show_bug.cgi?id=188720
1838         <rdar://problem/43580387>
1839
1840         Reviewed by Simon Fraser.
1841
1842         This patch replaces the logic in Event::isComposed to decide whether an event is composed or not by
1843         explicitly passing IsComposed flag to Event constructor. This decouples being composed from whether
1844         an event is trusted and of a partciular event type, paving our way to make synthetic click event
1845         dispatched by an author script composable in webkit.org/b/170211.
1846
1847         This patch also removes IsTrusted from the argument list of event constructors and create functions
1848         to systematically eliminate the possibility of this patch making an event uncomposed by not setting
1849         IsComposed flag.
1850
1851         No new tests since there should be no behavioral change.
1852
1853         * dom/ClipboardEvent.cpp:
1854         (WebCore::ClipboardEvent::ClipboardEvent): A trusted ClipboardEvent is composed.
1855         * dom/ClipboardEvent.h:
1856         (WebCore::ClipboardEvent::ClipboardEvent): Removed IsTrusted from the variant which takes Init object
1857         to make sure this refactoring is correct.
1858         (WebCore::ClipboardEvent::create): Ditto.
1859         * dom/CompositionEvent.cpp:
1860         (WebCore::CompositionEvent::CompositionEvent): A trusted CompositionEvent is composed.
1861         * dom/CompositionEvent.h:
1862         * dom/Element.cpp:
1863         (WebCore::Element::dispatchMouseEvent): A trusted dblclick event is composed (this is a non-standard
1864         event but virtually every mouse event is composed so it makes sense to make this composed).
1865         * dom/Event.cpp:
1866         (WebCore::Event::Event):
1867         (WebCore::Event::create):
1868         (WebCore::Event::composed const): Deleted. The trival implementation moved to the header file.
1869         * dom/Event.h:
1870         (WebCore::Event::composed const):
1871         * dom/FocusEvent.cpp:
1872         (WebCore::FocusEvent::FocusEvent): A trusted Focus event is composed.
1873         * dom/FocusEvent.h:
1874         (WebCore::FocusEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
1875         (WebCore::FocusEvent::FocusEvent): Ditto.
1876         * dom/InputEvent.cpp:
1877         (WebCore::InputEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
1878         (WebCore::InputEvent::InputEvent): A trsuted InputEvent is composed.
1879         * dom/InputEvent.h:
1880         * dom/KeyboardEvent.cpp:
1881         (WebCore::KeyboardEvent::KeyboardEvent): A trsuted KeyboardEvent is composed.
1882         (WebCore::KeyboardEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
1883         * dom/KeyboardEvent.h:
1884         * dom/MouseEvent.cpp:
1885         (WebCore::MouseEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
1886         (WebCore::MouseEvent::MouseEvent): Explicitly take IsComposed flag from subclasses since simulated click
1887         does not currently compose.
1888         * dom/MouseEvent.h:
1889         * dom/MouseRelatedEvent.cpp:
1890         (WebCore::MouseRelatedEvent::MouseRelatedEvent): A trusted touch event is composed.
1891         * dom/MouseRelatedEvent.h:
1892         * dom/Node.cpp:
1893         (WebCore::Node::dispatchDOMActivateEvent): A trusted DOMActivateEvent event is composed.
1894         (WebCore::Node::dispatchInputEvent): A trusted input event is composed.
1895         * dom/SimulatedClick.cpp:
1896         (SimulatedMouseEvent::SimulatedMouseEvent): A simulated click is composed if it's a trusted event for now.
1897         This is the bug to be fixed in webkit.org/b/170211.
1898         * dom/TextEvent.cpp:
1899         (WebCore::TextEvent::TextEvent): A trsuted textInput event is composed.
1900         * dom/UIEvent.cpp:
1901         (WebCore::UIEvent::UIEvent): Added IsComposed as an argument to the variant which creates a trusted event,
1902         and removed IsTrusted from Init variant for the correctness guarantee.
1903         * dom/UIEvent.h:
1904         (WebCore::UIEvent::create): Ditto.
1905         * dom/UIEventWithKeyState.h:
1906         (WebCore::UIEventWithKeyState::UIEventWithKeyState): Ditto.
1907         * dom/WheelEvent.cpp:
1908         (WebCore::WheelEvent::WheelEvent): A trusted Wheel event, which is a subclass of MouseEvent, is composed.
1909         (WebCore::WheelEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
1910         * dom/WheelEvent.h:
1911         * editing/Editor.cpp:
1912         (WebCore::dispatchBeforeInputEvent):
1913         (WebCore::dispatchInputEvent):
1914         (WebCore::dispatchClipboardEvent): Call the newly added variant which takes DataTransfer directly so that
1915         we can remove IsTrusted from the variant which takes Init for the correctness guarantee.
1916         * page/EventHandler.cpp:
1917         (WebCore::EventHandler::dispatchDragEvent): A trusted mouse event is composed.
1918
1919 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
1920
1921         Add getModifierState to MouseEvent
1922         https://bugs.webkit.org/show_bug.cgi?id=188913
1923         <rdar://problem/43668772>
1924
1925         Reviewed by Simon Fraser.
1926
1927         Moved getModifierState from KeyboardEvent to UIEventWithKeyState and exposed it in MouseEvent.
1928         See https://www.w3.org/TR/2016/WD-uievents-20160804/#mouseevent
1929
1930         This patch also fixes the bug that initMouseEvent was not clearing AltGraph and CapsLock states,
1931         which was preserved in the refactoring done in r235158.
1932
1933         Tests: fast/events/constructors/mouse-event-getModifierState.html
1934                fast/events/dblclick-event-getModifierState.html
1935
1936         * dom/KeyboardEvent.cpp:
1937         (WebCore::KeyboardEvent::getModifierState const): Moved to UIEventWithKeyState.
1938         * dom/KeyboardEvent.h:
1939         * dom/KeyboardEvent.idl: Insert a blank line to match the spec's IDL.
1940         * dom/MouseEvent.idl: Added getModifierState. 
1941         * dom/UIEventWithKeyState.cpp:
1942         (WebCore::UIEventWithKeyState::modifiersFromInitializer): Moved from the header file.
1943         (WebCore::UIEventWithKeyState::getModifierState const):
1944         (WebCore::UIEventWithKeyState::setModifierKeys): Moved from the header file.
1945         * dom/UIEventWithKeyState.h:
1946         (WebCore::UIEventWithKeyState::modifierKeys const):
1947         (WebCore::UIEventWithKeyState::setModifierKeys): Deleted the variant which didn't take altGraphKey
1948         since that variant behaves same as the one which takes altGraphKey.
1949
1950 2018-08-24  Youenn Fablet  <youenn@apple.com>
1951
1952         libwebrtc PeerConnection::AddTrack sometimes fail
1953         https://bugs.webkit.org/show_bug.cgi?id=188914
1954
1955         Reviewed by Eric Carlson.
1956
1957         AddTrack may fail so test the result and if not successful, make JS addTrack to throw an exception.
1958         This makes some tests to fail now.
1959         These tests should pass again when unified plan will be enabled.
1960         Covered by rebased tests.
1961
1962         * Modules/mediastream/PeerConnectionBackend.h:
1963         (WebCore::PeerConnectionBackend::notifyAddedTrack):
1964         * Modules/mediastream/RTCPeerConnection.cpp:
1965         (WebCore::RTCPeerConnection::addTrack):
1966         (WebCore::RTCPeerConnection::addTransceiver):
1967         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1968         (WebCore::LibWebRTCMediaEndpoint::addTrack):
1969         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1970         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1971         (WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
1972         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1973
1974 2018-08-24  Adrian Perez de Castro  <aperez@igalia.com>
1975
1976         [FreeType] Do not cast through GLib types in FontCustomPlatformDataFreeType.cpp
1977         https://bugs.webkit.org/show_bug.cgi?id=188919
1978
1979         Reviewed by Michael Catanzaro.
1980
1981         No new tests needed.
1982
1983         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1984         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Cast
1985         through "void (*)(void)" instead of GCallback to avoid the warning
1986         produced by -Wcast-function-type.
1987
1988 2018-08-24  Andy Estes  <aestes@apple.com>
1989
1990         [Apple Pay] Allow $0 totals
1991         https://bugs.webkit.org/show_bug.cgi?id=185150
1992         <rdar://problem/39212331>
1993
1994         Reviewed by Dan Bernstein.
1995
1996         Relaxed payment request validation to allow $0 totals. This matches PassKit behavior.
1997
1998         Updated test cases in http/tests/ssl/applepay/.
1999
2000         * Modules/applepay/PaymentRequestValidator.mm:
2001         (WebCore::PaymentRequestValidator::validateTotal):
2002
2003 2018-08-24  Frederic Wang  <fwang@igalia.com>
2004
2005         Remove ScrollByPrecisePixel granularity
2006         https://bugs.webkit.org/show_bug.cgi?id=188915
2007
2008         Reviewed by Carlos Garcia Campos.
2009
2010         ScrollByPrecisePixel was introduced in bug 87535 and bug 91020 for Chromium Linux/Windows but
2011         it is no longer used.
2012
2013         No new tests, behavior unchanged.
2014
2015         * platform/ScrollAnimatorSmooth.cpp:
2016         (WebCore::ScrollAnimatorSmooth::scroll): Remove special handling for ScrollByPrecisePixel.
2017         * platform/ScrollTypes.h: Remove ScrollByPrecisePixel, it is never used.
2018         * platform/ScrollableArea.cpp:
2019         (WebCore::ScrollableArea::scroll): Remove special handling for ScrollByPrecisePixel.
2020         * platform/gtk/ScrollAnimatorGtk.cpp:
2021         (WebCore::ScrollAnimatorGtk::scroll): Remove special handling for ScrollByPrecisePixel.
2022
2023 2018-08-24  Antti Koivisto  <antti@apple.com>
2024
2025         Allow creating WeakPtrs to const objects
2026         https://bugs.webkit.org/show_bug.cgi?id=188785
2027
2028         Reviewed by Geoff Garen.
2029
2030         Remove some unneeded const_casts.
2031
2032         * css/MediaQueryEvaluator.cpp:
2033         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
2034         (WebCore::MediaQueryEvaluator::evaluate const):
2035         * css/MediaQueryEvaluator.h:
2036         * rendering/FloatingObjects.cpp:
2037         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
2038         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
2039         (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
2040         (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
2041         (WebCore::FloatingObjects::FloatingObjects):
2042         * rendering/FloatingObjects.h:
2043         (WebCore::FloatingObjects::renderer const):
2044
2045 2018-08-24  Zan Dobersek  <zdobersek@igalia.com>
2046
2047         [CoordGraphics] Move inline methods on CoordinatedGraphicsLayer out-of-line
2048         https://bugs.webkit.org/show_bug.cgi?id=188916
2049
2050         Reviewed by Carlos Garcia Campos.
2051
2052         Style checker produced complaints that CoordinatedGraphicsLayer class is
2053         using inline-defined methods despite the WEBCORE_EXPORT macro being used
2054         for the whole class. Keep the macro where it is but instead move the
2055         method definitions out-of-line.
2056
2057         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2058         (WebCore::CoordinatedGraphicsLayer::isCoordinatedGraphicsLayer const):
2059         (WebCore::CoordinatedGraphicsLayer::id const):
2060         (WebCore::CoordinatedGraphicsLayer::primaryLayerID const):
2061         (WebCore::CoordinatedGraphicsLayer::usesContentsLayer const):
2062         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2063
2064 2018-08-24  Antti Koivisto  <antti@apple.com>
2065
2066         Use OptionSet::containsAny and containsAll in some more places
2067         https://bugs.webkit.org/show_bug.cgi?id=188885
2068
2069         Reviewed by Sam Weinig.
2070
2071         * page/PerformanceMonitor.cpp:
2072         (WebCore::PerformanceMonitor::activityStateChanged):
2073         * rendering/RenderLayer.cpp:
2074         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
2075         (WebCore::RenderLayer::paintLayerContents):
2076         (WebCore::RenderLayer::calculateClipRects const):
2077         * rendering/RenderLayerBacking.cpp:
2078         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2079
2080 2018-08-23  Simon Fraser  <simon.fraser@apple.com>
2081
2082         Add support for dumping GC heap snapshots, and a viewer
2083         https://bugs.webkit.org/show_bug.cgi?id=186416
2084
2085         Reviewed by Joseph Pecoraro.
2086
2087         Make a way to dump information about the GC heap that is useful for looking for leaked
2088         or abandoned objects. This dump is obtained (on Apple platforms) via:
2089             notifyutil -p com.apple.WebKit.dumpGCHeap
2090         which writes a JSON file to /tmp which can then be loaded into the viewer in Tools/GCHeapInspector.
2091
2092         This leverages the heap snapshot used by Web Inspector, adding an alternate format for
2093         the snapshot JSON that adds additional data about objects and why they are GC roots.
2094         
2095         The generated bindings code is changed to include the output root reason from isReachableFromOpaqueRoots(),
2096         and to implement heapSnapshot() which provides the address of the wrapped object. A new IDL attribute,
2097         CustomHeapSnapshot, is used to allow custom heapSnapshot() implementations for classes like JSDocument
2098         that need to decorate the heap snapshot cell data with things like the document URL.
2099
2100         GCController registers a notifyutil callback which gathers the debug heap snapshot, and dumps it
2101         to a file in /tmp. The file path is printed out to the system log.
2102
2103         * bindings/js/DOMGCOutputConstraint.cpp:
2104         (WebCore::DOMGCOutputConstraint::executeImpl):
2105         * bindings/js/GCController.cpp:
2106         (WebCore::GCController::GCController):
2107         (WebCore::GCController::dumpHeap):
2108         * bindings/js/GCController.h:
2109         * bindings/js/JSCSSRuleListCustom.cpp:
2110         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
2111         * bindings/js/JSCallbackData.cpp:
2112         (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
2113         * bindings/js/JSCallbackData.h:
2114         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
2115         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
2116         * bindings/js/JSDOMWindowCustom.cpp:
2117         (WebCore::JSDOMWindow::getOwnPropertySlot):
2118         (WebCore::JSDOMWindow::heapSnapshot):
2119         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
2120         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
2121         * bindings/js/JSDocumentCustom.cpp:
2122         (WebCore::JSDocument::heapSnapshot):
2123         * bindings/js/JSMicrotaskCallback.h:
2124         (WebCore::JSMicrotaskCallback::call):
2125         * bindings/js/JSMutationObserverCustom.cpp:
2126         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
2127         * bindings/js/JSNavigatorCustom.cpp:
2128         (WebCore::JSNavigator::visitAdditionalChildren):
2129         * bindings/js/JSNodeCustom.cpp:
2130         (WebCore::isReachableFromDOM):
2131         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
2132         * bindings/js/JSNodeListCustom.cpp:
2133         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
2134         * bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp:
2135         (WebCore::JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
2136         * bindings/js/JSPerformanceObserverCustom.cpp:
2137         (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
2138         * bindings/js/JSPopStateEventCustom.cpp:
2139         * bindings/js/JSTextTrackCueCustom.cpp:
2140         (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
2141         * bindings/js/WebCoreTypedArrayController.cpp:
2142         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
2143         * bindings/js/WebCoreTypedArrayController.h:
2144         * bindings/scripts/CodeGeneratorJS.pm:
2145         (GenerateHeader):
2146         (GenerateImplementation):
2147         * bindings/scripts/IDLAttributes.json:
2148         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2149         (WebCore::JSInterfaceName::heapSnapshot):
2150         (WebCore::JSInterfaceNameOwner::isReachableFromOpaqueRoots):
2151         * bindings/scripts/test/JS/JSInterfaceName.h:
2152         * bindings/scripts/test/JS/JSMapLike.cpp:
2153         (WebCore::JSMapLike::heapSnapshot):
2154         (WebCore::JSMapLikeOwner::isReachableFromOpaqueRoots):
2155         * bindings/scripts/test/JS/JSMapLike.h:
2156         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2157         (WebCore::JSReadOnlyMapLike::heapSnapshot):
2158         (WebCore::JSReadOnlyMapLikeOwner::isReachableFromOpaqueRoots):
2159         * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
2160         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2161         (WebCore::JSTestActiveDOMObject::heapSnapshot):
2162         (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
2163         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2164         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2165         (WebCore::JSTestCEReactions::heapSnapshot):
2166         (WebCore::JSTestCEReactionsOwner::isReachableFromOpaqueRoots):
2167         * bindings/scripts/test/JS/JSTestCEReactions.h:
2168         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2169         (WebCore::JSTestCEReactionsStringifier::heapSnapshot):
2170         (WebCore::JSTestCEReactionsStringifierOwner::isReachableFromOpaqueRoots):
2171         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
2172         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2173         (WebCore::JSTestCallTracer::heapSnapshot):
2174         (WebCore::JSTestCallTracerOwner::isReachableFromOpaqueRoots):
2175         * bindings/scripts/test/JS/JSTestCallTracer.h:
2176         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2177         (WebCore::JSTestClassWithJSBuiltinConstructor::heapSnapshot):
2178         (WebCore::JSTestClassWithJSBuiltinConstructorOwner::isReachableFromOpaqueRoots):
2179         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
2180         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2181         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::heapSnapshot):
2182         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
2183         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2184         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2185         (WebCore::JSTestDOMJIT::heapSnapshot):
2186         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2187         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2188         (WebCore::JSTestEnabledBySetting::heapSnapshot):
2189         (WebCore::JSTestEnabledBySettingOwner::isReachableFromOpaqueRoots):
2190         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
2191         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2192         (WebCore::JSTestEventConstructor::heapSnapshot):
2193         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2194         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2195         (WebCore::JSTestEventTarget::heapSnapshot):
2196         * bindings/scripts/test/JS/JSTestEventTarget.h:
2197         * bindings/scripts/test/JS/JSTestException.cpp:
2198         (WebCore::JSTestException::heapSnapshot):
2199         (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
2200         * bindings/scripts/test/JS/JSTestException.h:
2201         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2202         (WebCore::JSTestGenerateIsReachable::heapSnapshot):
2203         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
2204         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2205         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2206         (WebCore::JSTestGlobalObject::heapSnapshot):
2207         (WebCore::JSTestGlobalObjectOwner::isReachableFromOpaqueRoots):
2208         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2209         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2210         (WebCore::JSTestIndexedSetterNoIdentifier::heapSnapshot):
2211         (WebCore::JSTestIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
2212         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
2213         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2214         (WebCore::JSTestIndexedSetterThrowingException::heapSnapshot):
2215         (WebCore::JSTestIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
2216         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
2217         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2218         (WebCore::JSTestIndexedSetterWithIdentifier::heapSnapshot):
2219         (WebCore::JSTestIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
2220         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
2221         * bindings/scripts/test/JS/JSTestInterface.cpp:
2222         (WebCore::JSTestInterface::heapSnapshot):
2223         (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
2224         * bindings/scripts/test/JS/JSTestInterface.h:
2225         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2226         (WebCore::JSTestInterfaceLeadingUnderscore::heapSnapshot):
2227         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
2228         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
2229         * bindings/scripts/test/JS/JSTestIterable.cpp:
2230         (WebCore::JSTestIterable::heapSnapshot):
2231         (WebCore::JSTestIterableOwner::isReachableFromOpaqueRoots):
2232         * bindings/scripts/test/JS/JSTestIterable.h:
2233         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2234         (WebCore::JSTestMediaQueryListListener::heapSnapshot):
2235         (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
2236         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2237         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2238         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::heapSnapshot):
2239         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
2240         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
2241         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2242         (WebCore::JSTestNamedAndIndexedSetterThrowingException::heapSnapshot):
2243         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
2244         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
2245         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2246         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::heapSnapshot):
2247         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
2248         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
2249         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2250         (WebCore::JSTestNamedConstructor::heapSnapshot):
2251         (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
2252         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2253         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2254         (WebCore::JSTestNamedDeleterNoIdentifier::heapSnapshot):
2255         (WebCore::JSTestNamedDeleterNoIdentifierOwner::isReachableFromOpaqueRoots):
2256         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
2257         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2258         (WebCore::JSTestNamedDeleterThrowingException::heapSnapshot):
2259         (WebCore::JSTestNamedDeleterThrowingExceptionOwner::isReachableFromOpaqueRoots):
2260         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
2261         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2262         (WebCore::JSTestNamedDeleterWithIdentifier::heapSnapshot):
2263         (WebCore::JSTestNamedDeleterWithIdentifierOwner::isReachableFromOpaqueRoots):
2264         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
2265         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2266         (WebCore::JSTestNamedDeleterWithIndexedGetter::heapSnapshot):
2267         (WebCore::JSTestNamedDeleterWithIndexedGetterOwner::isReachableFromOpaqueRoots):
2268         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
2269         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2270         (WebCore::JSTestNamedGetterCallWith::heapSnapshot):
2271         (WebCore::JSTestNamedGetterCallWithOwner::isReachableFromOpaqueRoots):
2272         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
2273         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2274         (WebCore::JSTestNamedGetterNoIdentifier::heapSnapshot):
2275         (WebCore::JSTestNamedGetterNoIdentifierOwner::isReachableFromOpaqueRoots):
2276         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
2277         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2278         (WebCore::JSTestNamedGetterWithIdentifier::heapSnapshot):
2279         (WebCore::JSTestNamedGetterWithIdentifierOwner::isReachableFromOpaqueRoots):
2280         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
2281         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2282         (WebCore::JSTestNamedSetterNoIdentifier::heapSnapshot):
2283         (WebCore::JSTestNamedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
2284         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
2285         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2286         (WebCore::JSTestNamedSetterThrowingException::heapSnapshot):
2287         (WebCore::JSTestNamedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
2288         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
2289         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2290         (WebCore::JSTestNamedSetterWithIdentifier::heapSnapshot):
2291         (WebCore::JSTestNamedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
2292         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
2293         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2294         (WebCore::JSTestNamedSetterWithIndexedGetter::heapSnapshot):
2295         (WebCore::JSTestNamedSetterWithIndexedGetterOwner::isReachableFromOpaqueRoots):
2296         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
2297         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2298         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::heapSnapshot):
2299         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterOwner::isReachableFromOpaqueRoots):
2300         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
2301         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2302         (WebCore::JSTestNamedSetterWithOverrideBuiltins::heapSnapshot):
2303         (WebCore::JSTestNamedSetterWithOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
2304         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
2305         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2306         (WebCore::JSTestNamedSetterWithUnforgableProperties::heapSnapshot):
2307         (WebCore::JSTestNamedSetterWithUnforgablePropertiesOwner::isReachableFromOpaqueRoots):
2308         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
2309         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2310         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::heapSnapshot):
2311         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
2312         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
2313         * bindings/scripts/test/JS/JSTestNode.cpp:
2314         (WebCore::JSTestNode::heapSnapshot):
2315         * bindings/scripts/test/JS/JSTestNode.h:
2316         * bindings/scripts/test/JS/JSTestObj.cpp:
2317         (WebCore::JSTestObj::heapSnapshot):
2318         (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
2319         * bindings/scripts/test/JS/JSTestObj.h:
2320         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2321         (WebCore::JSTestOverloadedConstructors::heapSnapshot):
2322         (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
2323         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2324         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2325         (WebCore::JSTestOverloadedConstructorsWithSequence::heapSnapshot):
2326         (WebCore::JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots):
2327         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
2328         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2329         (WebCore::JSTestOverrideBuiltins::heapSnapshot):
2330         (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
2331         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2332         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2333         (WebCore::JSTestPluginInterface::heapSnapshot):
2334         (WebCore::JSTestPluginInterfaceOwner::isReachableFromOpaqueRoots):
2335         * bindings/scripts/test/JS/JSTestPluginInterface.h:
2336         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2337         (WebCore::JSTestPromiseRejectionEvent::heapSnapshot):
2338         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
2339         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2340         (WebCore::JSTestSerialization::heapSnapshot):
2341         (WebCore::JSTestSerializationOwner::isReachableFromOpaqueRoots):
2342         * bindings/scripts/test/JS/JSTestSerialization.h:
2343         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2344         (WebCore::JSTestSerializationIndirectInheritance::heapSnapshot):
2345         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h:
2346         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2347         (WebCore::JSTestSerializationInherit::heapSnapshot):
2348         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
2349         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2350         (WebCore::JSTestSerializationInheritFinal::heapSnapshot):
2351         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
2352         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2353         (WebCore::JSTestSerializedScriptValueInterface::heapSnapshot):
2354         (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
2355         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2356         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2357         (WebCore::JSTestStringifier::heapSnapshot):
2358         (WebCore::JSTestStringifierOwner::isReachableFromOpaqueRoots):
2359         * bindings/scripts/test/JS/JSTestStringifier.h:
2360         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2361         (WebCore::JSTestStringifierAnonymousOperation::heapSnapshot):
2362         (WebCore::JSTestStringifierAnonymousOperationOwner::isReachableFromOpaqueRoots):
2363         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h:
2364         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2365         (WebCore::JSTestStringifierNamedOperation::heapSnapshot):
2366         (WebCore::JSTestStringifierNamedOperationOwner::isReachableFromOpaqueRoots):
2367         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h:
2368         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2369         (WebCore::JSTestStringifierOperationImplementedAs::heapSnapshot):
2370         (WebCore::JSTestStringifierOperationImplementedAsOwner::isReachableFromOpaqueRoots):
2371         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h:
2372         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2373         (WebCore::JSTestStringifierOperationNamedToString::heapSnapshot):
2374         (WebCore::JSTestStringifierOperationNamedToStringOwner::isReachableFromOpaqueRoots):
2375         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h:
2376         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2377         (WebCore::JSTestStringifierReadOnlyAttribute::heapSnapshot):
2378         (WebCore::JSTestStringifierReadOnlyAttributeOwner::isReachableFromOpaqueRoots):
2379         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h:
2380         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2381         (WebCore::JSTestStringifierReadWriteAttribute::heapSnapshot):
2382         (WebCore::JSTestStringifierReadWriteAttributeOwner::isReachableFromOpaqueRoots):
2383         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h:
2384         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2385         (WebCore::JSTestTypedefs::heapSnapshot):
2386         (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
2387         * bindings/scripts/test/JS/JSTestTypedefs.h:
2388         * dom/Document.idl:
2389         * page/DOMWindow.idl:
2390
2391 2018-08-23  Ryosuke Niwa  <rniwa@webkit.org>
2392
2393         initKeyboardEvent doesn't clear CapsLock state
2394         https://bugs.webkit.org/show_bug.cgi?id=188909
2395
2396         Reviewed by Wenson Hsieh.
2397
2398         Fixed the bug by not preserving CapsLock state in setModifierKeys variant which takes boolean
2399         for altGraphKey, which is only called by KeyboardEvent::initKeyboardEvent.
2400
2401         Test: fast/events/init-event-clears-capslock.html
2402
2403         * dom/UIEventWithKeyState.h:
2404         (WebCore::UIEventWithKeyState::setModifierKeys):
2405
2406 2018-08-23  Aditya Keerthi  <akeerthi@apple.com>
2407
2408         Unreviewed, fix the Windows build after r235245.
2409
2410         * html/InputMode.cpp:
2411         (WebCore::stringForInputMode):
2412
2413 2018-08-23  Saam barati  <sbarati@apple.com>
2414
2415         JSRunLoopTimer may run part of a member function after it's destroyed
2416         https://bugs.webkit.org/show_bug.cgi?id=188426
2417
2418         Reviewed by Mark Lam.
2419
2420         * page/cocoa/ResourceUsageThreadCocoa.mm:
2421         (WebCore::ResourceUsageThread::platformThreadBody):
2422         * page/linux/ResourceUsageThreadLinux.cpp:
2423         (WebCore::ResourceUsageThread::platformThreadBody):
2424
2425 2018-08-23  David Fenton  <david_fenton@apple.com>
2426
2427         Unreviewed, rolling out r235129.
2428
2429         broke internal builds
2430
2431         Reverted changeset:
2432
2433         "Allow creating WeakPtrs to const objects"
2434         https://bugs.webkit.org/show_bug.cgi?id=188785
2435         https://trac.webkit.org/changeset/235129
2436
2437 2018-08-23  Daniel Bates  <dabates@apple.com>
2438
2439         [iOS] Test editing/undo/replace-text-in-node-preserving-markers-crash.html crashes
2440         https://bugs.webkit.org/show_bug.cgi?id=188898
2441
2442         Reviewed by Simon Fraser.
2443
2444         Not all document markers may have a dictation metadata on iOS.
2445
2446         Currently we assume that every marker has dictation alternatives (i.e. DocumentMarker::alternatives()
2447         can be called) when deleting a selection preserving document markers on iOS. However, only markers
2448         for dictation may have dictation alternatives. For example, document markers for misspelled words do
2449         not have dictation metadata by definition. Instead of assuming every marker has dictation alternatives
2450         on iOS we need to check the marker type to determine whether it has associated dictation metadata and
2451         invoke the appropriate DocumentMarkerController::addMarker() overload.
2452
2453         * dom/DocumentMarker.h:
2454         (WebCore::DocumentMarker::isDictation const): Added.
2455         * editing/CompositeEditCommand.cpp:
2456         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Only access DocumentMarker::alternatives()
2457         and add a dictation marker on iOS if the marker is a dictation marker.
2458
2459 2018-08-23  Mark Lam  <mark.lam@apple.com>
2460
2461         Move vmEntryGlobalObject() to VM from CallFrame.
2462         https://bugs.webkit.org/show_bug.cgi?id=188900
2463         <rdar://problem/43655753>
2464
2465         Reviewed by Michael Saboff.
2466
2467         No new tests needed because this patch does not introduce new functionality.
2468
2469         * bindings/js/JSCustomXPathNSResolver.cpp:
2470         (WebCore::JSCustomXPathNSResolver::create):
2471         * bindings/js/JSDOMGlobalObject.cpp:
2472         (WebCore::callerGlobalObject):
2473         (WebCore::toJSDOMGlobalObject): Deleted.
2474         * bindings/js/JSDOMWindowBase.cpp:
2475         (WebCore::firstDOMWindow):
2476         * bridge/c/c_utility.cpp:
2477         (JSC::Bindings::convertValueToNPVariant):
2478         * bridge/objc/WebScriptObject.mm:
2479         (WebCore::addExceptionToConsole):
2480         * bridge/objc/objc_instance.mm:
2481         (ObjcInstance::moveGlobalExceptionToExecState):
2482         * bridge/objc/objc_runtime.mm:
2483         (JSC::Bindings::convertValueToObjcObject):
2484         * bridge/objc/objc_utility.mm:
2485         (JSC::Bindings::convertValueToObjcValue):
2486         * testing/Internals.cpp:
2487         (WebCore::Internals::cloneArrayBuffer):
2488
2489 2018-08-23  Andy Estes  <aestes@apple.com>
2490
2491         [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
2492         https://bugs.webkit.org/show_bug.cgi?id=188829
2493
2494         Reviewed by Tim Horton.
2495
2496         Test: http/tests/ssl/applepay/ApplePaySessionV4.html
2497
2498         * Configurations/FeatureDefines.xcconfig:
2499         * testing/MockPaymentCoordinator.cpp:
2500         (WebCore::MockPaymentCoordinator::supportsVersion):
2501
2502 2018-08-23  Devin Rousso  <drousso@apple.com>
2503
2504         Web Inspector: support breakpoints for timers and animation-frame events
2505         https://bugs.webkit.org/show_bug.cgi?id=188778
2506
2507         Reviewed by Brian Burg.
2508
2509         The original implementation of "instrumentation" breakpoints relied upon the frontend
2510         sending somewhat arbitrary strings when enabling breakpoints for specific events. As an
2511         example, setting a breakpoint for `requestAnimationFrame` expects `"animationFrameFired"`
2512         as the string, which doesn't make much sense. This patch removes the usage of these strings
2513         and instead expects the agent to implement a method that matches what is happening.
2514
2515         Tests: inspector/dom-debugger/event-animation-frame-breakpoints.html
2516                inspector/dom-debugger/event-listener-breakpoints.html
2517                inspector/dom-debugger/event-timer-breakpoints.html
2518
2519         * inspector/InspectorInstrumentation.h:
2520         (WebCore::InspectorInstrumentation::willFireTimer):
2521         * inspector/InspectorInstrumentation.cpp:
2522         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
2523         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
2524         (WebCore::InspectorInstrumentation::willFireTimerImpl):
2525         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
2526         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
2527         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
2528         (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded): Deleted.
2529
2530         * inspector/agents/InspectorDOMDebuggerAgent.h:
2531         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2532         (WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint): Added.
2533         (WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint): Added.
2534         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
2535         (WebCore::InspectorDOMDebuggerAgent::willFireTimer): Added.
2536         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame): Added.
2537         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Deleted.
2538         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Deleted.
2539         (WebCore::InspectorDOMDebuggerAgent::setBreakpoint): Deleted.
2540         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Deleted.
2541         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Deleted.
2542         (WebCore::InspectorDOMDebuggerAgent::removeBreakpoint): Deleted.
2543         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): Deleted.
2544         Unify the event listener and instrumentation breakpoint commands into a single method,
2545         `setEventBreakpoint`, that takes in both an `EventBreakpointType` and `eventName`.
2546
2547         * page/DOMTimer.cpp:
2548         (WebCore::DOMTimer::fired):
2549
2550 2018-08-23  Aditya Keerthi  <akeerthi@apple.com>
2551
2552         [iOS] Support the inputmode attribute on contenteditable elements
2553         https://bugs.webkit.org/show_bug.cgi?id=188878
2554
2555         Reviewed by Ryosuke Niwa.
2556
2557         The inputmode attribute should apply to contenteditable elements, in addition to
2558         textfield inputs and textareas.
2559
2560         Moved the inputmode attribute from HTMLInputElement.idl and
2561         HTMLTextAreaElement.idl to HTMLElement.idl to reflect the specification.
2562
2563         Also moved all logic to convert between the InputMode enum and string values
2564         into InputMode.cpp to avoid exposing unnecessary details to WebKit. Furthermore,
2565         InputMode::Auto was renamed to InputMode::Unspecified to avoid confusion with the
2566         specification.
2567
2568         Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
2569
2570         Tests: fast/forms/inputmode-attribute-contenteditable.html
2571                fast/forms/inputmode-attribute-input.html
2572                fast/forms/inputmode-attribute-textarea.html
2573
2574         * Sources.txt:
2575         * WebCore.xcodeproj/project.pbxproj:
2576         * html/HTMLElement.cpp:
2577         (WebCore::HTMLElement::canonicalInputMode const):
2578         (WebCore::HTMLElement::inputMode const):
2579         (WebCore::HTMLElement::setInputMode):
2580         * html/HTMLElement.h:
2581         * html/HTMLElement.idl:
2582         * html/HTMLInputElement.idl:
2583         * html/HTMLTextAreaElement.idl:
2584         * html/HTMLTextFormControlElement.cpp:
2585         * html/HTMLTextFormControlElement.h:
2586         * html/InputMode.cpp: Renamed from Source/WebCore/html/InputModeNames.cpp.
2587         (WebCore::inputModeForAttributeValue):
2588         (WebCore::stringForInputMode):
2589         * html/InputMode.h: Renamed from Source/WebCore/html/InputModeNames.h.
2590
2591 2018-08-23  Eric Carlson  <eric.carlson@apple.com>
2592
2593         [MediaStream] Store video preset sizes in a map
2594         https://bugs.webkit.org/show_bug.cgi?id=188866
2595         <rdar://problem/43622643>
2596
2597         Reviewed by Youenn Fablet.
2598
2599         No new tests, tested manually.
2600
2601         * platform/mediastream/mac/AVVideoCaptureSource.h:
2602         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2603         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
2604         (WebCore::AVVideoCaptureSource::initializeCapabilities):
2605         (WebCore::AVVideoCaptureSource::sizeForPreset):
2606         (WebCore::AVVideoCaptureSource::setPreset):
2607         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
2608         (WebCore::sizeForPreset): Deleted.
2609         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Deleted.
2610
2611 2018-08-23  Ryan Haddad  <ryanhaddad@apple.com>
2612
2613         Unreviewed, attempt to fix the build after r235230.
2614
2615         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2616
2617 2018-08-23  Youenn Fablet  <youenn@apple.com>
2618
2619         Update libwebrtc up to 984f1a80c0
2620         https://bugs.webkit.org/show_bug.cgi?id=188745
2621         <rdar://problem/43539177>
2622
2623         Reviewed by Eric Carlson.
2624
2625         Updated implementation according new webrtc backend.
2626         Instead of modifying libwebrtc header files, we disable unused parameter warning for such headers included in WebCore.
2627         WebCore implementation is updated according new webrtc API, mostly AddRef/Release.
2628         RealtimeOutgoingVideoSource now uses a pixel convolver to convert RGB pixel buffers as I420.
2629
2630         Covered by existing tests.
2631
2632         * CMakeLists.txt:
2633         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
2634         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2635         (WebCore::LibWebRTCMediaEndpoint::addTrack):
2636         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
2637         (WebCore::fillEncodingParameters):
2638         (WebCore::fillRtpParameters):
2639         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2640         (WebCore::LibWebRTCMediaEndpoint::Release const):
2641         * WebCore.xcodeproj/project.pbxproj:
2642         * platform/mediastream/RealtimeIncomingAudioSource.h:
2643         * platform/mediastream/RealtimeIncomingVideoSource.h:
2644         * platform/mediastream/RealtimeMediaSource.cpp:
2645         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
2646         (WebCore::RealtimeMediaSource::supportsConstraint const):
2647         (WebCore::RealtimeMediaSource::supportsConstraints):
2648         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2649         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2650         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
2651         (WebCore::GStreamerVideoDecoder::newSampleCallback):
2652         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2653         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
2654         (WebCore::GStreamerVideoEncoder::newSampleCallback):
2655         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2656         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
2657         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2658         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2659         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2660         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
2661         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2662         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2663         (WebCore::ConvertToI420):
2664         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
2665         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
2666         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: Added.
2667         (WebCore::RealtimeOutgoingVideoSourceCocoa::convertToYUV):
2668         * testing/MockLibWebRTCPeerConnection.cpp:
2669         (WebCore::MockLibWebRTCPeerConnection::AddTrack):
2670         * testing/MockLibWebRTCPeerConnection.h:
2671         (WebCore::MockRtpSender::GetParameters):
2672         (WebCore::MockRtpSender::SetParameters):
2673
2674 2018-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2675
2676         [Attachment Support] Attachment elements don't appear in drag images on macOS
2677         https://bugs.webkit.org/show_bug.cgi?id=188823
2678         <rdar://problem/43616378>
2679
2680         Reviewed by Tim Horton.
2681
2682         Currently, attachment elements don't show up in the drag image snapshot on macOS. This is because only the
2683         "Selection" phase is painted when generating a drag image on macOS, and many replaced renderers (with some
2684         exceptions, such as RenderImage) only paint visible content during the "Foreground" phase. To fix this, we
2685         override RenderAttachment::paintReplaced to paint the attachment in the case where the Selection phase is being
2686         painted.
2687
2688         Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
2689                 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
2690
2691         * rendering/RenderAttachment.cpp:
2692         (WebCore::RenderAttachment::paintReplaced):
2693         * rendering/RenderAttachment.h:
2694         * rendering/RenderThemeMac.mm:
2695         (WebCore::titleTextColorForAttachment):
2696         (WebCore::AttachmentLayout::layOutTitle):
2697
2698         Plumb an AttachmentLayoutStyle (i.e. NonSelected or Selected) to AttachmentLayout, and use this bit when
2699         determining the title text color, as well whether to paint backgrounds for the icon and title.
2700
2701         (WebCore::AttachmentLayout::AttachmentLayout):
2702         (WebCore::RenderThemeMac::attachmentIntrinsicSize const):
2703         (WebCore::RenderThemeMac::attachmentBaseline const):
2704         (WebCore::paintAttachmentIconBackground):
2705         (WebCore::paintAttachmentTitleBackground):
2706
2707         Bail from painting backgrounds if a selected style is used for the attachment.
2708
2709         (WebCore::RenderThemeMac::paintAttachment):
2710
2711         Rather than check the RenderAttachment's selection state when determining whether to paint with a non-selected
2712         or selected style, only use selected style if the RenderAttachment has a selection _and_ the painting phase is
2713         not "Selection". While this sounds extremely counter-intuitive, the "Selection" painting phase refers to
2714         painting the selected foreground content _without_ including any part of the selection highlight.
2715
2716 2018-08-23  Zalan Bujtas  <zalan@apple.com>
2717
2718         [LFC][Floating] Decouple the incoming floats and floats already placed in the list
2719         https://bugs.webkit.org/show_bug.cgi?id=188886
2720
2721         Reviewed by Antti Koivisto.
2722
2723         This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.
2724
2725         1. Introduce FloatBox class for the incoming floats (This will need to be renamed when adding support for avoidance -incoming box is actually not a float).
2726         2. Use the existing FloatState::FloatItem class for placed floats.
2727
2728         * Sources.txt:
2729         * WebCore.xcodeproj/project.pbxproj:
2730         * layout/LayoutUnits.h:
2731         * layout/Verification.cpp:
2732         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
2733         * layout/displaytree/DisplayBox.h:
2734         * layout/floats/FloatBox.cpp: Added.
2735         (WebCore::Layout::FloatBox::FloatBox):
2736         (WebCore::Layout::FloatBox::initializePosition):
2737         (WebCore::Layout::FloatBox::isLeftAligned const):
2738         (WebCore::Layout::FloatBox::setLeft):
2739         (WebCore::Layout::FloatBox::setTopLeft):
2740         (WebCore::Layout::FloatBox::resetVertically):
2741         (WebCore::Layout::FloatBox::resetHorizontally):
2742         (WebCore::Layout::FloatBox::topLeftInContainingBlock const):
2743         * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatingContext.h.
2744         (WebCore::Layout::FloatBox::top const):
2745         (WebCore::Layout::FloatBox::left const):
2746         (WebCore::Layout::FloatBox::marginTop const):
2747         (WebCore::Layout::FloatBox::marginLeft const):
2748         (WebCore::Layout::FloatBox::marginBottom const):
2749         (WebCore::Layout::FloatBox::marginRight const):
2750         (WebCore::Layout::FloatBox::rectWithMargin const):
2751         (WebCore::Layout::FloatBox::setTop):
2752         * layout/floats/FloatingContext.cpp:
2753         (WebCore::Layout::FloatingPair::verticalPosition const):
2754         (WebCore::Layout::begin):
2755         (WebCore::Layout::FloatingContext::positionForFloat const):
2756         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2757         (WebCore::Layout::FloatingContext::floatingPosition const):
2758         (WebCore::Layout::FloatingPair::horiztonalPosition const):
2759         (WebCore::Layout::FloatingPair::bottom const):
2760         (WebCore::Layout::Iterator::Iterator):
2761         (WebCore::Layout::Iterator::operator++):
2762         (WebCore::Layout::Iterator::set):
2763         (WebCore::Layout::FloatingContext::initialVerticalPosition const): Deleted.
2764         (WebCore::Layout::FloatingContext::alignWithContainingBlock const): Deleted.
2765         (WebCore::Layout::FloatingContext::alignWithFloatings const): Deleted.
2766         (WebCore::Layout::FloatingContext::toContainingBlock const): Deleted.
2767         * layout/floats/FloatingContext.h:
2768         * layout/floats/FloatingState.h:
2769         (WebCore::Layout::FloatingState::root const):
2770         (WebCore::Layout::FloatingState::layoutContext const):
2771
2772 2018-08-23  Zan Dobersek  <zdobersek@igalia.com>
2773
2774         [CoordGraphics] Remove the remaining CoordinatedGraphicsLayerState cruft
2775         https://bugs.webkit.org/show_bug.cgi?id=188881
2776
2777         Reviewed by Carlos Garcia Campos.
2778
2779         Remove what's left of CoordinatedGraphicsLayerState usage in the
2780         CoordinatedGraphics subsystem. In CoordinatedGraphicsLayer, this means
2781         dropping the m_layerState member variable since at this point it is not
2782         used anymore in any capacity. Affected helper methods and member
2783         variables are also removed where possible.
2784
2785         The syncLayerState() method on the CoordinatedGraphicsLayerClient
2786         interface is adjusted to not accept any parameters. Client should just
2787         mark frame synchronization as required while the layer state is now
2788         managed differently.
2789
2790         Instead of the CoordinatedLayerID (which is removed) the
2791         Nicosia::PlatformLayer::LayerID alias is introduced as a layer ID type,
2792         aliased to the uint64_t type.
2793
2794         CoordinatedGraphicsState.h file is rid of all structs except the
2795         basic CoordinatedGraphicsState struct that at this point contains only
2796         a reference to the Nicosia::Scene object. This will be further
2797         simplified in the patches that follow.
2798
2799         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
2800         (Nicosia::PlatformLayer::id const):
2801         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2802         (WebCore::CoordinatedGraphicsLayer::didChangeAnimations):
2803         (WebCore::CoordinatedGraphicsLayer::didChangeChildren):
2804         (WebCore::CoordinatedGraphicsLayer::didChangeFilters):
2805         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
2806         (WebCore::CoordinatedGraphicsLayer::didChangeGeometry):
2807         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
2808         (WebCore::CoordinatedGraphicsLayer::setPosition):
2809         (WebCore::CoordinatedGraphicsLayer::setAnchorPoint):
2810         (WebCore::CoordinatedGraphicsLayer::setSize):
2811         (WebCore::CoordinatedGraphicsLayer::setTransform):
2812         (WebCore::CoordinatedGraphicsLayer::setChildrenTransform):
2813         (WebCore::CoordinatedGraphicsLayer::setPreserves3D):
2814         (WebCore::CoordinatedGraphicsLayer::setMasksToBounds):
2815         (WebCore::CoordinatedGraphicsLayer::setDrawsContent):
2816         (WebCore::CoordinatedGraphicsLayer::setContentsVisible):
2817         (WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
2818         (WebCore::CoordinatedGraphicsLayer::setBackfaceVisibility):
2819         (WebCore::CoordinatedGraphicsLayer::setOpacity):
2820         (WebCore::CoordinatedGraphicsLayer::setContentsRect):
2821         (WebCore::CoordinatedGraphicsLayer::setContentsTileSize):
2822         (WebCore::CoordinatedGraphicsLayer::setContentsTilePhase):
2823         (WebCore::CoordinatedGraphicsLayer::setContentsToSolidColor):
2824         (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
2825         (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
2826         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
2827         (WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
2828         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
2829         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
2830         (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
2831         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2832         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
2833         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
2834         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
2835         (WebCore::toCoordinatedLayerID): Deleted.
2836         (WebCore::CoordinatedGraphicsLayer::didChangeLayerState): Deleted.
2837         (WebCore::CoordinatedGraphicsLayer::syncChildren): Deleted.
2838         (WebCore::CoordinatedGraphicsLayer::syncFilters): Deleted.
2839         (WebCore::CoordinatedGraphicsLayer::syncLayerState): Deleted.
2840         (WebCore::CoordinatedGraphicsLayer::syncAnimations): Deleted.
2841         (WebCore::CoordinatedGraphicsLayer::resetLayerState): Deleted.
2842         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2843         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2844         (): Deleted.
2845         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState): Deleted.
2846         (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const): Deleted.
2847
2848 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
2849
2850         [CoordGraphics] Drop old-school PlatformLayer management in CoordinatedGraphicsLayer
2851         https://bugs.webkit.org/show_bug.cgi?id=188850
2852
2853         Reviewed by Michael Catanzaro.
2854
2855         Remove the m_platformLayer member from the CoordinatedGraphicsLayer
2856         class as it's been unused since the rework in r235165.
2857
2858         The CoordinatedGraphicsLayer::syncPlatformLayer() helper method and the
2859         related member variable can both be removed as well. On the
2860         CoordinatedGraphicsLayerState class, we can remove the obsolete
2861         flags and the TextureMapperPlatformLayerProxy member variable that's
2862         unused now that such objects are handled through the Nicosia impl class.
2863
2864         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2865         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
2866         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
2867         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
2868         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
2869         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2870         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): Deleted.
2871         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2872         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2873         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
2874
2875 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
2876
2877         [CoordGraphics] Remove TiledBackingStoreClient inheritance from CoordinatedGraphicsLayer
2878         https://bugs.webkit.org/show_bug.cgi?id=188849
2879
2880         Reviewed by Michael Catanzaro.
2881
2882         Remove the TiledBackingStoreClient inheritance from the
2883         CoordinatedGraphicsLayer class since it's not used anymore after changes
2884         made in r235165.
2885
2886         Related TiledBackingStore objects on this class, along with tile state
2887         tracking member variables on the CoordinatedGraphicsLayerState class,
2888         are also removed.
2889
2890         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2891         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
2892         (WebCore::CoordinatedGraphicsLayer::resetLayerState):
2893         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
2894         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation): Deleted.
2895         (WebCore::CoordinatedGraphicsLayer::createTile): Deleted.
2896         (WebCore::CoordinatedGraphicsLayer::updateTile): Deleted.
2897         (WebCore::CoordinatedGraphicsLayer::removeTile): Deleted.
2898         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2899         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2900         (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const):
2901
2902 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
2903
2904         [CoordGraphics] Remove CoordinatedImageBacking and related functionality
2905         https://bugs.webkit.org/show_bug.cgi?id=188847
2906
2907         Reviewed by Michael Catanzaro.
2908
2909         Remove the CoordinatedImageBacking class and its intertwining use in the
2910         CoordinatedGraphics system.
2911
2912         Remove the now-unused m_coordinatedImageBacking member variable from the
2913         CoordinatedGraphicsLayer class, along with CoordinatedImageBacking::Host
2914         inheritance. Various related helper methods are also removed.
2915
2916         In CoordinatedGraphicsState and CoordinatedGraphicsLayerState classes,
2917         we are able to drop different CoordinatedImageBacking-related state
2918         values that are not used anymore.
2919
2920         * platform/TextureMapper.cmake:
2921         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2922         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
2923         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
2924         (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
2925         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
2926         (WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Deleted.
2927         (WebCore::CoordinatedGraphicsLayer::syncImageBacking): Deleted.
2928         (WebCore::CoordinatedGraphicsLayer::imageBackingVisible): Deleted.
2929         (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded): Deleted.
2930         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2931         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2932         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
2933         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Removed.
2934         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h: Removed.
2935
2936 2018-08-22  Ryosuke Niwa  <rniwa@webkit.org>
2937
2938         Store RefPtr in FocusNavigationScope
2939         https://bugs.webkit.org/show_bug.cgi?id=188864
2940
2941         Reviewed by Simon Fraser.
2942
2943         Use RefPtr to store the root node of a tree scope and a slot element instead of a reference and a raw pointer.
2944
2945         * page/FocusController.cpp:
2946         (WebCore::FocusNavigationScope::parentInScope const):
2947         (WebCore::FocusNavigationScope::firstNodeInScope const):
2948         (WebCore::FocusNavigationScope::lastNodeInScope const):
2949         (WebCore::FocusNavigationScope::FocusNavigationScope):
2950         (WebCore::FocusNavigationScope::owner const):
2951
2952 2018-08-22  Jiewen Tan  <jiewen_tan@apple.com>
2953
2954         Unreviewed, update "Web Authentication" from "Under Consideration" to "In Development"
2955         in features.json.
2956
2957         * features.json:
2958
2959 2018-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2960
2961         [Attachment Support] Support dragging attachment elements out as files on macOS
2962         https://bugs.webkit.org/show_bug.cgi?id=181294
2963         <rdar://problem/36298801>
2964
2965         Reviewed by Tim Horton.
2966
2967         Serialize a dragged attachment element as a web archive on macOS. This allows us to move attachment elements
2968         around a document by dragging, without performing a file upload upon every drop. Ideally, we should do this on
2969         iOS as well, but this currently causes attachment data to go missing; further investigation to fix this for iOS
2970         is tracked in <https://bugs.webkit.org/show_bug.cgi?id=181514>.
2971
2972         Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
2973                 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
2974
2975         * editing/cocoa/EditorCocoa.mm:
2976         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
2977
2978 2018-08-22  Aditya Keerthi  <akeerthi@apple.com>
2979
2980         [iOS] Add support for the inputmode attribute
2981         https://bugs.webkit.org/show_bug.cgi?id=183621
2982
2983         Reviewed by Tim Horton.
2984
2985         Added the inputmode attribute to the HTMLInputElement and HTMLTextAreaElement IDL
2986         files. The possible values for the attribute are specified in InputModeNames.
2987
2988         Test: fast/forms/inputmode-attribute.html
2989
2990         * Sources.txt:
2991         * WebCore.xcodeproj/project.pbxproj:
2992         * html/HTMLAttributeNames.in:
2993         * html/HTMLInputElement.idl:
2994         * html/HTMLTextAreaElement.idl:
2995         * html/HTMLTextFormControlElement.cpp:
2996         (WebCore::HTMLTextFormControlElement::inputMode const):
2997         (WebCore::HTMLTextFormControlElement::setInputMode):
2998         * html/HTMLTextFormControlElement.h:
2999         * html/InputModeNames.cpp: Added.
3000         (WebCore::InputModeNames::text):
3001         (WebCore::InputModeNames::tel):
3002         (WebCore::InputModeNames::url):
3003         (WebCore::InputModeNames::email):
3004         (WebCore::InputModeNames::numeric):
3005         (WebCore::InputModeNames::decimal):
3006         (WebCore::InputModeNames::search):
3007         * html/InputModeNames.h: Added.
3008
3009 2018-08-22  Eric Carlson  <eric.carlson@apple.com>
3010
3011         Log more often during AirPlay state changes
3012         https://bugs.webkit.org/show_bug.cgi?id=188854
3013
3014         Always log some infrequent but important AirPlay state changes to make debugging easier.
3015
3016         Reviewed by Jer Noble.
3017
3018         * html/HTMLMediaElement.cpp:
3019         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Low always.
3020         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
3021         (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): Ditto.
3022         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): Ditto.
3023
3024 2018-08-21  Ryosuke Niwa  <rniwa@webkit.org>
3025
3026         Focus navigation order in slot fallback contents is wrong
3027         https://bugs.webkit.org/show_bug.cgi?id=178001
3028         <rdar://problem/42842997>
3029
3030         Reviewed by Antti Koivisto.
3031
3032         The bug here is that when a slot uses its fallback content, the fallback content's focus order doesn't get
3033         grouped by that of the slot. Consider the following DOM tree:
3034
3035         - ShadowRoot
3036             - div tabindex = 2
3037             - slot tabindex = 1
3038                 - span tabindex = 3
3039
3040         In this example, the sequential focus navigation should be slot, span, then div. Even though span has tabindex
3041         order of 3, which is lower than that of div, the fallback content of the slot should be grouped together
3042         before the focus moves out of the slot content.
3043
3044         In WebKit, this concept of grouping elements for the sequential focus navigation ordering is implemeneted
3045         as FocusNavigationScope. Both ShadowRoot and HTMLSlotElement are treated as a focus scope owner but we had
3046         a bug that a slot element which uses its fallback content was not treated as a focus scope owner.
3047
3048         This patch addresses the bug by treating a slot wich uses its fallback content as a focus scope owner.
3049
3050         Test: fast/shadow-dom/focus-navigation-across-slots.html
3051
3052         * page/FocusController.cpp:
3053         (WebCore::isFocusScopeOwner): Treat a slot elment hs a focus scope owner regardless of whether it has assigned
3054         nodes or not.
3055         (WebCore::FocusNavigationScope::SlotKind): Added.
3056         (WebCore::FocusNavigationScope::m_slotKind): Added.
3057         (WebCore::FocusNavigationScope::parentInScope const): Return null if `node` is a child of the slot element for
3058         which this FocusNavigationScope is created (i.e. `node` is slot's fallback content).
3059         (WebCore::FocusNavigationScope::firstNodeInScope const): Return the first child node when this
3060         FocusNavigationScope is for a slot element using its fallback content.
3061         (WebCore::FocusNavigationScope::lastNodeInScope const): Ditto for the last child.
3062         (WebCore::FocusNavigationScope::FocusNavigationScope):
3063         (WebCore::FocusNavigationScope::scopeOf): The scope of a child of a slot element which uses its fallback content
3064         is its slot element (i.e. the current node is a fallback content). We can't simply check the current node is
3065         a slot element which uses a fallback content since the scope of a slot element is the parent scope. e.g. its
3066         tree scope like ShadowRoot or Document inside which this slot element appears.
3067         (WebCore::FocusNavigationScope::scopeOwnedByScopeOwner): Create the appropriate FocusNavigationScope based on
3068         whether the slot element has assigned or it uses its fallback content.
3069
3070 2018-08-22  David Kilzer  <ddkilzer@apple.com>
3071
3072         Move files in WebCore project to match Xcode folder structure
3073         <https://webkit.org/b/188851>
3074
3075         Reviewed by Tim Horton.
3076
3077         * Scripts/LocalizableStrings.pm: Renamed from Source/WebCore/LocalizableStrings.pm.
3078         * Scripts/extract-localizable-strings.pl: Renamed from Source/WebCore/extract-localizable-strings.pl.
3079         * WebCore.xcodeproj/project.pbxproj: Update to match new location of files.
3080         * platform/audio/cocoa/WebAudioBufferList.cpp: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.cpp.
3081         * platform/audio/cocoa/WebAudioBufferList.h: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.h.
3082         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h.
3083         * platform/ios/wak/WAKViewInternal.h: Renamed from Source/WebCore/platform/WAKViewInternal.h.
3084           Also fix 3 webkit-style warnings.
3085
3086 2018-08-22  Zalan Bujtas  <zalan@apple.com>
3087
3088         [LFC][Floating] Move files to a dedicated directory.
3089         https://bugs.webkit.org/show_bug.cgi?id=188846
3090
3091         Reviewed by Simon Fraser.
3092
3093         layout/Float* -> layout/floats
3094
3095         * WebCore.xcodeproj/project.pbxproj:
3096         * layout/floatformatting/FloatingContext.cpp: Renamed from Source/WebCore/layout/FloatingContext.cpp.
3097         (WebCore::Layout::FloatingPair::isEmpty const):
3098         (WebCore::Layout::FloatingPair::verticalPosition const):
3099         (WebCore::Layout::Iterator::operator* const):
3100         (WebCore::Layout::begin):
3101         (WebCore::Layout::end):
3102         (WebCore::Layout::FloatingContext::FloatingContext):
3103         (WebCore::Layout::FloatingContext::positionForFloat const):
3104         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3105         (WebCore::Layout::FloatingContext::floatingPosition const):
3106         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
3107         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
3108         (WebCore::Layout::FloatingContext::alignWithFloatings const):
3109         (WebCore::Layout::FloatingContext::toContainingBlock const):
3110         (WebCore::Layout::FloatingPair::FloatingPair):
3111         (WebCore::Layout::FloatingPair::left const):
3112         (WebCore::Layout::FloatingPair::right const):
3113         (WebCore::Layout::FloatingPair::intersects const):
3114         (WebCore::Layout::FloatingPair::operator == const):
3115         (WebCore::Layout::FloatingPair::bottom const):
3116         (WebCore::Layout::Iterator::Iterator):
3117         (WebCore::Layout::previousFloatingIndex):
3118         (WebCore::Layout::Iterator::operator++):
3119         (WebCore::Layout::Iterator::set):
3120         (WebCore::Layout::Iterator::operator== const):
3121         (WebCore::Layout::Iterator::operator!= const):
3122         * layout/floatformatting/FloatingContext.h: Renamed from Source/WebCore/layout/FloatingContext.h.
3123         (WebCore::Layout::FloatingContext::floatingState const):
3124         (WebCore::Layout::FloatingContext::layoutContext const):
3125         * layout/floatformatting/FloatingState.cpp: Renamed from Source/WebCore/layout/FloatingState.cpp.
3126         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
3127         (WebCore::Layout::FloatingState::FloatingState):
3128         (WebCore::Layout::belongsToThisFloatingContext):
3129         (WebCore::Layout::FloatingState::remove):
3130         (WebCore::Layout::FloatingState::append):
3131         (WebCore::Layout::FloatingState::bottom const):
3132         * layout/floatformatting/FloatingState.h: Renamed from Source/WebCore/layout/FloatingState.h.
3133         (WebCore::Layout::FloatingState::create):
3134         (WebCore::Layout::FloatingState::isEmpty const):
3135         (WebCore::Layout::FloatingState::FloatItem::layoutBox const):
3136         (WebCore::Layout::FloatingState::FloatItem::containingBlock const):
3137         (WebCore::Layout::FloatingState::FloatItem::displayBox const):
3138         (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const):
3139         (WebCore::Layout::FloatingState::floats const):
3140         (WebCore::Layout::FloatingState::last const):
3141         (WebCore::Layout::FloatingState::layoutContext const):
3142         (WebCore::Layout::FloatingState::root const):
3143         (WebCore::Layout::FloatingState::leftBottom const):
3144         (WebCore::Layout::FloatingState::rightBottom const):
3145         (WebCore::Layout::FloatingState::bottom const):
3146
3147 2018-08-22  Rob Buis  <rbuis@igalia.com>
3148
3149         Fetch: Stop checking Request.integrity's value in no-cors mode
3150         https://bugs.webkit.org/show_bug.cgi?id=188802
3151
3152         Reviewed by Frédéric Wang.
3153
3154         Remove this check since it was removed from the spec.
3155
3156         Behavior matches Chrome and Firefox.
3157
3158         Test: http/tests/subresource-integrity/sri-fetch.js:
3159
3160         * Modules/fetch/FetchRequest.cpp:
3161         (WebCore::FetchRequest::initializeOptions):
3162
3163 2018-08-22  Youenn Fablet  <youenn@apple.com>
3164
3165         Mark MediaStream Recording API as under consideration
3166         https://bugs.webkit.org/show_bug.cgi?id=188822
3167
3168         Reviewed by Jon Lee.
3169
3170         * features.json:
3171
3172 2018-08-22  Ms2ger  <Ms2ger@igalia.com>
3173
3174         [GTK] Never return an uninitialized ImageGStreamer object.
3175         https://bugs.webkit.org/show_bug.cgi?id=188305
3176
3177         Reviewed by Philippe Normand.
3178
3179         The single caller was already checking for a null return value, so
3180         make that check actually do something. Also remove the null-check on
3181         the return value of image(), which asserted that it would never return
3182         null.
3183
3184         Test: fast/canvas/canvas-createPattern-video-loading.html
3185
3186         * platform/graphics/gstreamer/ImageGStreamer.h:
3187         (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created.
3188         (WebCore::ImageGStreamer::image): Return a reference.
3189         (WebCore::ImageGStreamer::rect): Always assert that m_image is present.
3190         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3191         (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature.
3192
3193 2018-08-22  Zalan Bujtas  <zalan@apple.com>
3194
3195         Add changes missing from r234925.
3196
3197         * layout/blockformatting/BlockMarginCollapse.cpp:
3198         (WebCore::Layout::isMarginTopCollapsedWithParent):
3199         (WebCore::Layout::isMarginBottomCollapsedThrough):
3200         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
3201
3202 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
3203
3204         [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking
3205         https://bugs.webkit.org/show_bug.cgi?id=188693
3206
3207         Reviewed by Carlos Garcia Campos.
3208
3209         Populate Nicosia::CompositionLayer with additional LayerState member
3210         objects. For now we're using pending, staging and committed states,
3211         though it might be possible to narrow down these to just two.
3212
3213         Pending state contains state that will be moved to staging during the
3214         final steps of the next layer flush. flushState() method accumulates all
3215         state changes in the staging state, and also allows the caller to
3216         additionally perform flushing operations that are specific to backing
3217         store, image backing or content layer containers.
3218
3219         commitState() method moves staging state over into the committed state,
3220         again allowing user to pass a functor that receives the just-committed
3221         state and apply it to their composition engine.
3222
3223         Changes in state objects are done under a thread-safe lock. This might
3224         not be completely necessary at this point, but will be useful when
3225         additonal layer state updates will be coming from e.g. the scrolling
3226         thread. It might also make sense to tie in this lock use with the
3227         Nicosia::Scene lock in the future.
3228
3229         Nicosia::ContentLayerTextureMapperImpl is modified slightly to allow
3230         determining during flushes whether an update is pending. This is
3231         necessary for a special case in ThreadedCompositor where content (i.e.
3232         platform) layers like WebGL or video require an additional level of
3233         scene update coordination. This complete special case has to go through
3234         another review to see whether it's still necessary. Ideally we would be
3235         able to remove it.
3236
3237         CoordinatedGraphicsLayer is finally switched over to using
3238         Nicosia layer objects for state updates of any kind. This patch only
3239         adds all the necessary bits, but doesn't yet remove any of the existing
3240         code (but rather disables it temporarily, before it's removed).
3241
3242         Updating of simple state values is already in place. For backing stores,
3243         the flushCompositingStateForThisLayerOnly() method now takes care of
3244         preparing the backing store object if necessary as per layer state,
3245         while the updateContentBuffers() method is switched to operate with
3246         TiledBackingStore objects now kept on the BackingStoreTextureMapperImpl
3247         instance associated with that backing store. Helper methods like
3248         adjustContentsScale() and createBackingStore(), only called from the
3249         updateContentBuffers() method, are removed and the code there inlined.
3250
3251         For image-backed layers, the update is now done directly in
3252         the flushCompositingStateForThisLayerOnly() method, if necessary. The
3253         helper syncImageBacking() method is commented out in order to prevent
3254         double-painting of image buffers for now, but all this (along with the
3255         CoordinatedImageBacking logic in CompositingCoordinator) will be removed
3256         later.
3257
3258         For layers backed by platform layer objects, integration is relatively
3259         simple. setContentsToPlatformLayer() is changed to properly handle any
3260         passed-in platform layer object, and updatePlatformLayer() invokes the
3261         swapBuffersIfNeeded() method on the ContentLayerTextureMapperImpl object
3262         during each flush, if necessary.
3263
3264         In order to ensure any Nicosia-specific state update properly triggers
3265         a composition update, m_nicosia.performLayerUpdate is added and flipped
3266         to true during the flush in case of any state change. This then triggers
3267         a layer sync in the CompositingCoordinator object when the
3268         syncPendingStateChangesIncludingSubLayers() method is called. While no
3269         old-style layer state update is provided, it causes the necessary
3270         synchronization step that properly picks up the Nicosia-provided state
3271         changes. Once the old-style layer state tracking is removed, this method
3272         of update triggering will have to be updated as well.
3273
3274         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
3275         (Nicosia::CompositionLayer::flushState):
3276         (Nicosia::CompositionLayer::commitState):
3277         (Nicosia::CompositionLayer::accessCommitted):
3278         * platform/graphics/nicosia/NicosiaScene.h:
3279         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
3280         (Nicosia::ContentLayerTextureMapperImpl::flushUpdate):
3281         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h:
3282         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3283         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
3284         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
3285         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
3286         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
3287         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3288         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
3289         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
3290         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
3291         (WebCore::CoordinatedGraphicsLayer::adjustContentsScale): Deleted.
3292         (WebCore::CoordinatedGraphicsLayer::createBackingStore): Deleted.
3293         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3294
3295 2018-08-22  David Kilzer  <ddkilzer@apple.com>
3296
3297         Remove stale file references in WebCore Xcode project
3298
3299         I manually removed these using Xcode and verified that there was
3300         a commit that removed the original files.
3301
3302         Found by tool created for Bug 188754: Tool to fix folders that
3303         should map to directories in Xcode project files.
3304
3305         * WebCore.xcodeproj/project.pbxproj:
3306         (dom/DOMExceptions.in): Removed in r219741.
3307         (Modules/modern-media-controls/start-button.js):
3308         (Modules/modern-media-controls/volume-slider.css):
3309         (Modules/modern-media-controls/icon-button.css):
3310         (Modules/modern-media-controls/volume-slider.js):
3311         (Modules/modern-media-controls/macos-media-controls.js):
3312         (Modules/modern-media-controls/ios-inline-media-controls.css):
3313         (Modules/modern-media-controls/scrubber.css):
3314         (Modules/modern-media-controls/start-button.css):
3315         (Modules/modern-media-controls/scrubber.js):
3316         (Modules/modern-media-controls/icon-button.js):
3317         (Modules/modern-media-controls/macos-compact-inline-media-controls.css):
3318         (Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png):
3319         (Modules/modern-media-controls/images/iOS/start@1x.png):
3320         (Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png):
3321         (Modules/modern-media-controls/images/iOS/pause@2x.png):
3322         (Modules/modern-media-controls/images/iOS/play@3x.png):
3323         (Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png):
3324         (Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png):
3325         (Modules/modern-media-controls/images/iOS/pip-in@2x.png):
3326         (Modules/modern-media-controls/images/iOS/start@3x.png):
3327         (Modules/modern-media-controls/images/iOS/airplay@1x.png):
3328         (Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png):
3329         (Modules/modern-media-controls/images/iOS/slider-thumb@2x.png):
3330         (Modules/modern-media-controls/images/iOS/airplay@2x.png):
3331         (Modules/modern-media-controls/images/iOS/pause@3x.png):
3332         (Modules/modern-media-controls/images/iOS/pip-in@3x.png):
3333         (Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png):
3334         (Modules/modern-media-controls/images/iOS/pause@1x.png):
3335         (Modules/modern-media-controls/images/iOS/start@2x.png):
3336         (Modules/modern-media-controls/images/iOS/play@2x.png):
3337         (Modules/modern-media-controls/images/iOS/pip-in@1x.png):
3338         (Modules/modern-media-controls/images/iOS/play@1x.png):
3339         (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png):
3340         (Modules/modern-media-controls/images/macOS/rewind@1x.png):
3341         (Modules/modern-media-controls/images/macOS/play@2x.png):
3342         (Modules/modern-media-controls/images/macOS/volume-mute@2x.png):
3343         (Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png):
3344         (Modules/modern-media-controls/images/macOS/volume@2x.png):
3345         (Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png):
3346         (Modules/modern-media-controls/images/macOS/volume-compact@2x.png):
3347         (Modules/modern-media-controls/images/macOS/start@2x.png):
3348         (Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png):
3349         (Modules/modern-media-controls/images/macOS/airplay@2x.png):
3350         (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png):
3351         (Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png):
3352         (Modules/modern-media-controls/images/macOS/airplay@1x.png):
3353         (Modules/modern-media-controls/images/macOS/pip-in@1x.png):
3354         (Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png):
3355         (Modules/modern-media-controls/images/macOS/rewind@2x.png):
3356         (Modules/modern-media-controls/images/macOS/play-compact@1x.png):
3357         (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png):
3358         (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png):
3359         (Modules/modern-media-controls/images/macOS/volume@1x.png):
3360         (Modules/modern-media-controls/images/macOS/pip-in@2x.png):
3361         (Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png):
3362         (Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png):
3363         (Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png):
3364         (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png):
3365         (Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png):
3366         (Modules/modern-media-controls/images/macOS/pause-compact@1x.png):
3367         (Modules/modern-media-controls/images/macOS/start@1x.png):
3368         (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png):
3369         (Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png):
3370         (Modules/modern-media-controls/images/macOS/play@1x.png):
3371         (Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png):
3372         (Modules/modern-media-controls/images/macOS/forward@1x.png):
3373         (Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png):
3374         (Modules/modern-media-controls/images/macOS/pause@1x.png):
3375         (Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png):
3376         (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png):
3377         (Modules/modern-media-controls/images/macOS/pause@2x.png):
3378         (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png):
3379         (Modules/modern-media-controls/images/macOS/volume-compact@1x.png):
3380         (Modules/modern-media-controls/images/macOS/play-compact@2x.png):
3381         (Modules/modern-media-controls/images/macOS/media-selection@2x.png):
3382         (Modules/modern-media-controls/images/macOS/forward@2x.png):
3383         (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png):
3384         (Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png):
3385         (Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png):
3386         (Modules/modern-media-controls/images/macOS/media-selection@1x.png):
3387         (Modules/modern-media-controls/images/macOS/volume-mute@1x.png):
3388         (Modules/modern-media-controls/images/macOS/pause-compact@2x.png):
3389         (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png):
3390         (Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png):
3391         (Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png):