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