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