Attempt to fix the build after r230921
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-04-23  Daniel Bates  <dabates@apple.com>
2
3         Attempt to fix the build after r230921
4         (https://bugs.webkit.org/show_bug.cgi?id=159464)
5
6         Pass Same-Site info through.
7
8         * platform/network/cf/CookieJarCFNet.cpp:
9         (WebCore::cookieRequestHeaderFieldValue):
10         * platform/network/curl/CookieJarCurl.cpp:
11         (WebCore::cookieRequestHeaderFieldValue):
12         * platform/network/curl/CookieJarCurlDatabase.cpp:
13         (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
14         * platform/network/soup/CookieJarSoup.cpp:
15         (WebCore::cookieRequestHeaderFieldValue):
16
17 2018-04-23  Ryan Haddad  <ryanhaddad@apple.com>
18
19         Unreviewed, speculative macOS build fix attempt.
20
21         * Modules/mediasource/SourceBuffer.cpp:
22         (WebCore::SourceBuffer::provideMediaData):
23
24 2018-04-23  Daniel Bates  <dabates@apple.com>
25
26         Implement Same-Site cookies
27         https://bugs.webkit.org/show_bug.cgi?id=159464
28         <rdar://problem/27196358>
29
30         Reviewed by Brent Fulgham.
31
32         Implements support for Same-Site cookies as per <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>.
33         The implementation is materially consistent with the spec. though implements the computation
34         for a document's "site for cookies" indirectly as part of loading its frame. This is done to
35         avoid traversing the frame tree on each subresource request initiated by the document or one
36         of its workers. We take advantage of the fact that Web Workers and Service Workers use their
37         host document's loader to load resources on their behalf to use the correct "site for cookies"
38         for requests (e.g. fetch()) initiating by them without the need to duplicate and store the
39         host document's "site for cookies" in the worker's script execution context.
40
41         The implementation differs from the spec. in the handling of about: URLs and the empty URL
42         and makes the implementation in WebKit match the behavior of Chrome and Firefox as well as
43         consistent with origin inheritance as described in <https://html.spec.whatwg.org/multipage/browsers.html#origin>
44         (16 April 2018). Specifically, requests to about:blank, about:srcdoc and the empty URL ("")
45         are treated as same-site because these URLs inherit their origin from their owner.
46
47         Tests: http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html
48                http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html
49                http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
50                http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html
51                http/tests/cookies/same-site/fetch-in-about-blank-page.html
52                http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html
53                http/tests/cookies/same-site/fetch-in-cross-origin-page.html
54                http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html
55                http/tests/cookies/same-site/fetch-in-cross-origin-worker.html
56                http/tests/cookies/same-site/fetch-in-same-origin-page.html
57                http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html
58                http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html
59                http/tests/cookies/same-site/fetch-in-same-origin-worker.html
60                http/tests/cookies/same-site/popup-cross-site-post.html
61                http/tests/cookies/same-site/popup-cross-site.html
62                http/tests/cookies/same-site/popup-same-site-post.html
63                http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
64                http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html
65                http/tests/cookies/same-site/popup-same-site.html
66
67         * Sources.txt: Add source file SameSiteInfo.cpp.
68         * WebCore.xcodeproj/project.pbxproj: Add source files SameSiteInfo.{cpp, h}.
69         * dom/Document.cpp:
70         (WebCore::Document::initSecurityContext): Modified to call SecurityPolicy::shouldInheritSecurityOriginFromOwner().
71         (WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const): Ditto.
72         (WebCore::shouldInheritSecurityOriginFromOwner): Deleted; moved to SecurityPolicy.
73         * dom/Document.h:
74         (WebCore::Document::firstPartyForSameSiteCookies const): Added.
75         (WebCore::Document::setFirstPartyForSameSiteCookies): Added.
76         * loader/CookieJar.cpp:
77         (WebCore::sameSiteInfo): Returns the same-site info for the request used to load the specified document.
78         (WebCore::cookies): Pass the same-site info down to the platform.
79         (WebCore::cookieRequestHeaderFieldProxy): Ditto.
80         (WebCore::setCookies): Ditto.
81         (WebCore::cookieRequestHeaderFieldValue): Ditto.
82         (WebCore::getRawCookies): Ditto.
83         * loader/DocumentLoader.cpp:
84         (WebCore::DocumentLoader::willSendRequest): Add same-site info to the request.
85         (WebCore::DocumentLoader::startLoadingMainResource): Update a FIXME comment to explain that
86         we can simplify ResourceRequestBase if we can remove the call to addExtraFieldsToMainResourceRequest()
87         here. Specifically, we would not need to differentiate between a request with an unspecified
88         same-site state (default state of a new request) from a request whose same-site state has
89         been explicitly set if we can assume that the same-site state of a request is set exactly
90         once. In absence of this guarantee we need an "unspecified" state to avoid overriding existing
91         same-site information computed with a null initiating document (the case of a new address bar
92         initiated load) from a load initiated by the document associated with this loader.
93         * loader/FrameLoader.cpp:
94         (WebCore::FrameLoader::setFirstPartyForCookies): Modified to also update the first party for
95         same-site cookies ("site for cookies").
96         (WebCore::FrameLoader::load): Add same-site info to the request.
97         (WebCore::FrameLoader::reload): Ditto.
98         (WebCore::FrameLoader::setOriginalURLForDownloadRequest): Ditto.
99         (WebCore::FrameLoader::addExtraFieldsToRequest): If the request does not already have
100         same-site info then compute it and add it to the request. Mark main frame main resource
101         requests as a "top-site".
102         (WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded): Implements the "'Same-site' and 'cross-site'
103         Requests" algorithm from <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-2.1>.
104         (WebCore::createWindow): Add same-site info to the request.
105         * loader/FrameLoader.h:
106         * loader/ResourceLoader.cpp:
107         (WebCore::ResourceLoader::init): Ditto.
108         * page/DOMWindow.cpp:
109         (WebCore::DOMWindow::createWindow): Ditto.
110         * page/SecurityPolicy.cpp:
111         (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): Moved from Document.cpp.
112         * page/SecurityPolicy.h:
113         * platform/CookiesStrategy.h:
114         * platform/network/CacheValidation.cpp:
115         (WebCore::headerValueForVary): Pass the same-site info down to the platform.
116         * platform/network/CookieRequestHeaderFieldProxy.h:
117         (WebCore::CookieRequestHeaderFieldProxy::encode const): Encode same-site bits.
118         (WebCore::CookieRequestHeaderFieldProxy::decode): Decode same-site bits.
119         * platform/network/PlatformCookieJar.h:
120         * platform/network/ResourceRequestBase.cpp:
121         (WebCore::ResourceRequestBase::setAsIsolatedCopy): Added.
122         (WebCore::ResourceRequestBase::isSameSite const): Added.
123         (WebCore::ResourceRequestBase::setIsSameSite): Added.
124         (WebCore::ResourceRequestBase::isTopSite const): Added.
125         (WebCore::ResourceRequestBase::setIsTopSite): Added.
126         (WebCore::equalIgnoringHeaderFields):
127         * platform/network/ResourceRequestBase.h:
128         (WebCore::ResourceRequestBase::isSameSiteUnspecified const): Added. See comment for DocumentLoader::startLoadingMainResource()
129         for more details.
130         (WebCore::registrableDomainsAreEqual): Added.
131         (WebCore::ResourceRequestBase::encodeBase const): Encode same-site bits.
132         (WebCore::ResourceRequestBase::decodeBase): Decode same-site bits.
133         * platform/network/SameSiteInfo.cpp: Added.
134         (WebCore::SameSiteInfo::create):
135         * platform/network/SameSiteInfo.h: Added.
136         (WebCore::SameSiteInfo::encode const):
137         (WebCore::SameSiteInfo::decode):
138         * platform/network/cf/CookieJarCFNet.cpp:
139         (WebCore::setCookiesFromDOM): Pass Same-Site info down.
140         (WebCore::cookiesForDOM): Ditto.
141         (WebCore::cookieRequestHeaderFieldValue): Ditto.
142         (WebCore::getRawCookies): Ditto.
143         * platform/network/cf/ResourceRequestCFNet.cpp:
144         (WebCore::siteForCookies): Added.
145         (WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
146         (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
147         * platform/network/cocoa/ResourceRequestCocoa.mm:
148         (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
149         (WebCore::siteForCookies): Added.
150         (WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
151         * platform/network/curl/CookieJarCurl.cpp:
152         (WebCore::cookiesForDOM): Pass Same-Site info down.
153         (WebCore::setCookiesFromDOM): Ditto.
154         (WebCore::cookieRequestHeaderFieldValue): Ditto.
155         (WebCore::getRawCookies): Ditto.
156         * platform/network/curl/CookieJarCurl.h:
157         * platform/network/curl/CookieJarCurlDatabase.cpp:
158         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): Ditto.
159         (WebCore::CookieJarCurlDatabase::cookiesForDOM const): Ditto.
160         (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): Ditto.
161         (WebCore::CookieJarCurlDatabase::getRawCookies const): Ditto.
162         * platform/network/curl/CookieJarCurlDatabase.h:
163         * platform/network/curl/ResourceHandleCurl.cpp:
164         (WebCore::ResourceHandle::createCurlRequest): Ditto.
165         * platform/network/mac/CookieJarMac.mm:
166         (WebCore::cookiesForURL): Added; shared function to return the cookies based on the specified criterion. 
167         (WebCore::setHTTPCookiesForURL): Moved from the bottom of the file to top to be closer to the other
168         CFNetwork helper functions. Modified to support fetching same-site cookies.
169         (WebCore::httpCookiesForURL): Moved to be under setHTTPCookiesForURL(). Modified to call cookiesForURL().
170         Note the SPI used in cookiesForURL() apply the same criterion for whether to fetch secure cookies as we
171         were computing here. That is, the CFNetwork SPI only returns secure cookies if the specified URL's scheme
172         case-insensitively matches "https".
173         (WebCore::cookiesInPartitionForURL): Wrote in terms of cookiesForURL().
174         (WebCore::cookiesForSession): Pass the Same-Site info.
175         (WebCore::cookiesForDOM): Ditto.
176         (WebCore::cookieRequestHeaderFieldValue): Ditto.
177         (WebCore::setCookiesFromDOM): Ditto.
178         (WebCore::getRawCookies): Ditto.
179         (WebCore::deleteCookie): Pass std::nullopt for the Same-Site info so that we do not consider the SameSite
180         attribute when fetching cookies to delete.
181         * platform/network/soup/CookieJarSoup.cpp:
182         (WebCore::setCookiesFromDOM): Pass the Same-Site info.
183         (WebCore::cookiesForDOM): Ditto.
184         (WebCore::cookieRequestHeaderFieldValue): Ditto.
185         (WebCore::getRawCookies): Ditto.
186         * workers/service/context/ServiceWorkerThreadProxy.cpp:
187         (WebCore::createPageForServiceWorker): Set the first party for same site cookies ("site for cookies") to
188         the script URL.
189         * xml/XSLTProcessor.cpp:
190         (WebCore::XSLTProcessor::createDocumentFromSource): Copy the first party for same-site cookies to the
191         new document.
192
193 2018-04-23  Chris Dumez  <cdumez@apple.com>
194
195         HTML String load cannot be prevented by responding 'Cancel' asynchronously in decidePolicyForNavigationAction
196         https://bugs.webkit.org/show_bug.cgi?id=184848
197         <rdar://problem/39145306>
198
199         Reviewed by Brady Eidson.
200
201         When calling loadHTMLString on a WebView, we end up doing a load for 'about:blank'
202         with substitute data. In such case, we want to do a regular asynchronous policy
203         delegate check, there is no reason we need it to be synchronous. Update our check
204         to make sure we only do a synchronous policy check for initial 'about:blank' loads
205         that do not have substitute data.
206
207         * loader/PolicyChecker.cpp:
208         (WebCore::PolicyChecker::checkNavigationPolicy):
209
210 2018-04-23  Wenson Hsieh  <wenson_hsieh@apple.com>
211
212         [Extra zoom mode] 100vw is roughly half of the viewport width in extra zoom mode
213         https://bugs.webkit.org/show_bug.cgi?id=184871
214         <rdar://problem/39477595>
215
216         Reviewed by Andy Estes.
217
218         Currently, when computing CSS viewport units, we use ViewportConfiguration::initialScaleIgnoringContentSize().
219         This method computes an initial scale from the layout width and height without relying on any information
220         derived from the current content size. This is done to ensure that the content size and viewport dimensions for
221         CSS viewport units should not be simultaneously dependent on each other.
222
223         Since shrink-to-fit heuristics depend on content size, we currently assume that shrink-to-fit is disabled when
224         computing initialScaleIgnoringContentSize, by always passing in `false` for `shouldIgnoreScalingConstraints`.
225         However, in extra zoom mode, the opposite is true: since we force both `m_canIgnoreScalingConstraints` and
226         `m_forceHorizontalShrinkToFit` to be `true` in this mode, we will always try to shrink-to-fit regardless of
227         content size.
228
229         Because of this shrink-to-fit disparity between `initialScale` and `initialScaleIgnoringContentSize`, viewport
230         units in extra zoom mode are currently computed assuming an initial scale set by the page, whereas the real
231         viewport is scaled to fit, which causes any lengths computed in terms of vw and vh to be incorrect. To fix this,
232         we introduce a version of shouldIgnoreScalingConstraints() that returns `true` iff scaling constraints are
233         always ignored, regardless of content size. We then use this in initialScaleIgnoringContentSize, instead of
234         always passing in `false` for `shouldIgnoreScalingConstraints`.
235
236         Test: fast/css/extrazoom/viewport-units-shrink-to-fit.html
237
238         * page/ViewportConfiguration.cpp:
239         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
240         (WebCore::ViewportConfiguration::initialScaleIgnoringContentSize const):
241         * page/ViewportConfiguration.h:
242
243 2018-04-23  Zalan Bujtas  <zalan@apple.com>
244
245         [Simple line layout] Generate inline boxtree using simple line layout runs.
246         https://bugs.webkit.org/show_bug.cgi?id=184833
247
248         Reviewed by Antti Koivisto.
249
250         RenderBlockFlow::ensureLineBoxes triggers line layout on the block content to replace
251         the simple line layout runs with an inline boxtree. The runs generated by the fast path
252         should always match the inline tree boxes.
253         In this patch instead of triggering layout, we just convert the simple line runs to
254         inline boxes.
255         Currently, it works with only one, non-paginated text renderer, but we should be
256         able to extend it to all the simple line layout content.   
257
258         Covered by existing tests.
259
260         * rendering/InlineBox.h:
261         (WebCore::InlineBox::setHasHyphen):
262         (WebCore::InlineBox::setCanHaveLeadingExpansion):
263         (WebCore::InlineBox::setCanHaveTrailingExpansion):
264         (WebCore::InlineBox::setForceTrailingExpansion):
265         (WebCore::InlineBox::setForceLeadingExpansion):
266         (WebCore::InlineBox::hasHyphen const):
267         (WebCore::InlineBox::canHaveLeadingExpansion const):
268         (WebCore::InlineBox::canHaveTrailingExpansion const):
269         (WebCore::InlineBox::forceTrailingExpansion const):
270         * rendering/RenderBlockFlow.cpp:
271         (WebCore::RenderBlockFlow::ensureLineBoxes):
272         * rendering/RenderBlockFlow.h:
273         * rendering/SimpleLineLayoutFlowContents.h:
274         (WebCore::SimpleLineLayout::FlowContents::segmentForRun const):
275         * rendering/SimpleLineLayoutFunctions.cpp:
276         (WebCore::SimpleLineLayout::canUseForLineBoxTree):
277         (WebCore::SimpleLineLayout::initializeInlineBox):
278         (WebCore::SimpleLineLayout::generateLineBoxTree):
279         * rendering/SimpleLineLayoutFunctions.h:
280         * rendering/SimpleLineLayoutResolver.cpp:
281         (WebCore::SimpleLineLayout::RunResolver::rangeForLine const):
282         * rendering/SimpleLineLayoutResolver.h:
283
284 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
285
286         [CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, CoordinatedGraphicsLayer
287         https://bugs.webkit.org/show_bug.cgi?id=184881
288
289         Reviewed by Michael Catanzaro.
290
291         Remove the redundant findFirstDescendantWithContentsRecursively() and
292         setVisibleContentRectTrajectoryVector() methods on the
293         CoordinatedGraphicsLayer class.
294
295         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
296         (WebCore::CoordinatedGraphicsLayer::findFirstDescendantWithContentsRecursively): Deleted.
297         (WebCore::CoordinatedGraphicsLayer::setVisibleContentRectTrajectoryVector): Deleted.
298         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
299
300 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
301
302         [CoordGraphics] TiledBackingStore unnecessarily tracks alpha support value
303         https://bugs.webkit.org/show_bug.cgi?id=184880
304
305         Reviewed by Michael Catanzaro.
306
307         Drop the m_supportsAlpha member from the TiledBackingStore class. The
308         member value was unused. TiledBackingStore::setSupportsAlpha() method
309         is removed.
310
311         TiledBackingStore::setSupportsAlpha() invalidated the backing store,
312         so CoordinatedGraphicsLayer::setContentsOpaque() now enforces the same
313         behavior by manually updating the m_needsDisplay struct. This means
314         that during the following layer flush the backing store is repainted
315         in its entirety.
316
317         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
318         (WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
319         (WebCore::CoordinatedGraphicsLayer::createBackingStore):
320         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
321         (WebCore::TiledBackingStore::TiledBackingStore):
322         (WebCore::TiledBackingStore::setSupportsAlpha): Deleted.
323         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
324
325 2018-04-23  Thibault Saunier  <tsaunier@igalia.com>
326
327         [GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method
328         https://bugs.webkit.org/show_bug.cgi?id=184650
329
330         Reviewed by Philippe Normand.
331
332         In the playbin3 case we can assume that if the GstStream is selected by default,
333         it is the Main track of that kind.
334
335         No new tests are added as:
336             * It relies on playbin3 case which support might be compiled out
337             * we already have a few test that are currently disabled in the mediastream
338               testsuite. This patch is part of the work to enable them.
339
340         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
341         (WebCore::AudioTrackPrivateGStreamer::kind const):
342         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
343         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
344         (WebCore::VideoTrackPrivateGStreamer::kind const):
345         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
346
347 2018-04-23  Alicia Boya García  <aboya@igalia.com>
348
349         [MSE] Add allSamplesInTrackEnqueued event
350         https://bugs.webkit.org/show_bug.cgi?id=184737
351
352         MediaSource has a .endOfStream() method to signal when there are no more frames
353         after the ones currently buffered.
354
355         This bit of data is important for some multimedia frameworks. For instance, in
356         GStreamer a stream of frames being decoded should be terminated by a
357         'end-of-stream' (EOS) event that has a similar meaning. Some GStreamer elements
358         will expect this event in order to work properly under some circumstances.
359
360         Unfortunately currently WebKit provides no mechanism for this: an event of
361         sorts should be emitted after no more frames are going to be enqueued to signal
362         the end of the stream. The closest mechanism WebKit has for this is
363         `markEndOfStream()`, but it's not exactly the same: markEndOfStream() informs
364         that -- as far as network buffering is concerned -- we are done; but at that
365         point there may still be (and often are) many frames waiting in the
366         decodeQueue, so it would be wrong to signal the decoder that there are no more
367         frames.
368
369         This patch introduces a new optional method in SourceBufferPrivate,
370         `allSamplesInTrackEnqueued(const AtomicString& trackID)` that is called
371         whenever the MediaSource is in "ended" state (the user has called
372         `MediaSource.endOfStream()`) and the decodeQueue is empty. Media framework
373         implementations can use this method to send a EOS event to a decoder that needs
374         it.
375
376         Reviewed by Xabier Rodriguez-Calvar.
377
378         * Modules/mediasource/MediaSource.cpp:
379         (WebCore::MediaSource::streamEndedWithError):
380         * Modules/mediasource/SourceBuffer.cpp:
381         (WebCore::SourceBuffer::provideMediaData):
382         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
383         (WebCore::SourceBuffer::trySignalAllSamplesEnqueued):
384         * Modules/mediasource/SourceBuffer.h:
385         * platform/graphics/SourceBufferPrivate.h:
386         (WebCore::SourceBufferPrivate::allSamplesInTrackEnqueued):
387         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
388         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
389         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
390         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
391         (WebCore::PlaybackPipeline::allSamplesInTrackEnqueued):
392         * platform/graphics/gstreamer/mse/PlaybackPipeline.h:
393         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
394         (WebCore::SourceBufferPrivateGStreamer::allSamplesInTrackEnqueued):
395         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
396
397 2018-04-23  Ms2ger  <Ms2ger@igalia.com>
398
399         Avoid uninitialized memory read.
400         https://bugs.webkit.org/show_bug.cgi?id=184505
401         <rdar://problem/39348325>
402
403         Reviewed by Dean Jackson.
404
405         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-bounds.html
406
407         * html/ImageBitmap.cpp:
408         (WebCore::croppedSourceRectangleWithFormatting):
409
410 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
411
412         [TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
413         https://bugs.webkit.org/show_bug.cgi?id=184810
414
415         Reviewed by Carlos Garcia Campos.
416
417         Turn TextureMapperBackingStore into a simple interface that doesn't
418         inherit from RefCounted<>. Instead, push that inheritance off to the
419         classes that implement the TextureMapperBackingStore interface. This
420         narrows down the purpose of TextureMapperBackingStore towards a simple
421         interface that TextureMapper algorithms can work with.
422
423         TextureMapperLayer has its m_backingStore member variable turn into
424         a simple pointer instead of a RefPtr<>. Setter method and call sites of
425         that method are updated to reflect that.
426
427         TextureMapperTiledBackingStore now inherits from RefCounted<> directly,
428         instead of through TextureMapperBackingStore.
429
430         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
431         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
432         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
433         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
434         * platform/graphics/texmap/TextureMapperBackingStore.h:
435         * platform/graphics/texmap/TextureMapperLayer.cpp:
436         (WebCore::TextureMapperLayer::setBackingStore):
437         * platform/graphics/texmap/TextureMapperLayer.h:
438         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
439
440 2018-04-22  Zan Dobersek  <zdobersek@igalia.com>
441
442         [AsyncScrolling] Add generic ScrollingThread implementation
443         https://bugs.webkit.org/show_bug.cgi?id=184809
444
445         Reviewed by Yusuke Suzuki.
446
447         Add a generic ScrollingThread implementation that internally uses
448         RunLoop facilities to run the scrolling thread and dispatch
449         callbacks on that thread.
450
451         ScrollingThread::initializeRunLoop() retrieves address of the
452         thread-specific RunLoop and signals the Condition object.
453         ScrollingThread::wakeUpRunLoop() uses RunLoop::dispatch() to schedule
454         callback dispatches on the scrolling thread.
455
456         ScrollingThread::createThreadIfNeeded() mimics Cocoa implementation and
457         waits for the RunLoop address to be retrieved before continuing.
458
459         * SourcesGTK.txt: Add to build.
460         * SourcesWPE.txt: Ditto.
461         * page/scrolling/ScrollingThread.cpp:
462         (WebCore::ScrollingThread::createThreadIfNeeded):
463         * page/scrolling/ScrollingThread.h:
464         * page/scrolling/generic/ScrollingThreadGeneric.cpp: Added.
465         (WebCore::ScrollingThread::initializeRunLoop):
466         (WebCore::ScrollingThread::wakeUpRunLoop):
467
468 2018-04-22  Zan Dobersek  <zdobersek@igalia.com>
469
470         [CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraphicsState
471         https://bugs.webkit.org/show_bug.cgi?id=184811
472
473         Reviewed by Carlos Garcia Campos.
474
475         Remove the unused contentsSize and coveredRect attributes on the
476         CoordinatedGraphicsState struct. CoordinatedGraphicsLayer::coverRect()
477         method is now unused and can also be removed.
478
479         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
480         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
481
482 2018-04-21  Daniel Bates  <dabates@apple.com>
483
484         Cleanup CookieRequestHeaderFieldProxy
485         https://bugs.webkit.org/show_bug.cgi?id=184868
486
487         Remove extraneous whitespace that I inadvertently added.
488
489         * platform/network/CookieRequestHeaderFieldProxy.h:
490         (WebCore::CookieRequestHeaderFieldProxy::decode):
491
492 2018-04-21  Daniel Bates  <dabates@apple.com>
493
494         Cleanup CookieRequestHeaderFieldProxy
495         https://bugs.webkit.org/show_bug.cgi?id=184868
496
497         Reviewed by Youenn Fablet.
498
499         Simplify the struct CookieRequestHeaderFieldProxy and make it consistent with other structs.
500         Among other changes, remove constructors for CookieRequestHeaderFieldProxy as they are
501         unnecessary as all supported compilers support non-static data member initializers (NSDMI)
502         for aggregates, remove prefix "m_" from the name of fields as this is struct exists for
503         convenience and offers no encapsulation and simplify decoding logic of this struct.
504
505         No functionality changed. So, no new tests.
506
507         * loader/CookieJar.cpp:
508         (WebCore::cookieRequestHeaderFieldProxy):
509         * platform/network/CookieRequestHeaderFieldProxy.h:
510         (WebCore::CookieRequestHeaderFieldProxy::encode const):
511         (WebCore::CookieRequestHeaderFieldProxy::decode):
512         (WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy): Deleted.
513         * platform/network/SocketStreamHandleImpl.cpp:
514         (WebCore::cookieDataForHandshake):
515         * platform/network/cf/CookieJarCFNet.cpp:
516         (WebCore::cookieRequestHeaderFieldValue):
517         * platform/network/curl/CookieJarCurl.cpp:
518         (WebCore::cookieRequestHeaderFieldValue):
519         * platform/network/curl/CookieJarCurlDatabase.cpp:
520         (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
521         * platform/network/mac/CookieJarMac.mm:
522         (WebCore::cookieRequestHeaderFieldValue):
523         * platform/network/soup/CookieJarSoup.cpp:
524         (WebCore::cookieRequestHeaderFieldValue):
525
526 2018-04-21  Antoine Quint  <graouts@apple.com>
527
528         [Modern Media Controls] Show a loading indicator after pressing the play button in compact mode
529         https://bugs.webkit.org/show_bug.cgi?id=184863
530         <rdar://problem/38939468>
531
532         Reviewed by Dean Jackson.
533
534         We now display a loading indicator after pressing the play button when in compact mode. We also update the
535         behavior to use assets provided through WebKitAdditions (see webkit.org/b/184862) for the play button and
536         the invalid icon. Additionally, we always show a 20% opaque black overlay in the background while any piece
537         of user interface is up.
538
539         * Modules/modern-media-controls/controls/compact-activity-indicator.css: Added.
540         (button.compact-activity-indicator > picture): The loading indicator asset is a sprite made of 23 frames, so
541         we specify the mask size (since all buttons are rendered via a mask) to be 23 * 100% the rendered size. The
542         display of the loading indicator is performed with a first intro animation which runs once through the first
543         8 frames and then a continuously looping animation going through the remaining frames. We use a frames()
544         timing function to achieve the frame-by-frame effect while using only from/to keyframe animations. When we
545         fade out, we use a simply opacity fade, which is combined with the spinning animation. We use CSS variables
546         to encode both animations so they can be used combined or one at a time without redefining the whole animation
547         property.
548         (button.compact-activity-indicator.spins > picture): Use the "spins" animation variable when spinning.
549         (button.compact-activity-indicator.spins.fades-out > picture): Combine the "spins" and "fades-out" animation
550         variables when fading out.
551         (@keyframes compact-activity-indicator-intro): Animation going through the first 8 frames of the loading indicator.
552         (@keyframes compact-activity-indicator-loop): Animation going through the remaining frames of the loading indicator.
553         (@keyframes compact-activity-indicator-fades-out): Animation fading opacity from 1 to 0.
554         * Modules/modern-media-controls/controls/compact-activity-indicator.js: Added.
555         (CompactActivityIndicator):
556         (CompactActivityIndicator.prototype.show): Add the "spins" CSS class to show the control spinning with the intro animation.
557         (CompactActivityIndicator.prototype.hide): Add the "fades-out" CSS class to hide the control, removing both this class and
558         the "spins" class when the fade-out animation completes.
559         * Modules/modern-media-controls/controls/compact-media-controls.css: Added.
560         (.media-controls.compact:before): Add a 20% black overlay over the video frame to provide contrast for controls.
561         (.media-controls.compact button): Ensure buttons are sized to use the entire video frame so that their hit region
562         comprises the whole video frame.
563         (.media-controls.compact button > picture): Override default blending styles for a simple solid white mask.
564         (.media-controls.compact button:active > picture): Turn off the scale down effect when pressing a button.
565         * Modules/modern-media-controls/controls/compact-media-controls.js: Expose a "state" property for the compact media controls,
566         which can be exlusively one of three: "paused", "pending" and "invalid".
567         (CompactMediaControls.):
568         (CompactMediaControls.prototype.get state):
569         (CompactMediaControls.prototype.set state):
570         (CompactMediaControls.prototype.layout): In the "paused" state, show the play button. In the "pending" state show
571         the loading indicator. In the "invalid" state show the invalid button.
572         (CompactMediaControls.prototype.get placard): Deleted.
573         (CompactMediaControls.prototype.set placard): Deleted.
574         * Modules/modern-media-controls/js-files:
575         * Modules/modern-media-controls/media/compact-media-controls-support.js: Added.
576         (CompactMediaControlsSupport.prototype.get mediaEvents):
577         (CompactMediaControlsSupport.prototype.handleEvent): Make the controls enter the "paused" state when receiving a "pause"
578         event. Make the controls enter the "invalid" state when receiving an "error" event. 
579         (CompactMediaControlsSupport.prototype.enable):
580         (CompactMediaControlsSupport.prototype.disable):
581         (CompactMediaControlsSupport.prototype.buttonWasPressed): Play the media when pressing the play button and make the controls
582         enter the "pending" state. When pressing the loading indicator, pause the media and make the controls enter the "paused" state.
583         (CompactMediaControlsSupport.prototype._buttons):
584         (CompactMediaControlsSupport):
585         * Modules/modern-media-controls/media/media-controller.js:
586         (MediaController.prototype._supportingObjectClasses): Only use CompactMediaControlsSupport as a media controller supporting object
587         in the compact mode.
588         * Modules/modern-media-controls/media/placard-support.js:
589         (PlacardSupport.prototype.get mediaEvents): This media controller support object no longer needs to deal with compact mode.
590         * Modules/modern-media-controls/media/playback-support.js:
591         (PlaybackSupport.prototype.syncControl): This media controller support object no longer needs to deal with compact mode.
592         (PlaybackSupport):
593
594 2018-04-21  Antoine Quint  <graouts@apple.com>
595
596         [Modern Media Controls] Obtain compact mode icons through WebKitAdditions
597         https://bugs.webkit.org/show_bug.cgi?id=184862
598         <rdar://problem/39621645>
599
600         Reviewed by Jon Lee.
601
602         * Modules/modern-media-controls/controls/button.js:
603         (Button.prototype._updateImageMetrics): Handle PDF assets where the image source's intrinsic size needs
604         to be adjusted for the device pixel density.
605         (Button):
606         * Modules/modern-media-controls/controls/icon-service.js: Expect three additional icons provided through
607         WebKitAdditions, including two in the PDF format, so we add support for this format.
608         * WebCore.xcodeproj/project.pbxproj: Copy additional assets from the WebKitAdditions build directory should
609         any be present.
610
611 2018-04-21  Dean Jackson  <dino@apple.com>
612
613         Expose whether you've build with the Apple Internal SDK
614         https://bugs.webkit.org/show_bug.cgi?id=184864
615
616         Reviewed by Wenson Hsieh.
617
618         Internals API to let a test know if it is running with the
619         Apple internal SDK.
620
621         * testing/Internals.cpp:
622         (WebCore::usingAppleInternalSDK const):
623         * testing/Internals.h:
624         * testing/Internals.idl:
625
626 2018-04-20  Nan Wang  <n_wang@apple.com>
627
628         AX: AOM does not work with DOM Level 1 events
629         https://bugs.webkit.org/show_bug.cgi?id=184847
630
631         Reviewed by Chris Fleizach.
632
633         Added the accessibility events to the HTML attribute names.
634
635         Test cases are added to the existing layout tests.
636
637         * html/HTMLAttributeNames.in:
638         * html/HTMLElement.cpp:
639         (WebCore::HTMLElement::createEventHandlerNameMap):
640
641 2018-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
642
643         REGRESSION(r228088): [SOUP] Check TLS errors for WebSockets on GTlsConnection::accept-certificate
644         https://bugs.webkit.org/show_bug.cgi?id=184804
645
646         Reviewed by Michael Catanzaro.
647
648         * platform/network/soup/SocketStreamHandleImpl.h: Add a public url getter.
649         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
650         (WebCore::acceptCertificateCallback): Call SoupNetworkSession::checkTLSErrors() to decide whether to accept the
651         certificate or not.
652         (WebCore::connectProgressCallback): Receive the SocketStreamHandle and pass it to acceptCertificateCallback callback.
653         (WebCore::socketClientEventCallback): Ditto.
654         (WebCore::SocketStreamHandleImpl::create): Always connect to network events.
655         (WebCore::wssConnectionAcceptCertificateCallback): Deleted.
656         (WebCore::wssSocketClientEventCallback): Deleted.
657
658 2018-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
659
660         [SOUP] Do TLS error checking on GTlsConnection::accept-certificate
661         https://bugs.webkit.org/show_bug.cgi?id=184480
662
663         Reviewed by Michael Catanzaro.
664
665         * platform/network/soup/ResourceError.h: Change tlsError to recieve a failing URL instead of a SoupRequest,
666         since the request was only used to get the failing URL.
667         * platform/network/soup/ResourceErrorSoup.cpp:
668         (WebCore::ResourceError::tlsError): Use the given failing URL.
669         * platform/network/soup/SoupNetworkSession.cpp:
670         (WebCore::SoupNetworkSession::SoupNetworkSession): Use ssl-strict when creating the SoupSession to handle the
671         certificates ourselves by connecting to GTlsConnection::accept-certificate.
672         (WebCore::SoupNetworkSession::checkTLSErrors): Updated to receive a URL, certificate and errors instead of
673         receiving a SoupRequest and SoupMessage and extract the url, certirficate and errors from them. Also return the
674         optional error directly instead of using a completion handler since the function is always synchronous.
675         * platform/network/soup/SoupNetworkSession.h:
676
677 2018-04-20  Tim Horton  <timothy_horton@apple.com>
678
679         Adjust geolocation feature flag
680         https://bugs.webkit.org/show_bug.cgi?id=184856
681
682         Reviewed by Wenson Hsieh.
683
684         * Configurations/FeatureDefines.xcconfig:
685
686 2018-04-20  Chris Dumez  <cdumez@apple.com>
687
688         Unreviewed attempt to fix Windows build after r230875.
689
690         * platform/network/cf/CookieJarCFNet.cpp:
691         (WebCore::cookieRequestHeaderFieldValue):
692         * platform/network/curl/CookieJarCurlDatabase.cpp:
693
694 2018-04-20  Chris Dumez  <cdumez@apple.com>
695
696         REGRESSION (r229828): web view doesn’t update or respond to resizing until client calls policy decision handler
697         https://bugs.webkit.org/show_bug.cgi?id=184210
698         <rdar://problem/39072354>
699
700         Reviewed by Wenson Hsieh.
701
702         r229828 tried to have some API tests happy on iOS by freezing the layer tree
703         during the navigation policy decision. However, this is observable by the client
704         application and a regression from when the policy delegate was synchronous.
705
706         To address the issue, this patch reverts r229828 and instead updates the iOS
707         API tests to wait for the next presentation update after navigating
708         before interacting with the view.
709
710         * loader/FrameLoaderClient.h:
711         * loader/PolicyChecker.cpp:
712         (WebCore::PolicyChecker::checkNavigationPolicy):
713
714 2018-04-20  Brent Fulgham  <bfulgham@apple.com>
715
716         Limit cookie header access to Network process
717         https://bugs.webkit.org/show_bug.cgi?id=184764
718         <rdar://problem/36785285>
719
720         Reviewed by Youenn Fablet.
721
722         Revise the handling of cookie request headers so that we don't interact with them in the
723         WebContent process. They are only needed for interaction with the server and the network
724         process, so we should limit their scope to just the Network process.
725
726         Instead, we should handle a token that represents the cookie headers in the WebContent
727         process, which can be converted to the relevant cookie data in the network process when
728         needed.
729
730         * Modules/websockets/WebSocketChannel.cpp:
731         (WebCore::WebSocketChannel::didOpenSocketStream):
732         * Modules/websockets/WebSocketHandshake.cpp:
733         (WebCore::WebSocketHandshake::clientHandshakeMessage const):
734         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
735         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
736         (WebCore::WebSocketHandshake::clientHandshakeMessage): Deleted.
737         (WebCore::WebSocketHandshake::clientHandshakeRequest): Deleted.
738         * Modules/websockets/WebSocketHandshake.h:
739         * WebCore.xcodeproj/project.pbxproj:
740         * loader/CookieJar.cpp:
741         (WebCore::cookieRequestHeaderFieldProxy):
742         * loader/CookieJar.h:
743         * platform/network/CookieRequestHeaderFieldProxy.h: Added.
744         (WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy):
745         (WebCore::CookieRequestHeaderFieldProxy::isolatedCopy const):
746         (WebCore::CookieRequestHeaderFieldProxy::encode const):
747         (WebCore::CookieRequestHeaderFieldProxy::decode):
748         * platform/network/PlatformCookieJar.h:
749         * platform/network/SocketStreamHandle.cpp:
750         (WebCore::SocketStreamHandle::sendHandshake):
751         * platform/network/SocketStreamHandle.h:
752         * platform/network/SocketStreamHandleImpl.cpp:
753         (WebCore::SocketStreamHandleImpl::platformSendHandshake):
754         * platform/network/cf/SocketStreamHandleImpl.h:
755         * platform/network/curl/CookieJarCurl.cpp:
756         (WebCore::cookieRequestHeaderFieldValue):
757         * platform/network/curl/CookieJarCurl.h:
758         * platform/network/curl/SocketStreamHandleImpl.h:
759         * platform/network/mac/CookieJarMac.mm:
760         (WebCore::cookieRequestHeaderFieldValue):
761         * platform/network/soup/CookieJarSoup.cpp:
762         (WebCore::cookieRequestHeaderFieldValue):
763         * platform/network/soup/SocketStreamHandleImpl.h:
764
765 2018-04-20  Daniel Bates  <dabates@apple.com>
766
767         Hide Strong Password label when text field is too narrow
768         https://bugs.webkit.org/show_bug.cgi?id=184785
769         <rdar://problem/38183939>
770
771         Reviewed by Zalan Bujtas.
772
773         We accomplish this illusion by allowing the text field's decorations to wrap, specifying flex
774         shrink factors, a flex basis and hiding overflow. Hiding overflow is accomplished by a
775         combination of setting "overflow: hidden", "text-overflow: clip", and patching RenderTextControlSingleLine::layout()
776         to ensure that the height of the container element is equal to the intrinsic height of the
777         inner elements. Because the container is a flex box and we want to vertically center its
778         contents we also need to fix up the y-position of the container element as it may have flexed
779         as a result of forcing its height to match the intrinsic height of the inner elements.
780
781         * css/html.css:
782         (input::-webkit-strong-password-auto-fill-button): Specify a flex-shrink factor and prevent
783         wrapping of the "Strong Password" text when flexed.
784         * html/shadow/TextControlInnerElements.cpp:
785         (WebCore::TextControlInnerContainer::TextControlInnerContainer): Register for a custom style
786         resolution callback so that we can style the container if it is a Strong Password or Strong
787         Confirmation Password text field. Ideally we could accomplish this effect with a user agent-
788         specific pseudo class together with a selector definition in the user agent style sheet,
789         html.css. Unfortunately the style resolver does not seem to apply pseudo classes to
790         shadow DOM pseudo elements (why?). Therefore we use a custom style resolution callback to
791         achieve the same effect.
792         (WebCore::isStrongPasswordTextField): Returns whether the specified DOM element is a Strong
793         Password text field.
794         (WebCore::TextControlInnerContainer::resolveCustomStyle): Conditionally apply CSS properties
795         "flex-wrap: wrap" and overflow: hidden" if the shadow host of this container is a Strong
796         Password text field.
797         (WebCore::TextControlInnerElement::resolveCustomStyle): Conditionally style the inner text
798         if the shadow host of this container is a Strong Password text field. We need to apply these
799         styles here as opposed to in html.css for the same reason we need to apply the styles to
800         the container in a custom style resolution callback. See the comments for TextControlInnerContainer()
801         above for more details
802         * html/shadow/TextControlInnerElements.h:
803         * rendering/RenderTextControlSingleLine.cpp:
804         (WebCore::resetOverriddenHeight): Added. Incorporates the logic from setNeedsLayoutOnAncestors().
805         (WebCore::RenderTextControlSingleLine::layout): Override the height of the container element to
806         match the height of the inner elements when this text field is a Strong Password field. We cache
807         the container's logical top before adjusting its height so that we can restore it after performing
808         a second layout of this renderer. This is needed because we vertically center the elements in this
809         renderer and adjusting the height of the container may cause it to flex and re-position along its
810         cross axis when the container's height is taller than the inner element's height (e.g. the "Strong
811         Password" label wraps to the next line). This re-positioning causes a noticeable jitter when
812         transitioning from a field that has a visible "Strong Password" label to one that does not. Caching
813         and restoring the logical top of the container element avoids this jitter.
814         (WebCore::setNeedsLayoutOnAncestors): Deleted. Moved its implementation into resetOverriddenHeight().
815
816 2018-04-20  Dean Jackson  <dino@apple.com>
817
818         Render a badge on system preview images
819         https://bugs.webkit.org/show_bug.cgi?id=184854
820         <rdar://problem/39615154>
821
822         Reviewed by Tim Horton.
823
824         At paint time, if a RenderImage is an image element
825         which is identified as a system preview, then draw
826         a little badge in the top right corner.
827
828         It is expected that platforms will override the
829         default rendering with something that identifies
830         how a system preview will operate. e.g. QuickLook
831         on Apple systems.
832
833         Test: system-preview/badge.html
834
835         * rendering/RenderImage.cpp:
836         (WebCore::RenderImage::paintIntoRect): If we are
837         a system preview, call RenderTheme to draw a badge.
838         * rendering/RenderTheme.cpp:
839         (WebCore::RenderTheme::paintSystemPreviewBadge): A default
840         implementation that draws a red circle.
841         * rendering/RenderTheme.h:
842
843 2018-04-20  Brian Burg  <bburg@apple.com>
844
845         Web Inspector: remove some dead code in IdentifiersFactory
846         https://bugs.webkit.org/show_bug.cgi?id=184839
847
848         Reviewed by Timothy Hatcher.
849
850         * inspector/InspectorController.cpp:
851         (WebCore::InspectorController::setProcessId): Deleted.
852         * inspector/InspectorController.h:
853
854 2018-04-20  Chris Dumez  <cdumez@apple.com>
855
856         Use WindowProxy in DOMWindow.idl
857         https://bugs.webkit.org/show_bug.cgi?id=184820
858
859         Reviewed by Sam Weinig.
860
861         Use WindowProxy in DOMWindow.idl to match the specification more closely.
862
863         * bindings/js/JSWindowProxy.h:
864         * bindings/js/WindowProxy.cpp:
865         (WebCore::WindowProxy::window const):
866         * bindings/js/WindowProxy.h:
867         * bindings/scripts/CodeGeneratorJS.pm:
868         (NativeToJSValueDOMConvertNeedsState):
869         * dom/Document.cpp:
870         * dom/Document.h:
871         * dom/Document.idl:
872         * page/DOMWindow.cpp:
873         (WebCore::DOMWindow::focus):
874         (WebCore::DOMWindow::self const):
875         (WebCore::DOMWindow::opener const):
876         (WebCore::DOMWindow::parent const):
877         (WebCore::DOMWindow::top const):
878         (WebCore::DOMWindow::open):
879         * page/DOMWindow.h:
880         * page/DOMWindow.idl:
881         * testing/Internals.cpp:
882         (WebCore::Internals::openDummyInspectorFrontend):
883         * testing/Internals.h:
884         * testing/Internals.idl:
885
886 2018-04-20  Chris Dumez  <cdumez@apple.com>
887
888         Update cross-origin SecurityError messages to not include the target origin
889         https://bugs.webkit.org/show_bug.cgi?id=184803
890         <rdar://problem/39547724>
891
892         Reviewed by Sam Weinig.
893
894         No new tests, rebaselined existing tests.
895
896         * bindings/js/JSDOMBindingSecurity.cpp:
897         (WebCore::canAccessDocument):
898         (WebCore::BindingSecurity::shouldAllowAccessToFrame):
899         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
900         * page/DOMWindow.cpp:
901         (WebCore::DOMWindow::crossDomainAccessErrorMessage):
902         (WebCore::DOMWindow::isInsecureScriptAccess):
903         * page/DOMWindow.h:
904         * page/Location.cpp:
905         (WebCore::Location::reload):
906
907 2018-04-20  Chris Nardi  <cnardi@chromium.org>
908
909         Update HSL/HSLA parsing to match CSS Color 4
910         https://bugs.webkit.org/show_bug.cgi?id=180528
911         <rdar://problem/35926675>
912
913         CSS Color 4 specifies a comma optional syntax for HSL/HSLA, as well as allowing angle values for the
914         hue and percent alpha values. Update our parsing to match this.
915
916         Reviewed by Simon Fraser.
917
918         This change also updates the import of WPT css-color to test the changes.
919
920         Tests: LayoutTests/imported/w3c/web-platform-tests/css/css-color/hsl{a}-{001-008}.html
921
922         * css/parser/CSSPropertyParserHelpers.cpp:
923         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
924         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
925         (WebCore::CSSPropertyParserHelpers::consumeColor):
926         * platform/graphics/Color.cpp:
927         (WebCore::calcHue):
928         (WebCore::makeRGBAFromHSLA):
929
930 2018-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
931
932         [Extra zoom mode] Injected bundle form client should be notified when editing text fields
933         https://bugs.webkit.org/show_bug.cgi?id=184822
934         <rdar://problem/38807319>
935
936         Reviewed by Tim Horton.
937
938         Export the constructor and destructor of UserTypingGestureIndicator for use in WebKit (see WebPage.cpp).
939
940         Test: fast/forms/extrazoom/edit-text-field-calls-injected-bundle.html
941
942         * dom/UserTypingGestureIndicator.h:
943
944 2018-04-18  Jer Noble  <jer.noble@apple.com>
945
946         Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
947         https://bugs.webkit.org/show_bug.cgi?id=184762
948
949         Reviewed by Dan Bernstein.
950
951         * Configurations/WebCore.xcconfig:
952         * WebCore.xcodeproj/project.pbxproj:
953
954 2018-04-20  Daniel Bates  <dabates@apple.com>
955
956         Remove code for compilers that did not support NSDMI for aggregates
957         https://bugs.webkit.org/show_bug.cgi?id=184599
958
959         Reviewed by Per Arne Vollan.
960
961         Remove workaround for earlier Visual Studio versions that did not support non-static data
962         member initializers (NSDMI) for aggregates. We have since updated all the build.webkit.org
963         and EWS bots to a newer version that supports this feature.
964
965         * Modules/cache/CacheQueryOptions.h:
966         (WebCore::CacheQueryOptions::CacheQueryOptions): Deleted.
967         * dom/Node.h:
968         (WebCore::Node::InsertionType::InsertionType): Deleted.
969         (WebCore::Node::RemovalType::RemovalType): Deleted.
970         * html/canvas/CanvasStyle.h:
971         (WebCore::CanvasStyle::CMYKAColor::CMYKAColor): Deleted.
972         * page/EventHandler.h:
973         (WebCore::EventHandler::DragTargetResponse::DragTargetResponse): Deleted.
974         * page/animation/CSSAnimationController.h:
975         (WebCore::AnimationUpdate::AnimationUpdate): Deleted.
976         * platform/graphics/FontSelectionAlgorithm.h:
977         (WebCore::FontSelectionRequest::tied const):
978         (WebCore::FontSelectionRequest::FontSelectionRequest): Deleted.
979         (WebCore::FontSelectionCapabilities::FontSelectionCapabilities): Deleted.
980         * platform/mediastream/IceCandidate.h:
981         (WebCore::IceCandidate::IceCandidate): Deleted.
982         * platform/text/StringWithDirection.h:
983         (WebCore::StringWithDirection::StringWithDirection): Deleted.
984         * rendering/MarkedText.h:
985         (WebCore::MarkedText::MarkedText): Deleted.
986         * style/StyleUpdate.h:
987         (WebCore::Style::ElementUpdate::ElementUpdate): Deleted.
988         (WebCore::Style::ElementUpdates::ElementUpdates): Deleted.
989         (WebCore::Style::TextUpdate::TextUpdate): Deleted.
990
991 2018-04-20  Youenn Fablet  <youenn@apple.com>
992
993         WebPage sometimes incorrectly rules out PDF as a mime type that can be showed
994         https://bugs.webkit.org/show_bug.cgi?id=184369
995
996         Reviewed by Chris Dumez.
997
998         WebPage does need to check for plugins at reception of the response.
999         In that case, the page URL is the URL from which we are navigating out.
1000         Add plugin API to check for plugin availability with an extra URL parameter to cover that case.
1001
1002         Covered by API test.
1003
1004         * plugins/PluginData.cpp:
1005         (WebCore::PluginData::supportsWebVisibleMimeTypeForURL const):
1006         (WebCore::PluginData::supportsWebVisibleMimeType const):
1007         * plugins/PluginData.h:
1008
1009 2018-04-20  Daniel Bates  <dabates@apple.com>
1010
1011         Remove Strong Password decoration when text field type changes
1012         https://bugs.webkit.org/show_bug.cgi?id=184795
1013         <rdar://problem/38325108>
1014
1015         Reviewed by Antti Koivisto.
1016
1017         Remove the Strong Password decoration when the text field's type changes to avoid interfering
1018         with web sites that allow a person to show/hide their password.
1019
1020         Test: fast/forms/auto-fill-button/hide-strong-password-when-field-type-changes.html
1021
1022         * html/HTMLInputElement.cpp:
1023         (WebCore::HTMLInputElement::updateType):
1024
1025 2018-04-20  Javier Fernandez  <jfernandez@igalia.com>
1026
1027         Update Alignment shorthands to the spec now that they are not ambiguous
1028         https://bugs.webkit.org/show_bug.cgi?id=184812
1029
1030         Reviewed by Antti Koivisto.
1031
1032         Now that the issue [1] about the syntax ambiguity has been resolved we
1033         don't need to use the custom syntax anymore. The Alignment shorthands
1034         use now the simple syntax, defined based on the longhands' syntax.
1035
1036         Since we allow all the values valid for each longhand, we'll update
1037         in this CL the corresponding web platform tests. Additionally, this CL
1038         updates also the shorthand serialization tests [2], which didn't
1039         consider the new value 'legacy' for justify-items (and place-items) due
1040         to the bug [3] Firefox still has pending to be fixed.
1041
1042         [1] https://github.com/w3c/csswg-drafts/issues/1001
1043         [2] css/css-align/default-alignment/shorthand-serialization-001.html
1044         [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1363875
1045
1046         Tests: imported/w3c/web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001.html
1047                imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-computed-001.html
1048                imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-001.html
1049                imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-002.html
1050
1051         * css/parser/CSSPropertyParser.cpp:
1052         (WebCore::CSSPropertyParser::consumePlaceContentShorthand): Using the justify-content and align-content parsing logic to parse the shorthand.
1053         (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): Using the justify-items and align-items parsing logic to parse the shorthand.
1054         (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): Using the justify-self and align-self parsing logic to parse the shorthand.
1055
1056 2018-04-20  Daniel Bates  <dabates@apple.com>
1057
1058         Unreviewed, rolling out r230117.
1059
1060         Broke find-in-page for PDFs
1061
1062         Reverted changeset:
1063
1064         "ASSERTION FAILED: ASSERT(!containsImage ||
1065         MIMETypeRegistry::isSupportedImageResourceMIMEType([resource
1066         MIMEType])) in -[NSPasteboard(WebExtras)
1067         _web_writePromisedRTFDFromArchive:containsImage:]"
1068         https://bugs.webkit.org/show_bug.cgi?id=184161
1069         https://trac.webkit.org/changeset/230117
1070
1071 2018-04-20  Eric Carlson  <eric.carlson@apple.com>
1072
1073         Pausing should clear m_waitingToEnterFullscreen
1074         https://bugs.webkit.org/show_bug.cgi?id=184831
1075         <rdar://problem/39602852>
1076
1077         Reviewed by Jer Noble.
1078
1079         * html/HTMLMediaElement.cpp:
1080         (WebCore::HTMLMediaElement::pause): Clear m_waitingToEnterFullscreen
1081
1082 2018-04-20  Eric Carlson  <eric.carlson@apple.com>
1083
1084         [Extra zoom mode] Disable CA transactions while setting up for fullscreen
1085         https://bugs.webkit.org/show_bug.cgi?id=184817
1086         <rdar://problem/39596075>
1087
1088         Reviewed by Jer Noble.
1089
1090         This was tested manually as it is not possible to write an automated test for this.
1091
1092         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1093         (VideoFullscreenInterfaceAVKit::doSetup): Move the call to disable CA transactions outside
1094         of the EXTRA_ZOOM_MODE check, the [CATransaction commit] was already unguarded.
1095
1096 2018-04-20  Youenn Fablet  <youenn@apple.com>
1097
1098         Make PluginData cache its web visible plugins
1099         https://bugs.webkit.org/show_bug.cgi?id=184421
1100
1101         Reviewed by Chris Dumez.
1102
1103         Buffer visible plugins until the page URL changes.
1104         For that purpose, we now cache the visible plugins and the URL it was computed from in PluginData.
1105
1106         Update plugin info provider API to pass the URL used to check for plugin visibility.
1107
1108         No observable change of behavior.
1109
1110         * loader/EmptyClients.cpp:
1111         * plugins/PluginData.cpp:
1112         (WebCore::PluginData::webVisiblePlugins const):
1113         (WebCore::PluginData::publiclyVisiblePlugins const):
1114         (WebCore::PluginData::supportsMimeType const):
1115         * plugins/PluginData.h:
1116         * plugins/PluginInfoProvider.h:
1117
1118 2018-04-20  Chris Dumez  <cdumez@apple.com>
1119
1120         Unreviewed build fix after r230840.
1121
1122         * bindings/js/JSWindowProxy.cpp:
1123         (WebCore::JSWindowProxy::attachDebugger):
1124
1125 2018-04-20  Chris Dumez  <cdumez@apple.com>
1126
1127         Unreviewed attempt to fix the Windows build after r230831.
1128
1129         * bindings/js/JSWindowProxy.cpp:
1130         (WebCore::JSWindowProxy::create):
1131         (WebCore::JSWindowProxy::attachDebugger):
1132
1133 2018-04-20  Chris Nardi  <cnardi@chromium.org>
1134
1135         Omit default value when serializing font-feature-settings
1136         https://bugs.webkit.org/show_bug.cgi?id=182382
1137
1138         Reviewed by Myles C. Maxfield.
1139
1140         According to the shortest-serialization principle [1], values should be omitted if their omission
1141         wouldn't change the value of reparsing. As "1"/"on" is the default value for font-feature-settings,
1142         omit this when serializing, matching the behavior of Firefox and Chrome.
1143
1144         [1]: https://github.com/w3c/csswg-drafts/issues/1564
1145
1146         Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
1147         and fast/text/font-face-javascript.html.
1148
1149         * css/CSSFontFeatureValue.cpp:
1150         (WebCore::CSSFontFeatureValue::customCSSText const):
1151
1152 2018-04-19  Alexey Proskuryakov  <ap@apple.com>
1153
1154         More WK_ALTERNATE_FRAMEWORKS_DIR adoption in WebCore
1155         https://bugs.webkit.org/show_bug.cgi?id=184805
1156
1157         Reviewed by Dan Bernstein.
1158
1159         * Configurations/WebCoreTestShim.xcconfig:
1160         * Configurations/WebCoreTestSupport.xcconfig:
1161
1162 2018-04-19  Brady Eidson  <beidson@apple.com>
1163
1164         Make back forward cache work with process swapping.
1165         <rdar://problem/38676604> and https://bugs.webkit.org/show_bug.cgi?id=184793
1166
1167         Reviewed by Chris Dumez.
1168
1169         Covered by API tests.
1170
1171         * loader/FrameLoader.cpp:
1172         (WebCore::FrameLoader::loadWithNavigationAction):
1173         (WebCore::FrameLoader::load):
1174         (WebCore::FrameLoader::loadWithDocumentLoader):
1175         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1176         (WebCore::FrameLoader::reload):
1177         (WebCore::FrameLoader::commitProvisionalLoad):
1178         (WebCore::FrameLoader::loadDifferentDocumentItem):
1179         * loader/FrameLoader.h:
1180
1181 2018-04-19  Chris Dumez  <cdumez@apple.com>
1182
1183         Rename JSDOMWindowProxy to JSWindowProxy
1184         https://bugs.webkit.org/show_bug.cgi?id=184797
1185
1186         Reviewed by Sam Weinig.
1187
1188         Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.
1189
1190         * Sources.txt:
1191         * WebCore.xcodeproj/project.pbxproj:
1192         * bindings/IDLTypes.h:
1193         * bindings/js/JSBindingsAllInOne.cpp:
1194         * bindings/js/JSDOMConvertWindowProxy.h:
1195         * bindings/js/JSDOMWindowBase.cpp:
1196         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
1197         (WebCore::JSDOMWindowBase::finishCreation):
1198         (WebCore::JSDOMWindowBase::proxy const):
1199         (WebCore::toJSDOMWindow):
1200         * bindings/js/JSDOMWindowBase.h:
1201         * bindings/js/JSDOMWindowCustom.cpp:
1202         (WebCore::JSDOMWindow::toWrapped):
1203         * bindings/js/JSEventTargetCustom.cpp:
1204         (WebCore::JSEventTarget::toWrapped):
1205         * bindings/js/JSRemoteDOMWindowBase.cpp:
1206         (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
1207         (WebCore::toJSRemoteDOMWindow):
1208         * bindings/js/JSRemoteDOMWindowBase.h:
1209         * bindings/js/JSWindowProxy.cpp: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.cpp.
1210         (WebCore::JSWindowProxy::JSWindowProxy):
1211         (WebCore::JSWindowProxy::finishCreation):
1212         (WebCore::JSWindowProxy::create):
1213         (WebCore::JSWindowProxy::destroy):
1214         (WebCore::JSWindowProxy::setWindow):
1215         (WebCore::JSWindowProxy::attachDebugger):
1216         (WebCore::JSWindowProxy::wrapped const):
1217         (WebCore::JSWindowProxy::toWrapped):
1218         (WebCore::toJS):
1219         (WebCore::toJSWindowProxy):
1220         * bindings/js/JSWindowProxy.h: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.h.
1221         (WebCore::toJS):
1222         (WebCore::toJSWindowProxy):
1223         * bindings/js/ScriptController.cpp:
1224         (WebCore::ScriptController::initScriptForWindowProxy):
1225         * bindings/js/ScriptController.h:
1226         * bindings/js/WindowProxy.cpp:
1227         (WebCore::WindowProxy::createJSWindowProxy):
1228         (WebCore::WindowProxy::jsWindowProxiesAsVector const):
1229         (WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
1230         * bindings/js/WindowProxy.h:
1231         (WebCore::WindowProxy::jsWindowProxy):
1232         (WebCore::WindowProxy::existingJSWindowProxy const):
1233         * bindings/scripts/CodeGeneratorJS.pm:
1234         (AddToIncludesForIDLType):
1235         (GenerateHeader):
1236         (GenerateOverloadDispatcher):
1237         (GenerateImplementation):
1238         * bindings/scripts/test/JS/JSTestObj.cpp:
1239         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
1240         * page/Frame.cpp:
1241         * page/csp/ContentSecurityPolicy.cpp:
1242         (WebCore::ContentSecurityPolicy::didCreateWindowProxy const):
1243         * page/csp/ContentSecurityPolicy.h:
1244
1245 2018-04-19  Dirk Schulze  <krit@webbkit.org>
1246
1247         Introduce SVGGeometryElement interface
1248         https://bugs.webkit.org/show_bug.cgi?id=184768
1249
1250         Reviewed by Antti Koivisto.
1251
1252         Start implementing SVGGeometryElement interface from SVG2.
1253         https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
1254
1255         Start with SVGPathElement only for now. Also, just inferface gets implemented
1256         by this patch. No new functionality like isPointInFill yet.
1257         Fix getPointAtLength and make it more restrictive. This follows the spec and
1258         all other implementations.
1259
1260         Added additional test scenarios to existing tests.
1261
1262         * CMakeLists.txt:
1263         * DerivedSources.make:
1264         * Sources.txt:
1265         * WebCore.xcodeproj/project.pbxproj:
1266         * bindings/scripts/CodeGeneratorJS.pm:
1267         (GetGnuVTableOffsetForType):
1268         * svg/SVGAllInOne.cpp:
1269         * svg/SVGGeometryElement.cpp: Added.
1270         (WebCore::SVGGeometryElement::SVGGeometryElement):
1271         (WebCore::SVGGeometryElement::isSupportedAttribute):
1272         (WebCore::SVGGeometryElement::parseAttribute):
1273         (WebCore::SVGGeometryElement::svgAttributeChanged):
1274         (WebCore::SVGGeometryElement::createElementRenderer):
1275         * svg/SVGGeometryElement.h: Added.
1276         * svg/SVGGeometryElement.idl: Added.
1277         * svg/SVGGradientElement.cpp:
1278         * svg/SVGPathElement.cpp:
1279         (WebCore::SVGPathElement::SVGPathElement):
1280         (WebCore::SVGPathElement::parseAttribute):
1281         (WebCore::SVGPathElement::svgAttributeChanged):
1282         (WebCore::SVGPathElement::insertedIntoAncestor):
1283         (WebCore::SVGPathElement::removedFromAncestor):
1284         * svg/SVGPathElement.h:
1285         * svg/SVGPathElement.idl:
1286
1287 2018-04-19  Tadeu Zagallo  <tzagallo@apple.com>
1288
1289         REGRESSION(r227340): ArrayBuffers were not being serialized when sent via MessagePorts
1290         https://bugs.webkit.org/show_bug.cgi?id=184254
1291         <rdar://problem/39140200>
1292
1293         Reviewed by Daniel Bates.
1294
1295         Add a new encoding method to SerializedScriptValue that includes ArrayBuffers.
1296
1297         Test: workers/message-port.html
1298
1299         * bindings/js/SerializedScriptValue.h:
1300         (WebCore::SerializedScriptValue::encode const):
1301         (WebCore::SerializedScriptValue::decode):
1302         * dom/messageports/MessageWithMessagePorts.h:
1303         (WebCore::MessageWithMessagePorts::encode const):
1304         (WebCore::MessageWithMessagePorts::decode):
1305
1306 2018-04-19  David Kilzer  <ddkilzer@apple.com>
1307
1308         Enable Objective-C weak references
1309         <https://webkit.org/b/184789>
1310         <rdar://problem/39571716>
1311
1312         Reviewed by Dan Bernstein.
1313
1314         * Configurations/Base.xcconfig:
1315         (CLANG_ENABLE_OBJC_WEAK): Enable.
1316
1317 2018-04-19  Antti Koivisto  <antti@apple.com>
1318
1319         Don't use RenderTreeBuilder::current() in RenderTreeUpdater
1320         https://bugs.webkit.org/show_bug.cgi?id=184794
1321
1322         Reviewed by Zalan Bujtas.
1323
1324         Pass the builder as a parameter where needed.
1325
1326         * rendering/updating/RenderTreeUpdater.cpp:
1327         (WebCore::RenderTreeUpdater::updateElementRenderer):
1328         (WebCore::RenderTreeUpdater::updateTextRenderer):
1329         (WebCore::RenderTreeUpdater::tearDownRenderers):
1330         (WebCore::RenderTreeUpdater::tearDownRenderer):
1331         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
1332         (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
1333         (WebCore::RenderTreeUpdater::tearDownLeftoverShadowHostChildren):
1334         * rendering/updating/RenderTreeUpdater.h:
1335         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
1336         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1337         (WebCore::RenderTreeUpdater::GeneratedContent::removeBeforePseudoElement):
1338         (WebCore::RenderTreeUpdater::GeneratedContent::removeAfterPseudoElement):
1339         * rendering/updating/RenderTreeUpdaterGeneratedContent.h:
1340
1341 2018-04-19  Eric Carlson  <eric.carlson@apple.com>
1342
1343         Runtime logging during GC can cause crash
1344         https://bugs.webkit.org/show_bug.cgi?id=184792
1345         <rdar://problem/39567927>
1346
1347         Reviewed by Jer Noble.
1348
1349         Test: media/destructor-logging-crash.html
1350
1351         * dom/Document.cpp:
1352         (WebCore::Document::~Document): Clear the logger observer immediately so anything logged
1353         as a side effect of the destructor won't cause a problem.
1354         (WebCore::Document::didLogMessage): Create the ConsoleMessage in a task.
1355         * dom/Document.h:
1356
1357 2018-04-19  Youenn Fablet  <youenn@apple.com>
1358
1359         Web Inspector backend should get headers & cookies from network process separately from resource requests
1360         https://bugs.webkit.org/show_bug.cgi?id=184396
1361         <rdar://problem/38877384>
1362
1363         Reviewed by Brian Burg.
1364
1365         Add two new loader strategies to get response and network metrics directly from
1366         NetworkProcess based on resource loader identifier.
1367         Use these methods in InspectorNetworkAgent when response/metrics might be filtered.
1368
1369         Covered by existing tests, in particular http/tests/inspector/network/fetch-network-data.html which would fail
1370         without this since we are now setting the sourceOrigin for NetworkResourceLoader, which is used to sanitize response headers.
1371
1372         * inspector/agents/InspectorNetworkAgent.cpp:
1373         (WebCore::InspectorNetworkAgent::didReceiveResponse):
1374         (WebCore::InspectorNetworkAgent::didFinishLoading):
1375         * loader/LoaderStrategy.cpp:
1376         (WebCore::LoaderStrategy::responseFromResourceLoaIdentifier):
1377         (WebCore::LoaderStrategy::networkMetricsFromResourceLoaIdentifier):
1378         * loader/LoaderStrategy.h:
1379
1380 2018-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1381
1382         [Extra zoom mode] Add a mechanism to extend the height of the layout viewport in extra zoom mode
1383         https://bugs.webkit.org/show_bug.cgi?id=184782
1384         <rdar://problem/38346712>
1385
1386         Reviewed by Tim Horton.
1387
1388         Add a new helper on FrameView to compute an expanded layout viewport size, as well as a new setting for the
1389         height expansion factor when computing visual viewport dimensions. See WebKit/ChangeLog for more detail.
1390
1391         Test: fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html
1392
1393         * page/FrameView.cpp:
1394         (WebCore::FrameView::expandedLayoutViewportSize):
1395         * page/FrameView.h:
1396         * page/Settings.yaml:
1397
1398 2018-04-19  Chris Dumez  <cdumez@apple.com>
1399
1400         REGRESSION (r229133): decidePolicyForNavigationAction not called for loading an HTML string
1401         https://bugs.webkit.org/show_bug.cgi?id=184209
1402         <rdar://problem/39145306>
1403
1404         Reviewed by Ryosuke Niwa.
1405
1406         In r229133, we stopped doing navigation policy checks for about:blank because about:blank
1407         loads need to happen synchronously for Web-compatibility. However, this regressed loading
1408         an HTML string in a WebView because in such cases, the URL is also about:blank with
1409         substitute data.
1410
1411         In this patch, we take a more conservative approach and restore policy checking for
1412         'about:blank' but using synchronous IPC.
1413
1414         * loader/PolicyChecker.cpp:
1415         (WebCore::PolicyChecker::checkNavigationPolicy):
1416
1417 2018-04-19  Chris Nardi  <cnardi@chromium.org>
1418
1419         Support calc() in webkit-gradient and cross-fade
1420         https://bugs.webkit.org/show_bug.cgi?id=182225
1421
1422         Reviewed by Simon Fraser.
1423
1424         calc() was previously unsupported in webkit-gradient and webkit-cross-fade, but both should take calc() values.
1425         Update the code to support calc() values.
1426
1427         Tests: LayoutTests/css3/calc/cross-fade-calc.html
1428                LayoutTests/css3/calc/webkit-gradient-calc.html
1429
1430         * css/parser/CSSPropertyParserHelpers.cpp:
1431         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
1432         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
1433
1434 2018-04-17  Filip Pizlo  <fpizlo@apple.com>
1435
1436         The InternalFunction hierarchy should be in IsoSubspaces
1437         https://bugs.webkit.org/show_bug.cgi?id=184721
1438
1439         Reviewed by Saam Barati.
1440
1441         No new tests because no new behavior.
1442
1443         * bindings/js/WebCoreJSClientData.cpp:
1444         (WebCore::JSVMClientData::JSVMClientData):
1445         * bindings/js/WebCoreJSClientData.h:
1446         (WebCore::JSVMClientData::runtimeMethodSpace):
1447         * bridge/runtime_method.cpp:
1448         (JSC::RuntimeMethod::subspaceForImpl):
1449         * bridge/runtime_method.h:
1450
1451 2018-04-19  Brady Eidson  <beidson@apple.com>
1452
1453         Add globally-unique HistoryItem identifiers (and have WebKit2 adopt them).
1454         <rdar://problem/39533949> and https://bugs.webkit.org/show_bug.cgi?id=184750
1455
1456         Reviewed by Ryosuke Niwa.
1457
1458         No new tests (Refactor, no behavior change).
1459
1460         In WebCore, we:
1461         - Add a process-unique "BackForwardItemIdentifier"
1462         - Make all HistoryItems have such an identifier as a member
1463
1464         * WebCore.xcodeproj/project.pbxproj:
1465
1466         * history/BackForwardItemIdentifier.h: Added.
1467         (WebCore::BackForwardItemIdentifier::logString const):
1468         (WebCore::operator==):
1469         (WebCore::BackForwardItemIdentifier::encode const):
1470         (WebCore::BackForwardItemIdentifier::decode):
1471         (WebCore::BackForwardItemIdentifier::hash const):
1472         (WTF::BackForwardItemIdentifierHash::hash):
1473         (WTF::BackForwardItemIdentifierHash::equal):
1474         (WTF::HashTraits<WebCore::BackForwardItemIdentifier>::emptyValue):
1475         (WTF::HashTraits<WebCore::BackForwardItemIdentifier>::constructDeletedValue):
1476         (WTF::HashTraits<WebCore::BackForwardItemIdentifier>::isDeletedValue):
1477
1478         * history/HistoryItem.cpp:
1479         (WebCore::HistoryItem::generateSequenceNumber):
1480         (WebCore::HistoryItem::HistoryItem):
1481         (WebCore::generateSequenceNumber): Deleted.
1482
1483         * history/HistoryItem.h:
1484         (WebCore::HistoryItem::create):
1485         (WebCore::HistoryItem::identifier const):
1486
1487 2018-04-19  Nan Wang  <n_wang@apple.com>
1488
1489         AX: AOM: respect the accessibility setting for dispatching the accessible events
1490         https://bugs.webkit.org/show_bug.cgi?id=184619
1491
1492         Reviewed by Ryosuke Niwa.
1493
1494         Added accessibilityEventsEnabled as a setting on the page.
1495
1496         Test: accessibility/ios-simulator/accessibility-events-setting.html
1497
1498         * accessibility/AccessibilityObject.cpp:
1499         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
1500         * page/Settings.yaml:
1501         * testing/InternalSettings.cpp:
1502         (WebCore::InternalSettings::Backup::Backup):
1503         (WebCore::InternalSettings::Backup::restoreTo):
1504         (WebCore::InternalSettings::setAccessibilityEventsEnabled):
1505         * testing/InternalSettings.h:
1506         * testing/InternalSettings.idl:
1507
1508 2018-04-18  Jer Noble  <jer.noble@apple.com>
1509
1510         Fix build when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
1511         https://bugs.webkit.org/show_bug.cgi?id=184693
1512         <rdar://problem/39491884>
1513
1514         Reviewed by Tim Horton.
1515
1516         * Configurations/WebCore.xcconfig:
1517
1518 2018-04-19  Eric Stobbart  <ericstobbart@gmail.com>
1519
1520         Change MediaSource WebCore to return NewObject for SourceBuffers
1521         https://bugs.webkit.org/show_bug.cgi?id=184642
1522
1523         Reviewed by Chris Dumez.
1524
1525         Minor change inline with IDL documentation
1526
1527         * Modules/mediasource/MediaSource.cpp:
1528         (WebCore::MediaSource::addSourceBuffer):
1529         (): Deleted.
1530         * Modules/mediasource/MediaSource.h:
1531         * Modules/mediasource/MediaSource.idl:
1532
1533 2018-04-19  Yusuke Suzuki  <utatane.tea@gmail.com>
1534
1535         Unreviewed, build fix for Ubuntu LTS GCC
1536         https://bugs.webkit.org/show_bug.cgi?id=184756
1537
1538         The variable name "windowProxy" (with auto&) conflicts with the function name "windowProxy".
1539
1540         * bindings/js/ScriptController.cpp:
1541         (WebCore::ScriptController::updateDocument):
1542         (WebCore::ScriptController::collectIsolatedContexts):
1543
1544 2018-04-19  Manuel Rego Casasnovas  <rego@igalia.com>
1545
1546         Caret rendered at incorrect location inside empty table cell
1547         https://bugs.webkit.org/show_bug.cgi?id=85385
1548
1549         Reviewed by Zalan Bujtas.
1550
1551         This is based on a previous patch by Shezan Baig <shezbaig.wk@gmail.com>.
1552
1553         This fixes the position of the caret in empty cells,
1554         that was painted lower than expected
1555         (and then modified when you start to edit the cell).
1556
1557         Ensures that editable table cells have at least one line when
1558         they are laid out. This ensures that the cell's intrinsic before/after
1559         padding is calculated correctly, which results in the caret location
1560         being calculated correctly.
1561
1562         Test: editing/caret/caret-in-empty-cell.html
1563
1564         * rendering/RenderTableCell.cpp:
1565         (WebCore::RenderTableCell::hasLineIfEmpty): Override method to consider
1566         that it has an an empty line if the table cell is editable.
1567         * rendering/RenderTableCell.h:
1568
1569 2018-04-18  Daniel Bates  <dabates@apple.com>
1570
1571         Cleanup TextControlInnerElements
1572         https://bugs.webkit.org/show_bug.cgi?id=184475
1573
1574         Reviewed by Antti Koivisto.
1575
1576         Clean up TextControlInnerElement::resolveCustomStyle(), move the implementation of
1577         TextControlPlaceholderElement::create() from the header to the cpp file, replace
1578         fancy comments to demarcate classes with MARK: so that they show up in Xcode's
1579         function menu.
1580
1581         * html/shadow/TextControlInnerElements.cpp:
1582         (WebCore::TextControlInnerElement::resolveCustomStyle):
1583         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
1584         (WebCore::TextControlPlaceholderElement::create):
1585         * html/shadow/TextControlInnerElements.h:
1586
1587 2018-04-18  Chris Dumez  <cdumez@apple.com>
1588
1589         Rename WindowProxyController to WindowProxy
1590         https://bugs.webkit.org/show_bug.cgi?id=184756
1591
1592         Reviewed by Sam Weinig.
1593
1594         Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
1595         needed use WindowProxyController type, which was a bit confusing.
1596
1597         * Sources.txt:
1598         * WebCore.xcodeproj/project.pbxproj:
1599         * bindings/js/DOMWrapperWorld.cpp:
1600         (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
1601         (WebCore::DOMWrapperWorld::clearWrappers):
1602         * bindings/js/DOMWrapperWorld.h:
1603         (WebCore::DOMWrapperWorld::didCreateWindowProxy):
1604         (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
1605         * bindings/js/JSBindingsAllInOne.cpp:
1606         * bindings/js/JSDOMWindowBase.cpp:
1607         (WebCore::toJS):
1608         * bindings/js/JSDOMWindowProxy.cpp:
1609         (WebCore::toJS):
1610         (WebCore::toJSDOMWindowProxy):
1611         * bindings/js/JSDOMWindowProxy.h:
1612         (WebCore::toJS):
1613         (WebCore::toJSDOMWindowProxy):
1614         * bindings/js/ScriptCachedFrameData.cpp:
1615         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
1616         (WebCore::ScriptCachedFrameData::restore):
1617         * bindings/js/ScriptController.cpp:
1618         (WebCore::ScriptController::evaluateInWorld):
1619         (WebCore::ScriptController::loadModuleScriptInWorld):
1620         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
1621         (WebCore::ScriptController::evaluateModule):
1622         (WebCore::ScriptController::setupModuleScriptHandlers):
1623         (WebCore::ScriptController::windowProxy):
1624         (WebCore::ScriptController::enableEval):
1625         (WebCore::ScriptController::enableWebAssembly):
1626         (WebCore::ScriptController::disableEval):
1627         (WebCore::ScriptController::disableWebAssembly):
1628         (WebCore::ScriptController::updateDocument):
1629         (WebCore::ScriptController::collectIsolatedContexts):
1630         (WebCore::ScriptController::windowScriptNPObject):
1631         (WebCore::ScriptController::executeIfJavaScriptURL):
1632         * bindings/js/ScriptController.h:
1633         (WebCore::ScriptController::globalObject):
1634         * bindings/js/ScriptControllerMac.mm:
1635         (WebCore::ScriptController::windowScriptObject):
1636         * bindings/js/ScriptState.cpp:
1637         (WebCore::mainWorldExecState):
1638         * bindings/js/WindowProxy.cpp: Renamed from Source/WebCore/bindings/js/WindowProxyController.cpp.
1639         (WebCore::WindowProxy::WindowProxy):
1640         (WebCore::WindowProxy::~WindowProxy):
1641         (WebCore::WindowProxy::destroyJSWindowProxy):
1642         (WebCore::WindowProxy::createJSWindowProxy):
1643         (WebCore::WindowProxy::jsWindowProxiesAsVector const):
1644         (WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
1645         (WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
1646         (WebCore::WindowProxy::setDOMWindow):
1647         (WebCore::WindowProxy::attachDebugger):
1648         * bindings/js/WindowProxy.h: Renamed from Source/WebCore/bindings/js/WindowProxyController.h.
1649         (WebCore::WindowProxy::jsWindowProxies const):
1650         (WebCore::WindowProxy::releaseJSWindowProxies):
1651         (WebCore::WindowProxy::setJSWindowProxies):
1652         (WebCore::WindowProxy::jsWindowProxy):
1653         (WebCore::WindowProxy::existingJSWindowProxy const):
1654         (WebCore::WindowProxy::globalObject):
1655         * loader/FrameLoader.cpp:
1656         (WebCore::FrameLoader::clear):
1657         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
1658         * page/AbstractFrame.cpp:
1659         (WebCore::AbstractFrame::AbstractFrame):
1660         * page/AbstractFrame.h:
1661         (WebCore::AbstractFrame::windowProxy):
1662         (WebCore::AbstractFrame::windowProxy const):
1663         * page/Page.cpp:
1664         (WebCore::Page::setDebugger):
1665         * page/RemoteDOMWindow.cpp:
1666         (WebCore::RemoteDOMWindow::self const):
1667         (WebCore::RemoteDOMWindow::top const):
1668         (WebCore::RemoteDOMWindow::opener const):
1669         (WebCore::RemoteDOMWindow::parent const):
1670         * page/RemoteDOMWindow.h:
1671
1672 2018-04-18  Chris Dumez  <cdumez@apple.com>
1673
1674         Set RemoteDOMWindow's initial opener
1675         https://bugs.webkit.org/show_bug.cgi?id=184716
1676
1677         Reviewed by Sam Weinig.
1678
1679         Add support for WindowProxy type in the IDL. The implementation should
1680         return a WindowProxyController and toJS() will take care of converting
1681         this into a JSValue via JSDOMWindowProxy.
1682
1683         No new tests, rebaselined existing test.
1684
1685         * WebCore.xcodeproj/project.pbxproj:
1686         * bindings/IDLTypes.h:
1687         * bindings/js/JSDOMConvertWindowProxy.h: Added.
1688         (WebCore::JSConverter<IDLWindowProxy>::convert):
1689         * bindings/js/JSDOMWindowBase.cpp:
1690         (WebCore::toJS):
1691         * bindings/js/JSDOMWindowBase.h:
1692         (WebCore::toJS):
1693         * bindings/js/JSDOMWindowProxy.cpp:
1694         (WebCore::toJS):
1695         (WebCore::toJSDOMWindowProxy):
1696         * bindings/js/JSDOMWindowProxy.h:
1697         (WebCore::toJS):
1698         (WebCore::toJSDOMWindowProxy):
1699         * bindings/js/JSRemoteDOMWindowBase.cpp:
1700         * bindings/js/JSRemoteDOMWindowBase.h:
1701         * bindings/scripts/CodeGenerator.pm:
1702         (IsBuiltinType):
1703         * bindings/scripts/CodeGeneratorJS.pm:
1704         (AddToIncludesForIDLType):
1705         (GetBaseIDLType):
1706         * page/RemoteDOMWindow.cpp:
1707         (WebCore::RemoteDOMWindow::self const):
1708         (WebCore::RemoteDOMWindow::top const):
1709         (WebCore::RemoteDOMWindow::opener const):
1710         (WebCore::RemoteDOMWindow::parent const):
1711         * page/RemoteDOMWindow.h:
1712         * page/RemoteDOMWindow.idl:
1713         * page/RemoteFrame.h:
1714
1715 2018-04-18  Dean Jackson  <dino@apple.com>
1716
1717         Detect system preview links
1718         https://bugs.webkit.org/show_bug.cgi?id=184753
1719         <rdar://problem/39500514>
1720
1721         Reviewed by Antoine Quint.
1722
1723         Detect a special type of link anchor, which we're calling System Previews.
1724         Ultimately this will allow WebKit to present such links in a special
1725         way.
1726
1727         A System Preview link is an <a> element, with a rel attribute that
1728         includes "system-preview". It has a single element child, which is
1729         either an <img> or a <picture>.
1730
1731         Test: system-preview/detection.html
1732
1733         * html/HTMLAnchorElement.cpp:
1734         (WebCore::HTMLAnchorElement::relList): Add braces.
1735         (WebCore::HTMLAnchorElement::isSystemPreviewLink const): New
1736         function.
1737         * html/HTMLAnchorElement.h:
1738
1739         * html/HTMLImageElement.cpp:
1740         (WebCore::HTMLImageElement::isSystemPreviewImage const): Ask the
1741         parent if it is a system preview link.
1742         * html/HTMLImageElement.h:
1743         * html/HTMLPictureElement.cpp:
1744         (WebCore::HTMLPictureElement::isSystemPreviewImage const): Ditto.
1745         * html/HTMLPictureElement.h:
1746
1747         * testing/Internals.cpp: Testing helpers.
1748         (WebCore::Internals::systemPreviewRelType):
1749         (WebCore::Internals::isSystemPreviewLink const):
1750         (WebCore::Internals::isSystemPreviewImage const):
1751         * testing/Internals.h:
1752         * testing/Internals.idl:
1753
1754 2018-04-18  Antti Koivisto  <antti@apple.com>
1755
1756         :active pseudo class doesn't deactivate when using pressure sensitive trackpad
1757         https://bugs.webkit.org/show_bug.cgi?id=181680
1758
1759         Reviewed by Beth Dakin.
1760
1761         Trackpad sends a mouse force event with force of zero after mouse up event. This causes the element under cursor
1762         activate again.
1763
1764         Even a fake event test doesn't appear to be currently possible as TestRunner crashes if you try to send mouseForceChanged.
1765         All the tests using it are skipped.
1766
1767         * page/EventHandler.cpp:
1768         (WebCore::EventHandler::handleMouseForceEvent):
1769
1770         Don't add HitTestRequest::Active if the force of the force event is zero.
1771
1772 2018-04-18  Megan Gardner  <megan_gardner@apple.com>
1773
1774         Ensure correct screen sizes
1775         https://bugs.webkit.org/show_bug.cgi?id=184757
1776         
1777         Reviewed by Wenson Hsieh.
1778         
1779         Make sure that the screen sizes are actually correct.
1780
1781         Not currently testable, will add tests when it is.
1782
1783         * platform/ios/PlatformScreenIOS.mm:
1784
1785 2018-04-18  Nan Wang  <n_wang@apple.com>
1786
1787         AX: [macOS] WebKit hangs when triggering an alert from an AOM increment event
1788         https://bugs.webkit.org/show_bug.cgi?id=184742
1789
1790         Reviewed by Chris Fleizach.
1791
1792         Made increment and decrement actions on the macOS to be async. So that VoiceOver
1793         won't hang indefinitely if performing the actions causes an alert or other modal
1794         behaviors.
1795
1796         Test: accessibility/mac/async-increment-decrement-action.html
1797
1798         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1799         (-[WebAccessibilityObjectWrapper accessibilityPerformIncrementAction]):
1800         (-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
1801         (-[WebAccessibilityObjectWrapper accessibilityPerformDecrementAction]):
1802         (-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
1803         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
1804
1805 2018-04-18  Youenn Fablet  <youenn@apple.com>
1806
1807         MediaResourceLoader should set its fetch destination
1808         https://bugs.webkit.org/show_bug.cgi?id=184746
1809
1810         Reviewed by Eric Carlson.
1811
1812         Covered by updated test.
1813
1814         * loader/MediaResourceLoader.cpp:
1815         (WebCore::MediaResourceLoader::requestResource):
1816
1817 2018-04-18  Jer Noble  <jer.noble@apple.com>
1818
1819         Fix runtime errors in simulator while playing media
1820         https://bugs.webkit.org/show_bug.cgi?id=184751
1821
1822         Reviewed by Eric Carlson.
1823
1824         AVURLAssetHTTPCookiesKey may not be present, and AVPlayer may not respond to certain methods.
1825
1826         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1827         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1828         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1829         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
1830         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
1831
1832 2018-04-18  Jer Noble  <jer.noble@apple.com>
1833
1834         Ignore ASSERT when setting AVAudioSessionCategory returns an error on simulator.
1835         https://bugs.webkit.org/show_bug.cgi?id=184698
1836
1837         Reviewed by Eric Carlson.
1838
1839         * platform/audio/ios/AudioSessionIOS.mm:
1840         * platform/audio/mac/AudioSessionMac.cpp:
1841
1842 2018-04-18  Sihui Liu  <sihui_liu@apple.com>
1843
1844         REGRESSION: Using the reload button while offline pushes identical pages onto the back/forward list
1845         https://bugs.webkit.org/show_bug.cgi?id=184570
1846         <rdar://problem/34807323>
1847
1848         Reviewed by Chris Dumez.
1849
1850         Set FrameLoadType properly when error occurs in reload.
1851
1852         tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm
1853
1854         * loader/FrameLoader.cpp:
1855         (WebCore::FrameLoader::load):
1856
1857 2018-04-18  Chris Dumez  <cdumez@apple.com>
1858
1859         Add support for converting a local window to a remote window
1860         https://bugs.webkit.org/show_bug.cgi?id=184515
1861         <rdar://problem/39011318>
1862
1863         Reviewed by Ryosuke Niwa.
1864
1865         Add initial support for process-swapping when navigating cross-origin as a result
1866         of a window.open(). The window object returned by window.open() is initially same
1867         origin and is for about:blank. The navigation cross-origin then happens and the
1868         JS wrappers for the window then point to a cross-origin window which is remote (i.e.
1869         hosted in another WebProcess).
1870
1871         The RemoteDOMWindow exposed to JS looks like a regular cross-origin Window with a few
1872         exceptions due to our incomplete implementation (e.g. w.location returns null) and 
1873         most of its API is currently not functional. The RemoteDOMWindow API will be implemented
1874         in a follow-up by relying on IPC.
1875
1876         Test: http/tests/navigation/process-swap-window-open.html
1877
1878         * bindings/js/JSDOMGlobalObject.cpp:
1879         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
1880         * bindings/js/JSDOMPromiseDeferred.h:
1881         * bindings/js/JSDOMWindowProperties.cpp:
1882         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
1883         * bindings/js/JSDOMWindowProxy.cpp:
1884         (WebCore::JSDOMWindowProxy::finishCreation):
1885         (WebCore::JSDOMWindowProxy::create):
1886         * bindings/js/JSDOMWindowProxy.h:
1887         * bindings/js/JSDOMWrapper.cpp:
1888         (WebCore::JSDOMObject::JSDOMObject):
1889         * bindings/js/JSDOMWrapper.h:
1890         * bindings/js/WindowProxyController.cpp:
1891         (WebCore::WindowProxyController::createWindowProxy):
1892         (WebCore::WindowProxyController::setDOMWindowForWindowProxy):
1893         * bridge/objc/WebScriptObject.mm:
1894         (-[WebScriptObject _isSafeScript]):
1895         Teach more of our bindings code about RemoteDOMWindows.
1896
1897         * dom/Document.cpp:
1898         (WebCore::Document::createDOMWindow):
1899         * loader/FrameLoaderClient.h:
1900         Add FrameLoaderClient function to notify the client when a DOMWindow is constructed in
1901         the frame. This is needed for WebKit2 to link the old window to its new representation
1902         in the new WebProcess.
1903
1904 2018-04-17  Zan Dobersek  <zdobersek@igalia.com>
1905
1906         [CMake] Add and enable the ENABLE_CSS_ANIMATIONS_LEVEL_2 feature define
1907         https://bugs.webkit.org/show_bug.cgi?id=184681
1908
1909         Reviewed by Carlos Garcia Campos.
1910
1911         * Sources.txt: Include CSSAnimationTriggerScrollValue.cpp in the build.
1912         * WebCore.xcodeproj/project.pbxproj: Remove CSSAnimationTriggerScrollValue.cpp
1913         build target now that it's built via Sources.txt.
1914
1915 2018-04-17  Zan Dobersek  <zdobersek@igalia.com>
1916
1917         [CoordGraphics] CoordinatedImageBacking can simplify image drawing
1918         https://bugs.webkit.org/show_bug.cgi?id=183986
1919
1920         Reviewed by Michael Catanzaro.
1921
1922         In CoordinatedImageBacking::update(), when drawing the image into a
1923         freshly-created image backing, we can avoid save-and-restoring the
1924         painting context. We also don't have to clip it, since the clipping area
1925         is the same as the image (and buffer) bounds. Since the buffer is
1926         initialized to transparent color, we can use the CompositeCopy operator
1927         to just copy image data into the destination since there's nothing to
1928         paint the source over.
1929
1930         No new tests -- no change in functionality.
1931
1932         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
1933         (WebCore::CoordinatedImageBacking::update):
1934
1935 2018-04-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1936
1937         [GTK] Webkit should spoof as Safari on a Mac for Outlook.com
1938         https://bugs.webkit.org/show_bug.cgi?id=184573
1939
1940         Reviewed by Carlos Alberto Lopez Perez.
1941
1942         Add quirk for outlook.live.com.
1943
1944         * platform/UserAgentQuirks.cpp:
1945         (WebCore::urlRequiresMacintoshPlatform):
1946
1947 2018-04-17  Mark Lam  <mark.lam@apple.com>
1948
1949         Templatize CodePtr/Refs/FunctionPtrs with PtrTags.
1950         https://bugs.webkit.org/show_bug.cgi?id=184702
1951         <rdar://problem/35391681>
1952
1953         Reviewed by Filip Pizlo and Saam Barati.
1954
1955         No new tests. This is covered by existing tests.
1956
1957         * WebCore.xcodeproj/project.pbxproj:
1958         * css/ElementRuleCollector.cpp:
1959         (WebCore::ElementRuleCollector::ruleMatches):
1960         * cssjit/CSSPtrTag.h: Added.
1961         * cssjit/CompiledSelector.h:
1962         * cssjit/FunctionCall.h:
1963         (WebCore::FunctionCall::FunctionCall):
1964         (WebCore::FunctionCall::setFunctionAddress):
1965         (WebCore::FunctionCall::prepareAndCall):
1966         * cssjit/SelectorCompiler.cpp:
1967         (WebCore::SelectorCompiler::compileSelector):
1968         (WebCore::SelectorCompiler::SelectorFragment::appendUnoptimizedPseudoClassWithContext):
1969         (WebCore::SelectorCompiler::addPseudoClassType):
1970         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1971         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
1972         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest):
1973         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest):
1974         * cssjit/SelectorCompiler.h:
1975         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
1976         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
1977         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
1978         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
1979         * dom/SelectorQuery.cpp:
1980         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
1981         (WebCore::SelectorDataList::execute const):
1982         * dom/SelectorQuery.h:
1983
1984 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
1985
1986         Retain MessagePortChannel for transfer when disentangling ports
1987         https://bugs.webkit.org/show_bug.cgi?id=184502
1988         <rdar://problem/39372771>
1989
1990         Reviewed by Geoffrey Garen.
1991
1992         MessagePortChannels should be retained while ports are being transferred, but that was only
1993         happening when sending a port through another port, but not when sending it through a worker.
1994
1995         Test: workers/worker-to-worker.html
1996
1997         * dom/messageports/MessagePortChannel.cpp:
1998         (WebCore::MessagePortChannel::entanglePortWithProcess):
1999         (WebCore::MessagePortChannel::disentanglePort):
2000         (WebCore::MessagePortChannel::postMessageToRemote):
2001         (WebCore::MessagePortChannel::takeAllMessagesForPort):
2002
2003 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
2004
2005         References from CSSStyleDeclaration to CSSValues should be weak
2006         https://bugs.webkit.org/show_bug.cgi?id=180280
2007         <rdar://problem/35804869>
2008
2009         Reviewed by Geoffrey Garen.
2010
2011         No new tests - used the existing test to verify the leak
2012
2013         * css/DeprecatedCSSOMValue.h:
2014         (WebCore::DeprecatedCSSOMValue::weakPtrFactory):
2015         * css/PropertySetCSSStyleDeclaration.cpp:
2016         (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
2017         * css/PropertySetCSSStyleDeclaration.h:
2018
2019 2018-04-17  Jonathan Bedard  <jbedard@apple.com>
2020
2021         Unreviewed rollout of r230632. Regression in memory usage.
2022
2023         That bug tracked in https://bugs.webkit.org/show_bug.cgi?id=184569.
2024
2025         Tests: animations/animation-internals-api-multiple-keyframes.html
2026                animations/animation-internals-api.html
2027                transitions/transition-drt-api-delay.html
2028                transitions/transition-drt-api.html
2029
2030         * page/RuntimeEnabledFeatures.h:
2031         * testing/Internals.cpp:
2032         (WebCore::Internals::pseudoElement): Deleted.
2033         * testing/Internals.h:
2034         * testing/Internals.idl:
2035
2036 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
2037
2038         Do not unregister MessagePorts on deallocation if it has been disentangled
2039         https://bugs.webkit.org/show_bug.cgi?id=184285
2040         <rdar://problem/39256714>
2041
2042         Reviewed by Darin Adler.
2043
2044         Test: workers/message-port-gc.html
2045
2046         * dom/MessagePort.cpp:
2047         (WebCore::MessagePort::deref const):
2048
2049 2018-04-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2050
2051         [Curl] Fix timing of reporting error to the client
2052         https://bugs.webkit.org/show_bug.cgi?id=184707
2053
2054         Before checking the result code, check the status of callback invocation and
2055         do the right thing.
2056
2057         Reviewed by Youenn Fablet.
2058
2059         No new tests because there's no new behavior.
2060
2061         * platform/network/curl/CurlRequest.cpp:
2062         (WebCore::CurlRequest::didCompleteTransfer):
2063         * platform/network/curl/CurlRequest.h:
2064         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
2065
2066 2018-04-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2067
2068         [Curl] Export authentication information to be used by the client.
2069         https://bugs.webkit.org/show_bug.cgi?id=184709
2070
2071         Just added getters for username and password member variables.
2072
2073         Reviewed by Alex Christensen.
2074
2075         No new tests because there's no new behavior.
2076
2077         * platform/network/curl/CurlRequest.h:
2078         (WebCore::CurlRequest::user const):
2079         (WebCore::CurlRequest::password const):
2080
2081 2018-04-17  Chris Dumez  <cdumez@apple.com>
2082
2083         REGRESSION (r229831): CMD-clicking an iCloud web app link unexpectedly opens that link in a new tab and the current tab
2084         https://bugs.webkit.org/show_bug.cgi?id=184678
2085         <rdar://problem/39422122>
2086
2087         Reviewed by Alex Christensen.
2088
2089         Frament navigations need to happen synchronously for Web-compatibility. Because of this,
2090         r225657 added code to make sure that if the client does not make the navigation policy
2091         decision synchronously for frament navigations, then we'll stop waiting for the client
2092         and proceed with the navigation. However, r229831 make the navigation policy decision
2093         IPC decision, meaning that even if the client responds synchronously, it would be
2094         asynchronously from WebCore's point of view. As a result, we would always ignore the
2095         client's policy decision when doing a fragment navigation.
2096
2097         This is an issue on iclould.com because the web-app links are fragment URLs. When you
2098         CMD+click one of these link, we do the navigation policy check. As a result of this
2099         check, Safari responds IGNORE to the policy decision and instead decides to load the
2100         link in a new tab (because CMD key is pressed). Due to the bug mentioned above, we
2101         would not obey the IGNORE policy decision from Safari and load the link in the current
2102         tab, even though Safari would already be loading it in a new tab.
2103
2104         To address the issue, I reintroduced a synchronous code path for navigation policy
2105         decision making, backed by synchronous IPC. This synchronous code path is now used for
2106         fragment navigations to restore pre-r229831 behavior. If the client does not answer
2107         synchronously, we'll proceed with the navigation anyway, as was happening pre-r229831.
2108
2109         Test: http/tests/navigation/fragment-navigation-policy-ignore.html
2110
2111         * loader/EmptyClients.cpp:
2112         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2113         * loader/EmptyFrameLoaderClient.h:
2114         * loader/FrameLoader.cpp:
2115         (WebCore::FrameLoader::loadURL):
2116         (WebCore::FrameLoader::loadWithDocumentLoader):
2117         * loader/FrameLoaderClient.h:
2118         * loader/PolicyChecker.cpp:
2119         (WebCore::PolicyChecker::checkNavigationPolicy):
2120         * loader/PolicyChecker.h:
2121
2122 2018-04-17  Matt Lewis  <jlewis3@apple.com>
2123
2124         Unreviewed, rolling out r230713.
2125
2126         This caused internal build failures.
2127
2128         Reverted changeset:
2129
2130         "Implement checked cast for DDResultRef once
2131         DDResultGetTypeID() is available"
2132         https://bugs.webkit.org/show_bug.cgi?id=184554
2133         https://trac.webkit.org/changeset/230713
2134
2135 2018-04-17  Chris Dumez  <cdumez@apple.com>
2136
2137         Add bindings code for RemoteDOMWindow
2138         https://bugs.webkit.org/show_bug.cgi?id=184653
2139
2140         Reviewed by Ryosuke Niwa.
2141
2142         Add bindings code for RemoteDOMWindow. A RemoteDOMWindow behaves exactly like a cross-origin
2143         DOMWindow, which is backed by a RemoteDOMWindow object instead of a DOMWindow one. Since
2144         a RemoteDOMWindow is always cross origin, we do not need cross-origin checks and the bindings
2145         code is identical to the DOMWindow code paths from cross-origin handling.
2146
2147         No new tests, this code will be used and tested via Bug 184515.
2148
2149         * CMakeLists.txt:
2150         * DerivedSources.make:
2151         * Sources.txt:
2152         * WebCore.xcodeproj/project.pbxproj:
2153         * bindings/js/JSBindingsAllInOne.cpp:
2154         * bindings/js/JSDOMWindowCustom.cpp:
2155         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2156         (WebCore::JSDOMWindow::getOwnPropertySlot):
2157         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2158         (WebCore::addCrossOriginWindowOwnPropertyNames):
2159         * bindings/js/JSDOMWindowCustom.h:
2160
2161         * bindings/js/JSRemoteDOMWindowBase.cpp: Added.
2162         (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
2163         (WebCore::JSRemoteDOMWindowBase::destroy):
2164         (WebCore::JSRemoteDOMWindowBase::javaScriptRuntimeFlags):
2165         (WebCore::toJS):
2166         (WebCore::toJSRemoteDOMWindow):
2167         * bindings/js/JSRemoteDOMWindowBase.h: Added.
2168         JSRemoteDOMWindow unfortunately currently needs to be a global object because of:
2169         1. a JSProxy's target needs to be a JSGlobalObject currently
2170         2. The 'structure()->setGlobalObject(vm, &window);' call in
2171            JSDOMWindowProxy::setWindow(VM&, JSDOMGlobalObject&) which requires a JSGlobalObject.
2172         Ideally, this wouldn't be the case in the future but this would require some code refactoring.
2173         Our DOM global objects normally subclass JSDOMGlobalObject so I decided to subclass JSDOMGlobalObject,
2174         which brings some things our bindings code expect. However, subclassing JSDOMGlobalObject directly is
2175         problematic because it does not hold the m_wrapped implementation pointer. To address this issue, all
2176         our our DOM global objects have a JS*Base base class which subclasses JSDOMGlobalObject and stores the
2177         m_wrapped implementation pointer. I followed the same pattern here.
2178
2179         (WebCore::toJS):
2180         * bindings/js/JSRemoteDOMWindowCustom.cpp: Added.
2181         (WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
2182         (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
2183         (WebCore::JSRemoteDOMWindow::put):
2184         (WebCore::JSRemoteDOMWindow::putByIndex):
2185         (WebCore::JSRemoteDOMWindow::deleteProperty):
2186         (WebCore::JSRemoteDOMWindow::deletePropertyByIndex):
2187         (WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
2188         (WebCore::JSRemoteDOMWindow::defineOwnProperty):
2189         (WebCore::JSRemoteDOMWindow::getPrototype):
2190         (WebCore::JSRemoteDOMWindow::preventExtensions):
2191         (WebCore::JSRemoteDOMWindow::toStringName):
2192         * bindings/scripts/CodeGeneratorJS.pm:
2193         (IsDOMGlobalObject):
2194         (GenerateHeader):
2195         (GenerateOverloadDispatcher):
2196         (GenerateImplementation):
2197         * page/RemoteDOMWindow.idl: Added.
2198
2199 2018-04-17  David Kilzer  <ddkilzer@apple.com>
2200
2201         Implement checked cast for DDResultRef once DDResultGetTypeID() is available
2202         <https://webkit.org/b/184554>
2203         <rdar://problem/36241894>
2204
2205         Reviewed by Brent Fulgham.
2206
2207         * editing/cocoa/DataDetection.mm:
2208         (WebCore::detectItemAtPositionWithRange): Implement checked cast
2209         for DDResultRef.
2210
2211 2018-04-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2212
2213         Animated GIF imagery with finite looping are falling one loop short
2214         https://bugs.webkit.org/show_bug.cgi?id=183153
2215
2216         Reviewed by Simon Fraser.
2217
2218         The Netscape Looping Application Extension is a block which may be added
2219         to a GIF file to tell the viewer to loop through the entire GIF frames.
2220         This is communicated through two bytes designated for the "loopCount" in
2221         this block.
2222
2223         The entire block may not be found in the GIF, in which case the GIF is 
2224         supposed to animate its entire frames only once.
2225
2226         If the block exists and loopCount = 0, this means the image has to loop
2227         through its frames indefinitely.
2228
2229         If the block exist and loopCount > 0, this should mean the image has to
2230         loop through its frames loopCount + 1 times. The extra loop seems to be
2231         the consensus among most of the GIF generators and viewers. For example,
2232         if the image designer wants the image to loop through its frames n times:
2233         -- The GIF generator (e.g. Adobe Photoshop and https://ezgif.com/maker) 
2234            will write n - 1 for loopCount. However http://gifmaker.me and 
2235            http://gifmaker.org write n for loopCount.
2236         -- The browser (e.g. Chrome 65.0.3325 181 and FireFox Quantum 59.0.2) will
2237            translate loopCount = n - 1 to: animate GIF once + loop n - 1, which 
2238            means loop the GIF n times.
2239
2240         Because the specs are not really clear about this, we are going to consider
2241         the agreed-upon behavior among most of the web browsers the specs here.
2242
2243         * platform/graphics/cg/ImageDecoderCG.cpp:
2244         (WebCore::ImageDecoderCG::repetitionCount const):
2245         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2246         (WebCore::GIFImageDecoder::repetitionCount const):
2247
2248 2018-04-17  Saam Barati  <sbarati@apple.com>
2249
2250         Add system trace points for process launch and for initializeWebProcess
2251         https://bugs.webkit.org/show_bug.cgi?id=184669
2252
2253         Reviewed by Simon Fraser.
2254
2255         No testing needed because there is no new functionality here.
2256
2257         * loader/FrameLoader.cpp:
2258         (WebCore::FrameLoader::provisionalLoadStarted):
2259         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2260         * loader/SubresourceLoader.cpp:
2261         (WebCore::SubresourceLoader::willSendRequestInternal):
2262         (WebCore::SubresourceLoader::didFinishLoading):
2263         (WebCore::SubresourceLoader::didFail):
2264         (WebCore::SubresourceLoader::didCancel):
2265
2266 2018-04-17  Eric Carlson  <eric.carlson@apple.com>
2267
2268         [iOS] AirPlay device name is sometimes wrong
2269         https://bugs.webkit.org/show_bug.cgi?id=184543
2270         <rdar://problem/39105498>
2271
2272         Reviewed by Jer Noble.
2273
2274         No new tests, this can only be tested with a specific hardware setup.
2275
2276         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2277         (WebCore::exernalDeviceDisplayNameForPlayer): Get the device name from the AVOutputContext
2278         when possible.
2279
2280 2018-04-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2281
2282         [GTK] Build fix after r230529 (WaylandCompositorDisplay leaks its wl_display)
2283         https://bugs.webkit.org/show_bug.cgi?id=184406
2284
2285         Rubber-stamped by Michael Catanzaro.
2286
2287         Fix build with clang 3.8
2288
2289         No new tests, it is a build fix.
2290
2291         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2292         (WebCore::PlatformDisplayWayland::create):
2293
2294 2018-04-16  Antoine Quint  <graouts@apple.com>
2295
2296         Layout Test animations/needs-layout.html is a flaky Image Failure.
2297         https://bugs.webkit.org/show_bug.cgi?id=172397
2298
2299         Reviewed by Dean Jackson.
2300
2301         Animations that animate a transform and uses a relative value for either the x or y components
2302         require a layout before starting, which CSSAnimationController would perform in the call to
2303         CSSAnimationControllerPrivate::animationTimerFired() made immediately after a CSS animation was
2304         created.
2305
2306         We now perform a similar task where upon setting new blending keyframes we compute a flag indicating
2307         if the keyframe effect is animating a transform with relative x or y components. Then, when we perform
2308         the first invalidation task, which runs in the next run loop after a change to the timing model has
2309         been made, such as a call to play() on a CSSAnimation made in the TreeResolver::createAnimatedElementUpdate()
2310         where the CSSAnimation was created, we call forceLayout() on this element's FrameView. We also ensure
2311         we commit animations on the compositor immediately after that too, instead of waiting until the next
2312         DisplayRefreshMonitor callback.
2313
2314         * animation/DocumentTimeline.cpp:
2315         (WebCore::DocumentTimeline::performInvalidationTask):
2316         (WebCore::DocumentTimeline::updateAnimations):
2317         * animation/KeyframeEffectReadOnly.cpp:
2318         (WebCore::KeyframeEffectReadOnly::forceLayoutIfNeeded):
2319         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
2320         (WebCore::KeyframeEffectReadOnly::computedNeedsForcedLayout):
2321         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
2322         * animation/KeyframeEffectReadOnly.h:
2323
2324 2018-04-16  Pablo Saavedra  <psaavedra@igalia.com>
2325
2326         Inconsistent EGL defines in ImageBufferCairo
2327         https://bugs.webkit.org/show_bug.cgi?id=184661
2328
2329         Reviewed by Žan Doberšek.
2330
2331         On revision r219391 libepoxy is added. The headers in
2332         ImageBufferCairo.cpp become inconsistent when 2D canvas is enabled
2333         (-DENABLE_ACCELERATED_2D_CANVAS=ON) due to a redefinition error during
2334         the Webkit build:
2335
2336             ...
2337             /usr/include/GLES2/gl2.h:503:82: error: 'voi
2338             epoxy_glAttachShader(GLuint, GLuint)' redeclared as different kind
2339             of symbol
2340             GL_APICALL void         GL_APIENTRY glAttachShader (GLuint
2341             program, GLuint shader);
2342
2343         No new tests.
2344
2345         * platform/graphics/cairo/ImageBufferCairo.cpp:
2346
2347 2018-04-16  Filip Pizlo  <fpizlo@apple.com>
2348
2349         MutationObserver should be in an IsoHeap
2350         https://bugs.webkit.org/show_bug.cgi?id=184671
2351         <rdar://problem/36081981>
2352
2353         Reviewed by Sam Weinig.
2354
2355         No new tests because no new behavior.
2356
2357         * dom/MutationObserver.cpp:
2358         * dom/MutationObserver.h:
2359
2360 2018-04-16  Youenn Fablet  <youenn@apple.com>
2361
2362         Use NetworkLoadChecker to handle synchronous HTTP loads
2363         https://bugs.webkit.org/show_bug.cgi?id=184240
2364
2365         Reviewed by Chris Dumez.
2366
2367         Update LoaderStrategy::loadResourceSynchronously to pass FetchOptions directly.
2368         Update various call sites accordingly. This allows NetworkProcess to do all necessary checks.
2369         Add an option to disable security checks if NetworkProcess does it for WebProcess.
2370         This option will be also used for regular asynchronous loads in future patches.
2371
2372         Update DocumentThreadableLoader to bypass preflighting and response validation checks in case they are done in NetworkProcess.
2373
2374         Covered by existing and rebased tests.
2375
2376         * loader/CrossOriginPreflightChecker.cpp:
2377         (WebCore::CrossOriginPreflightChecker::doPreflight):
2378         * loader/DocumentThreadableLoader.cpp:
2379         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2380         (WebCore::DocumentThreadableLoader::loadRequest):
2381         * loader/FrameLoader.cpp:
2382         (WebCore::FrameLoader::loadResourceSynchronously):
2383         * loader/FrameLoader.h:
2384         * loader/LoaderStrategy.h:
2385         * xml/XSLTProcessorLibxslt.cpp:
2386         (WebCore::docLoaderFunc):
2387         * xml/parser/XMLDocumentParserLibxml2.cpp:
2388         (WebCore::openFunc):
2389
2390 2018-04-16  Christopher Reid  <chris.reid@sony.com>
2391
2392         [WinCairo] Media elements should be enabled by default
2393         https://bugs.webkit.org/show_bug.cgi?id=184597
2394
2395         Reviewed by Per Arne Vollan.
2396
2397         Enabling media elements by default with media foundation.
2398
2399         * page/SettingsDefaultValues.h:
2400
2401 2018-04-16  Christopher Reid  <chris.reid@sony.com>
2402
2403         [Curl] Add the Accept-Language field to curl request headers
2404         https://bugs.webkit.org/show_bug.cgi?id=184605
2405
2406         Reviewed by Alex Christensen.
2407
2408         Add Accept-Language field to curl request headers
2409
2410         * platform/network/curl/CurlRequest.cpp:
2411         * platform/network/curl/CurlRequest.h:
2412
2413 2018-04-16  Chris Dumez  <cdumez@apple.com>
2414
2415         Move more WindowProxy-related logic from ScriptController to WindowProxyController
2416         https://bugs.webkit.org/show_bug.cgi?id=184640
2417
2418         Reviewed by Ryosuke Niwa.
2419
2420         Move more WindowProxy-related logic from ScriptController to WindowProxyController,
2421         for clarity.
2422
2423         * bindings/js/JSDOMWindowProxy.cpp:
2424         (WebCore::JSDOMWindowProxy::attachDebugger):
2425         * bindings/js/JSDOMWindowProxy.h:
2426         * bindings/js/ScriptCachedFrameData.cpp:
2427         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
2428         (WebCore::ScriptCachedFrameData::restore):
2429         * bindings/js/ScriptController.cpp:
2430         (WebCore::ScriptController::~ScriptController):
2431         (WebCore::ScriptController::initScriptForWindowProxy):
2432         * bindings/js/ScriptController.h:
2433         (WebCore::ScriptController::existingCacheableBindingRootObject const):
2434         * bindings/js/WindowProxyController.cpp:
2435         (WebCore::collectGarbageAfterWindowProxyDestruction):
2436         (WebCore::WindowProxyController::~WindowProxyController):
2437         (WebCore::WindowProxyController::clearWindowProxiesNotMatchingDOMWindow):
2438         (WebCore::WindowProxyController::setDOMWindowForWindowProxy):
2439         (WebCore::WindowProxyController::attachDebugger):
2440         * bindings/js/WindowProxyController.h:
2441         * loader/FrameLoader.cpp:
2442         (WebCore::FrameLoader::clear):
2443         * page/Page.cpp:
2444         (WebCore::Page::setDebugger):
2445
2446 2018-04-16  Thibault Saunier  <tsaunier@igalia.com>
2447
2448         [GStreamer] Set *TrackPrivateGStreamer::active based on GstStream default select in constructor
2449         https://bugs.webkit.org/show_bug.cgi?id=184652
2450
2451         Reviewed by Philippe Normand.
2452
2453         In the constructor we should mark selected streams based on the default values from GstStream,
2454         if the user changes them, they will be updated as required later on.
2455
2456         No new tests are added as we already have a few ones that are currently disabled in
2457         the mediastream testsuite. This patch is part of the work to enable them.
2458
2459         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
2460         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
2461         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
2462         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
2463
2464 2018-04-16  Thibault Saunier  <tsaunier@igalia.com>
2465
2466         [GStreamer] Set TrackPrivateBaseGStreamer metadata information even if no client is avalaible
2467         https://bugs.webkit.org/show_bug.cgi?id=184651
2468
2469         Reviewed by Philippe Normand.
2470
2471         We can't notify the client if none is connected, but still we need to fill our metadatas from
2472         the provided GstTagList, especially in the case of playbin3 where the client is not set yet
2473         at construct time but the metadata might already be preset (and won't be updated later on).
2474
2475         No new tests are added as we already have a few ones that are currently disabled in
2476         the mediastream testsuite. This patch is part of the work to enable them.
2477
2478         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2479         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
2480
2481 2018-04-16  Antoine Quint  <graouts@apple.com>
2482
2483         [Web Animations] Ensure we never return -0 through the API
2484         https://bugs.webkit.org/show_bug.cgi?id=184644
2485
2486         Reviewed by Dean Jackson.
2487
2488         We could sometimes return -0 instead of 0, which is surprising and leads to an error in WPT tests.
2489         This would happen when playbackRate < 0.
2490
2491         * animation/WebAnimationUtilities.h:
2492         (WebCore::secondsToWebAnimationsAPITime):
2493
2494 2018-04-15  Antoine Quint  <graouts@apple.com>
2495
2496         [Web Animations] Animations do not naturally get a finish event
2497         https://bugs.webkit.org/show_bug.cgi?id=184639
2498         <rdar://problem/39397649>
2499
2500         Reviewed by Jon Lee.
2501
2502         We must call updateFinishedState() when an animation gets sampled as it means its timeline's time has progressed
2503         and it may have crossed to a finished state. Calling updateFinishedState() when sampling means that we'll correctly
2504         set the animation's hold time to its end value, which means that currentTime() will now always be clamped to return
2505         the end time once its has reached it, so we must not schedule animations to resolve immediately anymore since otherwise
2506         they will keep being scheduled in a loop.
2507
2508         * animation/WebAnimation.cpp:
2509         (WebCore::WebAnimation::timeToNextRequiredTick const):
2510         (WebCore::WebAnimation::resolve):
2511
2512 2018-04-15  Chris Dumez  <cdumez@apple.com>
2513
2514         Change Event's returnValue so it doesn't expose a new primitive
2515         https://bugs.webkit.org/show_bug.cgi?id=184415
2516
2517         Reviewed by Darin Adler.
2518
2519         Update Event.returnValue setter to match the latest DOM specification after:
2520         - https://github.com/whatwg/dom/pull/626
2521
2522         In particular, the returnValue setter is now a no-op if the new flag value
2523         is true. If the input flag value is false, it only sets the 'canceled' flag
2524         if the event is cancelable and the event’s in passive listener flag is unset.
2525
2526         Test: imported/w3c/web-platform-tests/dom/events/Event-returnValue.html
2527
2528         * dom/Event.cpp:
2529         (WebCore::Event::setLegacyReturnValue):
2530         (WebCore::Event::setCanceledFlagIfPossible):
2531         (WebCore::Event::preventDefault):
2532         * dom/Event.h:
2533
2534 2018-04-14  Thibault Saunier  <tsaunier@igalia.com>
2535
2536         [GStreamer] Expose a method to retrieve the GstStream from a TrackPrivateBaseGStreamer
2537         https://bugs.webkit.org/show_bug.cgi?id=184620
2538
2539         Reviewed by Philippe Normand.
2540
2541         This is a minor change, a dedicated test doesn't really make sense here.
2542
2543         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2544         (WebCore::TrackPrivateBaseGStreamer::stream):
2545
2546 2018-04-13  Ryosuke Niwa  <rniwa@webkit.org>
2547
2548         WebKit crashes when libwebrtc.dylib is missing
2549         https://bugs.webkit.org/show_bug.cgi?id=184607
2550
2551         Rubber-stamped by Jer Noble.
2552
2553         Don't call LibWebRTC related code when libwebrtc is not available.
2554
2555         * dom/Document.cpp:
2556         (WebCore::Document::prepareForDestruction):
2557         (WebCore::Document::suspend):
2558
2559 2018-04-13  Chris Dumez  <cdumez@apple.com>
2560
2561         Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame
2562         https://bugs.webkit.org/show_bug.cgi?id=184591
2563
2564         Reviewed by Sam Weinig.
2565
2566         Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
2567         RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
2568         This is work towards fixing Bug 184515.
2569
2570         * Sources.txt:
2571         * WebCore.xcodeproj/project.pbxproj:
2572         * bindings/js/DOMWrapperWorld.cpp:
2573         (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
2574         (WebCore::DOMWrapperWorld::clearWrappers):
2575         * bindings/js/DOMWrapperWorld.h:
2576         (WebCore::DOMWrapperWorld::didCreateWindowProxy):
2577         (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
2578         * bindings/js/JSBindingsAllInOne.cpp:
2579         * bindings/js/JSDOMWindowBase.cpp:
2580         (WebCore::toJSDOMWindow):
2581         * bindings/js/JSDOMWindowProxy.cpp:
2582         (WebCore::toJS):
2583         (WebCore::toJSDOMWindowProxy):
2584         * bindings/js/ScriptCachedFrameData.cpp:
2585         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
2586         (WebCore::ScriptCachedFrameData::restore):
2587         * bindings/js/ScriptController.cpp:
2588         (WebCore::ScriptController::~ScriptController):
2589         (WebCore::ScriptController::evaluateInWorld):
2590         (WebCore::ScriptController::loadModuleScriptInWorld):
2591         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
2592         (WebCore::ScriptController::evaluateModule):
2593         (WebCore::ScriptController::clearWindowProxiesNotMatchingDOMWindow):
2594         (WebCore::ScriptController::setDOMWindowForWindowProxy):
2595         (WebCore::ScriptController::initScriptForWindowProxy):
2596         (WebCore::ScriptController::setupModuleScriptHandlers):
2597         (WebCore::ScriptController::windowProxyController):
2598         (WebCore::ScriptController::enableEval):
2599         (WebCore::ScriptController::enableWebAssembly):
2600         (WebCore::ScriptController::disableEval):
2601         (WebCore::ScriptController::disableWebAssembly):
2602         (WebCore::ScriptController::attachDebugger):
2603         (WebCore::ScriptController::updateDocument):
2604         (WebCore::ScriptController::collectIsolatedContexts):
2605         (WebCore::ScriptController::windowScriptNPObject):
2606         (WebCore::ScriptController::executeIfJavaScriptURL):
2607         * bindings/js/ScriptController.h:
2608         (WebCore::ScriptController::globalObject):
2609         * bindings/js/ScriptControllerMac.mm:
2610         (WebCore::ScriptController::windowScriptObject):
2611         * bindings/js/ScriptState.cpp:
2612         (WebCore::mainWorldExecState):
2613         * bindings/js/WindowProxyController.cpp: Added.
2614         (WebCore::WindowProxyController::WindowProxyController):
2615         (WebCore::WindowProxyController::destroyWindowProxy):
2616         (WebCore::WindowProxyController::createWindowProxy):
2617         (WebCore::WindowProxyController::windowProxies):
2618         (WebCore::WindowProxyController::createWindowProxyWithInitializedScript):
2619         * bindings/js/WindowProxyController.h: Added.
2620         (WebCore::WindowProxyController::releaseWindowProxies):
2621         (WebCore::WindowProxyController::setWindowProxies):
2622         (WebCore::WindowProxyController::windowProxy):
2623         (WebCore::WindowProxyController::existingWindowProxy const):
2624         (WebCore::WindowProxyController::globalObject):
2625         * loader/FrameLoader.cpp:
2626         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
2627         * page/AbstractFrame.cpp:
2628         (WebCore::AbstractFrame::AbstractFrame):
2629         * page/AbstractFrame.h:
2630         (WebCore::AbstractFrame::windowProxyController):
2631         (WebCore::AbstractFrame::windowProxyController const):
2632
2633 2018-04-13  Brady Eidson  <beidson@apple.com>
2634
2635         Introduce SuspendedPageProxy to keep old web processes around after their WebPageProxy has been swapped to a new one.
2636         https://bugs.webkit.org/show_bug.cgi?id=184559
2637
2638         Reviewed by Alex Christensen.
2639
2640         Covered by new API test.
2641
2642         WebCore changes rework the meaning of a "ForSuspension" policy to simply navigate the page to about:blank.
2643
2644         * loader/DocumentLoader.cpp:
2645         (WebCore::DocumentLoader::redirectReceived):
2646         (WebCore::DocumentLoader::willSendRequest):
2647         (WebCore::DocumentLoader::startLoadingMainResource):
2648         * loader/DocumentLoader.h:
2649
2650         * loader/FrameLoader.cpp:
2651         (WebCore::FrameLoader::init):
2652         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2653
2654 2018-04-13  Chris Dumez  <cdumez@apple.com>
2655
2656         input.webkitEntries does not work as expected when folder contains accented chars
2657         https://bugs.webkit.org/show_bug.cgi?id=184517
2658         <rdar://problem/39265537>
2659
2660         Reviewed by Alex Christensen.
2661
2662         Use String::fromUTF8() to construct a WTF String from the char* returned by
2663         dirname() in FileSystem::directoryName(). Previously, we were just calling
2664         the String constructor, which would treat the input as latin 1 instead of
2665         UTF-8.
2666
2667         Change is covered by an API test rather than a layout test due to file versioning
2668         limitations.
2669
2670         * platform/posix/FileSystemPOSIX.cpp:
2671         (WebCore::FileSystem::directoryName):
2672
2673 2018-04-13  Yusuke Suzuki  <utatane.tea@gmail.com>
2674
2675         [WebCore] Use @getByIdDirectPrivate / @putByIdDirectPrivate in WebCore JS
2676         https://bugs.webkit.org/show_bug.cgi?id=184401
2677
2678         Rubber stamped by Saam Barati.
2679
2680         Apply bug 183970 changes to WebCore JS too. This offers solid type checking
2681         with @getByIdDirectPrivate().
2682
2683         * Modules/mediastream/RTCPeerConnection.js:
2684         (initializeRTCPeerConnection):
2685         (getLocalStreams):
2686         (getStreamById):
2687         (addStream):
2688         * Modules/mediastream/RTCPeerConnectionInternals.js:
2689         (isRTCPeerConnection):
2690         * Modules/streams/ReadableByteStreamController.js:
2691         (enqueue):
2692         (error):
2693         (close):
2694         (getter.byobRequest):
2695         * Modules/streams/ReadableByteStreamInternals.js:
2696         (privateInitializeReadableStreamBYOBReader):
2697         (privateInitializeReadableByteStreamController):
2698         (privateInitializeReadableStreamBYOBRequest):
2699         (isReadableByteStreamController):
2700         (isReadableStreamBYOBRequest):
2701         (isReadableStreamBYOBReader):
2702         (readableByteStreamControllerCancel):
2703         (readableByteStreamControllerError):
2704         (readableByteStreamControllerClose):
2705         (readableByteStreamControllerClearPendingPullIntos):
2706         (readableByteStreamControllerGetDesiredSize):
2707         (readableStreamHasBYOBReader):
2708         (readableStreamHasDefaultReader):
2709         (readableByteStreamControllerHandleQueueDrain):
2710         (readableByteStreamControllerPull):
2711         (readableByteStreamControllerShouldCallPull):
2712         (readableByteStreamControllerCallPullIfNeeded):
2713         (readableByteStreamControllerEnqueue):
2714         (readableByteStreamControllerEnqueueChunk):
2715         (readableByteStreamControllerRespondWithNewView):
2716         (readableByteStreamControllerRespond):
2717         (readableByteStreamControllerRespondInternal):
2718         (readableByteStreamControllerRespondInReadableState):
2719         (readableByteStreamControllerRespondInClosedState):
2720         (readableByteStreamControllerProcessPullDescriptors):
2721         (readableByteStreamControllerFillDescriptorFromQueue):
2722         (readableByteStreamControllerShiftPendingDescriptor):
2723         (readableByteStreamControllerInvalidateBYOBRequest):
2724         (readableByteStreamControllerCommitDescriptor):
2725         (readableStreamFulfillReadIntoRequest):
2726         (readableByteStreamControllerPullInto):
2727         (readableStreamAddReadIntoRequest):
2728         * Modules/streams/ReadableStream.js:
2729         (initializeReadableStream):
2730         (pipeThrough):
2731         * Modules/streams/ReadableStreamBYOBReader.js:
2732         (cancel):
2733         (read):
2734         (releaseLock):
2735         (getter.closed):
2736         * Modules/streams/ReadableStreamBYOBRequest.js:
2737         (respond):
2738         (respondWithNewView):
2739         (getter.view):
2740         * Modules/streams/ReadableStreamDefaultController.js:
2741         (error):
2742         * Modules/streams/ReadableStreamDefaultReader.js:
2743         (cancel):
2744         (read):
2745         (releaseLock):
2746         (getter.closed):
2747         * Modules/streams/ReadableStreamInternals.js:
2748         (privateInitializeReadableStreamDefaultReader):
2749         (readableStreamReaderGenericInitialize):
2750         (readableStreamDefaultControllerError):
2751         (readableStreamPipeTo):
2752         (readableStreamTee):
2753         (isReadableStream):
2754         (isReadableStreamDefaultReader):
2755         (isReadableStreamDefaultController):
2756         (readableStreamError):
2757         (readableStreamDefaultControllerCallPullIfNeeded):
2758         (readableStreamDefaultControllerGetDesiredSize):
2759         (readableStreamReaderGenericCancel):
2760         (readableStreamCancel):
2761         (readableStreamDefaultControllerCancel):
2762         (readableStreamDefaultControllerPull):
2763         (readableStreamDefaultControllerClose):
2764         (readableStreamClose):
2765         (readableStreamFulfillReadRequest):
2766         (readableStreamDefaultReaderRead):
2767         (readableStreamAddReadRequest):
2768         (isReadableStreamDisturbed):
2769         (readableStreamReaderGenericRelease):
2770         (readableStreamDefaultControllerCanCloseOrEnqueue):
2771         (privateInitializeReadableStreamDefaultController): Deleted.
2772         * Modules/streams/StreamInternals.js:
2773         (validateAndNormalizeQueuingStrategy):
2774         * Modules/streams/WritableStream.js:
2775         (initializeWritableStream):
2776         (abort):
2777         (close):
2778         (write):
2779         (getter.closed):
2780         (getter.ready):
2781         (getter.state):
2782         * Modules/streams/WritableStreamInternals.js:
2783         (isWritableStream):
2784         (syncWritableStreamStateWithQueue):
2785         (errorWritableStream):
2786         (callOrScheduleWritableStreamAdvanceQueue):
2787         * bindings/js/JSDOMBindingInternals.js:
2788         (mapLikeForEach):
2789
2790 2018-04-12  Antoine Quint  <graouts@apple.com>
2791
2792         [Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by default
2793         https://bugs.webkit.org/show_bug.cgi?id=184569
2794         <rdar://problem/38671301>
2795
2796         Reviewed by Jon Lee.
2797
2798         We now set the CSS Animations and CSS Transitions as Web Animations flag on by default. To ensure that some remaining
2799         tests pass with this flag on, we expose a way to get to a PseudoElement via a new internals.pseudoElement() method. This
2800         allows tests that used internals.pauseAnimationAtTimeOnPseudoElement() and internals.pauseTransitionAtTimeOnPseudoElement()
2801         to now work with the Web Animations API.
2802
2803         * page/RuntimeEnabledFeatures.h:
2804         * testing/Internals.cpp:
2805         (WebCore::Internals::pseudoElement):
2806         * testing/Internals.h:
2807         * testing/Internals.idl:
2808
2809 2018-04-13  Sergio Villar Senin  <svillar@igalia.com>
2810
2811         [WebVR][OpenVR] Implement requestPresent()/exitPresent() and getLayers()
2812         https://bugs.webkit.org/show_bug.cgi?id=184530
2813
2814         Reviewed by Žan Doberšek.
2815
2816         WebVR apps should invoke requestPresent() to start presenting contents of a VRLayerInit
2817         (right now a HTML canvas with a WebGL context) on the VRDisplay. This request might fail for
2818         a variety of reasons and can be eventually cancelled with exitPresent(). Once we are
2819         presenting we could access the presenting layers (right now just one) with getLayers().
2820
2821         Note that we are not presenting anything to the HMD yet, that will be done later in a follow
2822         up patch.
2823
2824         I took the chance to correct a mistak in the VRDisplayCapabilities object which has a method
2825         that should be called maxLayers instead of maxLayer.
2826
2827         * Modules/webvr/VRDisplay.cpp:
2828         (WebCore::VRDisplay::requestPresent):
2829         (WebCore::VRDisplay::stopPresenting):
2830         (WebCore::VRDisplay::exitPresent):
2831         (WebCore::VRDisplay::getLayers const):
2832         (WebCore::VRDisplay::isPresenting const): Deleted. Implemented in the header file.
2833         * Modules/webvr/VRDisplay.h:
2834         (WebCore::VRDisplay::isPresenting const):
2835         * Modules/webvr/VRDisplayCapabilities.h:
2836         (WebCore::VRDisplayCapabilities::maxLayers const): Renamed from maxLayer().
2837         (WebCore::VRDisplayCapabilities::maxLayer const): Deleted.
2838         * Modules/webvr/VRDisplayCapabilities.idl:
2839
2840 2018-04-13  Miguel Gomez  <magomez@igalia.com>
2841
2842         REGRESSION(r230627): [GTK][WPE] Possible deadlock when destroying the player in non AC mode
2843         https://bugs.webkit.org/show_bug.cgi?id=184583
2844
2845         Reviewed by Carlos Garcia Campos.
2846
2847         In non AC mode, ensure that a deadlock can't happen when destroying MediaPlayerPrivateGStreamerBase.
2848
2849         Covered by existent tests.
2850
2851         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2852         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2853         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2854         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
2855         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2856
2857 2018-04-13  Miguel Gomez  <magomez@igalia.com>
2858
2859         [GTK] [gstreamer] video won't unpause when built with -DUSE_GSTREAMER_GL=OFF
2860         https://bugs.webkit.org/show_bug.cgi?id=183362
2861
2862         Reviewed by Carlos Garcia Campos.
2863
2864         Remove the drawCancelled flag and use a new one to indicate that the player is being destroyed.
2865         That new flag is only enabled on destruction and it's not modified by cancelRepaint(), which
2866         can be used to handle the pause event without avoiding future renderings. Also cancelRepaint()
2867         has only effect when not in AC mode.
2868
2869         Covered by existent tests.
2870
2871         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2872         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2873         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2874         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
2875         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2876
2877 2018-04-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2878
2879         [GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer smart pointer traits
2880         https://bugs.webkit.org/show_bug.cgi?id=184533
2881
2882         Reviewed by Philippe Normand.
2883
2884         Renamed GStreamerUtilities* files into GStreamerCommon* and
2885         modified files including them accordingly. Include
2886         GRefPtrGStreamer.h and GUniquePtrGStreamer.h in GStreamerCommon.h
2887         to avoid problems destroying objects when those files are
2888         forgotten to be included.
2889
2890         * Modules/webaudio/AudioContext.cpp:
2891         * platform/GStreamer.cmake:
2892         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
2893         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
2894         * platform/graphics/gstreamer/GStreamerCommon.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp.
2895         * platform/graphics/gstreamer/GStreamerCommon.h: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h.
2896         * platform/graphics/gstreamer/ImageGStreamer.h:
2897         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
2898         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
2899         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
2900         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2901         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2902         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2903         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2904         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
2905         * platform/graphics/gstreamer/MediaSampleGStreamer.h:
2906         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
2907         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2908         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2909         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2910         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2911         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2912         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
2913         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
2914         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2915         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2916         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2917         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2918         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
2919         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.h:
2920         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2921         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2922         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2923         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2924         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2925         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2926         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
2927
2928 2018-04-12  Christopher Reid  <chris.reid@sony.com>
2929
2930         [Curl] Fix clang build error in CurlContext.cpp
2931         https://bugs.webkit.org/show_bug.cgi?id=184561
2932
2933         Reviewed by Darin Adler.
2934
2935         MSVC allows explicit template specialization in classes but gcc/clang do not.
2936
2937         * platform/network/curl/CurlContext.cpp:
2938
2939 2018-04-12  Christopher Reid  <chris.reid@sony.com>
2940
2941         [Curl] Cookie Database on memory path should be :memory:
2942         https://bugs.webkit.org/show_bug.cgi?id=184572
2943
2944         Reviewed by Alex Christensen.
2945
2946         CookieJarDB::isOnMemory is comparing the database path with :onmemory: but it should be using :memory:
2947         For reference, see: https://www.sqlite.org/inmemorydb.html
2948
2949         * platform/network/curl/CookieJarDB.h:
2950
2951 2018-04-12  Daniel Bates  <dabates@apple.com>
2952
2953         Attmept to fix the Windows build following <https://trac.webkit.org/changeset/230602/>
2954         (https://bugs.webkit.org/show_bug.cgi?id=184386)
2955
2956         Visual Studio cannot prove that all cases in the switch are covered :(
2957         So, add an ASSERT_NOT_REACHED() and a return a value outside of the switch block. 
2958
2959         * loader/cache/CachedResourceLoader.cpp:
2960         (WebCore::destinationForType):
2961
2962 2018-04-12  Chris Dumez  <cdumez@apple.com>
2963
2964         Introduce remote variants of Frame / DOMWindow classes
2965         https://bugs.webkit.org/show_bug.cgi?id=184467
2966         <rdar://problem/39011267>
2967
2968         Reviewed by Ryosuke Niwa.
2969
2970         Introduce remote variants of Frame / DOMWindow classes, for when these frames / windows
2971         are hosted on another WebProcess. Those will be used in a follow-up patch.
2972
2973         The hierarchy is as follows (class naming will be improved in a follow-up patch to minimise
2974         patch size):
2975         - AbstractFrame: A frame that can be either local or remote (hosted on another WebProcess)
2976             - Frame: A local frame
2977             - RemoteFrame: A frame hosted on another WebProcess. A RemoteFrame's window is also remote.
2978         - AbstractDOMWindow: A window that be either local or remote (hosted on another WebProcess)
2979             - DOMWindow: A local DOMWindow
2980             - RemoteDOMWindow: A window hosted on another WebProcess. A RemoteDOMWindow's frame is also
2981               remote. A RemoteDOMWindow is always cross-origin.
2982
2983         This patch introduces global identifiers (unique across all WebProcesses) for both Frames and
2984         Windows. This is useful as we need to know which Frame / DOMWindow a particular RemoteFrame /
2985         RemoteDOMWindow is pointing to.
2986
2987         Follow-up patch will add support for converting a local DOMWindow / Frame into a remote ones,
2988         when a newly opened window (via window.open) is navigated cross-origin (Bug 184515).
2989
2990         Other things we'll need to implement in follow-ups:
2991         - RemoteDOMWindow will need to know about its opener in order to support the window.opener
2992           API. Internally, the opener will be stored as a RemoteFrame so that window.opener always
2993           returns the current window in the opener frame (which changes upon navigation).
2994         - Nullify a RemoteDOMWindow's frame whenever the window it is pointing to becomes frameless.
2995           A frameless window behaves very differently (e.g. very little API is exposed to the Web).
2996           This happens when either the newly opened window is either closed or navigated.
2997
2998         * Sources.txt:
2999         * WebCore.xcodeproj/project.pbxproj:
3000         * loader/ContentFilter.cpp:
3001         (WebCore::ContentFilter::didDecide):
3002         * page/AbstractDOMWindow.cpp: Added.
3003         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
3004         (WebCore::AbstractDOMWindow::~AbstractDOMWindow):
3005         * page/AbstractDOMWindow.h: Added.
3006         (WebCore::AbstractDOMWindow::identifier const):
3007         * page/AbstractFrame.cpp: Added.
3008         (WebCore::AbstractFrame::AbstractFrame):
3009         (WebCore::AbstractFrame::~AbstractFrame):
3010         * page/AbstractFrame.h: Added.
3011         (WebCore::AbstractFrame::window const):
3012         * page/DOMWindow.cpp:
3013         (WebCore::DOMWindow::DOMWindow):
3014         * page/DOMWindow.h:
3015         (isType):
3016         * page/Frame.cpp:
3017         (WebCore::Frame::window const):
3018         (WebCore::Frame::virtualWindow const):
3019         * page/Frame.h:
3020         (isType):
3021         * page/GlobalFrameIdentifier.h: Added.
3022         (WebCore::GlobalFrameIdentifier::encode const):
3023         (WebCore::GlobalFrameIdentifier::decode):
3024         * page/GlobalWindowIdentifier.h: Added.
3025         (WebCore::operator==):
3026         (WebCore::GlobalWindowIdentifier::hash const):
3027         (WebCore::GlobalWindowIdentifier::encode const):
3028         (WebCore::GlobalWindowIdentifier::decode):
3029         (WTF::GlobalWindowIdentifierHash::hash):
3030         (WTF::GlobalWindowIdentifierHash::equal):
3031         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::emptyValue):
3032         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::constructDeletedValue):
3033         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::isDeletedValue):
3034
3035         * page/RemoteDOMWindow.cpp: Added.
3036         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
3037         (WebCore::RemoteDOMWindow::~RemoteDOMWindow):
3038         (WebCore::RemoteDOMWindow::self const):
3039         (WebCore::RemoteDOMWindow::location const):
3040         (WebCore::RemoteDOMWindow::close):
3041         (WebCore::RemoteDOMWindow::closed const):
3042         (WebCore::RemoteDOMWindow::focus):
3043         (WebCore::RemoteDOMWindow::blur):
3044         (WebCore::RemoteDOMWindow::length const):
3045         (WebCore::RemoteDOMWindow::top const):
3046         (WebCore::RemoteDOMWindow::opener const):
3047         (WebCore::RemoteDOMWindow::parent const):
3048         (WebCore::RemoteDOMWindow::postMessage):
3049         The DOM API exposed on RemoteDOMWindow is only the subset of the DOMWindow API that is exposed cross origin,
3050         since remote DOMWindow are always from a different origin. The short-term plan is to implement these in a
3051         follow-up by relying on IPC (synchronous when necessary) to fetch the information from the real window in
3052         the WebProcess where it lives. Longer term, we should probably keep RemoteDOMWindow members in sync with the
3053         DOMWindow they're pointing to, so we do not have to rely on synchronous IPC.
3054
3055         * page/RemoteDOMWindow.h: Added.
3056         (isType):
3057         * page/RemoteFrame.cpp: Added.
3058         (WebCore::RemoteFrame::RemoteFrame):
3059         (WebCore::RemoteFrame::~RemoteFrame):
3060         (WebCore::RemoteFrame::virtualWindow const):
3061         * page/RemoteFrame.h: Added.
3062         (isType):
3063
3064 2018-04-12  Daniel Bates  <dabates@apple.com>
3065
3066         Content-Type not enforced for <script> allows for XSS
3067         https://bugs.webkit.org/show_bug.cgi?id=184386
3068         <rdar://problem/39112268>
3069
3070         Reviewed by Brady Eidson.
3071
3072         As per the Fetch standard, <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-mime-type?> (16 March 2018),
3073         we should block JavaScript scripts that are served with MIME type text/csv, or a MIME type
3074         that begins with "audio/", "image/" or "video/".
3075
3076         As a side benefit of this change we now set the destination property [1] on preload requests.
3077
3078         [1] <https://fetch.spec.whatwg.org/#concept-request-destination>
3079
3080         Tests: http/tests/security/script-with-banned-mimetype.html
3081                http/tests/workers/worker-importScripts-banned-mimetype.html
3082
3083         * Sources.txt: Add file FetchIdioms.cpp.
3084         * WebCore.xcodeproj/project.pbxproj: Add files FetchIdioms.{cpp, h}.
3085         * dom/LoadableClassicScript.cpp:
3086         (WebCore::LoadableClassicScript::notifyFinished): Check the MIME type of the response and
3087         block the script if applicable.
3088         * dom/LoadableScript.h: Add error type MIMEType.
3089         * loader/FetchIdioms.cpp: Added.
3090         (WebCore::shouldBlockResponseDueToMIMEType): Implements the "Should response to request be blocked
3091         due to its MIME type?" algorithm from the Fetch standard.
3092         * loader/FetchIdioms.h: Added.
3093         * loader/FetchOptions.h:
3094         (WebCore::isScriptLikeDestination): Implements the definition of "script like" as per <https://fetch.spec.whatwg.org/#request-destination-script-like>.
3095         * loader/cache/CachedResourceLoader.cpp:
3096         (WebCore::CachedResourceLoader::requestImage): Removed logic to set the destination property as
3097         CachedResourceLoader::requestResource() is now responsible for doing this.
3098         (WebCore::CachedResourceLoader::requestFont): Ditto.
3099         (WebCore::CachedResourceLoader::requestTextTrack): Ditto.
3100         (WebCore::CachedResourceLoader::requestCSSStyleSheet): Ditto.
3101         (WebCore::CachedResourceLoader::requestScript): Ditto.
3102         (WebCore::CachedResourceLoader::requestXSLStyleSheet): Ditto.
3103         (WebCore::CachedResourceLoader::requestMedia): Update comment to express that we should assert
3104         that the destination property is either video or audio.
3105         (WebCore::CachedResourceLoader::requestIcon): Remove logic to set the destination property as
3106         CachedResourceLoader::requestResource() is now responsible for doing this.
3107         (WebCore::CachedResourceLoader::requestRawResource): Removed assertion as this function is used to
3108         load many kinds of requests that have different destination properties. The caller is responsible
3109         for setting the appropriate destintion property.
3110         (WebCore::CachedResourceLoader::requestMainResource): Remove logic to set the destination property
3111         as CachedResourceLoader::requestResource() is now responsible for doing this.
3112         (WebCore::destinationForType): Helper function that maps CachedResource::Type to FetchOptions::Destination.
3113         (WebCore::CachedResourceLoader::requestResource): Set the destination property on the request if not
3114         already set.
3115         * loader/cache/CachedResourceLoader.h: Segregate requestRawResource() from the other request functions
3116         and add a comment to explain what it is used for.
3117         * workers/Worker.cpp:
3118         (WebCore::Worker::create):
3119         * workers/WorkerScriptLoader.cpp:
3120         (WebCore::WorkerScriptLoader::loadSynchronously): Set the destination property to FetchOptions::Destination::Script
3121         and store it in an instance variable as we will need to reference it once we receive the HTTP response.
3122         Note that this function is only used to support the Web API importScripts().
3123         (WebCore::WorkerScriptLoader::loadAsynchronously): Store the passed destination property in an
3124         instance as we will need to reference it once we receive the HTTP response.
3125         (WebCore::WorkerScriptLoader::didReceiveResponse): Check the MIME type of the response and
3126         block the script if applicable.
3127         * workers/WorkerScriptLoader.h:
3128         * workers/service/ServiceWorkerJob.cpp:
3129         (WebCore::ServiceWorkerJob::fetchScriptWithContext): Set the destination property to FetchOptions::Destination::Serviceworker.
3130
3131 2018-04-12  Antoine Quint  <graouts@apple.com>
3132
3133         [Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
3134         https://bugs.webkit.org/show_bug.cgi?id=184555
3135
3136         Reviewed by Dean Jackson.
3137
3138         A series of small and intertwined issues were preventing a number of CSS Animations and CSS Trantions
3139         tests to fail when expressed as Web Animations.
3140
3141         * animation/AnimationTimeline.cpp:
3142         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Pass the old and new RenderStyles to CSSAnimation::create()
3143         since we're refactoring DeclarativeAnimation to create blending keyframes in initialize(), no longer requiring each subclass
3144         to create them.
3145         (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): Return the animation, if any, for a property animated by
3146         a CSS animation, so that we can determine if a property is already being animated when running a CSS Transition.
3147         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Since a property can be specified twice in a "transition" property,
3148         once via "all" and once explicitly, ensure we look at all currently running transitions for the currently-processed property to
3149         see if we need to cancel this transition. Previously, we used to only see if it had been transitioned in the old style. We also
3150         start transitions even if the duration is 0 provided the delay is a positive, non-zero value. Then, if there is a CSS Animation
3151         for this property already running, use that animation's original unanimated style as the from value.
3152         * animation/AnimationTimeline.h:
3153         * animation/CSSAnimation.cpp:
3154         (WebCore::CSSAnimation::create): The animation name is now set in the CSSAnimation constructor.
3155         (WebCore::CSSAnimation::CSSAnimation): Set the animation name and keep a copy of the unanimated style such that we can
3156         get it when a CSS Transition is created and takes precedence over this CSS Animation.
3157         (WebCore::CSSAnimation::initialize): Deleted.
3158         * animation/CSSAnimation.h:
3159         * animation/CSSTransition.cpp:
3160         (WebCore::CSSTransition::create):
3161         (WebCore::CSSTransition::initialize):
3162         * animation/CSSTransition.h:
3163         * animation/DeclarativeAnimation.cpp:
3164         (WebCore::DeclarativeAnimation::initialize): Call the new computeDeclarativeAnimationBlendingKeyframes() on the KeyframeEffect
3165         directly in this method so that subclasses don't need to create it manually, but most important so that keyframes are created
3166         before timing properties are set based on the backing animation.
3167         * animation/DeclarativeAnimation.h:
3168         * animation/KeyframeEffectReadOnly.cpp:
3169         (WebCore::KeyframeEffectReadOnly::getKeyframes): Ensure we have a CSSValue before trying to serialize it.
3170         (WebCore::KeyframeEffectReadOnly::computeDeclarativeAnimationBlendingKeyframes):
3171         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Use the animation's unanimated style to compute keyframes,
3172         instead of a default RenderStyle which would not use the right values for implicit keyframes.
3173         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Look at the property used to create
3174         the transition rather than that specified on the backing Animation object since it can be CSSPropertyInvalid in the case of
3175         "transition: all".
3176         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): If we're dealing with a CSS animation, we consider the first and
3177         last keyframes to always have the property listed since the underlying style was provided and should be captured.
3178         * animation/KeyframeEffectReadOnly.h:
3179         * style/StyleTreeResolver.cpp:
3180         (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Apply CSS Animations after CSS Trasitions since they take precedence.
3181
3182 2018-04-12  Antoine Quint  <graouts@apple.com>
3183
3184         [Web Animations] Only cancel declarative animations upon element removal
3185         https://bugs.webkit.org/show_bug.cgi?id=184553
3186
3187         Reviewed by Dean Jackson.
3188
3189         Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
3190         the ready promise and produce spurious logging from WPT tests.
3191
3192         * animation/AnimationTimeline.cpp:
3193         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
3194         (WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.
3195         * animation/AnimationTimeline.h:
3196         * dom/Element.cpp:
3197         (WebCore::Element::removedFromAncestor):
3198         * dom/PseudoElement.cpp:
3199         (WebCore::PseudoElement::clearHostElement):
3200         * rendering/updating/RenderTreeUpdater.cpp:
3201         (WebCore::RenderTreeUpdater::tearDownRenderers):
3202
3203 2018-04-12  Ryan Haddad  <ryanhaddad@apple.com>
3204
3205         Unreviewed, rolling out r230554.
3206
3207         The non-ASCII character in the filename causes issues with SVN
3208
3209         Reverted changeset:
3210
3211         "input.webkitEntries does not work as expected when folder
3212         contains accented chars"
3213         https://bugs.webkit.org/show_bug.cgi?id=184517
3214         https://trac.webkit.org/changeset/230554
3215
3216 2018-04-12  Alicia Boya García  <aboya@igalia.com>
3217
3218         [MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
3219         https://bugs.webkit.org/show_bug.cgi?id=180253
3220
3221         Right now it's checked that start <= end but it's not checked that
3222         neither of them is undefined.
3223
3224         When this happens, the bug can be hard to track down.
3225
3226         The assertion is not enabled for Mac because there is currently a test
3227         that is hitting it.
3228
3229         Reviewed by Jer Noble.
3230
3231         * platform/graphics/PlatformTimeRanges.cpp:
3232         (WebCore::PlatformTimeRanges::add):
3233
3234 2018-04-12  Chris Dumez  <cdumez@apple.com>
3235
3236         Process::setIdentifier() / Process::identifier() do not need a lock
3237         https://bugs.webkit.org/show_bug.cgi?id=184544
3238
3239         Reviewed by Brady Eidson.
3240
3241         Process::setIdentifier() / Process::identifier() do not need a lock.
3242         Process::setIdentifier() gets called in ChildProcess::initialize(),
3243         before we start any background threads. It is then safe to query
3244         this process identifier later on from background threads without
3245         locks.
3246
3247         * platform/Process.cpp:
3248         (WebCore::Process::setIdentifier):
3249         (WebCore::Process::identifier):
3250
3251 2018-04-12  Antoine Quint  <graouts@apple.com>
3252
3253         Unreviewed, fix the Windows build.
3254
3255         * animation/DocumentTimeline.cpp:
3256         (WebCore::DocumentTimeline::computeExtentOfAnimation const):
3257
3258 2018-04-12  Antoine Quint  <graouts@apple.com>
3259
3260         [Web Animations] Suspend animations when required
3261         https://bugs.webkit.org/show_bug.cgi?id=184541
3262
3263         Reviewed by Jon Lee.
3264
3265         Animations managed by CSSAnimationController get suspended under a number of scenarios, we now add the possibility
3266         to suspend animations on a DocumentTimeline as well such that Web Animations and CSS Animations and CSS Transitions
3267         implemented as Web Animations get suspended under the same conditions as well. We also update the implementation for
3268         Internals::numberOfActiveAnimations() such that tests checking that animations get suspended pass.
3269
3270         * animation/DocumentTimeline.cpp:
3271         (WebCore::DocumentTimeline::suspendAnimations): When asked to be suspended, the DocumentTimeline cancels pending
3272         invalidation tasks and updates all of the animations it manages, including those running on the compositor.
3273         (WebCore::DocumentTimeline::resumeAnimations): When asked to be resumed, the DocumentTimeline resumes animations
3274         it manages and rewinds its invalidation timer.
3275         (WebCore::DocumentTimeline::animationsAreSuspended):
3276         (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const): Called by Internals::numberOfActiveAnimations(),
3277         this returns the number of animations managed by this timeline that are not suspended.
3278         (WebCore::DocumentTimeline::currentTime):
3279         (WebCore::DocumentTimeline::timingModelDidChange): Ensure the invalidation timer is not rewound if the timeline
3280         is suspended.
3281         * animation/DocumentTimeline.h:
3282         * animation/WebAnimation.cpp:
3283         (WebCore::WebAnimation::setTimeline): When moving to a new timeline, ensure we match the new timeline's animation state.
3284         (WebCore::WebAnimation::setSuspended): Toggle the accelerated running state of any backing hardware animations when
3285         the suspension state of an animation changes.
3286         * animation/WebAnimation.h:
3287         (WebCore::WebAnimation::isSuspended const):
3288         * dom/Document.cpp:
3289         (WebCore::Document::didBecomeCurrentDocumentInFrame):
3290         (WebCore::Document::resume):
3291         * dom/Document.h:
3292         * history/CachedFrame.cpp:
3293         (WebCore::CachedFrameBase::restore):
3294         * page/Frame.cpp:
3295         (WebCore::Frame::clearTimers):
3296         * page/Page.cpp:
3297         (WebCore::Page::setIsVisibleInternal):
3298         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
3299         * testing/Internals.cpp:
3300         (WebCore::Internals::numberOfActiveAnimations const):
3301         (WebCore::Internals::animationsAreSuspended const):
3302         (WebCore::Internals::suspendAnimations const):
3303         (WebCore::Internals::resumeAnimations const):
3304
3305 2018-04-12  Antoine Quint  <graouts@apple.com>
3306
3307         [Web Animations] Throttle animations when lowPowerMode is on
3308         https://bugs.webkit.org/show_bug.cgi?id=184540
3309
3310         Reviewed by Jon Lee.
3311
3312         Ensure animations are sampled at a lower frequency when lowPowerMode is on.
3313
3314         * animation/DocumentTimeline.cpp:
3315         (WebCore::DocumentTimeline::updateThrottlingState):
3316         (WebCore::DocumentTimeline::animationInterval const):
3317         (WebCore::DocumentTimeline::updateAnimationSchedule):
3318         (WebCore::DocumentTimeline::scheduleAnimationResolution):
3319         * animation/DocumentTimeline.h:
3320         * page/Page.cpp:
3321         (WebCore::Page::handleLowModePowerChange):
3322         * testing/Internals.cpp:
3323         (WebCore::Internals::animationsInterval const):
3324
3325 2018-04-12  Antoine Quint  <graouts@apple.com>
3326
3327         [Web Animations] Ensure elements overlapping with elements animating also get composited
3328         https://bugs.webkit.org/show_bug.cgi?id=184539
3329
3330         Reviewed by Jon Lee.
3331
3332         A number of compositing tests failed because we didn't call into the Web Animations engine while various calls
3333         on RenderLayer and RenderLayerBacking were made. We bring the functionality over from CSSAnimationController to
3334         DocumentTimeline and KeyframeAnimation to KeyframeEffectReadOnly.
3335
3336         * animation/AnimationTimeline.cpp:
3337         (WebCore::AnimationTimeline::animationsForElement const): Update this method's signature to be const since it
3338         should be callable by other const method.
3339         (WebCore::AnimationTimeline::animationsForElement): Deleted.
3340         * animation/AnimationTimeline.h:
3341         * animation/DocumentTimeline.cpp:
3342         (WebCore::DocumentTimeline::computeExtentOfAnimation const): Adapt this method from CSSAnimationController.
3343         (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): Adapt this method from CSSAnimationController.
3344         (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): Adapt this method from CSSAnimationController.
3345         * animation/DocumentTimeline.h:
3346         * animation/KeyframeEffectReadOnly.cpp:
3347         (WebCore::KeyframeEffectReadOnly::computeExtentOfTransformAnimation const): Bring this method over from KeyframeAnimation.
3348         (WebCore::containsRotation): Bring this method over from KeyframeAnimation.
3349         (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaTransformList const): Bring this method over from KeyframeAnimation.
3350         (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaMatrix const): Bring this method over from KeyframeAnimation.
3351         * animation/KeyframeEffectReadOnly.h:
3352         (WebCore::KeyframeEffectReadOnly::animatedProperties const): DocumentTimeline::computeExtentOfAnimation() needs to get a list
3353         of all animated properties to see if a transform is animated, so we now expose such a list.
3354         * rendering/RenderLayer.cpp:
3355         (WebCore::RenderLayer::currentTransform const): Update this method to call into DocumentTimeline if the CSS Animations
3356         and CSS Transitions as Web Animations flag is on.
3357         (WebCore::RenderLayer::calculateClipRects const): Update this method to call into DocumentTimeline if the CSS Animations
3358         and CSS Transitions as Web Animations flag is on.
3359         * rendering/RenderLayerBacking.cpp:
3360         (WebCore::RenderLayerBacking::updateGeometry): Update this method to call into DocumentTimeline if the CSS Animations
3361         and CSS Transitions as Web Animations flag is on.
3362         * rendering/RenderLayerCompositor.cpp:
3363         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): Update this method to call into DocumentTimeline
3364         if the CSS Animations and CSS Transitions as Web Animations flag is on.
3365         * rendering/RenderObject.h:
3366         (WebCore::RenderObject::documentTimeline const):
3367
3368 2018-04-11  Antoine Quint  <graouts@apple.com>
3369
3370         [Web Animations] Enable seeking for hardware animations
3371         https://bugs.webkit.org/show_bug.cgi?id=184518
3372
3373         Reviewed by Dean Jackson.
3374
3375         Hardware animations had lagged behind software animations in support and this patch bring their respective level
3376         of support closer to one another. Importantly, we add the ability to seek an animation added to a GraphicsLayerCA
3377         since many tests pause and seek animations to test their state. Animations may also have their playback state changed
3378         along with their current time in the same run loop, so we now maintain a list of pending processing actions for
3379         hardware animations.
3380
3381         * animation/DocumentTimeline.cpp:
3382         (WebCore::DocumentTimeline::updateAnimationSchedule): If we have animations queued up for updates to their accelerated
3383         state we can schedule animation resolution immediately since we've already established we'll have work to do.
3384         (WebCore::DocumentTimeline::