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