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