Unreviewed, cleanup changelogs.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-26  Keith Miller  <keith_miller@apple.com>
2
3         Unreviewed, cleanup changelogs.
4
5 2017-10-26  Keith Miller  <keith_miller@apple.com>
6
7         Unreviewed, add deprecated declarations pragma to fix macosx.
8
9         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
10
11 2017-10-26  Andy Estes  <aestes@apple.com>
12
13         [Payment Request] Restrict API use to secure, same-origin frames
14         https://bugs.webkit.org/show_bug.cgi?id=178887
15
16         Reviewed by Tim Horton.
17
18         Reuse the access checks from Apple Pay to restrict PaymentRequest API usage to secure frames
19         in the same origin as the main frame.
20
21         Progresses active-document-cross-origin.https.sub.html and
22         active-document-same-origin.https.html from web-platform-tests. Regresses basic.https.html
23         since the allowpaymentrequest <iframe> attribute is not yet implemented.
24
25         * Modules/applepay/ApplePaySession.cpp:
26         (WebCore::ApplePaySession::create):
27         (WebCore::ApplePaySession::supportsVersion):
28         (WebCore::ApplePaySession::canMakePayments):
29         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
30         (WebCore::ApplePaySession::openPaymentSetup):
31         (WebCore::isSecure): Deleted.
32         (WebCore::canCallApplePaySessionAPIs): Deleted.
33         * Modules/applepay/PaymentSession.cpp: Added.
34         (WebCore::isSecure):
35         (WebCore::PaymentSession::canCreateSession):
36         * Modules/applepay/PaymentSession.h:
37         * Modules/paymentrequest/PaymentHandler.cpp:
38         (WebCore::PaymentHandler::canCreateSession):
39         * Modules/paymentrequest/PaymentHandler.h:
40         * Modules/paymentrequest/PaymentRequest.cpp:
41         (WebCore::PaymentRequest::create):
42         * WebCore.xcodeproj/project.pbxproj:
43
44 2017-10-26  Youenn Fablet  <youenn@apple.com>
45
46         Add service worker handle fetch support for all subresource requests
47         https://bugs.webkit.org/show_bug.cgi?id=178769
48
49         Reviewed by Chris Dumez.
50
51         Test: http/tests/workers/service/image-fetch.html
52
53         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
54         Setting the selected service worker identifier for subresource only at the moment.
55
56         Testing is limited to images, future wpt tests should cover other subresource cases.
57
58         * loader/DocumentThreadableLoader.cpp:
59         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
60         * loader/cache/CachedResourceLoader.cpp:
61         (WebCore::CachedResourceLoader::prepareFetch):
62         * loader/cache/CachedResourceRequest.cpp:
63         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
64         * loader/cache/CachedResourceRequest.h:
65
66 2017-10-26  Eric Carlson  <eric.carlson@apple.com>
67
68         NowPlayingInfo should contain a unique identifier
69         https://bugs.webkit.org/show_bug.cgi?id=178872
70
71         Reviewed by Jer Noble.
72
73         Updated TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm.
74
75         * platform/audio/PlatformMediaSessionManager.h:
76         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const): New.
77
78         * platform/audio/ios/MediaSessionManagerIOS.h:
79         * platform/audio/ios/MediaSessionManagerIOS.mm:
80         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.
81
82         * platform/audio/mac/MediaSessionManagerMac.h:
83         * platform/audio/mac/MediaSessionManagerMac.mm:
84         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto. Don't leak CFString.
85
86         * platform/mac/MediaRemoteSoftLink.cpp: Softlink kMRMediaRemoteNowPlayingInfoUniqueIdentifier.
87         * platform/mac/MediaRemoteSoftLink.h:
88
89 2017-10-26  Keith Miller  <keith_miller@apple.com>
90
91         Unreviewed, iOS build fix.
92
93         * SourcesMac.txt:
94         * WebCore.xcodeproj/project.pbxproj:
95
96 2017-10-26  Keith Miller  <keith_miller@apple.com>
97
98         Move Mac specific files to unified sources
99         https://bugs.webkit.org/show_bug.cgi?id=178883
100
101         Rubber-stamped by Tim Horton.
102
103         * SourcesCocoa.txt:
104         * SourcesMac.txt:
105         * WebCore.xcodeproj/project.pbxproj:
106
107 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
108
109         DidMoveToNewDocumentAssertionScope shouldn't be necessary
110         https://bugs.webkit.org/show_bug.cgi?id=178836
111         <rdar://problem/35008876>
112
113         Reviewed by Antti Koivisto.
114
115         DidMoveToNewDocumentAssertionScope was introduced in r217972 to replace an existing assertion to make sure
116         Node::didMoveToNewDocument is always called by its overrides in Node's subclasses. However, we can ensure
117         better Node::didMoveToNewDocument is always called if we called it directly in Node::moveTreeToNewScope.
118
119         Because only subclasses of Element and ShadowRoot override Node::didMoveToNewDocument and we already have
120         a specialized code path to adopt a ShadowRoot to a new document, this refactoring eliminates the need for
121         having a virtual function on Node at all.
122
123         Hence this patch names Node::didMoveToNewDocument to Node::moveToNewDocument and makes it non-virtual,
124         splits ShadowRoot::didMoveToNewDocument into moveShadowRootToNewParentScope and moveShadowRootToNewDocument,
125         and removes DidMoveToNewDocumentAssertionScope completely.
126
127         No new tests since there should be no behavioral change.
128
129         * dom/Document.cpp:
130         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Renamed from moveNodeIteratorsToNewDocument.
131         * dom/Document.h:
132         (WebCore::Document::moveNodeIteratorsToNewDocument): Inlined the check for emptiness of m_nodeIterators to
133         avoid keep calling moveNodeIteratorsToNewDocumentSlowCase on every single node getting moved.
134         * dom/Element.cpp:
135         (WebCore::Element::didMoveToNewDocument): Removed the call to Node::didMoveToNewDocument since this is the
136         base virtual function now.
137         * dom/Element.h:
138         * dom/Node.cpp:
139         (WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope): Deleted.
140         (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope): Deleted.
141         (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall): Deleted.
142         (WebCore::moveNodeToNewDocument): Deleted.
143         (WebCore::Node::moveShadowTreeToNewDocument): Made this a member function of Node since it needs to call
144         moveNodeToNewDocument, which is private to Node.
145         (WebCore::Node::moveTreeToNewScope): Removed the release assert for the root node since  the same check
146         exists inside traverseSubtreeToUpdateTreeScope. Also removed the release assertion for checking that
147         node's old document matches the old document since document() simply calls treeScope().documentScope()
148         and we're already release-asserting that the old scope of a node matches the old scope we know of.
149         We release-assert that the old tree scope's document didn't change after the traversal instead. Finally,
150         replaced a bunch of RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
151         (WebCore::Node::moveNodeToNewDocument): Renamed from didMoveToNewDocument. Moved the code related to
152         mutation observers inside hasRareData() check, and moved the the code to move event listeners inside
153         eventTargetData() check both for clarity, and avoid doing the work for every single node being moved.
154         Finally, call the old didMoveToNewDocument when "this" is an Element.
155         * dom/Node.h:
156         * dom/ShadowRoot.cpp:
157         (WebCore::ShadowRoot::moveShadowRootToNewParentScope): Added. Extracted from didMoveToNewDocument.
158         (WebCore::ShadowRoot::moveShadowRootToNewDocument): Renamed from didMoveToNewDocument. We now
159         release-assert that parent tree scope's document matches the new document if any.
160         * dom/ShadowRoot.h:
161
162 2017-10-26  Youenn Fablet  <youenn@apple.com>
163
164         Implement ServiceWorkerContainer getRegistration
165         https://bugs.webkit.org/show_bug.cgi?id=178882
166
167         Reviewed by Chris Dumez.
168
169         Replace rejection promise by resolving the promise with a null value.
170         This helps in running WPT tests as WPT tests usually check for registered service workers before running tests.
171         For WTR, there should be no registered service worker anyway.
172
173         * workers/service/ServiceWorkerContainer.cpp:
174         (WebCore::ServiceWorkerContainer::getRegistration):
175         * workers/service/ServiceWorkerContainer.h:
176
177 2017-10-26  Dan Bernstein  <mitz@apple.com>
178
179         Account for Mail’s WebMessageDocument class being renamed
180         https://bugs.webkit.org/show_bug.cgi?id=178881
181
182         Reviewed by Sam Weinig.
183
184         * editing/cocoa/HTMLConverter.mm:
185         (_WebMessageDocumentClass): Look up the class by its new name. No longer look it up by the
186           old old name, because TOT WebKit isn’t going to be used by versions of Mail that have that name.
187
188 2017-10-26  Antoine Quint  <graouts@apple.com>
189
190         Remove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
191         https://bugs.webkit.org/show_bug.cgi?id=178879
192
193         Reviewed by Dean Jackson.
194
195         There are no call sites for FrameView::serviceScriptedAnimations() and that method is the
196         only call site for Document::serviceScriptedAnimations(), so both can go.
197
198         * dom/Document.cpp:
199         (WebCore::Document::serviceScriptedAnimations): Deleted.
200         * dom/Document.h:
201         * page/FrameView.cpp:
202         (WebCore::FrameView::serviceScriptedAnimations): Deleted.
203         * page/FrameView.h:
204
205 2017-10-26  Chris Dumez  <cdumez@apple.com>
206
207         Bring back SWContextManager abstraction in WebCore
208         https://bugs.webkit.org/show_bug.cgi?id=178876
209
210         Reviewed by Geoffrey Garen.
211
212         Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
213         is actually useful when the ServiceWorker wants to message the storage process.
214
215         * Sources.txt:
216         * WebCore.xcodeproj/project.pbxproj:
217         * workers/service/context/SWContextManager.cpp: Added.
218         (WebCore::SWContextManager::singleton):
219         (WebCore::SWContextManager::setConnection):
220         (WebCore::SWContextManager::connection const):
221         (WebCore::SWContextManager::registerServiceWorkerThread):
222         (WebCore::SWContextManager::serviceWorkerThreadProxy const):
223         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
224         * workers/service/context/SWContextManager.h: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
225         (WebCore::SWContextManager::Connection::~Connection):
226
227 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
228
229         [Curl] Rename CurlJobManager to CurlRequestScheduler
230         https://bugs.webkit.org/show_bug.cgi?id=178775
231
232         To match the meaning of the class.
233         It was originally meant to be more generic purpose, but as
234         other classes was introduced, the objective of the class is
235         now only to handle the life cycle of curl requests.
236
237         The delegate is also renamed to CurlRequestSchedulerClient.
238
239         Reviewed by Alex Christensen.
240
241         * platform/Curl.cmake:
242         * platform/network/curl/CurlDownload.cpp:
243         (WebCore::CurlDownload::~CurlDownload):
244         (WebCore::CurlDownload::willSendRequest):
245         * platform/network/curl/CurlDownload.h:
246         * platform/network/curl/CurlRequest.cpp:
247         (WebCore::CurlRequest::CurlRequest):
248         (WebCore::CurlRequest::start):
249         (WebCore::CurlRequest::startWithJobManager):
250         (WebCore::CurlRequest::cancel):
251         (WebCore::CurlRequest::callClient):
252         (WebCore::CurlRequest::didReceiveData):
253         (WebCore::CurlRequest::didCompleteTransfer):
254         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
255         (WebCore::CurlRequest::invokeDidReceiveResponse):
256         (WebCore::CurlRequest::completeDidReceiveResponse):
257         (WebCore::CurlRequest::pausedStatusChanged):
258         (WebCore::CurlRequest::callDelegate): Deleted.
259         * platform/network/curl/CurlRequest.h:
260         (WebCore::CurlRequest::create):
261         (WebCore::CurlRequest::setClient):
262         (WebCore::CurlRequest::setDelegate): Deleted.
263         * platform/network/curl/CurlRequestClient.h: Renamed from Source/WebCore/platform/network/curl/CurlRequestDelegate.h.
264         * platform/network/curl/CurlRequestScheduler.cpp: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.cpp.
265         (WebCore::CurlJobList::startJobs):
266         (WebCore::CurlJobList::finishJobs):
267         (WebCore::CurlRequestScheduler::singleton):
268         (WebCore::CurlRequestScheduler::add):
269         (WebCore::CurlRequestScheduler::cancel):
270         (WebCore::CurlRequestScheduler::callOnWorkerThread):
271         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
272         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
273         (WebCore::CurlRequestScheduler::stopThread):
274         (WebCore::CurlRequestScheduler::updateJobList):
275         (WebCore::CurlRequestScheduler::workerThread):
276         * platform/network/curl/CurlRequestScheduler.h: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.h.
277         (WebCore::CurlRequestScheduler::~CurlRequestScheduler):
278         * platform/network/curl/CurlRequestSchedulerClient.h: Added.
279         (WebCore::CurlRequestSchedulerClient::~CurlRequestSchedulerClient):
280         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
281         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
282         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
283         (WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
284         * platform/network/curl/ResourceHandleCurlDelegate.h:
285
286 2017-10-26  Antti Koivisto  <antti@apple.com>
287
288         Remove unnecessary whitespace invalidation logic from RenderTreeUpdater
289         https://bugs.webkit.org/show_bug.cgi?id=178786
290
291         Reviewed by Zalan Bujtas.
292
293         RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded is a somewhat complex
294         and confusing function for figuring out if some whitespace-only text node might need to have its
295         rendering status recomputed. However actually computing if a text renderer is needed is not expensive.
296         We can simply do it for all whitespace nodes after a sibling mutation.
297
298         This also removes a set that could have stale renderer pointers in it (they were never dereferenced).
299
300         * rendering/RenderBlock.cpp:
301         (WebCore::RenderBlock::addChildIgnoringContinuation):
302
303             Fix a display:contents bug exposed by this change. With display:contents a text renderer may have an anonymous
304             inline wrapper and we need to take it into account when the text renderer is the beforeChild.
305
306             Tested by imported/w3c/web-platform-tests/css/css-display-3/display-contents-state-change-001.html
307
308         * style/RenderTreeUpdater.cpp:
309         (WebCore::RenderTreeUpdater::updateRenderTree):
310
311             Call updateTextRenderer() for all whitespace-only text nodes after a change in siblings.
312             In normal update case it just figures out quickly (by calling textRendererIsNeeded)
313             that there are no changes and bails out.
314
315         (WebCore::RenderTreeUpdater::updateElementRenderer):
316         (WebCore::RenderTreeUpdater::updateTextRenderer):
317         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.
318
319             No longer needed. Just mark that there have been changes to siblings instead.
320
321         * style/RenderTreeUpdater.h:
322
323 2017-10-26  Myles C. Maxfield  <mmaxfield@apple.com>
324
325         Mark font palettes as in development
326         https://bugs.webkit.org/show_bug.cgi?id=178590
327
328         Unreviewed.
329
330         * features.json:
331
332 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
333
334         Unreviewed, rolling out r223984.
335
336         Caused LayoutTest assertion failures.
337
338         Reverted changeset:
339
340         "When navigating back to a page, compositing layers may not
341         use accelerated drawing"
342         https://bugs.webkit.org/show_bug.cgi?id=178749
343         https://trac.webkit.org/changeset/223984
344
345 2017-10-26  Youenn Fablet  <youenn@apple.com>
346
347         Add inspector logging for MediaElementSession autoplay
348         https://bugs.webkit.org/show_bug.cgi?id=178846
349
350         Reviewed by Eric Carlson.
351
352         No change of behavior.
353         Making use of pal Logger in MediaElementSession.
354         This new logging is limited to autoplay/playback for now.
355
356         * html/MediaElementSession.cpp:
357         (WebCore::MediaElementSession::MediaElementSession):
358         (WebCore::MediaElementSession::playbackPermitted const):
359         (WebCore::MediaElementSession::autoplayPermitted const):
360         (WebCore::MediaElementSession::willLog const):
361         (WebCore::MediaElementSession::logChannel const):
362         * html/MediaElementSession.h:
363
364 2017-10-26  Keith Miller  <keith_miller@apple.com>
365
366         Move ApplePay to unified sources
367         https://bugs.webkit.org/show_bug.cgi?id=178871
368
369         Rubber-stamped by Tim Horton.
370
371         Also, add some other missing files.
372
373         * SourcesCocoa.txt:
374         * WebCore.xcodeproj/project.pbxproj:
375
376 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
377
378         Unreviewed, rolling out r224019.
379
380         This change caused API test WebKit.MSEIsPlayingAudio to time
381         out.
382
383         Reverted changeset:
384
385         "XMLHttpRequest should not treat file URLs as same origin"
386         https://bugs.webkit.org/show_bug.cgi?id=178565
387         https://trac.webkit.org/changeset/224019
388
389 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
390
391         Unreviewed, rolling out r223994.
392
393         The LayoutTest for this change is failing.
394
395         Reverted changeset:
396
397         "Add service worker handle fetch support for all subresource
398         requests"
399         https://bugs.webkit.org/show_bug.cgi?id=178769
400         https://trac.webkit.org/changeset/223994
401
402 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
403
404         Unreviewed, rolling out r223908.
405
406         Causes LayoutTest crashes with newer SDKs.
407
408         Reverted changeset:
409
410         "Adopt new secure coding APIs"
411         https://bugs.webkit.org/show_bug.cgi?id=178484
412         https://trac.webkit.org/changeset/223908
413
414 2017-10-25  Brent Fulgham  <bfulgham@apple.com>
415
416         XMLHttpRequest should not treat file URLs as same origin
417         https://bugs.webkit.org/show_bug.cgi?id=178565
418         <rdar://problem/11115901>
419
420         Reviewed by Ryosuke Niwa.
421
422         Do not treat file URLs as same-origin for XHR requests.
423
424         Test: fast/xmlhttprequest/xmlhttprequest-access-self-as-file.html
425
426         * loader/DocumentThreadableLoader.cpp:
427         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Use new helper method.
428         * page/SecurityOrigin.cpp:
429         (WebCore::SecurityOrigin::requestIsSameOrigin): New method to recognize same-origin
430         requests, with special handling for XHR.
431         * page/SecurityOrigin.h:
432
433 2017-10-26  Christopher Reid  <chris.reid@sony.com>
434
435         Remove scopeguard from platform
436         https://bugs.webkit.org/show_bug.cgi?id=178681
437
438         Reviewed by Brady Eidson.
439
440         Replacing platform/ScopeGuard with WTF::ScopeExit.
441         No new tests, no change in behavior.
442
443         * Modules/indexeddb/IDBRequest.cpp:
444         * Modules/indexeddb/IDBRequest.h:
445         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
446         * WebCore.xcodeproj/project.pbxproj:
447         * platform/FileSystem.cpp:
448         * platform/ScopeGuard.h: Removed.
449         * platform/network/BlobRegistryImpl.cpp:
450         * workers/service/ServiceWorkerContainer.cpp:
451
452 2017-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
453
454         REGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in line
455         https://bugs.webkit.org/show_bug.cgi?id=178625
456
457         Reviewed by Michael Catanzaro.
458
459         Once we find the first space, which has the COMMON script, we split the run, and the next ones keep using
460         COMMON instead of ARABIC because we don't update the current script on every loop iteration. This patch
461         simplifies the script handling by moving the code back to the loop and always breaking in case of different
462         scripts, correctly handling INHERITED and COMMON cases and updating the current script when needed.
463
464         Covered by existing tests. This improves several tests that have been rebaselined.
465
466         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
467         (WebCore::findNextRun):
468         (WebCore::scriptsAreCompatibleForCharacters): Deleted.
469
470 2017-10-26  Enrique Ocaña González  <eocanha@igalia.com>
471
472         [MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
473         https://bugs.webkit.org/show_bug.cgi?id=178819
474
475         Reviewed by Xabier Rodriguez-Calvar.
476
477         The deadlock may occur when UI thread tries to clear pipeline in
478         AppendPipeline::clearPlayerPrivate() while parser thread tries to change
479         pipeline state to pause holding the stream lock in
480         AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread()
481
482         This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
483
484         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
485         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
486         Return if there's no player private.
487
488 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
489
490         Assert that no script is executed during style recalc
491         https://bugs.webkit.org/show_bug.cgi?id=178845
492         <rdar://problem/35106129>
493
494         Reviewed by Antti Koivisto.
495
496         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
497         to make sure we don't start mutating DOM in the middle of a style update.
498
499         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
500         shadow tree since that happens while updating the style.
501
502         No new tests since there should be no behavioral change.
503
504         * dom/Document.cpp:
505         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
506         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
507         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
508         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
509         scripts which in turn trigger another (recursive) style recalc.
510         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
511         NoEventDispatchAssertion.
512         * dom/Element.cpp:
513         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
514         newly cloned element for SVG use element's shadow tree.
515         (WebCore::Element::cloneElementWithoutChildren): Ditto.
516         * dom/EventDispatcher.cpp:
517         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
518         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
519         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
520         pushing or popoing the stack frame.
521         * svg/SVGUseElement.cpp:
522         (WebCore::SVGUseElement::clearShadowTree):
523         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
524         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
525         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
526         (WebCore::SVGUseElement::cloneTarget const): Ditto.
527         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
528         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
529         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
530
531 2017-10-25  Keith Miller  <keith_miller@apple.com>
532
533         Move platform Cocoa sources to unified sources
534         https://bugs.webkit.org/show_bug.cgi?id=178851
535
536         Rubber-stamped by Tim Horton.
537
538         * SourcesCocoa.txt:
539         * WebCore.xcodeproj/project.pbxproj:
540
541 2017-10-25  Keith Miller  <keith_miller@apple.com>
542
543         Start moving Cocoa specific unified sources
544         https://bugs.webkit.org/show_bug.cgi?id=178850
545
546         Rubber-stamped by Tim Horton.
547
548         * PlatformMac.cmake:
549         * SourcesCocoa.txt:
550         * WebCore.xcodeproj/project.pbxproj:
551
552 2017-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
553
554         [HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
555         https://bugs.webkit.org/show_bug.cgi?id=178788
556
557         Reviewed by Michael Catanzaro.
558
559         Instead of using the TextRun direction. If the TextRun is ltr, but the harfbuzz buffer is rtl, the character
560         indexes will be swapped in m_coreTextIndices.
561
562         * platform/graphics/ComplexTextController.h:
563         (WebCore::ComplexTextController::ComplexTextRun::create): Remove the ltr parameter.
564         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
565         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_isLTR using hb_buffer_get_direction().
566         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Do not pass ltr to ComplexTextRun::create().
567
568 2017-10-25  Keith Miller  <keith_miller@apple.com>
569
570         Move remaining platform independent sources to unified sources
571         https://bugs.webkit.org/show_bug.cgi?id=178849
572
573         Rubber-stamped by Tim Horton.
574
575         * CMakeLists.txt:
576         * Sources.txt:
577         * WebCore.xcodeproj/project.pbxproj:
578
579 2017-10-25  Keith Miller  <keith_miller@apple.com>
580
581         Move plugins and rendering to unified sources
582         https://bugs.webkit.org/show_bug.cgi?id=178848
583
584         Rubber-stamped by Tim Horton.
585
586         * CMakeLists.txt:
587         * Sources.txt:
588         * WebCore.xcodeproj/project.pbxproj:
589
590 2017-10-25  Keith Miller  <keith_miller@apple.com>
591
592         Unreviewed, add FEMorphology.cpp back to the regular build after r224003.
593
594         * WebCore.xcodeproj/project.pbxproj:
595
596 2017-10-25  Keith Miller  <keith_miller@apple.com>
597
598         Unreviewed, Windows build fix.
599
600         * Sources.txt:
601
602 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
603
604         Web Inspector: provide a way to enable/disable event listeners
605         https://bugs.webkit.org/show_bug.cgi?id=177451
606         <rdar://problem/34994925>
607
608         Reviewed by Joseph Pecoraro.
609
610         Test: inspector/dom/setEventListenerDisabled.html
611
612         * dom/EventTarget.cpp:
613         (WebCore::EventTarget::fireEventListeners):
614         Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
615         callback will not be called.
616
617         * inspector/InspectorDOMAgent.h:
618         * inspector/InspectorDOMAgent.cpp:
619         (WebCore::InspectorDOMAgent::discardBindings):
620         (WebCore::InspectorDOMAgent::getEventListenersForNode):
621         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
622         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
623         (WebCore::InspectorDOMAgent::willRemoveEventListener):
624         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
625         Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
626         identifying event listeners so they can be referenced from the frontend. We only add items
627         to this mapping when `getEventListenersForNode` is called, as that is when EventListener
628         data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
629         for each EventListener until it is needed. Items are removed whenever an event listener is
630         removed or when the document changes.
631
632         * inspector/InspectorInstrumentation.h:
633         (WebCore::InspectorInstrumentation::isEventListenerDisabled):
634         * inspector/InspectorInstrumentation.cpp:
635         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
636         (WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
637         Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
638         actually exists. If not, don't dispatch an event to the frontend as nothing will change.
639
640 2017-10-25  Keith Miller  <keith_miller@apple.com>
641
642         Move Platform to unified sources.
643         https://bugs.webkit.org/show_bug.cgi?id=178829
644
645         Rubber-stamped by Tim Horton.
646
647         * CMakeLists.txt:
648         * Sources.txt:
649         * WebCore.xcodeproj/project.pbxproj:
650         * platform/Cursor.cpp:
651         * platform/sql/SQLiteDatabase.h:
652
653 2017-10-25  Chris Dumez  <cdumez@apple.com>
654
655         messageEvent.source can also be a ServiceWorker
656         https://bugs.webkit.org/show_bug.cgi?id=178839
657
658         Reviewed by Brady Eidson.
659
660         messageEvent.source can also be a ServiceWorker:
661         - https://html.spec.whatwg.org/multipage/comms.html#messageeventsource
662
663         This enables calling postMessage() from a ServiceWorker via Bug 178794.
664
665         * dom/MessageEvent.cpp:
666         (WebCore::MessageEvent::source const): Deleted.
667         * dom/MessageEvent.h:
668         * dom/MessageEvent.idl:
669
670 2017-10-25  Ryosuke Niwa  <rniwa@webkit.org>
671
672         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
673         https://bugs.webkit.org/show_bug.cgi?id=178715
674         <rdar://problem/35144665>
675
676         Reviewed by Brent Fulgham.
677
678         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
679         instead of in the middle of collecting a list of stylesheets.
680
681         * dom/Document.cpp:
682         (WebCore::Document::Document): Initialize the newly added timer.
683         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
684         handlers may be expecting to see the document after XSLT had been applied.
685         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
686         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
687         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
688         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
689         (WebCore::Document::applyXSLTransform): Deleted.
690         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
691         inline XSLT and it happens much earlier than implicitClose.
692         * dom/Document.h:
693         * dom/ProcessingInstruction.cpp:
694         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
695         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
696         function can be called from a non-script-resilient call stack.
697         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
698         * style/StyleScope.cpp:
699         (WebCore::Style::Scope::collectXSLTransforms): Added.
700         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
701         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
702         * style/StyleScope.h:
703         * xml/parser/XMLDocumentParserLibxml2.cpp:
704         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
705
706 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
707
708         Web Inspector: Canvas Tab: starting a second recording doesn't show red titlebar if the first recording was empty
709         https://bugs.webkit.org/show_bug.cgi?id=178805
710         <rdar://problem/35176303>
711
712         Reviewed by Brian Burg.
713
714         No new tests, updated existing tests.
715
716         * inspector/InspectorCanvasAgent.cpp:
717         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
718         If the recording was stopped and had no data, reset the CallTracingActive flag to false.
719
720 2017-10-25  Keith Miller  <keith_miller@apple.com>
721
722         Move html to unified sources
723         https://bugs.webkit.org/show_bug.cgi?id=178709
724
725         Reviewed by Alex Christensen.
726
727         * CMakeLists.txt:
728         * Sources.txt:
729         * WebCore.xcodeproj/project.pbxproj:
730
731 2017-10-25  Basuke Suzuki  <Basuke.Suzuki@sony.com>
732
733         [Curl] Delete temporally downloaded file when it cancelled
734         https://bugs.webkit.org/show_bug.cgi?id=134393
735
736         Reviewed by Alex Christensen.
737
738         * platform/network/curl/CurlRequest.cpp:
739         (WebCore::CurlRequest::didCancelTransfer):
740         (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
741         (WebCore::CurlRequest::closeDownloadFile):
742         (WebCore::CurlRequest::cleanupDownloadFile):
743         * platform/network/curl/CurlRequest.h:
744
745 2017-10-25  Youenn Fablet  <youenn@apple.com>
746
747         Add service worker handle fetch support for all subresource requests
748         https://bugs.webkit.org/show_bug.cgi?id=178769
749
750         Reviewed by Chris Dumez.
751
752         Test: http/tests/workers/service/image-fetch.https.html
753
754         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
755         Setting the selected service worker identifier for subresource only at the moment.
756
757         Testing is limited to images, future wpt tests should cover other subresource cases.
758
759         * loader/DocumentThreadableLoader.cpp:
760         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
761         * loader/cache/CachedResourceLoader.cpp:
762         (WebCore::CachedResourceLoader::prepareFetch):
763         * loader/cache/CachedResourceRequest.cpp:
764         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
765         * loader/cache/CachedResourceRequest.h:
766
767 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
768
769         Aliasing of text in CSS specs is blocky and ugly
770         https://bugs.webkit.org/show_bug.cgi?id=174946
771         rdar://problem/33594542
772
773         Reviewed by Dean Jackson.
774
775         The PaintedContentRequest relating to subpixel-antialiased text was failing to be
776         satisfied if the text content in a composited layer was nested inside descendant
777         RenderLayers, because RenderLayer::isVisuallyNonEmpty() returned early. If this
778         function is passed a request, we can't return until we've satisfied the request
779         (which triggers the checking of descendant layers).
780
781         Test: compositing/contents-format/subpixel-antialiased-nested-layer.html
782
783         * rendering/RenderLayer.cpp:
784         (WebCore::RenderLayer::calculateClipRects const):
785
786 2017-10-25  Chris Dumez  <cdumez@apple.com>
787
788         Unreviewed, add missing copyright header to ServiceWorkerClientType.idl.
789
790         * workers/service/ServiceWorkerClientType.idl:
791 =======
792         * platform/Cursor.cpp: Previously, excluded on iOS now wrapped in #if
793         * platform/sql/SQLiteDatabase.h: remove debugging data member from release builds.
794 >>>>>>> build fixes
795
796 2017-10-25  Chris Dumez  <cdumez@apple.com>
797
798         Make toJS() do the right thing for ServiceWorkerClient
799         https://bugs.webkit.org/show_bug.cgi?id=178816
800
801         Reviewed by Youenn Fablet.
802
803         Make toJS() do the right thing for ServiceWorkerClient. In particular,
804         it needs to construct a JSServiceWorkerWindowClient wrapper if the
805         implementation object is a ServiceWorkerWindowClient.
806
807         Also, ServiceWorkerClient does not need to be an ActiveDOMObject as
808         it does not have any long-running tasks. Make it a ContextDestructionObject
809         instead for now.
810
811         * CMakeLists.txt:
812         * DerivedSources.make:
813         * Sources.txt:
814         * WebCore.xcodeproj/project.pbxproj:
815         * workers/service/ServiceWorkerClient.cpp:
816         (WebCore::ServiceWorkerClient::postMessage):
817         * workers/service/ServiceWorkerClient.h:
818         (WebCore::ServiceWorkerClient::create):
819         * workers/service/ServiceWorkerClient.idl:
820         * workers/service/ServiceWorkerClientType.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
821         * workers/service/ServiceWorkerClientType.idl: Added.
822         * workers/service/ServiceWorkerClients.h:
823         * workers/service/ServiceWorkerClients.idl:
824
825 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
826
827         When navigating back to a page, compositing layers may not use accelerated drawing
828         https://bugs.webkit.org/show_bug.cgi?id=178749
829         rdar://problem/35158946
830
831         Reviewed by Dean Jackson.
832
833         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
834         occurred on back navigation, related to the ordering of style recalcs and layout.
835
836         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
837         its cacheAcceleratedCompositingFlags(), so any layers created during style update
838         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
839         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
840
841         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
842         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
843         the TileController.
844
845         Test: compositing/accelerated-layers-after-back.html
846
847         * page/FrameView.cpp:
848         (WebCore::FrameView::updateCompositingLayersAfterLayout):
849         * platform/graphics/ca/GraphicsLayerCA.cpp:
850         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
851         * rendering/RenderLayerCompositor.cpp:
852         (WebCore::RenderLayerCompositor::willRecalcStyle):
853         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
854         (WebCore::RenderLayerCompositor::updateCompositingLayers):
855         * rendering/RenderLayerCompositor.h:
856
857 2017-10-25  Youenn Fablet  <youenn@apple.com>
858
859         Enable ServiceWorker to fetch resources
860         https://bugs.webkit.org/show_bug.cgi?id=178673
861
862         Reviewed by Brady Eidson.
863
864         Test: http/tests/workers/service/service-worker-fetch.html
865
866         Allow reusing of EmptyFrameLoaderClient for network loading in WebKit Service Worker environment.
867         Allow overriding the creation of a document loader, pageID, frameID and sessionID getters.
868
869         Allow the possibility to create synthetic documents for all ports.
870
871         Beefing up ServiceWorkerThreadProxy as it owns a Document and a Page that do nothing but server
872         the purpose of loading resources for a service worker thread.
873
874         * WebCore.xcodeproj/project.pbxproj:
875         * loader/DocumentLoader.h:
876         (WebCore::DocumentLoader::setResponse):
877         * loader/EmptyClients.cpp:
878         (WebCore::EmptyFrameLoaderClient::sessionID const):
879         (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
880         (WebCore::createEmptyFrameNetworkingContext):
881         * loader/EmptyClients.h:
882         * loader/EmptyFrameLoaderClient.h: Added.
883         * loader/FrameLoader.cpp:
884         (WebCore::FrameLoader::initForSynthesizedDocument):
885         * loader/FrameLoader.h:
886         * loader/FrameLoaderClient.h:
887         * workers/service/context/ServiceWorkerThread.cpp:
888         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
889         (WebCore::m_workerObjectProxy):
890         * workers/service/context/ServiceWorkerThread.h:
891         * workers/service/context/ServiceWorkerThreadProxy.cpp:
892         (WebCore::ServiceWorkerThreadProxy::create):
893         (WebCore::createPageForServiceWorker):
894         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
895         (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
896         * workers/service/context/ServiceWorkerThreadProxy.h:
897         Test: http/tests/workers/service/service-worker-fetch.html
898
899 2017-10-25  Jer Noble  <jer.noble@apple.com>
900
901         UNPACK_FLIP_Y is broken for MSE-backed videos
902         https://bugs.webkit.org/show_bug.cgi?id=178774
903
904         Reviewed by Dean Jackson.
905
906         The global GLSL variable gl_Position can apparently only be set once, and any modifications
907         made after that initial set are ignored. So rather than implement flipping by changing
908         gl_Position.y, flip the texture coordinates instead.
909
910         Drive-by fix: some of the constants used in VideoTextureCopierCV are not defined on older
911         macOS versions, so make them optional.
912
913         Tests: fast/canvas/webgl/texImage2D-mse-flipY-false.html
914                fast/canvas/webgl/texImage2D-mse-flipY-true.html
915
916         * platform/graphics/cv/VideoTextureCopierCV.cpp:
917         (WebCore::transferFunctionFromString):
918         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
919         * platform/cocoa/CoreVideoSoftLink.cpp:
920         * platform/cocoa/CoreVideoSoftLink.h:
921
922 2017-10-25  Chris Dumez  <cdumez@apple.com>
923
924         [Service Worker] Add stubs for serviceWorkerClient.type
925         https://bugs.webkit.org/show_bug.cgi?id=178812
926
927         Reviewed by Youenn Fablet.
928
929         Add stubs for serviceWorkerClient.type to match the latest specification:
930         - https://w3c.github.io/ServiceWorker/#enumdef-clienttype
931
932         * CMakeLists.txt:
933         * DerivedSources.make:
934         * Sources.txt:
935         * WebCore.xcodeproj/project.pbxproj:
936         * workers/service/ServiceWorkerClient.cpp:
937         (WebCore::ServiceWorkerClient::type const):
938         * workers/service/ServiceWorkerClient.h:
939         * workers/service/ServiceWorkerClient.idl:
940         * workers/service/ServiceWorkerClientType.h: Added.
941         * workers/service/ServiceWorkerClientType.idl: Added.
942         * workers/service/ServiceWorkerClients.h:
943         * workers/service/ServiceWorkerClients.idl:
944
945 2017-10-24  Keith Miller  <keith_miller@apple.com>
946
947         Move mathml and page to unified souces
948         https://bugs.webkit.org/show_bug.cgi?id=178770
949
950         Rubber-stamped by Tim Horton.
951
952         * CMakeLists.txt:
953         * Sources.txt:
954         * WebCore.xcodeproj/project.pbxproj:
955
956 2017-10-25  Fujii Hironori  <Hironori.Fujii@sony.com>
957
958         fast/images/animated-gif-paint-after-animation.html flaky crash
959         https://bugs.webkit.org/show_bug.cgi?id=178510
960
961         Reviewed by Said Abou-Hallawa.
962
963         ScalableImageDecoder was accessed from the main thread and the
964         image decoding thread without a mutex.
965
966         No new tests because there is no behavior change.
967
968         * platform/image-decoders/ScalableImageDecoder.h: Add m_mutex. Lock the mutex in setData.
969         * platform/image-decoders/ScalableImageDecoder.cpp:
970         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): Lock the mutex.
971         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): Ditto.
972         (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
973         (WebCore::ScalableImageDecoder::frameDurationAtIndex const): Ditto.
974         (WebCore::ScalableImageDecoder::createFrameImageAtIndex): Ditto.
975
976 2017-10-25  Chris Dumez  <cdumez@apple.com>
977
978         Add support for unregistering a service worker
979         https://bugs.webkit.org/show_bug.cgi?id=178735
980
981         Reviewed by Brady Eidson.
982
983         Add support for unregistering a service worker:
984         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister
985
986         Test: http/tests/workers/service/basic-unregister.https.html
987
988         * workers/service/ServiceWorkerContainer.cpp:
989         (WebCore::ServiceWorkerContainer::addRegistration):
990         (WebCore::ServiceWorkerContainer::removeRegistration):
991         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
992         * workers/service/ServiceWorkerContainer.h:
993         * workers/service/ServiceWorkerJob.cpp:
994         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
995         * workers/service/ServiceWorkerJob.h:
996         * workers/service/ServiceWorkerJobClient.h:
997         * workers/service/ServiceWorkerJobData.h:
998         (WebCore::ServiceWorkerJobData::encode const):
999         (WebCore::ServiceWorkerJobData::decode):
1000         * workers/service/ServiceWorkerJobType.h:
1001         * workers/service/ServiceWorkerRegistration.cpp:
1002         (WebCore::containerForScriptExecutionContext):
1003         (WebCore::ServiceWorkerRegistration::unregister):
1004         * workers/service/server/SWClientConnection.cpp:
1005         (WebCore::SWClientConnection::registrationJobResolvedInServer):
1006         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
1007         * workers/service/server/SWClientConnection.h:
1008         * workers/service/server/SWServer.cpp:
1009         (WebCore::SWServer::resolveRegistationJob):
1010         (WebCore::SWServer::resolveUnregistrationJob):
1011         * workers/service/server/SWServer.h:
1012         * workers/service/server/SWServerRegistration.cpp:
1013         (WebCore::SWServerRegistration::scriptContextStarted):
1014         (WebCore::SWServerRegistration::startNextJob):
1015         (WebCore::SWServerRegistration::runUnregisterJob):
1016         (WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
1017         (WebCore::SWServerRegistration::resolveWithUnregistrationResultOnMainThread):
1018         (WebCore::SWServerRegistration::resolveCurrentRegistrationJob):
1019         (WebCore::SWServerRegistration::resolveCurrentUnregistrationJob):
1020         * workers/service/server/SWServerRegistration.h:
1021
1022 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
1023
1024         MediaSessionManager* needs to catch Obj-C exceptions
1025         https://bugs.webkit.org/show_bug.cgi?id=178813
1026
1027         Reviewed by Tim Horton.
1028
1029         Wrap all calls out to Objective-C with BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS.
1030
1031         * platform/audio/ios/MediaSessionManagerIOS.mm:
1032         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
1033         (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
1034         (WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
1035         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
1036         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
1037         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
1038         (-[WebMediaSessionHelper allocateVolumeView]):
1039         (-[WebMediaSessionHelper initWithCallback:]):
1040         * platform/audio/mac/MediaSessionManagerMac.mm:
1041         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
1042
1043 2017-10-25  Andy Estes  <aestes@apple.com>
1044
1045         [Payment Request] Implement the "user aborts the payment request" algorithm
1046         https://bugs.webkit.org/show_bug.cgi?id=178810
1047
1048         Reviewed by Tim Horton.
1049
1050         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1051         (WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
1052         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1053         * Modules/paymentrequest/PaymentRequest.cpp:
1054         (WebCore::PaymentRequest::cancel):
1055         * Modules/paymentrequest/PaymentRequest.h:
1056         * testing/MockPaymentCoordinator.cpp:
1057         (WebCore::MockPaymentCoordinator::cancelPayment):
1058         * testing/MockPaymentCoordinator.h:
1059         * testing/MockPaymentCoordinator.idl:
1060
1061 2017-10-25  Jer Noble  <jer.noble@apple.com>
1062
1063         Autoplay muted videos still stop playback of other streaming apps in the background
1064         https://bugs.webkit.org/show_bug.cgi?id=177920
1065
1066         Reviewed by Eric Carlson.
1067
1068         When creating a new <video> or <audio> element, the global AudioSession can sometimes have
1069         its sessionCategory() set to "MediaPlayback", even if the element does not yet have a
1070         source. This is because the constructor for the MediaElementSession is called before
1071         m_isPlayingToWirelessTarget is initialized, and so in the MediaElementSession constructor,
1072         the media element's m_isPlayingToWirelessTarget ivar is sometimes (uninitialized) true.
1073
1074         We could move the MediaElementSession ivar to the very end of the header, so it's
1075         initialized last, but that still leaves the possibility of the MediaElementSession et. all
1076         calling into the HTMLMediaElement before it's subclass's constructors have a chance to
1077         initialize their own ivars (much less their vtables). So instead, we'll create and set the
1078         MediaElementSession in a finishInitialization() method called from the HTMLVideoElement and
1079         HTMLAudioElement's create() factory methods.
1080
1081         * html/HTMLAudioElement.cpp:
1082         (WebCore::HTMLAudioElement::create):
1083         * html/HTMLMediaElement.cpp:
1084         (WebCore::HTMLMediaElement::HTMLMediaElement):
1085         (WebCore::HTMLMediaElement::finishInitialization):
1086         * html/HTMLMediaElement.h:
1087         * html/HTMLVideoElement.cpp:
1088         (WebCore::HTMLVideoElement::create):
1089
1090 2017-10-25  Javier Fernandez  <jfernandez@igalia.com>
1091
1092         [css-grid] Avoid clearing the overrideContainingBlockWidth if possible
1093         https://bugs.webkit.org/show_bug.cgi?id=178260
1094
1095         Reviewed by Sergio Villar Senin.
1096
1097         Since the intrinsic width computation uses the same logic than the
1098         track sizing algorithm we are clearing the overrideContainingBlockWidth
1099         of some grid items that are required to laid out them properly.
1100
1101         It's very uncommon that any intrinsic size computation isn't performed
1102         as part of a layout process. However, if it happens, once cleared the
1103         overrideContainingBlockWidth it may lead to an incorrect layout of the
1104         affected grid items.
1105
1106         This change is a defensive approach to avoid the issues caused by
1107         such off-layout preferred size requests, which may imply recomputing
1108         the grid container intrinsic size.
1109
1110         No new tests, because we are only removing some redundant logic.
1111
1112         * rendering/GridTrackSizingAlgorithm.cpp:
1113         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
1114         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
1115         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1116         (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
1117         (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
1118         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
1119         * rendering/GridTrackSizingAlgorithm.h:
1120
1121 2017-10-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1122
1123         Unreviewed follow up changing one more enum value as discussed in the bug
1124         https://bugs.webkit.org/show_bug.cgi?id=177810
1125
1126         * platform/glib/LowPowerModeNotifierGLib.cpp:
1127         (WebCore::LowPowerModeNotifier::updateState): use NONE instead of DISCHARGING, to ensure
1128         it will build even with older upower.
1129
1130 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
1131
1132         Make SERVICE_WORKER feature buildable on GTK, WPE
1133         https://bugs.webkit.org/show_bug.cgi?id=178574
1134
1135         Reviewed by Carlos Garcia Campos.
1136
1137         * CMakeLists.txt: Add missing include paths and files to the build.
1138         * Sources.txt: Add missing files to the build.
1139         * WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
1140         JSFetchEventCustom.cpp targets, they're now built via unified sources.
1141         * bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
1142         with the ENABLE(SERVICE_WORKER) guards.
1143
1144 2017-10-24  Alejandro G. Castro  <alex@igalia.com>
1145
1146         Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
1147         https://bugs.webkit.org/show_bug.cgi?id=178721
1148
1149         Reviewed by Youenn Fablet.
1150
1151         Assert when we reach those situations and return some value after that to avoid warning.
1152
1153         No new tests, this is a clean up.
1154
1155         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1156         (WebCore::sessionDescriptionType):
1157         (WebCore::signalingState):
1158         (WebCore::toRTCIceConnectionState):
1159         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1160         (WebCore::bundlePolicyfromConfiguration):
1161         (WebCore::iceTransportPolicyfromConfiguration):
1162
1163 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
1164
1165         RenderSVGModelObject::checkIntersection triggers layout
1166         https://bugs.webkit.org/show_bug.cgi?id=178710
1167
1168         Reviewed by Simon Fraser.
1169
1170         Fixed the bug that checkIntersection and checkEnclosure no longer updates the layout after r223882.
1171
1172         Test: svg/custom/check-intersection-basic.svg
1173
1174         * svg/SVGSVGElement.cpp:
1175         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
1176         (WebCore::SVGSVGElement::checkIntersection):
1177         (WebCore::SVGSVGElement::checkEnclosure):
1178         * svg/SVGSVGElement.h:
1179
1180 2017-10-24  Andy Estes  <aestes@apple.com>
1181
1182         [Apple Pay] Implement a paymentmethodselected event for PaymentRequest
1183         https://bugs.webkit.org/show_bug.cgi?id=178765
1184
1185         Reviewed by Tim Horton.
1186
1187         When the Apple Pay payment method changes, fire an applepaypaymentmethodchanged event on the
1188         PaymentRequest object. The event has a paymentMethod property and an updateWith() method
1189         which behaves identically to PaymentRequestUpdateEvent.updateWith().
1190
1191         Test: http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html
1192
1193         * DerivedSources.make:
1194         * Modules/applepay/ApplePayPaymentMethod.idl:
1195         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
1196         * Modules/applepay/PaymentMethod.h:
1197         (WebCore::PaymentMethod::PaymentMethod): Deleted.
1198         (WebCore::PaymentMethod::pkPaymentMethod const): Deleted.
1199         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1200         (WebCore::ApplePayPaymentHandler::detailsUpdated):
1201         (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
1202         (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
1203         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1204         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Added.
1205         (WebCore::ApplePayPaymentMethodUpdateEvent::ApplePayPaymentMethodUpdateEvent):
1206         (WebCore::ApplePayPaymentMethodUpdateEvent::eventInterface const):
1207         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Added.
1208         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl: Added.
1209         * Modules/paymentrequest/PaymentHandler.h:
1210         * Modules/paymentrequest/PaymentRequest.cpp:
1211         (WebCore::PaymentRequest::shippingAddressChanged):
1212         (WebCore::PaymentRequest::shippingOptionChanged):
1213         (WebCore::PaymentRequest::dispatchEvent):
1214         (WebCore::PaymentRequest::updateWith):
1215         (WebCore::PaymentRequest::settleDetailsPromise):
1216         (WebCore::PaymentRequest::dispatchUpdateEvent): Deleted.
1217         * Modules/paymentrequest/PaymentRequest.h:
1218         * Modules/paymentrequest/PaymentRequest.idl:
1219         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
1220         (WebCore::PaymentRequestUpdateEvent::updateWith):
1221         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
1222         * WebCore.xcodeproj/project.pbxproj:
1223         * dom/EventNames.h:
1224         * dom/EventNames.in:
1225         * testing/MockPaymentCoordinator.cpp:
1226         (WebCore::MockPaymentCoordinator::changePaymentMethod):
1227         * testing/MockPaymentCoordinator.h:
1228         * testing/MockPaymentCoordinator.idl:
1229         * testing/MockPaymentMethod.h: Added.
1230
1231 2017-10-24  Youenn Fablet  <youenn@apple.com>
1232
1233         ServiceWorkerClientFetch should return an error that is not null in case of failure
1234         https://bugs.webkit.org/show_bug.cgi?id=178761
1235
1236         Reviewed by Geoffrey Garen.
1237
1238         Covered by existing tests.
1239
1240         As per spec, ServiceWorkerJob should not go through Service Worker Handle Fetch
1241         for fetching scripts.
1242
1243         * workers/WorkerScriptLoader.cpp:
1244         (WebCore::WorkerScriptLoader::loadAsynchronously):
1245         * workers/WorkerScriptLoaderClient.h:
1246         (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const):
1247         * workers/service/ServiceWorkerJob.h:
1248
1249 2017-10-24  Keith Miller  <keith_miller@apple.com>
1250
1251         Move inspector and loader to unified sources.
1252         https://bugs.webkit.org/show_bug.cgi?id=178760
1253
1254         Rubber-stamped by Tim Horton.
1255
1256         * CMakeLists.txt:
1257         * Sources.txt:
1258         * WebCore.xcodeproj/project.pbxproj:
1259
1260 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1261
1262         Fix build after r223940
1263
1264         * inspector/WebConsoleAgent.cpp:
1265
1266 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1267
1268         Fix Windows build after r223929.
1269         https://bugs.webkit.org/show_bug.cgi?id=177027
1270
1271         * inspector/WebConsoleAgent.cpp:
1272         (WebCore::WebConsoleAgent::getLoggingChannels):
1273         Always initialize the variable "level".  Visual studio was complaining about the possibility of not initializing it
1274         but this is only possible if logChannel->level is an invalid enum value.
1275
1276 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1277
1278         Fix Windows build after r223925
1279         https://bugs.webkit.org/show_bug.cgi?id=178687
1280
1281         * html/ImageBitmap.cpp:
1282         (WebCore::interpolationQualityForResizeQuality):
1283         Visual Studio was complaining that not all control paths returned a value.
1284
1285 2017-10-24  Youenn Fablet  <youenn@apple.com>
1286
1287         Enable service worker to use cache storage api
1288         https://bugs.webkit.org/show_bug.cgi?id=178684
1289
1290         Reviewed by Brady Eidson.
1291
1292         Test: http/tests/workers/service/service-worker-cache-api.https.html
1293
1294         Updated WorkerLoaderProxy so that it can create a CacheStorageConnection.
1295         Update WorkerCacheStorageConnection to take benefit of that.
1296         This allows creating a CacheStorageConnection based on the page for regular workers and differently for Service Worker context.
1297
1298         Added ServiceWorkerThreadProxy as a proxy to ServiceWorkerThread.
1299         It is in particular responsible to do proxy for loading tasks.
1300         It implements cache API support for service worker by creating a dedicated CacheStorageConnection.
1301
1302         * Modules/cache/WorkerCacheStorageConnection.cpp:
1303         (WebCore::WorkerCacheStorageConnection::create):
1304         (WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
1305         (WebCore::WorkerCacheStorageConnection::doOpen):
1306         (WebCore::WorkerCacheStorageConnection::doRemove):
1307         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
1308         (WebCore::WorkerCacheStorageConnection::reference):
1309         (WebCore::WorkerCacheStorageConnection::dereference):
1310         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
1311         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
1312         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
1313         * WebCore.xcodeproj/project.pbxproj:
1314         * workers/WorkerLoaderProxy.h:
1315         * workers/WorkerMessagingProxy.cpp:
1316         (WebCore::WorkerMessagingProxy::createCacheStorageConnection):
1317         * workers/WorkerMessagingProxy.h:
1318         * workers/service/context/ServiceWorkerThread.cpp:
1319         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1320         * workers/service/context/ServiceWorkerThread.h:
1321         * workers/service/context/ServiceWorkerThreadProxy.cpp: Added.
1322         (WebCore::ServiceWorkerThreadProxy::create):
1323         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1324         (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
1325         (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
1326         (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
1327         * workers/service/context/ServiceWorkerThreadProxy.h: Added.
1328
1329 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1330
1331         Optionally store entire ResourceRequest for ping loads
1332         https://bugs.webkit.org/show_bug.cgi?id=178756
1333
1334         Reviewed by Tim Horton.
1335
1336         No change in behavior.
1337         This uses less memory in the common loading case.
1338         This will be needed for moving appcache loading to the Networking Process.
1339         See https://bugs.webkit.org/show_bug.cgi?id=178540
1340
1341         * loader/cache/CachedResource.cpp:
1342         (WebCore::CachedResource::load):
1343         * loader/cache/CachedResource.h:
1344         (WebCore::CachedResource::setOriginalRequest):
1345         (WebCore::CachedResource::originalRequest const):
1346         (WebCore::CachedResource::setOriginalRequestHeaders): Deleted.
1347         * loader/cache/CachedResourceLoader.cpp:
1348         (WebCore::CachedResourceLoader::requestResource):
1349
1350 2017-10-24  Andy Estes  <aestes@apple.com>
1351
1352         [WebIDL] Support the ExportMacro attribute for dictionaries
1353         https://bugs.webkit.org/show_bug.cgi?id=178752
1354
1355         Reviewed by Sam Weinig.
1356
1357         * bindings/scripts/CodeGeneratorJS.pm:
1358         (GenerateDictionaryHeaderContent):
1359         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1360         * bindings/scripts/test/TestStandaloneDictionary.idl:
1361
1362 2017-10-24  Eric Carlson  <eric.carlson@apple.com>
1363
1364         Web Inspector: Enable WebKit logging configuration and display
1365         https://bugs.webkit.org/show_bug.cgi?id=177027
1366         <rdar://problem/33964767>
1367
1368         Reviewed by Joseph Pecoraro.
1369
1370         Test: inspector/console/webcore-logging.html
1371
1372         * dom/Document.cpp:
1373         (WebCore::Document::~Document): Stop observing the logger.
1374         (WebCore::Document::logger): Observe the logger.
1375         (WebCore::Document::didLogMessage): Forward logging messages to the inspector.
1376         * dom/Document.h:
1377
1378         * inspector/WebConsoleAgent.cpp:
1379         (WebCore::WebConsoleAgent::getLoggingChannels): New, return the state of log runtime channels.
1380         (WebCore::WebConsoleAgent::setLoggingChannelLevel): New, set the state of a channel.
1381         * inspector/WebConsoleAgent.h:
1382
1383         * platform/Logging.cpp:
1384         (WebCore::getLogChannel): New, get a log channel by name.
1385         * platform/Logging.h:
1386
1387 2017-10-24  Dean Jackson  <dino@apple.com>
1388
1389         Attempted build fix for Sierra.
1390
1391         * html/ImageBitmap.cpp:
1392         (WebCore::croppedSourceRectangleWithFormatting):
1393
1394 2017-10-24  Dean Jackson  <dino@apple.com>
1395
1396         Implement resizing options for ImageBitmap rendering
1397         https://bugs.webkit.org/show_bug.cgi?id=178687
1398         <rdar://problem/35135417>
1399
1400         Reviewed by Sam Weinig.
1401
1402         Implement many of the sizing options for createImageBitmap.
1403
1404         Test: http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html
1405
1406         * html/ImageBitmap.cpp:
1407         (WebCore::croppedSourceRectangleWithFormatting):
1408
1409             Implement the first bit of the algorithm from
1410             the HTML specification.
1411
1412         (WebCore::outputSizeForSourceRectangle):
1413
1414             ... and then the second bit. Leave the rest in
1415             comments for now.
1416
1417         (WebCore::interpolationQualityForResizeQuality):
1418
1419             Helper function to map ImageBitmapOptions to
1420             GraphicsContext.
1421
1422         (WebCore::ImageBitmap::createPromise):
1423
1424             Implement more of the sizing algorithm.
1425
1426         * html/ImageBitmap.h: Origin tainting is defined to be false by default.
1427
1428 2017-10-24  Chris Dumez  <cdumez@apple.com>
1429
1430         Add initial implementation for serviceWorker.postMessage()
1431         https://bugs.webkit.org/show_bug.cgi?id=178534
1432
1433         Reviewed by Youenn Fablet.
1434
1435         Add initial implementation for serviceWorker.postMessage():
1436         - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
1437
1438         Test: http/tests/workers/service/basic-ServiceWorker-postMessage.https.html
1439
1440         * CMakeLists.txt:
1441         * DerivedSources.make:
1442         * Sources.txt:
1443         * WebCore.xcodeproj/project.pbxproj:
1444         * bindings/js/JSBindingsAllInOne.cpp:
1445         * bindings/js/JSExtendableMessageEvent.cpp: Added.
1446         (WebCore::JSExtendableMessageEvent::data const):
1447         * bindings/js/WebCoreBuiltinNames.h:
1448         * dom/Document.h:
1449         * dom/EventNames.in:
1450         * dom/MessagePortChannel.h:
1451         * dom/ScriptExecutionContext.h:
1452         * workers/WorkerGlobalScope.h:
1453         * workers/service/ExtendableEvent.cpp:
1454         (WebCore::ExtendableEvent::ExtendableEvent):
1455         (WebCore::ExtendableEvent::~ExtendableEvent):
1456         * workers/service/ExtendableEvent.h:
1457         * workers/service/ExtendableMessageEvent.cpp: Added.
1458         (WebCore::ExtendableMessageEvent::create):
1459         (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
1460         (WebCore::ExtendableMessageEvent::~ExtendableMessageEvent):
1461         * workers/service/ExtendableMessageEvent.h: Added.
1462         * workers/service/ExtendableMessageEvent.idl: Added.
1463         * workers/service/ServiceWorker.cpp:
1464         (WebCore::ServiceWorker::ServiceWorker):
1465         (WebCore::ServiceWorker::postMessage):
1466         (WebCore::ServiceWorker::state const):
1467         (WebCore::ServiceWorker::scriptExecutionContext const):
1468         * workers/service/ServiceWorker.h:
1469         * workers/service/ServiceWorkerContainer.cpp:
1470         (WebCore::ServiceWorkerContainer::controller const):
1471         * workers/service/ServiceWorkerContainer.h:
1472         * workers/service/ServiceWorkerGlobalScope.cpp:
1473         (WebCore::ServiceWorkerGlobalScope::thread):
1474         * workers/service/ServiceWorkerGlobalScope.h:
1475         (isType):
1476         * workers/service/context/ServiceWorkerThread.cpp:
1477         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
1478         * workers/service/context/ServiceWorkerThread.h:
1479         * workers/service/server/SWClientConnection.h:
1480
1481 2017-10-24  Andy Estes  <aestes@apple.com>
1482
1483         [Payment Request] Implement the "PaymentRequest updated" algorithm
1484         https://bugs.webkit.org/show_bug.cgi?id=178689
1485
1486         Reviewed by Alex Christensen.
1487
1488         Implemented the "PaymentRequest updated" algorithm by firing shippingaddresschange and
1489         shippingoptionchange events at the right times and implementing
1490         PaymentRequestUpdateEvent.updateWith().
1491
1492         Tests: http/tests/paymentrequest/payment-request-change-shipping-address.https.html
1493                http/tests/paymentrequest/payment-request-change-shipping-option.https.html
1494                http/tests/paymentrequest/updateWith-method-pmi-handling.https.html
1495
1496         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1497         (WebCore::convertAndValidate): Added. Converts a PaymentDetailsInit to a
1498         ApplePaySessionPaymentRequest::TotalAndLineItems.
1499         (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Created a ShippingContactUpdate
1500         and passed it to PaymentCoordinator::completeShippingContactSelection().
1501         (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): Created a ShippingMethodUpdate and
1502         passed it to PaymentCoordinator::completeShippingMethodSelection().
1503         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1504         * Modules/paymentrequest/PaymentHandler.h:
1505         * Modules/paymentrequest/PaymentRequest.cpp:
1506         (WebCore::checkAndCanonicalizeDetails): Moved the logic for checking and canonicalizing a
1507         PaymentDetailsBase from PaymentRequest::create() to here.
1508         (WebCore::PaymentRequest::create): Called checkAndCanonicalizeDetails().
1509         (WebCore::PaymentRequest::abortWithException): Moved the body of stop() to here and
1510         parameterized the Exception with which to abort m_showPromise.
1511         (WebCore::PaymentRequest::stop): Called abortWithException() with an AbortError.
1512         (WebCore::PaymentRequest::shippingAddressChanged): Called dispatchUpdateEvent() with
1513         shippingaddresschangeEvent.
1514         (WebCore::PaymentRequest::shippingOptionChanged): Ditto with shippingoptionchangeEvent.
1515         (WebCore::PaymentRequest::dispatchUpdateEvent): Created a PaymentRequestUpdateEvent and
1516         dispatched it.
1517         (WebCore::PaymentRequest::updateWith): Added a settle handler to m_detailsPromise.
1518         (WebCore::PaymentRequest::settleDetailsPromise): Updated the PaymentRequest with the new
1519         details and called PaymentHandler::shippingAddressUpdated() or
1520         PaymentHandler::shippingOptionUpdated().
1521         * Modules/paymentrequest/PaymentRequest.h:
1522         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
1523         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
1524         (WebCore::PaymentRequestUpdateEvent::updateWith): Called PaymentRequest::updateWith().
1525         (WebCore::PaymentRequestUpdateEvent::eventInterface const): Returned
1526         PaymentRequestUpdateEventInterfaceType.
1527         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
1528         * Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
1529         * testing/MockPaymentCoordinator.cpp:
1530         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
1531         (WebCore::MockPaymentCoordinator::openPaymentSetup):
1532         (WebCore::MockPaymentCoordinator::completeMerchantValidation): Stopped calling
1533         PaymentCoordinator::didAuthorizePayment().
1534         (WebCore::MockPaymentCoordinator::changeShippingOption): Called
1535         PaymentCoordinator::didSelectShippingMethod().
1536         (WebCore::MockPaymentCoordinator::acceptPayment): Called
1537         PaymentCoordinator::didAuthorizePayment().
1538         * testing/MockPaymentCoordinator.h:
1539         * testing/MockPaymentCoordinator.idl:
1540
1541 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1542
1543         Apply custom header fields from WebsitePolicies to same-domain requests
1544         https://bugs.webkit.org/show_bug.cgi?id=178356
1545         <rdar://problem/31073436>
1546
1547         Reviewed by Brady Eidson.
1548
1549         Covered by new API tests.
1550
1551         * loader/cache/CachedResourceLoader.cpp:
1552         (WebCore::CachedResourceLoader::requestResource):
1553         * platform/network/ResourceRequestBase.cpp:
1554         (WebCore::ResourceRequestBase::setCachePolicy):
1555         (WebCore::ResourceRequestBase::setTimeoutInterval):
1556         (WebCore::ResourceRequestBase::setHTTPMethod):
1557         (WebCore::ResourceRequestBase::setHTTPHeaderField):
1558         (WebCore::ResourceRequestBase::clearHTTPAuthorization):
1559         (WebCore::ResourceRequestBase::clearHTTPContentType):
1560         (WebCore::ResourceRequestBase::clearHTTPReferrer):
1561         (WebCore::ResourceRequestBase::clearHTTPOrigin):
1562         (WebCore::ResourceRequestBase::clearHTTPUserAgent):
1563         (WebCore::ResourceRequestBase::clearHTTPAccept):
1564         (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
1565         (WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
1566         (WebCore::ResourceRequestBase::setHTTPBody):
1567         (WebCore::ResourceRequestBase::setAllowCookies):
1568         (WebCore::ResourceRequestBase::setPriority):
1569         (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
1570         (WebCore::ResourceRequestBase::addHTTPHeaderField):
1571         (WebCore::ResourceRequestBase::setHTTPHeaderFields):
1572         If we only update the platform request when headers are added (or other changes) for HTTP requests,
1573         then the changes will not affect the NSURLRequest that is sent over IPC or visible to the API.
1574         This is necessary for these new tests to work, but it's also of growing importance since our
1575         introduction of WKURLSchemeHandler.
1576
1577 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
1578
1579         Adopt new secure coding APIs
1580         https://bugs.webkit.org/show_bug.cgi?id=178484
1581         <rdar://problem/34837193>
1582
1583         Reviewed by Tim Horton.
1584
1585         Switch to new NSKeyed[Un]Archiver methods that active and use
1586         NSSecureCoding by default.
1587
1588         Most of the new API is wrapped in a set of convenience methods so we can
1589         build without the new API on older systems.
1590
1591         No change in behavior.
1592
1593         * editing/cocoa/EditorCocoa.mm:
1594         (WebCore::archivedDataForAttributedString): Use new convenience method
1595         to archive the string object.
1596         * loader/archive/cf/LegacyWebArchiveMac.mm:
1597         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
1598         use secure coding where possible.
1599         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
1600         * platform/ios/PlatformPasteboardIOS.mm:
1601         (WebCore::PlatformPasteboard::write): Use new secure API.
1602         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
1603         * testing/cocoa/WebArchiveDumpSupport.mm:
1604         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
1605         secure coding API where possible.
1606
1607 2017-10-24  Jeremy Jones  <jeremyj@apple.com>
1608
1609         HTMLMediaElement should iterate HTMLTrackElements consistently.
1610         https://bugs.webkit.org/show_bug.cgi?id=178423
1611         rdar://problem/35044967
1612
1613         Reviewed by Eric Carlson.
1614
1615         No new tests because no expected behavior change.
1616
1617         HTMLMediaElement iterates HTMLTrackElements as children in every place but one, where it iterates them
1618         as descendants. It should always iterate them as children.
1619
1620         * html/HTMLMediaElement.cpp:
1621         (WebCore::HTMLMediaElement::finishParsingChildren):
1622
1623 2017-10-24  Chris Dumez  <cdumez@apple.com>
1624
1625         SerializedScriptValue::deserialize() should take ports as a const Vector&
1626         https://bugs.webkit.org/show_bug.cgi?id=178727
1627
1628         Reviewed by Alex Christensen.
1629
1630         SerializedScriptValue::deserialize() should take ports as a const Vector&, not a Vector&.
1631         It does not modify the input vector.
1632
1633         * bindings/js/JSMessageEventCustom.cpp:
1634         (WebCore::JSMessageEvent::data const):
1635         * bindings/js/SerializedScriptValue.cpp:
1636         (WebCore::CloneDeserializer::deserialize):
1637         (WebCore::CloneDeserializer::CloneDeserializer):
1638         (WebCore::SerializedScriptValue::deserialize):
1639         * bindings/js/SerializedScriptValue.h:
1640
1641 2017-10-24  Konstantin Tokarev  <annulen@yandex.ru>
1642
1643         [MediaFoundation] Videos are always autoplaying for local files
1644         https://bugs.webkit.org/show_bug.cgi?id=178693
1645
1646         Patch by Doug Massay.
1647         Reviewed by Alex Christensen.
1648
1649         r199114 fixes autoplay issue only if starting session invokes
1650         buffering stage. However when local files are played, onBufferingStarted
1651         and onBufferingStopped are not called, and video is not paused.
1652
1653         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1654         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
1655         (WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
1656         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1657
1658 2017-10-24  Matt Lewis  <jlewis3@apple.com>
1659
1660         Unreviewed, rolling out r223889.
1661
1662         This caused multiple crashes on all platforms
1663
1664         Reverted changeset:
1665
1666         "Adopt new secure coding APIs"
1667         https://bugs.webkit.org/show_bug.cgi?id=178484
1668         https://trac.webkit.org/changeset/223889
1669
1670 2017-10-24  Antti Koivisto  <antti@apple.com>
1671
1672         Create inline wrappers for before/after pseudo elements that have display:contents
1673         https://bugs.webkit.org/show_bug.cgi?id=178722
1674
1675         Reviewed by Ryosuke Niwa.
1676
1677         We can handle before and after pseudo elements with display:contents by giving them
1678         inline renderers with style inherited from display:contents style. This removes
1679         need for complicated logic for this case and handles everything correctly.
1680
1681         This is a better approach and replaces the one taken in bug 178584.
1682         It also fixes two display:contents WPTs.
1683
1684         * dom/PseudoElement.h:
1685
1686             There is no need to track content renderers separately anymore. They always descendants of
1687             pseudo element's renderer (which is an inline wrapper in case of display:contents).
1688
1689         * rendering/style/RenderStyle.cpp:
1690         (WebCore::RenderStyle::copyContentFrom):
1691         * rendering/style/RenderStyle.h:
1692         * style/RenderTreeUpdaterGeneratedContent.cpp:
1693         (WebCore::createContentRenderers):
1694         (WebCore::updateStyleForContentRenderers):
1695         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1696         (WebCore::removeAndDestroyContentRenderers): Deleted.
1697
1698             Since content renderers are now always descendants of the pseudo renderer
1699             there is no need for a separate destruction path.
1700
1701         * style/StyleTreeResolver.cpp:
1702         (WebCore::Style::TreeResolver::resolvePseudoStyle):
1703
1704             Create ElementUpdate with a style that will produce an inline wrapper.
1705
1706 2017-10-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1707
1708         [iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
1709         https://bugs.webkit.org/show_bug.cgi?id=178713
1710         <rdar://problem/35115906>
1711
1712         Reviewed by Eric Carlson.
1713
1714         Loading AVFoundation should not be required to answer the question of MediaPlayer::isAvailable() on iOS, where
1715         both AVFoundation and CoreMedia frameworks should always exist. As such, we can bail early and return true to
1716         avoid always dynamically loading AVFoundation and CoreMedia.
1717
1718         * platform/graphics/MediaPlayer.cpp:
1719         (WebCore::MediaPlayer::isAvailable):
1720
1721 2017-10-24  Antoine Quint  <graouts@apple.com>
1722
1723         RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
1724         https://bugs.webkit.org/show_bug.cgi?id=178716
1725         <rdar://problem/35112900>
1726
1727         Reviewed by Dean Jackson.
1728
1729         * rendering/RenderThemeCocoa.mm:
1730         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
1731
1732 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
1733
1734         SizesAttributeParser::SizesAttributeParser triggers layout
1735         https://bugs.webkit.org/show_bug.cgi?id=178712
1736
1737         Reviewed by Antti Koivisto.
1738
1739         Revert r213711 as this change introduced an unwated synchronous layout inside Node::insertedIntoAncestor.
1740
1741         The test had been marked as timing out since r191379 and changed to failing expectation in r199225
1742         as the test result's error message changes from run to run.
1743
1744         Disabled Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
1745                         had been marked failing since r199225, prior to which it was marked as timeout in r191379.
1746                         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
1747                         is now marked as flaky.
1748
1749         * css/parser/SizesAttributeParser.cpp:
1750         (WebCore::SizesAttributeParser::SizesAttributeParser):
1751
1752 2017-10-24  Keith Miller  <keith_miller@apple.com>
1753
1754         Unreviewed, fix internal iOS build.
1755
1756         * Sources.txt:
1757
1758 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
1759
1760         Adopt new secure coding APIs
1761         https://bugs.webkit.org/show_bug.cgi?id=178484
1762         <rdar://problem/34837193>
1763
1764         Reviewed by Tim Horton.
1765
1766         Switch to new NSKeyed[Un]Archiver methods that active and use
1767         NSSecureCoding by default.
1768
1769         Most of the new API is wrapped in a set of convenience methods so we can
1770         build without the new API on older systems.
1771
1772         No change in behavior.
1773
1774         * editing/cocoa/EditorCocoa.mm:
1775         (WebCore::archivedDataForAttributedString): Use new convenience method
1776         to archive the string object.
1777         * loader/archive/cf/LegacyWebArchiveMac.mm:
1778         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
1779         use secure coding where possible.
1780         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
1781         * platform/ios/PlatformPasteboardIOS.mm:
1782         (WebCore::PlatformPasteboard::write): Use new secure API.
1783         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
1784         * testing/cocoa/WebArchiveDumpSupport.mm:
1785         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
1786         secure coding API where possible.
1787
1788 2017-10-24  Miguel Gomez  <magomez@igalia.com>
1789
1790         [GTK][X11] Windy.com shows always straight wind lines
1791         https://bugs.webkit.org/show_bug.cgi?id=176718
1792
1793         Reviewed by Carlos Garcia Campos.
1794
1795         WebGL's GL_LUMINANCE_ALPHA format is not available in OpenGL when using a version >= 3.2
1796         and a core profile. In that case, we need to replace it with GL_RG and swizzle the color
1797         components appropriately.
1798
1799         No new behavior.
1800
1801         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1802         (WebCore::GraphicsContext3D::texImage2D):
1803         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1804         (WebCore::GraphicsContext3D::texSubImage2D):
1805
1806 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
1807
1808         DocumentOrderedMap::add should release assert that tree scopes match
1809         https://bugs.webkit.org/show_bug.cgi?id=178708
1810
1811         Reviewed by Antti Koivisto.
1812
1813         Assert that the tree scope of element matches the given tree scope instead of asserting that
1814         element is in tree scope, and replaced the use of RELEASE_ASSERT by the newly added
1815         RELEASE_ASSERT_WITH_SECURITY_IMPLICATION to clarify the semantics of these assertions.
1816
1817         Also removed now redudnant early exits which would never execute due to release assertions.
1818
1819         * dom/DocumentOrderedMap.cpp:
1820         (WebCore::DocumentOrderedMap::add):
1821         (WebCore::DocumentOrderedMap::remove):
1822         (WebCore::DocumentOrderedMap::get const):
1823
1824 2017-10-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1825
1826         -Wsubobject-linkage warning in InspectorIndexedDBAgent.cpp
1827         https://bugs.webkit.org/show_bug.cgi?id=178698
1828
1829         Reviewed by Joseph Pecoraro.
1830
1831         * inspector/InspectorIndexedDBAgent.cpp:
1832
1833 2017-10-24  Antoine Quint  <graouts@apple.com>
1834
1835         [Web Animations] Add basic timing and target properties
1836         https://bugs.webkit.org/show_bug.cgi?id=178674
1837
1838         Reviewed by Dean Jackson.
1839
1840         We add three new interfaces to expose enough properties to establish basic timing properties,
1841         a start time and duration, and the target of an animation. The startTime property is set on
1842         the Animation object, the target is set on the KeyframeEffect set as the effect property on
1843         the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.
1844
1845         Tests: webanimations/animation-effect-timing.html
1846                webanimations/animation-effect.html
1847                webanimations/animation-interface-effect-property.html
1848                webanimations/animation-interface-start-time-property.html
1849                webanimations/keyframe-effect-interface-timing-duration.html
1850                webanimations/keyframe-effect.html
1851
1852         * CMakeLists.txt:
1853         * DerivedSources.make:
1854         * Sources.txt:
1855         * WebCore.xcodeproj/project.pbxproj:
1856         * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
1857         (WebCore::AnimationEffect::AnimationEffect):
1858         (WebCore::AnimationEffect::~AnimationEffect):
1859         * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
1860         (WebCore::AnimationEffect::isKeyframeEffect const):
1861         (WebCore::AnimationEffect::timing const):
1862         (WebCore::AnimationEffect::classType const):
1863         * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
1864         * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
1865         (WebCore::AnimationEffectTiming::create):
1866         (WebCore::AnimationEffectTiming::AnimationEffectTiming):
1867         (WebCore::AnimationEffectTiming::~AnimationEffectTiming):
1868         * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
1869         * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
1870         * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
1871         (WebCore::KeyframeEffect::create):
1872         (WebCore::KeyframeEffect::KeyframeEffect):
1873         * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
1874         * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
1875         * animation/WebAnimation.cpp:
1876         (WebCore::WebAnimation::setEffect):
1877         * animation/WebAnimation.h:
1878         * animation/WebAnimation.idl:
1879         * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
1880         (WebCore::toJSNewlyCreated):
1881         (WebCore::toJS):
1882         * bindings/js/WebCoreBuiltinNames.h:
1883
1884 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
1885
1886         RenderSVGModelObject::checkIntersection triggers layout
1887         https://bugs.webkit.org/show_bug.cgi?id=178710
1888
1889         Reviewed by Antti Koivisto.
1890
1891         Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.
1892
1893         * rendering/svg/RenderSVGModelObject.cpp:
1894         (WebCore::getElementCTM):
1895         * svg/SVGSVGElement.cpp:
1896         (WebCore::SVGSVGElement::getEnclosureList):
1897
1898 2017-10-24  Nan Wang  <n_wang@apple.com>
1899
1900         AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
1901         https://bugs.webkit.org/show_bug.cgi?id=178697
1902
1903         Reviewed by Chris Fleizach.
1904
1905         When we are calling _accessibilityMinValue and _accessibilityMaxValue on iOS, 
1906         it might cause crash if the AX object has already been detached. Fixed this 
1907         by adding the necessary checks.
1908
1909         Test: accessibility/ios-simulator/slider-min-value-crash.html
1910
1911         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1912         (-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
1913         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
1914
1915 2017-10-23  Keith Miller  <keith_miller@apple.com>
1916
1917         Unreviewed, restore unneeded all in ones.
1918
1919         * CMakeLists.txt:
1920
1921 2017-10-23  Commit Queue  <commit-queue@webkit.org>
1922
1923         Unreviewed, rolling out r223870 and r223871.
1924         https://bugs.webkit.org/show_bug.cgi?id=178702
1925
1926         broke the windows build (Requested by keith_miller on
1927         #webkit).
1928
1929         Reverted changesets:
1930
1931         "Add html, inspector, loader to unified sources"
1932         https://bugs.webkit.org/show_bug.cgi?id=178695
1933         https://trac.webkit.org/changeset/223870
1934
1935         "Unrievwed, fix windows build."
1936         https://trac.webkit.org/changeset/223871
1937
1938 2017-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1939
1940         Unreviewed, attempt to fix initializeSupportedImageMIMETypes after r223860
1941         https://bugs.webkit.org/show_bug.cgi?id=178618
1942         <rdar://problem/35108852>
1943
1944         * platform/MIMETypeRegistry.cpp:
1945         (WebCore::initializeSupportedImageMIMETypes):
1946
1947 2017-10-23  Keith Miller  <keith_miller@apple.com>
1948
1949         Unrievwed, fix windows build.
1950
1951         * CMakeLists.txt:
1952
1953 2017-10-23  Keith Miller  <keith_miller@apple.com>
1954
1955         Add html, inspector, loader to unified sources
1956         https://bugs.webkit.org/show_bug.cgi?id=178695
1957
1958         Rubber-stamped by Tim Horton.
1959
1960         * CMakeLists.txt:
1961         * Sources.txt:
1962         * WebCore.xcodeproj/project.pbxproj:
1963
1964 2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>
1965
1966         Web Inspector: Remove unused Console.setMonitoringXHREnabled
1967         https://bugs.webkit.org/show_bug.cgi?id=178617
1968
1969         Reviewed by Sam Weinig.
1970
1971         * inspector/InspectorInstrumentation.cpp:
1972         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
1973         * inspector/InspectorInstrumentation.h:
1974         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
1975         * inspector/WebConsoleAgent.cpp:
1976         (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
1977         (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
1978         * inspector/WebConsoleAgent.h:
1979         Remove XHR monitoring code.
1980
1981         * xml/XMLHttpRequest.h:
1982         * xml/XMLHttpRequest.cpp:
1983         (WebCore::XMLHttpRequest::send):
1984         (WebCore::XMLHttpRequest::didFinishLoading):
1985         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
1986         * xml/XMLHttpRequest.idl:
1987         Remove now unused state on XHR and ExecState requirement for send().
1988
1989 2017-10-23  Keith Miller  <keith_miller@apple.com>
1990
1991         Add dom, editing, fileapi, and history to unified sources
1992         https://bugs.webkit.org/show_bug.cgi?id=178694
1993
1994         Rubber-stamped by Tim Horton.
1995
1996         * CMakeLists.txt:
1997         * Sources.txt:
1998         * WebCore.xcodeproj/project.pbxproj:
1999
2000 2017-10-23  Keith Miller  <keith_miller@apple.com>
2001
2002         Move bridge, contentextensions, crypto, and css to unified sources.
2003         https://bugs.webkit.org/show_bug.cgi?id=178691
2004
2005         Reviewed by Tim Horton.
2006
2007         * CMakeLists.txt:
2008         * Sources.txt:
2009         * WebCore.xcodeproj/project.pbxproj:
2010
2011 2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2012
2013         Unreviewed, fix the Windows build after r223860
2014
2015         UTIUtilities only exists on Cocoa platforms, so we need to guard it accordingly.
2016
2017         * platform/MIMETypeRegistry.cpp:
2018         (WebCore::initializeSupportedImageMIMETypes):
2019
2020 2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2021
2022         [iOS] DocumentWriter::createDocument can spend ~100ms unnecessarily converting image UTIs to MIME types
2023         https://bugs.webkit.org/show_bug.cgi?id=178618
2024         <rdar://problem/35108852>
2025
2026         Reviewed by Said Abou-Hallawa.
2027
2028         Currently, in setting up a new Document, DocumentWriter::createDocument() always asks whether or not the
2029         Document should be a PDF document by calling MIMETypeRegistry::isPDFMIMEType(), which forces lazy initialization
2030         of every MIME type dictionary (e.g. image types, PDF types, JavaScript types, etc.). As evidenced by traces,
2031         this can be an expensive operation on certain devices.
2032
2033         This patch implements two optimizations. First, we refactor the initializeSupportedImageMIMETypes() helper to
2034         stop asking for MIMETypeForImageSourceType for each of the supported UTIs. This is because the known MIME types
2035         corresponding to these hard-coded UTI types is a fixed set anyways, so we can simply iterate over a constant
2036         array of MIME types and populate the supported image (and image resource) types. Also, add assertions to ensure
2037         that we keep allowed image MIME types in sync with allowed image UTIs.
2038
2039         The second optimization removes initializeMIMETypeRegistry() altogether in favor of calling just the
2040         initialize*MIMETypes() functions needed to ensure the information required. For instance, getPDFMIMETypes()
2041         currently calls initializeMIMETypeRegistry() if the pdfMIMETypes dictionary doesn't exist, when it really only
2042         needs to ensure that the pdfMIMETypes is initialized, for which initializePDFMIMETypes() is sufficient.
2043
2044         * platform/MIMETypeRegistry.cpp:
2045         (WebCore::initializeSupportedImageMIMETypes):
2046         (WebCore::initializeSupportedJavaScriptMIMETypes):
2047         (WebCore::initializePDFMIMETypes):
2048         (WebCore::initializeSupportedNonImageMimeTypes):
2049         (WebCore::initializeUnsupportedTextMIMETypes):
2050
2051         Move MIME type dictionary creation into initialize*MIMETypes() helpers. Additionally, remove
2052         initializePDFAndPostScriptMIMETypes, which is no longer necessary.
2053
2054         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
2055         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
2056         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
2057         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
2058         (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
2059         (WebCore::MIMETypeRegistry::isPDFOrPostScriptMIMEType):
2060
2061         Tweak to check that the type isPDFMIMEType(), or that it's otherwise "application/postscript".
2062
2063         (WebCore::MIMETypeRegistry::isPDFMIMEType):
2064         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
2065         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
2066         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
2067         (WebCore::MIMETypeRegistry::getPDFMIMETypes):
2068         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
2069
2070         Call only the relevant MIME type initializers when needed.
2071
2072         (WebCore::initializePostScriptMIMETypes): Deleted.
2073         (WebCore::initializeMIMETypeRegistry): Deleted.
2074         (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Deleted.
2075
2076         Remove an unused and unexported function.
2077
2078         * platform/MIMETypeRegistry.h:
2079
2080 2017-10-23  Andy Estes  <aestes@apple.com>
2081
2082         [Payment Request] Take the JSC API lock before creating the PaymentResponse.details object
2083         https://bugs.webkit.org/show_bug.cgi?id=178686
2084
2085         Reviewed by Keith Miller.
2086
2087         This fixes several flaky crashes in http/tests/paymentrequest/ after r223855.
2088
2089         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2090         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
2091
2092 2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>
2093
2094         Web Inspector: Please support HAR Export for network traffic
2095         https://bugs.webkit.org/show_bug.cgi?id=146692
2096         <rdar://problem/7463672>
2097
2098         Reviewed by Brian Burg.
2099
2100         Tests: http/tests/inspector/network/har/har-basic.html
2101                http/tests/inspector/network/har/har-page.html
2102
2103         * inspector/InspectorNetworkAgent.cpp:
2104         (WebCore::InspectorNetworkAgent::willSendRequest):
2105         Include the wall time when sending a request. This is needed for HAR to
2106         include a wall time, and can be used for Cookie expiration time calculation
2107         as well.
2108
2109 2017-10-23  Andy Estes  <aestes@apple.com>
2110
2111         [Payment Request] Resolve PaymentRequest.show()'s accept promise when a payment is authorized
2112         https://bugs.webkit.org/show_bug.cgi?id=178609
2113         <rdar://problem/33542813>
2114
2115         Reviewed by Alex Christensen.
2116
2117         This patch implements the logic for resolving PaymentRequest.show()'s accept promise when
2118         the user authorizes a payment, and implements PaymentResponse.complete().
2119
2120         Tests: http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html
2121                http/tests/paymentrequest/payment-response-complete-method.https.html
2122                http/tests/paymentrequest/payment-response-methodName-attribute.https.html
2123                http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html
2124                http/tests/paymentrequest/payment-response-payerName-attribute.https.html
2125                http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html
2126
2127         * DerivedSources.make:
2128         * Modules/applepay/ApplePayPaymentContact.h:
2129         * Modules/applepay/Payment.h:
2130         (WebCore::Payment::Payment): Deleted.
2131         (WebCore::Payment::pkPayment const): Deleted.
2132         * Modules/applepay/PaymentContact.h:
2133         (WebCore::PaymentContact::PaymentContact): Deleted.
2134         (WebCore::PaymentContact::pkContact const): Deleted.
2135         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2136         (WebCore::convert):
2137         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2138         (WebCore::ApplePayPaymentHandler::hasActiveSession):
2139         (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
2140         (WebCore::ApplePayPaymentHandler::document):
2141         (WebCore::ApplePayPaymentHandler::paymentCoordinator):
2142         (WebCore::ApplePayPaymentHandler::convertData):
2143         (WebCore::ApplePayPaymentHandler::show):
2144         (WebCore::ApplePayPaymentHandler::hide):
2145         (WebCore::ApplePayPaymentHandler::canMakePayment):
2146         (WebCore::ApplePayPaymentHandler::complete):
2147         (WebCore::convert):
2148         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
2149         (WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
2150         (WebCore::ApplePayPaymentHandler::didSelectShippingContact):
2151         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2152         * Modules/paymentrequest/PaymentAddress.h:
2153         * Modules/paymentrequest/PaymentAddress.idl:
2154         * Modules/paymentrequest/PaymentHandler.cpp:
2155         (WebCore::PaymentHandler::create):
2156         * Modules/paymentrequest/PaymentHandler.h:
2157         * Modules/paymentrequest/PaymentRequest.cpp:
2158         (WebCore::PaymentRequest::show):
2159         (WebCore::PaymentRequest::stop):
2160         (WebCore::PaymentRequest::canMakePayment):
2161         (WebCore::PaymentRequest::canSuspendForDocumentSuspension const):
2162         (WebCore::PaymentRequest::shippingAddressChanged):
2163         (WebCore::PaymentRequest::shippingOptionChanged):
2164         (WebCore::PaymentRequest::accept):
2165         (WebCore::PaymentRequest::complete):
2166         * Modules/paymentrequest/PaymentRequest.h:
2167         * Modules/paymentrequest/PaymentResponse.cpp:
2168         (WebCore::PaymentResponse::PaymentResponse):
2169         (WebCore::PaymentResponse::complete):
2170         * Modules/paymentrequest/PaymentResponse.h:
2171         * WebCore.xcodeproj/project.pbxproj:
2172         * testing/Internals.cpp:
2173         (WebCore::Internals::Internals):
2174         (WebCore::Internals::mockPaymentCoordinator const):
2175         * testing/Internals.h:
2176         * testing/Internals.idl:
2177         * testing/MockPayment.h: Added.
2178         * testing/MockPaymentAddress.h: Added.
2179         * testing/MockPaymentAddress.idl: Added.
2180         * testing/MockPaymentContact.h: Added.
2181         * testing/MockPaymentCoordinator.cpp:
2182         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
2183         (WebCore::MockPaymentCoordinator::openPaymentSetup):
2184         (WebCore::dispatchIfShowing):
2185         (WebCore::MockPaymentCoordinator::showPaymentUI):
2186         (WebCore::MockPaymentCoordinator::completeMerchantValidation):
2187         (WebCore::MockPaymentCoordinator::completePaymentSession):
2188         (WebCore::MockPaymentCoordinator::abortPaymentSession):
2189         (WebCore::MockPaymentCoordinator::cancelPaymentSession):
2190         (WebCore::MockPaymentCoordinator::paymentCoordinatorDestroyed):
2191         * testing/MockPaymentCoordinator.h:
2192         * testing/MockPaymentCoordinator.idl: Added.
2193
2194 2017-10-23  Dean Jackson  <dino@apple.com>
2195
2196         Attempt to stop iOS Simulator tests from failing because
2197         we don't support Accelerated ImageBuffer.
2198
2199         * html/ImageBitmap.cpp:
2200
2201 2017-10-23  Zalan Bujtas  <zalan@apple.com>
2202
2203         [FrameView::layout cleanup] Make m_subtreeLayoutRoot weak.
2204         https://bugs.webkit.org/show_bug.cgi?id=178621
2205         <rdar://problem/35110321>
2206
2207         Reviewed by Simon Fraser.
2208
2209         This patch turn m_subtreeLayoutRoot into a weak pointer to handle both the optional and the mutation cases.
2210
2211         Covered by existing cases.
2212
2213         * page/FrameView.cpp:
2214         (WebCore::FrameView::reset):
2215         (WebCore::FrameView::willDestroyRenderTree):
2216         (WebCore::FrameView::didDestroyRenderTree):
2217         (WebCore::FrameView::calculateScrollbarModesForLayout):
2218         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
2219         (WebCore::FrameView::canPerformLayout const):
2220         (WebCore::FrameView::layout): WeakPtr<RenderElement> protects us from recursive layouts triggering UAF on layoutRoot.
2221         (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
2222         (WebCore::FrameView::scheduleRelayout):
2223         (WebCore::FrameView::scheduleRelayoutOfSubtree):
2224         (WebCore::FrameView::needsLayout const):
2225         (WebCore::FrameView::autoSizeIfEnabled):
2226         * page/FrameView.h:
2227
2228 2017-10-23  Keith Miller  <keith_miller@apple.com>
2229
2230         Unreviewed, fix windows build.
2231
2232         * CMakeLists.txt:
2233
2234 2017-10-23  Keith Miller  <keith_miller@apple.com>
2235
2236         Move shared accessibility and animiations files to unified sources.
2237         https://bugs.webkit.org/show_bug.cgi?id=178677
2238
2239         Reviewed by Tim Horton.
2240
2241         * Sources.txt:
2242         * WebCore.xcodeproj/project.pbxproj:
2243
2244 2017-10-23  Chris Dumez  <cdumez@apple.com>
2245
2246         Drop confusing Event::dispatched() method
2247         https://bugs.webkit.org/show_bug.cgi?id=178670
2248
2249         Reviewed by Youenn Fablet.
2250
2251         Drop confusing Event::dispatched() method. What the call sites want to do is check
2252         that the Event's "dispatch" flag is set:
2253         - https://dom.spec.whatwg.org/#dispatch-flag
2254
2255         This flag gets set at the beginning of dispatchEvent() and unset at the end of
2256         dispatchEvent():
2257         - https://dom.spec.whatwg.org/#ref-for-dispatch-flag③
2258
2259         See as an example event.initEvent():
2260         - https://dom.spec.whatwg.org/#dom-event-initevent
2261
2262         The right way to check the Event's "dispatch" flag is the Event::isBeingDispatched()
2263         method, so use this instead. One side effect of this change is that it is now
2264         possible to call the init*Event() method on events that have already been dispatched
2265         in order to dispatch them again, as per the specification.
2266
2267         Test: fast/events/initEvent-after-dispatching.html
2268
2269         * dom/CompositionEvent.cpp:
2270         (WebCore::CompositionEvent::initCompositionEvent):
2271         * dom/DeviceMotionEvent.cpp:
2272         (WebCore::DeviceMotionEvent::initDeviceMotionEvent):
2273         * dom/DeviceOrientationEvent.cpp:
2274         (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
2275         * dom/Event.h:
2276         * dom/HashChangeEvent.h:
2277         * dom/KeyboardEvent.cpp:
2278         (WebCore::KeyboardEvent::initKeyboardEvent):
2279         * dom/MessageEvent.cpp:
2280         (WebCore::MessageEvent::initMessageEvent):
2281         * dom/MouseEvent.cpp:
2282         (WebCore::MouseEvent::initMouseEvent):
2283         * dom/OverflowEvent.cpp:
2284         (WebCore::OverflowEvent::initOverflowEvent):
2285         * dom/TextEvent.cpp:
2286         (WebCore::TextEvent::initTextEvent):
2287         * dom/TouchEvent.cpp:
2288         (WebCore::TouchEvent::initTouchEvent):
2289         * dom/UIEvent.cpp:
2290         (WebCore::UIEvent::initUIEvent):
2291         * dom/WheelEvent.cpp:
2292         (WebCore::WheelEvent::initWheelEvent):
2293         * storage/StorageEvent.cpp:
2294         (WebCore::StorageEvent::initStorageEvent):
2295
2296 2017-10-23  Antti Koivisto  <antti@apple.com>
2297
2298         Remember previous child renderer during render tree update
2299         https://bugs.webkit.org/show_bug.cgi?id=178659
2300
2301         Reviewed by Zalan Bujtas.
2302
2303         We shouldn't need to recompute the previous renderer, we know it already.
2304
2305         * style/RenderTreePosition.cpp:
2306         (WebCore::RenderTreePosition::previousSiblingRenderer const): Deleted.
2307
2308             No longer needed. This was also subtly wrong as doesn't take display:contents into account.
2309
2310         * style/RenderTreePosition.h:
2311         * style/RenderTreeUpdater.cpp:
2312         (WebCore::RenderTreeUpdater::updateRenderTree):
2313         (WebCore::RenderTreeUpdater::textRendererIsNeeded):
2314
2315             Use the saved previous renderer.
2316
2317         (WebCore::RenderTreeUpdater::updateTextRenderer):
2318         (WebCore::RenderTreeUpdater::storePreviousRenderer):
2319
2320             Save the previous renderere as we walk the tree.
2321
2322         (WebCore::textRendererIsNeeded): Deleted.
2323         * style/RenderTreeUpdater.h:
2324
2325 2017-10-23  Keith Miller  <keith_miller@apple.com>
2326
2327         Add Shared Modules files to the unified source build.
2328         https://bugs.webkit.org/show_bug.cgi?id=178675
2329
2330         Reviewed by Tim Horton.
2331
2332         This patch all the Modules sources files shared across all ports to
2333         unified sources.
2334
2335         * CMakeLists.txt:
2336         * Sources.txt:
2337         * WebCore.xcodeproj/project.pbxproj:
2338
2339 2017-10-22  Dean Jackson  <dino@apple.com>
2340
2341         Implement drawImage(ImageBitmap) on 2d canvas
2342         https://bugs.webkit.org/show_bug.cgi?id=178653
2343         <rdar://problem/35104360>
2344
2345         Reviewed by Antoine Quint.
2346
2347         Implement CanvasRenderingContext2D::drawImage with ImageBitmap.
2348         It's probably not going to be a very common operation, but
2349         it importantly allows us to test the ImageBitmap creation
2350         code.
2351
2352         Test: http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html
2353
2354         * html/ImageBitmap.cpp:
2355         (WebCore::taintsOrigin): New helper function to determine if a
2356         CachedImage would provide a clean origin.
2357         (WebCore::ImageBitmap::createPromise): Set the flag that records
2358         if this ImageBitmap has a clean origin.
2359         * html/ImageBitmap.h:
2360         (WebCore::ImageBitmap::buffer): Exposes the ImageBuffer backing
2361         store, allowing access to the data for drawing.
2362         (WebCore::ImageBitmap::originClean const): Is this ImageBitmap
2363         going to taint a destination.
2364         * html/canvas/CanvasRenderingContext.cpp:
2365         (WebCore::CanvasRenderingContext::wouldTaintOrigin): Implement
2366         the ImageBitmap version of this template function.
2367         * html/canvas/CanvasRenderingContext.h:
2368         * html/canvas/CanvasRenderingContext2D.cpp:
2369         (WebCore::CanvasRenderingContext2D::drawImage): Implement the
2370         actual drawing of an ImageBitmap.
2371
2372 2017-10-23  Daniel Bates  <dabates@apple.com>
2373
2374         Unreviewed, rolling out r223699.
2375
2376         Caused regressions with right-to-left text selection and
2377         painting of markers in flipped writing mode and in overlapping
2378         lines. Will investigate offline.
2379
2380         Reverted changeset:
2381
2382         "Share logic in InlineTextBox to compute selection rect"
2383         https://bugs.webkit.org/show_bug.cgi?id=178232
2384         https://trac.webkit.org/changeset/223699
2385
2386 2017-10-23  Youenn Fablet  <youenn@apple.com>
2387
2388         Create a Fetch event when ServiceWorker has to handle a fetch
2389         https://bugs.webkit.org/show_bug.cgi?id=178491
2390
2391         Reviewed by Chris Dumez.
2392
2393         Covered by existing test.
2394
2395         Updating FetchEvent to pass a FetchResponse* within its onResponse callback.
2396         Making it a CompletionHandler.
2397         Fixing a check on respondWith to ensure that event is dispatched when respondWith is called.
2398
2399         Adding ServiceWorkerFetch class to handle the creation of the fetch event, waiting for the fetch event to be responded
2400         and processing when fetch event is responded.
2401         ServiceWorkerFetchTask takes a client to which will be sent the response body or the error.
2402         WebKit implementation of it will be to send the related IPC message back to the WebProcess that made the fetch request.
2403
2404         Adding a method to ServiceWorkerThread to create the fetch event on worker thread and dispatch on the global scope.
2405
2406         * WebCore.xcodeproj/project.pbxproj:
2407         * platform/network/ResourceResponseBase.h:
2408         * testing/Internals.cpp:
2409         (WebCore::Internals::waitForFetchEventToFinish):
2410         * workers/service/FetchEvent.cpp:
2411         (WebCore::FetchEvent::~FetchEvent):
2412         (WebCore::FetchEvent::respondWith):
2413         (WebCore::FetchEvent::onResponse):
2414         (WebCore::FetchEvent::respondWithError):
2415         (WebCore::FetchEvent::processResponse):
2416         (WebCore::FetchEvent::promiseIsSettled):
2417         * workers/service/FetchEvent.h:
2418         * workers/service/context/ServiceWorkerFetch.cpp: Added.
2419         (WebCore::ServiceWorkerFetch::dispatchFetchTask):
2420         (WebCore::ServiceWorkerFetch::processResponse):
2421         * workers/service/context/ServiceWorkerFetch.h: Added.
2422         * workers/service/context/ServiceWorkerThread.cpp:
2423         (WebCore::m_workerObjectProxy):
2424         (WebCore::ServiceWorkerThread::dispatchFetchEvent):
2425         * workers/service/context/ServiceWorkerThread.h:
2426
2427 2017-10-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2428
2429         [Curl] Fix authentication related bugs
2430         https://bugs.webkit.org/show_bug.cgi?id=178652
2431
2432         Reviewed by Alex Christensen.
2433
2434         * platform/network/curl/AuthenticationChallengeCurl.cpp:
2435         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
2436         * platform/network/curl/CurlContext.cpp:
2437         (WebCore::CurlHandle::setHttpAuthUserPass):
2438         * platform/network/curl/CurlRequest.cpp:
2439         (WebCore::CurlRequest::setUserPass):
2440         (WebCore::CurlRequest::setupTransfer):
2441         (WebCore::CurlRequest::didReceiveHeader):
2442         * platform/network/curl/CurlRequest.h:
2443
2444 2017-10-23  Matt Lewis  <jlewis3@apple.com>
2445
2446         Unreviewed, rolling out r223820.
2447
2448         This caused a build break on Windows.
2449
2450         Reverted changeset:
2451
2452         "Web Inspector: Remove unused Console.setMonitoringXHREnabled"
2453         https://bugs.webkit.org/show_bug.cgi?id=178617
2454         https://trac.webkit.org/changeset/223820
2455
2456 2017-10-23  Zalan Bujtas  <zalan@apple.com>
2457
2458         Call FrameView::scheduleSelectionUpdate when selection needs repainting after layout instead of setting the RenderView dirty.
2459         https://bugs.webkit.org/show_bug.cgi?id=178651
2460         <rdar://problem/35117448>
2461
2462         Reviewed by Antti Koivisto.
2463
2464         Calling setNeedsLayout() on the RenderView to trigger selection update is problematic in 2 different ways:
2465         1. marking the root renderer dirty does not trigger layout (this is very specific to the root,
2466         other renderers do trigger layout). It means that it works as long as someone else schedules a layout.
2467         2. when a subtree layout is already scheduled and we mark the root renderer dirty, the root gets stuck with
2468         the dirty flag (since the entry point for the subsequent layout is a descendant of the root and not the root itself).
2469
2470         This patch addresses these issues by scheduling/converting subtree layout when needed.  
2471
2472         Covered by fast/dynamic/remove-invisible-node-inside-selection.html/remove-node-inside-selection.html
2473
2474         * editing/FrameSelection.cpp:
2475         (WebCore::FrameSelection::respondToNodeModification):
2476         * page/FrameView.cpp:
2477         (WebCore::FrameView::scheduleSelectionUpdate):
2478         * page/FrameView.h:
2479
2480 2017-10-23  Miguel Gomez  <magomez@igalia.com>
2481
2482         [TexMap] Remove GraphicsContext3D usage from TextureMapperShaderProgram
2483         https://bugs.webkit.org/show_bug.cgi?id=175425
2484
2485         Reviewed by Žan Doberšek.
2486
2487         Remove usage of the GraphicsContext3D class in TextureMapperShaderProgram.
2488         Direct OpenGL API calls, types and constants are used instead.
2489
2490         By removing GraphicsContext3D, we don't use ANGLE anymore to perform the
2491         shader adaptation to the used OpenGL/GLES2 version, so we need to do that
2492         inside TextureMapperShaderProgram. The main changes required for this are
2493         adding the #version directive and use in/out to define input/output parameters
2494         when using OpenGL >= 3.2, and defining the default precision only when using
2495         GLES2.
2496
2497         Besides that, now that VideoTextureCopierGStreamer doesn't have its own
2498         GraphicsContext3D, we need to add a VAO to it when using OpenGL >= 3.2.
2499
2500         Based on a previous patch by Žan Doberšek <zdobersek@igalia.com>.
2501
2502         No behavior change.
2503
2504         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2505         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
2506         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
2507         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
2508         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
2509         * platform/graphics/texmap/TextureMapperGL.cpp:
2510         (WebCore::TextureMapperGLData::getShaderProgram):
2511         (WebCore::prepareFilterProgram):
2512         (WebCore::TextureMapperGL::drawTexture):
2513         (WebCore::TextureMapperGL::drawFiltered):
2514         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2515         (WebCore::TextureMapperShaderProgram::create):
2516         (WebCore::getShaderLog):
2517         (WebCore::getProgramLog):
2518         (WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
2519         (WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram):
2520         (WebCore::TextureMapperShaderProgram::setMatrix):
2521         (WebCore::TextureMapperShaderProgram::getLocation):
2522         * platform/graphics/texmap/TextureMapperShaderProgram.h:
2523         (WebCore::TextureMapperShaderProgram::programID const):
2524
2525 2017-10-22  Sam Weinig  <sam@webkit.org>
2526
2527         [Settings] Replace current Settings generation with template file based approach
2528         https://bugs.webkit.org/show_bug.cgi?id=178634
2529
2530         Reviewed by Joseph Pecoraro.
2531
2532         This replaces the recently added python based Settings generation with a generator
2533         built in ruby, so we can take advantage of ERB for templating. The result has much
2534         of the logic in the templates and as a result feels much easier to follow and cleaner.
2535
2536         Since I was moving things to ruby, I took the opertunity to switch the Settings definition
2537         file from our .in format to yaml, which is quite a bit easier to read.
2538
2539         * CMakeLists.txt:
2540         * DerivedSources.make:
2541         * Scripts/GenerateSettings: Removed.
2542         * Scripts/GenerateSettings.py: Removed.
2543         * Scripts/GenerateSettings.rb: Added.
2544         * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Removed.
2545         * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Removed.
2546         * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Removed.
2547         * Scripts/GenerateSettings/GenerateSettings.py: Removed.
2548         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Removed.
2549         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Removed.
2550         * Scripts/GenerateSettings/Settings.py: Removed.
2551         * Scripts/GenerateSettings/__init__.py: Removed.
2552         * Scripts/SettingsTemplates: Added.
2553         * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: Added.
2554         * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: Added.
2555         * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: Added.
2556         * Scripts/SettingsTemplates/Settings.cpp.erb: Added.
2557         * Scripts/SettingsTemplates/Settings.h.erb: Added.
2558         * WebCore.xcodeproj/project.pbxproj:
2559         * WebCoreMacros.cmake:
2560         * page/Settings.in: Removed.
2561         * page/Settings.yaml: Added.
2562
2563 2017-10-22  Joseph Pecoraro  <pecoraro@apple.com>
2564
2565         REGRESSION(r219675): Web Inspector: CommandLineAPI getEventListeners does not work
2566         https://bugs.webkit.org/show_bug.cgi?id=178650
2567         <rdar://problem/35116347>
2568
2569         Reviewed by Sam Weinig.
2570
2571         Test: inspector/console/command-line-api-getEventListeners.html
2572
2573         * inspector/CommandLineAPIHost.cpp:
2574         (WebCore::listenerEntriesFromListenerInfo):
2575         Fix typo.
2576
2577         (WebCore::CommandLineAPIHost::getEventListeners):
2578         Fix incorrect early return.
2579
2580         * inspector/CommandLineAPIHost.h:
2581         * inspector/CommandLineAPIHost.idl:
2582         Add more attributes about the listener. These new attributes match output from Chrome.
2583
2584 2017-10-22  Antoine Quint  <graouts@apple.com>
2585
2586         [Web Animations] Add animations to the timeline
2587         https://bugs.webkit.org/show_bug.cgi?id=178643
2588
2589         Reviewed by Dean Jackson.
2590
2591         If a timeline is provided as a parameter to the Animation constructor,
2592         add it to the timeline, and remove it when the object is destroyed.
2593
2594         We also start the basic mechanism to dump the contents of a timeline
2595         as text for testing purposes, currently only logging the number of
2596         animations in a timeline and just logging the class name for animation
2597         themselves.
2598
2599         Test: webanimations/animation-creation-addition.html
2600
2601         * animation/AnimationTimeline.cpp:
2602         (WebCore::AnimationTimeline::description):
2603         * animation/AnimationTimeline.h:
2604         * animation/AnimationTimeline.idl:
2605         * animation/WebAnimation.cpp:
2606         (WebCore::WebAnimation::create):
2607         (WebCore::WebAnimation::~WebAnimation):
2608         (WebCore::WebAnimation::description):
2609         * animation/WebAnimation.h:
2610         * testing/Internals.cpp:
2611         (WebCore::Internals::timelineDescription):
2612         * testing/Internals.h:
2613         * testing/Internals.idl:
2614
2615 2017-10-21  Zalan Bujtas  <zalan@apple.com>
2616
2617         [FrameView::layout cleanup] Drop allowSubtree parameter
2618         https://bugs.webkit.org/show_bug.cgi?id=178623
2619         <rdar://problem/35111012>
2620
2621         Reviewed by Sam Weinig.
2622
2623         This flag is only set through ::forceLayout(). Let's just convert the subtree layout
2624         to full layout right before calling ::layout().
2625
2626         No change in functionality.
2627
2628         * page/FrameView.cpp:
2629         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
2630         (WebCore::FrameView::layout):
2631         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
2632         (WebCore::FrameView::forceLayout):
2633         * page/FrameView.h:
2634
2635 2017-10-21  Joseph Pecoraro  <pecoraro@apple.com>
2636
2637         Web Inspector: Remove unused Console.setMonitoringXHREnabled
2638         https://bugs.webkit.org/show_bug.cgi?id=178617
2639
2640         Reviewed by Sam Weinig.
2641
2642         * inspector/InspectorInstrumentation.cpp:
2643         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
2644         * inspector/InspectorInstrumentation.h:
2645         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
2646         * inspector/WebConsoleAgent.cpp:
2647         (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
2648         (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
2649         * inspector/WebConsoleAgent.h:
2650         Remove XHR monitoring code.
2651
2652         * xml/XMLHttpRequest.h:
2653         * xml/XMLHttpRequest.cpp:
2654         (WebCore::XMLHttpRequest::send):
2655         (WebCore::XMLHttpRequest::didFinishLoading):
2656         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
2657         * xml/XMLHttpRequest.idl:
2658         Remove now unused state on XHR and ExecState requirement for send().
2659
2660 2017-10-21  Dean Jackson  <dino@apple.com>
2661
2662         createImageBitmap with basic HTMLImageElement
2663         https://bugs.webkit.org/show_bug.cgi?id=178619
2664         <rdar://problem/35104118>
2665
2666         Reviewed by Antoine Quint.
2667
2668         Implement the basic infrastructure for creating
2669         an ImageBitmap from an HTMLImageElement.
2670
2671         Test: http/wpt/2dcontext/imagebitmap/createImageBitmap.html
2672
2673         * html/ImageBitmap.cpp:
2674         (WebCore::ImageBitmap::createPromise): Create the image buffer
2675         and draw the image into its backing store.
2676         * html/ImageBitmap.h:
2677
2678 2017-10-21  Antoine Quint  <graouts@apple.com>
2679
2680         [Web Animations] Add bindings to unified sources
2681         https://bugs.webkit.org/show_bug.cgi?id=178620
2682
2683         Reviewed by Dean Jackson.
2684
2685         Removing the Web Animations bindings from the WebCore target and adding them to the unified sources list instead.
2686
2687         * Sources.txt:
2688         * WebCore.xcodeproj/project.pbxproj:
2689
2690 2017-10-21  Tim Horton  <timothy_horton@apple.com>
2691
2692         Fix the Mac CMake build
2693
2694         * PlatformMac.cmake:
2695
2696 2017-10-21  Antti Koivisto  <antti@apple.com>
2697
2698         Support ::before/::after pseudo elements with display:contents
2699         https://bugs.webkit.org/show_bug.cgi?id=178584
2700
2701         Reviewed by Ryosuke Niwa.
2702
2703         This is cases like
2704
2705         ::before { display:contents; content:'foo' }
2706
2707         * css/StyleResolver.cpp:
2708         (WebCore::StyleResolver::adjustDisplayContentsStyle): Added.
2709
2710             Allow display:contents on pseudo elements.
2711             Factor into function.
2712
2713         (WebCore::StyleResolver::adjustRenderStyle):
2714         * dom/PseudoElement.h:
2715
2716             Add a weak vector of content renderers.
2717
2718         * style/RenderTreePosition.h:
2719         (WebCore::RenderTreePosition::moveToLastChild):
2720
2721             Add a way to set a valid render tree position without a node.
2722
2723         * style/RenderTreeUpdaterGeneratedContent.cpp:
2724         (WebCore::createContentRenderers):
2725
2726             Take RenderTreePosition.
2727
2728         (WebCore::updateStyleForContentRenderers):
2729
2730             Update based on the content renderer vector instead of doing a tree walk.
2731
2732         (WebCore::removeAndDestroyContentRenderers):
2733
2734             Helper for destroying content renderers.
2735
2736         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
2737
2738             In the normal case create a render tree position for the pseudo element renderer and
2739             use RenderTreePosition::moveToLastChild to make it a valid position. (The existing
2740             RenderTreePosition interface didn't have way to move to positions in anonymous boxes)
2741
2742             In the case of a non box generating display:contents pseudo element, use the current
2743             render tree position instead.
2744
2745             Ensure that pseudo element renderers are destroyed before creating the new ones since in
2746             display:contents case they are not descendants of the pseudo renderer and don't get cleared
2747             automatically.
2748
2749 2017-10-20  Zalan Bujtas  <zalan@apple.com>
2750
2751         [FrameView::layout cleanup] Use SetForScope to ensure layout state correctness
2752         https://bugs.webkit.org/show_bug.cgi?id=178604
2753         <rdar://problem/35101890>
2754
2755         Reviewed by Simon Fraser.
2756
2757         SetForScope guarantees state correctness even with nested layouts. This is a lot less
2758         error prone than resetting the state value after each potential recursive call.
2759
2760         Covered by existing tests.
2761
2762         * page/FrameView.cpp:
2763         (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): This layout state does
2764         not look too useful.
2765         (WebCore::FrameView::layout):
2766         * page/FrameView.h: While performPostLayoutTasks() is somewhat special since it can either be sync or async,
2767         so painting should be allowed in both cases.
2768
2769 2017-10-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2770
2771         SVGPathElement should cache the built-up Path of its non animating pathByteStream()
2772         https://bugs.webkit.org/show_bug.cgi?id=178248
2773
2774         Reviewed by Simon Fraser.
2775
2776         Instead of creating a Path object from the non animating pathByteStream()
2777         every time we need to updatePathFromPathElement(), the Path object can be
2778         cached once it is created and used for later calls.
2779
2780         * html/canvas/Path2D.h: buildPathFromString() now returns a Path.
2781
2782         * platform/graphics/Path.h:
2783         * platform/graphics/cairo/PathCairo.cpp:
2784         (WebCore::Path::Path):
2785         (WebCore::Path::operator=):
2786         * platform/graphics/cg/PathCG.cpp:
2787         (WebCore::Path::Path):
2788         (WebCore::Path::operator=):
2789         * platform/graphics/win/PathDirect2D.cpp:
2790         (WebCore::Path::Path):
2791         (WebCore::Path::operator=):
2792         Define the move constructor and the move assignment operator for the the
2793         Path class so a statement like "Path path = buildPathFromString()" won't 
2794         go through the copy constructor and the copy assignment operator.
2795
2796         * rendering/style/BasicShapes.cpp:
2797         (WebCore::SVGPathTranslatedByteStream::path const):
2798         * rendering/svg/RenderSVGResourceClipper.cpp:
2799         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
2800         * rendering/svg/RenderSVGShape.cpp:
2801         (WebCore::RenderSVGShape::updateShapeFromElement):
2802         * rendering/svg/RenderSVGTextPath.cpp:
2803         (WebCore::RenderSVGTextPath::layoutPath const):
2804         * rendering/svg/SVGPathData.cpp:
2805         (WebCore::pathFromCircleElement):
2806         (WebCore::pathFromEllipseElement):
2807         (WebCore::pathFromLineElement):
2808         (WebCore::pathFromPathElement):
2809         (WebCore::pathFromPolygonElement):
2810         (WebCore::pathFromPolylineElement):
2811         (WebCore::pathFromRectElement):
2812         (WebCore::pathFromGraphicsElement):
2813         (WebCore::updatePathFromCircleElement): Deleted.
2814         (WebCore::updatePathFromEllipseElement): Deleted.
2815         (WebCore::updatePathFromLineElement): Deleted.
2816         (WebCore::updatePathFromPathElement): Deleted.
2817         (WebCore::updatePathFromPolygonElement): Deleted.
2818         (WebCore::updatePathFromPolylineElement): Deleted.
2819         (WebCore::updatePathFromRectElement): Deleted.
2820         (WebCore::updatePathFromGraphicsElement): Deleted.
2821         * rendering/svg/SVGPathData.h:
2822         * svg/SVGAnimateMotionElement.cpp:
2823         (WebCore::SVGAnimateMotionElement::parseAttribute):
2824         (WebCore::SVGAnimateMotionElement::updateAnimationPath):
2825         * svg/SVGGraphicsElement.cpp:
2826         (WebCore::SVGGraphicsElement::toClipPath):
2827         * svg/SVGGraphicsElement.h:
2828         Rename updatePathFromElement() to pathFromGraphicsElement().
2829
2830         * svg/SVGPathElement.cpp:
2831         (WebCore::SVGPathElement::parseAttribute): Clear the cache when
2832         m_pathByteStream changes.
2833         (WebCore::SVGPathElement::pathForByteStream const): Caches the m_cachedPath
2834         if it is null.
2835         (WebCore::SVGPathElement::pathSegListChanged): Clear the cache when
2836         m_pathByteStream changes.
2837
2838         * svg/SVGPathElement.h:
2839         * svg/SVGPathUtilities.cpp:
2840         (WebCore::buildPathFromString):
2841         (WebCore::buildPathFromByteStream):
2842         * svg/SVGPathUtilities.h:
2843         Make thes buildPathFromString() and buildPathFromByteStream() return Paths.
2844
2845         * svg/SVGUseElement.cpp:
2846         (WebCore::SVGUseElement::toClipPath):
2847         * svg/SVGUseElement.h:
2848         Make these toClipPath() return Path.
2849
2850 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
2851
2852         Rename insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor
2853         https://bugs.webkit.org/show_bug.cgi?id=178605
2854
2855         Reviewed by Andy Estes.
2856
2857         Renamed insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor respectively
2858         to make it clear that these functions can be called even when node's immediate parent didn't change.
2859
2860         * dom/ContainerNodeAlgorithms.cpp:
2861         (WebCore::notifyNodeInsertedIntoDocument):
2862         (WebCore::notifyNodeInsertedIntoTree):
2863         (WebCore::notifyNodeRemovedFromDocument):
2864         (WebCore::notifyNodeRemovedFromTree):
2865         (WebCore::notifyChildNodeRemoved):
2866         * dom/ContainerNodeAlgorithms.h:
2867         * dom/Element.cpp:
2868         (WebCore::Element::insertedIntoAncestor): Renamed from insertedInto.
2869         (WebCore::Element::removedFromAncestor): Renamed from removedFrom.
2870         * dom/Element.h:
2871         * dom/Node.cpp:
2872         (WebCore::Node::insertedIntoAncestor): 
2873         (WebCore::Node::removedFromAncestor):
2874         (WebCore::Node::removedFrom): Deleted.
2875         * dom/Node.h:
2876         * dom/ProcessingInstruction.cpp:
2877         (WebCore::ProcessingInstruction::insertedIntoAncestor): Renamed from insertedInto.
2878         (WebCore::ProcessingInstruction::removedFromAncestor): Renamed from removedFrom.
2879         * dom/ProcessingInstruction.h:
2880         * dom/ScriptElement.h:
2881         (WebCore::ScriptElement::insertedIntoAncestor const): Renamed from insertedInto.
2882         * dom/ShadowRoot.cpp:
2883         (WebCore::ShadowRoot::insertedIntoAncestor): Renamed from insertedInto.
2884         (WebCore::ShadowRoot::removedFromAncestor): Renamed from removedFrom.
2885         * dom/ShadowRoot.h:
2886         * html/FormAssociatedElement.cpp:
2887         (WebCore::FormAssociatedElement::insertedIntoAncestor): Renamed from insertedInto.
2888         (WebCore::FormAssociatedElement::removedFromAncestor): Renamed from removedFrom.
2889         * html/FormAssociatedElement.h:
2890         * html/HTMLBaseElement.cpp:
2891         (WebCore::HTMLBaseElement::insertedIntoAncestor): Renamed from insertedInto.
2892         (WebCore::HTMLBaseElement::removedFromAncestor): Renamed from removedFrom.
2893         * html/HTMLBaseElement.h:
2894         * html/HTMLBodyElement.cpp:
2895         (WebCore::HTMLBodyElement::insertedIntoAncestor): Renamed from insertedInto.
2896         * html/HTMLBodyElement.h:
2897         * html/HTMLFormControlElement.cpp:
2898         (WebCore::HTMLFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
2899         (WebCore::HTMLFormControlElement::removedFromAncestor): Renamed from removedFrom.
2900         * html/HTMLFormControlElement.h:
2901         * html/HTMLFormControlElementWithState.cpp:
2902         (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Renamed from insertedInto.
2903         (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Renamed from removedFrom.
2904         * html/HTMLFormControlElementWithState.h:
2905         * html/HTMLFormElement.cpp:
2906         (WebCore::HTMLFormElement::insertedIntoAncestor): Renamed from insertedInto.
2907         (WebCore::HTMLFormElement::removedFromAncestor): Renamed from removedFrom.
2908         * html/HTMLFormElement.h:
2909         * html/HTMLFrameElementBase.cpp:
2910         (WebCore::HTMLFrameElementBase::insertedIntoAncestor): Renamed from insertedInto.
2911         * html/HTMLFrameElementBase.h:
2912         * html/HTMLFrameSetElement.cpp:
2913         (WebCore::HTMLFrameSetElement::insertedIntoAncestor): Renamed from insertedInto.
2914         (WebCore::HTMLFrameSetElement::removedFromAncestor): Renamed from removedFrom.
2915         * html/HTMLFrameSetElement.h:
2916         * html/HTMLImageElement.cpp:
2917         (WebCore::HTMLImageElement::insertedIntoAncestor): Renamed from insertedInto.
2918         (WebCore::HTMLImageElement::removedFromAncestor): Renamed from removedFrom.
2919         * html/HTMLImageElement.h:
2920         * html/HTMLInputElement.cpp:
2921         (WebCore::HTMLInputElement::insertedIntoAncestor): Renamed from insertedInto.
2922         (WebCore::HTMLInputElement::removedFromAncestor): Renamed from removedFrom.
2923         * html/HTMLInputElement.h:
2924         * html/HTMLLinkElement.cpp:
2925         (WebCore::HTMLLinkElement::insertedIntoAncestor): Renamed from insertedInto.
2926         (WebCore::HTMLLinkElement::removedFromAncestor): Renamed from removedFrom.
2927         * html/HTMLLinkElement.h:
2928         * html/HTMLMapElement.cpp:
2929         (WebCore::HTMLMapElement::insertedIntoAncestor): Renamed from insertedInto.
2930         (WebCore::HTMLMapElement::removedFromAncestor): Renamed from removedFrom.
2931         * html/HTMLMapElement.h:
2932         * html/HTMLMediaElement.cpp:
2933         (WebCore::HTMLMediaElement::insertedIntoAncestor): Renamed from insertedInto.
2934         (WebCore::HTMLMediaElement::removedFromAncestor): Renamed from removedFrom.
2935         * html/HTMLMediaElement.h:
2936         * html/HTMLMetaElement.cpp:
2937         (WebCore::HTMLMetaElement::insertedIntoAncestor): Renamed from insertedInto.
2938         * html/HTMLMetaElement.h:
2939         * html/HTMLObjectElement.cpp:
2940         (WebCore::HTMLObjectElement::insertedIntoAncestor): Renamed from insertedInto.
2941         (WebCore::HTMLObjectElement::removedFromAncestor): Renamed from removedFrom.
2942         * html/HTMLObjectElement.h:
2943         * html/HTMLOptionElement.cpp:
2944         (WebCore::HTMLOptionElement::insertedIntoAncestor): Renamed from insertedInto.
2945         * html/HTMLOptionElement.h:
2946         * html/HTMLScriptElement.cpp:
2947         (WebCore::HTMLScriptElement::insertedIntoAncestor): Renamed from insertedInto.
2948         * html/HTMLScriptElement.h:
2949         * html/HTMLSelectElement.cpp:
2950         (WebCore::HTMLSelectElement::insertedIntoAncestor): Renamed from insertedInto.
2951         * html/HTMLSelectElement.h:
2952         * html/HTMLSlotElement.cpp:
2953         (WebCore::HTMLSlotElement::insertedIntoAncestor): Renamed from insertedInto.
2954         (WebCore::HTMLSlotElement::removedFromAncestor): Renamed from removedFrom.
2955         * html/HTMLSlotElement.h:
2956         * html/HTMLSourceElement.cpp:
2957         (WebCore::HTMLSourceElement::insertedIntoAncestor): Renamed from insertedInto.
2958         (WebCore::HTMLSourceElement::removedFromAncestor): Renamed from removedFrom.
2959         * html/HTMLSourceElement.h:
2960         * html/HTMLStyleElement.cpp:
2961         (WebCore::HTMLStyleElement::insertedIntoAncestor): Renamed from insertedInto.
2962         (WebCore::HTMLStyleElement::removedFromAncestor): Renamed from removedFrom.
2963         * html/HTMLStyleElement.h:
2964         * html/HTMLTextFormControlElement.cpp:
2965         (WebCore::HTMLTextFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
2966         * html/HTMLTextFormControlElement.h:
2967         * html/HTMLTitleElement.cpp:
2968         (WebCore::HTMLTitleElement::insertedIntoAncestor): Renamed from insertedInto.
2969         (WebCore::HTMLTitleElement::removedFromAncestor): Renamed from removedFrom.
2970         * html/HTMLTitleElement.h:
2971         * html/HTMLTrackElement.cpp:
2972         (WebCore::HTMLTrackElement::insertedIntoAncestor): Renamed from insertedInto.
2973         (WebCore::HTMLTrackElement::removedFromAncestor): Renamed from removedFrom.
2974         * html/HTMLTrackElement.h:
2975         * svg/SVGElement.cpp:
2976         (WebCore::SVGElement::removedFromAncestor): Renamed from removedFrom.
2977         (WebCore::SVGElement::insertedIntoAncestor): Renamed from insertedInto.
2978         (WebCore::SVGElement::updateRelativeLengthsInformation):
2979         * svg/SVGElement.h:
2980         * svg/SVGFEImageElement.cpp:
2981         (WebCore::SVGFEImageElement::insertedIntoAncestor): Renamed from insertedInto.
2982         (WebCore::SVGFEImageElement::removedFromAncestor): Renamed from removedFrom.
2983         * svg/SVGFEImageElement.h:
2984         * svg/SVGFontFaceElement.cpp:
2985         (WebCore::SVGFontFaceElement::insertedIntoAncestor): Renamed from insertedInto.
2986         (WebCore::SVGFontFaceElement::removedFromAncestor): Renamed from removedFrom.
2987         * svg/SVGFontFaceElement.h:
2988         * svg/SVGFontFaceUriElement.cpp:
2989         (WebCore::SVGFontFaceUriElement::insertedIntoAncestor): Renamed from insertedInto.
2990         * svg/SVGFontFaceUriElement.h:
2991         * svg/SVGImageElement.cpp:
2992         (WebCore::SVGImageElement::insertedIntoAncestor): Renamed from insertedInto.
2993         * svg/SVGImageElement.h:
2994         * svg/SVGMPathElement.cpp:
2995         (WebCore::SVGMPathElement::insertedIntoAncestor): Renamed from insertedInto.
2996         (WebCore::SVGMPathElement::removedFromAncestor): Renamed from removedFrom.
2997         * svg/SVGMPathElement.h:
2998         * svg/SVGPathElement.cpp:
2999         (WebCore::SVGPathElement::insertedIntoAncestor): Renamed from insertedInto.
3000         (WebCore::SVGPathElement::removedFromAncestor): Renamed from removedFrom.
3001         * svg/SVGPathElement.h:
3002         * svg/SVGSVGElement.cpp:
3003         (WebCore::SVGSVGElement::insertedIntoAncestor): Renamed from insertedInto.
3004         (WebCore::SVGSVGElement::removedFromAncestor): Renamed from removedFrom.
3005         * svg/SVGSVGElement.h:
3006         * svg/SVGScriptElement.cpp:
3007         (WebCore::SVGScriptElement::insertedIntoAncestor): Renamed from insertedInto.
3008         * svg/SVGScriptElement.h:
3009         * svg/SVGStyleElement.cpp:
3010         (WebCore::SVGStyleElement::insertedIntoAncestor): Renamed from insertedInto.
3011         (WebCore::SVGStyleElement::removedFromAncestor): Renamed from removedFrom.
3012         * svg/SVGStyleElement.h:
3013         * svg/SVGTRefElement.cpp:
3014         (WebCore::SVGTRefElement::buildPendingResource):
3015         (WebCore::SVGTRefElement::insertedIntoAncestor): Renamed from insertedInto.
3016         (WebCore::SVGTRefElement::removedFromAncestor): Renamed from removedFrom.
3017         * svg/SVGTRefElement.h:
3018         * svg/SVGTextPathElement.cpp:
3019         (WebCore::SVGTextPathElement::insertedIntoAncestor): Renamed from insertedInto.
3020         (WebCore::SVGTextPathElement::removedFromAncestor): Renamed from removedFrom.
3021         * svg/SVGTextPathElement.h:
3022         * svg/SVGTitleElement.cpp:
3023         (WebCore::SVGTitleElement::insertedIntoAncestor): Renamed from insertedInto.
3024         (WebCore::SVGTitleElement::removedFromAncestor): Renamed from removedFrom.
3025         * svg/SVGTitleElement.h:
3026         * svg/SVGUseElement.cpp:
3027         (WebCore::SVGUseElement::insertedIntoAncestor): Renamed from insertedInto.
3028         (WebCore::SVGUseElement::removedFromAncestor): Renamed from removedFrom.
3029         * svg/SVGUseElement.h:
3030         * svg/animation/SVGSMILElement.cpp:
3031         (WebCore::SVGSMILElement::insertedIntoAncestor): Renamed from insertedInto.
3032         (WebCore::SVGSMILElement::removedFromAncestor): Renamed from removedFrom.
3033         * svg/animation/SVGSMILElement.h:
3034
3035 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
3036
3037         Fix conditions in HTMLSourceElement and HTMLTrackElement's insertedInto and removedFrom
3038         https://bugs.webkit.org/show_bug.cgi?id=178607
3039
3040         Reviewed by Eric Carlson.
3041
3042         Fixed the conditions in insertedInto and removedFrom of HTMLSourceElement and HTMLTrackElement to be
3043         semantically sensisble. Since these elements are only functional when their immediate parents are
3044         HTMLMediaElement and HTMLPictureElement, we have to check that its immediate parent changed, not when
3045         some of its ancestor had changed by insertion or removal.
3046
3047         * html/HTMLSourceElement.cpp:
3048         (WebCore::HTMLSourceElement::insertedInto):
3049         (WebCore::HTMLSourceElement::removedFrom):
3050         * html/HTMLTrackElement.cpp:
3051         (WebCore::HTMLTrackElement::insertedInto):
3052         (WebCore::HTMLTrackElement::removedFrom):
3053
3054 2017-10-20  Keith Miller  <keith_miller@apple.com>
3055
3056         Unreviewed, fix windows build.
3057
3058         * Sources.txt:
3059         * WebCore.xcodeproj/project.pbxproj:
3060
3061 2017-10-20  Daniel Bates  <dabates@apple.com>
3062
3063         Use "= default" for more default constructors and destructors in WebCore
3064         https://bugs.webkit.org/show_bug.cgi?id=178585
3065
3066         Reviewed by Alex Christensen.
3067
3068         Also remove some destructors that would be implicitly generated.
3069
3070         * Modules/applepay/PaymentMerchantSession.h:
3071         (WebCore::PaymentMerchantSession::~PaymentMerchantSession): Deleted.
3072         * platform/ControlStates.h:
3073         (WebCore::ControlStates::~ControlStates): Deleted.
3074         * platform/PlatformEvent.h:
3075         (WebCore::PlatformEvent::~PlatformEvent): Use default.
3076         * platform/PlatformStrategies.h:
3077         (WebCore::PlatformStrategies::PlatformStrategies): Ditto.
3078         * platform/image-decoders/gif/GIFImageReader.h:
3079         (GIFFrameContext::GIFFrameContext):
3080         (GIFFrameContext::~GIFFrameContext): Deleted.
3081         (GIFImageReader::~GIFImageReader): Deleted.
3082         * rendering/RenderBlockFlow.h:
3083         (WebCore::RenderBlockFlow::RenderBlockFlowRareData::~RenderBlockFlowRareData): Deleted.
3084
3085 2017-10-20  Zalan Bujtas  <zalan@apple.com>
3086
3087         [FrameView::layout cleanup] Scheduling layout should be disabled for FrameView::layout
3088         https://bugs.webkit.org/show_bug.cgi?id=178562
3089         <rdar://problem/35089015>
3090
3091         Reviewed by Simon Fraser.
3092
3093         This patch extends the scope of m_layoutSchedulingEnabled. Now layout scheduling is disabled for the entire FrameView::layout(). 
3094         A scheduled layout at the end of FrameView::layout would indicated dirty tree (which is against FrameView::layout's contract).
3095
3096         Covered by existing tests.
3097
3098         * page/FrameView.cpp:
3099         (WebCore::FrameView::layout):
3100
3101 2017-10-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
3102
3103         When destroying a resource, register "only" the clients who are losing their resource as having pending resources
3104         https://bugs.webkit.org/show_bug.cgi?id=178567
3105         <rdar://problem/35064781>
3106
3107         Reviewed by Simon Fraser.
3108
3109         SVGResources::resourceDestroyed() will return a bool indicating whether 
3110         it had a reference to the destroyed resource or not. If it returns true
3111         SVGResourcesCache::resourceDestroyed() will register the client Element
3112         as having pending resources.
3113
3114         * rendering/svg/SVGResources.cpp:
3115         (WebCore::paintingResourceFromSVGPaint):
3116         (WebCore::SVGResources::removeClientFromCache const):
3117         (WebCore::SVGResources::resourceDestroyed):
3118         (WebCore::SVGResources::buildSetOfResources):
3119         (WebCore::SVGResources::resetClipper):
3120         (WebCore::SVGResources::resetFilter):
3121         (WebCore::SVGResources::resetMarkerStart):
3122         (WebCore::SVGResources::resetMarkerMid):
3123         (WebCore::SVGResources::resetMarkerEnd):
3124         (WebCore::SVGResources::resetMasker):
3125         (WebCore::SVGResources::resetFill):
3126         (WebCore::SVGResources::resetStroke):
3127         (WebCore::SVGResources::resetLinkedResource):
3128         * rendering/svg/SVGResources.h:
3129         (WebCore::SVGResources::isEmpty const):
3130         (WebCore::SVGResources::ClipperFilterMaskerData::ClipperFilterMaskerData): Deleted.
3131         (WebCore::SVGResources::MarkerData::MarkerData): Deleted.
3132         (WebCore::SVGResources::FillStrokeData::FillStrokeData): Deleted.
3133         * rendering/svg/SVGResourcesCache.cpp:
3134         (WebCore::SVGResourcesCache::resourceDestroyed):
3135
3136 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
3137
3138         Unify the node removal code in ContainerNode and expand the coverage of NoEventDispatchAssertion
3139         https://bugs.webkit.org/show_bug.cgi?id=178568
3140
3141         Reviewed by Antti Koivisto.
3142
3143         Consolidated the code to remove a child node in ContainerNode into removeAllChildrenWithScriptAssertion
3144         and removeNodeWithScriptAssertion to share code and make the semantics of when it becomes unsafe to run scripts.
3145
3146         Also renamed getChildNodes to collectChildNodes, and made it return NodeVector instead of taking an out argument.
3147
3148         No new tests since there should be no behavioral changes.
3149
3150         * dom/ContainerNode.cpp:
3151         (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Added.
3152         (WebCore::ContainerNode::removeNodeWithScriptAssertion): Added.
3153         (WebCore::collectChildrenAndRemoveFromOldParent):
3154         (WebCore::ContainerNode::takeAllChildrenFrom): Deployed removeAllChildrenWithScriptAssertion.
3155         (WebCore::ContainerNode::notifyChildRemoved): Deleted. Merged into removeNodeWithScriptAssertion.
3156         (WebCore::willRemoveChild): Deleted. Ditto.
3157         (WebCore::willRemoveChildren): Deleted. Merged into removeAllChildrenWithScriptAssertion.
3158         (WebCore::ContainerNode::removeChild): Deployed removeNodeWithScriptAssertion.
3159         (WebCore::ContainerNode::parserRemoveChild): Ditto.
3160         (WebCore::ContainerNode::replaceAllChildren): Deployed removeAllChildrenWithScriptAssertion. Now removes the node
3161         outside executeNodeInsertionWithScriptAssertion but that's okay since executeNodeInsertionWithScriptAssertion
3162         doesn't execute any code with a side effect before invoking the callback.
3163         (WebCore::ContainerNode::removeChildren):
3164         (WebCore::dispatchChildRemovalEvents): Refactored to take Ref<Node>&.
3165         * dom/ContainerNode.h:
3166         (WebCore::collectChildNodes): Renamed from getChildNodes. Also removed the useless comment about NodeVector's
3167         initial size and instead prefer to webkit.org/b/80706 where the number 11 was picked.
3168         * editing/ApplyStyleCommand.cpp:
3169         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
3170         * editing/ReplaceNodeWithSpanCommand.cpp:
3171         (WebCore::swapInNodePreservingAttributesAndChildren):
3172         * svg/SVGUseElement.cpp:
3173         (WebCore::SVGUseElement::clearShadowTree): Added an assertion exception while tearing down the UA shadow tree.
3174
3175 2017-10-20  Youenn Fablet  <youenn@apple.com>
3176
3177         ResourceResponse should have a ServiceWorker source
3178         https://bugs.webkit.org/show_bug.cgi?id=178593
3179
3180         Reviewed by Alex Christensen.
3181
3182         Covered by updated tests.
3183
3184         Added ResourceResponse::Source::ServiceWorker.
3185         Added internals to get FetchResponse source.
3186
3187         * inspector/InspectorNetworkAgent.cpp:
3188         (WebCore::responseSource):
3189         * loader/ResourceLoader.cpp:
3190         (WebCore::logResourceResponseSource):
3191         * page/DiagnosticLoggingKeys.cpp:
3192         (WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
3193         * page/DiagnosticLoggingKeys.h:
3194         * platform/network/ResourceResponseBase.h:
3195         * testing/Internals.cpp:
3196         (WebCore::responseSourceToString):
3197         (WebCore::Internals::fetchResponseSource):
3198         * testing/Internals.h:
3199         * testing/Internals.idl:
3200
3201 2017-10-20  Andy Estes  <aestes@apple.com>
3202
3203         Generated serializers do not properly handle optional interface attributes
3204         https://bugs.webkit.org/show_bug.cgi?id=178542
3205
3206         Reviewed by Sam Weinig.
3207
3208         * bindings/scripts/CodeGeneratorJS.pm:
3209         (GenerateSerializerDefinition):
3210         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3211         (WebCore::JSTestSerialization::serialize):
3212
3213 2017-10-20  Antoine Quint  <graouts@apple.com>
3214
3215         [Web Animations] Provide basic timeline and animation interfaces
3216         https://bugs.webkit.org/show_bug.cgi?id=178526
3217
3218         Reviewed by Dean Jackson.
3219
3220         We're getting Web Animations work started by implementing a very minimal codebase which provides
3221         a DocumentTimeline class which has an instance created for each Document. The parent class,
3222         AnimationTimeline, allows for animations to be added and removed, and animations can be created
3223         using the Animation class, with an optional timeline as parameter.
3224
3225         Tests: webanimations/animation-creation-basic.html
3226                webanimations/document-timeline.html
3227
3228         * CMakeLists.txt:
3229         * Configurations/FeatureDefines.xcconfig:
3230         * DerivedSources.make:
3231         * PlatformWin.cmake:
3232         * WebCore.xcodeproj/project.pbxproj:
3233         * animation/AnimationTimeline.cpp: Added.
3234         (WebCore::AnimationTimeline::AnimationTimeline):
3235         (WebCore::AnimationTimeline::~AnimationTimeline):
3236         (WebCore::AnimationTimeline::addAnimation):
3237         (WebCore::AnimationTimeline::removeAnimation):
3238         * animation/AnimationTimeline.h: Added.
3239         (WebCore::AnimationTimeline::isDocumentTimeline const):
3240         (WebCore::AnimationTimeline::classType const):
3241         * animation/AnimationTimeline.idl: Added.
3242         * animation/DocumentTimeline.cpp: Added.
3243         (WebCore::DocumentTimeline::create):
3244         (WebCore::DocumentTimeline::DocumentTimeline):
3245         * animation/DocumentTimeline.h: Added.
3246         * animation/DocumentTimeline.idl: Added.
3247         * animation/WebAnimation.cpp: Added.
3248         (WebCore::WebAnimation::create):
3249         (WebCore::WebAnimation::WebAnimation):
3250         (WebCore::WebAnimation::~WebAnimation):
3251         * animation/WebAnimation.h: Added.
3252         * animation/WebAnimation.idl: Added.
3253         * bindings/js/JSAnimationTimelineCustom.cpp: Added.
3254         (WebCore::toJSNewlyCreated):
3255         (WebCore::toJS):
3256         * bindings/js/WebCoreBuiltinNames.h:
3257         * dom/Document.cpp:
3258         (WebCore::Document::timeline):
3259         * dom/Document.h:
3260         * dom/Document.idl:
3261         * page/RuntimeEnabledFeatures.h:
3262         (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled const):
3263
3264 2017-10-20  Commit Queue  <commit-queue@webkit.org>
3265
3266         Unreviewed, rolling out r223744, r223750, and r223751.
3267         https://bugs.webkit.org/show_bug.cgi?id=178594
3268
3269         These caused consistent failures in test that existed and were
3270         added in the patches. (Requested by mlewis13 on #webkit).
3271
3272         Reverted changesets:
3273
3274         "[JSC] ScriptFetcher should be notified directly from module
3275         pipeline"
3276         https://bugs.webkit.org/show_bug.cgi?id=178340
3277         https://trac.webkit.org/changeset/223744
3278
3279         "Unreviewed, fix changed line number in test expect files"
3280         https://bugs.webkit.org/show_bug.cgi?id=178340
3281         https://trac.webkit.org/changeset/223750
3282
3283         "Unreviewed, follow up to reflect comments"
3284         https://bugs.webkit.org/show_bug.cgi?id=178340
3285         https://trac.webkit.org/changeset/223751
3286
3287 2017-10-20  Zalan Bujtas  <zalan@apple.com>
3288
3289         [FrameView::layout cleanup] Move can-enter-layout logic to a separate function
3290         https://bugs.webkit.org/show_bug.cgi?id=178546
3291         <rdar://problem/35083894>
3292
3293         Reviewed by Antti Koivisto.
3294
3295         No change in functionality.
3296
3297         * page/FrameView.cpp:
3298         (WebCore::FrameView::canPerformLayout const):
3299         (WebCore::FrameView::layout): We already assert on certain reentrancy conditions, loggig the reason
3300         does not seem to have high value.
3301         * page/FrameView.h:
3302
3303 2017-10-20  Dean Jackson  <dino@apple.com>
3304
3305         Add createImageBitmap to Window and Worker
3306         https://bugs.webkit.org/show_bug.cgi?id=178573
3307         <rdar://problem/35092692>
3308
3309         Reviewed by Sam Weinig.
3310
3311         Implement the createImageBitmap functions that are exposed on the Window
3312         and Worker objects.
3313
3314         Covered by the Web Platform Tests.
3315
3316         * html/ImageBitmap.cpp: Make sure to call suspendIfNeeded since this is
3317         an ActiveDOMObject.
3318         * html/ImageBitmap.h: Change the order of the classes in the Variant
3319         to match the order of definitions in the IDL.
3320         * page/DOMWindow.cpp:
3321         (WebCore::DOMWindow::createImageBitmap): Call ImageBitmap::createPromise.
3322         * page/DOMWindow.h:
3323         * page/WindowOrWorkerGlobalScope.idl: Add the createImageBitmap methods.
3324         * workers/WorkerGlobalScope.cpp:
3325         (WebCore::WorkerGlobalScope::createImageBitmap): Call ImageBitmap::createPromise.
3326         * workers/WorkerGlobalScope.h:
3327
3328 2017-10-20  Joanmarie Diggs  <jdiggs@igalia.com>
3329
3330         AX: [ATK] Events missing and state incorrect for aria-activedescendant
3331         https://bugs.webkit.org/show_bug.cgi?id=178523
3332
3333         Reviewed by Chris Fleizach.
3334
3335         When the aria-activedescendant of an element changes, emit object:state-changed:focused.
3336         When a focused element has a valid active descendant, do not expose the focused state on
3337         the element, but rather on the active descendant. Also expose the focusable state on the
3338         active descendant.
3339
3340         Tests: accessibility/gtk/aria-activedescendant-changed-notification.html
3341                accessibility/gtk/aria-activedescendant.html
3342
3343         * accessibility/AccessibilityObject.cpp:
3344         (WebCore::AccessibilityObject::isActiveDescendantOfFocusedContainer const):
3345         (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
3346         * accessibility/AccessibilityObject.h:
3347         * accessibility/AccessibilityRenderObject.cpp:
3348         (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
3349         * accessibility/atk/AXObjectCacheAtk.cpp:
3350         (WebCore::AXObjectCache::postPlatformNotification):
3351         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3352         (setAtkStateSetFromCoreObject):
3353
3354 2017-10-20  Ms2ger  <Ms2ger@igalia.com>
3355
3356         Add the MAX_CLIENT_WAIT_TIMEOUT_WEBGL constant to WebGL2RenderingContext.
3357         https://bugs.webkit.org/show_bug.cgi?id=178572
3358
3359         Reviewed by Žan Doberšek.
3360
3361         Test: fast/canvas/webgl/webgl2/constants.html
3362
3363         * html/canvas/WebGL2RenderingContext.idl:
3364
3365 2017-10-20  Miguel Gomez  <magomez@igalia.com>
3366
3367         [GTK][WPE] Fix review comments on WEBPImageDecoder
3368         https://bugs.webkit.org/show_bug.cgi?id=178080
3369
3370         Reviewed by Said Abou-Hallawa.
3371
3372         Properly free the demuxer in case of error, improve the code to detect the first
3373         required frame to decode, fix the usage of the DecodingStatus and some styling
3374         changes.
3375
3376         Covered by existent tests.
3377
3378         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
3379         (WebCore::webpFrameAtIndex):
3380         (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
3381         (WebCore::WEBPImageDecoder::decode):
3382         (WebCore::WEBPImageDecoder::decodeFrame):
3383         (WebCore::WEBPImageDecoder::initFrameBuffer):
3384         (WebCore::WEBPImageDecoder::clearFrameBufferCache):
3385
3386 2017-10-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3387
3388         [Curl] Clean up old style code in old curl files.
3389         https://bugs.webkit.org/show_bug.cgi?id=178569
3390
3391         Reviewed by Ryosuke Niwa.
3392
3393         * platform/network/curl/AuthenticationChallenge.h:
3394         * platform/network/curl/CertificateInfo.h:
3395         * platform/network/curl/CookieJarCurl.h:
3396         * platform/network/curl/CurlCacheEntry.h:
3397         * platform/network/curl/CurlCacheManager.cpp:
3398         (WebCore::CurlCacheManager::singleton):
3399         (WebCore::CurlCacheManager::getInstance): Deleted.
3400         * platform/network/curl/CurlCacheManager.h:
3401         * platform/network/curl/CurlContext.cpp:
3402         (WebCore::CurlContext::singleton):
3403         * platform/network/curl/CurlContext.h:
3404         (WebCore::CurlContext::singleton): Deleted.
3405         * platform/network/curl/CurlJobManager.cpp:
3406         (WebCore::CurlJobManager::singleton):
3407         * platform/network/curl/CurlJobManager.h:
3408         (WebCore::CurlJobManager::singleton): Deleted.
3409         * platform/network/curl/CurlRequest.cpp:
3410         (WebCore::CurlRequest::setupTransfer):
3411         * platform/network/curl/CurlRequest.h:
3412         * platform/network/curl/CurlRequestDelegate.h:
3413         * platform/network/curl/CurlResponse.h:
3414         (WebCore::CurlResponse::isolatedCopy const):
3415         * platform/network/curl/CurlSSLHandle.h:
3416         * platform/network/curl/CurlSSLVerifier.h:
3417         * platform/network/curl/DownloadBundle.h:
3418         * platform/network/curl/MultipartHandle.h:
3419         * platform/network/curl/ResourceError.h:
3420         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
3421         (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
3422         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
3423         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
3424         (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
3425         (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
3426         * platform/network/curl/ResourceRequest.h:
3427         (WebCore::ResourceRequest::ResourceRequest):
3428         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
3429         (WebCore::ResourceRequest::cfURLRequest const):
3430         (WebCore::ResourceRequest::httpPipeliningEnabled):
3431         (WebCore::ResourceRequest::setHTTPPipeliningEnabled):
3432         (WebCore::ResourceRequest::doUpdatePlatformRequest):
3433         (WebCore::ResourceRequest::doUpdateResourceRequest):
3434         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
3435         (WebCore::ResourceRequest::doUpdateResourceHTTPBody):
3436         (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
3437         * platform/network/curl/ResourceResponseCurl.cpp:
3438         (WebCore::ResourceResponse::isAppendableHeader):
3439         (WebCore::ResourceResponse::ResourceResponse):
3440
3441 2017-10-20  Frederic Wang  <fwang@igalia.com>
3442
3443         RenderLayerCompositor: Move implementation of simple methods into the header file.
3444         https://bugs.webkit.org/show_bug.cgi?id=178514
3445
3446         Reviewed by Darin Adler.
3447
3448         No new tests, behavior unchanged.
3449
3450 2017-10-19  Antti Koivisto  <antti@apple.com>
3451
3452         Support ::before/::after pseudo elements on elements with display:contents
3453         https://bugs.webkit.org/show_bug.cgi?id=178513
3454
3455         Reviewed by Ryosuke Niwa.
3456
3457         Add support for
3458
3459             div { display:contents }
3460             div::after { content:'foo' }
3461
3462         That is support non-box generating elements with generated content.