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