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