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