96588500c0a00ae9a1956c0002419f86d8d7b32f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-01-22  Eric Carlson  <eric.carlson@apple.com>
2
3         Resign NowPlaying status when no media element is eligible
4         https://bugs.webkit.org/show_bug.cgi?id=181914
5         <rdar://problem/35294116>
6
7         Reviewed by Jer Noble.
8
9         No new tests, these changes prevent existing tests from crashing.
10
11         * html/HTMLMediaElement.h:
12         * html/MediaElementSession.cpp:
13         (WebCore::MediaElementSession::playbackPermitted const): Return early when the media 
14         element has been suspended.
15         (WebCore::MediaElementSession::canShowControlsManager const): Return false when the
16         media element has been suspended.
17         (WebCore::isMainContentForPurposesOfAutoplay): Return early if it isn't safe to update
18         style because HitTest can force a layout.
19         (WebCore::MediaElementSession::updateIsMainContent const): Ditto.
20
21 2018-01-22  Alex Christensen  <achristensen@webkit.org>
22
23         Begin removing QTKit code
24         https://bugs.webkit.org/show_bug.cgi?id=181951
25
26         Reviewed by Jer Noble.
27
28         QTKit was being used on El Capitan and before.
29
30         * Configurations/WebCore.xcconfig:
31         * SourcesMac.txt:
32         * WebCore.xcodeproj/project.pbxproj:
33         * platform/graphics/MediaPlayer.cpp:
34         (WebCore::buildMediaEnginesVector):
35         (WebCore::MediaPlayer::supportsType):
36         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Removed.
37         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: Removed.
38         * platform/graphics/mac/MediaTimeQTKit.h: Removed.
39         * platform/graphics/mac/MediaTimeQTKit.mm: Removed.
40         * platform/mac/WebVideoFullscreenController.mm:
41         (-[WebVideoFullscreenController setVideoElement:]):
42         (-[WebVideoFullscreenController updatePowerAssertions]):
43
44 2018-01-22  Per Arne Vollan  <pvollan@apple.com>
45
46         [Win] Null pointer crash under WebCore::RenderStyle::colorIncludingFallback.
47         https://bugs.webkit.org/show_bug.cgi?id=181801
48         <rdar://problem/35614900>
49
50         Reviewed by Brent Fulgham.
51
52         Do not paint synchronously when popup items have been added or changed while the popup is visible.
53         If new popup items have been added after the popup was shown, a synchronous paint operation will
54         possibly access their style before it is ready, leading to a null pointer crash. The invalidated
55         area will be painted asynchronously.
56
57         No new tests. To reproduce this crash, it is necessary to open a popup with JavaScript, add new
58         popup items, and then end the test. Opening the popup can be done by sending a mousedown event
59         with the eventsender. However, on Windows the mousedown event is sent synchronously, and will
60         block as long as the popup is open and running the popup event loop. This means no JS can be
61         executed until the popup is closed, causing the test to always time out before new popup items
62         can be added. I have verified the fix with a manual test case.
63
64         * platform/win/PopupMenuWin.cpp:
65         (WebCore::PopupMenuWin::updateFromElement):
66
67 2018-01-22  Chris Dumez  <cdumez@apple.com>
68
69         RELEASE_ASSERT(registration) hit in SWServer::installContextData(const ServiceWorkerContextData&)
70         https://bugs.webkit.org/show_bug.cgi?id=181941
71         <rdar://problem/36744892>
72
73         Reviewed by Youenn Fablet.
74
75         Make sure we clear SWServer::m_pendingContextDatas & SWServer::m_pendingJobs as needed
76         when clearing Website data. Otherwise, we will hit assertion when those gets processed
77         after the connection to the SW process has been established (not to mentioned we failed
78         to clear some in-memory data even though the user asked us to).
79
80         * workers/service/server/SWServer.cpp:
81         (WebCore::SWServer::clearAll):
82         (WebCore::SWServer::clear):
83
84 2018-01-22  Ryosuke Niwa  <rniwa@webkit.org>
85
86         Blob conversion and sanitization doesn't work with Microsoft Word for Mac 2011
87         https://bugs.webkit.org/show_bug.cgi?id=181616
88         <rdar://problem/36484908>
89
90         Reviewed by Wenson Hsieh.
91
92         The bug was caused by WebContentReader::readHTML and WebContentMarkupReader::readHTML not sanitizing plain HTML string
93         as done for web archives even when custom pasteboard data is enabled. Fixed the bug by doing the sanitization.
94
95         Unfortunately, we can't make file URLs available in this case because WebContent process doesn't have sandbox extensions
96         to access local files referenced by the HTML source in the clipboard, and we can't make WebContent process request for
97         a sandbox extension¸on an arbitrary local file, as it would defeat the whole point of sandboxing.
98
99         Instead, we strip away all HTML attributes referencing a URL whose scheme is not HTTP, HTTPS, or data when sanitizing
100         text/html from the clipboard to avoid exposing local file paths, which can reveal privacy & security sensitive data
101         such as the user's full name, and the location of private containers of other applications in the system.
102
103         Tests: PasteHTML.DoesNotSanitizeHTMLWhenCustomPasteboardDataIsDisabled
104                PasteHTML.DoesNotStripFileURLsWhenCustomPasteboardDataIsDisabled
105                PasteHTML.ExposesHTMLTypeInDataTransfer
106                PasteHTML.KeepsHTTPURLs
107                PasteHTML.SanitizesHTML
108                PasteHTML.StripsFileURLs
109
110         * editing/cocoa/WebContentReaderCocoa.mm:
111         (WebCore::WebContentReader::readHTML): Fixed the bug by sanitizing the markup, and stripping away file URLs.
112         (WebCore::WebContentMarkupReader::readHTML): Ditto.
113         * editing/markup.cpp:
114         (WebCore::removeSubresourceURLAttributes): Added.
115         (WebCore::sanitizeMarkup): Added.
116         * editing/markup.h:
117
118 2018-01-22  Chris Dumez  <cdumez@apple.com>
119
120         Add release logging to help debug issues related to service workers
121         https://bugs.webkit.org/show_bug.cgi?id=181935
122         <rdar://problem/36735900>
123
124         Reviewed by Brady Eidson.
125
126         * workers/service/ServiceWorker.cpp:
127         (WebCore::ServiceWorker::ServiceWorker):
128         (WebCore::ServiceWorker::scheduleTaskToUpdateState):
129         (WebCore::ServiceWorker::postMessage):
130         (WebCore::ServiceWorker::isAlwaysOnLoggingAllowed const):
131         * workers/service/ServiceWorker.h:
132         * workers/service/ServiceWorkerContainer.cpp:
133         (WebCore::ServiceWorkerContainer::addRegistration):
134         (WebCore::ServiceWorkerContainer::removeRegistration):
135         (WebCore::ServiceWorkerContainer::updateRegistration):
136         (WebCore::ServiceWorkerContainer::jobFailedWithException):
137         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
138         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
139         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
140         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
141         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
142         (WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):
143         * workers/service/ServiceWorkerContainer.h:
144         * workers/service/ServiceWorkerRegistration.cpp:
145         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
146         (WebCore::ServiceWorkerRegistration::updateStateFromServer):
147         (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
148         * workers/service/server/SWServer.cpp:
149         (WebCore::SWServer::scriptContextFailedToStart):
150         (WebCore::SWServer::didFinishInstall):
151         (WebCore::SWServer::didFinishActivation):
152         (WebCore::SWServer::terminateWorkerInternal):
153         * workers/service/server/SWServerJobQueue.cpp:
154         (WebCore::SWServerJobQueue::didResolveRegistrationPromise):
155         (WebCore::SWServerJobQueue::runRegisterJob):
156
157 2018-01-22  Youenn Fablet  <youenn@apple.com>
158
159         Safari Tech Preview can't use GitHub login at forums.swift.org
160         https://bugs.webkit.org/show_bug.cgi?id=181908
161         <rdar://problem/36715111>
162
163         Reviewed by Chris Dumez.
164
165         Test: http/wpt/service-workers/navigation-redirect.https.html
166
167         For subresource loads, redirections will not change who is in charge of continuing the load (service worker or network process).
168         For navigation loads, we need to match the registration for every redirection since this is using the Manual redirect mode.
169         This allows starting the load with a service worker and finishing the load with another service worker, which will become the controller.
170
171         Implement this by wrapping the registration matching of an URL within DocumentLoader::matchRegistration.
172         Use that method in DocumentLoader::redirectReceived.
173
174         * loader/DocumentLoader.cpp:
175         (WebCore::DocumentLoader::matchRegistration):
176         (WebCore::doRegistrationsMatch):
177         (WebCore::DocumentLoader::redirectReceived):
178         (WebCore::DocumentLoader::startLoadingMainResource):
179         * loader/DocumentLoader.h:
180
181 2018-01-22  Antti Koivisto  <antti@apple.com>
182
183         REGRESSION (Safari 11): Buttons inside a fieldset legend cannot be clicked on in Safari 11
184         https://bugs.webkit.org/show_bug.cgi?id=179666
185         <rdar://problem/35534292>
186
187         Reviewed by Zalan Bujtas.
188
189         The legend element of a fieldset is in the border area, outside the clip rect.
190         With overflow:hidden mouse events won't reach it.
191
192         Test case by Dhaya Benmessaoud.
193
194         Test: fast/forms/legend-overflow-hidden-hit-test.html
195
196         * rendering/RenderBlock.cpp:
197         (WebCore::RenderBlock::nodeAtPoint):
198         (WebCore::RenderBlock::hitTestExcludedChildrenInBorder):
199
200         Add a special case to hit testing to handle legend, similarly to what is done for painting.
201
202         * rendering/RenderBlock.h:
203
204 2018-01-22  Joanmarie Diggs  <jdiggs@igalia.com>
205
206         AX: Implement support for Graphics ARIA roles
207         https://bugs.webkit.org/show_bug.cgi?id=181796
208
209         Reviewed by Chris Fleizach.
210
211         Add mappings for the three new roles (graphics-document, graphics-object,
212         and graphics-symbol) as per the Graphics Accessibility API Mappings spec.
213
214         No new tests; instead, new test cases added to roles-computedRoleString.html
215         and roles-exposed.html.
216
217         * accessibility/AccessibilityObject.cpp:
218         (WebCore::initializeRoleMap):
219         (WebCore::AccessibilityObject::computedRoleString const):
220         * accessibility/AccessibilityObject.h:
221         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
222         (atkRole):
223         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
224         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
225         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
226         (createAccessibilityRoleMap):
227         (-[WebAccessibilityObjectWrapper subrole]):
228         (-[WebAccessibilityObjectWrapper roleDescription]):
229
230 2018-01-22  Antti Koivisto  <antti@apple.com>
231
232         REGRESSION(r224535): Can't write reviews in the App Store
233         https://bugs.webkit.org/show_bug.cgi?id=181936
234         <rdar://problem/36670246>
235
236         Reviewed by Zalan Bujtas.
237
238         * page/LayoutContext.cpp:
239         (WebCore::LayoutContext::updateStyleForLayout):
240
241         r224535 was about media queries but it also removed a seemingly spurious call to SyleScope::didChangeStyleSheetEnvironment
242         from the path that does not involve media queries.
243         Turns out UITextContentView somehow depended on it, so revert this specific change.
244
245 2018-01-22  Brady Eidson  <beidson@apple.com>
246
247         In WebKit2, make the MessagePortChannelRegistry live in the UI process.
248         https://bugs.webkit.org/show_bug.cgi?id=181922
249
250         Reviewed by Andy Estes.
251
252         No new tests (Refactor, no behavior change)
253
254         Add encoder/decoders and EXPORT a whole bunch of stuff.
255         
256         * WebCore.xcodeproj/project.pbxproj:
257
258         * dom/MessagePort.h:
259
260         * dom/messageports/MessagePortChannel.cpp:
261         (WebCore::MessagePortChannel::processForPort):
262         * dom/messageports/MessagePortChannel.h:
263
264         * dom/messageports/MessagePortChannelProvider.h:
265         * dom/messageports/MessagePortChannelRegistry.h:
266
267         * dom/messageports/MessageWithMessagePorts.h:
268         (WebCore::MessageWithMessagePorts::encode const):
269         (WebCore::MessageWithMessagePorts::decode):
270
271 2018-01-22  Youenn Fablet  <youenn@apple.com>
272
273         Fetch Headers from an Opaque response should be filtered out
274         https://bugs.webkit.org/show_bug.cgi?id=181926
275
276         Reviewed by Chris Dumez.
277
278         Covered by updated test.
279
280         Refactor to use the same FetchResponse::create for Cache API and cloning.
281         In this method, ensure that response and headers are filtered correctly according response tainting.
282         Make also sure that synthetic responses do not get filtered (not needed since created by JavaScript).
283
284         Introduce helper routine to set the header map of a resource response.
285         Use this routine when cloning a synthetic response as in that case, m_internalResponse has no header at all.
286
287         * Modules/cache/DOMCache.cpp:
288         (WebCore::DOMCache::updateRecords):
289         * Modules/fetch/FetchResponse.cpp:
290         (WebCore::FetchResponse::create):
291         (WebCore::FetchResponse::clone):
292         * Modules/fetch/FetchResponse.h:
293         * platform/network/ResourceResponseBase.cpp:
294         (WebCore::ResourceResponseBase::setHTTPHeaderFields):
295         * platform/network/ResourceResponseBase.h:
296         * testing/ServiceWorkerInternals.cpp:
297         (WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
298
299 2018-01-22  Javier Fernandez  <jfernandez@igalia.com>
300
301         [css-align] 'overflow' keyword must precede the self-position and content-position value
302         https://bugs.webkit.org/show_bug.cgi?id=181793
303
304         Reviewed by Antti Koivisto.
305
306         There were several discussions to avoid ambiguities with the complex
307         values, specially when it comes to define the place-xxx shorthands.
308
309         One of the sources of problems is the 'overflow-position' keyword. The
310         CSS WG has decided to change the syntax of all the CSS Box Alignment
311         properties so that the 'overflow-position' keyword always precede the
312         'self-position' or the 'content-position' keywords.
313
314         https://github.com/w3c/csswg-drafts/issues/1446#event-1125715434
315
316         In order to apply this change to the Content Distribution properties'
317         (align-content and justify-content) syntax I had to completely
318         re-implement their parsing function. Thanks to this I addressed also
319         the issue with the content-distribution fallback, which cannot be
320         specified explicitly now.
321
322         https://github.com/w3c/csswg-drafts/issues/1002#ref-commit-c38cac4
323
324         No new tests, just rebaselined the expected results of the test cases affected.
325
326         Despite the so many layout tests affected by this change, it's
327         unlikely that it might break any content in current web
328         sites. This patch changes the new CSS syntax, obviously backward
329         compatible, defined by the new CSS Box Alignment. The
330         'overflow-position' keyword is only used by the layout models
331         implementing the new spec, so far only CSS Grid Layout.
332         Considering that CSS Grid has been shipped last year, it's unlikely
333         that many sites are using the new CSS values.
334
335         * css/CSSComputedStyleDeclaration.cpp:
336         (WebCore::valueForItemPositionWithOverflowAlignment):
337         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
338         * css/CSSContentDistributionValue.cpp:
339         (WebCore::CSSContentDistributionValue::customCSSText const):
340         * css/StyleBuilderConverter.h:
341         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
342         * css/parser/CSSPropertyParser.cpp:
343         (WebCore::consumeOverflowPositionKeyword):
344         (WebCore::consumeContentPositionKeyword):
345         (WebCore::consumeContentDistributionOverflowPosition):
346         (WebCore::consumeSelfPositionOverflowPosition):
347
348 2018-01-22  Chris Nardi  <csnardi1@gmail.com>
349
350         Parse calc() in CSS media queries
351         https://bugs.webkit.org/show_bug.cgi?id=181716
352
353         calc() was previously unsupported inside of media queries. This change
354         adds in support for parsing calc inside of media queries.
355
356         Reviewed by Antti Koivisto.
357
358         Tests: Imported web-platform-tests/css/mediaqueries
359
360         * css/MediaQueryExpression.cpp:
361         (WebCore::featureWithValidIdent): Updated function to take a CSSPrimitiveValue.
362         (WebCore::featureWithValidDensity): Updated function to take a CSSPrimitiveValue instead of a CSSParserToken.
363         (WebCore::featureWithValidPositiveLength): Ditto.
364         (WebCore::featureExpectingPositiveInteger): Ditto.
365         (WebCore::featureWithPositiveInteger): Ditto.
366         (WebCore::featureWithPositiveNumber): Ditto.
367         (WebCore::featureWithZeroOrOne): Ditto.
368         (WebCore::MediaQueryExpression::MediaQueryExpression): Use CSSPropertyParserHelpers for consuming.
369         * css/MediaQueryExpression.h:
370         * css/parser/CSSPropertyParserHelpers.cpp:
371         (WebCore::CSSPropertyParserHelpers::consumeResolution): Added function for use in media query expression parsing.
372         * css/parser/CSSPropertyParserHelpers.h:
373         * css/parser/MediaQueryParser.cpp:
374         (WebCore::MediaQueryParser::readRestrictor): Updated functions to take a CSSParserTokenRange in order to use CSSPropertyParserHelpers.
375         (WebCore::MediaQueryParser::readMediaNot): Ditto.
376         (WebCore::MediaQueryParser::readMediaType): Ditto.
377         (WebCore::MediaQueryParser::readAnd): Ditto.
378         (WebCore::MediaQueryParser::readFeatureStart): Ditto.
379         (WebCore::MediaQueryParser::readFeature): Ditto.
380         (WebCore::MediaQueryParser::readFeatureColon): Ditto.
381         (WebCore::MediaQueryParser::readFeatureValue): Ditto.
382         (WebCore::MediaQueryParser::readFeatureEnd): Ditto.
383         (WebCore::MediaQueryParser::skipUntilComma): Ditto.
384         (WebCore::MediaQueryParser::skipUntilBlockEnd): Ditto.
385         (WebCore::MediaQueryParser::processToken): Ditto.
386         (WebCore::MediaQueryParser::parseInternal): Ditto.
387         (WebCore::MediaQueryData::clear): Removed reference to m_valueList
388         (WebCore::MediaQueryData::addExpression): Use CSSParserTokenRange.
389         (WebCore::MediaQueryData::lastExpressionValid): New helper function.
390         (WebCore::MediaQueryData::removeLastExpression): New helper function.
391         * css/parser/MediaQueryParser.h:
392
393 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
394
395         [Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation
396         https://bugs.webkit.org/show_bug.cgi?id=181930
397
398         Reviewed by Carlos Garcia Campos.
399
400         Move the PlatformContextCairo::drawSurfaceToContext() code into the
401         Cairo namespace as an operation, renaming it to drawSurface(). Mirroring
402         other operations, the PlatformContextCairo object is now passed through
403         a reference as the first argument to the function, and cairo_t context
404         object is retrieved from that.
405
406         Call sites of the PlatformContextCairo::drawSurfaceToContext() method
407         are adjusted to now call Cairo::drawSurface() and properly pass the
408         PlatformContextCairo object to the function.
409
410         No new tests -- no change in functionality.
411
412         * platform/graphics/cairo/CairoOperations.cpp:
413         (WebCore::Cairo::prepareForStroking): Make this static.
414         (WebCore::Cairo::drawPatternToCairoContext):
415         (WebCore::Cairo::drawNativeImage):
416         (WebCore::Cairo::drawSurface):
417         * platform/graphics/cairo/CairoOperations.h:
418         * platform/graphics/cairo/PlatformContextCairo.cpp:
419         (WebCore::drawPatternToCairoContext): Deleted.
420         (WebCore::PlatformContextCairo::drawSurfaceToContext): Deleted.
421         * platform/graphics/cairo/PlatformContextCairo.h:
422         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
423         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
424
425 2018-01-22  Manuel Rego Casasnovas  <rego@igalia.com>
426
427         [css-grid] Spanning Grid item has too much space at the bottom / is too high
428         https://bugs.webkit.org/show_bug.cgi?id=181677
429
430         Reviewed by Javier Fernandez.
431
432         In IndefiniteSizeStrategy::findUsedFlexFraction() we were not
433         subtracting the size of the gutters when we call findFrUnitSize().
434         If an item spans several tracks, we cannot pass the maxContentForChild()
435         directly, we need to subtract the gutters as they are treated
436         as fixed size tracks in the algorithm.
437
438         The spec text is pretty clear regarding this
439         (https://drafts.csswg.org/css-grid/#algo-find-fr-size):
440         "Let leftover space be the space to fill minus the base sizes
441          of the non-flexible grid tracks."
442
443         Gutters are treated as fixed-size tracks for the purpose
444         of the track sizing algorithm, so we need to subtract them from the
445         leftover space while finding the size of an "fr".
446
447         Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-find-fr-size-gutters-001.html
448                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-find-fr-size-gutters-002.html
449
450         * rendering/GridTrackSizingAlgorithm.cpp:
451         (WebCore::GridTrackSizingAlgorithm::findFrUnitSize const):
452         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
453
454 2018-01-21  Ryosuke Niwa  <rniwa@webkit.org>
455
456         Turning off custom pasteboard data doesn't actually turn it off in WK2
457         https://bugs.webkit.org/show_bug.cgi?id=181920
458         <rdar://problem/36686429>
459
460         Reviewed by Wenson Hsieh.
461
462         Replaced the global settings for custom pasteboard data by regular runtime enabled flags.
463
464         * dom/DataTransfer.cpp:
465         (WebCore::DataTransfer::getDataForItem const):
466         (WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
467         (WebCore::DataTransfer::setDataFromItemList):
468         (WebCore::DataTransfer::types const):
469         (WebCore::DataTransfer::commitToPasteboard):
470         * dom/DataTransferItemList.cpp:
471         (WebCore::shouldExposeTypeInItemList):
472         * editing/Editor.cpp:
473         (WebCore::createDataTransferForClipboardEvent):
474         * editing/cocoa/WebContentReaderCocoa.mm:
475         (WebCore::createFragmentAndAddResources):
476         (WebCore::WebContentReader::readWebArchive):
477         * page/DeprecatedGlobalSettings.cpp:
478         (WebCore::DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled): Deleted.
479         * page/DeprecatedGlobalSettings.h:
480         (WebCore::DeprecatedGlobalSettings::setCustomPasteboardDataEnabled): Deleted.
481         (WebCore::DeprecatedGlobalSettings::customPasteboardDataEnabled): Deleted.
482         * page/RuntimeEnabledFeatures.h:
483         (WebCore::RuntimeEnabledFeatures::setCustomPasteboardDataEnabled):
484         (WebCore::RuntimeEnabledFeatures::customPasteboardDataEnabled const):
485         * testing/InternalSettings.cpp:
486         (WebCore::InternalSettings::Backup::Backup):
487         (WebCore::InternalSettings::Backup::restoreTo):
488         (WebCore::InternalSettings::setCustomPasteboardDataEnabled):
489
490 2018-01-21  Wenson Hsieh  <wenson_hsieh@apple.com>
491
492         Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
493         https://bugs.webkit.org/show_bug.cgi?id=181918
494
495         Reviewed by Tim Horton.
496
497         Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default). No change in behavior.
498
499         * Configurations/FeatureDefines.xcconfig:
500
501 2018-01-19  Ryosuke Niwa  <rniwa@webkit.org>
502
503         Release assertion in canExecuteScript when executing scripts during page cache restore
504         https://bugs.webkit.org/show_bug.cgi?id=181902
505
506         Reviewed by Antti Koivisto.
507
508         The crash was caused by an erroneous instantiation of ScriptDisallowedScope::InMainThread in CachedPage::restore.
509         It can execute arbitrary scripts since CachedFrame::open can update style, layout, and evaluate media queries.
510
511         This is fine because there is no way to put this page back into a page cache until the load is commited via
512         FrameLoader::commitProvisionalLoad is invoked later which only happens after CachedPage::restore had exited.
513
514         Also added a release assert to make sure this condition holds.
515
516         Tests: fast/history/page-cache-execute-script-during-restore.html
517                fast/history/page-cache-navigate-during-restore.html
518
519         * history/CachedPage.cpp:
520         (WebCore::CachedPageRestorationScope::CachedPageRestorationScope): Added.
521         (WebCore::CachedPageRestorationScope::~CachedPageRestorationScope): Added.
522         (WebCore::CachedPage::restore): Don't instantiate ScriptDisallowedScope::InMainThread. Set isRestoringCachedPage
523         on the cached pate to release-assert that there won't be any attempt to put this very page back into the cache.
524         * history/PageCache.cpp:
525         (WebCore::canCachePage): Added a release assert to make sure the page which is in the process of being restored
526         from the page cache is not put into the page cache.
527         * page/Page.h:
528         (WebCore::Page::setIsRestoringCachedPage): Added.
529         (WebCore::Page::isRestoringCachedPage const): Added.
530
531 2018-01-21  Eric Carlson  <eric.carlson@apple.com>
532
533         Resign NowPlaying status when no media element is eligible
534         https://bugs.webkit.org/show_bug.cgi?id=181914
535         <rdar://problem/35294116>
536
537         Reviewed by Jer Noble.
538
539         Updated API test.
540
541         * html/HTMLMediaElement.cpp:
542         (WebCore::HTMLMediaElement::removedFromAncestor): Call mediaSession->clientCharacteristicsChanged
543         so NowPlaying status will be updated.
544
545         * html/MediaElementSession.cpp:
546         (WebCore::MediaElementSession::canShowControlsManager const): Return false when being queried
547         for NowPlaying status in an inactive document.
548
549         * platform/audio/PlatformMediaSessionManager.cpp:
550         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Implement in for all
551         ports.
552         * platform/audio/PlatformMediaSessionManager.h:
553         (WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
554         * platform/audio/ios/MediaSessionManagerIOS.h:
555         * platform/audio/mac/MediaSessionManagerMac.h:
556         * platform/audio/mac/MediaSessionManagerMac.mm:
557         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Call MRMediaRemoteSetCanBeNowPlayingApplication
558         whenever status changes.
559         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Deleted, implemented
560         in the base class.
561
562 2018-01-21  Jer Noble  <jer.noble@apple.com>
563
564         REGRESSION (macOS 10.13.2): imported/w3c/web-platform-tests/media-source/mediasource-* LayoutTests failing
565         https://bugs.webkit.org/show_bug.cgi?id=181891
566
567         Reviewed by Eric Carlson.
568
569         In macOS 10.13.2, CoreMedia changed the definition of CMSampleBufferGetDuration() to return
570         the presentation duration rather than the decode duration. For media streams where those two
571         durations are identical (or at least, closely similar), this isn't a problem. But the media
572         file used in the WPT tests have an unusual frame cadence: decode durations go {3000, 1, 5999,
573         1, 5999,...} and presentation durations go {3000, 2999, 3000, 2999}. This caused one check in
574         the "Coded Frame Processing" algorithm to begin failing, where it checks that the delta
575         between the last sample's decode time and the new decode time is no more than 2x as far as
576         the last sample's duration. That's not a problem as long as the "duration" is the "decode
577         duration" and the samples are all adjacent. Once the "duration" is "presentation duration",
578         all the assumptions in the algorithm are invalidated. In the WPT test case, the delta between
579         decode times is 5999, and 2 * the presentation duration is 5998, causing all samples up to
580         the next sync sample to be dropped.
581
582         To work around this change in behavior, we'll adopt the same technique used by Mozilla's MSE
583         implementation, which was done for similar reasons. Rather than track the "last frame duration",
584         we'll record the "greatest frame duration", and use actual decode timestamps to derive this
585         duration. The "greatest frame duration" field will be reset at the same times as "last frame
586         duration", and will be used only in the part of the algorithm that checks for large decode
587         timestamp gaps.
588
589         * Modules/mediasource/SourceBuffer.cpp:
590         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
591         (WebCore::SourceBuffer::resetParserState):
592         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
593
594 2018-01-21  Andy Estes  <aestes@apple.com>
595
596         [ios] LayoutTest imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html is crashing in JSC::JSONParse
597         https://bugs.webkit.org/show_bug.cgi?id=177832
598         <rdar://problem/34805315>
599
600         Reviewed by Tim Horton.
601
602         Test: http/tests/paymentrequest/rejects_if_not_active.https.html
603
604         * Modules/paymentrequest/PaymentRequest.cpp:
605         (WebCore::PaymentRequest::show): Rejected promise if the document is not active.
606
607 2018-01-20  Brady Eidson  <beidson@apple.com>
608
609         Make garbage collection of MessagePort objects be asynchronous.
610         https://bugs.webkit.org/show_bug.cgi?id=181910
611
612         Reviewed by Andy Estes.
613
614         No new tests (Covered by existing tests, including GC-specific ones).
615
616         The basic premise here is as follows:
617         - You can *always* GC a MessagePort that is closed
618         - You can *always* GC a MessagePort that has no onmessage handler, as incoming messages cannot 
619           possibly revive it.
620         - You can GC a MessagePort, even if it has a message handler, as long as there are no messages 
621           in flight between it and the remote port, and as long as the remote port is "maybe eligible for GC."
622           
623         A MessagePort is considered "maybe eligible for GC" once hasPendingActivity is asked once.
624         
625         A MessagePort loses "maybe eligible for GC" status once it is used for sending or receiving a message.
626         
627         The changes to MessagePort.cpp implement the above with a tiny little bool-driven state machine.
628         * dom/MessagePort.cpp:
629         (WebCore::MessagePort::postMessage):
630         (WebCore::MessagePort::disentangle):
631         (WebCore::MessagePort::registerLocalActivity):
632         (WebCore::MessagePort::start):
633         (WebCore::MessagePort::close):
634         (WebCore::MessagePort::contextDestroyed):
635         (WebCore::MessagePort::dispatchMessages):
636         (WebCore::MessagePort::hasPendingActivity const):
637         (WebCore::MessagePort::isLocallyReachable const):
638         (WebCore::MessagePort::addEventListener):
639         (WebCore::MessagePort::removeEventListener):
640         * dom/MessagePort.h:
641
642         - Remove the lock and any background-thread code paths
643         - Add ASSERT(isMainThread())s throughout
644         * dom/messageports/MessagePortChannel.cpp:
645         (WebCore::MessagePortChannel::MessagePortChannel):
646         (WebCore::MessagePortChannel::includesPort):
647         (WebCore::MessagePortChannel::entanglePortWithProcess):
648         (WebCore::MessagePortChannel::disentanglePort):
649         (WebCore::MessagePortChannel::closePort):
650         (WebCore::MessagePortChannel::postMessageToRemote):
651         (WebCore::MessagePortChannel::takeAllMessagesForPort):
652         (WebCore::MessagePortChannel::checkRemotePortForActivity):
653         (WebCore::MessagePortChannel::hasAnyMessagesPendingOrInFlight const):
654         * dom/messageports/MessagePortChannel.h:
655         
656         Add a callback for a MessagePortChannel to go ask the remote MessagePort object about local activity:
657         * dom/messageports/MessagePortChannelProvider.h:
658         * dom/messageports/MessagePortChannelProviderImpl.cpp:
659         (WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
660         (WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):
661         (WebCore::MessagePortChannelProviderImpl::hasMessagesForPorts_temporarySync): Deleted.
662         * dom/messageports/MessagePortChannelProviderImpl.h:
663         
664         - Remove the lock and any background-thread code paths
665         - Add ASSERT(isMainThread())s throughout
666         * dom/messageports/MessagePortChannelRegistry.cpp:
667         (WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
668         (WebCore::MessagePortChannelRegistry::messagePortChannelDestroyed):
669         (WebCore::MessagePortChannelRegistry::didEntangleLocalToRemote):
670         (WebCore::MessagePortChannelRegistry::didDisentangleMessagePort):
671         (WebCore::MessagePortChannelRegistry::didCloseMessagePort):
672         (WebCore::MessagePortChannelRegistry::didPostMessageToRemote):
673         (WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
674         (WebCore::MessagePortChannelRegistry::checkRemotePortForActivity):
675         (WebCore::MessagePortChannelRegistry::existingChannelContainingPort):
676         (WebCore::MessagePortChannelRegistry::hasMessagesForPorts_temporarySync): Deleted.
677         * dom/messageports/MessagePortChannelRegistry.h:
678
679 2018-01-20  Andy Estes  <aestes@apple.com>
680
681         [Apple Pay] Stop eagerly loading PassKit.framework
682         https://bugs.webkit.org/show_bug.cgi?id=181911
683         <rdar://problem/36555369>
684
685         Reviewed by Tim Horton.
686
687         r226458 and r226123 added code that caused PassKit.framework to be eagerly loaded when
688         initializing a WKWebView. This is costly and should only be done when Apple Pay is first used.
689
690         To avoid eagerly loading PassKit, this patch does two things:
691
692         1. Instead of sending the available payment networks as part of WebPageCreationParameters,
693         PaymentCoordinator asks for them using a syncrhonous message the first time they are needed.
694         2. Instead of setting the Apple Pay preference to false when PassKit can't be loaded,
695         the following API entry points check for a missing PassKit and return false, or throw
696         exceptions, or reject promises:
697             - ApplePaySession.canMakePayments()
698             - ApplePaySession.canMakePaymentsWithActiveCard()
699             - ApplePaySession.openPaymentSetup()
700             - ApplePaySession.begin()
701
702         No new tests for (1), which causes no change in behavior. (2) was manually verified by
703         locally moving aside PassKit.framework, but that's not possible to do in an automated test.
704
705         * Modules/applepay/PaymentCoordinator.cpp:
706         (WebCore::PaymentCoordinator::PaymentCoordinator):
707         (WebCore::PaymentCoordinator::validatedPaymentNetwork const):
708         (WebCore::toHashSet): Deleted.
709         * Modules/applepay/PaymentCoordinator.h:
710         * Modules/applepay/PaymentCoordinatorClient.h:
711         * loader/EmptyClients.cpp:
712         * page/MainFrame.cpp:
713         (WebCore::MainFrame::MainFrame):
714
715         Removed PaymentCoordinator::m_availablePaymentNetworks and made
716         PaymentCoordinator::validatedPaymentNetwork() call
717         PaymentCoordinatorClient::validatedPaymentNetwork() instead.
718
719         * page/PageConfiguration.h:
720
721         Removed availablePaymentNetworks from PageConfiguration.
722
723         * testing/Internals.cpp:
724         (WebCore::Internals::Internals):
725         * testing/MockPaymentCoordinator.cpp:
726         (WebCore::MockPaymentCoordinator::validatedPaymentNetwork):
727         * testing/MockPaymentCoordinator.h:
728
729         Implemented PaymentCoordinatorClient::validatedPaymentNetwork().
730
731 2018-01-20  Jer Noble  <jer.noble@apple.com>
732
733         Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
734         https://bugs.webkit.org/show_bug.cgi?id=181840
735         <rdar://problem/36186214>
736
737         Reviewed by Simon Fraser.
738
739         Test: media/video-fullscreen-reload-crash.html
740
741         Short circuit play() or pause() operations if the document is suspended or stopped.
742
743         * html/HTMLMediaElement.cpp:
744         (WebCore::HTMLMediaElement::playInternal):
745         (WebCore::HTMLMediaElement::pauseInternal):
746
747 2018-01-20  Youenn Fablet  <youenn@apple.com>
748
749         fetch redirect is incompatible with "no-cors" mode
750         https://bugs.webkit.org/show_bug.cgi?id=181866
751         <rdar://problem/35827140>
752
753         Reviewed by Chris Dumez.
754
755         Covered by updated tests.
756
757         Return a network error when no-cors mode and redirect mode is manual or error.
758         Update preflight implementation to no longer use manual redirect mode to simulate https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
759         Instead implement redirectReceived callback to treat any redirect response as the preflight response.
760
761         * loader/cache/CachedResourceLoader.cpp:
762         (WebCore::CachedResourceLoader::canRequest):
763         * loader/CrossOriginPreflightChecker.cpp:
764         (WebCore::CrossOriginPreflightChecker::redirectReceived):
765         (WebCore::CrossOriginPreflightChecker::startPreflight):
766         * loader/CrossOriginPreflightChecker.h:
767
768 2018-01-19  Wenson Hsieh  <wenson_hsieh@apple.com>
769
770         [macOS] [WK2] Drag location is computed incorrectly when dragging content from subframes
771         https://bugs.webkit.org/show_bug.cgi?id=181896
772         <rdar://problem/35479043>
773
774         Reviewed by Tim Horton.
775
776         In r218837, I packaged most of the information needed to start a drag into DragItem, which is propagated to the client layer
777         via the startDrag codepath. However, this introduced a bug in computing the event position and drag location in window
778         coordinates. Consider the case where we're determining the drag image offset for a dragged element in a subframe:
779
780         Before the patch, the drag location (which starts out in the subframe's content coordinates) would be converted to root view
781         coordinates, which would then be converted to mainframe content coordinates, which would then be converted to window coordinates
782         using the mainframe's view. After the patch, we carry out the same math until the last step, where we erroneously use the
783         _subframe's_ view to convert to window coordinates from content coordinates. This results in the position of the iframe relative
784         to the mainframe being accounted for twice.
785
786         To fix this, we simply use the main frame's view to convert from mainframe content coordinates to window coordinates while
787         computing the drag location. As for the event position in window coordinates, this is currently unused by any codepath in WebKit,
788         so we can just remove it altogether.
789
790         Since this bug only affects drag and drop in the macOS WebKit2 port, there's currently no way to test this. I'll be using
791         <https://bugs.webkit.org/show_bug.cgi?id=181898> to track adding test support for drag and drop on macOS WebKit2. Manually tested
792         dragging in both WebKit1 and WebKit2 on macOS. dragLocationInWindowCoordinates isn't used at all for iOS drag and drop.
793
794         * page/DragController.cpp:
795         (WebCore::DragController::doSystemDrag):
796         * platform/DragItem.h:
797         (WebCore::DragItem::encode const):
798         (WebCore::DragItem::decode):
799
800 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
801
802         Unreviewed, rolling out r227235.
803
804         The test for this change consistently times out on High
805         Sierra.
806
807         Reverted changeset:
808
809         "Support for preconnect Link headers"
810         https://bugs.webkit.org/show_bug.cgi?id=181657
811         https://trac.webkit.org/changeset/227235
812
813 2018-01-19  Youenn Fablet  <youenn@apple.com>
814
815         Cache storage errors like Quota should trigger console messages
816         https://bugs.webkit.org/show_bug.cgi?id=181879
817         <rdar://problem/36669048>
818
819         Reviewed by Chris Dumez.
820
821         Covered by rebased test.
822
823         * Modules/cache/DOMCache.cpp:
824         (WebCore::DOMCache::retrieveRecords):
825         (WebCore::DOMCache::batchDeleteOperation):
826         (WebCore::DOMCache::batchPutOperation):
827         * Modules/cache/DOMCacheEngine.cpp:
828         (WebCore::DOMCacheEngine::errorToException):
829         (WebCore::DOMCacheEngine::logErrorAndConvertToException):
830         * Modules/cache/DOMCacheEngine.h:
831         * Modules/cache/DOMCacheStorage.cpp:
832         (WebCore::DOMCacheStorage::retrieveCaches):
833         (WebCore::DOMCacheStorage::doOpen):
834         (WebCore::DOMCacheStorage::doRemove):
835
836 2018-01-19  Youenn Fablet  <youenn@apple.com>
837
838         Do not go to the storage process when registering a service worker client if there is no service worker registered
839         https://bugs.webkit.org/show_bug.cgi?id=181740
840         <rdar://problem/36650400>
841
842         Reviewed by Chris Dumez.
843
844         Register a document as service worker client only if there is an existing service worker connection.
845         This allows not creating any connection if no service worker is registered.
846
847         Add internals API to test whether a service worker connection was created or not.
848         This is used by API tests that cover the changes.
849
850         * dom/Document.cpp:
851         (WebCore::Document::privateBrowsingStateDidChange): No need to create a service worker connection if client is not registered yet.
852         (WebCore::Document::setServiceWorkerConnection): No need to unregister/register if service worker connection is the same.
853         Similarly, if Document is to be destroyed or suspended, we should not register it.
854         * loader/DocumentLoader.cpp:
855         (WebCore::DocumentLoader::commitData):
856         * testing/Internals.cpp:
857         (WebCore::Internals::hasServiceWorkerConnection):
858         * testing/Internals.h:
859         * testing/Internals.idl:
860         * workers/service/ServiceWorkerProvider.cpp:
861         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
862         * workers/service/ServiceWorkerProvider.h:
863
864 2018-01-19  Dean Jackson  <dino@apple.com>
865
866         REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
867         https://bugs.webkit.org/show_bug.cgi?id=181817
868         <rdar://problem/35274055>
869
870         Add a setting for controlling whether touch listeners are passive
871         by default on document/window/body.
872
873         Updated existing test.
874
875         * dom/EventTarget.cpp:
876         (WebCore::EventTarget::addEventListener):
877         * page/Settings.yaml:
878
879 2018-01-19  Daniel Bates  <dabates@apple.com>
880
881         Update frame-ancestor directive to match Content Security Policy Level 3
882         https://bugs.webkit.org/show_bug.cgi?id=178891
883         <rdar://problem/35209458>
884
885         Reviewed by Alex Christensen.
886
887         Derived from Blink e667cc2e501fabab3605b838e4ee0d642a9c4a59:
888         <https://chromium.googlesource.com/chromium/src.git/+/e667cc2e501fabab3605b838e4ee0d642a9c4a59>
889
890         Update frame-ancestor directive to match against the origin of the ancestor document per the
891         Content Security Policy Level 3 spec.: <https://w3c.github.io/webappsec-csp/> (15 January 2018).
892         Specifically this change in behavior was made to CSP 3 in <https://github.com/w3c/webappsec/issues/311>.
893         In earlier versions of the spec, the frame-ancestor directive matched against the URL of the
894         ancestor document.
895
896         Disregarding allow-same-origin sandboxed iframes, a document with policy "frame-ancestor 'self'"
897         will be blocked from loading in a sandboxed iframe as a result of this change.
898
899         Tests: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-allow-same-origin-sandboxed-cross-url-allow.html
900                http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-sandboxed-cross-url-block.html
901
902         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
903         (WebCore::checkFrameAncestors):
904
905 2018-01-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>
906
907         [Curl] Add timeout support to XMLHttpRequest
908         https://bugs.webkit.org/show_bug.cgi?id=181876
909
910         Reviewed by Alex Christensen 
911
912         * platform/network/ResourceRequestBase.cpp:
913         * platform/network/curl/CurlContext.cpp:
914         (WebCore::CurlHandle::setTimeout):
915         * platform/network/curl/CurlContext.h:
916         * platform/network/curl/CurlRequest.cpp:
917         (WebCore::CurlRequest::setupTransfer):
918         (WebCore::CurlRequest::didCompleteTransfer):
919         * platform/network/curl/ResourceError.h:
920         * platform/network/curl/ResourceErrorCurl.cpp:
921         (WebCore::ResourceError::httpError):
922
923 2018-01-19  Yoav Weiss  <yoav@yoav.ws>
924
925         Support for preconnect Link headers
926         https://bugs.webkit.org/show_bug.cgi?id=181657
927
928         Reviewed by Darin Adler.
929
930         Move the preconnect functionality into its own function, and
931         also call this function when Link headers are processed.
932
933         Test: http/tests/preconnect/link-header-rel-preconnect-http.php
934
935         * loader/LinkLoader.cpp:
936         (WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
937         (WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
938         (WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
939         * loader/LinkLoader.h:
940
941 2018-01-19  Joseph Pecoraro  <pecoraro@apple.com>
942
943         AppCache: Log a Deprecation warning to the Console when AppCache is used
944         https://bugs.webkit.org/show_bug.cgi?id=181778
945
946         Reviewed by Alex Christensen.
947
948         * html/HTMLHtmlElement.cpp:
949         (WebCore::HTMLHtmlElement::insertedByParser):
950
951 2018-01-19  Chris Dumez  <cdumez@apple.com>
952
953         ASSERT(registration || isTerminating()) hit in SWServerWorker::skipWaiting()
954         https://bugs.webkit.org/show_bug.cgi?id=181761
955         <rdar://problem/36594564>
956
957         Reviewed by Youenn Fablet.
958
959         There is a short period of time, early in the registration process where a
960         SWServerWorker object exists for a registration but is not in the registration's
961         installing/waiting/active slots yet. As a result, if a registration is cleared
962         during this period (for e.g. due to the user clearing all website data), that
963         SWServerWorker will not be terminated. We then hit assertion later on when this
964         worker is trying to do things (like call skipWaiting).
965
966         To address the issue, we now keep a reference this SWServerWorker on the
967         registration, via a new SWServerRegistration::m_preInstallationWorker data member.
968         When the registration is cleared, we now take care of terminating this worker.
969
970         No new tests, covered by existing tests that crash flakily in debug builds.
971
972         * workers/WorkerThread.cpp:
973         (WebCore::WorkerThread::stop):
974         if the mutex is locked, then the worker thread is still starting. We spin the
975         runloop and try to stop again later. This avoids the deadlock shown in
976         Bug 181763 as the worker thread may need to interact with the main thread
977         during startup.
978
979         * workers/service/server/SWServer.cpp:
980         (WebCore::SWServer::installContextData):
981         * workers/service/server/SWServerJobQueue.cpp:
982         (WebCore::SWServerJobQueue::scriptContextFailedToStart):
983         (WebCore::SWServerJobQueue::install):
984         * workers/service/server/SWServerRegistration.cpp:
985         (WebCore::SWServerRegistration::~SWServerRegistration):
986         (WebCore::SWServerRegistration::setPreInstallationWorker):
987         (WebCore::SWServerRegistration::clear):
988         * workers/service/server/SWServerRegistration.h:
989         (WebCore::SWServerRegistration::preInstallationWorker const):
990
991 2018-01-19  Chris Dumez  <cdumez@apple.com>
992
993         Service worker registrations restored from disk may not be reused when the JS calls register() again
994         https://bugs.webkit.org/show_bug.cgi?id=181810
995         <rdar://problem/36591711>
996
997         Reviewed by Youenn Fablet.
998
999         The issue was that when restoring a registration from disk, we would not set its active worker right
1000         away. We only set it later in installContextData(). installContextData() is only called after we’ve
1001         launched the service worker process and established a connection to it.
1002
1003         However, we would start processing jobs (such as registrations) before we’ve established the connection
1004         to the service worker process. SWServerJobQueue::runRegisterJob(), in order to reuse an existing
1005         registration checks the registration’s active worker has the right script URL. The issue was that when
1006         this code would execute, we may not have set the registration’s active service worker yet, in which case,
1007         we would update the existing registration instead of reusing it as-is.
1008
1009         To address the issue, we now delay the processing of jobs until the connection to the service worker
1010         process has been established and we've installed all pending contexts via installContextData().
1011
1012         Changed is covered by new API test.
1013
1014         * workers/service/server/SWServer.cpp:
1015         (WebCore::SWServer::Connection::scheduleJobInServer):
1016         (WebCore::SWServer::scheduleJob):
1017         (WebCore::SWServer::serverToContextConnectionCreated):
1018         * workers/service/server/SWServer.h:
1019
1020 2018-01-19  James Craig  <jcraig@apple.com>
1021
1022         AX: when invert colors is on, double-invert image and picture elements in UserAgentStyleSheet
1023         https://bugs.webkit.org/show_bug.cgi?id=181281
1024         <rdar://problem/36291776>
1025
1026         Reviewed by Simon Fraser.
1027
1028         Updated "Smart Invert" to include img and picture element inversion and tests.
1029
1030         Tests: accessibility/smart-invert-reference.html
1031                accessibility/smart-invert.html
1032
1033         * css/html.css:
1034         (@media (inverted-colors)):
1035         (img:not(picture>img), picture, video):
1036
1037 2018-01-19  Chris Dumez  <cdumez@apple.com>
1038
1039         The WebContent process should not process incoming IPC while waiting for a sync IPC reply
1040         https://bugs.webkit.org/show_bug.cgi?id=181560
1041
1042         Reviewed by Ryosuke Niwa.
1043
1044         Add internals API for testing purposes.
1045
1046         Test: fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html
1047
1048         * page/ChromeClient.h:
1049         * testing/Internals.cpp:
1050         (WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
1051         * testing/Internals.h:
1052         * testing/Internals.idl:
1053
1054 2018-01-19  Keith Miller  <keith_miller@apple.com>
1055
1056         HaveInternalSDK includes should be "#include?"
1057         https://bugs.webkit.org/show_bug.cgi?id=179670
1058
1059         Reviewed by Dan Bernstein.
1060
1061         * Configurations/Base.xcconfig:
1062
1063 2018-01-19  Daniel Bates  <dabates@apple.com>
1064
1065         Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.
1066
1067         * html/HTMLPlugInImageElement.cpp:
1068         (WebCore::HTMLPlugInImageElement::willDetachRenderers):
1069         * plugins/PluginViewBase.h:
1070         (WebCore::PluginViewBase::willDetachRenderer):
1071         (WebCore::PluginViewBase::willDetatchRenderer): Deleted.
1072
1073 2018-01-19  Jonathan Bedard  <jbedard@apple.com>
1074
1075         Unreviewed build fix, remove unused lambda captures.
1076
1077         * dom/messageports/MessagePortChannel.cpp:
1078         (WebCore::MessagePortChannel::takeAllMessagesForPort):
1079         * dom/messageports/MessagePortChannelRegistry.cpp:
1080         (WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
1081
1082 2018-01-19  Antoine Quint  <graouts@apple.com>
1083
1084         [Web Animations] Expose timing properties (delay, endDelay, fill, iterationStart, iterations, direction) and getComputedTiming()
1085         https://bugs.webkit.org/show_bug.cgi?id=181857
1086         <rdar://problem/36660081>
1087
1088         Reviewed by Dean Jackson.
1089
1090         We start the work to implement the rest of the Web Animations timing and animation model by exposing more properties on
1091         AnimationEffectTiming to control delay (delay, endDelay), looping (iterationStart, iterations), fill and direction.
1092         Additionally, we expose the getComputedTiming() method on AnimationEffect, although it currently lacks some computed
1093         properties that will come in later patch as we implement various processes defined by the spec. We also update the
1094         existing duration() method on AnimationEffectTiming to be called iterationDuration() to match the terms used in the
1095         specification.
1096
1097         Finally, we make all new properties, and update existing ones, that expose a time value go through the new utility
1098         function secondsToWebAnimationsAPITime() to guarantee rounded values with microseconds precision, as advised by
1099         the Web Animations specification.
1100
1101         * CMakeLists.txt:
1102         * DerivedSources.make:
1103         * Sources.txt:
1104         * WebCore.xcodeproj/project.pbxproj:
1105         * animation/AnimationEffect.cpp:
1106         (WebCore::AnimationEffect::localTime const):
1107         (WebCore::AnimationEffect::getComputedTiming):
1108         * animation/AnimationEffect.h:
1109         * animation/AnimationEffect.idl:
1110         * animation/AnimationEffectTiming.cpp:
1111         (WebCore::AnimationEffectTiming::AnimationEffectTiming):
1112         (WebCore::AnimationEffectTiming::setIterationStart):
1113         (WebCore::AnimationEffectTiming::setIterations):
1114         (WebCore::AnimationEffectTiming::bindingsDuration const):
1115         (WebCore::AnimationEffectTiming::setBindingsDuration):
1116         (WebCore::AnimationEffectTiming::endTime const):
1117         (WebCore::AnimationEffectTiming::activeDuration const):
1118         * animation/AnimationEffectTiming.h:
1119         * animation/AnimationEffectTiming.idl:
1120         * animation/AnimationPlaybackEvent.cpp:
1121         (WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
1122         (WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
1123         * animation/AnimationTimeline.cpp:
1124         (WebCore::AnimationTimeline::bindingsCurrentTime):
1125         * animation/ComputedTimingProperties.h: Added.
1126         * animation/ComputedTimingProperties.idl: Added. We set nullable double values to a default value of "null" since
1127         otherwise setting those properties to a null value would not set the properties in the converted JS dictionary.
1128         * animation/KeyframeEffect.cpp:
1129         (WebCore::KeyframeEffect::create): Handle new timing properties passed in the KeyframeEffectOptions dictionary.
1130         (WebCore::KeyframeEffect::applyAtLocalTime):
1131         (WebCore::KeyframeEffect::getAnimatedStyle):
1132         (WebCore::KeyframeEffect::startOrStopAccelerated):
1133         * animation/WebAnimation.cpp:
1134         (WebCore::WebAnimation::bindingsStartTime const):
1135         (WebCore::WebAnimation::bindingsCurrentTime const):
1136         (WebCore::WebAnimation::effectEndTime const):
1137         (WebCore::WebAnimation::timeToNextRequiredTick const):
1138         * animation/WebAnimationUtilities.h: Added.
1139         (WebCore::secondsToWebAnimationsAPITime):
1140
1141 2018-01-19  Alex Christensen  <achristensen@webkit.org>
1142
1143         Remove dead networking code
1144         https://bugs.webkit.org/show_bug.cgi?id=181813
1145
1146         Reviewed by Tim Horton.
1147
1148         CFURLConnection is only used on Windows.
1149
1150         * platform/network/cf/ResourceError.h:
1151         * platform/network/cf/ResourceRequest.h:
1152         (WebCore::ResourceRequest::encodingRequiresPlatformData const):
1153         * platform/network/cf/ResourceRequestCFNet.cpp:
1154         (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
1155         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1156         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
1157         (WebCore::ResourceRequest::doUpdateResourceRequest):
1158         (WebCore::ResourceRequest::setStorageSession):
1159         * platform/network/cf/ResourceResponse.h:
1160         (WebCore::ResourceResponse::ResourceResponse):
1161
1162 2018-01-19  Alex Christensen  <achristensen@webkit.org>
1163
1164         Remove unused WebViewPrivate _allowCookies
1165         https://bugs.webkit.org/show_bug.cgi?id=181812
1166
1167         Reviewed by Tim Horton.
1168
1169         This SPI was in the original iOS upstreaming and has not been used in many years.
1170
1171         * platform/network/ResourceRequestBase.cpp:
1172         (WebCore::ResourceRequestBase::setDefaultAllowCookies): Deleted.
1173         (WebCore::ResourceRequestBase::defaultAllowCookies): Deleted.
1174         * platform/network/ResourceRequestBase.h:
1175         (WebCore::ResourceRequestBase::ResourceRequestBase):
1176
1177 2018-01-18  Brady Eidson  <beidson@apple.com>
1178
1179         Make in-process MessagePorts be (mostly) asynchronous
1180         https://bugs.webkit.org/show_bug.cgi?id=181454
1181
1182         Reviewed by Alex Christensen.
1183
1184         No new tests (Covered *brutally* by existing tests)
1185
1186         Part of making MessagePorts be a thing we can pass across processes is making them work async.
1187         
1188         The existing "MessagePortChannel" method of abstraction was not cut out for this.
1189         This patch gets rid of MessagePortChannel and adds a new MessagePortChannelProvider abstraction.
1190         It then gets the new machinery working in-process (with some pieces of out-of-process in place)
1191
1192         One synchronous behavior this patch maintains is the hasPendingActivity() check used to support GC.
1193         That will (creatively) be made async in the next followup.
1194         
1195         More generally from MessagePorts, this patch also adds a "MessageWithMessagePorts" object to be used
1196         with all forms of postMessage(). Much better.
1197         
1198         * CMakeLists.txt:
1199         * Sources.txt:
1200         * WebCore.xcodeproj/project.pbxproj:
1201
1202         * dom/InProcessMessagePortChannel.cpp: Removed.
1203         * dom/InProcessMessagePortChannel.h: Removed.
1204         * dom/MessagePortChannel.cpp: Removed.
1205         * dom/MessagePortChannel.h: Removed.
1206
1207         * dom/MessageChannel.cpp:
1208         (WebCore::MessageChannel::create):
1209         (WebCore::MessageChannel::MessageChannel):
1210         (WebCore::m_port2): Deleted.
1211         * dom/MessageChannel.h:
1212         (WebCore::MessageChannel::create): Deleted.
1213
1214         * dom/MessagePort.cpp:
1215         (WebCore::MessagePort::create):
1216         (WebCore::MessagePort::MessagePort):
1217         (WebCore::MessagePort::~MessagePort):
1218         (WebCore::MessagePort::entangle):
1219         (WebCore::MessagePort::postMessage):
1220         (WebCore::MessagePort::disentangle):
1221         (WebCore::MessagePort::messageAvailable):
1222         (WebCore::MessagePort::start):
1223         (WebCore::MessagePort::close):
1224         (WebCore::MessagePort::contextDestroyed):
1225         (WebCore::MessagePort::dispatchMessages):
1226         (WebCore::MessagePort::hasPendingActivity const):
1227         (WebCore::MessagePort::locallyEntangledPort const):
1228         (WebCore::MessagePort::disentanglePorts):
1229         (WebCore::MessagePort::entanglePorts):
1230         (WebCore::MessagePort::entangleWithRemote): Deleted.
1231         * dom/MessagePort.h:
1232
1233         * dom/MessagePortIdentifier.h:
1234         (WebCore::MessagePortIdentifier::logString const):
1235
1236         * dom/ScriptExecutionContext.cpp:
1237         (WebCore::ScriptExecutionContext::processMessageWithMessagePortsSoon):
1238         (WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
1239         (WebCore::ScriptExecutionContext::processMessagePortMessagesSoon): Deleted.
1240         * dom/ScriptExecutionContext.h:
1241
1242         Add a single object that represents two intertwined ports, tracks their pending
1243         messages, tracks which process they're in, etc etc:
1244         * dom/messageports/MessagePortChannel.cpp: Added.
1245         (WebCore::MessagePortChannel::create):
1246         (WebCore::MessagePortChannel::MessagePortChannel):
1247         (WebCore::MessagePortChannel::~MessagePortChannel):
1248         (WebCore::MessagePortChannel::includesPort):
1249         (WebCore::MessagePortChannel::entanglePortWithProcess):
1250         (WebCore::MessagePortChannel::disentanglePort):
1251         (WebCore::MessagePortChannel::closePort):
1252         (WebCore::MessagePortChannel::postMessageToRemote):
1253         (WebCore::MessagePortChannel::takeAllMessagesForPort):
1254         (WebCore::MessagePortChannel::hasAnyMessagesPendingOrInFlight const):
1255         * dom/messageports/MessagePortChannel.h: Added.
1256         (WebCore::MessagePortChannel::port1 const):
1257         (WebCore::MessagePortChannel::port2 const):
1258         (WebCore::MessagePortChannel::logString const):
1259
1260         Abstraction for creating and operating on MessagePorts in a potentially cross-process way:
1261         * dom/messageports/MessagePortChannelProvider.cpp: Added.
1262         (WebCore::MessagePortChannelProvider::singleton):
1263         (WebCore::MessagePortChannelProvider::setSharedProvider):
1264         * dom/messageports/MessagePortChannelProvider.h: Added.
1265         (WebCore::MessagePortChannelProvider::~MessagePortChannelProvider):
1266
1267         Adds a concrete implementation of that provider to be used in-process (e.g. WK1):
1268         * dom/messageports/MessagePortChannelProviderImpl.cpp: Added.
1269         (WebCore::MessagePortChannelProviderImpl::~MessagePortChannelProviderImpl):
1270         (WebCore::MessagePortChannelProviderImpl::performActionOnAppropriateThread):
1271         (WebCore::MessagePortChannelProviderImpl::createNewMessagePortChannel):
1272         (WebCore::MessagePortChannelProviderImpl::entangleLocalPortInThisProcessToRemote):
1273         (WebCore::MessagePortChannelProviderImpl::messagePortDisentangled):
1274         (WebCore::MessagePortChannelProviderImpl::messagePortClosed):
1275         (WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
1276         (WebCore::MessagePortChannelProviderImpl::takeAllMessagesForPort):
1277         (WebCore::MessagePortChannelProviderImpl::hasMessagesForPorts_temporarySync):
1278         * dom/messageports/MessagePortChannelProviderImpl.h: Added.
1279
1280         Adds a main thread object to handle the set of all MessagePortChannels that are open.
1281         For now it lives in the WebProcess, but for out-of-process it will live in the UIProcess:
1282         * dom/messageports/MessagePortChannelRegistry.cpp: Added.
1283         (WebCore::MessagePortChannelRegistry::~MessagePortChannelRegistry):
1284         (WebCore::MessagePortChannelRegistry::didCreateMessagePortChannel):
1285         (WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
1286         (WebCore::MessagePortChannelRegistry::messagePortChannelDestroyed):
1287         (WebCore::MessagePortChannelRegistry::didEntangleLocalToRemote):
1288         (WebCore::MessagePortChannelRegistry::didDisentangleMessagePort):
1289         (WebCore::MessagePortChannelRegistry::didCloseMessagePort):
1290         (WebCore::MessagePortChannelRegistry::didPostMessageToRemote):
1291         (WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
1292         (WebCore::MessagePortChannelRegistry::hasMessagesForPorts_temporarySync): This is named against style
1293           and weird on purpose - to call attention to how bad it is and how it's temporary.
1294         (WebCore::MessagePortChannelRegistry::existingChannelContainingPort):
1295         * dom/messageports/MessagePortChannelRegistry.h: Added.
1296
1297         Add an object that represents a "SerializedScriptValue for the message payload and the ports
1298         that are being transferred along with that payload". This is used in all forms of postMessage():
1299         * dom/messageports/MessageWithMessagePorts.cpp: Added.
1300         * dom/messageports/MessageWithMessagePorts.h: Added.
1301
1302         * page/DOMWindow.cpp:
1303         (WebCore::PostMessageTimer::PostMessageTimer):
1304         (WebCore::PostMessageTimer::event):
1305         (WebCore::DOMWindow::postMessage):
1306
1307         * platform/Logging.h:
1308
1309         * workers/DedicatedWorkerGlobalScope.cpp:
1310         (WebCore::DedicatedWorkerGlobalScope::postMessage):
1311
1312         * workers/Worker.cpp:
1313         (WebCore::Worker::postMessage):
1314
1315         * workers/WorkerGlobalScopeProxy.h:
1316
1317         * workers/WorkerMessagingProxy.cpp:
1318         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
1319         (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
1320         * workers/WorkerMessagingProxy.h:
1321
1322         * workers/WorkerObjectProxy.h:
1323
1324         * workers/service/ServiceWorker.cpp:
1325         (WebCore::ServiceWorker::postMessage):
1326
1327         * workers/service/ServiceWorkerClient.cpp:
1328         (WebCore::ServiceWorkerClient::postMessage):
1329
1330         * workers/service/context/SWContextManager.cpp:
1331         (WebCore::SWContextManager::postMessageToServiceWorker):
1332
1333         * workers/service/context/ServiceWorkerThread.cpp:
1334         (WebCore::fireMessageEvent):
1335         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
1336         * workers/service/context/ServiceWorkerThread.h:
1337
1338 2018-01-18  Ryan Haddad  <ryanhaddad@apple.com>
1339
1340         Unreviewed build fix, removed unused lambda capture.
1341
1342         * workers/service/context/SWContextManager.cpp:
1343         (WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):
1344
1345 2018-01-18  Chris Dumez  <cdumez@apple.com>
1346
1347         We should be able to terminate service workers that are unresponsive
1348         https://bugs.webkit.org/show_bug.cgi?id=181563
1349         <rdar://problem/35280031>
1350
1351         Reviewed by Alex Christensen.
1352
1353         Test: http/tests/workers/service/postmessage-after-terminating-hung-worker.html
1354
1355         * workers/service/context/SWContextManager.cpp:
1356         (WebCore::SWContextManager::terminateWorker):
1357         Before calling WorkerThread::stop(), set a timer with the given timeout parameter.
1358         If the worker thread has not stopped when the timer fires, forcefully exit the
1359         service worker process. The StorageProcess will take care of relaunching the
1360         service worker process if it exits abruptly.
1361
1362         (WebCore::SWContextManager::serviceWorkerFailedToTerminate):
1363         Log error message if we failed to terminate a service worker and call exit().
1364
1365         (WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):
1366
1367         * workers/service/context/SWContextManager.h:
1368
1369 2018-01-18  Youenn Fablet  <youenn@apple.com>
1370
1371         Do not go to the storage process when loading a main resource if there is no service worker registered
1372         https://bugs.webkit.org/show_bug.cgi?id=181395
1373
1374         Reviewed by Chris Dumez.
1375
1376         No observable behavior change.
1377         Instead of creating a connection to know whether there is a potential service worker,
1378         Ask the service worker provider that will use the connection if needed.
1379         Otherwise, it will use a default value provided by the UIProcess.
1380
1381         Tested by cleaning all service workers and checking the computed value of the default value,
1382         then observing whether pages registering service workers work well.
1383
1384         * loader/DocumentLoader.cpp:
1385         (WebCore::DocumentLoader::startLoadingMainResource):
1386         * workers/service/ServiceWorkerProvider.cpp:
1387         (WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
1388         * workers/service/ServiceWorkerProvider.h:
1389
1390 2018-01-18  Dan Bernstein  <mitz@apple.com>
1391
1392         [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
1393         https://bugs.webkit.org/show_bug.cgi?id=181803
1394
1395         Reviewed by Tim Horton.
1396
1397         * Configurations/Base.xcconfig: Updated.
1398         * Configurations/DebugRelease.xcconfig: Ditto.
1399         * Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
1400         * Configurations/Version.xcconfig: Updated.
1401         * Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings
1402           useful for defining settings that depend on the target macOS version.
1403
1404 2018-01-18  Chris Dumez  <cdumez@apple.com>
1405
1406         Service Workers restored from persistent storage have 'redundant' state
1407         https://bugs.webkit.org/show_bug.cgi?id=181749
1408         <rdar://problem/36556486>
1409
1410         Reviewed by Youenn Fablet.
1411
1412         Tested by new API test.
1413
1414         * workers/service/server/SWServer.cpp:
1415         (WebCore::SWServer::installContextData):
1416         Make sure the SWServerWorker's state is set to "activated" after it is assigned to
1417         the registrations' active slot. Otherwise, it stays in its default state (redundant).
1418
1419 2018-01-18  Antti Koivisto  <antti@apple.com>
1420
1421         REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
1422         https://bugs.webkit.org/show_bug.cgi?id=181460
1423         <rdar://problem/36379776>
1424
1425         Reviewed by Ryosuke Niwa.
1426
1427         * css/parser/CSSParser.cpp:
1428         (WebCore::CSSParserContext::CSSParserContext):
1429
1430         Don't do the expensive security origin test if the supplied sheet base URL is null. This
1431         is true for rules coming from the same document.
1432
1433 2018-01-18  Antti Koivisto  <antti@apple.com>
1434
1435         REGRESSION (r223604): Setting :before/after pseudo element on <noscript> asserts
1436         https://bugs.webkit.org/show_bug.cgi?id=181795
1437         <rdar://problem/36334524>
1438
1439         Reviewed by David Kilzer.
1440
1441         <noscript> disallows renderer generation outside CSS mechanisms, however we would still construct
1442         PseudoElements for them during style resolution. These were never removed properly because the
1443         pseudo element removal was tied to render tree teardown. Without proper removal the associated
1444         animations were also not canceled.
1445
1446         Test: fast/css-generated-content/noscript-pseudo-anim-crash.html
1447
1448         * dom/Element.cpp:
1449         (WebCore::Element::removedFromAncestor):
1450
1451         Take care to get rid of PseudoElements when the element is removed from the tree.
1452         This also cancels any associated animations.
1453
1454 2018-01-18  Chris Fleizach  <cfleizach@apple.com>
1455
1456         AX: Aria-activedescendant not supported
1457         https://bugs.webkit.org/show_bug.cgi?id=161734
1458         <rdar://problem/28202679>
1459
1460         Reviewed by Joanmarie Diggs.
1461
1462         When a combo-box owns/controls a list/listbox/grid/tree, the owned element needs to check the active-descendant of the combobox when
1463         checking if it has selected children. 
1464         The target of the selection change notification should also be the owned element in these cases.
1465
1466         Test: accessibility/aria-combobox-controlling-list.html
1467
1468         * accessibility/AccessibilityObject.cpp:
1469         (WebCore::AccessibilityObject::selectedListItem):
1470         * accessibility/AccessibilityObject.h:
1471         * accessibility/AccessibilityRenderObject.cpp:
1472         (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
1473         (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
1474         (WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
1475         (WebCore::AccessibilityRenderObject::selectedChildren):
1476         * accessibility/AccessibilityRenderObject.h:
1477         * accessibility/mac/AXObjectCacheMac.mm:
1478         (WebCore::AXObjectCache::postPlatformNotification):
1479
1480 2018-01-17  Per Arne Vollan  <pvollan@apple.com>
1481
1482         REGRESSION (r224780): Text stroke not applied to video captions.
1483         https://bugs.webkit.org/show_bug.cgi?id=181743
1484         <rdar://problem/35874338>
1485
1486         Reviewed by Simon Fraser.
1487
1488         Tests: media/track/track-css-visible-stroke-expected.html
1489                media/track/track-css-visible-stroke.html
1490
1491         After r224780, it is no longer possible to mix text stroke styles with webkit
1492         legacy text stroke styles.
1493
1494         * css/StyleResolver.cpp:
1495         (WebCore::isValidCueStyleProperty):
1496         * page/CaptionUserPreferencesMediaAF.cpp:
1497         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):
1498
1499 2018-01-18  Andy Estes  <aestes@apple.com>
1500
1501         [Payment Request] Support a default shipping address for Apple Pay
1502         https://bugs.webkit.org/show_bug.cgi?id=181754
1503         <rdar://problem/36009733>
1504
1505         Reviewed by Brady Eidson.
1506
1507         Move shippingContact from ApplePayPaymentRequest to ApplePayRequestBase. This allows
1508         merchants to specify a default shipping address when using Apple Pay with Payment Request.
1509
1510         This also fixes a bug found during testing where
1511         +[NSPersonNameComponentsFormatter localizedStringFromPersonNameComponents:style:options:]
1512         would throw an exception when passed a nil NSPersonNameComponents.
1513
1514         Test: http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html
1515
1516         * Modules/applepay/ApplePayPaymentRequest.h:
1517         * Modules/applepay/ApplePayPaymentRequest.idl:
1518         * Modules/applepay/ApplePayRequestBase.cpp:
1519         (WebCore::convertAndValidate):
1520         * Modules/applepay/ApplePayRequestBase.h:
1521         * Modules/applepay/ApplePayRequestBase.idl:
1522         * Modules/applepay/ApplePaySession.cpp:
1523         (WebCore::convertAndValidate):
1524         * Modules/applepay/ApplePaySessionPaymentRequest.h:
1525         (WebCore::ApplePaySessionPaymentRequest::version const):
1526         (WebCore::ApplePaySessionPaymentRequest::setVersion):
1527         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1528         (WebCore::convert):
1529         * Modules/applepay/paymentrequest/ApplePayRequest.idl:
1530         * testing/MockPaymentCoordinator.cpp:
1531         (WebCore::MockPaymentCoordinator::showPaymentUI):
1532         (WebCore::MockPaymentCoordinator::completeMerchantValidation):
1533         * testing/MockPaymentCoordinator.h:
1534
1535 2018-01-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1536
1537         [iOS] Specify -[NSURL _title] for the associated URL when copying an image element
1538         https://bugs.webkit.org/show_bug.cgi?id=181783
1539         <rdar://problem/35785445>
1540
1541         Reviewed by Ryosuke Niwa.
1542
1543         Always specify the -[NSURL _title] to be either the title specified in a PasteboardImage's inner PasteboardURL,
1544         or if no title is specified, fall back to the user-visible URL string. This is because at least one internal
1545         client always tries to use the -_title property to determine the title of a pasted URL, or if none is specified,
1546         the -suggestedName. Since we need to set suggestedName to the preferred file name of the copied image and we
1547         don't want the suggested name to become the title of the link, we need to explicitly set the link title.
1548
1549         In doing so, this patch also fixes a bug wherein we forget to set the _title of the NSURL we're registering to
1550         an NSItemProvider.
1551
1552         Tests:  ActionSheetTests.CopyImageElementWithHREFAndTitle (new)
1553                 ActionSheetTests.CopyImageElementWithHREF (modified)
1554
1555         * platform/ios/PlatformPasteboardIOS.mm:
1556         (WebCore::PlatformPasteboard::write):
1557
1558 2018-01-17  Jer Noble  <jer.noble@apple.com>
1559
1560         WebVTT served via HLS never results in cues
1561         https://bugs.webkit.org/show_bug.cgi?id=181773
1562
1563         Reviewed by Eric Carlson.
1564
1565         Test: http/tests/media/hls/hls-webvtt-tracks.html
1566
1567         Three independant errors conspired to keep in-band WebVTT samples from parsing:
1568
1569         - The definition of ISOWebVTTCue::boxTypeName() was incorrect.
1570         - ISOWebVTTCue::parse() didn't call it's superclass's parse() method (leading to an incorrect size and offset).
1571         - Use String::fromUTF8() rather than String.adopt(StringVector&&).
1572
1573         * platform/graphics/iso/ISOVTTCue.cpp:
1574         (WebCore::ISOWebVTTCue::parse):
1575         * platform/graphics/iso/ISOVTTCue.h:
1576         (WebCore::ISOWebVTTCue::boxTypeName):
1577
1578 2018-01-17  John Wilander  <wilander@apple.com>
1579
1580         Resource Load Statistics: Block cookies for prevalent resources without user interaction
1581         https://bugs.webkit.org/show_bug.cgi?id=177394
1582         <rdar://problem/34613960>
1583
1584         Reviewed by Alex Christensen.
1585
1586         Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
1587                http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
1588                http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
1589                http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
1590
1591         * platform/network/NetworkStorageSession.h:
1592             Now exports NetworkStorageSession::nsCookieStorage().
1593         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1594         (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
1595             Fixes the FIXME.
1596
1597 2018-01-17  Dean Jackson  <dino@apple.com>
1598
1599         Remove linked-on test for Snow Leopard
1600         https://bugs.webkit.org/show_bug.cgi?id=181770
1601
1602         Reviewed by Eric Carlson.
1603
1604         Remove a very old linked-on-or-after test.
1605
1606         * platform/graphics/ca/GraphicsLayerCA.cpp:
1607
1608 2018-01-17  Matt Lewis  <jlewis3@apple.com>
1609
1610         Unreviewed, rolling out r227098.
1611
1612         This broke the build.
1613
1614         Reverted changeset:
1615
1616         "Remove linked-on test for Snow Leopard"
1617         https://bugs.webkit.org/show_bug.cgi?id=181770
1618         https://trac.webkit.org/changeset/227098
1619
1620 2018-01-17  Dean Jackson  <dino@apple.com>
1621
1622         Remove linked-on test for Snow Leopard
1623         https://bugs.webkit.org/show_bug.cgi?id=181770
1624
1625         Reviewed by Eric Carlson.
1626
1627         Remove a very old linked-on-or-after test.
1628
1629         * platform/graphics/ca/GraphicsLayerCA.cpp:
1630
1631 2018-01-17  Stephan Szabo  <stephan.szabo@sony.com>
1632
1633         [Curl] Use ResourceRequest::encodeWithPlatformData()
1634         https://bugs.webkit.org/show_bug.cgi?id=181768
1635
1636         Reviewed by Alex Christensen.
1637
1638         No new tests, assertion hit in downstream port, should be covered by
1639         existing tests.
1640
1641         * platform/network/curl/ResourceRequest.h:
1642         (WebCore::ResourceRequest::encodeWithPlatformData const):
1643         (WebCore::ResourceRequest::decodeWithPlatformData):
1644
1645 2018-01-17  Eric Carlson  <eric.carlson@apple.com>
1646
1647         Use existing RGB colorspace instead of creating a new one
1648         https://bugs.webkit.org/show_bug.cgi?id=181765
1649         <rdar://problem/36595753>
1650
1651         Reviewed by Dean Jackson.
1652
1653         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1654         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Use sRGBColorSpaceRef instead
1655         of creating a new static colorspace.
1656
1657 2018-01-17  Matt Lewis  <jlewis3@apple.com>
1658
1659         Unreviewed, rolling out r227076.
1660
1661         This breaks internal builds
1662
1663         Reverted changeset:
1664
1665         "Resource Load Statistics: Block cookies for prevalent
1666         resources without user interaction"
1667         https://bugs.webkit.org/show_bug.cgi?id=177394
1668         https://trac.webkit.org/changeset/227076
1669
1670 2018-01-17  Ryosuke Niwa  <rniwa@webkit.org>
1671
1672         input and textarea elements should reveal selection in setSelection when focused
1673         https://bugs.webkit.org/show_bug.cgi?id=181715
1674         <rdar://problem/36570546>
1675
1676         Reviewed by Zalan Bujtas.
1677
1678         Made input and textarea elements reveal selection in FrameSelection::setSelection instead of by directly
1679         invoking FrameSelection::revealSelection in their respective updateFocusAppearance to unify code paths.
1680
1681         Also added options to reveal selection up to the main frame to SetSelectionOption to be used in iOS.
1682
1683         * editing/FrameSelection.cpp:
1684         (WebCore::FrameSelection::FrameSelection):
1685         (WebCore::FrameSelection::moveWithoutValidationTo): Takes SelectionRevealMode as an argument and converts
1686         sets appropriate selection options.
1687         (WebCore::FrameSelection::setSelection): Reconstruct SelectionRevealMode out of selection option sets.
1688         (WebCore::FrameSelection::updateAndRevealSelection):
1689         * editing/FrameSelection.h:
1690         (WebCore::FrameSelection): Added RevealSelectionUpToMainFrame as a SelectionRevealMode and replaced
1691         m_shouldRevealSelection by m_selectionRevealMode.
1692         * html/HTMLInputElement.cpp:
1693         (WebCore::HTMLInputElement::updateFocusAppearance): Pass SelectionRevealMode to HTMLTextFormControlElement's
1694         select and restoreCachedSelection instead of directly invoking FrameSelection::revealSelection.
1695         * html/HTMLTextAreaElement.cpp:
1696         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Ditto.
1697         * html/HTMLTextFormControlElement.cpp:
1698         (WebCore::HTMLTextFormControlElement::select):
1699         (WebCore::HTMLTextFormControlElement::setSelectionRange):
1700         (WebCore::HTMLTextFormControlElement::restoreCachedSelection):
1701         * html/HTMLTextFormControlElement.h:
1702
1703 2018-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1704
1705         WEBKIT_FRAMEWORK should not modify file-global include directories
1706         https://bugs.webkit.org/show_bug.cgi?id=181656
1707
1708         Reviewed by Konstantin Tokarev.
1709
1710         * CMakeLists.txt:
1711         * PlatformWPE.cmake:
1712
1713 2018-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1714
1715         [GTK] Try even harder not to static link WTF into libwebkit2gtk
1716         https://bugs.webkit.org/show_bug.cgi?id=181751
1717
1718         Reviewed by Alex Christensen.
1719
1720         We don't want two copies of WTF. It should only be in libjavascriptcoregtk.
1721
1722         * PlatformGTK.cmake:
1723
1724 2018-01-17  Zalan Bujtas  <zalan@apple.com>
1725
1726         Multicol: RenderMultiColumnFlow should not inherit the flow state
1727         https://bugs.webkit.org/show_bug.cgi?id=181762
1728         <rdar://problem/35448565>
1729
1730         Reviewed by Simon Fraser.
1731
1732         Do not compute the inherited flow state flag for RenderMultiColumnFlow.
1733         It is (by definition) always inside a fragmented flow.
1734
1735         Test: fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow.html
1736
1737         * rendering/RenderObject.cpp:
1738         (WebCore::RenderObject::computedFragmentedFlowState):
1739
1740 2018-01-17  Alex Christensen  <achristensen@webkit.org>
1741
1742         Deprecate Application Cache
1743         https://bugs.webkit.org/show_bug.cgi?id=181764
1744
1745         Reviewed by Geoffrey Garen.
1746
1747         * features.json:
1748
1749 2018-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1750
1751         [iOS simulator] API test WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage is failing
1752         https://bugs.webkit.org/show_bug.cgi?id=181758
1753
1754         Reviewed by Tim Horton.
1755
1756         This test is failing because Editor::clientReplacementURLForResource expects a MIME type, but on iOS, the type
1757         paramter passed into WebContentReader::readImage is a UTI; subsequently, the bundle editing delegate receives
1758         a MIME type that's actually a UTI, which is incorrect. To address this, ensure that a MIME type is passed to
1759         bundle SPI by converting the type in WebContentReader::readImage to a MIME type.
1760
1761         * editing/cocoa/WebContentReaderCocoa.mm:
1762         (WebCore::WebContentReader::readImage):
1763
1764 2018-01-17  Antti Koivisto  <antti@apple.com>
1765
1766         REGRESSION (r226385?): Crash in com.apple.WebCore: WebCore::MediaQueryEvaluator::evaluate const + 32
1767         https://bugs.webkit.org/show_bug.cgi?id=181742
1768         <rdar://problem/36334726>
1769
1770         Reviewed by David Kilzer.
1771
1772         Test: fast/media/mediaqueryevaluator-crash.html
1773
1774         * css/MediaQueryEvaluator.cpp:
1775         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
1776
1777         Use WeakPtr<Document> instead of a plain Frame pointer.
1778
1779         (WebCore::MediaQueryEvaluator::evaluate const):
1780
1781         Get the frame via document.
1782
1783         * css/MediaQueryEvaluator.h:
1784         * dom/Document.cpp:
1785         (WebCore::Document::prepareForDestruction):
1786
1787         Take care to clear style resolver.
1788
1789 2018-01-17  Youenn Fablet  <youenn@apple.com>
1790
1791         Put fetch request keepAlive behind a runtime flag
1792         https://bugs.webkit.org/show_bug.cgi?id=181592
1793
1794         Reviewed by Chris Dumez.
1795
1796         No change of behavior.
1797
1798         * Modules/fetch/FetchRequest.idl:
1799         * page/RuntimeEnabledFeatures.h:
1800         (WebCore::RuntimeEnabledFeatures::fetchAPIKeepAliveEnabled const):
1801         (WebCore::RuntimeEnabledFeatures::setFetchAPIKeepAliveEnabled):
1802
1803 2018-01-17  Per Arne Vollan  <pvollan@apple.com>
1804
1805         [Win] Use switch when converting from ResourceRequestCachePolicy to platform cache policy.
1806         https://bugs.webkit.org/show_bug.cgi?id=181686
1807
1808         Reviewed by Alex Christensen.
1809
1810         No new tests, covered by existing tests.
1811
1812         A switch will make the function easier on the eyes. Also, use the function in places where the ResourceRequestCachePolicy
1813         is just casted to a platform cache policy.
1814
1815         * platform/network/cf/ResourceRequestCFNet.cpp:
1816         (WebCore::toPlatformRequestCachePolicy):
1817
1818 2018-01-17  John Wilander  <wilander@apple.com>
1819
1820         Resource Load Statistics: Block cookies for prevalent resources without user interaction
1821         https://bugs.webkit.org/show_bug.cgi?id=177394
1822         <rdar://problem/34613960>
1823
1824         Reviewed by Alex Christensen.
1825
1826         Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
1827                http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
1828                http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
1829                http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
1830
1831         * platform/network/NetworkStorageSession.h:
1832             Now exports NetworkStorageSession::nsCookieStorage().
1833         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1834         (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
1835             Fixes the FIXME.
1836
1837 2018-01-17  Daniel Bates  <dabates@apple.com>
1838
1839         REGRESSION (r222795): Cardiogram never signs in
1840         https://bugs.webkit.org/show_bug.cgi?id=181693
1841         <rdar://problem/36286293>
1842
1843         Reviewed by Ryosuke Niwa.
1844
1845         Exempt Cardiogram from the XHR header restrictions in r222795.
1846
1847         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
1848         However Cardiogram also depends on such functionality.
1849
1850         Test: fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled.html
1851
1852         * page/Settings.yaml:
1853         * platform/RuntimeApplicationChecks.h:
1854         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1855         (WebCore::IOSApplication::isCardiogram):
1856         * xml/XMLHttpRequest.cpp:
1857         (WebCore::XMLHttpRequest::setRequestHeader):
1858
1859 2018-01-17  Daniel Bates  <dabates@apple.com>
1860
1861         ASSERTION FAILED: !m_completionHandler in PingHandle::~PingHandle()
1862         https://bugs.webkit.org/show_bug.cgi?id=181746
1863         <rdar://problem/36586248>
1864
1865         Reviewed by Chris Dumez.
1866
1867         Call PingHandle::pingLoadComplete() with an error when NSURLConnection queries
1868         whether the ping is able to respond to an authentication request. (Pings do not
1869         respond to authenticate requests.) It will call the completion handler, nullify
1870         the completion handler, and deallocate the PingHandle. Nullifying the completion
1871         handler is necessary to avoid the assertion failure in ~PingHandle().
1872
1873         Test: http/tests/misc/before-unload-load-image.html
1874
1875         * platform/network/PingHandle.h:
1876
1877 2018-01-17  Daniel Bates  <dabates@apple.com>
1878
1879         WebCoreResourceHandleAsOperationQueueDelegate/ResourceHandleCFURLConnectionDelegateWithOperationQueue may
1880         be deleted in main thread callback
1881         https://bugs.webkit.org/show_bug.cgi?id=181747
1882         <rdar://problem/36588120>
1883
1884         Reviewed by Alex Christensen.
1885
1886         Retain the delegate (e.g. WebCoreResourceHandleAsOperationQueueDelegate) before scheduling
1887         a main thread callback and blocking on a semaphore for its reply because the main thread
1888         callback can do anything, including deleting the delegate, before the non-main thread
1889         has a chance to execute. For instance, a PingHandle will delete itself (and hence delete
1890         its resource handle delegate) in most of the code paths invoked by the delegate.
1891
1892         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1893         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1894         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1895         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1896         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1897         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1898         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
1899         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
1900         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1901         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
1902
1903 2018-01-17  Chris Dumez  <cdumez@apple.com>
1904
1905         'fetch' event may be sent to a service worker before its state is set to 'activated'
1906         https://bugs.webkit.org/show_bug.cgi?id=181698
1907         <rdar://problem/36554856>
1908
1909         Reviewed by Youenn Fablet.
1910
1911         'fetch' event may be sent to a service worker before its state is set to 'activated'.
1912         When the registration's active worker needs to intercept a load, and its state is 'activating',
1913         we queue the request to send the fetch event in SWServerWorker::m_whenActivatedHandlers.
1914         Once the SWServerWorker::setState() is called with 'activated' state, we then call the
1915         handlers in m_whenActivatedHandlers to make send the fetch event now that the worker is
1916         activated. The issue is that even though the worker is activated and its state was set to
1917         'activated' on Storage process side, we had not yet notified the ServiceWorker process
1918         of the service worker's new state yet.
1919
1920         To address the issue, we now make sure that SWServerWorker::m_whenActivatedHandlers are
1921         called *after* we've sent the IPC to the ServiceWorker process to update the worker's
1922         state to 'activated'. Also, we now call ServiceWorkerFetch::dispatchFetchEvent()
1923         asynchronously in a postTask() as the service worker's state is also updated asynchronously
1924         in a postTask. This is as per specification [1], which says to "queue a task" to fire
1925         the fetch event.
1926
1927         [1] https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
1928
1929         No new tests, covered by imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html
1930         which hits the new assertion without the fix.
1931
1932         * workers/service/context/ServiceWorkerFetch.cpp:
1933         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
1934         Add assertions to make sure that we dispatch the fetch event on the right worker and
1935         that the worker is in 'activated' state.
1936
1937         * workers/service/context/ServiceWorkerThread.cpp:
1938         (WebCore::ServiceWorkerThread::postFetchTask):
1939         Queue a task to fire the fetch event as per:
1940         - https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
1941         We need to match the specification exactly here or things will happen in the wrong
1942         order. In particular, things like "update registration state" and "update worker state"
1943         might happen *after* firing the fetch event, even though the IPC for "update registration/worker
1944         state" was sent before the "fire fetch event" one, because the code for updating a registration/
1945         worker state already queues a task, as per the specification.
1946
1947         * workers/service/server/SWServerRegistration.cpp:
1948         (WebCore::SWServerRegistration::updateWorkerState):
1949         * workers/service/server/SWServerRegistration.h:
1950         * workers/service/server/SWServerWorker.cpp:
1951         (WebCore::SWServerWorker::setState):
1952         Move code to send the IPC to the Service Worker process whenever the service worker's state
1953         needs to be updated from SWServerRegistration::updateWorkerState() to SWServerWorker::setState().
1954         This way, we can make sure the IPC is sent *before* we call the m_whenActivatedHandlers handlers,
1955         as they may also send IPC to the Service Worker process, and we need to make sure this IPC happens
1956         after so that the service worker is in the right state.
1957
1958 2018-01-17  Stephan Szabo  <stephan.szabo@sony.com>
1959
1960         Page.cpp only sees forward declaration of ApplicationStateChangeListener when ENABLE(VIDEO) is off
1961         https://bugs.webkit.org/show_bug.cgi?id=181713
1962
1963         Reviewed by Darin Adler.
1964
1965         No new tests (build fix).
1966
1967         * page/Page.cpp: Add include for ApplicationStateChangeListener
1968
1969 2018-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1970
1971         Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
1972         https://bugs.webkit.org/show_bug.cgi?id=181637
1973         <rdar://problem/36508471>
1974
1975         Reviewed by Tim Horton.
1976
1977         Before carrying out blob URL conversion for pasted or dropped rich content, let the editor client replace
1978         subresource URLs in WebKit2 by calling out to new injected bundle SPI. See comments below for more detail.
1979
1980         Tests:  WKAttachmentTests.InjectedBundleReplaceURLsWhenPastingAttributedString
1981                 WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage
1982
1983         * editing/Editor.cpp:
1984         (WebCore::Editor::clientReplacementURLForResource):
1985         * editing/Editor.h:
1986
1987         Add a new helper to call out to the editor client for a URL string to replace a given ArchiveResource. In
1988         WebKit2, this calls out to the injected bundle's new `replacementURLForResource` SPI hook.
1989
1990         * editing/cocoa/WebContentReaderCocoa.mm:
1991         (WebCore::shouldReplaceSubresourceURL):
1992         (WebCore::replaceRichContentWithAttachments):
1993         (WebCore::replaceSubresourceURLsWithURLsFromClient):
1994
1995         Add a new static helper to replace subresource URLs in the given DocumentFragment with URLs supplied by the
1996         editor client. Additionally builds a list of ArchiveResources that have not been replaced, for use at call sites
1997         so that we don't unnecessarily create more Blobs for ArchiveResources that have already been replaced.
1998
1999         (WebCore::createFragmentAndAddResources):
2000         (WebCore::sanitizeMarkupWithArchive):
2001
2002         Tweak web content reading codepaths to first replace subresource URLs with editor-client-supplied URLs.
2003
2004         (WebCore::WebContentReader::readImage):
2005         (WebCore::shouldConvertToBlob): Deleted.
2006
2007         Rename this helper to shouldReplaceSubresourceURL, blob URL replacement is no longer the only scenario in which
2008         we replace resource URLs, but in both cases, we still want to ignore `http:`-family and `data:` URLs.
2009
2010         * loader/EmptyClients.cpp:
2011         * page/EditorClient.h:
2012
2013 2018-01-17  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2014         [EME][GStreamer] Add the full-sample encryption support in the GStreamer ClearKey decryptor
2015         https://bugs.webkit.org/show_bug.cgi?id=180080
2016
2017         Reviewed by Xabier Rodriguez-Calvar.
2018
2019         Currently the GStreamer clearKey decryptor doesn't support the full-sample encryption,
2020         where the buffer is entirely encrypted, it supports only the sub-sample encryption.
2021
2022         Test: media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
2023
2024         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2025         (webKitMediaClearKeyDecryptorDecrypt):
2026
2027 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
2028
2029         Unreviewed follow-up to r227051.
2030
2031         * platform/graphics/cairo/CairoOperations.h: Fix declaration of the
2032         fillRoundedRect() function by removing the bool parameter that's not
2033         used at all in the definition. This went unspotted due to the unified
2034         source build including the implementation file before fillRoundedRect()
2035         usage in GrapihcsContextCairo.cpp, leaving the declaration undefined
2036         and instead using the definition directly.
2037
2038 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
2039
2040         [Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
2041         https://bugs.webkit.org/show_bug.cgi?id=181725
2042
2043         Reviewed by Carlos Garcia Campos.
2044
2045         Don't duplicate global alpha and image interpolation quality state
2046         values on the PlatformContextCairo. Instead, retrieve them from
2047         the managing GraphicsContextState when necessary.
2048
2049         For Cairo operations, the FillSource and StrokeSource containers now
2050         store the global alpha value, using it during the operation executions.
2051         For drawNativeImage(), the global alpha and interpolation quality values
2052         are passed through arguments.
2053
2054         In PlatformContextCairo, the two values are no longer stored on the
2055         internally-managed stack, and the getter-setter pairs for the two values
2056         are removed. In drawSurfaceToContext(), the two values are now expected
2057         to be passed through the method arguments.
2058
2059         No new tests -- no change in behavior.
2060
2061         * platform/graphics/cairo/CairoOperations.cpp:
2062         (WebCore::Cairo::prepareForFilling):
2063         (WebCore::Cairo::prepareForStroking):
2064         (WebCore::Cairo::drawPathShadow):
2065         (WebCore::Cairo::fillCurrentCairoPath):
2066         (WebCore::Cairo::FillSource::FillSource):
2067         (WebCore::Cairo::StrokeSource::StrokeSource):
2068         (WebCore::Cairo::strokeRect):
2069         (WebCore::Cairo::strokePath):
2070         (WebCore::Cairo::drawGlyphs):
2071         (WebCore::Cairo::drawNativeImage):
2072         (WebCore::Cairo::State::setGlobalAlpha): Deleted.
2073         (WebCore::Cairo::State::setImageInterpolationQuality): Deleted.
2074         * platform/graphics/cairo/CairoOperations.h:
2075         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2076         (WebCore::GraphicsContext::drawNativeImage):
2077         (WebCore::GraphicsContext::setPlatformAlpha):
2078         (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
2079         * platform/graphics/cairo/PlatformContextCairo.cpp:
2080         (WebCore::PlatformContextCairo::save):
2081         (WebCore::PlatformContextCairo::drawSurfaceToContext):
2082         (WebCore::PlatformContextCairo::State::State): Deleted.
2083         (WebCore::PlatformContextCairo::setImageInterpolationQuality): Deleted.
2084         (WebCore::PlatformContextCairo::imageInterpolationQuality const): Deleted.
2085         (WebCore::PlatformContextCairo::globalAlpha const): Deleted.
2086         (WebCore::PlatformContextCairo::setGlobalAlpha): Deleted.
2087         * platform/graphics/cairo/PlatformContextCairo.h:
2088         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2089         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2090
2091 2018-01-17  Philippe Normand  <pnormand@igalia.com>
2092
2093         REGRESSION(r226973/r226974): Four multimedia tests failing
2094         https://bugs.webkit.org/show_bug.cgi?id=181696
2095
2096         Reviewed by Carlos Garcia Campos.
2097
2098         This patch reverts some of the changes of the above revisions so as to fix layout test failures.
2099
2100         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2101         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Properly
2102         prepare stalled event when an error was detected.
2103         (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Revert to previous version.
2104         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
2105         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
2106         Emit progress event also when streaming but not when an error was
2107         detected.
2108         (WebCore::MediaPlayerPrivateGStreamer::totalBytes const): use isLiveStream like everywhere else.
2109         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2110         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2111         (webkit_web_src_init): Revert to keep-alive FALSE by default.
2112
2113 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
2114
2115         [Cairo] Move prepareForFilling(), prepareForStroking() code to CairoOperations
2116         https://bugs.webkit.org/show_bug.cgi?id=181721
2117
2118         Reviewed by Carlos Garcia Campos.
2119
2120         Move the prepareForFilling() and prepareForStroking() code off of the
2121         PlatformContextCairo class and into static functions inside the
2122         CairoOperations implementation files. The original methods weren't
2123         called from any place other than the Cairo operations, and they only
2124         operated with the cairo_t object that's stored in and retrievable from
2125         the PlatformContextCairo object.
2126
2127         No new tests -- no change in behavior.
2128
2129         * platform/graphics/cairo/CairoOperations.cpp:
2130         (WebCore::Cairo::reduceSourceByAlpha):
2131         (WebCore::Cairo::prepareCairoContextSource):
2132         (WebCore::Cairo::clipForPatternFilling):
2133         (WebCore::Cairo::prepareForFilling):
2134         (WebCore::Cairo::prepareForStroking):
2135         (WebCore::Cairo::drawPathShadow):
2136         (WebCore::Cairo::fillCurrentCairoPath):
2137         (WebCore::Cairo::strokeRect):
2138         (WebCore::Cairo::strokePath):
2139         (WebCore::Cairo::drawGlyphs):
2140         * platform/graphics/cairo/PlatformContextCairo.cpp:
2141         (WebCore::reduceSourceByAlpha): Deleted.
2142         (WebCore::prepareCairoContextSource): Deleted.
2143         (WebCore::PlatformContextCairo::prepareForFilling): Deleted.
2144         (WebCore::PlatformContextCairo::prepareForStroking): Deleted.
2145         (WebCore::PlatformContextCairo::clipForPatternFilling): Deleted.
2146         * platform/graphics/cairo/PlatformContextCairo.h:
2147
2148 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
2149
2150         [Cairo] Use one-time ShadowBlur objects when performing shadowing
2151         https://bugs.webkit.org/show_bug.cgi?id=181720
2152
2153         Reviewed by Carlos Garcia Campos.
2154
2155         Don't maintain a ShadowBlur object in the PlatformContextCairo class.
2156         Instead, use temporary ShadowBlur objects whenever shadowing is needed,
2157         providing all the shadow state information to it and drawing shadow into
2158         the given GraphicsContext object.
2159
2160         ShadowBlur constructors are cleaned up. The 'shadows ignored' argument
2161         can now also be provided to the variant that accepts explicit shadow
2162         attributes, but the argument is false by default.
2163
2164         In CairoOperations, the ShadowBlurUsage functionality is rolled into the
2165         new ShadowState class. ShadowState parameter is now used for operations
2166         that might need to perform shadow painting. Call sites are modified
2167         accordingly.
2168
2169         Cairo::State::setShadowValues() and Cairo::State::clearShadow() are
2170         removed, since the ShadowBlur object that was modified through those is
2171         being removed from the PlatformContextCairo class. We still have to flip
2172         the Y-axis of the shadow offset in GraphicsContext::setPlatformShadow()
2173         when shadows are ignoring transformations.
2174
2175         No new tests -- no change in behavior.
2176
2177         * platform/graphics/ShadowBlur.cpp:
2178         (WebCore::ShadowBlur::ShadowBlur):
2179         * platform/graphics/ShadowBlur.h:
2180         * platform/graphics/cairo/CairoOperations.cpp:
2181         (WebCore::Cairo::drawPathShadow):
2182         (WebCore::Cairo::drawGlyphsShadow):
2183         (WebCore::Cairo::ShadowState::ShadowState):
2184         (WebCore::Cairo::ShadowState::isVisible const):
2185         (WebCore::Cairo::ShadowState::isRequired const):
2186         (WebCore::Cairo::fillRect):
2187         (WebCore::Cairo::fillRoundedRect):
2188         (WebCore::Cairo::fillRectWithRoundedHole):
2189         (WebCore::Cairo::fillPath):
2190         (WebCore::Cairo::strokeRect):
2191         (WebCore::Cairo::strokePath):
2192         (WebCore::Cairo::drawGlyphs):
2193         (WebCore::Cairo::drawNativeImage):
2194         (WebCore::Cairo::State::setShadowValues): Deleted.
2195         (WebCore::Cairo::State::clearShadow): Deleted.
2196         (WebCore::Cairo::ShadowBlurUsage::ShadowBlurUsage): Deleted.
2197         (WebCore::Cairo::ShadowBlurUsage::required const): Deleted.
2198         * platform/graphics/cairo/CairoOperations.h:
2199         * platform/graphics/cairo/FontCairo.cpp:
2200         (WebCore::FontCascade::drawGlyphs):
2201         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2202         (WebCore::GraphicsContext::restorePlatformState):
2203         (WebCore::GraphicsContext::drawNativeImage):
2204         (WebCore::GraphicsContext::fillPath):
2205         (WebCore::GraphicsContext::strokePath):
2206         (WebCore::GraphicsContext::fillRect):
2207         (WebCore::GraphicsContext::setPlatformShadow):
2208         (WebCore::GraphicsContext::clearPlatformShadow):
2209         (WebCore::GraphicsContext::strokeRect):
2210         (WebCore::GraphicsContext::platformFillRoundedRect):
2211         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2212         * platform/graphics/cairo/PlatformContextCairo.cpp:
2213         (WebCore::PlatformContextCairo::drawSurfaceToContext):
2214         * platform/graphics/cairo/PlatformContextCairo.h:
2215         (WebCore::PlatformContextCairo::shadowBlur): Deleted.
2216         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2217         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2218
2219 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
2220
2221         CanvasImageData: createImageData() parameter should not be nullable
2222         https://bugs.webkit.org/show_bug.cgi?id=181670
2223
2224         Reviewed by Sam Weinig.
2225
2226         createImageData() method on the CanvasImageData interface should not
2227         treat the ImageData parameter as nullable, but should instead reject any
2228         null values with a TypeError, as demanded by the specification.
2229
2230         No new tests -- current tests covering createImageData(null) are updated
2231         to properly cover new behavior of throwing a TypeError exception.
2232
2233         * html/canvas/CanvasImageData.idl:
2234         * html/canvas/CanvasRenderingContext2DBase.cpp:
2235         (WebCore::CanvasRenderingContext2DBase::createImageData const):
2236         * html/canvas/CanvasRenderingContext2DBase.h:
2237
2238 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2239
2240         [CMake] Remove WebCoreDerivedSources library target
2241         https://bugs.webkit.org/show_bug.cgi?id=181664
2242
2243         Reviewed by Carlos Garcia Campos.
2244
2245         After unified source build has been introduced, CMake Visual
2246         Studio build suffers complicated unnecessary recompilation issues
2247         because Visual Studio invokes scripts twice in both WebCore and
2248         WebCoreDerivedSources projects (Bug 181117).
2249
2250         WebCoreDerivedSources library has been introduced in r198766 to
2251         avoid command line length limit of CMake Ninja build on macOS.
2252         Fortunately, unified source build has reduced the number of source
2253         files to compile, WebCore doesn't need to be split anymore.
2254
2255         No new tests (No behavior change)
2256
2257         * CMakeLists.txt: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES. Removed WebCoreDerivedSources library target.
2258         Do not compile each JavaScript Builtins.cpp files because the unified source WebCoreJSBuiltins.cpp is already included.
2259         * PlatformGTK.cmake: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES.
2260         * PlatformWin.cmake: Ditto.
2261
2262 2018-01-16  Simon Fraser  <simon.fraser@apple.com>
2263
2264         Can't scroll iframe after toggling it to display:none and back
2265         https://bugs.webkit.org/show_bug.cgi?id=181708
2266         rdar://problem/13234778
2267
2268         Reviewed by Tim Horton.
2269
2270         Nothing updated the FrameView's set of scrollable areas when a subframe came back from display:none.
2271         Mirror the existing virtual removeChild() by making addChild() virtual, and using it to mark
2272         the FrameView's scrollable area set as dirty.
2273
2274         Test: tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe.html
2275
2276         * page/FrameView.cpp:
2277         (WebCore::FrameView::addChild):
2278         * page/FrameView.h:
2279         * platform/ScrollView.h:
2280
2281 2018-01-16  Chris Dumez  <cdumez@apple.com>
2282
2283         SWServerWorker::m_contextConnectionIdentifier may get out of date
2284         https://bugs.webkit.org/show_bug.cgi?id=181687
2285         <rdar://problem/36548111>
2286
2287         Reviewed by Brady Eidson.
2288
2289         SWServerWorker::m_contextConnectionIdentifier may get out of date. This happens when the
2290         context process crashes and is relaunched.
2291
2292         No new tests, added assertion in terminateWorkerInternal() that hits without this fix.
2293
2294         * workers/service/server/SWServer.cpp:
2295         (WebCore::SWServer::runServiceWorker):
2296         (WebCore::SWServer::terminateWorkerInternal):
2297         (WebCore::SWServer::unregisterServiceWorkerClient):
2298         * workers/service/server/SWServerWorker.h:
2299         (WebCore::SWServerWorker::setContextConnectionIdentifier):
2300
2301 2018-01-16  Jer Noble  <jer.noble@apple.com>
2302
2303         Reset MediaSourcePrivateAVFObjC's m_sourceBufferWithSelectedVideo when the underlying SourceBufferPrivate is removed.
2304         https://bugs.webkit.org/show_bug.cgi?id=181707
2305         <rdar://problem/34809474>
2306
2307         Reviewed by Eric Carlson.
2308
2309         Test: media/media-source/media-source-remove-unload-crash.html
2310
2311         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2312         (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
2313
2314 2018-01-12  Jiewen Tan  <jiewen_tan@apple.com>
2315
2316         [WebAuthN] Implement dummy WebAuthN IDLs
2317         https://bugs.webkit.org/show_bug.cgi?id=181627
2318         <rdar://problem/36459864>
2319
2320         Reviewed by Alex Christensen.
2321
2322         This patch implements dummy WebAuthN IDLs and connect them with Credential Management as well.
2323         All implementations in this patch are subject to change when real implementations land. The
2324         purpose here on the other hand is to have IDLs, bindings and implementations connected. This
2325         patch should handle all IDLs that we need.
2326
2327         No tests.
2328
2329         * CMakeLists.txt:
2330         * DerivedSources.make:
2331         * Modules/credentialmanagement/CredentialCreationOptions.h:
2332         * Modules/credentialmanagement/CredentialCreationOptions.idl:
2333         * Modules/credentialmanagement/CredentialRequestOptions.h:
2334         * Modules/credentialmanagement/CredentialRequestOptions.idl:
2335         * Modules/webauthn/AuthenticatorAssertionResponse.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
2336         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
2337         (WebCore::AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse):
2338         (WebCore::AuthenticatorAssertionResponse::authenticatorData):
2339         (WebCore::AuthenticatorAssertionResponse::signature):
2340         (WebCore::AuthenticatorAssertionResponse::userHandle):
2341         * Modules/webauthn/AuthenticatorAssertionResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
2342         * Modules/webauthn/AuthenticatorAssertionResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
2343         * Modules/webauthn/AuthenticatorAttestationResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
2344         (WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse):
2345         (WebCore::AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse):
2346         (WebCore::AuthenticatorAttestationResponse::attestationObject):
2347         * Modules/webauthn/AuthenticatorAttestationResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
2348         * Modules/webauthn/AuthenticatorAttestationResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
2349         * Modules/webauthn/AuthenticatorResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
2350         (WebCore::AuthenticatorResponse::AuthenticatorResponse):
2351         (WebCore::AuthenticatorResponse::~AuthenticatorResponse):
2352         (WebCore::AuthenticatorResponse::clientDataJSON):
2353         * Modules/webauthn/AuthenticatorResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
2354         * Modules/webauthn/AuthenticatorResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
2355         * Modules/webauthn/PublicKeyCredential.cpp:
2356         (WebCore::PublicKeyCredential::rawId):
2357         (WebCore::PublicKeyCredential::response):
2358         (WebCore::PublicKeyCredential::getClientExtensionResults):
2359         (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
2360         * Modules/webauthn/PublicKeyCredential.h:
2361         * Modules/webauthn/PublicKeyCredential.idl:
2362         * Modules/webauthn/PublicKeyCredentialCreationOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
2363         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl: Added.
2364         * Modules/webauthn/PublicKeyCredentialDescriptor.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
2365         * Modules/webauthn/PublicKeyCredentialDescriptor.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
2366         * Modules/webauthn/PublicKeyCredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
2367         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
2368         * Modules/webauthn/PublicKeyCredentialType.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
2369         * Modules/webauthn/PublicKeyCredentialType.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
2370         * Sources.txt:
2371         * WebCore.xcodeproj/project.pbxproj:
2372         * bindings/js/WebCoreBuiltinNames.h:
2373
2374 2018-01-16  Zalan Bujtas  <zalan@apple.com>
2375
2376         AX: Do not trigger layout in updateBackingStore() unless it is safe to do so
2377         https://bugs.webkit.org/show_bug.cgi?id=181703
2378         <rdar://problem/36365706>
2379
2380         Reviewed by Ryosuke Niwa.
2381
2382         Document::isSafeToUpdateStyleOrLayout() can tell whether it is safe to run layout.
2383
2384         Unable to create test with WebInspector involved. 
2385
2386         * accessibility/AccessibilityObject.cpp:
2387         (WebCore::AccessibilityObject::updateBackingStore):
2388         * dom/Document.cpp:
2389         (WebCore::Document::isSafeToUpdateStyleOrLayout const):
2390         (WebCore::Document::updateStyleIfNeeded):
2391         (WebCore::Document::updateLayout):
2392         (WebCore::isSafeToUpdateStyleOrLayout): Deleted.
2393         * dom/Document.h:
2394
2395 2018-01-16  Ryan Haddad  <ryanhaddad@apple.com>
2396
2397         Unreviewed, rolling out r226962.
2398
2399         The LayoutTest added with this change is a flaky timeout.
2400
2401         Reverted changeset:
2402
2403         "Support for preconnect Link headers"
2404         https://bugs.webkit.org/show_bug.cgi?id=181657
2405         https://trac.webkit.org/changeset/226962
2406
2407 2018-01-16  Simon Fraser  <simon.fraser@apple.com>
2408
2409         Text looks bad on some CSS spec pages
2410         https://bugs.webkit.org/show_bug.cgi?id=181700
2411         rdar://problem/36552107
2412
2413         Reviewed by Tim Horton.
2414
2415         When making new tiles in a TileController, we failed to set their "supports antialiased layer text"
2416         setting, so tile caches could end up with a mixture of layers that do and do not support
2417         antialiased layer text.
2418
2419         No tests because the tiled drawing tests don't dump out tiles inside of tile caches.
2420
2421         * platform/graphics/ca/TileController.cpp:
2422         (WebCore::TileController::createTileLayer):
2423
2424 2018-01-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2425
2426         REGRESSION(r221292): svg/animations/animateTransform-pattern-transform.html crashes with security assertion
2427         https://bugs.webkit.org/show_bug.cgi?id=179986
2428
2429         Reviewed by Simon Fraser.
2430
2431         This patch reverts all or parts of the following changes-sets
2432             <http://trac.webkit.org/changeset/221292>
2433             <http://trac.webkit.org/changeset/197967>
2434             <http://trac.webkit.org/changeset/196670>
2435
2436         A JS statement like this:
2437             var item = text.x.animVal.getItem(0);
2438
2439         Creates the following C++ objects:
2440             SVGAnimatedListPropertyTearOff<SVGLengthListValues> for 'text.x'
2441             SVGListPropertyTearOff<SVGLengthListValues> for 'text.x.animVal'
2442             SVGPropertyTearOff<SVGLengthValue> for 'text.x.animVal.getItem(0)'
2443
2444         If 'item' changes, the attribute 'x' of the element '<text>' will change
2445         as well. But this binding works only in one direction. If the attribute
2446         'x' of the element '<text>' changes, e.g.:
2447
2448             text.setAttribute('x', '10,20,30');
2449
2450         This will detach 'item' from the element <text> and any further changes 
2451         in 'item' won't affect the attribute 'x' of element <text>.
2452
2453         The one direction binding can only work if this chain of tear-off objects
2454         is kept connected. This is implemented by RefCounted back pointers from
2455         SVGPropertyTearOff and SVGListPropertyTearOff to SVGAnimatedListPropertyTearOff.
2456
2457         The security crashes and the memory leaks are happening because of the
2458         raw forward pointers:
2459             -- SVGAnimatedListPropertyTearOff maintains raw pointers of type
2460                SVGListPropertyTearOff for m_baseVal and m_animVal
2461             -- The m_wrappers and m_animatedWrappers of SVGAnimatedListPropertyTearOff
2462                are vectors of raw pointer Vector<SVGLength*>
2463
2464         To control the life cycle of the raw pointers, SVGListPropertyTearOff and
2465         SVGPropertyTearOff call SVGAnimatedListPropertyTearOff::propertyWillBeDeleted()
2466         to notify it they are going to be deleted. In propertyWillBeDeleted(), we
2467         clear the pointers so they are not used after being freed. This mechanism
2468         has been error-prone and we've never got it 100% right.
2469
2470         The solution we need to adopt with SVG tear-off objects is the following:
2471             -- All the forward pointers should be weak pointers.
2472             -- All the back pointers should be ref pointers.
2473
2474         This solution may not look intuitive but it solves the bugs and keeps the
2475         one direction binding. The forward weak pointers allows the tear-off
2476         objects to go aways if no reference from JS exists. The back ref pointers
2477         maintains the chain of objects and guarantees the correct binding.
2478
2479         * svg/SVGPathSegList.h:
2480         * svg/SVGTransformList.h:
2481         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2482         (WebCore::SVGAnimatedListPropertyTearOff::baseVal):
2483         (WebCore::SVGAnimatedListPropertyTearOff::animVal):
2484         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
2485         * svg/properties/SVGAnimatedProperty.h:
2486         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
2487         (WebCore::SVGAnimatedProperty::propertyWillBeDeleted): Deleted.
2488         * svg/properties/SVGAnimatedPropertyTearOff.h:
2489         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
2490         * svg/properties/SVGListProperty.h:
2491         (WebCore::SVGListProperty::initializeValuesAndWrappers):
2492         (WebCore::SVGListProperty::getItemValuesAndWrappers):
2493         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
2494         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
2495         (WebCore::SVGListProperty::removeItemValuesAndWrappers):
2496         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
2497         (WebCore::SVGListProperty::createWeakPtr const):
2498         * svg/properties/SVGListPropertyTearOff.h:
2499         (WebCore::SVGListPropertyTearOff::removeItemFromList):
2500         (WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff): Deleted.
2501         * svg/properties/SVGPropertyTearOff.h:
2502         (WebCore::SVGPropertyTearOff::createWeakPtr const):
2503         (WebCore::SVGPropertyTearOff::~SVGPropertyTearOff):
2504
2505 2018-01-16  Eric Carlson  <eric.carlson@apple.com>
2506
2507         AVSampleBufferDisplayLayer should be flushed when application activates
2508         https://bugs.webkit.org/show_bug.cgi?id=181623
2509         <rdar://problem/36487738>
2510
2511         Reviewed by Darin Adler.
2512
2513         No new tests, I wasn't able to reproduce it in a test.
2514
2515         * WebCore.xcodeproj/project.pbxproj:
2516         * dom/Document.cpp:
2517         (WebCore::Document::addApplicationStateChangeListener): New.
2518         (WebCore::Document::removeApplicationStateChangeListener): Ditto.
2519         (WebCore::Document::forEachApplicationStateChangeListener): Ditto.
2520         * dom/Document.h:
2521
2522         * html/HTMLMediaElement.cpp:
2523         (WebCore::HTMLMediaElement::registerWithDocument): Register for application state changes.
2524         (WebCore::HTMLMediaElement::unregisterWithDocument): Unregister.
2525         (WebCore::HTMLMediaElement::applicationWillResignActive): Pass through to the player.
2526         (WebCore::HTMLMediaElement::applicationDidBecomeActive): Ditto.
2527         * html/HTMLMediaElement.h:
2528
2529         * page/ApplicationStateChangeListener.h: Added.
2530         (WebCore::ApplicationStateChangeListener::applicationWillResignActive):
2531         (WebCore::ApplicationStateChangeListener::applicationDidBecomeActive):
2532         * page/Page.cpp:
2533         (WebCore::Page::forEachDocument):
2534         (WebCore::Page::applicationWillResignActive):
2535         (WebCore::Page::applicationDidEnterBackground):
2536         (WebCore::Page::applicationWillEnterForeground):
2537         (WebCore::Page::applicationDidBecomeActive):
2538         * page/Page.h:
2539         * platform/graphics/MediaPlayer.cpp:
2540         (WebCore::MediaPlayer::applicationWillResignActive):
2541         (WebCore::MediaPlayer::applicationDidBecomeActive):
2542         * platform/graphics/MediaPlayer.h:
2543         * platform/graphics/MediaPlayerPrivate.h:
2544         (WebCore::MediaPlayerPrivateInterface::applicationWillResignActive):
2545         (WebCore::MediaPlayerPrivateInterface::applicationDidBecomeActive):
2546
2547         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2548         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2549         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Switch
2550         to release logging.
2551         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
2552         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Split out of enqueueVideoSample.
2553         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Move code that updates
2554         the display later to enqueueCorrectedVideoSample. Rearrange logic to the image painter sample
2555         buffer has the correct timestamp.
2556         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerErrorDidChange): Switch to release logging.
2557         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Ditto.
2558         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): f the display
2559         layer is in the "failed" state, flush the renderer and update the display mode.
2560         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Switch to release logging.
2561         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Ditto.
2562         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad): Ditto.
2563         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay): Ditto.
2564         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Ditto.
2565         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Ditto.
2566         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Ditto.
2567         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume): Ditto.
2568         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto.
2569         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateReadyState) Ditto.:
2570         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::logChannel const): Ditto.
2571         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes): Deleted.
2572
2573 2018-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
2574
2575         PAL should link to JavaScriptCore rather than WTF
2576         https://bugs.webkit.org/show_bug.cgi?id=181683
2577
2578         Reviewed by Konstantin Tokarev.
2579
2580         Do not link directly to JavaScriptCore. Get it via PAL.
2581
2582         * CMakeLists.txt:
2583
2584 2018-01-16  Zach Li  <zachli@apple.com>
2585
2586         Add pop-up policy support in website policies.
2587         https://bugs.webkit.org/show_bug.cgi?id=181544.
2588         rdar://problem/30521400.
2589
2590         Reviewed by Alex Christensen.
2591
2592         * loader/DocumentLoader.h:
2593         Introduce pop-up policy getter and setter. Initialize
2594         the policy as Default.
2595         (WebCore::DocumentLoader::popUpPolicy const):
2596         (WebCore::DocumentLoader::setPopUpPolicy):
2597         * page/DOMWindow.cpp:
2598         (WebCore::DOMWindow::allowPopUp):
2599         Pop-up policy specified on a per-page basis holds
2600         precedence over the global policy. If no pop-up policy
2601         is specified during navigation, global policy is used.
2602
2603 2018-01-16  Jer Noble  <jer.noble@apple.com>
2604
2605         Crash playing audio-only HLS stream via hls.js (MSE)
2606         https://bugs.webkit.org/show_bug.cgi?id=181691
2607         <rdar://problem/32967295>
2608
2609         Reviewed by Eric Carlson.
2610
2611         Add a weak-link check to the block called by -[AVSampleBufferDisplayLayer requestMediaDataWhenReadyOnQueue:usingBlock:].
2612
2613         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2614         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2615         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
2616         (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
2617
2618 2018-01-16  Simon Fraser  <simon.fraser@apple.com>
2619
2620         Rename applyHorizontalScale/applyVerticalScale in SVG filters, and related cleanup
2621         https://bugs.webkit.org/show_bug.cgi?id=181684
2622
2623         Reviewed by Alex Christensen.
2624
2625         Rename the confusing applyHorizontalScale/applyVerticalScale to scaledByFilterResolution(),
2626         and have it take and return a FloatSize. Change callers to do math in terms of FloatSizes.
2627
2628         Add inflate(size) to each of the rect classes.
2629
2630         * platform/graphics/FloatRect.h:
2631         (WebCore::FloatRect::inflate):
2632         * platform/graphics/IntRect.h:
2633         (WebCore::IntRect::inflate):
2634         * platform/graphics/LayoutRect.h:
2635         (WebCore::LayoutRect::inflate):
2636         * platform/graphics/filters/FEDisplacementMap.cpp:
2637         (WebCore::FEDisplacementMap::platformApplySoftware):
2638         * platform/graphics/filters/FEDropShadow.cpp:
2639         (WebCore::FEDropShadow::determineAbsolutePaintRect):
2640         (WebCore::FEDropShadow::platformApplySoftware):
2641         * platform/graphics/filters/FEGaussianBlur.cpp:
2642         (WebCore::FEGaussianBlur::calculateUnscaledKernelSize):
2643         (WebCore::FEGaussianBlur::calculateKernelSize):
2644         (WebCore::FEGaussianBlur::determineAbsolutePaintRect):
2645         (WebCore::FEGaussianBlur::platformApplySoftware):
2646         * platform/graphics/filters/FEGaussianBlur.h:
2647         * platform/graphics/filters/FEMorphology.cpp:
2648         (WebCore::FEMorphology::determineAbsolutePaintRect):
2649         (WebCore::FEMorphology::platformApplySoftware):
2650         * platform/graphics/filters/FEOffset.cpp:
2651         (WebCore::FEOffset::determineAbsolutePaintRect):
2652         (WebCore::FEOffset::platformApplySoftware):
2653         * platform/graphics/filters/Filter.h:
2654         (WebCore::Filter::setSourceImage):
2655         (WebCore::Filter::scaledByFilterResolution const):
2656         (WebCore::Filter::applyHorizontalScale const): Deleted.
2657         (WebCore::Filter::applyVerticalScale const): Deleted.
2658         * platform/graphics/filters/FilterOperations.cpp:
2659         (WebCore::outsetSizeForBlur):
2660         * rendering/FilterEffectRenderer.h:
2661         * svg/graphics/filters/SVGFilter.cpp:
2662         (WebCore::SVGFilter::scaledByFilterResolution const):
2663         (WebCore::SVGFilter::applyHorizontalScale const): Deleted.
2664         (WebCore::SVGFilter::applyVerticalScale const): Deleted.
2665         * svg/graphics/filters/SVGFilter.h:
2666
2667 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2668
2669         [CMake][Mac] Fix the build errors
2670         https://bugs.webkit.org/show_bug.cgi?id=181665
2671
2672         Reviewed by Alex Christensen.
2673
2674         No new tests (No behavior change)
2675
2676         * CMakeLists.txt: Added Modules/paymentrequest/MerchantValidationEvent.idl to compile.
2677         * PlatformMac.cmake: Added Modules/paymentrequest/MerchantValidationEvent.cpp to compile.
2678         Added workers/service/context and Modules/applicationmanifest as forwarding header paths.
2679
2680 2018-01-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2681
2682         [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
2683         https://bugs.webkit.org/show_bug.cgi?id=181638
2684         <rdar://problem/36508702>
2685
2686         Reviewed by Dan Bernstein.
2687
2688         Adjust the `didInsertAttachment` codepath to additionally propagate the attachment element's `src`.
2689         Additionally, fix an issue with insertion and removal client notifications wherein the client can receive
2690         insertion calls without corresponding removal calls, or vice versa. This is an existing issue, but matters more
2691         now because we actually need to access the attachment element for its `src` when propagating changes to the
2692         client. See below for details.
2693
2694         Test: WKAttachmentTests.AttachmentUpdatesWhenInsertingRichMarkup
2695
2696         * dom/Document.h:
2697         (WebCore::Document::attachmentElementsByIdentifier const):
2698         * editing/Editor.cpp:
2699         (WebCore::Editor::notifyClientOfAttachmentUpdates):
2700         * page/EditorClient.h:
2701         (WebCore::EditorClient::didInsertAttachment):
2702         * page/Frame.cpp:
2703         (WebCore::Frame::setDocument):
2704
2705         When a Frame's document changes, inform the client that the attachments in the previous document are going away.
2706         For each attachment currently connected to the document, we have either (1) already informed the client that it
2707         was inserted, or (2) the attachment is pending an insertion call to the client. If (1) is the case, then we'll
2708         tell the client that the attachment is removed, which will balance out the earlier insertion call. If (2) is the
2709         case, then we'll remove the previously inserted attachment identifier from the set of attachment identifiers
2710         pending insertion, and the client won't be informed of insertions or removals.
2711
2712 2018-01-16  Antoine Quint  <graouts@apple.com>
2713
2714         Use traits for animation timing functions
2715         https://bugs.webkit.org/show_bug.cgi?id=181651
2716
2717         Reviewed by Dean Jackson.
2718
2719         Cleaning up Dean's previous patch as suggested by Darin's post-commit review comments. The
2720         downcast function can match const automatically and it's a better style to put the * inside
2721         the downcast call rather than outside.
2722
2723         * css/CSSComputedStyleDeclaration.cpp:
2724         (WebCore::createTimingFunctionValue):
2725         * platform/animation/TimingFunction.cpp:
2726         (WebCore::operator<<):
2727         (WebCore::TimingFunction::transformTime const):
2728         * platform/animation/TimingFunction.h:
2729         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
2730         (WebCore::toCAMediaTimingFunction):
2731
2732 2018-01-16  Philippe Normand  <pnormand@igalia.com>
2733
2734         [GStreamer] Live streaming cleanups
2735         https://bugs.webkit.org/show_bug.cgi?id=181672
2736
2737         Reviewed by Michael Catanzaro.
2738
2739         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2740         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Switch to
2741         streaming code path when no content-length was reported by the
2742         http source element.
2743         (WebCore::MediaPlayerPrivateGStreamer::totalBytes const): Return early when streaming.
2744         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2745         (CachedResourceStreamingClient::responseReceived): Emit headers as
2746         an element message, like souphttpsrc.
2747
2748 2018-01-15  Philippe Normand  <pnormand@igalia.com>
2749
2750         [GStreamer] misc fixes and cleanups
2751         https://bugs.webkit.org/show_bug.cgi?id=181647
2752
2753         Reviewed by Michael Catanzaro.
2754
2755         * platform/graphics/MediaPlayer.cpp:
2756         (WebCore::convertEnumerationToString): New utility function to convert preload enum to string.
2757         * platform/graphics/MediaPlayerEnums.h: Ditto.
2758         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2759         (WebCore::MediaPlayerPrivateGStreamer::load): Debug tweak
2760         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Ditto
2761         (WebCore::MediaPlayerPrivateGStreamer::play): Ditto
2762         (WebCore::MediaPlayerPrivateGStreamer::paused const): Ditto
2763         (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Prevent useless state update.
2764         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
2765         (WebCore::MediaPlayerPrivateGStreamer::updateStates): Debug tweak.
2766         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Ditto.
2767         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2768         Remove useless handlesSyncMessage method.
2769         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2770         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted): Prevent useless state update.
2771         (WebCore::MediaPlayerPrivateGStreamerBase::muted const): Debug tweak.
2772         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Ditto.
2773         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2774         (webkit_web_src_init): Enable keepAlive by default like in souphttpsrc.
2775         (webKitWebSrcStart): Debug tweak.
2776         (webKitWebSrcQueryWithParent): Ditto.
2777         (webKitWebSrcNeedData): Ditto.
2778         (CachedResourceStreamingClient::responseReceived): Change appsrc
2779         stream-type when we wan't seek. Also update caps like souphttpsrc
2780         does.
2781         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Add forward declaration of MediaPlayer.
2782         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2783         (WebCore::MediaSourceClientGStreamerMSE::append): Fix compilation warning.
2784
2785 2018-01-16  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2786
2787         [WPE] Two clearkey tests failing since r226621
2788         https://bugs.webkit.org/show_bug.cgi?id=181532
2789
2790         Reviewed by Xabier Rodriguez-Calvar.
2791
2792         Whith a fake initData, we can have a pssh size nul, thus we should check it.
2793         We saw this issue in the subtest "initData longer than 64Kb characters" in
2794         the clearkey-generate-request-disallowed-input layout test.
2795
2796         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2797         (WebCore::extractKeyidsLocationFromCencInitData):
2798
2799 2018-01-15  Yoav Weiss  <yoav@yoav.ws>
2800
2801         Support for preconnect Link headers
2802         https://bugs.webkit.org/show_bug.cgi?id=181657
2803
2804         Reviewed by Darin Adler.
2805
2806         Move the preconnect functionality into its own function, and
2807         also call this function when Link headers are processed.
2808
2809         Test: http/tests/preconnect/link-header-rel-preconnect-http.php
2810
2811         * loader/LinkLoader.cpp:
2812         (WebCore::LinkLoader::loadLinksFromHeader): Call preconnect.
2813         (WebCore::LinkLoader::preconnect): Preconnect to a host functionality moved here.
2814         (WebCore::LinkLoader::preload): Renamed `preloadIfNeeded` to `preload`.
2815         (WebCore::LinkLoader::loadLink): Call preconnect.
2816         * loader/LinkLoader.h:
2817
2818 2018-01-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2819
2820         Improve use of ExportMacros
2821         https://bugs.webkit.org/show_bug.cgi?id=181652
2822
2823         Reviewed by Konstantin Tokarev.
2824
2825         Remove a comment.
2826
2827         * platform/PlatformExportMacros.h:
2828
2829 2018-01-15  Konstantin Tokarev  <annulen@yandex.ru>
2830
2831         image-rendering should affect scaling of border-image
2832         https://bugs.webkit.org/show_bug.cgi?id=169440
2833
2834         Reviewed by Michael Catanzaro.
2835
2836         Test: fast/borders/border-image-pixelated.html
2837
2838         * rendering/style/NinePieceImage.cpp:
2839         (WebCore::NinePieceImage::paint):
2840
2841 2018-01-15  Tomas Popela  <tpopela@redhat.com>
2842
2843         2.19.3 ACCELERATED_2D_CANVAS support is broken
2844         https://bugs.webkit.org/show_bug.cgi?id=180799
2845
2846         Reviewed by Michael Catanzaro.
2847
2848         * html/canvas/CanvasRenderingContext2DBase.cpp:
2849         (WebCore::CanvasRenderingContext2DBase::didDraw):
2850
2851 2018-01-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2852
2853         [Curl] Enable HTTP/2
2854         https://bugs.webkit.org/show_bug.cgi?id=181551
2855
2856         Reviewed by Michael Catanzaro.
2857
2858         Start supporting HTTP/2 protocol. The first step is just enabling the HTTP/2 on Curl backend.
2859         Next step will be to enable multiplexing feature.
2860
2861         No new tests because we don't have HTTP/2 test backend yet.
2862
2863         * platform/network/curl/CurlContext.cpp:
2864         (WebCore::CurlContext::isHttp2Enabled const):
2865         (WebCore::CurlHandle::enableHttp):
2866         (WebCore::CurlHandle::enableHttpGetRequest):
2867         (WebCore::CurlHandle::enableHttpHeadRequest):
2868         (WebCore::CurlHandle::enableHttpPostRequest):
2869         (WebCore::CurlHandle::enableHttpPutRequest):
2870         (WebCore::CurlHandle::setHttpCustomRequest):
2871         * platform/network/curl/CurlContext.h:
2872
2873 2018-01-15  Dean Jackson  <dino@apple.com>
2874
2875         Use a helper function for checked arithmetic in WebGL validation
2876         https://bugs.webkit.org/show_bug.cgi?id=181620
2877         <rdar://problem/36485879>
2878
2879         Reviewed by Eric Carlson.
2880
2881         Eric recommended using a templated helper function to do
2882         a common arithmetic check in WebGL validation.
2883
2884         * html/canvas/WebGL2RenderingContext.cpp:
2885         (WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
2886         * html/canvas/WebGLRenderingContext.cpp:
2887         (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
2888         * html/canvas/WebGLRenderingContextBase.cpp:
2889         (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
2890         (WebCore::WebGLRenderingContextBase::validateDrawArrays):
2891         (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
2892         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
2893         * html/canvas/WebGLRenderingContextBase.h:
2894         (WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
2895
2896 2018-01-15  Dean Jackson  <dino@apple.com>
2897
2898         Use traits for animation timing functions
2899         https://bugs.webkit.org/show_bug.cgi?id=181651
2900         <rdar://problem/36525328>
2901
2902         Reviewed by Antoine Quint.
2903
2904         Use the type traits for TimingFunction classes, so
2905         we can is<> and downcast<>.
2906
2907         * css/CSSComputedStyleDeclaration.cpp:
2908         (WebCore::createTimingFunctionValue):
2909         * platform/animation/TimingFunction.cpp:
2910         (WebCore::TimingFunction::transformTime const):
2911         * platform/animation/TimingFunction.h:
2912         * platform/graphics/ca/GraphicsLayerCA.cpp:
2913         (WebCore::animationHasStepsTimingFunction):
2914         (WebCore::animationHasFramesTimingFunction):
2915         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
2916         (WebCore::toCAMediaTimingFunction):
2917
2918 2018-01-15  Youenn Fablet  <youenn@apple.com>
2919
2920         RealtimeMediaSource should be ThreadSafeRefCounted
2921         https://bugs.webkit.org/show_bug.cgi?id=181649
2922
2923         Reviewed by Eric Carlson.
2924
2925         Difficult to write a test as this is really racy.
2926         RealtimeIncomingVideoSourceCocoa::OnFrame is taking a reference on a background thread
2927         to send a task to the main thread.
2928         This requires it to be thread safe ref counted.
2929
2930         * platform/mediastream/RealtimeMediaSource.h:
2931
2932 2018-01-15  Philippe Normand  <pnormand@igalia.com>
2933
2934         Prevent useless MediaPlayer mute state notifications
2935         https://bugs.webkit.org/show_bug.cgi?id=181646
2936
2937         Reviewed by Carlos Garcia Campos.
2938
2939         On GTK port the mute change notification was triggering the test
2940         runner to think the whole page mute state had changed and that
2941         media elements were muted. The simplest solution is to propagate
2942         the notification only if the state actually changed.
2943
2944         * platform/graphics/MediaPlayer.cpp:
2945         (WebCore::MediaPlayer::muteChanged): Propagate mute notification
2946         only if the mute state actually changed.
2947
2948 2018-01-15  Sebastian Dröge  <sebastian@centricular.com>
2949
2950         [GStreamer] Don't wait for draw condition variable when shutting down.
2951         https://bugs.webkit.org/show_bug.cgi?id=180978
2952
2953         Reviewed by Carlos Garcia Campos.
2954
2955         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2956         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2957         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
2958         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2959         By also waiting for the draw condition variable while shutting down,
2960         it is possible that the GStreamer video sink is waiting for the main
2961         thread to actually render the current frame, while at the same time
2962         the main thread is waiting for the GStreamer video sink to shut down,
2963         resulting in a deadlock.
2964
2965 2018-01-13  Minsheng Liu  <lambda@liu.ms>
2966
2967         MathML Lengths should take zoom level into account
2968         https://bugs.webkit.org/show_bug.cgi?id=180029
2969
2970         Reviewed by Frédéric Wang.
2971
2972         The patch applies the effective zoom factor to physical units in toUserUnits().
2973
2974         Test: mathml/presentation/mspace-units-with-zoom.html
2975
2976         * rendering/mathml/RenderMathMLBlock.cpp:
2977         (WebCore::toUserUnits):
2978
2979 2018-01-12  Chris Dumez  <cdumez@apple.com>
2980
2981         ASSERTION FAILED: registration || isTerminating() in WebCore::SWServerWorker::skipWaiting()
2982         https://bugs.webkit.org/show_bug.cgi?id=181603
2983         <rdar://problem/36476050>
2984
2985         Reviewed by Youenn Fablet.
2986
2987         No new tests, covered by existing tests that crash flakily.
2988
2989         * workers/service/server/SWServer.cpp:
2990         (WebCore::SWServer::terminateWorkerInternal):
2991         If the connection to the context process is gone, make sure we make the worker as terminated
2992         so that it does not stay in Running state and in SWServer::m_runningOrTerminatingWorkers.
2993
2994         * workers/service/server/SWServerRegistration.cpp:
2995         (WebCore::SWServerRegistration::~SWServerRegistration):
2996         Add assertions to make sure none of the registration's workers are still running when
2997         the registration is destroyed.
2998
2999         (WebCore::SWServerRegistration::updateRegistrationState):
3000         Make sure registration workers that are overwritten are not still running.
3001
3002         * workers/service/server/SWServerWorker.cpp:
3003         (WebCore::SWServerWorker::setState):
3004         If a worker's state is set to redundant, make sure we also terminate it.
3005
3006 2018-01-12  Commit Queue  <commit-queue@webkit.org>
3007
3008         Unreviewed, rolling out r226927.
3009         https://bugs.webkit.org/show_bug.cgi?id=181621
3010
3011         Breaks 32-bit and iOS release for some reason that i don't
3012         understand yet (Requested by dino on #webkit).
3013
3014         Reverted changeset:
3015
3016         "Use a helper function for checked arithmetic in WebGL
3017         validation"
3018         https://bugs.webkit.org/show_bug.cgi?id=181620
3019         https://trac.webkit.org/changeset/226927
3020
3021 2018-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
3022
3023         Data URL fonts split in the middle of an alphabet cause random letters to disappear
3024         https://bugs.webkit.org/show_bug.cgi?id=175845
3025         <rdar://problem/33996578>
3026
3027         Reviewed by Brent Fulgham.
3028
3029         It is fairly common practice for a font foundry to split a font up into two files such that a semi-random
3030         half of the alphabet is present in one of the files, and the other half is present in the other file. This
3031         practice involves representing the files as data URLs, so as to minimize the time it takes to load them.
3032
3033         Because resource loading is asynchronous (even for data URLs), it is possible today to get a paint after
3034         the first file is loaded but before the second file is loaded. Indeed, because of the way font fallback
3035         works, we will never start loading the second file until a layout has occurred with the first font.
3036
3037         Because a site usually only uses this pattern for a handful of fonts, and I've never seen this pattern
3038         being used for CJK fonts, it isn't very expensive to opportunistically decode these data URLs eagerly.
3039         Using this method doesn't actually guarantee that the two fonts will load in between successive paints,
3040         but it at least makes this much more likely. This patch implements this strategy, along with a size
3041         threshold to make sure that we won't decode any super large data URLs when it isn't necessary.
3042
3043         Test: fast/text/font-load-data-partitioned-alphabet.html
3044
3045         * css/CSSFontFace.cpp:
3046         (WebCore::CSSFontFace::opportunisticallyStartFontDataURLLoading):
3047         * css/CSSFontFace.h:
3048         * css/CSSFontFaceSource.cpp:
3049         (WebCore::CSSFontFaceSource::opportunisticallyStartFontDataURLLoading):
3050         * css/CSSFontFaceSource.h:
3051         * css/CSSFontSelector.cpp:
3052         (WebCore::CSSFontSelector::opportunisticallyStartFontDataURLLoading):
3053         * css/CSSFontSelector.h:
3054         * platform/graphics/FontCascadeFonts.cpp:
3055         (WebCore::opportunisticallyStartFontDataURLLoading):
3056         (WebCore::FontCascadeFonts::glyphDataForVariant):
3057         * platform/graphics/FontSelector.h:
3058
3059 2018-01-12  Alex Christensen  <achristensen@webkit.org>
3060
3061         History state should be updated during client redirects with asynchronous policy decisions
3062         https://bugs.webkit.org/show_bug.cgi?id=181358
3063         <rdar://problem/35547689>
3064
3065         Reviewed by Andy Estes.
3066
3067         When decidePolicyForNavigationAction is responded to asynchronously during a client redirect, 
3068         HistoryController::updateForRedirectWithLockedBackForwardList does not update the history because
3069         the document loader has not been marked as a client redirect because the FrameLoader only looks
3070         at its provisional document loader to mark it as a client redirect.  When decidePolicyForNavigationAction
3071         is responded to asynchronously, though, the FrameLoader's provisional document loader has moved to 
3072         its policy document loader.  To get both asynchronous and synchronous cases, let's just mark the document
3073         loader as a client redirect whether it's the provisional or policy document loader.
3074
3075         Covered by a new API test.
3076
3077         * loader/FrameLoader.cpp:
3078         (WebCore::FrameLoader::loadURL):
3079         (WebCore::FrameLoader::loadPostRequest):
3080
3081 2018-01-12  Dean Jackson  <dino@apple.com>
3082
3083         Use a helper function for checked arithmetic in WebGL validation
3084         https://bugs.webkit.org/show_bug.cgi?id=181620
3085         <rdar://problem/36485879>
3086
3087         Reviewed by Eric Carlson.
3088
3089         Eric recommended using a templated helper function to do
3090         a common arithmetic check in WebGL validation.
3091
3092         * html/canvas/WebGL2RenderingContext.cpp:
3093         (WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
3094         * html/canvas/WebGLRenderingContext.cpp:
3095         (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
3096         * html/canvas/WebGLRenderingContextBase.cpp:
3097         (WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
3098         (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
3099         (WebCore::WebGLRenderingContextBase::validateDrawArrays):
3100         (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
3101         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
3102         * html/canvas/WebGLRenderingContextBase.h:
3103
3104 2018-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
3105
3106         [Cocoa] CTFontCopyDefaultCascadeListForLanguages() can return nullptr
3107         https://bugs.webkit.org/show_bug.cgi?id=181615
3108         <rdar://problem/36334637>
3109
3110         Reviewed by Jon Lee.
3111
3112         Speculative fix. We are getting crash reports saying that this call can return nullptr, and we
3113         don't check for it.
3114
3115         No new tests because I couldn't find the specific input that causes it to return nullptr. (I
3116         tried running this code with every 0, 1, and 2 length locale string, every weight value, and
3117         every italic value, and couldn't get it to crash. I also inspected the code to figure out what
3118         values would cause it to return nullptr, and I couldn't find anything other than if the system
3119         has a totally busted font setup.)
3120
3121         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3122         (WebCore::SystemFontDatabase::computeCascadeList):
3123
3124 2018-01-11  Dean Jackson  <dino@apple.com>
3125
3126         [WebGL] Simulated vertexAttrib0 can sometimes cause OUT_OF_MEMORY errors
3127         https://bugs.webkit.org/show_bug.cgi?id=181558
3128         <rdar://problem/36189833>
3129
3130         Reviewed by Eric Carlson.
3131
3132         Very large element indices in the ELEMENT_ARRAY_BUFFER meant that
3133         our simulated vertexAttrib0 buffer might be too large. We need
3134         to check for out-of-memory, but we can also detect some of the issues
3135         earlier in our validation code. Additionally, make sure that we don't
3136         accidentally cast an unsigned to a signed.
3137
3138         Test: fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html
3139
3140         * html/canvas/WebGL2RenderingContext.cpp:
3141         (WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Update validation
3142         code to look for overflow, rather than relying on looking for sign changes.
3143         * html/canvas/WebGLRenderingContext.cpp:
3144         (WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
3145         * html/canvas/WebGLRenderingContextBase.cpp:
3146         (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
3147         (WebCore::WebGLRenderingContextBase::drawArrays): Check that we were able to simulate.
3148         (WebCore::WebGLRenderingContextBase::drawElements):
3149         (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): Update validation code, and
3150         use GC3Duint, since that's what the indicies are.
3151         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Ditto.
3152         (WebCore::WebGLRenderingContextBase::drawArraysInstanced): Check that we were able to simulate.
3153         (WebCore::WebGLRenderingContextBase::drawElementsInstanced):
3154         * html/canvas/WebGLRenderingContextBase.h:
3155
3156 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3157
3158         Large in-place attachment elements cause the document width to expand when inserted
3159         https://bugs.webkit.org/show_bug.cgi?id=181614
3160
3161         Reviewed by Dan Bernstein.
3162
3163         Make in-place images and videos have a max-width of 100%, so that large attachments aren't inserted with full
3164         display size, causing the document and viewport width to expand.
3165
3166         * html/HTMLAttachmentElement.cpp:
3167         (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
3168
3169 2018-01-12  Keith Rollin  <krollin@apple.com>
3170
3171         Logged JSON should escape "'s and \'s in strings.
3172         https://bugs.webkit.org/show_bug.cgi?id=181608
3173
3174         Reviewed by Brent Fulgham.
3175
3176         No new tests -- no new functionality, just changed logging. The
3177         efficacy of the logging was verified by inspecting its output.
3178
3179         * loader/ResourceLoadObserver.cpp:
3180         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3181
3182 2018-01-12  Dean Jackson  <dino@apple.com>
3183
3184         drawElements should be invalid if vertexAttrib0 doesn't have data
3185         https://bugs.webkit.org/show_bug.cgi?id=181609
3186         <rdar://problem/36392883>
3187
3188         Reviewed by Antoine Quint.
3189
3190         If a vertex attribute has been enabled, but no data provided, then
3191         draw validation should fail.
3192
3193         Test: fast/canvas/webgl/drawElements-empty-vertex-data.html
3194
3195         * html/canvas/WebGLRenderingContextBase.cpp:
3196         (WebCore::WebGLRenderingContextBase::validateVertexAttributes): If there were
3197         never any data in the vertex buffer, then we incorrectly compared with 0.
3198
3199 2018-01-12  Youenn Fablet  <youenn@apple.com>
3200
3201         FormDataElement::lengthInBytes should use ThreadableBlobRegistry
3202         https://bugs.webkit.org/show_bug.cgi?id=181554
3203
3204         Reviewed by Chris Dumez.
3205
3206         Covered by updated test.
3207
3208         Fix blobRegistry() use and add support for creating a response that may trigger the issue.
3209
3210
3211         * platform/network/FormData.cpp:
3212         (WebCore::FormDataElement::lengthInBytes const): Was using directly blobRegistry() while ThreadableBlobRegistry is more appropriate
3213         in case this is called from workers.
3214         * Modules/fetch/FetchBody.h:
3215         * Modules/fetch/FetchResponse.h:
3216         * fileapi/Blob.h:
3217         * testing/ServiceWorkerInternals.cpp:
3218         (WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
3219         * testing/ServiceWorkerInternals.h:
3220         * testing/ServiceWorkerInternals.idl:
3221
3222 2018-01-12  Jer Noble  <jer.noble@apple.com>
3223
3224         Wrap CDMFairPlayStreaming and related classes in ENABLE(ENCRYPTED_MEDIA) checks
3225         https://bugs.webkit.org/show_bug.cgi?id=181602
3226
3227         Reviewed by Maciej Stachowiak.
3228
3229         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
3230         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
3231         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3232
3233 2018-01-12  Youenn Fablet  <youenn@apple.com>
3234
3235         WebProcess should pass the registration identifier and not the worker identifier for fetch events
3236         https://bugs.webkit.org/show_bug.cgi?id=181591
3237
3238         Reviewed by Chris Dumez.
3239
3240         Test: http/wpt/service-workers/update-service-worker.https.html
3241
3242         Store service worker registration identifier in ResourceLoaderOptions instead of service worker identifier.
3243
3244         * loader/DocumentThreadableLoader.cpp:
3245         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
3246         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
3247         * loader/ResourceLoaderOptions.h:
3248         * loader/WorkerThreadableLoader.cpp:
3249         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
3250         * loader/cache/CachedResourceLoader.cpp:
3251         (WebCore::CachedResourceLoader::prepareFetch):
3252         (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
3253         * loader/cache/CachedResourceRequest.cpp:
3254         (WebCore::CachedResourceRequest::setSelectedServiceWorkerRegistrationIdentifierIfNeeded):
3255         (WebCore::CachedResourceRequest::setNavigationServiceWorkerRegistrationData):
3256         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded): Deleted.
3257         * loader/cache/CachedResourceRequest.h:
3258         * workers/WorkerScriptLoader.cpp:
3259         (WebCore::WorkerScriptLoader::loadSynchronously):
3260         (WebCore::WorkerScriptLoader::loadAsynchronously):
3261         * workers/service/server/SWServer.cpp:
3262         (WebCore::SWServer::activeWorkerFromRegistrationID):
3263         * workers/service/server/SWServer.h:
3264
3265 2018-01-12  Fujii Hironori  <Hironori.Fujii@sony.com>
3266
3267         [Win][CMake] Remove all-in-one file for WebCore DerivedSources
3268         https://bugs.webkit.org/show_bug.cgi?id=181582
3269
3270         Reviewed by Alex Christensen.
3271
3272         Those source files are compiled in unified source build nowadays.
3273
3274         No new tests (No behavior change)
3275
3276         * CMakeLists.txt: Removed calling PROCESS_ALLINONE_FILE.
3277         * DerivedSources.cpp: Removed.
3278         * WebCoreMacros.cmake: Removed a macro PROCESS_ALLINONE_FILE.
3279
3280 2018-01-12  Fujii Hironori  <Hironori.Fujii@sony.com>
3281
3282         [WinCairo][CMake] Use ${CURL_LIBRARY} instead of specifying the library name libcurl_imp explicitly
3283         https://bugs.webkit.org/show_bug.cgi?id=181578
3284
3285         Reviewed by Alex Christensen.
3286
3287         vcpkg has libcurl.lib, not libcurl_imp.lib.
3288
3289         No new tests because no behavior change.
3290
3291         * PlatformWinCairo.cmake: Link ${CURL_LIBRARY} instead of libcurl_imp.
3292
3293 2018-01-12  Jer Noble  <jer.noble@apple.com>
3294
3295         WebGL video texture black in Safari 11.0.2 and wrong colored in Safari Preview 11.1
3296         https://bugs.webkit.org/show_bug.cgi?id=181445
3297         <rdar://problem/36383183>
3298
3299         Reviewed by Dean Jackson.
3300
3301         Tests: added compile-time correctness tests for YCbCrMatrix values.
3302
3303         Perform the derivation from YCbCr coefficients into matrices in constexpr expressions
3304         at compile-time. This allows us to also perform compile-time correctness checks to catch
3305         regressions which may cause incorrect color conversions.
3306
3307         Since we now have general-purpose derivation of matrix values from coefficients,
3308         adding missing specificed matrices is trivial, so add support for SMPTE 240M and BT.2020
3309         matrices.
3310
3311         * platform/graphics/cv/VideoTextureCopierCV.cpp:
3312         (WebCore::GLfloatColor::GLfloatColor):
3313         (WebCore::GLfloatColor::abs):
3314         (WebCore::GLfloatColor::isApproximatelyEqualTo const):
3315         (WebCore::YCbCrMatrix::operator Vector<GLfloat> const):
3316         (WebCore::YCbCrMatrix::YCbCrMatrix):
3317         (WebCore::YCbCrMatrix::operator* const):
3318         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
3319
3320 2018-01-12  Antoine Quint  <graouts@apple.com>
3321
3322         Add support for the frames() timing function
3323         https://bugs.webkit.org/show_bug.cgi?id=181585
3324         <rdar://problem/36463317>
3325
3326         Reviewed by Dean.
3327
3328         Implement the frames() timing function as specified in the CSS Timing Functions Level 1
3329         specification, specifically https://www.w3.org/TR/css-timing-1/#frames-timing-functions.
3330         A frames timing function is a type of timing function that divides the input time into a
3331         specified number of intervals of equal length.
3332
3333         Test: transitions/frames-timing-function.html
3334
3335         * css/CSSComputedStyleDeclaration.cpp:
3336         (WebCore::createTimingFunctionValue):
3337         * css/CSSTimingFunctionValue.cpp:
3338         (WebCore::CSSFramesTimingFunctionValue::customCSSText const):
3339         (WebCore::CSSFramesTimingFunctionValue::equals const):
3340         * css/CSSTimingFunctionValue.h:
3341         * css/CSSToStyleMap.cpp:
3342         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
3343         * css/CSSValue.cpp:
3344         (WebCore::CSSValue::equals const):
3345         (WebCore::CSSValue::cssText const):
3346         (WebCore::CSSValue::destroy):
3347         * css/CSSValue.h:
3348         (WebCore::CSSValue::isFramesTimingFunctionValue const):
3349         * css/CSSValueKeywords.in:
3350         * css/parser/CSSPropertyParser.cpp:
3351         (WebCore::consumeSteps):
3352         (WebCore::consumeFrames):
3353         (WebCore::consumeAnimationTimingFunction):
3354         * platform/animation/TimingFunction.cpp:
3355         (WebCore::operator<<):
3356         (WebCore::TimingFunction::transformTime const):
3357         * platform/animation/TimingFunction.h:
3358         (WebCore::TimingFunction::isFramesTimingFunction const):
3359         * platform/graphics/ca/GraphicsLayerCA.cpp:
3360         (WebCore::animationHasFramesTimingFunction):
3361         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
3362
3363 2018-01-12  Commit Queue  <commit-queue@webkit.org>
3364
3365         Unreviewed, rolling out r226721.
3366         https://bugs.webkit.org/show_bug.cgi?id=181583
3367
3368         Lets do a slightly different fix (Requested by anttik on
3369         #webkit).
3370
3371         Reverted changeset:
3372
3373         "REGRESSION(r225650): The scores of MotionMark tests Multiply
3374         and Leaves dropped by 8%"
3375         https://bugs.webkit.org/show_bug.cgi?id=181460
3376         https://trac.webkit.org/changeset/226721
3377
3378 2018-01-11  Keith Miller  <keith_miller@apple.com>
3379
3380         Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION
3381         https://bugs.webkit.org/show_bug.cgi?id=181573
3382
3383         Reviewed by Simon Fraser.
3384
3385         * Configurations/FeatureDefines.xcconfig:
3386
3387 2018-01-11  Jiewen Tan  <jiewen_tan@apple.com>
3388
3389         [WebAuthN] Import a CBOR coder from Chromium
3390         https://bugs.webkit.org/show_bug.cgi?id=181522
3391         <rdar://problem/36055729>
3392
3393         Reviewed by Brent Fulgham.
3394
3395         This patch imports a CBOR coder including encoder and decoder from Chromium. CBOR encoder
3396         is needed for WebAuthN to encode attestation object into binaries. When supporting extensions
3397         in the future, CBOR encoder/decoder will be needed as well. Implementating and maintaining
3398         a fully-fledged CBOR coder doesn't seem to align with WebKit's best interests. Therefore,
3399         importing a most suitable third party implementation will be wise.
3400
3401         In this patch, it fully integrate the whole coder into our codebase. Those changes includes:
3402             1. Substitute data structures that enjoy a better WTF version.
3403             2. Replacing marcos.
3404             3. Implementating workarounds for some functionalities that we lack fundamental types' support.
3405             4. Changing the coding style to match ours.
3406
3407         This patch doesn't intend to improve the logic of the original codebase. Hence some of the
3408         coding logic might not match what WebKit ususally has.
3409
3410         Here is a full list of Chromium changes that constructed this CBOR coder in chronological order:
3411