fast/images/animated-gif-paint-after-animation.html flaky crash
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-25  Fujii Hironori  <Hironori.Fujii@sony.com>
2
3         fast/images/animated-gif-paint-after-animation.html flaky crash
4         https://bugs.webkit.org/show_bug.cgi?id=178510
5
6         Reviewed by Said Abou-Hallawa.
7
8         ScalableImageDecoder was accessed from the main thread and the
9         image decoding thread without a mutex.
10
11         No new tests because there is no behavior change.
12
13         * platform/image-decoders/ScalableImageDecoder.h: Add m_mutex. Lock the mutex in setData.
14         * platform/image-decoders/ScalableImageDecoder.cpp:
15         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): Lock the mutex.
16         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): Ditto.
17         (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
18         (WebCore::ScalableImageDecoder::frameDurationAtIndex const): Ditto.
19         (WebCore::ScalableImageDecoder::createFrameImageAtIndex): Ditto.
20
21 2017-10-25  Chris Dumez  <cdumez@apple.com>
22
23         Add support for unregistering a service worker
24         https://bugs.webkit.org/show_bug.cgi?id=178735
25
26         Reviewed by Brady Eidson.
27
28         Add support for unregistering a service worker:
29         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister
30
31         Test: http/tests/workers/service/basic-unregister.https.html
32
33         * workers/service/ServiceWorkerContainer.cpp:
34         (WebCore::ServiceWorkerContainer::addRegistration):
35         (WebCore::ServiceWorkerContainer::removeRegistration):
36         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
37         * workers/service/ServiceWorkerContainer.h:
38         * workers/service/ServiceWorkerJob.cpp:
39         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
40         * workers/service/ServiceWorkerJob.h:
41         * workers/service/ServiceWorkerJobClient.h:
42         * workers/service/ServiceWorkerJobData.h:
43         (WebCore::ServiceWorkerJobData::encode const):
44         (WebCore::ServiceWorkerJobData::decode):
45         * workers/service/ServiceWorkerJobType.h:
46         * workers/service/ServiceWorkerRegistration.cpp:
47         (WebCore::containerForScriptExecutionContext):
48         (WebCore::ServiceWorkerRegistration::unregister):
49         * workers/service/server/SWClientConnection.cpp:
50         (WebCore::SWClientConnection::registrationJobResolvedInServer):
51         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
52         * workers/service/server/SWClientConnection.h:
53         * workers/service/server/SWServer.cpp:
54         (WebCore::SWServer::resolveRegistationJob):
55         (WebCore::SWServer::resolveUnregistrationJob):
56         * workers/service/server/SWServer.h:
57         * workers/service/server/SWServerRegistration.cpp:
58         (WebCore::SWServerRegistration::scriptContextStarted):
59         (WebCore::SWServerRegistration::startNextJob):
60         (WebCore::SWServerRegistration::runUnregisterJob):
61         (WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
62         (WebCore::SWServerRegistration::resolveWithUnregistrationResultOnMainThread):
63         (WebCore::SWServerRegistration::resolveCurrentRegistrationJob):
64         (WebCore::SWServerRegistration::resolveCurrentUnregistrationJob):
65         * workers/service/server/SWServerRegistration.h:
66
67 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
68
69         MediaSessionManager* needs to catch Obj-C exceptions
70         https://bugs.webkit.org/show_bug.cgi?id=178813
71
72         Reviewed by Tim Horton.
73
74         Wrap all calls out to Objective-C with BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS.
75
76         * platform/audio/ios/MediaSessionManagerIOS.mm:
77         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
78         (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
79         (WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
80         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
81         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
82         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
83         (-[WebMediaSessionHelper allocateVolumeView]):
84         (-[WebMediaSessionHelper initWithCallback:]):
85         * platform/audio/mac/MediaSessionManagerMac.mm:
86         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
87
88 2017-10-25  Andy Estes  <aestes@apple.com>
89
90         [Payment Request] Implement the "user aborts the payment request" algorithm
91         https://bugs.webkit.org/show_bug.cgi?id=178810
92
93         Reviewed by Tim Horton.
94
95         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
96         (WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
97         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
98         * Modules/paymentrequest/PaymentRequest.cpp:
99         (WebCore::PaymentRequest::cancel):
100         * Modules/paymentrequest/PaymentRequest.h:
101         * testing/MockPaymentCoordinator.cpp:
102         (WebCore::MockPaymentCoordinator::cancelPayment):
103         * testing/MockPaymentCoordinator.h:
104         * testing/MockPaymentCoordinator.idl:
105
106 2017-10-25  Jer Noble  <jer.noble@apple.com>
107
108         Autoplay muted videos still stop playback of other streaming apps in the background
109         https://bugs.webkit.org/show_bug.cgi?id=177920
110
111         Reviewed by Eric Carlson.
112
113         When creating a new <video> or <audio> element, the global AudioSession can sometimes have
114         its sessionCategory() set to "MediaPlayback", even if the element does not yet have a
115         source. This is because the constructor for the MediaElementSession is called before
116         m_isPlayingToWirelessTarget is initialized, and so in the MediaElementSession constructor,
117         the media element's m_isPlayingToWirelessTarget ivar is sometimes (uninitialized) true.
118
119         We could move the MediaElementSession ivar to the very end of the header, so it's
120         initialized last, but that still leaves the possibility of the MediaElementSession et. all
121         calling into the HTMLMediaElement before it's subclass's constructors have a chance to
122         initialize their own ivars (much less their vtables). So instead, we'll create and set the
123         MediaElementSession in a finishInitialization() method called from the HTMLVideoElement and
124         HTMLAudioElement's create() factory methods.
125
126         * html/HTMLAudioElement.cpp:
127         (WebCore::HTMLAudioElement::create):
128         * html/HTMLMediaElement.cpp:
129         (WebCore::HTMLMediaElement::HTMLMediaElement):
130         (WebCore::HTMLMediaElement::finishInitialization):
131         * html/HTMLMediaElement.h:
132         * html/HTMLVideoElement.cpp:
133         (WebCore::HTMLVideoElement::create):
134
135 2017-10-25  Javier Fernandez  <jfernandez@igalia.com>
136
137         [css-grid] Avoid clearing the overrideContainingBlockWidth if possible
138         https://bugs.webkit.org/show_bug.cgi?id=178260
139
140         Reviewed by Sergio Villar Senin.
141
142         Since the intrinsic width computation uses the same logic than the
143         track sizing algorithm we are clearing the overrideContainingBlockWidth
144         of some grid items that are required to laid out them properly.
145
146         It's very uncommon that any intrinsic size computation isn't performed
147         as part of a layout process. However, if it happens, once cleared the
148         overrideContainingBlockWidth it may lead to an incorrect layout of the
149         affected grid items.
150
151         This change is a defensive approach to avoid the issues caused by
152         such off-layout preferred size requests, which may imply recomputing
153         the grid container intrinsic size.
154
155         No new tests, because we are only removing some redundant logic.
156
157         * rendering/GridTrackSizingAlgorithm.cpp:
158         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
159         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
160         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
161         (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
162         (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
163         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
164         * rendering/GridTrackSizingAlgorithm.h:
165
166 2017-10-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
167
168         Unreviewed follow up changing one more enum value as discussed in the bug
169         https://bugs.webkit.org/show_bug.cgi?id=177810
170
171         * platform/glib/LowPowerModeNotifierGLib.cpp:
172         (WebCore::LowPowerModeNotifier::updateState): use NONE instead of DISCHARGING, to ensure
173         it will build even with older upower.
174
175 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
176
177         Make SERVICE_WORKER feature buildable on GTK, WPE
178         https://bugs.webkit.org/show_bug.cgi?id=178574
179
180         Reviewed by Carlos Garcia Campos.
181
182         * CMakeLists.txt: Add missing include paths and files to the build.
183         * Sources.txt: Add missing files to the build.
184         * WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
185         JSFetchEventCustom.cpp targets, they're now built via unified sources.
186         * bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
187         with the ENABLE(SERVICE_WORKER) guards.
188
189 2017-10-24  Alejandro G. Castro  <alex@igalia.com>
190
191         Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
192         https://bugs.webkit.org/show_bug.cgi?id=178721
193
194         Reviewed by Youenn Fablet.
195
196         Assert when we reach those situations and return some value after that to avoid warning.
197
198         No new tests, this is a clean up.
199
200         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
201         (WebCore::sessionDescriptionType):
202         (WebCore::signalingState):
203         (WebCore::toRTCIceConnectionState):
204         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
205         (WebCore::bundlePolicyfromConfiguration):
206         (WebCore::iceTransportPolicyfromConfiguration):
207
208 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
209
210         RenderSVGModelObject::checkIntersection triggers layout
211         https://bugs.webkit.org/show_bug.cgi?id=178710
212
213         Reviewed by Simon Fraser.
214
215         Fixed the bug that checkIntersection and checkEnclosure no longer updates the layout after r223882.
216
217         Test: svg/custom/check-intersection-basic.svg
218
219         * svg/SVGSVGElement.cpp:
220         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
221         (WebCore::SVGSVGElement::checkIntersection):
222         (WebCore::SVGSVGElement::checkEnclosure):
223         * svg/SVGSVGElement.h:
224
225 2017-10-24  Andy Estes  <aestes@apple.com>
226
227         [Apple Pay] Implement a paymentmethodselected event for PaymentRequest
228         https://bugs.webkit.org/show_bug.cgi?id=178765
229
230         Reviewed by Tim Horton.
231
232         When the Apple Pay payment method changes, fire an applepaypaymentmethodchanged event on the
233         PaymentRequest object. The event has a paymentMethod property and an updateWith() method
234         which behaves identically to PaymentRequestUpdateEvent.updateWith().
235
236         Test: http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html
237
238         * DerivedSources.make:
239         * Modules/applepay/ApplePayPaymentMethod.idl:
240         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
241         * Modules/applepay/PaymentMethod.h:
242         (WebCore::PaymentMethod::PaymentMethod): Deleted.
243         (WebCore::PaymentMethod::pkPaymentMethod const): Deleted.
244         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
245         (WebCore::ApplePayPaymentHandler::detailsUpdated):
246         (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
247         (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
248         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
249         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Added.
250         (WebCore::ApplePayPaymentMethodUpdateEvent::ApplePayPaymentMethodUpdateEvent):
251         (WebCore::ApplePayPaymentMethodUpdateEvent::eventInterface const):
252         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Added.
253         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl: Added.
254         * Modules/paymentrequest/PaymentHandler.h:
255         * Modules/paymentrequest/PaymentRequest.cpp:
256         (WebCore::PaymentRequest::shippingAddressChanged):
257         (WebCore::PaymentRequest::shippingOptionChanged):
258         (WebCore::PaymentRequest::dispatchEvent):
259         (WebCore::PaymentRequest::updateWith):
260         (WebCore::PaymentRequest::settleDetailsPromise):
261         (WebCore::PaymentRequest::dispatchUpdateEvent): Deleted.
262         * Modules/paymentrequest/PaymentRequest.h:
263         * Modules/paymentrequest/PaymentRequest.idl:
264         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
265         (WebCore::PaymentRequestUpdateEvent::updateWith):
266         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
267         * WebCore.xcodeproj/project.pbxproj:
268         * dom/EventNames.h:
269         * dom/EventNames.in:
270         * testing/MockPaymentCoordinator.cpp:
271         (WebCore::MockPaymentCoordinator::changePaymentMethod):
272         * testing/MockPaymentCoordinator.h:
273         * testing/MockPaymentCoordinator.idl:
274         * testing/MockPaymentMethod.h: Added.
275
276 2017-10-24  Youenn Fablet  <youenn@apple.com>
277
278         ServiceWorkerClientFetch should return an error that is not null in case of failure
279         https://bugs.webkit.org/show_bug.cgi?id=178761
280
281         Reviewed by Geoffrey Garen.
282
283         Covered by existing tests.
284
285         As per spec, ServiceWorkerJob should not go through Service Worker Handle Fetch
286         for fetching scripts.
287
288         * workers/WorkerScriptLoader.cpp:
289         (WebCore::WorkerScriptLoader::loadAsynchronously):
290         * workers/WorkerScriptLoaderClient.h:
291         (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const):
292         * workers/service/ServiceWorkerJob.h:
293
294 2017-10-24  Keith Miller  <keith_miller@apple.com>
295
296         Move inspector and loader to unified sources.
297         https://bugs.webkit.org/show_bug.cgi?id=178760
298
299         Rubber-stamped by Tim Horton.
300
301         * CMakeLists.txt:
302         * Sources.txt:
303         * WebCore.xcodeproj/project.pbxproj:
304
305 2017-10-24  Alex Christensen  <achristensen@webkit.org>
306
307         Fix build after r223940
308
309         * inspector/WebConsoleAgent.cpp:
310
311 2017-10-24  Alex Christensen  <achristensen@webkit.org>
312
313         Fix Windows build after r223929.
314         https://bugs.webkit.org/show_bug.cgi?id=177027
315
316         * inspector/WebConsoleAgent.cpp:
317         (WebCore::WebConsoleAgent::getLoggingChannels):
318         Always initialize the variable "level".  Visual studio was complaining about the possibility of not initializing it
319         but this is only possible if logChannel->level is an invalid enum value.
320
321 2017-10-24  Alex Christensen  <achristensen@webkit.org>
322
323         Fix Windows build after r223925
324         https://bugs.webkit.org/show_bug.cgi?id=178687
325
326         * html/ImageBitmap.cpp:
327         (WebCore::interpolationQualityForResizeQuality):
328         Visual Studio was complaining that not all control paths returned a value.
329
330 2017-10-24  Youenn Fablet  <youenn@apple.com>
331
332         Enable service worker to use cache storage api
333         https://bugs.webkit.org/show_bug.cgi?id=178684
334
335         Reviewed by Brady Eidson.
336
337         Test: http/tests/workers/service/service-worker-cache-api.https.html
338
339         Updated WorkerLoaderProxy so that it can create a CacheStorageConnection.
340         Update WorkerCacheStorageConnection to take benefit of that.
341         This allows creating a CacheStorageConnection based on the page for regular workers and differently for Service Worker context.
342
343         Added ServiceWorkerThreadProxy as a proxy to ServiceWorkerThread.
344         It is in particular responsible to do proxy for loading tasks.
345         It implements cache API support for service worker by creating a dedicated CacheStorageConnection.
346
347         * Modules/cache/WorkerCacheStorageConnection.cpp:
348         (WebCore::WorkerCacheStorageConnection::create):
349         (WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
350         (WebCore::WorkerCacheStorageConnection::doOpen):
351         (WebCore::WorkerCacheStorageConnection::doRemove):
352         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
353         (WebCore::WorkerCacheStorageConnection::reference):
354         (WebCore::WorkerCacheStorageConnection::dereference):
355         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
356         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
357         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
358         * WebCore.xcodeproj/project.pbxproj:
359         * workers/WorkerLoaderProxy.h:
360         * workers/WorkerMessagingProxy.cpp:
361         (WebCore::WorkerMessagingProxy::createCacheStorageConnection):
362         * workers/WorkerMessagingProxy.h:
363         * workers/service/context/ServiceWorkerThread.cpp:
364         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
365         * workers/service/context/ServiceWorkerThread.h:
366         * workers/service/context/ServiceWorkerThreadProxy.cpp: Added.
367         (WebCore::ServiceWorkerThreadProxy::create):
368         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
369         (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
370         (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
371         (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
372         * workers/service/context/ServiceWorkerThreadProxy.h: Added.
373
374 2017-10-24  Alex Christensen  <achristensen@webkit.org>
375
376         Optionally store entire ResourceRequest for ping loads
377         https://bugs.webkit.org/show_bug.cgi?id=178756
378
379         Reviewed by Tim Horton.
380
381         No change in behavior.
382         This uses less memory in the common loading case.
383         This will be needed for moving appcache loading to the Networking Process.
384         See https://bugs.webkit.org/show_bug.cgi?id=178540
385
386         * loader/cache/CachedResource.cpp:
387         (WebCore::CachedResource::load):
388         * loader/cache/CachedResource.h:
389         (WebCore::CachedResource::setOriginalRequest):
390         (WebCore::CachedResource::originalRequest const):
391         (WebCore::CachedResource::setOriginalRequestHeaders): Deleted.
392         * loader/cache/CachedResourceLoader.cpp:
393         (WebCore::CachedResourceLoader::requestResource):
394
395 2017-10-24  Andy Estes  <aestes@apple.com>
396
397         [WebIDL] Support the ExportMacro attribute for dictionaries
398         https://bugs.webkit.org/show_bug.cgi?id=178752
399
400         Reviewed by Sam Weinig.
401
402         * bindings/scripts/CodeGeneratorJS.pm:
403         (GenerateDictionaryHeaderContent):
404         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
405         * bindings/scripts/test/TestStandaloneDictionary.idl:
406
407 2017-10-24  Eric Carlson  <eric.carlson@apple.com>
408
409         Web Inspector: Enable WebKit logging configuration and display
410         https://bugs.webkit.org/show_bug.cgi?id=177027
411         <rdar://problem/33964767>
412
413         Reviewed by Joseph Pecoraro.
414
415         Test: inspector/console/webcore-logging.html
416
417         * dom/Document.cpp:
418         (WebCore::Document::~Document): Stop observing the logger.
419         (WebCore::Document::logger): Observe the logger.
420         (WebCore::Document::didLogMessage): Forward logging messages to the inspector.
421         * dom/Document.h:
422
423         * inspector/WebConsoleAgent.cpp:
424         (WebCore::WebConsoleAgent::getLoggingChannels): New, return the state of log runtime channels.
425         (WebCore::WebConsoleAgent::setLoggingChannelLevel): New, set the state of a channel.
426         * inspector/WebConsoleAgent.h:
427
428         * platform/Logging.cpp:
429         (WebCore::getLogChannel): New, get a log channel by name.
430         * platform/Logging.h:
431
432 2017-10-24  Dean Jackson  <dino@apple.com>
433
434         Attempted build fix for Sierra.
435
436         * html/ImageBitmap.cpp:
437         (WebCore::croppedSourceRectangleWithFormatting):
438
439 2017-10-24  Dean Jackson  <dino@apple.com>
440
441         Implement resizing options for ImageBitmap rendering
442         https://bugs.webkit.org/show_bug.cgi?id=178687
443         <rdar://problem/35135417>
444
445         Reviewed by Sam Weinig.
446
447         Implement many of the sizing options for createImageBitmap.
448
449         Test: http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html
450
451         * html/ImageBitmap.cpp:
452         (WebCore::croppedSourceRectangleWithFormatting):
453
454             Implement the first bit of the algorithm from
455             the HTML specification.
456
457         (WebCore::outputSizeForSourceRectangle):
458
459             ... and then the second bit. Leave the rest in
460             comments for now.
461
462         (WebCore::interpolationQualityForResizeQuality):
463
464             Helper function to map ImageBitmapOptions to
465             GraphicsContext.
466
467         (WebCore::ImageBitmap::createPromise):
468
469             Implement more of the sizing algorithm.
470
471         * html/ImageBitmap.h: Origin tainting is defined to be false by default.
472
473 2017-10-24  Chris Dumez  <cdumez@apple.com>
474
475         Add initial implementation for serviceWorker.postMessage()
476         https://bugs.webkit.org/show_bug.cgi?id=178534
477
478         Reviewed by Youenn Fablet.
479
480         Add initial implementation for serviceWorker.postMessage():
481         - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
482
483         Test: http/tests/workers/service/basic-ServiceWorker-postMessage.https.html
484
485         * CMakeLists.txt:
486         * DerivedSources.make:
487         * Sources.txt:
488         * WebCore.xcodeproj/project.pbxproj:
489         * bindings/js/JSBindingsAllInOne.cpp:
490         * bindings/js/JSExtendableMessageEvent.cpp: Added.
491         (WebCore::JSExtendableMessageEvent::data const):
492         * bindings/js/WebCoreBuiltinNames.h:
493         * dom/Document.h:
494         * dom/EventNames.in:
495         * dom/MessagePortChannel.h:
496         * dom/ScriptExecutionContext.h:
497         * workers/WorkerGlobalScope.h:
498         * workers/service/ExtendableEvent.cpp:
499         (WebCore::ExtendableEvent::ExtendableEvent):
500         (WebCore::ExtendableEvent::~ExtendableEvent):
501         * workers/service/ExtendableEvent.h:
502         * workers/service/ExtendableMessageEvent.cpp: Added.
503         (WebCore::ExtendableMessageEvent::create):
504         (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
505         (WebCore::ExtendableMessageEvent::~ExtendableMessageEvent):
506         * workers/service/ExtendableMessageEvent.h: Added.
507         * workers/service/ExtendableMessageEvent.idl: Added.
508         * workers/service/ServiceWorker.cpp:
509         (WebCore::ServiceWorker::ServiceWorker):
510         (WebCore::ServiceWorker::postMessage):
511         (WebCore::ServiceWorker::state const):
512         (WebCore::ServiceWorker::scriptExecutionContext const):
513         * workers/service/ServiceWorker.h:
514         * workers/service/ServiceWorkerContainer.cpp:
515         (WebCore::ServiceWorkerContainer::controller const):
516         * workers/service/ServiceWorkerContainer.h:
517         * workers/service/ServiceWorkerGlobalScope.cpp:
518         (WebCore::ServiceWorkerGlobalScope::thread):
519         * workers/service/ServiceWorkerGlobalScope.h:
520         (isType):
521         * workers/service/context/ServiceWorkerThread.cpp:
522         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
523         * workers/service/context/ServiceWorkerThread.h:
524         * workers/service/server/SWClientConnection.h:
525
526 2017-10-24  Andy Estes  <aestes@apple.com>
527
528         [Payment Request] Implement the "PaymentRequest updated" algorithm
529         https://bugs.webkit.org/show_bug.cgi?id=178689
530
531         Reviewed by Alex Christensen.
532
533         Implemented the "PaymentRequest updated" algorithm by firing shippingaddresschange and
534         shippingoptionchange events at the right times and implementing
535         PaymentRequestUpdateEvent.updateWith().
536
537         Tests: http/tests/paymentrequest/payment-request-change-shipping-address.https.html
538                http/tests/paymentrequest/payment-request-change-shipping-option.https.html
539                http/tests/paymentrequest/updateWith-method-pmi-handling.https.html
540
541         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
542         (WebCore::convertAndValidate): Added. Converts a PaymentDetailsInit to a
543         ApplePaySessionPaymentRequest::TotalAndLineItems.
544         (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Created a ShippingContactUpdate
545         and passed it to PaymentCoordinator::completeShippingContactSelection().
546         (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): Created a ShippingMethodUpdate and
547         passed it to PaymentCoordinator::completeShippingMethodSelection().
548         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
549         * Modules/paymentrequest/PaymentHandler.h:
550         * Modules/paymentrequest/PaymentRequest.cpp:
551         (WebCore::checkAndCanonicalizeDetails): Moved the logic for checking and canonicalizing a
552         PaymentDetailsBase from PaymentRequest::create() to here.
553         (WebCore::PaymentRequest::create): Called checkAndCanonicalizeDetails().
554         (WebCore::PaymentRequest::abortWithException): Moved the body of stop() to here and
555         parameterized the Exception with which to abort m_showPromise.
556         (WebCore::PaymentRequest::stop): Called abortWithException() with an AbortError.
557         (WebCore::PaymentRequest::shippingAddressChanged): Called dispatchUpdateEvent() with
558         shippingaddresschangeEvent.
559         (WebCore::PaymentRequest::shippingOptionChanged): Ditto with shippingoptionchangeEvent.
560         (WebCore::PaymentRequest::dispatchUpdateEvent): Created a PaymentRequestUpdateEvent and
561         dispatched it.
562         (WebCore::PaymentRequest::updateWith): Added a settle handler to m_detailsPromise.
563         (WebCore::PaymentRequest::settleDetailsPromise): Updated the PaymentRequest with the new
564         details and called PaymentHandler::shippingAddressUpdated() or
565         PaymentHandler::shippingOptionUpdated().
566         * Modules/paymentrequest/PaymentRequest.h:
567         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
568         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
569         (WebCore::PaymentRequestUpdateEvent::updateWith): Called PaymentRequest::updateWith().
570         (WebCore::PaymentRequestUpdateEvent::eventInterface const): Returned
571         PaymentRequestUpdateEventInterfaceType.
572         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
573         * Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
574         * testing/MockPaymentCoordinator.cpp:
575         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
576         (WebCore::MockPaymentCoordinator::openPaymentSetup):
577         (WebCore::MockPaymentCoordinator::completeMerchantValidation): Stopped calling
578         PaymentCoordinator::didAuthorizePayment().
579         (WebCore::MockPaymentCoordinator::changeShippingOption): Called
580         PaymentCoordinator::didSelectShippingMethod().
581         (WebCore::MockPaymentCoordinator::acceptPayment): Called
582         PaymentCoordinator::didAuthorizePayment().
583         * testing/MockPaymentCoordinator.h:
584         * testing/MockPaymentCoordinator.idl:
585
586 2017-10-24  Alex Christensen  <achristensen@webkit.org>
587
588         Apply custom header fields from WebsitePolicies to same-domain requests
589         https://bugs.webkit.org/show_bug.cgi?id=178356
590         <rdar://problem/31073436>
591
592         Reviewed by Brady Eidson.
593
594         Covered by new API tests.
595
596         * loader/cache/CachedResourceLoader.cpp:
597         (WebCore::CachedResourceLoader::requestResource):
598         * platform/network/ResourceRequestBase.cpp:
599         (WebCore::ResourceRequestBase::setCachePolicy):
600         (WebCore::ResourceRequestBase::setTimeoutInterval):
601         (WebCore::ResourceRequestBase::setHTTPMethod):
602         (WebCore::ResourceRequestBase::setHTTPHeaderField):
603         (WebCore::ResourceRequestBase::clearHTTPAuthorization):
604         (WebCore::ResourceRequestBase::clearHTTPContentType):
605         (WebCore::ResourceRequestBase::clearHTTPReferrer):
606         (WebCore::ResourceRequestBase::clearHTTPOrigin):
607         (WebCore::ResourceRequestBase::clearHTTPUserAgent):
608         (WebCore::ResourceRequestBase::clearHTTPAccept):
609         (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
610         (WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
611         (WebCore::ResourceRequestBase::setHTTPBody):
612         (WebCore::ResourceRequestBase::setAllowCookies):
613         (WebCore::ResourceRequestBase::setPriority):
614         (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
615         (WebCore::ResourceRequestBase::addHTTPHeaderField):
616         (WebCore::ResourceRequestBase::setHTTPHeaderFields):
617         If we only update the platform request when headers are added (or other changes) for HTTP requests,
618         then the changes will not affect the NSURLRequest that is sent over IPC or visible to the API.
619         This is necessary for these new tests to work, but it's also of growing importance since our
620         introduction of WKURLSchemeHandler.
621
622 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
623
624         Adopt new secure coding APIs
625         https://bugs.webkit.org/show_bug.cgi?id=178484
626         <rdar://problem/34837193>
627
628         Reviewed by Tim Horton.
629
630         Switch to new NSKeyed[Un]Archiver methods that active and use
631         NSSecureCoding by default.
632
633         Most of the new API is wrapped in a set of convenience methods so we can
634         build without the new API on older systems.
635
636         No change in behavior.
637
638         * editing/cocoa/EditorCocoa.mm:
639         (WebCore::archivedDataForAttributedString): Use new convenience method
640         to archive the string object.
641         * loader/archive/cf/LegacyWebArchiveMac.mm:
642         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
643         use secure coding where possible.
644         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
645         * platform/ios/PlatformPasteboardIOS.mm:
646         (WebCore::PlatformPasteboard::write): Use new secure API.
647         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
648         * testing/cocoa/WebArchiveDumpSupport.mm:
649         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
650         secure coding API where possible.
651
652 2017-10-24  Jeremy Jones  <jeremyj@apple.com>
653
654         HTMLMediaElement should iterate HTMLTrackElements consistently.
655         https://bugs.webkit.org/show_bug.cgi?id=178423
656         rdar://problem/35044967
657
658         Reviewed by Eric Carlson.
659
660         No new tests because no expected behavior change.
661
662         HTMLMediaElement iterates HTMLTrackElements as children in every place but one, where it iterates them
663         as descendants. It should always iterate them as children.
664
665         * html/HTMLMediaElement.cpp:
666         (WebCore::HTMLMediaElement::finishParsingChildren):
667
668 2017-10-24  Chris Dumez  <cdumez@apple.com>
669
670         SerializedScriptValue::deserialize() should take ports as a const Vector&
671         https://bugs.webkit.org/show_bug.cgi?id=178727
672
673         Reviewed by Alex Christensen.
674
675         SerializedScriptValue::deserialize() should take ports as a const Vector&, not a Vector&.
676         It does not modify the input vector.
677
678         * bindings/js/JSMessageEventCustom.cpp:
679         (WebCore::JSMessageEvent::data const):
680         * bindings/js/SerializedScriptValue.cpp:
681         (WebCore::CloneDeserializer::deserialize):
682         (WebCore::CloneDeserializer::CloneDeserializer):
683         (WebCore::SerializedScriptValue::deserialize):
684         * bindings/js/SerializedScriptValue.h:
685
686 2017-10-24  Konstantin Tokarev  <annulen@yandex.ru>
687
688         [MediaFoundation] Videos are always autoplaying for local files
689         https://bugs.webkit.org/show_bug.cgi?id=178693
690
691         Patch by Doug Massay.
692         Reviewed by Alex Christensen.
693
694         r199114 fixes autoplay issue only if starting session invokes
695         buffering stage. However when local files are played, onBufferingStarted
696         and onBufferingStopped are not called, and video is not paused.
697
698         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
699         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
700         (WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
701         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
702
703 2017-10-24  Matt Lewis  <jlewis3@apple.com>
704
705         Unreviewed, rolling out r223889.
706
707         This caused multiple crashes on all platforms
708
709         Reverted changeset:
710
711         "Adopt new secure coding APIs"
712         https://bugs.webkit.org/show_bug.cgi?id=178484
713         https://trac.webkit.org/changeset/223889
714
715 2017-10-24  Antti Koivisto  <antti@apple.com>
716
717         Create inline wrappers for before/after pseudo elements that have display:contents
718         https://bugs.webkit.org/show_bug.cgi?id=178722
719
720         Reviewed by Ryosuke Niwa.
721
722         We can handle before and after pseudo elements with display:contents by giving them
723         inline renderers with style inherited from display:contents style. This removes
724         need for complicated logic for this case and handles everything correctly.
725
726         This is a better approach and replaces the one taken in bug 178584.
727         It also fixes two display:contents WPTs.
728
729         * dom/PseudoElement.h:
730
731             There is no need to track content renderers separately anymore. They always descendants of
732             pseudo element's renderer (which is an inline wrapper in case of display:contents).
733
734         * rendering/style/RenderStyle.cpp:
735         (WebCore::RenderStyle::copyContentFrom):
736         * rendering/style/RenderStyle.h:
737         * style/RenderTreeUpdaterGeneratedContent.cpp:
738         (WebCore::createContentRenderers):
739         (WebCore::updateStyleForContentRenderers):
740         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
741         (WebCore::removeAndDestroyContentRenderers): Deleted.
742
743             Since content renderers are now always descendants of the pseudo renderer
744             there is no need for a separate destruction path.
745
746         * style/StyleTreeResolver.cpp:
747         (WebCore::Style::TreeResolver::resolvePseudoStyle):
748
749             Create ElementUpdate with a style that will produce an inline wrapper.
750
751 2017-10-24  Wenson Hsieh  <wenson_hsieh@apple.com>
752
753         [iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
754         https://bugs.webkit.org/show_bug.cgi?id=178713
755         <rdar://problem/35115906>
756
757         Reviewed by Eric Carlson.
758
759         Loading AVFoundation should not be required to answer the question of MediaPlayer::isAvailable() on iOS, where
760         both AVFoundation and CoreMedia frameworks should always exist. As such, we can bail early and return true to
761         avoid always dynamically loading AVFoundation and CoreMedia.
762
763         * platform/graphics/MediaPlayer.cpp:
764         (WebCore::MediaPlayer::isAvailable):
765
766 2017-10-24  Antoine Quint  <graouts@apple.com>
767
768         RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
769         https://bugs.webkit.org/show_bug.cgi?id=178716
770         <rdar://problem/35112900>
771
772         Reviewed by Dean Jackson.
773
774         * rendering/RenderThemeCocoa.mm:
775         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
776
777 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
778
779         SizesAttributeParser::SizesAttributeParser triggers layout
780         https://bugs.webkit.org/show_bug.cgi?id=178712
781
782         Reviewed by Antti Koivisto.
783
784         Revert r213711 as this change introduced an unwated synchronous layout inside Node::insertedIntoAncestor.
785
786         The test had been marked as timing out since r191379 and changed to failing expectation in r199225
787         as the test result's error message changes from run to run.
788
789         Disabled Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
790                         had been marked failing since r199225, prior to which it was marked as timeout in r191379.
791                         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
792                         is now marked as flaky.
793
794         * css/parser/SizesAttributeParser.cpp:
795         (WebCore::SizesAttributeParser::SizesAttributeParser):
796
797 2017-10-24  Keith Miller  <keith_miller@apple.com>
798
799         Unreviewed, fix internal iOS build.
800
801         * Sources.txt:
802
803 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
804
805         Adopt new secure coding APIs
806         https://bugs.webkit.org/show_bug.cgi?id=178484
807         <rdar://problem/34837193>
808
809         Reviewed by Tim Horton.
810
811         Switch to new NSKeyed[Un]Archiver methods that active and use
812         NSSecureCoding by default.
813
814         Most of the new API is wrapped in a set of convenience methods so we can
815         build without the new API on older systems.
816
817         No change in behavior.
818
819         * editing/cocoa/EditorCocoa.mm:
820         (WebCore::archivedDataForAttributedString): Use new convenience method
821         to archive the string object.
822         * loader/archive/cf/LegacyWebArchiveMac.mm:
823         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
824         use secure coding where possible.
825         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
826         * platform/ios/PlatformPasteboardIOS.mm:
827         (WebCore::PlatformPasteboard::write): Use new secure API.
828         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
829         * testing/cocoa/WebArchiveDumpSupport.mm:
830         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
831         secure coding API where possible.
832
833 2017-10-24  Miguel Gomez  <magomez@igalia.com>
834
835         [GTK][X11] Windy.com shows always straight wind lines
836         https://bugs.webkit.org/show_bug.cgi?id=176718
837
838         Reviewed by Carlos Garcia Campos.
839
840         WebGL's GL_LUMINANCE_ALPHA format is not available in OpenGL when using a version >= 3.2
841         and a core profile. In that case, we need to replace it with GL_RG and swizzle the color
842         components appropriately.
843
844         No new behavior.
845
846         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
847         (WebCore::GraphicsContext3D::texImage2D):
848         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
849         (WebCore::GraphicsContext3D::texSubImage2D):
850
851 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
852
853         DocumentOrderedMap::add should release assert that tree scopes match
854         https://bugs.webkit.org/show_bug.cgi?id=178708
855
856         Reviewed by Antti Koivisto.
857
858         Assert that the tree scope of element matches the given tree scope instead of asserting that
859         element is in tree scope, and replaced the use of RELEASE_ASSERT by the newly added
860         RELEASE_ASSERT_WITH_SECURITY_IMPLICATION to clarify the semantics of these assertions.
861
862         Also removed now redudnant early exits which would never execute due to release assertions.
863
864         * dom/DocumentOrderedMap.cpp:
865         (WebCore::DocumentOrderedMap::add):
866         (WebCore::DocumentOrderedMap::remove):
867         (WebCore::DocumentOrderedMap::get const):
868
869 2017-10-24  Michael Catanzaro  <mcatanzaro@igalia.com>
870
871         -Wsubobject-linkage warning in InspectorIndexedDBAgent.cpp
872         https://bugs.webkit.org/show_bug.cgi?id=178698
873
874         Reviewed by Joseph Pecoraro.
875
876         * inspector/InspectorIndexedDBAgent.cpp:
877
878 2017-10-24  Antoine Quint  <graouts@apple.com>
879
880         [Web Animations] Add basic timing and target properties
881         https://bugs.webkit.org/show_bug.cgi?id=178674
882
883         Reviewed by Dean Jackson.
884
885         We add three new interfaces to expose enough properties to establish basic timing properties,
886         a start time and duration, and the target of an animation. The startTime property is set on
887         the Animation object, the target is set on the KeyframeEffect set as the effect property on
888         the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.
889
890         Tests: webanimations/animation-effect-timing.html
891                webanimations/animation-effect.html
892                webanimations/animation-interface-effect-property.html
893                webanimations/animation-interface-start-time-property.html
894                webanimations/keyframe-effect-interface-timing-duration.html
895                webanimations/keyframe-effect.html
896
897         * CMakeLists.txt:
898         * DerivedSources.make:
899         * Sources.txt:
900         * WebCore.xcodeproj/project.pbxproj:
901         * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
902         (WebCore::AnimationEffect::AnimationEffect):
903         (WebCore::AnimationEffect::~AnimationEffect):
904         * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
905         (WebCore::AnimationEffect::isKeyframeEffect const):
906         (WebCore::AnimationEffect::timing const):
907         (WebCore::AnimationEffect::classType const):
908         * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
909         * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
910         (WebCore::AnimationEffectTiming::create):
911         (WebCore::AnimationEffectTiming::AnimationEffectTiming):
912         (WebCore::AnimationEffectTiming::~AnimationEffectTiming):
913         * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
914         * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
915         * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
916         (WebCore::KeyframeEffect::create):
917         (WebCore::KeyframeEffect::KeyframeEffect):
918         * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
919         * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
920         * animation/WebAnimation.cpp:
921         (WebCore::WebAnimation::setEffect):
922         * animation/WebAnimation.h:
923         * animation/WebAnimation.idl:
924         * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
925         (WebCore::toJSNewlyCreated):
926         (WebCore::toJS):
927         * bindings/js/WebCoreBuiltinNames.h:
928
929 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
930
931         RenderSVGModelObject::checkIntersection triggers layout
932         https://bugs.webkit.org/show_bug.cgi?id=178710
933
934         Reviewed by Antti Koivisto.
935
936         Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.
937
938         * rendering/svg/RenderSVGModelObject.cpp:
939         (WebCore::getElementCTM):
940         * svg/SVGSVGElement.cpp:
941         (WebCore::SVGSVGElement::getEnclosureList):
942
943 2017-10-24  Nan Wang  <n_wang@apple.com>
944
945         AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
946         https://bugs.webkit.org/show_bug.cgi?id=178697
947
948         Reviewed by Chris Fleizach.
949
950         When we are calling _accessibilityMinValue and _accessibilityMaxValue on iOS, 
951         it might cause crash if the AX object has already been detached. Fixed this 
952         by adding the necessary checks.
953
954         Test: accessibility/ios-simulator/slider-min-value-crash.html
955
956         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
957         (-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
958         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
959
960 2017-10-23  Keith Miller  <keith_miller@apple.com>
961
962         Unreviewed, restore unneeded all in ones.
963
964         * CMakeLists.txt:
965
966 2017-10-23  Commit Queue  <commit-queue@webkit.org>
967
968         Unreviewed, rolling out r223870 and r223871.
969         https://bugs.webkit.org/show_bug.cgi?id=178702
970
971         broke the windows build (Requested by keith_miller on
972         #webkit).
973
974         Reverted changesets:
975
976         "Add html, inspector, loader to unified sources"
977         https://bugs.webkit.org/show_bug.cgi?id=178695
978         https://trac.webkit.org/changeset/223870
979
980         "Unrievwed, fix windows build."
981         https://trac.webkit.org/changeset/223871
982
983 2017-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
984
985         Unreviewed, attempt to fix initializeSupportedImageMIMETypes after r223860
986         https://bugs.webkit.org/show_bug.cgi?id=178618
987         <rdar://problem/35108852>
988
989         * platform/MIMETypeRegistry.cpp:
990         (WebCore::initializeSupportedImageMIMETypes):
991
992 2017-10-23  Keith Miller  <keith_miller@apple.com>
993
994         Unrievwed, fix windows build.
995
996         * CMakeLists.txt:
997
998 2017-10-23  Keith Miller  <keith_miller@apple.com>
999
1000         Add html, inspector, loader to unified sources
1001         https://bugs.webkit.org/show_bug.cgi?id=178695
1002
1003         Rubber-stamped by Tim Horton.
1004
1005         * CMakeLists.txt:
1006         * Sources.txt:
1007         * WebCore.xcodeproj/project.pbxproj:
1008
1009 2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>
1010
1011         Web Inspector: Remove unused Console.setMonitoringXHREnabled
1012         https://bugs.webkit.org/show_bug.cgi?id=178617
1013
1014         Reviewed by Sam Weinig.
1015
1016         * inspector/InspectorInstrumentation.cpp:
1017         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
1018         * inspector/InspectorInstrumentation.h:
1019         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
1020         * inspector/WebConsoleAgent.cpp:
1021         (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
1022         (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
1023         * inspector/WebConsoleAgent.h:
1024         Remove XHR monitoring code.
1025
1026         * xml/XMLHttpRequest.h:
1027         * xml/XMLHttpRequest.cpp:
1028         (WebCore::XMLHttpRequest::send):
1029         (WebCore::XMLHttpRequest::didFinishLoading):
1030         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
1031         * xml/XMLHttpRequest.idl:
1032         Remove now unused state on XHR and ExecState requirement for send().
1033
1034 2017-10-23  Keith Miller  <keith_miller@apple.com>
1035
1036         Add dom, editing, fileapi, and history to unified sources
1037         https://bugs.webkit.org/show_bug.cgi?id=178694
1038
1039         Rubber-stamped by Tim Horton.
1040
1041         * CMakeLists.txt:
1042         * Sources.txt:
1043         * WebCore.xcodeproj/project.pbxproj:
1044
1045 2017-10-23  Keith Miller  <keith_miller@apple.com>
1046
1047         Move bridge, contentextensions, crypto, and css to unified sources.
1048         https://bugs.webkit.org/show_bug.cgi?id=178691
1049
1050         Reviewed by Tim Horton.
1051
1052         * CMakeLists.txt:
1053         * Sources.txt:
1054         * WebCore.xcodeproj/project.pbxproj:
1055
1056 2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1057
1058         Unreviewed, fix the Windows build after r223860
1059
1060         UTIUtilities only exists on Cocoa platforms, so we need to guard it accordingly.
1061
1062         * platform/MIMETypeRegistry.cpp:
1063         (WebCore::initializeSupportedImageMIMETypes):
1064
1065 2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1066
1067         [iOS] DocumentWriter::createDocument can spend ~100ms unnecessarily converting image UTIs to MIME types
1068         https://bugs.webkit.org/show_bug.cgi?id=178618
1069         <rdar://problem/35108852>
1070
1071         Reviewed by Said Abou-Hallawa.
1072
1073         Currently, in setting up a new Document, DocumentWriter::createDocument() always asks whether or not the
1074         Document should be a PDF document by calling MIMETypeRegistry::isPDFMIMEType(), which forces lazy initialization
1075         of every MIME type dictionary (e.g. image types, PDF types, JavaScript types, etc.). As evidenced by traces,
1076         this can be an expensive operation on certain devices.
1077
1078         This patch implements two optimizations. First, we refactor the initializeSupportedImageMIMETypes() helper to
1079         stop asking for MIMETypeForImageSourceType for each of the supported UTIs. This is because the known MIME types
1080         corresponding to these hard-coded UTI types is a fixed set anyways, so we can simply iterate over a constant
1081         array of MIME types and populate the supported image (and image resource) types. Also, add assertions to ensure
1082         that we keep allowed image MIME types in sync with allowed image UTIs.
1083
1084         The second optimization removes initializeMIMETypeRegistry() altogether in favor of calling just the
1085         initialize*MIMETypes() functions needed to ensure the information required. For instance, getPDFMIMETypes()
1086         currently calls initializeMIMETypeRegistry() if the pdfMIMETypes dictionary doesn't exist, when it really only
1087         needs to ensure that the pdfMIMETypes is initialized, for which initializePDFMIMETypes() is sufficient.
1088
1089         * platform/MIMETypeRegistry.cpp:
1090         (WebCore::initializeSupportedImageMIMETypes):
1091         (WebCore::initializeSupportedJavaScriptMIMETypes):
1092         (WebCore::initializePDFMIMETypes):
1093         (WebCore::initializeSupportedNonImageMimeTypes):
1094         (WebCore::initializeUnsupportedTextMIMETypes):
1095
1096         Move MIME type dictionary creation into initialize*MIMETypes() helpers. Additionally, remove
1097         initializePDFAndPostScriptMIMETypes, which is no longer necessary.
1098
1099         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
1100         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
1101         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
1102         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
1103         (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
1104         (WebCore::MIMETypeRegistry::isPDFOrPostScriptMIMEType):
1105
1106         Tweak to check that the type isPDFMIMEType(), or that it's otherwise "application/postscript".
1107
1108         (WebCore::MIMETypeRegistry::isPDFMIMEType):
1109         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
1110         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
1111         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
1112         (WebCore::MIMETypeRegistry::getPDFMIMETypes):
1113         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
1114
1115         Call only the relevant MIME type initializers when needed.
1116
1117         (WebCore::initializePostScriptMIMETypes): Deleted.
1118         (WebCore::initializeMIMETypeRegistry): Deleted.
1119         (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Deleted.
1120
1121         Remove an unused and unexported function.
1122
1123         * platform/MIMETypeRegistry.h:
1124
1125 2017-10-23  Andy Estes  <aestes@apple.com>
1126
1127         [Payment Request] Take the JSC API lock before creating the PaymentResponse.details object
1128         https://bugs.webkit.org/show_bug.cgi?id=178686
1129
1130         Reviewed by Keith Miller.
1131
1132         This fixes several flaky crashes in http/tests/paymentrequest/ after r223855.
1133
1134         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1135         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
1136
1137 2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>
1138
1139         Web Inspector: Please support HAR Export for network traffic
1140         https://bugs.webkit.org/show_bug.cgi?id=146692
1141         <rdar://problem/7463672>
1142
1143         Reviewed by Brian Burg.
1144
1145         Tests: http/tests/inspector/network/har/har-basic.html
1146                http/tests/inspector/network/har/har-page.html
1147
1148         * inspector/InspectorNetworkAgent.cpp:
1149         (WebCore::InspectorNetworkAgent::willSendRequest):
1150         Include the wall time when sending a request. This is needed for HAR to
1151         include a wall time, and can be used for Cookie expiration time calculation
1152         as well.
1153
1154 2017-10-23  Andy Estes  <aestes@apple.com>
1155
1156         [Payment Request] Resolve PaymentRequest.show()'s accept promise when a payment is authorized
1157         https://bugs.webkit.org/show_bug.cgi?id=178609
1158         <rdar://problem/33542813>
1159
1160         Reviewed by Alex Christensen.
1161
1162         This patch implements the logic for resolving PaymentRequest.show()'s accept promise when
1163         the user authorizes a payment, and implements PaymentResponse.complete().
1164
1165         Tests: http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html
1166                http/tests/paymentrequest/payment-response-complete-method.https.html
1167                http/tests/paymentrequest/payment-response-methodName-attribute.https.html
1168                http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html
1169                http/tests/paymentrequest/payment-response-payerName-attribute.https.html
1170                http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html
1171
1172         * DerivedSources.make:
1173         * Modules/applepay/ApplePayPaymentContact.h:
1174         * Modules/applepay/Payment.h:
1175         (WebCore::Payment::Payment): Deleted.
1176         (WebCore::Payment::pkPayment const): Deleted.
1177         * Modules/applepay/PaymentContact.h:
1178         (WebCore::PaymentContact::PaymentContact): Deleted.
1179         (WebCore::PaymentContact::pkContact const): Deleted.
1180         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1181         (WebCore::convert):
1182         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1183         (WebCore::ApplePayPaymentHandler::hasActiveSession):
1184         (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
1185         (WebCore::ApplePayPaymentHandler::document):
1186         (WebCore::ApplePayPaymentHandler::paymentCoordinator):
1187         (WebCore::ApplePayPaymentHandler::convertData):
1188         (WebCore::ApplePayPaymentHandler::show):
1189         (WebCore::ApplePayPaymentHandler::hide):
1190         (WebCore::ApplePayPaymentHandler::canMakePayment):
1191         (WebCore::ApplePayPaymentHandler::complete):
1192         (WebCore::convert):
1193         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
1194         (WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
1195         (WebCore::ApplePayPaymentHandler::didSelectShippingContact):
1196         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1197         * Modules/paymentrequest/PaymentAddress.h:
1198         * Modules/paymentrequest/PaymentAddress.idl:
1199         * Modules/paymentrequest/PaymentHandler.cpp:
1200         (WebCore::PaymentHandler::create):
1201         * Modules/paymentrequest/PaymentHandler.h:
1202         * Modules/paymentrequest/PaymentRequest.cpp:
1203         (WebCore::PaymentRequest::show):
1204         (WebCore::PaymentRequest::stop):
1205         (WebCore::PaymentRequest::canMakePayment):
1206         (WebCore::PaymentRequest::canSuspendForDocumentSuspension const):
1207         (WebCore::PaymentRequest::shippingAddressChanged):
1208         (WebCore::PaymentRequest::shippingOptionChanged):
1209         (WebCore::PaymentRequest::accept):
1210         (WebCore::PaymentRequest::complete):
1211         * Modules/paymentrequest/PaymentRequest.h:
1212         * Modules/paymentrequest/PaymentResponse.cpp:
1213         (WebCore::PaymentResponse::PaymentResponse):
1214         (WebCore::PaymentResponse::complete):
1215         * Modules/paymentrequest/PaymentResponse.h:
1216         * WebCore.xcodeproj/project.pbxproj:
1217         * testing/Internals.cpp:
1218         (WebCore::Internals::Internals):
1219         (WebCore::Internals::mockPaymentCoordinator const):
1220         * testing/Internals.h:
1221         * testing/Internals.idl:
1222         * testing/MockPayment.h: Added.
1223         * testing/MockPaymentAddress.h: Added.
1224         * testing/MockPaymentAddress.idl: Added.
1225         * testing/MockPaymentContact.h: Added.
1226         * testing/MockPaymentCoordinator.cpp:
1227         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
1228         (WebCore::MockPaymentCoordinator::openPaymentSetup):
1229         (WebCore::dispatchIfShowing):
1230         (WebCore::MockPaymentCoordinator::showPaymentUI):
1231         (WebCore::MockPaymentCoordinator::completeMerchantValidation):
1232         (WebCore::MockPaymentCoordinator::completePaymentSession):
1233         (WebCore::MockPaymentCoordinator::abortPaymentSession):
1234         (WebCore::MockPaymentCoordinator::cancelPaymentSession):
1235         (WebCore::MockPaymentCoordinator::paymentCoordinatorDestroyed):
1236         * testing/MockPaymentCoordinator.h:
1237         * testing/MockPaymentCoordinator.idl: Added.
1238
1239 2017-10-23  Dean Jackson  <dino@apple.com>
1240
1241         Attempt to stop iOS Simulator tests from failing because
1242         we don't support Accelerated ImageBuffer.
1243
1244         * html/ImageBitmap.cpp:
1245
1246 2017-10-23  Zalan Bujtas  <zalan@apple.com>
1247
1248         [FrameView::layout cleanup] Make m_subtreeLayoutRoot weak.
1249         https://bugs.webkit.org/show_bug.cgi?id=178621
1250         <rdar://problem/35110321>
1251
1252         Reviewed by Simon Fraser.
1253
1254         This patch turn m_subtreeLayoutRoot into a weak pointer to handle both the optional and the mutation cases.
1255
1256         Covered by existing cases.
1257
1258         * page/FrameView.cpp:
1259         (WebCore::FrameView::reset):
1260         (WebCore::FrameView::willDestroyRenderTree):
1261         (WebCore::FrameView::didDestroyRenderTree):
1262         (WebCore::FrameView::calculateScrollbarModesForLayout):
1263         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
1264         (WebCore::FrameView::canPerformLayout const):
1265         (WebCore::FrameView::layout): WeakPtr<RenderElement> protects us from recursive layouts triggering UAF on layoutRoot.
1266         (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
1267         (WebCore::FrameView::scheduleRelayout):
1268         (WebCore::FrameView::scheduleRelayoutOfSubtree):
1269         (WebCore::FrameView::needsLayout const):
1270         (WebCore::FrameView::autoSizeIfEnabled):
1271         * page/FrameView.h:
1272
1273 2017-10-23  Keith Miller  <keith_miller@apple.com>
1274
1275         Unreviewed, fix windows build.
1276
1277         * CMakeLists.txt:
1278
1279 2017-10-23  Keith Miller  <keith_miller@apple.com>
1280
1281         Move shared accessibility and animiations files to unified sources.
1282         https://bugs.webkit.org/show_bug.cgi?id=178677
1283
1284         Reviewed by Tim Horton.
1285
1286         * Sources.txt:
1287         * WebCore.xcodeproj/project.pbxproj:
1288
1289 2017-10-23  Chris Dumez  <cdumez@apple.com>
1290
1291         Drop confusing Event::dispatched() method
1292         https://bugs.webkit.org/show_bug.cgi?id=178670
1293
1294         Reviewed by Youenn Fablet.
1295
1296         Drop confusing Event::dispatched() method. What the call sites want to do is check
1297         that the Event's "dispatch" flag is set:
1298         - https://dom.spec.whatwg.org/#dispatch-flag
1299
1300         This flag gets set at the beginning of dispatchEvent() and unset at the end of
1301         dispatchEvent():
1302         - https://dom.spec.whatwg.org/#ref-for-dispatch-flag③
1303
1304         See as an example event.initEvent():
1305         - https://dom.spec.whatwg.org/#dom-event-initevent
1306
1307         The right way to check the Event's "dispatch" flag is the Event::isBeingDispatched()
1308         method, so use this instead. One side effect of this change is that it is now
1309         possible to call the init*Event() method on events that have already been dispatched
1310         in order to dispatch them again, as per the specification.
1311
1312         Test: fast/events/initEvent-after-dispatching.html
1313
1314         * dom/CompositionEvent.cpp:
1315         (WebCore::CompositionEvent::initCompositionEvent):
1316         * dom/DeviceMotionEvent.cpp:
1317         (WebCore::DeviceMotionEvent::initDeviceMotionEvent):
1318         * dom/DeviceOrientationEvent.cpp:
1319         (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
1320         * dom/Event.h:
1321         * dom/HashChangeEvent.h:
1322         * dom/KeyboardEvent.cpp:
1323         (WebCore::KeyboardEvent::initKeyboardEvent):
1324         * dom/MessageEvent.cpp:
1325         (WebCore::MessageEvent::initMessageEvent):
1326         * dom/MouseEvent.cpp:
1327         (WebCore::MouseEvent::initMouseEvent):
1328         * dom/OverflowEvent.cpp:
1329         (WebCore::OverflowEvent::initOverflowEvent):
1330         * dom/TextEvent.cpp:
1331         (WebCore::TextEvent::initTextEvent):
1332         * dom/TouchEvent.cpp:
1333         (WebCore::TouchEvent::initTouchEvent):
1334         * dom/UIEvent.cpp:
1335         (WebCore::UIEvent::initUIEvent):
1336         * dom/WheelEvent.cpp:
1337         (WebCore::WheelEvent::initWheelEvent):
1338         * storage/StorageEvent.cpp:
1339         (WebCore::StorageEvent::initStorageEvent):
1340
1341 2017-10-23  Antti Koivisto  <antti@apple.com>
1342
1343         Remember previous child renderer during render tree update
1344         https://bugs.webkit.org/show_bug.cgi?id=178659
1345
1346         Reviewed by Zalan Bujtas.
1347
1348         We shouldn't need to recompute the previous renderer, we know it already.
1349
1350         * style/RenderTreePosition.cpp:
1351         (WebCore::RenderTreePosition::previousSiblingRenderer const): Deleted.
1352
1353             No longer needed. This was also subtly wrong as doesn't take display:contents into account.
1354
1355         * style/RenderTreePosition.h:
1356         * style/RenderTreeUpdater.cpp:
1357         (WebCore::RenderTreeUpdater::updateRenderTree):
1358         (WebCore::RenderTreeUpdater::textRendererIsNeeded):
1359
1360             Use the saved previous renderer.
1361
1362         (WebCore::RenderTreeUpdater::updateTextRenderer):
1363         (WebCore::RenderTreeUpdater::storePreviousRenderer):
1364
1365             Save the previous renderere as we walk the tree.
1366
1367         (WebCore::textRendererIsNeeded): Deleted.
1368         * style/RenderTreeUpdater.h:
1369
1370 2017-10-23  Keith Miller  <keith_miller@apple.com>
1371
1372         Add Shared Modules files to the unified source build.
1373         https://bugs.webkit.org/show_bug.cgi?id=178675
1374
1375         Reviewed by Tim Horton.
1376
1377         This patch all the Modules sources files shared across all ports to
1378         unified sources.
1379
1380         * CMakeLists.txt:
1381         * Sources.txt:
1382         * WebCore.xcodeproj/project.pbxproj:
1383
1384 2017-10-22  Dean Jackson  <dino@apple.com>
1385
1386         Implement drawImage(ImageBitmap) on 2d canvas
1387         https://bugs.webkit.org/show_bug.cgi?id=178653
1388         <rdar://problem/35104360>
1389
1390         Reviewed by Antoine Quint.
1391
1392         Implement CanvasRenderingContext2D::drawImage with ImageBitmap.
1393         It's probably not going to be a very common operation, but
1394         it importantly allows us to test the ImageBitmap creation
1395         code.
1396
1397         Test: http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html
1398
1399         * html/ImageBitmap.cpp:
1400         (WebCore::taintsOrigin): New helper function to determine if a
1401         CachedImage would provide a clean origin.
1402         (WebCore::ImageBitmap::createPromise): Set the flag that records
1403         if this ImageBitmap has a clean origin.
1404         * html/ImageBitmap.h:
1405         (WebCore::ImageBitmap::buffer): Exposes the ImageBuffer backing
1406         store, allowing access to the data for drawing.
1407         (WebCore::ImageBitmap::originClean const): Is this ImageBitmap
1408         going to taint a destination.
1409         * html/canvas/CanvasRenderingContext.cpp:
1410         (WebCore::CanvasRenderingContext::wouldTaintOrigin): Implement
1411         the ImageBitmap version of this template function.
1412         * html/canvas/CanvasRenderingContext.h:
1413         * html/canvas/CanvasRenderingContext2D.cpp:
1414         (WebCore::CanvasRenderingContext2D::drawImage): Implement the
1415         actual drawing of an ImageBitmap.
1416
1417 2017-10-23  Daniel Bates  <dabates@apple.com>
1418
1419         Unreviewed, rolling out r223699.
1420
1421         Caused regressions with right-to-left text selection and
1422         painting of markers in flipped writing mode and in overlapping
1423         lines. Will investigate offline.
1424
1425         Reverted changeset:
1426
1427         "Share logic in InlineTextBox to compute selection rect"
1428         https://bugs.webkit.org/show_bug.cgi?id=178232
1429         https://trac.webkit.org/changeset/223699
1430
1431 2017-10-23  Youenn Fablet  <youenn@apple.com>
1432
1433         Create a Fetch event when ServiceWorker has to handle a fetch
1434         https://bugs.webkit.org/show_bug.cgi?id=178491
1435
1436         Reviewed by Chris Dumez.
1437
1438         Covered by existing test.
1439
1440         Updating FetchEvent to pass a FetchResponse* within its onResponse callback.
1441         Making it a CompletionHandler.
1442         Fixing a check on respondWith to ensure that event is dispatched when respondWith is called.
1443
1444         Adding ServiceWorkerFetch class to handle the creation of the fetch event, waiting for the fetch event to be responded
1445         and processing when fetch event is responded.
1446         ServiceWorkerFetchTask takes a client to which will be sent the response body or the error.
1447         WebKit implementation of it will be to send the related IPC message back to the WebProcess that made the fetch request.
1448
1449         Adding a method to ServiceWorkerThread to create the fetch event on worker thread and dispatch on the global scope.
1450
1451         * WebCore.xcodeproj/project.pbxproj:
1452         * platform/network/ResourceResponseBase.h:
1453         * testing/Internals.cpp:
1454         (WebCore::Internals::waitForFetchEventToFinish):
1455         * workers/service/FetchEvent.cpp:
1456         (WebCore::FetchEvent::~FetchEvent):
1457         (WebCore::FetchEvent::respondWith):
1458         (WebCore::FetchEvent::onResponse):
1459         (WebCore::FetchEvent::respondWithError):
1460         (WebCore::FetchEvent::processResponse):
1461         (WebCore::FetchEvent::promiseIsSettled):
1462         * workers/service/FetchEvent.h:
1463         * workers/service/context/ServiceWorkerFetch.cpp: Added.
1464         (WebCore::ServiceWorkerFetch::dispatchFetchTask):
1465         (WebCore::ServiceWorkerFetch::processResponse):
1466         * workers/service/context/ServiceWorkerFetch.h: Added.
1467         * workers/service/context/ServiceWorkerThread.cpp:
1468         (WebCore::m_workerObjectProxy):
1469         (WebCore::ServiceWorkerThread::dispatchFetchEvent):
1470         * workers/service/context/ServiceWorkerThread.h:
1471
1472 2017-10-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1473
1474         [Curl] Fix authentication related bugs
1475         https://bugs.webkit.org/show_bug.cgi?id=178652
1476
1477         Reviewed by Alex Christensen.
1478
1479         * platform/network/curl/AuthenticationChallengeCurl.cpp:
1480         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
1481         * platform/network/curl/CurlContext.cpp:
1482         (WebCore::CurlHandle::setHttpAuthUserPass):
1483         * platform/network/curl/CurlRequest.cpp:
1484         (WebCore::CurlRequest::setUserPass):
1485         (WebCore::CurlRequest::setupTransfer):
1486         (WebCore::CurlRequest::didReceiveHeader):
1487         * platform/network/curl/CurlRequest.h:
1488
1489 2017-10-23  Matt Lewis  <jlewis3@apple.com>
1490
1491         Unreviewed, rolling out r223820.
1492
1493         This caused a build break on Windows.
1494
1495         Reverted changeset:
1496
1497         "Web Inspector: Remove unused Console.setMonitoringXHREnabled"
1498         https://bugs.webkit.org/show_bug.cgi?id=178617
1499         https://trac.webkit.org/changeset/223820
1500
1501 2017-10-23  Zalan Bujtas  <zalan@apple.com>
1502
1503         Call FrameView::scheduleSelectionUpdate when selection needs repainting after layout instead of setting the RenderView dirty.
1504         https://bugs.webkit.org/show_bug.cgi?id=178651
1505         <rdar://problem/35117448>
1506
1507         Reviewed by Antti Koivisto.
1508
1509         Calling setNeedsLayout() on the RenderView to trigger selection update is problematic in 2 different ways:
1510         1. marking the root renderer dirty does not trigger layout (this is very specific to the root,
1511         other renderers do trigger layout). It means that it works as long as someone else schedules a layout.
1512         2. when a subtree layout is already scheduled and we mark the root renderer dirty, the root gets stuck with
1513         the dirty flag (since the entry point for the subsequent layout is a descendant of the root and not the root itself).
1514
1515         This patch addresses these issues by scheduling/converting subtree layout when needed.  
1516
1517         Covered by fast/dynamic/remove-invisible-node-inside-selection.html/remove-node-inside-selection.html
1518
1519         * editing/FrameSelection.cpp:
1520         (WebCore::FrameSelection::respondToNodeModification):
1521         * page/FrameView.cpp:
1522         (WebCore::FrameView::scheduleSelectionUpdate):
1523         * page/FrameView.h:
1524
1525 2017-10-23  Miguel Gomez  <magomez@igalia.com>
1526
1527         [TexMap] Remove GraphicsContext3D usage from TextureMapperShaderProgram
1528         https://bugs.webkit.org/show_bug.cgi?id=175425
1529
1530         Reviewed by Žan Doberšek.
1531
1532         Remove usage of the GraphicsContext3D class in TextureMapperShaderProgram.
1533         Direct OpenGL API calls, types and constants are used instead.
1534
1535         By removing GraphicsContext3D, we don't use ANGLE anymore to perform the
1536         shader adaptation to the used OpenGL/GLES2 version, so we need to do that
1537         inside TextureMapperShaderProgram. The main changes required for this are
1538         adding the #version directive and use in/out to define input/output parameters
1539         when using OpenGL >= 3.2, and defining the default precision only when using
1540         GLES2.
1541
1542         Besides that, now that VideoTextureCopierGStreamer doesn't have its own
1543         GraphicsContext3D, we need to add a VAO to it when using OpenGL >= 3.2.
1544
1545         Based on a previous patch by Žan Doberšek <zdobersek@igalia.com>.
1546
1547         No behavior change.
1548
1549         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
1550         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
1551         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
1552         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
1553         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
1554         * platform/graphics/texmap/TextureMapperGL.cpp:
1555         (WebCore::TextureMapperGLData::getShaderProgram):
1556         (WebCore::prepareFilterProgram):
1557         (WebCore::TextureMapperGL::drawTexture):
1558         (WebCore::TextureMapperGL::drawFiltered):
1559         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
1560         (WebCore::TextureMapperShaderProgram::create):
1561         (WebCore::getShaderLog):
1562         (WebCore::getProgramLog):
1563         (WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
1564         (WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram):
1565         (WebCore::TextureMapperShaderProgram::setMatrix):
1566         (WebCore::TextureMapperShaderProgram::getLocation):
1567         * platform/graphics/texmap/TextureMapperShaderProgram.h:
1568         (WebCore::TextureMapperShaderProgram::programID const):
1569
1570 2017-10-22  Sam Weinig  <sam@webkit.org>
1571
1572         [Settings] Replace current Settings generation with template file based approach
1573         https://bugs.webkit.org/show_bug.cgi?id=178634
1574
1575         Reviewed by Joseph Pecoraro.
1576
1577         This replaces the recently added python based Settings generation with a generator
1578         built in ruby, so we can take advantage of ERB for templating. The result has much
1579         of the logic in the templates and as a result feels much easier to follow and cleaner.
1580
1581         Since I was moving things to ruby, I took the opertunity to switch the Settings definition
1582         file from our .in format to yaml, which is quite a bit easier to read.
1583
1584         * CMakeLists.txt:
1585         * DerivedSources.make:
1586         * Scripts/GenerateSettings: Removed.
1587         * Scripts/GenerateSettings.py: Removed.
1588         * Scripts/GenerateSettings.rb: Added.
1589         * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Removed.
1590         * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Removed.
1591         * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Removed.
1592         * Scripts/GenerateSettings/GenerateSettings.py: Removed.
1593         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Removed.
1594         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Removed.
1595         * Scripts/GenerateSettings/Settings.py: Removed.
1596         * Scripts/GenerateSettings/__init__.py: Removed.
1597         * Scripts/SettingsTemplates: Added.
1598         * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: Added.
1599         * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: Added.
1600         * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: Added.
1601         * Scripts/SettingsTemplates/Settings.cpp.erb: Added.
1602         * Scripts/SettingsTemplates/Settings.h.erb: Added.
1603         * WebCore.xcodeproj/project.pbxproj:
1604         * WebCoreMacros.cmake:
1605         * page/Settings.in: Removed.
1606         * page/Settings.yaml: Added.
1607
1608 2017-10-22  Joseph Pecoraro  <pecoraro@apple.com>
1609
1610         REGRESSION(r219675): Web Inspector: CommandLineAPI getEventListeners does not work
1611         https://bugs.webkit.org/show_bug.cgi?id=178650
1612         <rdar://problem/35116347>
1613
1614         Reviewed by Sam Weinig.
1615
1616         Test: inspector/console/command-line-api-getEventListeners.html
1617
1618         * inspector/CommandLineAPIHost.cpp:
1619         (WebCore::listenerEntriesFromListenerInfo):
1620         Fix typo.
1621
1622         (WebCore::CommandLineAPIHost::getEventListeners):
1623         Fix incorrect early return.
1624
1625         * inspector/CommandLineAPIHost.h:
1626         * inspector/CommandLineAPIHost.idl:
1627         Add more attributes about the listener. These new attributes match output from Chrome.
1628
1629 2017-10-22  Antoine Quint  <graouts@apple.com>
1630
1631         [Web Animations] Add animations to the timeline
1632         https://bugs.webkit.org/show_bug.cgi?id=178643
1633
1634         Reviewed by Dean Jackson.
1635
1636         If a timeline is provided as a parameter to the Animation constructor,
1637         add it to the timeline, and remove it when the object is destroyed.
1638
1639         We also start the basic mechanism to dump the contents of a timeline
1640         as text for testing purposes, currently only logging the number of
1641         animations in a timeline and just logging the class name for animation
1642         themselves.
1643
1644         Test: webanimations/animation-creation-addition.html
1645
1646         * animation/AnimationTimeline.cpp:
1647         (WebCore::AnimationTimeline::description):
1648         * animation/AnimationTimeline.h:
1649         * animation/AnimationTimeline.idl:
1650         * animation/WebAnimation.cpp:
1651         (WebCore::WebAnimation::create):
1652         (WebCore::WebAnimation::~WebAnimation):
1653         (WebCore::WebAnimation::description):
1654         * animation/WebAnimation.h:
1655         * testing/Internals.cpp:
1656         (WebCore::Internals::timelineDescription):
1657         * testing/Internals.h:
1658         * testing/Internals.idl:
1659
1660 2017-10-21  Zalan Bujtas  <zalan@apple.com>
1661
1662         [FrameView::layout cleanup] Drop allowSubtree parameter
1663         https://bugs.webkit.org/show_bug.cgi?id=178623
1664         <rdar://problem/35111012>
1665
1666         Reviewed by Sam Weinig.
1667
1668         This flag is only set through ::forceLayout(). Let's just convert the subtree layout
1669         to full layout right before calling ::layout().
1670
1671         No change in functionality.
1672
1673         * page/FrameView.cpp:
1674         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
1675         (WebCore::FrameView::layout):
1676         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
1677         (WebCore::FrameView::forceLayout):
1678         * page/FrameView.h:
1679
1680 2017-10-21  Joseph Pecoraro  <pecoraro@apple.com>
1681
1682         Web Inspector: Remove unused Console.setMonitoringXHREnabled
1683         https://bugs.webkit.org/show_bug.cgi?id=178617
1684
1685         Reviewed by Sam Weinig.
1686
1687         * inspector/InspectorInstrumentation.cpp:
1688         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
1689         * inspector/InspectorInstrumentation.h:
1690         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
1691         * inspector/WebConsoleAgent.cpp:
1692         (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
1693         (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
1694         * inspector/WebConsoleAgent.h:
1695         Remove XHR monitoring code.
1696
1697         * xml/XMLHttpRequest.h:
1698         * xml/XMLHttpRequest.cpp:
1699         (WebCore::XMLHttpRequest::send):
1700         (WebCore::XMLHttpRequest::didFinishLoading):
1701         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
1702         * xml/XMLHttpRequest.idl:
1703         Remove now unused state on XHR and ExecState requirement for send().
1704
1705 2017-10-21  Dean Jackson  <dino@apple.com>
1706
1707         createImageBitmap with basic HTMLImageElement
1708         https://bugs.webkit.org/show_bug.cgi?id=178619
1709         <rdar://problem/35104118>
1710
1711         Reviewed by Antoine Quint.
1712
1713         Implement the basic infrastructure for creating
1714         an ImageBitmap from an HTMLImageElement.
1715
1716         Test: http/wpt/2dcontext/imagebitmap/createImageBitmap.html
1717
1718         * html/ImageBitmap.cpp:
1719         (WebCore::ImageBitmap::createPromise): Create the image buffer
1720         and draw the image into its backing store.
1721         * html/ImageBitmap.h:
1722
1723 2017-10-21  Antoine Quint  <graouts@apple.com>
1724
1725         [Web Animations] Add bindings to unified sources
1726         https://bugs.webkit.org/show_bug.cgi?id=178620
1727
1728         Reviewed by Dean Jackson.
1729
1730         Removing the Web Animations bindings from the WebCore target and adding them to the unified sources list instead.
1731
1732         * Sources.txt:
1733         * WebCore.xcodeproj/project.pbxproj:
1734
1735 2017-10-21  Tim Horton  <timothy_horton@apple.com>
1736
1737         Fix the Mac CMake build
1738
1739         * PlatformMac.cmake:
1740
1741 2017-10-21  Antti Koivisto  <antti@apple.com>
1742
1743         Support ::before/::after pseudo elements with display:contents
1744         https://bugs.webkit.org/show_bug.cgi?id=178584
1745
1746         Reviewed by Ryosuke Niwa.
1747
1748         This is cases like
1749
1750         ::before { display:contents; content:'foo' }
1751
1752         * css/StyleResolver.cpp:
1753         (WebCore::StyleResolver::adjustDisplayContentsStyle): Added.
1754
1755             Allow display:contents on pseudo elements.
1756             Factor into function.
1757
1758         (WebCore::StyleResolver::adjustRenderStyle):
1759         * dom/PseudoElement.h:
1760
1761             Add a weak vector of content renderers.
1762
1763         * style/RenderTreePosition.h:
1764         (WebCore::RenderTreePosition::moveToLastChild):
1765
1766             Add a way to set a valid render tree position without a node.
1767
1768         * style/RenderTreeUpdaterGeneratedContent.cpp:
1769         (WebCore::createContentRenderers):
1770
1771             Take RenderTreePosition.
1772
1773         (WebCore::updateStyleForContentRenderers):
1774
1775             Update based on the content renderer vector instead of doing a tree walk.
1776
1777         (WebCore::removeAndDestroyContentRenderers):
1778
1779             Helper for destroying content renderers.
1780
1781         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1782
1783             In the normal case create a render tree position for the pseudo element renderer and
1784             use RenderTreePosition::moveToLastChild to make it a valid position. (The existing
1785             RenderTreePosition interface didn't have way to move to positions in anonymous boxes)
1786
1787             In the case of a non box generating display:contents pseudo element, use the current
1788             render tree position instead.
1789
1790             Ensure that pseudo element renderers are destroyed before creating the new ones since in
1791             display:contents case they are not descendants of the pseudo renderer and don't get cleared
1792             automatically.
1793
1794 2017-10-20  Zalan Bujtas  <zalan@apple.com>
1795
1796         [FrameView::layout cleanup] Use SetForScope to ensure layout state correctness
1797         https://bugs.webkit.org/show_bug.cgi?id=178604
1798         <rdar://problem/35101890>
1799
1800         Reviewed by Simon Fraser.
1801
1802         SetForScope guarantees state correctness even with nested layouts. This is a lot less
1803         error prone than resetting the state value after each potential recursive call.
1804
1805         Covered by existing tests.
1806
1807         * page/FrameView.cpp:
1808         (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): This layout state does
1809         not look too useful.
1810         (WebCore::FrameView::layout):
1811         * page/FrameView.h: While performPostLayoutTasks() is somewhat special since it can either be sync or async,
1812         so painting should be allowed in both cases.
1813
1814 2017-10-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
1815
1816         SVGPathElement should cache the built-up Path of its non animating pathByteStream()
1817         https://bugs.webkit.org/show_bug.cgi?id=178248
1818
1819         Reviewed by Simon Fraser.
1820
1821         Instead of creating a Path object from the non animating pathByteStream()
1822         every time we need to updatePathFromPathElement(), the Path object can be
1823         cached once it is created and used for later calls.
1824
1825         * html/canvas/Path2D.h: buildPathFromString() now returns a Path.
1826
1827         * platform/graphics/Path.h:
1828         * platform/graphics/cairo/PathCairo.cpp:
1829         (WebCore::Path::Path):
1830         (WebCore::Path::operator=):
1831         * platform/graphics/cg/PathCG.cpp:
1832         (WebCore::Path::Path):
1833         (WebCore::Path::operator=):
1834         * platform/graphics/win/PathDirect2D.cpp:
1835         (WebCore::Path::Path):
1836         (WebCore::Path::operator=):
1837         Define the move constructor and the move assignment operator for the the
1838         Path class so a statement like "Path path = buildPathFromString()" won't 
1839         go through the copy constructor and the copy assignment operator.
1840
1841         * rendering/style/BasicShapes.cpp:
1842         (WebCore::SVGPathTranslatedByteStream::path const):
1843         * rendering/svg/RenderSVGResourceClipper.cpp:
1844         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
1845         * rendering/svg/RenderSVGShape.cpp:
1846         (WebCore::RenderSVGShape::updateShapeFromElement):
1847         * rendering/svg/RenderSVGTextPath.cpp:
1848         (WebCore::RenderSVGTextPath::layoutPath const):
1849         * rendering/svg/SVGPathData.cpp:
1850         (WebCore::pathFromCircleElement):
1851         (WebCore::pathFromEllipseElement):
1852         (WebCore::pathFromLineElement):
1853         (WebCore::pathFromPathElement):
1854         (WebCore::pathFromPolygonElement):
1855         (WebCore::pathFromPolylineElement):
1856         (WebCore::pathFromRectElement):
1857         (WebCore::pathFromGraphicsElement):
1858         (WebCore::updatePathFromCircleElement): Deleted.
1859         (WebCore::updatePathFromEllipseElement): Deleted.
1860         (WebCore::updatePathFromLineElement): Deleted.
1861         (WebCore::updatePathFromPathElement): Deleted.
1862         (WebCore::updatePathFromPolygonElement): Deleted.
1863         (WebCore::updatePathFromPolylineElement): Deleted.
1864         (WebCore::updatePathFromRectElement): Deleted.
1865         (WebCore::updatePathFromGraphicsElement): Deleted.
1866         * rendering/svg/SVGPathData.h:
1867         * svg/SVGAnimateMotionElement.cpp:
1868         (WebCore::SVGAnimateMotionElement::parseAttribute):
1869         (WebCore::SVGAnimateMotionElement::updateAnimationPath):
1870         * svg/SVGGraphicsElement.cpp:
1871         (WebCore::SVGGraphicsElement::toClipPath):
1872         * svg/SVGGraphicsElement.h:
1873         Rename updatePathFromElement() to pathFromGraphicsElement().
1874
1875         * svg/SVGPathElement.cpp:
1876         (WebCore::SVGPathElement::parseAttribute): Clear the cache when
1877         m_pathByteStream changes.
1878         (WebCore::SVGPathElement::pathForByteStream const): Caches the m_cachedPath
1879         if it is null.
1880         (WebCore::SVGPathElement::pathSegListChanged): Clear the cache when
1881         m_pathByteStream changes.
1882
1883         * svg/SVGPathElement.h:
1884         * svg/SVGPathUtilities.cpp:
1885         (WebCore::buildPathFromString):
1886         (WebCore::buildPathFromByteStream):
1887         * svg/SVGPathUtilities.h:
1888         Make thes buildPathFromString() and buildPathFromByteStream() return Paths.
1889
1890         * svg/SVGUseElement.cpp:
1891         (WebCore::SVGUseElement::toClipPath):
1892         * svg/SVGUseElement.h:
1893         Make these toClipPath() return Path.
1894
1895 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
1896
1897         Rename insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor
1898         https://bugs.webkit.org/show_bug.cgi?id=178605
1899
1900         Reviewed by Andy Estes.
1901
1902         Renamed insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor respectively
1903         to make it clear that these functions can be called even when node's immediate parent didn't change.
1904
1905         * dom/ContainerNodeAlgorithms.cpp:
1906         (WebCore::notifyNodeInsertedIntoDocument):
1907         (WebCore::notifyNodeInsertedIntoTree):
1908         (WebCore::notifyNodeRemovedFromDocument):
1909         (WebCore::notifyNodeRemovedFromTree):
1910         (WebCore::notifyChildNodeRemoved):
1911         * dom/ContainerNodeAlgorithms.h:
1912         * dom/Element.cpp:
1913         (WebCore::Element::insertedIntoAncestor): Renamed from insertedInto.
1914         (WebCore::Element::removedFromAncestor): Renamed from removedFrom.
1915         * dom/Element.h:
1916         * dom/Node.cpp:
1917         (WebCore::Node::insertedIntoAncestor): 
1918         (WebCore::Node::removedFromAncestor):
1919         (WebCore::Node::removedFrom): Deleted.
1920         * dom/Node.h:
1921         * dom/ProcessingInstruction.cpp:
1922         (WebCore::ProcessingInstruction::insertedIntoAncestor): Renamed from insertedInto.
1923         (WebCore::ProcessingInstruction::removedFromAncestor): Renamed from removedFrom.
1924         * dom/ProcessingInstruction.h:
1925         * dom/ScriptElement.h:
1926         (WebCore::ScriptElement::insertedIntoAncestor const): Renamed from insertedInto.
1927         * dom/ShadowRoot.cpp:
1928         (WebCore::ShadowRoot::insertedIntoAncestor): Renamed from insertedInto.
1929         (WebCore::ShadowRoot::removedFromAncestor): Renamed from removedFrom.
1930         * dom/ShadowRoot.h:
1931         * html/FormAssociatedElement.cpp:
1932         (WebCore::FormAssociatedElement::insertedIntoAncestor): Renamed from insertedInto.
1933         (WebCore::FormAssociatedElement::removedFromAncestor): Renamed from removedFrom.
1934         * html/FormAssociatedElement.h:
1935         * html/HTMLBaseElement.cpp:
1936         (WebCore::HTMLBaseElement::insertedIntoAncestor): Renamed from insertedInto.
1937         (WebCore::HTMLBaseElement::removedFromAncestor): Renamed from removedFrom.
1938         * html/HTMLBaseElement.h:
1939         * html/HTMLBodyElement.cpp:
1940         (WebCore::HTMLBodyElement::insertedIntoAncestor): Renamed from insertedInto.
1941         * html/HTMLBodyElement.h:
1942         * html/HTMLFormControlElement.cpp:
1943         (WebCore::HTMLFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
1944         (WebCore::HTMLFormControlElement::removedFromAncestor): Renamed from removedFrom.
1945         * html/HTMLFormControlElement.h:
1946         * html/HTMLFormControlElementWithState.cpp:
1947         (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Renamed from insertedInto.
1948         (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Renamed from removedFrom.
1949         * html/HTMLFormControlElementWithState.h:
1950         * html/HTMLFormElement.cpp:
1951         (WebCore::HTMLFormElement::insertedIntoAncestor): Renamed from insertedInto.
1952         (WebCore::HTMLFormElement::removedFromAncestor): Renamed from removedFrom.
1953         * html/HTMLFormElement.h:
1954         * html/HTMLFrameElementBase.cpp:
1955         (WebCore::HTMLFrameElementBase::insertedIntoAncestor): Renamed from insertedInto.
1956         * html/HTMLFrameElementBase.h:
1957         * html/HTMLFrameSetElement.cpp:
1958         (WebCore::HTMLFrameSetElement::insertedIntoAncestor): Renamed from insertedInto.
1959         (WebCore::HTMLFrameSetElement::removedFromAncestor): Renamed from removedFrom.
1960         * html/HTMLFrameSetElement.h:
1961         * html/HTMLImageElement.cpp:
1962         (WebCore::HTMLImageElement::insertedIntoAncestor): Renamed from insertedInto.
1963         (WebCore::HTMLImageElement::removedFromAncestor): Renamed from removedFrom.
1964         * html/HTMLImageElement.h:
1965         * html/HTMLInputElement.cpp:
1966         (WebCore::HTMLInputElement::insertedIntoAncestor): Renamed from insertedInto.
1967         (WebCore::HTMLInputElement::removedFromAncestor): Renamed from removedFrom.
1968         * html/HTMLInputElement.h:
1969         * html/HTMLLinkElement.cpp:
1970         (WebCore::HTMLLinkElement::insertedIntoAncestor): Renamed from insertedInto.
1971         (WebCore::HTMLLinkElement::removedFromAncestor): Renamed from removedFrom.
1972         * html/HTMLLinkElement.h:
1973         * html/HTMLMapElement.cpp:
1974         (WebCore::HTMLMapElement::insertedIntoAncestor): Renamed from insertedInto.
1975         (WebCore::HTMLMapElement::removedFromAncestor): Renamed from removedFrom.
1976         * html/HTMLMapElement.h:
1977         * html/HTMLMediaElement.cpp:
1978         (WebCore::HTMLMediaElement::insertedIntoAncestor): Renamed from insertedInto.
1979         (WebCore::HTMLMediaElement::removedFromAncestor): Renamed from removedFrom.
1980         * html/HTMLMediaElement.h:
1981         * html/HTMLMetaElement.cpp:
1982         (WebCore::HTMLMetaElement::insertedIntoAncestor): Renamed from insertedInto.
1983         * html/HTMLMetaElement.h:
1984         * html/HTMLObjectElement.cpp:
1985         (WebCore::HTMLObjectElement::insertedIntoAncestor): Renamed from insertedInto.
1986         (WebCore::HTMLObjectElement::removedFromAncestor): Renamed from removedFrom.
1987         * html/HTMLObjectElement.h:
1988         * html/HTMLOptionElement.cpp:
1989         (WebCore::HTMLOptionElement::insertedIntoAncestor): Renamed from insertedInto.
1990         * html/HTMLOptionElement.h:
1991         * html/HTMLScriptElement.cpp:
1992         (WebCore::HTMLScriptElement::insertedIntoAncestor): Renamed from insertedInto.
1993         * html/HTMLScriptElement.h:
1994         * html/HTMLSelectElement.cpp:
1995         (WebCore::HTMLSelectElement::insertedIntoAncestor): Renamed from insertedInto.
1996         * html/HTMLSelectElement.h:
1997         * html/HTMLSlotElement.cpp:
1998         (WebCore::HTMLSlotElement::insertedIntoAncestor): Renamed from insertedInto.
1999         (WebCore::HTMLSlotElement::removedFromAncestor): Renamed from removedFrom.
2000         * html/HTMLSlotElement.h:
2001         * html/HTMLSourceElement.cpp:
2002         (WebCore::HTMLSourceElement::insertedIntoAncestor): Renamed from insertedInto.
2003         (WebCore::HTMLSourceElement::removedFromAncestor): Renamed from removedFrom.
2004         * html/HTMLSourceElement.h:
2005         * html/HTMLStyleElement.cpp:
2006         (WebCore::HTMLStyleElement::insertedIntoAncestor): Renamed from insertedInto.
2007         (WebCore::HTMLStyleElement::removedFromAncestor): Renamed from removedFrom.
2008         * html/HTMLStyleElement.h:
2009         * html/HTMLTextFormControlElement.cpp:
2010         (WebCore::HTMLTextFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
2011         * html/HTMLTextFormControlElement.h:
2012         * html/HTMLTitleElement.cpp:
2013         (WebCore::HTMLTitleElement::insertedIntoAncestor): Renamed from insertedInto.
2014         (WebCore::HTMLTitleElement::removedFromAncestor): Renamed from removedFrom.
2015         * html/HTMLTitleElement.h:
2016         * html/HTMLTrackElement.cpp:
2017         (WebCore::HTMLTrackElement::insertedIntoAncestor): Renamed from insertedInto.
2018         (WebCore::HTMLTrackElement::removedFromAncestor): Renamed from removedFrom.
2019         * html/HTMLTrackElement.h:
2020         * svg/SVGElement.cpp:
2021         (WebCore::SVGElement::removedFromAncestor): Renamed from removedFrom.
2022         (WebCore::SVGElement::insertedIntoAncestor): Renamed from insertedInto.
2023         (WebCore::SVGElement::updateRelativeLengthsInformation):
2024         * svg/SVGElement.h:
2025         * svg/SVGFEImageElement.cpp:
2026         (WebCore::SVGFEImageElement::insertedIntoAncestor): Renamed from insertedInto.
2027         (WebCore::SVGFEImageElement::removedFromAncestor): Renamed from removedFrom.
2028         * svg/SVGFEImageElement.h:
2029         * svg/SVGFontFaceElement.cpp:
2030         (WebCore::SVGFontFaceElement::insertedIntoAncestor): Renamed from insertedInto.
2031         (WebCore::SVGFontFaceElement::removedFromAncestor): Renamed from removedFrom.
2032         * svg/SVGFontFaceElement.h:
2033         * svg/SVGFontFaceUriElement.cpp:
2034         (WebCore::SVGFontFaceUriElement::insertedIntoAncestor): Renamed from insertedInto.
2035         * svg/SVGFontFaceUriElement.h:
2036         * svg/SVGImageElement.cpp:
2037         (WebCore::SVGImageElement::insertedIntoAncestor): Renamed from insertedInto.
2038         * svg/SVGImageElement.h:
2039         * svg/SVGMPathElement.cpp:
2040         (WebCore::SVGMPathElement::insertedIntoAncestor): Renamed from insertedInto.
2041         (WebCore::SVGMPathElement::removedFromAncestor): Renamed from removedFrom.
2042         * svg/SVGMPathElement.h:
2043         * svg/SVGPathElement.cpp:
2044         (WebCore::SVGPathElement::insertedIntoAncestor): Renamed from insertedInto.
2045         (WebCore::SVGPathElement::removedFromAncestor): Renamed from removedFrom.
2046         * svg/SVGPathElement.h:
2047         * svg/SVGSVGElement.cpp:
2048         (WebCore::SVGSVGElement::insertedIntoAncestor): Renamed from insertedInto.
2049         (WebCore::SVGSVGElement::removedFromAncestor): Renamed from removedFrom.
2050         * svg/SVGSVGElement.h:
2051         * svg/SVGScriptElement.cpp:
2052         (WebCore::SVGScriptElement::insertedIntoAncestor): Renamed from insertedInto.
2053         * svg/SVGScriptElement.h:
2054         * svg/SVGStyleElement.cpp:
2055         (WebCore::SVGStyleElement::insertedIntoAncestor): Renamed from insertedInto.
2056         (WebCore::SVGStyleElement::removedFromAncestor): Renamed from removedFrom.
2057         * svg/SVGStyleElement.h:
2058         * svg/SVGTRefElement.cpp:
2059         (WebCore::SVGTRefElement::buildPendingResource):
2060         (WebCore::SVGTRefElement::insertedIntoAncestor): Renamed from insertedInto.
2061         (WebCore::SVGTRefElement::removedFromAncestor): Renamed from removedFrom.
2062         * svg/SVGTRefElement.h:
2063         * svg/SVGTextPathElement.cpp:
2064         (WebCore::SVGTextPathElement::insertedIntoAncestor): Renamed from insertedInto.
2065         (WebCore::SVGTextPathElement::removedFromAncestor): Renamed from removedFrom.
2066         * svg/SVGTextPathElement.h:
2067         * svg/SVGTitleElement.cpp:
2068         (WebCore::SVGTitleElement::insertedIntoAncestor): Renamed from insertedInto.
2069         (WebCore::SVGTitleElement::removedFromAncestor): Renamed from removedFrom.
2070         * svg/SVGTitleElement.h:
2071         * svg/SVGUseElement.cpp:
2072         (WebCore::SVGUseElement::insertedIntoAncestor): Renamed from insertedInto.
2073         (WebCore::SVGUseElement::removedFromAncestor): Renamed from removedFrom.
2074         * svg/SVGUseElement.h:
2075         * svg/animation/SVGSMILElement.cpp:
2076         (WebCore::SVGSMILElement::insertedIntoAncestor): Renamed from insertedInto.
2077         (WebCore::SVGSMILElement::removedFromAncestor): Renamed from removedFrom.
2078         * svg/animation/SVGSMILElement.h:
2079
2080 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
2081
2082         Fix conditions in HTMLSourceElement and HTMLTrackElement's insertedInto and removedFrom
2083         https://bugs.webkit.org/show_bug.cgi?id=178607
2084
2085         Reviewed by Eric Carlson.
2086
2087         Fixed the conditions in insertedInto and removedFrom of HTMLSourceElement and HTMLTrackElement to be
2088         semantically sensisble. Since these elements are only functional when their immediate parents are
2089         HTMLMediaElement and HTMLPictureElement, we have to check that its immediate parent changed, not when
2090         some of its ancestor had changed by insertion or removal.
2091
2092         * html/HTMLSourceElement.cpp:
2093         (WebCore::HTMLSourceElement::insertedInto):
2094         (WebCore::HTMLSourceElement::removedFrom):
2095         * html/HTMLTrackElement.cpp:
2096         (WebCore::HTMLTrackElement::insertedInto):
2097         (WebCore::HTMLTrackElement::removedFrom):
2098
2099 2017-10-20  Keith Miller  <keith_miller@apple.com>
2100
2101         Unreviewed, fix windows build.
2102
2103         * Sources.txt:
2104         * WebCore.xcodeproj/project.pbxproj:
2105
2106 2017-10-20  Daniel Bates  <dabates@apple.com>
2107
2108         Use "= default" for more default constructors and destructors in WebCore
2109         https://bugs.webkit.org/show_bug.cgi?id=178585
2110
2111         Reviewed by Alex Christensen.
2112
2113         Also remove some destructors that would be implicitly generated.
2114
2115         * Modules/applepay/PaymentMerchantSession.h:
2116         (WebCore::PaymentMerchantSession::~PaymentMerchantSession): Deleted.
2117         * platform/ControlStates.h:
2118         (WebCore::ControlStates::~ControlStates): Deleted.
2119         * platform/PlatformEvent.h:
2120         (WebCore::PlatformEvent::~PlatformEvent): Use default.
2121         * platform/PlatformStrategies.h:
2122         (WebCore::PlatformStrategies::PlatformStrategies): Ditto.
2123         * platform/image-decoders/gif/GIFImageReader.h:
2124         (GIFFrameContext::GIFFrameContext):
2125         (GIFFrameContext::~GIFFrameContext): Deleted.
2126         (GIFImageReader::~GIFImageReader): Deleted.
2127         * rendering/RenderBlockFlow.h:
2128         (WebCore::RenderBlockFlow::RenderBlockFlowRareData::~RenderBlockFlowRareData): Deleted.
2129
2130 2017-10-20  Zalan Bujtas  <zalan@apple.com>
2131
2132         [FrameView::layout cleanup] Scheduling layout should be disabled for FrameView::layout
2133         https://bugs.webkit.org/show_bug.cgi?id=178562
2134         <rdar://problem/35089015>
2135
2136         Reviewed by Simon Fraser.
2137
2138         This patch extends the scope of m_layoutSchedulingEnabled. Now layout scheduling is disabled for the entire FrameView::layout(). 
2139         A scheduled layout at the end of FrameView::layout would indicated dirty tree (which is against FrameView::layout's contract).
2140
2141         Covered by existing tests.
2142
2143         * page/FrameView.cpp:
2144         (WebCore::FrameView::layout):
2145
2146 2017-10-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2147
2148         When destroying a resource, register "only" the clients who are losing their resource as having pending resources
2149         https://bugs.webkit.org/show_bug.cgi?id=178567
2150         <rdar://problem/35064781>
2151
2152         Reviewed by Simon Fraser.
2153
2154         SVGResources::resourceDestroyed() will return a bool indicating whether 
2155         it had a reference to the destroyed resource or not. If it returns true
2156         SVGResourcesCache::resourceDestroyed() will register the client Element
2157         as having pending resources.
2158
2159         * rendering/svg/SVGResources.cpp:
2160         (WebCore::paintingResourceFromSVGPaint):
2161         (WebCore::SVGResources::removeClientFromCache const):
2162         (WebCore::SVGResources::resourceDestroyed):
2163         (WebCore::SVGResources::buildSetOfResources):
2164         (WebCore::SVGResources::resetClipper):
2165         (WebCore::SVGResources::resetFilter):
2166         (WebCore::SVGResources::resetMarkerStart):
2167         (WebCore::SVGResources::resetMarkerMid):
2168         (WebCore::SVGResources::resetMarkerEnd):
2169         (WebCore::SVGResources::resetMasker):
2170         (WebCore::SVGResources::resetFill):
2171         (WebCore::SVGResources::resetStroke):
2172         (WebCore::SVGResources::resetLinkedResource):
2173         * rendering/svg/SVGResources.h:
2174         (WebCore::SVGResources::isEmpty const):
2175         (WebCore::SVGResources::ClipperFilterMaskerData::ClipperFilterMaskerData): Deleted.
2176         (WebCore::SVGResources::MarkerData::MarkerData): Deleted.
2177         (WebCore::SVGResources::FillStrokeData::FillStrokeData): Deleted.
2178         * rendering/svg/SVGResourcesCache.cpp:
2179         (WebCore::SVGResourcesCache::resourceDestroyed):
2180
2181 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
2182
2183         Unify the node removal code in ContainerNode and expand the coverage of NoEventDispatchAssertion
2184         https://bugs.webkit.org/show_bug.cgi?id=178568
2185
2186         Reviewed by Antti Koivisto.
2187
2188         Consolidated the code to remove a child node in ContainerNode into removeAllChildrenWithScriptAssertion
2189         and removeNodeWithScriptAssertion to share code and make the semantics of when it becomes unsafe to run scripts.
2190
2191         Also renamed getChildNodes to collectChildNodes, and made it return NodeVector instead of taking an out argument.
2192
2193         No new tests since there should be no behavioral changes.
2194
2195         * dom/ContainerNode.cpp:
2196         (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Added.
2197         (WebCore::ContainerNode::removeNodeWithScriptAssertion): Added.
2198         (WebCore::collectChildrenAndRemoveFromOldParent):
2199         (WebCore::ContainerNode::takeAllChildrenFrom): Deployed removeAllChildrenWithScriptAssertion.
2200         (WebCore::ContainerNode::notifyChildRemoved): Deleted. Merged into removeNodeWithScriptAssertion.
2201         (WebCore::willRemoveChild): Deleted. Ditto.
2202         (WebCore::willRemoveChildren): Deleted. Merged into removeAllChildrenWithScriptAssertion.
2203         (WebCore::ContainerNode::removeChild): Deployed removeNodeWithScriptAssertion.
2204         (WebCore::ContainerNode::parserRemoveChild): Ditto.
2205         (WebCore::ContainerNode::replaceAllChildren): Deployed removeAllChildrenWithScriptAssertion. Now removes the node
2206         outside executeNodeInsertionWithScriptAssertion but that's okay since executeNodeInsertionWithScriptAssertion
2207         doesn't execute any code with a side effect before invoking the callback.
2208         (WebCore::ContainerNode::removeChildren):
2209         (WebCore::dispatchChildRemovalEvents): Refactored to take Ref<Node>&.
2210         * dom/ContainerNode.h:
2211         (WebCore::collectChildNodes): Renamed from getChildNodes. Also removed the useless comment about NodeVector's
2212         initial size and instead prefer to webkit.org/b/80706 where the number 11 was picked.
2213         * editing/ApplyStyleCommand.cpp:
2214         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
2215         * editing/ReplaceNodeWithSpanCommand.cpp:
2216         (WebCore::swapInNodePreservingAttributesAndChildren):
2217         * svg/SVGUseElement.cpp:
2218         (WebCore::SVGUseElement::clearShadowTree): Added an assertion exception while tearing down the UA shadow tree.
2219
2220 2017-10-20  Youenn Fablet  <youenn@apple.com>
2221
2222         ResourceResponse should have a ServiceWorker source
2223         https://bugs.webkit.org/show_bug.cgi?id=178593
2224
2225         Reviewed by Alex Christensen.
2226
2227         Covered by updated tests.
2228
2229         Added ResourceResponse::Source::ServiceWorker.
2230         Added internals to get FetchResponse source.
2231
2232         * inspector/InspectorNetworkAgent.cpp:
2233         (WebCore::responseSource):
2234         * loader/ResourceLoader.cpp:
2235         (WebCore::logResourceResponseSource):
2236         * page/DiagnosticLoggingKeys.cpp:
2237         (WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
2238         * page/DiagnosticLoggingKeys.h:
2239         * platform/network/ResourceResponseBase.h:
2240         * testing/Internals.cpp:
2241         (WebCore::responseSourceToString):
2242         (WebCore::Internals::fetchResponseSource):
2243         * testing/Internals.h:
2244         * testing/Internals.idl:
2245
2246 2017-10-20  Andy Estes  <aestes@apple.com>
2247
2248         Generated serializers do not properly handle optional interface attributes
2249         https://bugs.webkit.org/show_bug.cgi?id=178542
2250
2251         Reviewed by Sam Weinig.
2252
2253         * bindings/scripts/CodeGeneratorJS.pm:
2254         (GenerateSerializerDefinition):
2255         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2256         (WebCore::JSTestSerialization::serialize):
2257
2258 2017-10-20  Antoine Quint  <graouts@apple.com>
2259
2260         [Web Animations] Provide basic timeline and animation interfaces
2261         https://bugs.webkit.org/show_bug.cgi?id=178526
2262
2263         Reviewed by Dean Jackson.
2264
2265         We're getting Web Animations work started by implementing a very minimal codebase which provides
2266         a DocumentTimeline class which has an instance created for each Document. The parent class,
2267         AnimationTimeline, allows for animations to be added and removed, and animations can be created
2268         using the Animation class, with an optional timeline as parameter.
2269
2270         Tests: webanimations/animation-creation-basic.html
2271                webanimations/document-timeline.html
2272
2273         * CMakeLists.txt:
2274         * Configurations/FeatureDefines.xcconfig:
2275         * DerivedSources.make:
2276         * PlatformWin.cmake:
2277         * WebCore.xcodeproj/project.pbxproj:
2278         * animation/AnimationTimeline.cpp: Added.
2279         (WebCore::AnimationTimeline::AnimationTimeline):
2280         (WebCore::AnimationTimeline::~AnimationTimeline):
2281         (WebCore::AnimationTimeline::addAnimation):
2282         (WebCore::AnimationTimeline::removeAnimation):
2283         * animation/AnimationTimeline.h: Added.
2284         (WebCore::AnimationTimeline::isDocumentTimeline const):
2285         (WebCore::AnimationTimeline::classType const):
2286         * animation/AnimationTimeline.idl: Added.
2287         * animation/DocumentTimeline.cpp: Added.
2288         (WebCore::DocumentTimeline::create):
2289         (WebCore::DocumentTimeline::DocumentTimeline):
2290         * animation/DocumentTimeline.h: Added.
2291         * animation/DocumentTimeline.idl: Added.
2292         * animation/WebAnimation.cpp: Added.
2293         (WebCore::WebAnimation::create):
2294         (WebCore::WebAnimation::WebAnimation):
2295         (WebCore::WebAnimation::~WebAnimation):
2296         * animation/WebAnimation.h: Added.
2297         * animation/WebAnimation.idl: Added.
2298         * bindings/js/JSAnimationTimelineCustom.cpp: Added.
2299         (WebCore::toJSNewlyCreated):
2300         (WebCore::toJS):
2301         * bindings/js/WebCoreBuiltinNames.h:
2302         * dom/Document.cpp:
2303         (WebCore::Document::timeline):
2304         * dom/Document.h:
2305         * dom/Document.idl:
2306         * page/RuntimeEnabledFeatures.h:
2307         (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled const):
2308
2309 2017-10-20  Commit Queue  <commit-queue@webkit.org>
2310
2311         Unreviewed, rolling out r223744, r223750, and r223751.
2312         https://bugs.webkit.org/show_bug.cgi?id=178594
2313
2314         These caused consistent failures in test that existed and were
2315         added in the patches. (Requested by mlewis13 on #webkit).
2316
2317         Reverted changesets:
2318
2319         "[JSC] ScriptFetcher should be notified directly from module
2320         pipeline"
2321         https://bugs.webkit.org/show_bug.cgi?id=178340
2322         https://trac.webkit.org/changeset/223744
2323
2324         "Unreviewed, fix changed line number in test expect files"
2325         https://bugs.webkit.org/show_bug.cgi?id=178340
2326         https://trac.webkit.org/changeset/223750
2327
2328         "Unreviewed, follow up to reflect comments"
2329         https://bugs.webkit.org/show_bug.cgi?id=178340
2330         https://trac.webkit.org/changeset/223751
2331
2332 2017-10-20  Zalan Bujtas  <zalan@apple.com>
2333
2334         [FrameView::layout cleanup] Move can-enter-layout logic to a separate function
2335         https://bugs.webkit.org/show_bug.cgi?id=178546
2336         <rdar://problem/35083894>
2337
2338         Reviewed by Antti Koivisto.
2339
2340         No change in functionality.
2341
2342         * page/FrameView.cpp:
2343         (WebCore::FrameView::canPerformLayout const):
2344         (WebCore::FrameView::layout): We already assert on certain reentrancy conditions, loggig the reason
2345         does not seem to have high value.
2346         * page/FrameView.h:
2347
2348 2017-10-20  Dean Jackson  <dino@apple.com>
2349
2350         Add createImageBitmap to Window and Worker
2351         https://bugs.webkit.org/show_bug.cgi?id=178573
2352         <rdar://problem/35092692>
2353
2354         Reviewed by Sam Weinig.
2355
2356         Implement the createImageBitmap functions that are exposed on the Window
2357         and Worker objects.
2358
2359         Covered by the Web Platform Tests.
2360
2361         * html/ImageBitmap.cpp: Make sure to call suspendIfNeeded since this is
2362         an ActiveDOMObject.
2363         * html/ImageBitmap.h: Change the order of the classes in the Variant
2364         to match the order of definitions in the IDL.
2365         * page/DOMWindow.cpp:
2366         (WebCore::DOMWindow::createImageBitmap): Call ImageBitmap::createPromise.
2367         * page/DOMWindow.h:
2368         * page/WindowOrWorkerGlobalScope.idl: Add the createImageBitmap methods.
2369         * workers/WorkerGlobalScope.cpp:
2370         (WebCore::WorkerGlobalScope::createImageBitmap): Call ImageBitmap::createPromise.
2371         * workers/WorkerGlobalScope.h:
2372
2373 2017-10-20  Joanmarie Diggs  <jdiggs@igalia.com>
2374
2375         AX: [ATK] Events missing and state incorrect for aria-activedescendant
2376         https://bugs.webkit.org/show_bug.cgi?id=178523
2377
2378         Reviewed by Chris Fleizach.
2379
2380         When the aria-activedescendant of an element changes, emit object:state-changed:focused.
2381         When a focused element has a valid active descendant, do not expose the focused state on
2382         the element, but rather on the active descendant. Also expose the focusable state on the
2383         active descendant.
2384
2385         Tests: accessibility/gtk/aria-activedescendant-changed-notification.html
2386                accessibility/gtk/aria-activedescendant.html
2387
2388         * accessibility/AccessibilityObject.cpp:
2389         (WebCore::AccessibilityObject::isActiveDescendantOfFocusedContainer const):
2390         (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
2391         * accessibility/AccessibilityObject.h:
2392         * accessibility/AccessibilityRenderObject.cpp:
2393         (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
2394         * accessibility/atk/AXObjectCacheAtk.cpp:
2395         (WebCore::AXObjectCache::postPlatformNotification):
2396         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2397         (setAtkStateSetFromCoreObject):
2398
2399 2017-10-20  Ms2ger  <Ms2ger@igalia.com>
2400
2401         Add the MAX_CLIENT_WAIT_TIMEOUT_WEBGL constant to WebGL2RenderingContext.
2402         https://bugs.webkit.org/show_bug.cgi?id=178572
2403
2404         Reviewed by Žan Doberšek.
2405
2406         Test: fast/canvas/webgl/webgl2/constants.html
2407
2408         * html/canvas/WebGL2RenderingContext.idl:
2409
2410 2017-10-20  Miguel Gomez  <magomez@igalia.com>
2411
2412         [GTK][WPE] Fix review comments on WEBPImageDecoder
2413         https://bugs.webkit.org/show_bug.cgi?id=178080
2414
2415         Reviewed by Said Abou-Hallawa.
2416
2417         Properly free the demuxer in case of error, improve the code to detect the first
2418         required frame to decode, fix the usage of the DecodingStatus and some styling
2419         changes.
2420
2421         Covered by existent tests.
2422
2423         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2424         (WebCore::webpFrameAtIndex):
2425         (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
2426         (WebCore::WEBPImageDecoder::decode):
2427         (WebCore::WEBPImageDecoder::decodeFrame):
2428         (WebCore::WEBPImageDecoder::initFrameBuffer):
2429         (WebCore::WEBPImageDecoder::clearFrameBufferCache):
2430
2431 2017-10-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2432
2433         [Curl] Clean up old style code in old curl files.
2434         https://bugs.webkit.org/show_bug.cgi?id=178569
2435
2436         Reviewed by Ryosuke Niwa.
2437
2438         * platform/network/curl/AuthenticationChallenge.h:
2439         * platform/network/curl/CertificateInfo.h:
2440         * platform/network/curl/CookieJarCurl.h:
2441         * platform/network/curl/CurlCacheEntry.h:
2442         * platform/network/curl/CurlCacheManager.cpp:
2443         (WebCore::CurlCacheManager::singleton):
2444         (WebCore::CurlCacheManager::getInstance): Deleted.
2445         * platform/network/curl/CurlCacheManager.h:
2446         * platform/network/curl/CurlContext.cpp:
2447         (WebCore::CurlContext::singleton):
2448         * platform/network/curl/CurlContext.h:
2449         (WebCore::CurlContext::singleton): Deleted.
2450         * platform/network/curl/CurlJobManager.cpp:
2451         (WebCore::CurlJobManager::singleton):
2452         * platform/network/curl/CurlJobManager.h:
2453         (WebCore::CurlJobManager::singleton): Deleted.
2454         * platform/network/curl/CurlRequest.cpp:
2455         (WebCore::CurlRequest::setupTransfer):
2456         * platform/network/curl/CurlRequest.h:
2457         * platform/network/curl/CurlRequestDelegate.h:
2458         * platform/network/curl/CurlResponse.h:
2459         (WebCore::CurlResponse::isolatedCopy const):
2460         * platform/network/curl/CurlSSLHandle.h:
2461         * platform/network/curl/CurlSSLVerifier.h:
2462         * platform/network/curl/DownloadBundle.h:
2463         * platform/network/curl/MultipartHandle.h:
2464         * platform/network/curl/ResourceError.h:
2465         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2466         (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
2467         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
2468         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
2469         (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
2470         (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
2471         * platform/network/curl/ResourceRequest.h:
2472         (WebCore::ResourceRequest::ResourceRequest):
2473         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
2474         (WebCore::ResourceRequest::cfURLRequest const):
2475         (WebCore::ResourceRequest::httpPipeliningEnabled):
2476         (WebCore::ResourceRequest::setHTTPPipeliningEnabled):
2477         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2478         (WebCore::ResourceRequest::doUpdateResourceRequest):
2479         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2480         (WebCore::ResourceRequest::doUpdateResourceHTTPBody):
2481         (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
2482         * platform/network/curl/ResourceResponseCurl.cpp:
2483         (WebCore::ResourceResponse::isAppendableHeader):
2484         (WebCore::ResourceResponse::ResourceResponse):
2485
2486 2017-10-20  Frederic Wang  <fwang@igalia.com>
2487
2488         RenderLayerCompositor: Move implementation of simple methods into the header file.
2489         https://bugs.webkit.org/show_bug.cgi?id=178514
2490
2491         Reviewed by Darin Adler.
2492
2493         No new tests, behavior unchanged.
2494
2495 2017-10-19  Antti Koivisto  <antti@apple.com>
2496
2497         Support ::before/::after pseudo elements on elements with display:contents
2498         https://bugs.webkit.org/show_bug.cgi?id=178513
2499
2500         Reviewed by Ryosuke Niwa.
2501
2502         Add support for
2503
2504             div { display:contents }
2505             div::after { content:'foo' }
2506
2507         That is support non-box generating elements with generated content.
2508
2509         * style/RenderTreePosition.cpp:
2510         (WebCore::RenderTreePosition::nextSiblingRenderer const):
2511
2512             Implement full pseudo-inclusive traversal starting from any element (including pseudo)
2513             to locate the next rendering sibling. In case of display:content this may need to look
2514             into descendants.
2515
2516         * style/RenderTreeUpdater.cpp:
2517         (WebCore::textRendererIsNeeded):
2518
2519             RenderTreePosition::nextSiblingRenderer can no longer be called with a node that already has a renderer.
2520             Maintain the existing behavior.
2521
2522         * style/RenderTreeUpdaterGeneratedContent.cpp:
2523         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
2524         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
2525
2526             Don't require for host to have a renderer.
2527
2528         * style/RenderTreeUpdaterGeneratedContent.h:
2529         * style/StyleTreeResolver.cpp:
2530         (WebCore::Style::TreeResolver::resolvePseudoStyle):
2531
2532 2017-10-20  Keith Miller  <keith_miller@apple.com>
2533
2534         Move common bindings files to unified sources
2535         https://bugs.webkit.org/show_bug.cgi?id=178561
2536
2537         Rubber-stamped by Ryosuke Niwa.
2538
2539         This patch moves most of the common bindings files to unified sources.
2540
2541         Additionally, it adds a change to make_names to unique a struct
2542         name that caused name conflicts that I missed when I made the
2543         source changes before.
2544
2545         Lastly, add missing reference to WebCoreJSBuiltins.cpp in CMake build.
2546
2547         No new behavior no tests.
2548
2549         * CMakeLists.txt:
2550         * Sources.txt:
2551         * WebCore.xcodeproj/project.pbxproj:
2552         * dom/make_names.pl:
2553         (printFactoryCppFile):
2554
2555 2017-10-20  Saam Barati  <sbarati@apple.com>
2556
2557         Optimize accesses to how we get the direct prototype
2558         https://bugs.webkit.org/show_bug.cgi?id=178548
2559
2560         Reviewed by Yusuke Suzuki.
2561
2562         No new tests: no functionality change.
2563
2564         * bindings/js/JSDOMAbstractOperations.h:
2565         (WebCore::isVisibleNamedProperty):
2566         (WebCore::accessVisibleNamedProperty):
2567         * bindings/js/JSDOMWindowBase.cpp:
2568         (WebCore::toJSDOMWindow):
2569         * bindings/js/JSDOMWindowProperties.cpp:
2570         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
2571         * bindings/js/JSPluginElementFunctions.cpp:
2572         (WebCore::pluginElementCustomGetOwnPropertySlot):
2573         * bindings/js/WorkerScriptController.cpp:
2574         (WebCore::WorkerScriptController::initScript):
2575         * bindings/scripts/CodeGeneratorJS.pm:
2576         (GeneratePut):
2577         (GeneratePutByIndex):
2578         (GenerateConstructorHelperMethods):
2579         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2580         (WebCore::JSTestGlobalObjectConstructor::initializeProperties):
2581         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2582         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put):
2583         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex):
2584         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2585         (WebCore::JSTestNamedAndIndexedSetterThrowingException::put):
2586         (WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex):
2587         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2588         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put):
2589         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex):
2590         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2591         (WebCore::JSTestNamedSetterNoIdentifier::put):
2592         (WebCore::JSTestNamedSetterNoIdentifier::putByIndex):
2593         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2594         (WebCore::JSTestNamedSetterThrowingException::put):
2595         (WebCore::JSTestNamedSetterThrowingException::putByIndex):
2596         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2597         (WebCore::JSTestNamedSetterWithIdentifier::put):
2598         (WebCore::JSTestNamedSetterWithIdentifier::putByIndex):
2599         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2600         (WebCore::JSTestNamedSetterWithIndexedGetter::put):
2601         (WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex):
2602         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2603         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put):
2604         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex):
2605         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2606         (WebCore::JSTestNamedSetterWithUnforgableProperties::put):
2607         (WebCore::JSTestNamedSetterWithUnforgableProperties::putByIndex):
2608
2609 2017-10-20  Yusuke Suzuki  <utatane.tea@gmail.com>
2610
2611         [JSC] ScriptFetcher should be notified directly from module pipeline
2612         https://bugs.webkit.org/show_bug.cgi?id=178340
2613
2614         Reviewed by Sam Weinig.
2615
2616         No behavior change.
2617
2618         * bindings/js/JSMainThreadExecState.h:
2619         (WebCore::JSMainThreadExecState::loadModule):
2620         * bindings/js/ScriptController.cpp:
2621         (WebCore::ScriptController::loadModuleScriptInWorld):
2622         (WebCore::jsValueToModuleKey): Deleted.
2623         (WebCore::ScriptController::setupModuleScriptHandlers): Deleted.
2624         * bindings/js/ScriptController.h:
2625         * dom/LoadableModuleScript.cpp:
2626         (WebCore::LoadableModuleScript::notifyLoadFailed):
2627         * dom/LoadableModuleScript.h:
2628
2629 2017-10-19  Ms2ger  <Ms2ger@igalia.com>
2630
2631         Remove proprietary constants from WebGL2RenderingContext.
2632         https://bugs.webkit.org/show_bug.cgi?id=178511
2633
2634         Reviewed by Ryosuke Niwa.
2635
2636         As far as I can tell, these constants are not in the specification,
2637         and no other browser supports them.
2638
2639         No new tests: just code removal.
2640
2641         * html/canvas/WebGL2RenderingContext.idl:
2642
2643 2017-10-19  Zalan Bujtas  <zalan@apple.com>
2644
2645         [FrameView::layout cleanup] Move style update related logic to a separate function
2646         https://bugs.webkit.org/show_bug.cgi?id=178558
2647         <rdar://problem/35088218>
2648
2649         Reviewed by Simon Fraser.
2650
2651         No change in functionality.
2652
2653         * page/FrameView.cpp:
2654         (WebCore::FrameView::ensureStyleIsUpToDateForLayout):
2655         (WebCore::FrameView::layout):
2656         * page/FrameView.h:
2657
2658 2017-10-19  JF Bastien  <jfbastien@apple.com>
2659
2660         WebAssembly: no VM / JS version of everything but Instance
2661         https://bugs.webkit.org/show_bug.cgi?id=177473
2662
2663         Reviewed by Filip Pizlo, Saam Barati.
2664
2665         * ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
2666         included in JSWebAssemblyModule.h.
2667         * bindings/js/SerializedScriptValue.cpp: Update postMessage code
2668         according to C++ API changes.
2669
2670 2017-10-19  Chris Dumez  <cdumez@apple.com>
2671
2672         SerializedScriptValue passed to postMessage() cannot be null
2673         https://bugs.webkit.org/show_bug.cgi?id=178550
2674
2675         Reviewed by Youenn Fablet.
2676
2677         SerializedScriptValue passed to postMessage() cannot be null. Therefore, we
2678         should use Ref<> type, not RefPtr<>.
2679
2680         * dom/MessagePortChannel.h:
2681         * dom/default/PlatformMessagePortChannel.cpp:
2682         (WebCore::MessagePortChannel::postMessageToRemote):
2683         * workers/WorkerGlobalScopeProxy.h:
2684         * workers/WorkerMessagingProxy.cpp:
2685         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
2686         (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
2687         * workers/WorkerMessagingProxy.h:
2688         * workers/WorkerObjectProxy.h:
2689         * workers/service/context/ServiceWorkerThread.cpp:
2690
2691 2017-10-19  Daniel Bates  <dabates@apple.com>
2692
2693         Use "= default" to denote default constructor or destructor
2694         https://bugs.webkit.org/show_bug.cgi?id=178528
2695
2696         Rubber-stamped by Andy Estes.
2697
2698         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
2699         * Modules/applepay/ApplePayError.cpp:
2700         * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
2701         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
2702         * Modules/applepay/ApplePaySession.cpp:
2703         * Modules/applepay/ApplePaySessionPaymentRequest.cpp:
2704         * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
2705         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
2706         * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
2707         * Modules/applepay/Payment.h:
2708         * Modules/applepay/PaymentCoordinatorClient.h:
2709         * Modules/credentials/BasicCredential.cpp:
2710         * Modules/credentials/FederatedCredential.cpp:
2711         * Modules/credentials/NavigatorCredentials.cpp:
2712         * Modules/credentials/PasswordCredential.cpp:
2713         * Modules/encryptedmedia/CDMClient.h:
2714         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
2715         * Modules/encryptedmedia/legacy/LegacyCDM.h:
2716         * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
2717         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
2718         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
2719         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
2720         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
2721         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
2722         * Modules/entriesapi/DOMFileSystem.cpp:
2723         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
2724         * Modules/entriesapi/FileSystemEntry.cpp:
2725         * Modules/fetch/FetchLoaderClient.h:
2726         * Modules/gamepad/Gamepad.cpp:
2727         * Modules/gamepad/GamepadEvent.h:
2728         * Modules/gamepad/deprecated/Gamepad.cpp:
2729         [ truncated ]
2730
2731 2017-10-19  Sam Weinig  <sam@webkit.org>
2732
2733         [Bindings] Standardize on DOMPromise as the way to store passed in promises
2734         https://bugs.webkit.org/show_bug.cgi?id=178533
2735
2736         Reviewed by Youenn Fablet.
2737
2738         This standardizes on RefPtr<DOMPromise> as the canonical way to store a promise
2739         that has been passed in from JS. This does not change promises that start off in
2740         WebCore and are passed to JS; they remain using DOMPromiseDeferred and DOMPromiseProxy.
2741
2742         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
2743         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
2744         * dom/PromiseRejectionEvent.cpp:
2745         * dom/PromiseRejectionEvent.h:
2746         * dom/RejectedPromiseTracker.cpp:
2747
2748             Use a RefPtr<DOMPromise> rather than a JSPromise* to hold onto the promise.
2749
2750         * bindings/IDLTypes.h:
2751
2752             Use IDLWrapper to get better defaults, since DOMPromise is refcounted.
2753
2754         * bindings/js/JSDOMConvertPromise.h:
2755         (WebCore::Converter<IDLPromise<T>>::convert):
2756
2757             Switch default conversion to return a RefPtr<DOMPromise> rather than a JSPromise*
2758
2759         (WebCore::JSConverter<IDLPromise<T>>::convert):
2760
2761             Add support for converting from a DOMPromise to a JSValue.
2762
2763         * bindings/js/JSDOMPromise.cpp:
2764         * bindings/js/JSDOMPromise.h:
2765         (WebCore::DOMPromise::create): Deleted.
2766
2767             Remove now unused constructor.    
2768
2769         * workers/service/ExtendableEvent.cpp:
2770         (WebCore::ExtendableEvent::waitUntil):
2771         * workers/service/ExtendableEvent.h:
2772         * workers/service/ExtendableEvent.idl:
2773         * workers/service/FetchEvent.cpp:
2774         (WebCore::FetchEvent::respondWith):
2775         (WebCore::FetchEvent::promiseIsSettled):
2776         * workers/service/FetchEvent.h:
2777         * workers/service/FetchEvent.idl:
2778
2779             Address FIXMEs and remove need for passing an ExecState to ExtendableEvent
2780             and FetchEvent by using the new default conversion to DOMPromise.
2781
2782 2017-10-19  Sam Weinig  <sam@webkit.org>
2783
2784         [Settings] Move global settings into their own file
2785         https://bugs.webkit.org/show_bug.cgi?id=178512
2786
2787         Reviewed by Darin Adler.
2788
2789         Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
2790         It's called DeprecatedGlobalSettings to indicate that this is an anti-pattern we would
2791         like to discourage, as WebCore can operate in a process with multiple clients, each of
2792         which should be able to set their own preferences.
2793
2794         * WebCore.xcodeproj/project.pbxproj:
2795         * CMakeLists.txt:
2796
2797             Add new files.
2798         
2799         * page/DeprecatedGlobalSettings.cpp: Copied from Source/WebCore/page/SettingsBase.cpp.
2800         * page/DeprecatedGlobalSettings.h: Copied from Source/WebCore/page/SettingsBase.h.
2801         * page/SettingsBase.cpp:
2802         * page/SettingsBase.h:
2803         
2804             Move all global settings out of SettingsBase and into the new DeprecatedGlobalSettings.
2805         
2806         * Modules/mediastream/UserMediaRequest.cpp:
2807         * bindings/js/CommonVM.cpp:
2808         * css/CSSStyleDeclaration.cpp:
2809         * dom/DataTransfer.cpp:
2810         * dom/DataTransferItemList.cpp:
2811         * editing/Editor.cpp:
2812         * loader/ResourceLoadObserver.cpp:
2813         * page/FrameView.cpp:
2814         * page/PerformanceMonitor.cpp:
2815         * platform/ScrollbarTheme.cpp:
2816         (WebCore::ScrollbarTheme::theme):
2817         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
2818         * platform/graphics/MediaPlayer.cpp:
2819         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2820         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2821         * platform/mac/NSScrollerImpDetails.mm:
2822         * platform/mock/ScrollbarThemeMock.cpp:
2823         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2824         * platform/network/ios/NetworkStateNotifierIOS.mm:
2825         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2826         * platform/win/MainThreadSharedTimerWin.cpp:
2827         * rendering/RenderLayer.cpp:
2828         * rendering/RenderListBox.cpp:
2829         * testing/InternalSettings.cpp:
2830         * testing/Internals.cpp:
2831
2832             Update users of global settings to reference the new class name.
2833
2834 2017-10-19  Youenn Fablet  <youenn@apple.com>
2835
2836         Add preliminary support for ServiceWorker Handle Fetch
2837         https://bugs.webkit.org/show_bug.cgi?id=178475
2838         <rdar://problem/35066424>
2839
2840         Reviewed by Chris Dumez.
2841
2842         Test: http/tests/workers/service/basic-fetch.https.html
2843
2844         Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
2845         A script context is now storing its selected service worker identifier. This should be fully implemented later on.
2846         This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
2847         Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.
2848
2849         * WebCore.xcodeproj/project.pbxproj:
2850         * dom/ScriptExecutionContext.h:
2851         (WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
2852         (WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
2853         * loader/DocumentThreadableLoader.cpp:
2854         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2855         * loader/FetchOptions.h:
2856         (WebCore::isPotentialNavigationOrSubresourceRequest):
2857         (WebCore::isNonSubresourceRequest):
2858         * loader/ResourceLoaderOptions.h:
2859         * loader/WorkerThreadableLoader.cpp:
2860         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
2861         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2862         * loader/WorkerThreadableLoader.h:
2863         * platform/network/ResourceRequestBase.h:
2864         * platform/network/ResourceResponseBase.h:
2865         * workers/WorkerThread.h:
2866         * workers/service/ServiceWorkerContainer.cpp:
2867         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2868         * workers/service/context/SWContextManager.cpp: Removed.
2869         * workers/service/context/ServiceWorkerThread.h:
2870
2871 2017-10-19  Zalan Bujtas  <zalan@apple.com>
2872
2873         [FrameView::layout cleanup] Move post layout task scheduling logic to a separate function
2874         https://bugs.webkit.org/show_bug.cgi?id=178538
2875         <rdar://problem/35080743>
2876
2877         Reviewed by Simon Fraser.
2878
2879         Move and reorganize post layout task scheduling code.
2880         
2881         Covered by existing tests.
2882
2883         * page/FrameView.cpp:
2884         (WebCore::FrameView::layout):
2885         (WebCore::FrameView::runOrSchedulePostLayoutTasks):
2886         * page/FrameView.h:
2887
2888 2017-10-19  Zalan Bujtas  <zalan@apple.com>
2889
2890         [FrameView::layout cleanup] Move scrollbars setup logic to a separate function
2891         https://bugs.webkit.org/show_bug.cgi?id=178394
2892         <rdar://problem/35031066>
2893
2894         Reviewed by Antti Koivisto.
2895
2896         Decouple scrollbars setup and the unrelated first-layout logic.
2897         FIXME: find out why m_firstLayout depends on the subtree flag (I'd assume we issue full layout the very first time). 
2898
2899         Covered by existing test cases.
2900
2901         * page/FrameView.cpp:
2902         (WebCore::FrameView::adjustScrollbarsForLayout):
2903         (WebCore::FrameView::layout):
2904         * page/FrameView.h:
2905
2906 2017-10-19  Tim Horton  <timothy_horton@apple.com>
2907
2908         Expand r209943 to suppress paste during provisional navigation as well
2909         https://bugs.webkit.org/show_bug.cgi?id=178429
2910         <rdar://problem/33952830>
2911
2912         Reviewed by Dean Jackson.
2913
2914         No new tests; adjusted an existing test to cover this case.
2915
2916         * editing/Editor.cpp:
2917         (WebCore::Editor::canPaste const):
2918         Disable pasting during provisional navigation, like r209943 did for
2919         various other forms of text input.
2920
2921         (WebCore::Editor::shouldInsertText const):
2922         * dom/EventDispatcher.cpp:
2923         (WebCore::shouldSuppressEventDispatchInDOM):
2924         * loader/FrameLoader.cpp:
2925         (WebCore::FrameLoader::shouldSuppressTextInputFromEditing const):
2926         (WebCore::FrameLoader::shouldSuppressKeyboardInput const): Deleted.
2927         * loader/FrameLoader.h:
2928         * page/Settings.in:
2929         Rename the setting to be about editing-related text input, not "keyboard" input.
2930
2931         * editing/EditorCommand.cpp:
2932         (WebCore::allowExecutionWhenDisabled):
2933         (WebCore::doNotAllowExecutionWhenDisabled):
2934         (WebCore::allowExecutionWhenDisabledCopyCut):
2935         (WebCore::allowExecutionWhenDisabledPaste):
2936         (WebCore::createCommandMap):
2937         (WebCore::Editor::Command::allowExecutionWhenDisabled const):
2938         Completely disable execution of paste events when in no-text-input-from-editing mode.
2939         Otherwise, even though canPaste was false and we wouldn't do a default paste action,
2940         we would still dispatch the paste event to the DOM.
2941
2942 2017-10-19  Dean Jackson  <dino@apple.com>
2943
2944         Avoid duplicate multisample resolve before WebGL compositing
2945         https://bugs.webkit.org/show_bug.cgi?id=178537
2946         <rdar://problem/35080724>
2947
2948         Fix iOS build.
2949
2950         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2951         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2952
2953 2017-10-19  Dean Jackson  <dino@apple.com>
2954
2955         Avoid duplicate multisample resolve before WebGL compositing
2956         https://bugs.webkit.org/show_bug.cgi?id=178537
2957         <rdar://problem/35080724>
2958
2959         Reviewed by Jer Noble.
2960
2961         Both endPaint and prepareTexture were doing the MSAA resolve
2962         into the renderbuffer, and being called on macOS before compositing.
2963         Without that step, endPaint became unnecessary on iOS so I renamed
2964         it presentRenderbuffer.
2965
2966         Covered by existing tests.
2967
2968         * platform/graphics/GraphicsContext3D.h:
2969         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2970         (WebCore::GraphicsContext3D::presentRenderbuffer):
2971         (WebCore::GraphicsContext3D::endPaint): Deleted.
2972         * platform/graphics/cocoa/WebGLLayer.mm:
2973         (-[WebGLLayer display]):
2974
2975 2017-10-19  Andy Estes  <aestes@apple.com>
2976
2977         [Payment Request] Only process shipping options if shipping is requested, and throw an exception on duplicate shipping option IDs
2978         https://bugs.webkit.org/show_bug.cgi?id=178535
2979
2980         Reviewed by Alex Christensen.
2981
2982         Progresses four tests in web-platform-tests/payment-request/payment-request-constructor.https.html.
2983
2984         * Modules/paymentrequest/PaymentRequest.cpp:
2985         (WebCore::PaymentRequest::create):
2986
2987 2017-10-19  Daniel Bates  <dabates@apple.com>
2988
2989         Share logic in InlineTextBox to compute selection rect
2990         https://bugs.webkit.org/show_bug.cgi?id=178232
2991         <rdar://problem/34963452>
2992
2993         Reviewed by Zalan Bujtas.
2994
2995         Currently each paint routine in InlineTextBox duplicates similar code to compute the selection
2996         rect it will paint. This change consolidates all the duplication into localSelectionRectWithClampedPositions()
2997         and writes all of the paint operations, except for paintCompositionUnderline(), in terms of it.
2998         We will write paintCompositionUnderline() in terms of localSelectionRectWithClampedPositions()
2999         in a subsequent patch.
3000
3001         We also write localSelectionRect() in terms of localSelectionRectWithClampedPositions(). Ideally
3002         we would have one way to compute the selection rect. However, localSelectionRect() and paintDocumentMarker()
3003         currently expect the enclosing integral rectangle of the selection rectangle. The function
3004         paintDocumentMarker() needs the enclosing integral rectangle to avoid truncating the dot pattern
3005         drawn under marked words (e.g. a spelling error) on Cocoa platforms. With regards to localSelectionRect()
3006         we should look to have it return the actual selection rectangle. See <https://bugs.webkit.org/show_bug.cgi?id=138913>
3007         for more details.
3008
3009         * rendering/InlineTextBox.cpp:
3010         (WebCore::InlineTextBox::localSelectionRect const): Move logic in common with paintSelection() into
3011         localSelectionRectWithClampedPositions() and modified code to use it.
3012         (WebCore::InlineTextBox::localSelectionRectWithClampedPositions const): Added.
3013         (WebCore::InlineTextBox::paint): Store the local paint offset as a LayoutPoint as it is the canonical
3014         data type for representing an offset when painting. Pass the local paint offset instead of the analagous boxOrigin value.
3015         (WebCore::InlineTextBox::paintSelection): Write in terms of localSelectionRectWithClampedPositions().
3016         (WebCore::InlineTextBox::paintTextSubrangeBackground): Ditto.
3017         (WebCore::InlineTextBox::paintCompositionBackground): Ditto.
3018         (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
3019         (WebCore::InlineTextBox::paintDocumentMarker): Ditto.
3020         (WebCore::InlineTextBox::paintDocumentMarkers): Pass paint offset instead of the analogous boxOrigin value.
3021         * rendering/InlineTextBox.h:
3022
3023 2017-10-19  Daniel Bates  <dabates@apple.com>
3024
3025         Referrer policy should be inherited from creator
3026         https://bugs.webkit.org/show_bug.cgi?id=178403
3027         <rdar://problem/31546136>
3028
3029         Reviewed by Andy Estes.
3030
3031         As per section Browsing contexts of the the HTML standard, <https://html.spec.whatwg.org/multipage/browsers.html>
3032         (17 October 2017), the referrer policy of a document should initially be inherited from its
3033         creator.
3034
3035         Tests: http/tests/security/referrer-policy-nested-subframe.html
3036                http/tests/security/referrer-policy-nested-window-open.html
3037                http/tests/security/referrer-policy-subframe-window-open.html
3038                http/tests/security/referrer-policy-window-open-subframe.html
3039
3040         * dom/Document.cpp:
3041         (WebCore::Document::initSecurityContext): Ask the loader for the effective referrer policy.
3042         * loader/FrameLoader.cpp:
3043         (WebCore::FrameLoader::effectiveReferrerPolicy const): Added. Returns the referrer policy
3044         of the creator document. The creator document is document of the parent frame or the document
3045         of the opener for a subframe or child window, respectively. If we do not have a creator frame
3046         then we return the default referrer policy, non-referrer-when-downgrade, by <https://www.w3.org/TR/2017/CR-referrer-policy-20170126/#referrer-policy-empty-string>.
3047         * loader/FrameLoader.h:
3048
3049 2017-10-19  Zalan Bujtas  <zalan@apple.com>
3050
3051         [FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks
3052         https://bugs.webkit.org/show_bug.cgi?id=178518
3053         <rdar://problem/35075409>
3054
3055         Reviewed by Antti Koivisto.
3056
3057         This patch tightens existing reentrancy policy on performPostLayoutTasks.
3058
3059         Covered by existing test cases.
3060
3061         * page/FrameView.cpp:
3062         (WebCore::FrameView::FrameView):
3063         (WebCore::FrameView::reset):
3064         (WebCore::FrameView::layout):
3065         (WebCore::FrameView::performPostLayoutTasks):
3066         * page/FrameView.h:
3067
3068 2017-10-19  Chris Dumez  <cdumez@apple.com>
3069
3070         Unreviewed, revert r223650 as it caused crashes on the bots.
3071
3072         * WebCore.xcodeproj/project.pbxproj:
3073         * dom/ScriptExecutionContext.h:
3074         * loader/DocumentThreadableLoader.cpp:
3075         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
3076         * loader/FetchOptions.h:
3077         * loader/ResourceLoaderOptions.h:
3078         * loader/WorkerThreadableLoader.cpp:
3079         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
3080         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
3081         * loader/WorkerThreadableLoader.h:
3082         * platform/network/ResourceRequestBase.h:
3083         * platform/network/ResourceResponseBase.h:
3084         * workers/WorkerThread.h:
3085         * workers/service/ServiceWorkerContainer.cpp:
3086         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3087         * workers/service/context/SWContextManager.cpp: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
3088         (WebCore::SWContextManager::singleton):
3089         (WebCore::SWContextManager::SWContextManager):
3090         (WebCore::SWContextManager::startServiceWorkerContext):
3091         * workers/service/context/SWContextManager.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
3092         * workers/service/context/ServiceWorkerThread.h:
3093
3094 2017-10-19  Zalan Bujtas  <zalan@apple.com>
3095
3096         [FrameView::layout cleanup] Replace m_nestedLayoutCount with isLayoutNested()
3097         https://bugs.webkit.org/show_bug.cgi?id=178503
3098         <rdar://problem/35066561>
3099
3100         Reviewed by Antti Koivisto.
3101
3102         Covered by existing tests.
3103
3104         * page/FrameView.cpp:
3105         (WebCore::FrameView::reset):
3106         (WebCore::FrameView::layout):
3107         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
3108         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
3109         (WebCore::FrameView::updateEmbeddedObjects):
3110         (WebCore::FrameView::flushPostLayoutTasksQueue):
3111         (WebCore::FrameView::performPostLayoutTasks):
3112         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
3113         * page/FrameView.h:
3114
3115 2017-10-19  Antti Koivisto  <antti@apple.com>
3116
3117         Overlapping text on all CSS fonts specs
3118         https://bugs.webkit.org/show_bug.cgi?id=177585
3119         <rdar://problem/34704078>
3120
3121         Reviewed by Daniel Bates.
3122
3123         We were resetting StyleResolver::overrideDocumentElementStyle too early when resolving slot elements.
3124         This resulted in 'rem' units being miscomputed.
3125
3126         Reduction by Zalan.
3127
3128         Test: fast/html/details-line-height-overlap.html
3129
3130         * style/StyleTreeResolver.cpp:
3131         (WebCore::Style::TreeResolver::Scope::Scope):
3132         (WebCore::Style::TreeResolver::Scope::~Scope):
3133
3134             Only reset overrideDocumentElementStyle when destroying the scope.
3135
3136         (WebCore::Style::TreeResolver::pushScope):
3137         (WebCore::Style::TreeResolver::pushEnclosingScope):
3138         (WebCore::Style::TreeResolver::popScope):
3139
3140             A scope can show up multiple times in scope stack.
3141
3142         * style/StyleTreeResolver.h:
3143
3144 2017-10-19  Ryosuke Niwa  <rniwa@webkit.org>
3145
3146         Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
3147         https://bugs.webkit.org/show_bug.cgi?id=178504
3148
3149         Reviewed by Antti Koivisto.
3150
3151         Consolidated calls to notifyChildNodeInserted, childrenChanged, didFinishInsertingNode, and
3152         dispatchChildInsertionEvents for inserting a node by executeNodeInsertionWithScriptAssertion,
3153         a new templatefunction which takes a closure to do the node insertion to make exactly when
3154         the script becomes runnable clear.
3155
3156         Added an exception to SVGTRefElement::updateReferencedText since this code mutates user agent
3157         shadow root during insertedInto, and turned ChildChangeSource into an enum class.
3158
3159         * dom/CharacterData.cpp:
3160         (WebCore::CharacterData::parserAppendData):
3161         (WebCore::CharacterData::setDataAndUpdate):
3162         * dom/ContainerNode.cpp:
3163         (WebCore::executeNodeInsertionWithScriptAssertion): Extracted.
3164         (WebCore::ContainerNode::takeAllChildrenFrom): Deployed executeNodeInsertionWithScriptAssertion.
3165         (WebCore::ContainerNode::insertBefore): Ditto.
3166         (WebCore::ContainerNode::changeForChildInsertion): Deleted.
3167         (WebCore::ContainerNode::notifyChildInserted): Deleted.
3168         (WebCore::ContainerNode::parserInsertBefore): Deployed executeNodeInsertionWithScriptAssertion. 
3169         (WebCore::ContainerNode::replaceChild): Ditto.
3170         (WebCore::ContainerNode::removeChild):
3171         (WebCore::ContainerNode::parserRemoveChild):
3172         (WebCore::ContainerNode::replaceAllChildren): Ditto.
3173         (WebCore::ContainerNode::removeChildren):
3174         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
3175         (WebCore::ContainerNode::parserAppendChild): Ditto.
3176         (WebCore::ContainerNode::childrenChanged):
3177         (WebCore::ContainerNode::updateTreeAfterInsertion): Deleted.
3178         * dom/ContainerNode.h:
3179         * dom/Element.cpp:
3180         (WebCore::Element::childrenChanged):
3181         * html/HTMLOutputElement.cpp:
3182         (WebCore::HTMLOutputElement::childrenChanged):
3183         * svg/SVGClipPathElement.cpp:
3184         (WebCore::SVGClipPathElement::childrenChanged):
3185         * svg/SVGElement.cpp:
3186         (WebCore::SVGElement::childrenChanged):
3187         * svg/SVGFELightElement.cpp:
3188         (WebCore::SVGFELightElement::childrenChanged):
3189         * svg/SVGFilterElement.cpp:
3190         (WebCore::SVGFilterElement::childrenChanged):
3191         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
3192         (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
3193         * svg/SVGGradientElement.cpp:
3194         (WebCore::SVGGradientElement::childrenChanged):
3195         * svg/SVGMarkerElement.cpp:
3196         (WebCore::SVGMarkerElement::childrenChanged):
3197         * svg/SVGMaskElement.cpp:
3198         (WebCore::SVGMaskElement::childrenChanged):
3199         * svg/SVGPatternElement.cpp:
3200         (WebCore::SVGPatternElement::childrenChanged):
3201         * svg/SVGTRefElement.cpp:
3202         (WebCore::SVGTRefElement::updateReferencedText): Allow DOM mutations inside the user agent shadow tree here.
3203
3204 2017-10-19  Ryosuke Niwa  <rniwa@webkit.org>
3205
3206         Add an argument indicating the type of removal to Node::removedFrom
3207         https://bugs.webkit.org/show_bug.cgi?id=178505
3208
3209         Reviewed by Antti Koivisto.
3210
3211         Like r223628, added RemovalType as the first argument to Node::removedFrom, which contains two booleans indicating
3212         whether the node just become disconnected from a document, and whether node's tree scope had changed or not.
3213
3214         These boolean flags simplifies the logic in removedFrom implementations, and are required to have a better
3215         guarantee about the correctness of node flags during calls to removedFrom. Right now, Node::isConnected() and
3216         Node::isInShadowTree() are both outdated until Node::removedFrom is called.
3217
3218         Also renamed the second argument of removedFrom to parentOfRemovedTree to make the semantics clear.
3219
3220         Note that in some implementations of removedFrom, we check whether isConnected() was true to decide whether
3221         the node had already been disconnected from a document prior to calls to this particular call of removedFrom.
3222         This extra check is no longer necessary since no node will be removed from a document without first being inserted
3223         completely somewhere after r223458.
3224
3225         No new tests since there should be no behavioral changes.
3226
3227         * dom/ContainerNodeAlgorithms.cpp:
3228         (WebCore::notifyNodeInsertedIntoDocument): Replaced RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
3229         (WebCore::notifyNodeRemovedFromDocument): Replaced the check that the node had not been re-connected by scripts
3230         by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
3231         Also moved the code to call setCSSTarget to Element::removedFrom. This random call to setCSSTarget predates r114351,
3232         as well as r40475. It was originally introduced by r29311 into Node::removedFromDocument() ten years ago.
3233         (WebCore::notifyNodeRemovedFromTree): Moved NoEventDispatchAssertion to notifyChildNodeRemoved.
3234         (WebCore::notifyChildNodeRemoved): Added NoEventDispatchAssertion.
3235         * dom/ContainerNodeAlgorithms.h:
3236         * dom/Element.cpp:
3237         (WebCore::Element::removedFrom): Replaced the complicated code to detect when this element is removed from a document
3238         and its tree scope had changed by removalType.disconnectedFromDocument and removalType.treeScopeChanged.
3239         * dom/Element.h:
3240         * dom/Node.cpp:
3241         (WebCore::Node::removedFrom):
3242         * dom/Node.h: Replaced a long block of comments above insertedInto by two lines of concise comments now that
3243         the semantics of insertedInto and didFinishInsertingNode are more clear, and enforced by assertions.
3244         (WebCore::Node::RemovalType::RemovalType): Addedl
3245         * dom/ProcessingInstruction.cpp:
3246         (WebCore::ProcessingInstruction::removedFrom):
3247         * dom/ProcessingInstruction.h:
3248         * dom/ShadowRoot.cpp:
3249         (WebCore::ShadowRoot::removedFrom): The extra !isConnected() check is no longer needed. See the description above.
3250         * dom/ShadowRoot.h:
3251         * html/FormAssociatedElement.cpp:
3252         (WebCore::FormAssociatedElement::removedFrom):
3253         * html/FormAssociatedElement.h:
3254         * html/HTMLBaseElement.cpp:
3255         (WebCore::HTMLBaseElement::removedFrom):
3256         * html/HTMLBaseElement.h:
3257         * html/HTMLFormControlElement.cpp:
3258         (WebCore::HTMLFormControlElement::removedFrom):
3259         * html/HTMLFormControlElement.h:
3260         * html/HTMLFormControlElementWithState.cpp:
3261         (WebCore::HTMLFormControlElementWithState::removedFrom):
3262         * html/HTMLFormControlElementWithState.h:
3263         * html/HTMLFormElement.cpp:
3264         (WebCore::HTMLFormElement::removedFrom):
3265         * html/HTMLFormElement.h:
3266         * html/HTMLFrameSetElement.cpp:
3267         (WebCore::HTMLFrameSetElement::removedFrom):
3268         * html/HTMLFrameSetElement.h:
3269         * html/HTMLImageElement.cpp:
3270         (WebCore::HTMLImageElement::removedFrom):
3271         * html/HTMLImageElement.h:
3272         * html/HTMLInputElement.cpp:
3273         (WebCore::HTMLInputElement::removedFrom):
3274         * html/HTMLInputElement.h:
3275         * html/HTMLLinkElement.cpp:
3276         (WebCore::HTMLLinkElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
3277         * html/HTMLLinkElement.h:
3278         * html/HTMLMapElement.cpp:
3279         (WebCore::HTMLMapElement::removedFrom):
3280         * html/HTMLMapElement.h:
3281         * html/HTMLMediaElement.cpp:
3282         (WebCore::HTMLMediaElement::removedFrom):
3283         * html/HTMLMediaElement.h:
3284         * html/HTMLObjectElement.cpp:
3285         (WebCore::HTMLObjectElement::removedFrom):
3286         * html/HTMLObjectElement.h:
3287         * html/HTMLSlotElement.cpp:
3288         (WebCore::HTMLSlotElement::removedFrom): Simplifies the logic to detect when this slot element is being
3289         removed from a shadow tree using removalType.treeScopeChanged.
3290         * html/HTMLSlotElement.h:
3291         * html/HTMLSourceElement.cpp:
3292         (WebCore::HTMLSourceElement::insertedInto): Added a FIXME for an obvious bug.
3293         (WebCore::HTMLSourceElement::removedFrom): Ditto.
3294         * html/HTMLSourceElement.h:
3295         * html/HTMLStyleElement.cpp:
3296         (WebCore::HTMLStyleElement::removedFrom):
3297         * html/HTMLStyleElement.h:
3298         * html/HTMLTitleElement.cpp:
3299         (WebCore::HTMLTitleElement::removedFrom):
3300         * html/HTMLTitleElement.h:
3301         * html/HTMLTrackElement.cpp:
3302         (WebCore::HTMLTrackElement::removedFrom): Ditto.
3303         * html/HTMLTrackElement.h:
3304         * svg/SVGElement.cpp:
3305         (WebCore::SVGElement::removedFrom): Replaced isConnected() check before calling Node::removedFrom by the check of
3306         removalType.disconnectedFromDocument.
3307         * svg/SVGElement.h:
3308         * svg/SVGFEImageElement.cpp:
3309         (WebCore::SVGFEImageElement::removedFrom):
3310         * svg/SVGFEImageElement.h:
3311         * svg/SVGFontFaceElement.cpp:
3312         (WebCore::SVGFontFaceElement::removedFrom):
3313         * svg/SVGFontFaceElement.h:
3314         * svg/SVGMPathElement.cpp:
3315         (WebCore::SVGMPathElement::removedFrom):
3316         * svg/SVGMPathElement.h:
3317         * svg/SVGPathElement.cpp:
3318         (WebCore::SVGPathElement::removedFrom):
3319         * svg/SVGPathElement.h:
3320         * svg/SVGSVGElement.cpp:
3321         (WebCore::SVGSVGElement::removedFrom):
3322         * svg/SVGSVGElement.h:
3323         * svg/SVGStyleElement.cpp:
3324         (WebCore::SVGStyleElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
3325         * svg/SVGStyleElement.h:
3326         * svg/SVGTRefElement.cpp:
3327         (WebCore::SVGTRefElement::removedFrom):
3328         * svg/SVGTRefElement.h:
3329         * svg/SVGTextPathElement.cpp:
3330         (WebCore::SVGTextPathElement::removedFrom):
3331         * svg/SVGTextPathElement.h:
3332         * svg/SVGTitleElement.cpp:
3333         (WebCore::SVGTitleElement::removedFrom):
3334         * svg/SVGTitleElement.h:
3335         * svg/SVGUseElement.cpp:
3336         (WebCore::SVGUseElement::removedFrom):
3337         * svg/SVGUseElement.h:
3338         * svg/animation/SVGSMILElement.cpp:
3339         (WebCore::SVGSMILElement::removedFrom):
3340         * svg/animation/SVGSMILElement.h:
3341
3342 2017-10-19  Ms2ger  <Ms2ger@igalia.com>
3343
3344         Update the signatures of compressedTexSubImage3D.
3345         https://bugs.webkit.org/show_bug.cgi?id=178507
3346
3347         Reviewed by Ryosuke Niwa.
3348
3349         No new tests: not much point in adding tests now; this method doesn't
3350         do anything anyway.
3351
3352         * html/canvas/WebGL2RenderingContext.cpp:
3353         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
3354         * html/canvas/WebGL2RenderingContext.h:
3355         * html/canvas/WebGL2RenderingContext.idl:
3356
3357 2017-10-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3358
3359         [curl] Segfault in WebCore::CurlRequest::setupPOST
3360         https://bugs.webkit.org/show_bug.cgi?id=178434
3361
3362         Reviewed by Ryosuke Niwa.
3363
3364         * platform/network/curl/CurlRequest.cpp:
3365         (WebCore::CurlRequest::resolveBlobReferences):
3366         (WebCore::CurlRequest::setupPOST):
3367
3368 2017-10-18  Ryosuke Niwa  <rniwa@webkit.org>
3369
3370         Don't expose raw HTML in pasteboard to the web content
3371         https://bugs.webkit.org/show_bug.cgi?id=178422
3372         <rdar://problem/34567052>
3373
3374         Reviewed by Wenson Hsieh.
3375
3376         This patch enables HTML sanitization added in r223440 when WebKit pastes & concludes edit drag as opposed to
3377         just when dataTransfer.get is used. This is important to avoid leaking privacy sensitive information such as
3378         local file paths and pasting potentially harmful content such as scripts in event handler serialized by
3379         WebKit prior to r223462. In addition, we start using blob URLs in the pasted content instead of retaining
3380         the original URL and overriding the document loader like r222839 for RTFD and r222119 for image files.
3381
3382         To do this, a new superclass FrameWebContentReader of PasteboardWebContentReader and WebContentMarkupReader
3383         is introduced, and helper functions are extracted out of WebContentMarkupReader in WebContentReaderCocoa.mm
3384         to be also used in WebContentReader.
3385
3386         Tests: http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html
3387                http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin.html
3388                http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html
3389                PasteWebArchive.SanitizesHTML
3390
3391         * editing/WebContentReader.cpp:
3392         (WebCore::FrameWebContentReader::shouldSanitize const): Moved from WebContentMarkupReader.
3393         * editing/WebContentReader.h:
3394         (WebCore::FrameWebContentReader): Added to share code between WebContentReader and WebContentMarkupReader.
3395         (WebCore::FrameWebContentReader::FrameWebContentReader): Added.
3396         * editing/cocoa/EditorCocoa.mm:
3397         (WebCore::Editor::writeSelectionToPasteboard): Store the content's origin in the pasteboard so that we can
3398         avoid sanitizing the content when pasting into the same document. This is important since converting all URLs
3399         into blob URLs would break editors on the Web which tracks images, etc... in the content using URLs.
3400         (WebCore::Editor::writeSelection): Ditto.
3401         * editing/cocoa/WebContentReaderCocoa.mm:
3402         (WebCore::MarkupAndArchive): Replaced FragmentAndArchive. Now returns the markup string in the archive
3403         instead of the parsed fragment.
3404         (WebCore::extractMarkupAndArchive): Renamed from createFragmentFromWebArchive. Now returns the markup string.
3405         (WebCore::sanitizeMarkupWithArchive): Extracted out of WebContentMarkupReader::readWebArchive to share code
3406         between WebContentReader and WebContentMarkupReader, and added the code to handle subframes recursively.
3407         As inefficient as this code is, we can't delay the conversion of subframes' marksup until later time since
3408         the main frame's markup would contain blob URLs to refer to those subframes. 
3409         (WebCore::WebContentReader::readWebArchive): Use sanitizeMarkupWithArchive when shouldSanitize() is true.
3410         Don't add the subresources to the document loader when the content will be loaded into the same origin since
3411         subresouces are mostly likely available in the document anyway.
3412         (WebCore::WebContentMarkupReader::readWebArchive):
3413         * platform/Pasteboard.h:
3414         (WebCore::PasteboardWebContent): Added contentOrigin.
3415         * platform/PasteboardWriterData.h:
3416         (WebCore::PasteboardWriterData): Ditto.
3417         * platform/ios/PasteboardIOS.mm:
3418         (WebCore::Pasteboard::read): Read the origin before branching out to readRespectingUTIFidelities.
3419         * platform/ios/PlatformPasteboardIOS.mm:
3420         (WebCore::PlatformPasteboard::write): Record the content origin into the pasteboard.
3421         * platform/mac/PasteboardMac.mm:
3422         (WebCore::Pasteboard::write): Ditto.
3423         * platform/mac/PasteboardWriter.mm:
3424         (WebCore::createPasteboardWriter): Ditto.
3425
3426 2017-10-18  Sam Weinig  <sam@webkit.org>
3427
3428         Another attempt to fix the windows build.
3429
3430         * page/SettingsBase.cpp:
3431         (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
3432         * page/SettingsBase.h:
3433
3434 2017-10-18  Sam Weinig  <sam@webkit.org>
3435
3436         Attempt to fix the windows build.
3437
3438         * page/SettingsBase.cpp:
3439         (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
3440         * page/SettingsBase.h:
3441
3442 2017-10-18  Sam Weinig  <sam@webkit.org>
3443
3444         [Settings] Convert more settings to be generated
3445         https://bugs.webkit.org/show_bug.cgi?id=177766
3446
3447         Reviewed by Dean Jackson.
3448
3449         - Replaces setNeedsStyleRecalcInAllFrames option in Settings.in
3450           with a more generic, onChange, which allows you to specify a function
3451           in SettingsBase that will be called when the setting changes. 
3452           setNeedsStyleRecalcInAllFrames is then reimplemented in terms of
3453           onChange.
3454         - Moves most (all but two) of the remaining non-static settings from
3455           SettingsBase to Settings.in
3456
3457         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
3458         (printSetterBody):
3459         * Scripts/GenerateSettings/Settings.py:
3460         (Setting.__init__):
3461         (Setting.__str__):
3462         (Setting.typeIsValueType):
3463         (Setting.setterFunctionName):
3464         (Setting.setterChangeFunctionName):
3465         (Setting.hasComplexSetter):
3466         (parseInput):
3467         
3468             Add support for the onChange option.
3469         
3470         * page/Settings.in:
3471
3472             Migrate most of the remaining non-static settings to Settings.in.
3473             Adopt onChange option.
3474
3475         * page/SettingsBase.cpp:
3476         * page/SettingsBase.h:
3477
3478             Add helper functions for use by the onChange option.
3479
3480 2017-10-18  Chris Dumez  <cdumez@apple.com>
3481
3482         Implement ServiceWorkerRegistration.scope / updateViaCache
3483         https://bugs.webkit.org/show_bug.cgi?id=178497
3484
3485         Reviewed by Youenn Fablet.
3486
3487         Implement ServiceWorkerRegistration.scope / updateViaCache.
3488
3489         No new tests, updated existing test.
3490
3491         * WebCore.xcodeproj/project.pbxproj:
3492         * workers/service/ServiceWorkerContainer.cpp:
3493         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3494         * workers/service/ServiceWorkerContainer.h:
3495         * workers/service/ServiceWorkerJob.cpp:
3496         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
3497         * workers/service/ServiceWorkerJob.h:
3498         * workers/service/ServiceWorkerJobClient.h:
3499         * workers/service/ServiceWorkerRegistration.cpp:
3500         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
3501         (WebCore::ServiceWorkerRegistration::scope const):
3502         (WebCore::ServiceWorkerRegistration::updateViaCache const):
3503         (WebCore::ServiceWorkerRegistration::update):
3504         (WebCore::ServiceWorkerRegistration::unregister):
3505         (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
3506         (WebCore::ServiceWorkerRegistration::activeDOMObjectName const):
3507         (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
3508         * workers/service/ServiceWorkerRegistration.h:
3509         * workers/service/ServiceWorkerRegistration.idl:
3510         * workers/service/ServiceWorkerRegistrationData.cpp:
3511         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
3512         * workers/service/ServiceWorkerRegistrationData.h:
3513         (WebCore::ServiceWorkerRegistrationData::encode const):
3514         (WebCore::ServiceWorkerRegistrationData::decode):
3515         * workers/service/server/SWClientConnection.cpp:
3516         (WebCore::SWClientConnection::jobResolvedInServer):
3517         * workers/service/server/SWClientConnection.h:
3518         * workers/service/server/SWServerRegistration.cpp:
3519         (WebCore::SWServerRegistration::scriptContextStarted):
3520         (WebCore::SWServerRegistration::data const):
3521
3522 2017-10-18  Youenn Fablet  <youenn@apple.com>
3523
3524         Add preliminary support for ServiceWorker Handle Fetch
3525         https://bugs.webkit.org/show_bug.cgi?id=178475
3526
3527         Reviewed by Chris Dumez.
3528
3529         Test: http/tests/workers/service/basic-fetch.https.html
3530
3531         Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
3532         A script context is now storing its selected service worker identifier. This should be fully implemented later on.
3533         This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
3534         Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.
3535
3536         * WebCore.xcodeproj/project.pbxproj:
3537         * dom/ScriptExecutionContext.h:
3538         (WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
3539         (WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
3540         * loader/DocumentThreadableLoader.cpp:
3541         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
3542         * loader/FetchOptions.h:
3543         (WebCore::isPotentialNavigationOrSubresourceRequest):
3544         (WebCore::isNonSubresourceRequest):
3545         * loader/ResourceLoaderOptions.h:
3546         * loader/WorkerThreadableLoader.cpp:
3547         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
3548         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
3549         * loader/WorkerThreadableLoader.h:
3550         * platform/network/ResourceRequestBase.h:
3551         * platform/network/ResourceResponseBase.h:
3552         * workers/WorkerThread.h:
3553         * workers/service/ServiceWorkerContainer.cpp:
3554         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3555         * workers/service/ServiceWorkerProvider.h:
3556         * workers/service/context/SWContextManager.cpp: Removed.
3557         * workers/service/context/ServiceWorkerThread.h:
3558         * workers/service/server/SWServer.h:
3559
3560 2017-10-18  Zalan Bujtas  <zalan@apple.com>
3561
3562         [FrameView::layout cleanup] Group related pre-layout code to improve readability
3563         https://bugs.webkit.org/show_bug.cgi?id=178496
3564         <rdar://problem/35065718>
3565
3566         Reviewed by Simon Fraser.
3567
3568         Early returns/asserts/member variable resets etc.
3569
3570         Covered by existing tests.
3571
3572         * page/FrameView.cpp:
3573         (WebCore::FrameView::layout):
3574
3575 2017-10-17  Jiewen Tan  <jiewen_tan@apple.com>
3576
3577         Replace some stack raw pointers with RefPtrs within WebCore/html
3578         https://bugs.webkit.org/show_bug.cgi?id=178201
3579         <rdar://problem/34841692>
3580
3581         Reviewed by Ryosuke Niwa.
3582
3583         This is an effort to reduce raw pointer usage in DOM code. In this patch, raw pointers
3584         that are ref countable are blindly selected to be replaced with RefPtrs with one exception
3585         which is auto*.
3586
3587         Also, this patch occasionally modifies the return type of some methods, and therefore callers
3588         of those methods are modified accordingly.
3589
3590         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
3591         (WebCore::LegacyCDM::mediaPlayer const):
3592         * Modules/encryptedmedia/legacy/LegacyCDM.h:
3593         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
3594         (WebCore::CDMPrivateMediaPlayer::createSession):
3595         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
3596         (WebCore::WebKitMediaKeys::cdmMediaPlayer const):
3597         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
3598         * Modules/mediacontrols/MediaControlsHost.cpp:
3599         (WebCore::MediaControlsHost::externalDeviceDisplayName const):
3600         (WebCore::MediaControlsHost::externalDeviceType const):
3601         * dom/Element.cpp:
3602         (WebCore::Element::focusDelegate):
3603         (WebCore::Element::userAgentShadowRoot const):
3604         (WebCore::Element::ensureUserAgentShadowRoot):
3605         * dom/Element.h:
3606         * dom/EventContext.cpp:
3607         (WebCore::TouchEventContext::checkReachability const):
3608         * dom/EventPath.cpp:
3609         (WebCore::shouldEventCrossShadowBoundary):
3610         (WebCore::EventPath::setRelatedTarget):
3611         (WebCore::EventPath::retargetTouch):
3612         (WebCore:: const):
3613         * dom/EventTarget.cpp:
3614         (WebCore::EventTarget::toNode):
3615         (WebCore::EventTarget::addEventListener):
3616         * dom/EventTarget.h:
3617         * dom/MouseEvent.cpp:
3618         (WebCore::MouseEvent::toElement const):
3619         (WebCore::MouseEvent::fromElement const):
3620         * dom/MouseEvent.h:
3621         * dom/MouseRelatedEvent.cpp:
3622         (WebCore::MouseRelatedEvent::computeRelativePosition):
3623         * dom/Node.cpp:
3624         (WebCore::Node::toNode):
3625         * dom/Node.h:
3626         * dom/ScopedEventQueue.cpp:
3627         * editing/Editor.cpp:
3628         (WebCore::Editor::selectionForCommand):
3629         * editing/EditorCommand.cpp:
3630         (WebCore::targetFrame):
3631         * editing/TextIterator.cpp:
3632         (WebCore::TextIterator::handleReplacedElement):
3633         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
3634         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
3635         * html/ColorInputType.cpp:
3636         (WebCore::ColorInputType::updateColorSwatch):
3637         (WebCore::ColorInputType::shadowColorSwatch const):
3638         * html/FileInputType.cpp:
3639         (WebCore::FileInputType::disabledAttributeChanged):
3640         (WebCore::FileInputType::multipleAttributeChanged):
3641         * html/FormAssociatedElement.cpp:
3642         (WebCore::FormAssociatedElement::findAssociatedForm):
3643         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
3644         (WebCore::FormAssociatedElement::resetFormOwner):
3645         (WebCore::FormAssociatedElement::formAttributeChanged):
3646         * html/FormController.cpp:
3647         (WebCore::recordFormStructure):
3648         (WebCore::FormKeyGenerator::formKey):
3649         (WebCore::FormController::restoreControlStateIn):
3650         * html/HTMLAnchorElement.cpp:
3651         (WebCore::appendServerMapMousePosition):
3652         (WebCore::HTMLAnchorElement::handleClick):
3653         * html/HTMLAppletElement.cpp:
3654         (WebCore::HTMLAppletElement::updateWidget):
3655         * html/HTMLAreaElement.cpp:
3656         (WebCore::HTMLAreaElement::imageElement const):
3657         (WebCore::HTMLAreaElement::isFocusable const):
3658         (WebCore::HTMLAreaElement::setFocus):
3659         (WebCore::HTMLAreaElement::updateFocusAppearance):
3660         * html/HTMLBodyElement.cpp:
3661         (WebCore::HTMLBodyElement::scrollLeft):
3662         (WebCore::HTMLBodyElement::setScrollLeft):
3663         (WebCore::HTMLBodyElement::scrollTop):
3664         (WebCore::HTMLBodyElement::setScrollTop):
3665         (WebCore::HTMLBodyElement::scrollHeight):
3666         (WebCore::HTMLBodyElement::scrollWidth):
3667         * html/HTMLCanvasElement.cpp:
3668         (WebCore::HTMLCanvasElement::createElementRenderer):
3669         (WebCore:: const):
3670         * html/HTMLDocument.cpp:
3671         (WebCore::HTMLDocument::width):
3672         (WebCore::HTMLDocument::height):
3673         * html/HTMLElement.cpp:
3674         (WebCore::HTMLElement::rendererIsNeeded):
3675         (WebCore::setHasDirAutoFlagRecursively):
3676         (WebCore::HTMLElement::directionality const):
3677         (WebCore::HTMLElement::dirAttributeChanged):
3678         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
3679         * html/HTMLEmbedElement.cpp:
3680         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
3681         (WebCore::HTMLEmbedElement::rendererIsNeeded):
3682         * html/HTMLFieldSetElement.cpp:
3683         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
3684         (WebCore::HTMLFieldSetElement::disabledStateChanged):
3685         (WebCore::HTMLFieldSetElement::childrenChanged):
3686         * html/HTMLFormControlElement.cpp:
3687         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
3688         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
3689         (WebCore::HTMLFormControlElement::didChangeForm):
3690         (WebCore::HTMLFormControlElement::shouldAutocorrect const):
3691         (WebCore::HTMLFormControlElement::autocapitalizeType const):
3692         * html/HTMLFormElement.cpp:
3693         (WebCore::HTMLFormElement::handleLocalEvents):
3694         (WebCore::submitElementFromEvent):
3695         (WebCore::HTMLFormElement::prepareForSubmission):
3696         (WebCore::HTMLFormElement::submit):
3697         (WebCore::HTMLFormElement::reset):
3698         (WebCore::HTMLFormElement::shouldAutocorrect const):
3699         (WebCore::HTMLFormElement::parseAttribute):
3700         (WebCore::HTMLFormElement::resetDefaultButton):
3701         (WebCore::HTMLFormElement::elementFromPastNamesMap const):
3702         (WebCore::HTMLFormElement::namedElements):
3703         * html/HTMLFormElement.h:
3704         * html/HTMLFrameElement.cpp:
3705         (WebCore::HTMLFrameElement::didAttachRenderers):
3706         * html/HTMLFrameElementBase.cpp:
3707         (WebCore::HTMLFrameElementBase::isURLAllowed const):
3708         (WebCore::HTMLFrameElementBase::openURL):
3709         (WebCore::HTMLFrameElementBase::didAttachRenderers):
3710         * html/HTMLFrameOwnerElement.cpp:
3711         (WebCore::HTMLFrameOwnerElement::setContentFrame):
3712         (WebCore::HTMLFrameOwnerElement::clearContentFrame):
3713         (WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
3714         (WebCore::SubframeLoadingDisabler::canLoadFrame):
3715         * html/HTMLFrameSetElement.cpp:
3716         (WebCore::HTMLFrameSetElement::findContaining):
3717         (WebCore::HTMLFrameSetElement::willAttachRenderers):
3718         (WebCore::HTMLFrameSetElement::insertedInto):
3719         (WebCore::HTMLFrameSetElement::removedFrom):
3720         * html/HTMLFrameSetElement.h:
3721         * html/HTMLImageElement.cpp:
3722         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3723         (WebCore::HTMLImageElement::pictureElement const):
3724         (WebCore::HTMLImageElement::destroyImageControls):
3725         (WebCore::HTMLImageElement::hasImageControls const):
3726         * html/HTMLInputElement.cpp:
3727         (WebCore::HTMLInputElement::innerTextElement const):
3728         (WebCore::HTMLInputElement::endEditing):
3729         (WebCore::HTMLInputElement::dataList const):
3730         (WebCore::HTMLInputElement::resetListAttributeTargetObserver): Deleted.
3731         (WebCore::HTMLInputElement::listAttributeTargetChanged): Deleted.
3732         (WebCore::HTMLInputElement::isSteppable const): Deleted.
3733         (WebCore::HTMLInputElement::dateType const): Deleted.
3734         (WebCore::HTMLInputElement::isTextButton const): Deleted.
3735         (WebCore::HTMLInputElement::isRadioButton const): Deleted.
3736         (WebCore::HTMLInputElement::isSearchField const): Deleted.
3737         (WebCore::HTMLInputElement::isInputTypeHidden const): Deleted.
3738         (WebCore::HTMLInputElement::isPasswordField const): Deleted.
3739         (WebCore::HTMLInputElement::isCheckbox const): Deleted.
3740         (WebCore::HTMLInputElement::isRangeControl const): Deleted.
3741         (WebCore::HTMLInputElement::isColorControl const): Deleted.
3742         (WebCore::HTMLInputElement::isText const): Deleted.
3743         (WebCore::HTMLInputElement::isEmailField const): Deleted.
3744         (WebCore::HTMLInputElement::isFileUpload const): Deleted.
3745         (WebCore::HTMLInputElement::isImageButton const): Deleted.
3746         (WebCore::HTMLInputElement::isNumberField const): Deleted.
3747         (WebCore::HTMLInputElement::isSubmitButton const): Deleted.
3748         (WebCore::HTMLInputElement::isTelephoneField const): Deleted.
3749         (WebCore::HTMLInputElement::isURLField const): Deleted.
3750         (WebCore::HTMLInputElement::isDateField const): Deleted.
3751         (WebCore::HTMLInputElement::isDateTimeField const): Deleted.
3752         (WebCore::HTMLInputElement::isDateTimeLocalField const): Deleted.
3753         (WebCore::HTMLInputElement::isMonthField const): Deleted.
3754         (WebCore::HTMLInputElement::isTimeField const): Deleted.
3755         (WebCore::HTMLInputElement::isWeekField const): Deleted.
3756         (WebCore::HTMLInputElement::isEnumeratable const): Deleted.
3757         (WebCore::HTMLInputElement::supportLabels const): Deleted.
3758         (WebCore::HTMLInputElement::shouldAppearChecked const): Deleted.
3759         (WebCore::HTMLInputElement::supportsPlaceholder const): Deleted.
3760         (WebCore::HTMLInputElement::updatePlaceholderText): Deleted.
3761         (WebCore::HTMLInputElement::isEmptyValue const): Deleted.
3762         (WebCore::HTMLInputElement::maxLengthAttributeChanged): Deleted.
3763         (WebCore::HTMLInputElement::minLengthAttributeChanged): Deleted.
3764         (WebCore::HTMLInputElement::updateValueIfNeeded): Deleted.
3765         (WebCore::HTMLInputElement::defaultToolTip const): Deleted.
3766         (WebCore::HTMLInputElement::matchesIndeterminatePseudoClass const): Deleted.
3767         (WebCore::HTMLInputElement::shouldAppearIndeterminate const): Deleted.
3768         (WebCore::HTMLInputElement::mediaCaptureType const): Deleted.
3769         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Deleted.
3770         (WebCore:: const): Deleted.
3771         (WebCore::HTMLInputElement::checkedRadioButtonForGroup const): Deleted.
3772         (WebCore::HTMLInputElement::radioButtonGroups const): Deleted.
3773         (WebCore::HTMLInputElement::addToRadioButtonGroup): Deleted.
3774         (WebCore::HTMLInputElement::removeFromRadioButtonGroup): Deleted.
3775         (WebCore::HTMLInputElement::height const): Deleted.
3776         (WebCore::HTMLInputElement::width const): Deleted.
3777         (WebCore::HTMLInputElement::setHeight): Deleted.
3778         (WebCore::HTMLInputElement::setWidth): Deleted.
3779         (WebCore::ListAttributeTargetObserver::ListAttributeTargetObserver): Deleted.
3780         (WebCore::ListAttributeTargetObserver::idTargetChanged): Deleted.
3781         (WebCore::HTMLInputElement::setRangeText): Deleted.
3782         (WebCore::HTMLInputElement::shouldTruncateText const): Deleted.
3783         (WebCore::HTMLInputElement::selectionStartForBindings const): Deleted.
3784         (WebCore::HTMLInputElement::setSelectionStartForBindings): Deleted.
3785         (WebCore::HTMLInputElement::selectionEndForBindings const): Deleted.
3786         (WebCore::HTMLInputElement::setSelectionEndForBindings): Deleted.
3787         (WebCore::HTMLInputElement::selectionDirectionForBindings const): Deleted.
3788         (WebCore::HTMLInputElement::setSelectionDirectionForBindings): Deleted.
3789         (WebCore::HTMLInputElement::setSelectionRangeForBindings): Deleted.
3790         (WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
3791         (WebCore::HTMLInputElement::setupDateTimeChooserParameters): Deleted.
3792         (WebCore::HTMLInputElement::capsLockStateMayHaveChanged): Deleted.
3793         * html/HTMLInputElement.h:
3794         * html/HTMLKeygenElement.cpp:
3795         (WebCore::HTMLKeygenElement::shadowSelect const):
3796         * html/HTMLLabelElement.cpp:
3797         (WebCore::HTMLLabelElement::defaultEventHandler):
3798         * html/HTMLLinkElement.cpp:
3799         (WebCore::HTMLLinkElement::handleClick):
3800         * html/HTMLMapElement.cpp:
3801         (WebCore::HTMLMapElement::mapMouseEvent):
3802         * html/HTMLMediaElement.cpp:
3803         (WebCore::HTMLMediaElement::selectMediaResource):
3804         (WebCore::HTMLMediaElement::loadResource):
3805         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3806         (WebCore::HTMLMediaElement::isSafeToLoadURL):
3807         (WebCore::HTMLMediaElement::controls const):
3808         (WebCore::HTMLMediaElement::layoutSizeChanged):
3809         (WebCore::HTMLMediaElement::enterFullscreen):
3810         (WebCore::HTMLMediaElement::mediaControls const):
3811         (WebCore::HTMLMediaElement::hasMediaControls const):
3812         (WebCore::HTMLMediaElement::mediaPlayerReferrer const):
3813         (WebCore::HTMLMediaElement::mediaPlayerUserAgent const):
3814         (WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge):
3815         (WebCore::HTMLMediaElement::sourceApplicationIdentifier const):
3816         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
3817         (WebCore::HTMLMediaElement::session const):
3818         * html/HTMLMediaElement.h:
3819         (WebCore::HTMLMediaElement::player const):
3820         * html/HTMLObjectElement.cpp:
3821         (WebCore::HTMLObjectElement::hasFallbackContent const):
3822         * html/HTMLOptGroupElement.cpp:
3823         (WebCore::HTMLOptGroupElement::ownerSelectElement const):
3824         (WebCore::HTMLOptGroupElement::accessKeyAction):
3825         * html/HTMLOptionElement.cpp:
3826         (WebCore::HTMLOptionElement::setText):
3827         (WebCore::HTMLOptionElement::accessKeyAction):
3828         (WebCore::HTMLOptionElement::index const):
3829         (WebCore::HTMLOptionElement::parseAttribute):
3830         (WebCore::HTMLOptionElement::selected):
3831         (WebCore::HTMLOptionElement::setSelected):
3832         (WebCore::HTMLOptionElement::setSelectedState):
3833         (WebCore::HTMLOptionElement::childrenChanged):
3834         (WebCore::HTMLOptionElement::ownerDataListElement const):
3835         (WebCore::HTMLOptionElement::ownerSelectElement const):
3836         (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
3837         (WebCore::HTMLOptionElement::insertedInto):
3838         (WebCore::HTMLOptionElement::collectOptionInnerText const):
3839         * html/HTMLPlugInElement.cpp:
3840         (WebCore::HTMLPlugInElement::willDetachRenderers):
3841         (WebCore::HTMLPlugInElement::isKeyboardFocusable const):
3842         (WebCore::HTMLPlugInElement::isUserObservable const):
3843         * html/HTMLPlugInImageElement.cpp:
3844         (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
3845         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
3846         * html/HTMLSelectElement.cpp:
3847         (WebCore::HTMLSelectElement::add):
3848         (WebCore::HTMLSelectElement::recalcListItems const):
3849         (WebCore::HTMLSelectElement::selectOption):
3850         (WebCore::HTMLSelectElement::reset):
3851         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
3852         * html/HTMLSlotElement.cpp:
3853         (WebCore::flattenAssignedNodes):
3854         * html/HTMLSourceElement.cpp:
3855         (WebCore::HTMLSourceElement::removedFrom):
3856         * html/HTMLSummaryElement.cpp:
3857         (WebCore::HTMLSummaryElement::isActiveSummary const):
3858         (WebCore::isClickableControl):
3859         (WebCore::HTMLSummaryElement::defaultEventHandler):
3860         * html/HTMLTableCellElement.cpp:
3861         (WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
3862         * html/HTMLTableColElement.cpp:
3863         (WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
3864         * html/HTMLTableElement.cpp:
3865         (WebCore::HTMLTableElement::tHead const):
3866         (WebCore::HTMLTableElement::setTHead):
3867         (WebCore::HTMLTableElement::tFoot const):
3868         (WebCore::HTMLTableElement::createTBody):
3869         (WebCore::HTMLTableElement::lastBody const):
3870         (WebCore::HTMLTableElement::deleteRow):
3871         * html/HTMLTablePartElement.cpp:
3872         (WebCore::HTMLTablePartElement::findParentTable const):
3873         * html/HTMLTableRowsCollection.cpp:
3874         (WebCore::HTMLTableRowsCollection::rowAfter):
3875         * html/HTMLTextAreaElement.cpp:
3876         (WebCore::HTMLTextAreaElement::subtreeHasChanged):
3877         (WebCore::HTMLTextAreaElement::innerTextElement const):
3878         * html/HTMLTextAreaElement.h:
3879         * html/HTMLTextFormControlElement.cpp:
3880         (WebCore::HTMLTextFormControlElement::setSelectionRange):
3881         (WebCore::HTMLTextFormControlElement::indexForVisiblePosition const):
3882         (WebCore::HTMLTextFormControlElement::visiblePositionForIndex const):
3883         (WebCore::HTMLTextFormControlElement::computeSelectionStart const):
3884         (WebCore::HTMLTextFormControlElement::computeSelectionEnd const):
3885         (WebCore::HTMLTextFormControlElement::computeSelectionDirection const):
3886         (WebCore::HTMLTextFormControlElement::selection const):
3887         (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
3888         (WebCore::innerTextValueFrom):
3889         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
3890         (WebCore::HTMLTextFormControlElement::innerTextValue const):
3891         (WebCore::positionForIndex):
3892         (WebCore::HTMLTextFormControlElement::indexForPosition const):
3893         (WebCore::HTMLTextFormControlElement::hidePlaceholder):
3894         (WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary):
3895         (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
3896         (WebCore::enclosingTextFormControl):
3897         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
3898         * html/HTMLTextFormControlElement.h:
3899         * html/HTMLTrackElement.cpp:
3900         (WebCore::HTMLTrackElement::canLoadURL):
3901         (WebCore::HTMLTrackElement::setReadyState):
3902         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute const):
3903         (WebCore::HTMLTrackElement::textTrackKindChanged):
3904         (WebCore::HTMLTrackElement::textTrackModeChanged):
3905         (WebCore::HTMLTrackElement::textTrackAddCues):
3906         (WebCore::HTMLTrackElement::textTrackRemoveCues):
3907         (WebCore::HTMLTrackElement::textTrackAddCue):
3908         (WebCore::HTMLTrackElement::textTrackRemoveCue):
3909         (WebCore::HTMLTrackElement::mediaElement const):
3910         * html/HTMLTrackElement.h:
3911         * html/HTMLVideoElement.cpp:
3912         (WebCore::HTMLVideoElement::setDisplayMode):
3913         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
3914         * html/ImageDocument.cpp:
3915         (WebCore::ImageDocument::createDocumentStructure):
3916         (WebCore::ImageDocument::scale):
3917         (WebCore::ImageDocument::imageFitsInWindow):
3918         * html/InputType.cpp:
3919         (WebCore::InputType::destroyShadowSubtree):
3920         * html/InputType.h:
3921         (WebCore::InputType::innerTextElement const):
3922         * html/MediaDocument.cpp:
3923         (WebCore::MediaDocumentParser::createDocumentStructure):
3924         (WebCore::MediaDocument::defaultEventHandler):
3925         * html/MediaElementSession.cpp:
3926         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
3927         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
3928         (WebCore::isMainContentForPurposesOfAutoplay):
3929         * html/NumberInputType.cpp:
3930         (WebCore::NumberInputType::decorationWidth const):
3931         * html/PluginDocument.cpp:
3932         (WebCore::PluginDocumentParser::appendBytes):
3933         * html/RadioInputType.cpp:
3934         (WebCore::RadioInputType::handleKeydownEvent):
3935         (WebCore::RadioInputType::isKeyboardFocusable const):
3936         (WebCore::RadioInputType::didDispatchClick):
3937         * html/RadioNodeList.cpp:
3938         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const):
3939         * html/RangeInputType.cpp:
3940         (WebCore::RangeInputType::handleMouseDownEvent):
3941         (WebCore::RangeInputType::handleTouchEvent):
3942         (WebCore::RangeInputType::sliderTrackElement const):
3943         (WebCore::RangeInputType::listAttributeTargetChanged):
3944         (WebCore::RangeInputType::updateTickMarkValues):
3945         * html/SearchInputType.cpp:
3946         (WebCore::SearchInputType::createShadowSubtree):
3947         * html/TextFieldInputType.cpp:
3948         (WebCore::TextFieldInputType::isEmptyValue const):
3949         (WebCore::TextFieldInputType::handleKeydownEvent):
3950         (WebCore::TextFieldInputType::handleFocusEvent):
3951         (WebCore::TextFieldInputType::innerTextElement const):
3952         (WebCore::TextFieldInputType::updatePlaceholderText):
3953         (WebCore::TextFieldInputType::didSetValueByUserEdit):
3954         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
3955         * html/TextFieldInputType.h:
3956         * html/canvas/CanvasRenderingContext2D.cpp:
3957         (WebCore::size):
3958         (WebCore::CanvasRenderingContext2D::drawImage):
3959         * html/canvas/WebGL2RenderingContext.cpp:
3960         (WebCore::WebGL2RenderingContext::copyBufferSubData):
3961         (WebCore::WebGL2RenderingContext::getBufferSubData):
3962         * html/canvas/WebGLFramebuffer.cpp:
3963         (WebCore::WebGLFramebuffer::attach):
3964         (WebCore::WebGLFramebuffer::getAttachmentObject const):
3965         (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
3966         (WebCore::WebGLFramebuffer::getColorBufferWidth const):
3967         (WebCore::WebGLFramebuffer::getColorBufferHeight const):
3968         (WebCore::WebGLFramebuffer::getColorBufferFormat const):
3969         (WebCore::WebGLFramebuffer::checkStatus const):
3970         (WebCore::WebGLFramebuffer::hasStencilBuffer const):
3971         (WebCore::WebGLFramebuffer::initializeAttachments):
3972         * html/canvas/WebGLRenderingContext.cpp:
3973         (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
3974         * html/canvas/WebGLRenderingContextBase.cpp:
3975         (WebCore::WebGLRenderingContextBase::create):
3976         (WebCore::WebGLRenderingContextBase::bufferData):
3977         (WebCore::WebGLRenderingContextBase::bufferSubData):
3978         (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
3979         (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
3980         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
3981         (WebCore::WebGLRenderingContextBase::generateMipmap):
3982         (WebCore::WebGLRenderingContextBase::getAttachedShaders):
3983         (WebCore::WebGLRenderingContextBase::getTexParameter):
3984         (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
3985         (WebCore::WebGLRenderingContextBase::texImage2DBase):
3986         (WebCore::WebGLRenderingContextBase::validateTexFunc):
3987         (WebCore::WebGLRenderingContextBase::texSubImage2D):
3988         (WebCore::WebGLRenderingContextBase::texSubImage2DBase):
3989         (WebCore::WebGLRenderingContextBase::copyTexImage2D):
3990         (WebCore::WebGLRenderingContextBase::texImage2D):
3991         (WebCore::WebGLRenderingContextBase::texParameter):
3992         (WebCore::WebGLRenderingContextBase::loseContextImpl):
3993         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
3994         (WebCore::WebGLRenderingContextBase::validateTextureBinding):
3995         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
3996         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
3997         (WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const):
3998         (WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor):
3999         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp: