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