Storage Access API: Turn feature on by default in Settings.yaml
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-01-04  John Wilander  <wilander@apple.com>
2
3         Storage Access API: Turn feature on by default in Settings.yaml
4         https://bugs.webkit.org/show_bug.cgi?id=181298
5         <rdar://problem/36302506>
6
7         Reviewed by Brent Fulgham.
8
9         No new tests. This is just a feature settings change.
10
11         * page/Settings.yaml:
12
13 2018-01-04  Zalan Bujtas  <zalan@apple.com>
14
15         WebContent process crashes while loading https://www.classicspecs.com
16         https://bugs.webkit.org/show_bug.cgi?id=181290
17         <rdar://problem/36225906>
18
19         Reviewed by Simon Fraser.
20
21         Floats can overhang multiple blocks (they are called intruding floats).
22         Each block keeps track of such intruding floats. When an overhanging float box is destroyed,
23         we need to deregister it from all those blocks. We do it by walking up the ancestor block chain
24         and check if the parent (grandparent etc) block still contains this float. Once we find the topmost block, 
25         we start deregistering it by traversing back on the descendant blocks.
26         Normally we do it in RenderElement::takeChildInternal right before the box is getting detached.
27         However in certain cases (like when the float's parent happens to be an anonymous wrapper)
28         by the time we get to ::takeChildInternal the subtree is already detached and we can't access all the
29         ancestors.
30         This patch ensure that the floating box is still attached during de-registration. 
31
32         Test: fast/block/float/crash-when-intruding-float-has-anonymous-parent-and-detach.html
33
34         * rendering/RenderObject.cpp:
35         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
36
37 2018-01-04  Eric Carlson  <eric.carlson@apple.com>
38
39         [MediaStream] Add Mock screen capture source
40         https://bugs.webkit.org/show_bug.cgi?id=181291
41         <rdar://problem/36298164>
42
43         Reviewed by Dean Jackson.
44
45         Tests:  http/tests/media/media-stream/get-display-media-prompt.html
46                 GetDisplayMediaTest.BasicPrompt
47                 GetDisplayMediaTest.Constraints
48
49         * Modules/mediastream/MediaDevices.cpp:
50         (WebCore::MediaDevices::MediaDevices): Add static_assert to ensure MediaDevices::DisplayCaptureSurfaceType
51         and RealtimeMediaSourceSettings::DisplaySurfaceType values are equivalent.
52         (WebCore::MediaDevices::getSupportedConstraints): Remove bogus code.
53         * Modules/mediastream/MediaDevices.h: Add DisplayCaptureSurfaceType.
54         * Modules/mediastream/MediaDevices.idl: Ditto.
55
56         * Modules/mediastream/MediaStreamTrack.cpp:
57         (WebCore::MediaStreamTrack::getSettings const): Add a FIXME.
58         * Modules/mediastream/MediaStreamTrack.h: Add displaySurface and logicalSurface.
59
60         * Modules/mediastream/MediaTrackSupportedConstraints.h: Remove displaySurface and logicalSurface.
61         * Modules/mediastream/MediaTrackSupportedConstraints.idl:
62
63         * SourcesCocoa.txt: Add DisplayCaptureManagerCocoa.cpp and DisplayCaptureSourceCocoa.cpp.
64
65         * WebCore.xcodeproj/project.pbxproj: Ditto.
66
67         * platform/mediastream/CaptureDevice.h:
68         (WebCore::CaptureDevice::encode const): Add.
69         (WebCore::CaptureDevice::decode):
70
71         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
72         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): Include display capture "devices".
73         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Deal with display capture devices.
74         (WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID): Ditto.
75         * platform/mediastream/RealtimeMediaSourceCenter.h:
76
77         * platform/mediastream/RealtimeMediaSourceSettings.h:
78         (WebCore::RealtimeMediaSourceSettings::displaySurface const): Return a DisplaySurfaceType.
79         (WebCore::RealtimeMediaSourceSettings::setDisplaySurface): Take a DisplaySurfaceType.
80
81         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
82         (WebCore::DisplayCaptureManagerCocoa::singleton):
83         (WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa):
84         (WebCore::DisplayCaptureManagerCocoa::captureDevices):
85         (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID):
86         (WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID):
87         * platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
88
89         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: Added.
90         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
91         (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
92         (WebCore::DisplayCaptureSourceCocoa::capabilities const):
93         (WebCore::DisplayCaptureSourceCocoa::settings const):
94         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
95         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
96         (WebCore::DisplayCaptureSourceCocoa::stopProducingData):
97         (WebCore::DisplayCaptureSourceCocoa::elapsedTime):
98         (WebCore::DisplayCaptureSourceCocoa::applyFrameRate):
99         (WebCore::DisplayCaptureSourceCocoa::emitFrame):
100         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
101
102         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
103         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureDeviceManager): New.
104         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
105
106         * platform/mock/MockRealtimeMediaSource.cpp:
107         (WebCore::deviceMap): Add screen capture "devices".
108         (WebCore::MockRealtimeMediaSource::displayDevices): New.
109         * platform/mock/MockRealtimeMediaSource.h:
110
111         * platform/mock/MockRealtimeMediaSourceCenter.cpp: Clean up includes.
112         * platform/mock/MockRealtimeMediaSourceCenter.h:
113
114         * platform/mock/MockRealtimeVideoSource.cpp:
115         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Mock two screen devices.
116         (WebCore::MockRealtimeVideoSource::updateSettings): Deal with mock screens.
117         (WebCore::MockRealtimeVideoSource::initializeCapabilities): Ditto.
118         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Ditto.
119         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
120         (WebCore::MockRealtimeVideoSource::generateFrame): Ditto.
121         * platform/mock/MockRealtimeVideoSource.h:
122         (WebCore::MockRealtimeVideoSource::mockCamera const):
123         (WebCore::MockRealtimeVideoSource::mockScreen const):
124
125 2018-01-04  Youenn Fablet  <youenn@apple.com>
126
127         FetchResponse should set its internal response text encoding name
128         https://bugs.webkit.org/show_bug.cgi?id=181284
129
130         Reviewed by Alex Christensen.
131
132         Covered by rebased test.
133
134         * Modules/fetch/FetchResponse.cpp:
135         (WebCore::FetchResponse::create): Set response text encoding based on content type charset.
136
137 2018-01-04  John Wilander  <wilander@apple.com>
138
139         Storage Access API: Remove JavaScript confirm() prompt from Document::requestStorageAccess()
140         https://bugs.webkit.org/show_bug.cgi?id=181276
141         <rdar://problem/36290463>
142
143         Reviewed by Alex Christensen.
144
145         No new tests. Existing test expectations updated.
146
147         * dom/Document.cpp:
148         (WebCore::Document::requestStorageAccess):
149
150 2018-01-04  Carlos Garcia Campos  <cgarcia@igalia.com>
151
152         [GTK] Issues with Ahem's ex / x-height
153         https://bugs.webkit.org/show_bug.cgi?id=180581
154
155         Reviewed by Michael Catanzaro.
156
157         Get the x-height value from the TT_OS2 table if available.
158
159         Fixes: fast/text/break-word-pre-wrap.html
160                imported/w3c/web-platform-tests/css/css-shapes-1/shape-outside/values/shape-outside-shape-arguments-000.html
161
162         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
163         (WebCore::Font::platformInit):
164
165 2018-01-04  Philippe Normand  <pnormand@igalia.com>
166
167         Unreviewed, GTK build fix attempt after r226357
168
169         * platform/graphics/gstreamer/GStreamerUtilities.h: The
170         GST_BUFFER_DTS_OR_PTS macro was added in GStreamer 1.8 but old
171         versions of Debian might not have this release yet.
172
173 2018-01-04  Youenn Fablet  <youenn@apple.com>
174
175         Implement Cache API partitioning based on ClientOrigin
176         https://bugs.webkit.org/show_bug.cgi?id=181240
177
178         Reviewed by Alex Christensen.
179
180         Covered by updated tests.
181
182         Previously, cache storage was partitioned according the origin of the client, represented as a String.
183         We now partition according both client and top origins, represented as a ClientOrigin
184
185         Minor refactoring to use more makePendingActivity.
186         Added support for IPC serialization of ClientOrigin.
187         Added SecurityOriginData::toString which is used by WebKit2 Cache Storage implementation.
188
189         * Modules/cache/CacheStorageConnection.cpp:
190         (WebCore::CacheStorageConnection::open):
191         (WebCore::CacheStorageConnection::retrieveCaches):
192         * Modules/cache/CacheStorageConnection.h:
193         (WebCore::CacheStorageConnection::clearMemoryRepresentation):
194         (WebCore::CacheStorageConnection::doOpen):
195         (WebCore::CacheStorageConnection::doRetrieveCaches):
196         * Modules/cache/DOMCacheStorage.cpp:
197         (WebCore::DOMCacheStorage::origin const):
198         (WebCore::DOMCacheStorage::retrieveCaches):
199         (WebCore::DOMCacheStorage::open):
200         (WebCore::DOMCacheStorage::remove):
201         * Modules/cache/DOMCacheStorage.h:
202         * Modules/cache/WorkerCacheStorageConnection.cpp:
203         (WebCore::WorkerCacheStorageConnection::doOpen):
204         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
205         * Modules/cache/WorkerCacheStorageConnection.h:
206         * page/ClientOrigin.h:
207         (WebCore::ClientOrigin::isolatedCopy const):
208         (WebCore::ClientOrigin::encode const):
209         (WebCore::ClientOrigin::decode):
210         * page/SecurityOriginData.cpp:
211         (WebCore::SecurityOriginData::toString const):
212         (WebCore::SecurityOriginData::debugString const): Deleted.
213         * page/SecurityOriginData.h:
214         (WebCore::SecurityOriginData::debugString const):
215         * testing/Internals.cpp:
216         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
217
218 2018-01-04  Youenn Fablet  <youenn@apple.com>
219
220         Service Worker should expose redirect mode for navigation loads as manual
221         https://bugs.webkit.org/show_bug.cgi?id=181067
222
223         Reviewed by Alex Christensen.
224
225         Covered by rebased tests.
226
227         * loader/CrossOriginAccessControl.cpp: Removing ContentType header only if affecting CORS checks.
228         This allows extending header filtering in service worker to all modes, including Navigate.
229         * workers/service/context/ServiceWorkerFetch.cpp:
230         (WebCore::ServiceWorkerFetch::dispatchFetchEvent): Ideally, document loading code should set redirect to manual.
231         Since it is not the case yet and that would require changes to various places, manual is set before exposing the corresponding fetch event.
232
233 2018-01-04  Youenn Fablet  <youenn@apple.com>
234
235         ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope should be a no-op if worker is being terminated
236         https://bugs.webkit.org/show_bug.cgi?id=181245
237
238         Reviewed by Alex Christensen.
239
240         Stop appending tasks to a terminating worker and returning false in that case.
241         This mirrors what is done for regular workers.
242
243         * workers/service/context/SWContextManager.cpp:
244         (WebCore::SWContextManager::terminateWorker):
245         * workers/service/context/ServiceWorkerThreadProxy.cpp:
246         (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
247         * workers/service/context/ServiceWorkerThreadProxy.h:
248
249 2018-01-04  Youenn Fablet  <youenn@apple.com>
250
251         Cancel pending script loads when service worker is being terminated
252         https://bugs.webkit.org/show_bug.cgi?id=181250
253
254         Reviewed by Alex Christensen.
255
256         Covered by service worker tests no longer crashing in ASAN builds.
257
258         * workers/WorkerScriptLoader.cpp:
259         (WebCore::WorkerScriptLoader::notifyFinished): Clearing loader when finished.
260         (WebCore::WorkerScriptLoader::cancel): Implementing cancel of a script loader by cancelling the underlying threadable loader.
261         * workers/WorkerScriptLoader.h:
262         * workers/service/ServiceWorkerContainer.cpp: Canceling loads of all pending jobs.
263         (WebCore::ServiceWorkerContainer::stop):
264         * workers/service/ServiceWorkerJob.cpp:
265         (WebCore::ServiceWorkerJob::cancelPendingLoad):
266         * workers/service/ServiceWorkerJob.h:
267
268 2018-01-04  Youenn Fablet  <youenn@apple.com>
269
270         Implement  https://fetch.spec.whatwg.org/#main-fetch default referrer policy setting
271         https://bugs.webkit.org/show_bug.cgi?id=181239
272
273         Reviewed by Alex Christensen.
274
275         Covered by updated and rebased test.
276
277         Setting the request referrer policy to the Document referrer policy if no one is set.
278         If Document has no referrer policy, use no-referrer-when-downgrade as per the spec.
279
280         * loader/cache/CachedResourceLoader.cpp:
281         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
282         (WebCore::CachedResourceLoader::requestResource):
283         * loader/cache/CachedResourceLoader.h:
284         * loader/cache/CachedResourceRequest.cpp:
285         (WebCore::CachedResourceRequest::updateReferrerPolicy):
286         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
287         * loader/cache/CachedResourceRequest.h:
288
289 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
290
291         [Attachment Support] Create attachment elements when dropping files on iOS
292         https://bugs.webkit.org/show_bug.cgi?id=181192
293         <rdar://problem/36280945>
294
295         Reviewed by Tim Horton.
296
297         Implements support for dropping data as attachment elements on iOS. See comments below for more detail.
298
299         Tests:  WKAttachmentTests.InsertDroppedRichAndPlainTextFilesAsAttachments
300                 WKAttachmentTests.InsertDroppedZipArchiveAsAttachment
301                 WKAttachmentTests.InsertDroppedItemProvidersInOrder
302
303         * WebCore.xcodeproj/project.pbxproj:
304         * editing/WebContentReader.cpp:
305         (WebCore::WebContentReader::ensureFragment):
306
307         Add a new helper to create the WebContentReader's fragment, if it hasn't already been created.
308
309         * editing/WebContentReader.h:
310         * editing/cocoa/WebContentReaderCocoa.mm:
311         (WebCore::WebContentReader::readFilePaths):
312
313         Rename readFilenames to readFilePaths (which better reflects its parameters, which are file paths). Also, move
314         the implementation of readFilePaths to shared iOS/macOS code in WebContentReaderCocoa, and remove the stub
315         implementation on iOS.
316
317         There's a bit of code here that I kept macOS-only which deals with inserting file paths as plain text in
318         editable areas, but it's unclear to me why and if WebKit clients currently find this useful, so I left a FIXME
319         to investigate removing this altogether. Code for handling this plain text insertion of file paths on Mac was
320         introduced in r67403.
321
322         * editing/ios/WebContentReaderIOS.mm:
323         (WebCore::WebContentReader::readFilenames): Deleted.
324         * editing/mac/WebContentReaderMac.mm:
325         (WebCore::WebContentReader::readFilenames): Deleted.
326         * page/mac/DragControllerMac.mm:
327         (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
328
329         Teach DragController to accept all types conforming to "public.item" and "public.content" on iOS, only when
330         attachment elements are enabled. This allows us to load content from item providers that we otherwise would not
331         have loaded, since we now have the ability to fall back to attachment element insertion if the type is not have
332         a default representation using standard web content.
333
334         * platform/Pasteboard.h:
335         * platform/PasteboardItemInfo.h: Added.
336         (WebCore::PasteboardItemInfo::encode const):
337         (WebCore::PasteboardItemInfo::decode):
338
339         Add PasteboardItemInfo, a struct that describes an item on the pasteboard. Also, implement encoding and decoding
340         support for PasteboardItemInfo. So far, the item info only describes file information about the pasteboard item,
341         and flags indicating whether the item prefers attachment or inline presentation.
342
343         * platform/PasteboardStrategy.h:
344
345         Replace getFilenamesForDataInteraction with informationForItemAtIndex. Instead of returning all of the file
346         paths associated with any item on the pasteboard, fetch a PasteboardItemInfo at a given item index, which
347         includes information about the file path as well as some other metadata we'll need when deciding how to read
348         pasteboard contents as a document fragment.
349
350         * platform/PlatformPasteboard.h:
351         * platform/cocoa/PasteboardCocoa.mm:
352         (WebCore::Pasteboard::read):
353         * platform/ios/AbstractPasteboard.h:
354         * platform/ios/PasteboardIOS.mm:
355         (WebCore::Pasteboard::read):
356         (WebCore::Pasteboard::readRespectingUTIFidelities):
357
358         Teach the iOS Pasteboard to read web content using attachment elements, if enabled. There are two scenarios in
359         which we would want to insert an attachment element:
360         (1) The item provider uses a preferred presentation style of attachment, in which case we bail out of trying to
361             handle the drop using the default mechanisms, and simply insert it as an attachment. We need this to deal
362             with the case where we drop text or HTML files from the Files app, so that we don't try and insert the
363             contents of the text or HTML as inline web content.
364         (2) The item provider doesn't have a preferred attachment presentation style, but there's nothing WebKit would
365             otherwise do with the dropped content, so insert an attachment element as a fallback. Examples where this is
366             relevant are dropping a PDF or ZIP archive without attachment presentation style explicitly set.
367         We first check if we fall into case (1). If so, we can bail early by inserting an attachment; otherwise, we
368         proceed normally and see if we can read the contents of the drop as web content. If, at the end of default drop
369         handling, we don't still have a way to represent the dropped content, enter case (2).
370
371         (WebCore::Pasteboard::readFilePaths):
372         (WebCore::Pasteboard::readFilenames): Deleted.
373
374         Rename readFilenames to readFilePaths, and reimplement it using informationForItemAtIndex.
375
376         * platform/ios/PlatformPasteboardIOS.mm:
377         (WebCore::pasteboardItemPresentationStyle):
378         (WebCore::PlatformPasteboard::informationForItemAtIndex):
379         (WebCore::PlatformPasteboard::filenamesForDataInteraction): Deleted.
380
381         Implement informationForItemAtIndex and remove filenamesForDataInteraction. As before, we ask the pasteboard
382         (i.e. WebItemProviderPasteboard) for information about dropped file URLs. This time, we limit this to a single
383         file, so we don't end up creating multiple attachment elements for each representation of a single item
384         provider. See below for -preferredFileUploadURLAtIndex:fileType: for more detail.
385
386         * platform/ios/WebItemProviderPasteboard.h:
387         * platform/ios/WebItemProviderPasteboard.mm:
388         (-[WebItemProviderLoadResult initWithItemProvider:typesToLoad:]):
389         (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
390
391         Remove this synthesized instance variable and instead just check the item provider's preferredPresentationStyle.
392
393         (-[WebItemProviderLoadResult description]):
394
395         Add a verbose -description to the load result object. Useful for debugging what was content was loaded from an
396         item provider on drop.
397
398         (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]):
399
400         Return the highest fidelity loaded type identifier for a given item.
401
402         (-[WebItemProviderPasteboard allDroppedFileURLs]):
403         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
404
405         Prefer flat RTFD to RTFD. In the case where attachments are enabled and we're accepting all types of content
406         using attachment elements as a fallback representation, if the source writes attributed strings to the
407         pasteboard with com.apple.rtfd at a higher fidelity than com.apple.flat-rtfd, we'll end up loading only
408         com.apple.rtfd and dropping the text as an attachment element because we cannot convert the dropped content to
409         markup. Instead, if flat RTFD is present in the item provider, always prefer that over RTFD so that dropping as
410         regular web content isn't overridden when attachment elements are enabled.
411
412         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
413         (-[WebItemProviderPasteboard droppedFileURLs]): Deleted.
414         * platform/mac/DragDataMac.mm:
415         (WebCore::DragData::containsCompatibleContent const):
416
417         DragData::containsCompatibleContent should be true when attachment elements are enabled, and there are files we
418         can drop as attachment elements.
419
420         * platform/mac/PasteboardMac.mm:
421         (WebCore::Pasteboard::read):
422         (WebCore::Pasteboard::readFilePaths):
423         (WebCore::Pasteboard::readFilenames): Deleted.
424
425 2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>
426
427         Replace hard-coded paths in shebangs with #!/usr/bin/env
428         https://bugs.webkit.org/show_bug.cgi?id=181040
429
430         Reviewed by Alex Christensen.
431
432         * bindings/scripts/InFilesCompiler.pm:
433         * bindings/scripts/InFilesParser.pm:
434         * bindings/scripts/generate-bindings-all.pl:
435         * bindings/scripts/generate-bindings.pl:
436         * bindings/scripts/preprocess-idls.pl:
437         * css/make-css-file-arrays.pl:
438         * css/makeprop.pl:
439         * css/makevalues.pl:
440         * dom/make_event_factory.pl:
441         * dom/make_names.pl:
442         * extract-localizable-strings.pl:
443         * make-hash-tools.pl:
444
445 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
446
447         [Attachment Support] Add plumbing for starting a drag with promised blob data
448         https://bugs.webkit.org/show_bug.cgi?id=181201
449
450         Reviewed by Tim Horton.
451
452         Adds logic to allow dragging an attachment element as a file by sending promised blob information to the UI
453         process. See comments below for more detail.
454
455         The only change in behavior is that dragging an attachment element will no longer write web content and injected
456         bundle data to the pasteboard if the attachment element's file attribute is nonnull. This will cause one
457         existing WK1 layout test to fail, but will otherwise not affect any attachment editing clients. On iOS,
458         attachment elements in the Mail viewer can be dragged, but each attachment's file is null, so we fall back to
459         current behavior; on macOS, Mail currently overrides the drag completely, beginning at -mouseDown:, so this
460         doesn't make a difference to macOS Mail either.
461
462         * editing/Editor.h:
463         * editing/cocoa/EditorCocoa.mm:
464         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
465
466         Add a helper method to retrieve an attachment element as web archive data, for moving attachments within the
467         same document. Also gives the injected editor bundle a chance to supply custom pasteboard types.
468
469         * loader/EmptyClients.cpp:
470         * page/DragClient.h:
471         (WebCore::DragClient::prepareToDragPromisedBlob):
472
473         Add new DragClient methods to send information about a promised blob to the UI process.
474
475         * page/DragController.cpp:
476         (WebCore::DragController::startDrag):
477
478         Call dragAttachmentElement when starting a drag on an attachment element.
479
480         (WebCore::DragController::dragAttachmentElement):
481
482         Try to begin dragging a given attachment element, propagating promised blob information to the client layers.
483         Returns true iff the attachment is backed by blob data (i.e. the file is nonnull).
484
485         * platform/PromisedBlobInfo.h:
486
487         Add a list of additional types and data to PromisedBlobInfo. In addition to the promised blob info, this would
488         allow injected bundle data and other private types alongside the main attachment data on the pasteboard.
489
490 2018-01-03  Simon Fraser  <simon.fraser@apple.com>
491
492         Remove the 'resolutionScale' parameter from ImageBufferDataCG get/putBytes
493         https://bugs.webkit.org/show_bug.cgi?id=181268
494
495         Reviewed by Alex Christensen.
496
497         These functions were always called with resolutionScale=1.
498
499         * platform/graphics/cg/ImageBufferCG.cpp:
500         (WebCore::ImageBuffer::getUnmultipliedImageData const):
501         (WebCore::ImageBuffer::getPremultipliedImageData const):
502         (WebCore::ImageBuffer::putByteArray):
503         * platform/graphics/cg/ImageBufferDataCG.cpp:
504         (WebCore::ImageBufferData::getData const):
505         (WebCore::ImageBufferData::putData):
506         (WebCore::affineWarpBufferData): Deleted.
507         * platform/graphics/cg/ImageBufferDataCG.h:
508
509 2018-01-03  John Wilander  <wilander@apple.com>
510
511         Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
512         https://bugs.webkit.org/show_bug.cgi?id=181270
513         <rdar://problem/36289544>
514
515         Reviewed by Alex Christensen.
516
517         No new tests. Existing test re-enabled.
518
519         This change refactors how the web process tells the network process
520         to remove storage access. Previously, this was done over the UI process
521         just like requests for storage access. But since no further reasoning
522         is needed, the message should go straight from the web process to the
523         network process for performance reasons and to minimize the risk of a
524         race.
525
526         As a consequence, the XPC code for storage access removal in the UI
527         process is deleted.
528
529         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
530         (WebCore::NetworkStorageSession::cookieStoragePartition const):
531             Removes the storageAccessAPIEnabled check since the flag
532             doesn't get propagated when the network process is created.
533             Figuring this out will take some work which is unnecessary
534             when we already gate access to the feature in Document.idl.
535
536 2018-01-03  James Craig  <jcraig@apple.com>
537
538         AX: when invert colors is on, double-invert certain media elements in UserAgentStyleSheet
539         https://bugs.webkit.org/show_bug.cgi?id=168447
540         <rdar://problem/30559874>
541
542         Reviewed by Simon Fraser.
543
544         Double-invert video when platform 'invert colors' setting is enabled. Behavior matches 
545         current 'Smart Invert' feature of Safari Reader on macOS/iOS and other iOS native apps.
546
547         Tests: accessibility/smart-invert-reference.html
548                accessibility/smart-invert.html
549
550         * Modules/modern-media-controls/controls/media-controls.css:
551         (@media (inverted-colors)):
552         (:host):
553         (picture):
554         * css/html.css:
555         (@media (inverted-colors)):
556         (video):
557
558 2018-01-03  Youenn Fablet  <youenn@apple.com>
559
560         LayoutTest http/tests/media/media-stream/disconnected-frame.html to consistently fail an assertion: !m_adoptionIsRequired
561         https://bugs.webkit.org/show_bug.cgi?id=181264
562
563         Reviewed by Eric Carlson.
564
565         Covered by http/tests/media/media-stream/disconnected-frame.html not crashing anymore in Debug builds.
566         Calling suspendIfNeeded in create method instead of constructor.
567
568         * Modules/mediastream/UserMediaRequest.cpp:
569         (WebCore::UserMediaRequest::create):
570         (WebCore::UserMediaRequest::UserMediaRequest):
571
572 2018-01-03  Antti Koivisto  <antti@apple.com>
573
574         Remove DeprecatedCSSOMValue::equals
575         https://bugs.webkit.org/show_bug.cgi?id=181241
576
577         Reviewed by Zalan Bujtas.
578
579         This is dead code.
580
581         * css/DeprecatedCSSOMValue.cpp:
582         (WebCore::compareCSSOMValues): Deleted.
583         (WebCore::DeprecatedCSSOMValue::equals const): Deleted.
584         * css/DeprecatedCSSOMValue.h:
585         (WebCore::DeprecatedCSSOMValue::operator== const): Deleted.
586         (WebCore::DeprecatedCSSOMComplexValue::equals const): Deleted.
587         * css/DeprecatedCSSOMValueList.cpp:
588         (WebCore::DeprecatedCSSOMValueList::equals const): Deleted.
589         * css/DeprecatedCSSOMValueList.h:
590
591 2018-01-03  Simon Fraser  <simon.fraser@apple.com>
592
593         feLighting is broken with primitiveUnits="objectBoundingBox"
594         https://bugs.webkit.org/show_bug.cgi?id=181197
595
596         Reviewed by Tim Horton.
597
598         With <filter primitiveUnits="objectBoundingBox"> we need to convert the coordinates
599         of fePointLights and feSpotLights into user space coordinates. Following
600         https://www.w3.org/TR/SVG/filters.html#FilterElementPrimitiveUnitsAttribute
601         this is done by treating them as fractions of the bounding box on the referencing
602         element, with treatment for z following https://www.w3.org/TR/SVG/coords.html#Units_viewport_percentage
603         
604         To do this, store the bounds of the referencing elemenet on SVGFilterBuilder as
605         targetBoundingBox, and store the primitiveUnits type. Then do the conversion of lighting
606         coordinates in SVGFESpecularLightingElement::build() and SVGFEDiffuseLightingElement::build().
607
608         Remove SVGFELightElement::findLightSource(), since we need to be able to pass the SVGFilterBuilder
609         to the lightSource() function so hoist the code up.
610
611         Tests: svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
612                svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
613                svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox-expected.svg
614                svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox.svg
615                svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
616                svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
617
618         * rendering/svg/RenderSVGResourceFilter.cpp:
619         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
620         * svg/SVGFEDiffuseLightingElement.cpp:
621         (WebCore::SVGFEDiffuseLightingElement::build):
622         * svg/SVGFEDistantLightElement.cpp:
623         (WebCore::SVGFEDistantLightElement::lightSource const):
624         * svg/SVGFEDistantLightElement.h:
625         * svg/SVGFELightElement.cpp:
626         (WebCore::SVGFELightElement::findLightSource): Deleted.
627         * svg/SVGFELightElement.h:
628         * svg/SVGFEPointLightElement.cpp:
629         (WebCore::SVGFEPointLightElement::lightSource const):
630         * svg/SVGFEPointLightElement.h:
631         * svg/SVGFESpecularLightingElement.cpp:
632         (WebCore::SVGFESpecularLightingElement::build):
633         * svg/SVGFESpotLightElement.cpp:
634         (WebCore::SVGFESpotLightElement::lightSource const):
635         * svg/SVGFESpotLightElement.h:
636         * svg/graphics/filters/SVGFilterBuilder.h:
637         (WebCore::SVGFilterBuilder::setTargetBoundingBox):
638         (WebCore::SVGFilterBuilder::targetBoundingBox const):
639         (WebCore::SVGFilterBuilder::primitiveUnits const):
640         (WebCore::SVGFilterBuilder::setPrimitiveUnits):
641
642 2018-01-03  Antti Koivisto  <antti@apple.com>
643
644         Crash beneath CSSValue::equals @ csas.cz
645         https://bugs.webkit.org/show_bug.cgi?id=181243
646         <rdar://problem/35990826>
647
648         Reviewed by Alex Christensen.
649
650         Test: fast/text/oblique-degree-equals-crash.html
651
652         * css/CSSFontStyleValue.cpp:
653         (WebCore::CSSFontStyleValue::equals const):
654
655         Null check both oblique pointers.
656
657 2018-01-03  Joseph Pecoraro  <pecoraro@apple.com>
658
659         Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
660         https://bugs.webkit.org/show_bug.cgi?id=180979
661         <rdar://problem/36146670>
662
663         Reviewed by Matt Baker.
664
665         * platform/graphics/cocoa/FontCacheCoreText.cpp:
666         (fontNameIsSystemFont):
667         (WebCore::FontCache::systemFontFamilies):
668         Switch to the original Mac algorithm before r180979 that uses
669         CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
670         available on iOS but now it is. This is a performance improvement on
671         both platforms, but significantly so on macOS. It also finds more,
672         valid, family names.
673
674 2018-01-03  Michael Catanzaro  <mcatanzaro@igalia.com>
675
676         ASSERTION FAILED: !source || is<Target>(*source) in CoordinatedGraphicsLayer::removeFromParent
677         https://bugs.webkit.org/show_bug.cgi?id=166568
678
679         Reviewed by Simon Fraser.
680
681         When a GraphicsLayer has a mask layer, it fails to properly unparent the mask layer before
682         it is destroyed. This leaves the mask layer with a dangling parent pointer. Fix it, while
683         taking care not to introduce yet another virtual function call during the execution of the
684         destructor.
685
686         * platform/graphics/GraphicsLayer.cpp:
687         (WebCore::GraphicsLayer::willBeDestroyed):
688
689 2018-01-03  Simon Fraser  <simon.fraser@apple.com>
690
691         SVG lighting filter lights are in the wrong coordinate system
692         https://bugs.webkit.org/show_bug.cgi?id=181147
693
694         Reviewed by Zalan Bujtas.
695
696         Point and spot light coordinates weren't being converted into buffer-relative
697         coordinates before being fed into the lighting math, resulting in incorrect light
698         rendering on Retina devices, and when the filter primitive region was clipped.
699
700         Fix by storing absoluteUnclippedSubregion on FilterEffect, which allows us to map
701         lighting points from user space coordinates into the coordinates of the buffer being
702         used for rendering. Also scale the light z coordinate by doing a dummy point mapping in x.
703
704         Rename members of PointLightSource and SpotLightSource to make it clear which coordinate
705         system they are in.
706
707         Tests include HiDPI tests.
708
709         Tests: svg/filters/fePointLight-coordinates-expected.svg
710                svg/filters/fePointLight-coordinates.svg
711                svg/filters/feSpotLight-coordinates-expected.svg
712                svg/filters/feSpotLight-coordinates.svg
713                svg/filters/hidpi/fePointLight-coordinates-expected.svg
714                svg/filters/hidpi/fePointLight-coordinates.svg
715                svg/filters/hidpi/feSpotLight-coordinates-expected.svg
716                svg/filters/hidpi/feSpotLight-coordinates.svg
717
718         * platform/graphics/FloatPoint3D.h: Make it easy to get and set the X and Y coords as a FloatPoint.
719         (WebCore::FloatPoint3D::xy const):
720         (WebCore::FloatPoint3D::setXY):
721         * platform/graphics/GeometryUtilities.cpp:
722         (WebCore::mapPoint):
723         (WebCore::mapRect):
724         * platform/graphics/GeometryUtilities.h: Helper to make a point between rects.
725         * platform/graphics/filters/DistantLightSource.cpp:
726         (WebCore::DistantLightSource::initPaintingData):
727         * platform/graphics/filters/DistantLightSource.h:
728         * platform/graphics/filters/FELighting.cpp:
729         (WebCore::FELighting::drawLighting):
730         * platform/graphics/filters/FilterEffect.cpp:
731         (WebCore::FilterEffect::mapPointFromUserSpaceToBuffer const):
732         * platform/graphics/filters/FilterEffect.h:
733         (WebCore::FilterEffect::setUnclippedAbsoluteSubregion):
734         * platform/graphics/filters/LightSource.h:
735         * platform/graphics/filters/PointLightSource.cpp:
736         (WebCore::PointLightSource::initPaintingData):
737         (WebCore::PointLightSource::computePixelLightingData const):
738         (WebCore::PointLightSource::setX):
739         (WebCore::PointLightSource::setY):
740         (WebCore::PointLightSource::setZ):
741         * platform/graphics/filters/PointLightSource.h:
742         (WebCore::PointLightSource::position const):
743         (WebCore::PointLightSource::PointLightSource):
744         * platform/graphics/filters/SpotLightSource.cpp:
745         (WebCore::SpotLightSource::initPaintingData):
746         (WebCore::SpotLightSource::computePixelLightingData const):
747         (WebCore::SpotLightSource::setX):
748         (WebCore::SpotLightSource::setY):
749         (WebCore::SpotLightSource::setZ):
750         (WebCore::SpotLightSource::setPointsAtX):
751         (WebCore::SpotLightSource::setPointsAtY):
752         (WebCore::SpotLightSource::setPointsAtZ):
753         * platform/graphics/filters/SpotLightSource.h:
754         (WebCore::SpotLightSource::position const):
755         (WebCore::SpotLightSource::direction const):
756         (WebCore::SpotLightSource::SpotLightSource):
757         * rendering/svg/RenderSVGResourceFilter.cpp:
758         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
759         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
760         (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
761
762 2018-01-03  Youenn Fablet  <youenn@apple.com>
763
764         Select service worker for documents with data/blob URLS
765         https://bugs.webkit.org/show_bug.cgi?id=181213
766
767         Reviewed by Alex Christensen.
768
769         Covered by updated test.
770
771         Reusing the service worker of the parent for blob/data URL documents.
772
773         * loader/DocumentLoader.cpp:
774         (WebCore::isLocalURL):
775         (WebCore::DocumentLoader::commitData):
776
777 2018-01-03  Ryan Haddad  <ryanhaddad@apple.com>
778
779         Unreviewed, rolling out r226352.
780
781         Breaks Sierra and El Capitan builds.
782
783         Reverted changeset:
784
785         "Web Inspector: Slow open time enumerating system fonts
786         (FontCache::systemFontFamilies)"
787         https://bugs.webkit.org/show_bug.cgi?id=180979
788         https://trac.webkit.org/changeset/226352
789
790 2018-01-03  Philippe Normand  <pnormand@igalia.com>
791
792         [GStreamer] The bus synchronous handler should be in the base player class
793         https://bugs.webkit.org/show_bug.cgi?id=181237
794
795         Reviewed by Carlos Garcia Campos.
796
797         Because this is where video rendering is handled.
798
799         No new tests, this is only a refactoring.
800
801         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
802         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
803         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
804         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
805
806 2018-01-03  Philippe Normand  <pnormand@igalia.com>
807
808         [GStreamer] move MediaSample implementation out of mse/
809         https://bugs.webkit.org/show_bug.cgi?id=179165
810
811         Reviewed by Carlos Garcia Campos.
812
813         This module isn't specific to MSE and can potentially be reused
814         elsewhere, for WebRTC for instance. Additionally the
815         ::platformSample() method was implemented and the code was cleaned up.
816
817         * platform/GStreamer.cmake:
818         * platform/MediaSample.h:
819         * platform/graphics/gstreamer/GStreamerMediaSample.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp.
820         (WebCore::GStreamerMediaSample::platformSample):
821         * platform/graphics/gstreamer/GStreamerMediaSample.h: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.h.
822         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
823         (WebCore::PlaybackPipeline::enqueueSample):
824
825 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
826
827         Unreviewed. Fix resource load stats tests on GLib based ports after r226355.
828
829         The monitor can be created in the work queue thread too.
830
831         * platform/glib/FileMonitorGLib.cpp:
832         (WebCore::FileMonitor::FileMonitor):
833
834 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
835
836         [GTK] Crash destroying WebCore::FileMonitor
837         https://bugs.webkit.org/show_bug.cgi?id=181138
838
839         Reviewed by Michael Catanzaro.
840
841         Ensure that platform file monitor is always created and destroyed in the work queue thread synchronously.
842
843         * platform/FileMonitor.h:
844         * platform/glib/FileMonitorGLib.cpp:
845         (WebCore::FileMonitor::FileMonitor):
846         (WebCore::FileMonitor::~FileMonitor):
847         (WebCore::FileMonitor::didChange):
848
849 2018-01-02  Joseph Pecoraro  <pecoraro@apple.com>
850
851         Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
852         https://bugs.webkit.org/show_bug.cgi?id=180979
853         <rdar://problem/36146670>
854
855         Reviewed by Matt Baker.
856
857         * platform/graphics/cocoa/FontCacheCoreText.cpp:
858         (WebCore::FontCache::systemFontFamilies):
859         Switch to the original Mac algorithm before r180979 that uses
860         CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
861         available on iOS but now it is. This is a performance improvement on
862         both platforms, but significantly so on macOS. It also finds more,
863         valid, family names.
864
865 2018-01-02  Yusuke Suzuki  <utatane.tea@gmail.com>
866
867         Unreviewed, fix GCC warning by using #include
868         https://bugs.webkit.org/show_bug.cgi?id=181189
869
870         This file is included in C++ files. Use #include instead of #import to suppress warning in GCC.
871
872         * platform/PromisedBlobInfo.h:
873
874 2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>
875
876         Remove std::chrono completely
877         https://bugs.webkit.org/show_bug.cgi?id=181186
878
879         Reviewed by Alex Christensen.
880
881         Use MonotonicTime, WallTime, and Seconds instead.
882         Changes are mechanical ones. But persistent network cache data is changed.
883         So we bump the version number of the cache storage.
884
885         * Modules/indexeddb/server/IDBServer.cpp:
886         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
887         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
888         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
889         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
890         * Modules/indexeddb/server/IDBServer.h:
891         * Modules/webdatabase/DatabaseTracker.cpp:
892         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
893         * Modules/webdatabase/DatabaseTracker.h:
894         * dom/Document.cpp:
895         (WebCore::Document::lastModified):
896         * html/HTMLMediaElement.cpp:
897         (WebCore::HTMLMediaElement::clearMediaCache):
898         * html/HTMLMediaElement.h:
899         (WebCore::HTMLMediaElement::clearMediaCache):
900         * loader/CrossOriginPreflightResultCache.cpp:
901         (WebCore::parseAccessControlMaxAge):
902         (WebCore::CrossOriginPreflightResultCacheItem::parse):
903         (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest const):
904         * loader/CrossOriginPreflightResultCache.h:
905         * loader/cache/CachedResource.cpp:
906         (WebCore::CachedResource::CachedResource):
907         (WebCore::CachedResource::freshnessLifetime const):
908         (WebCore::CachedResource::responseReceived):
909         (WebCore::CachedResource::updateResponseAfterRevalidation):
910         * loader/cache/CachedResource.h:
911         * platform/FileSystem.cpp:
912         (WebCore::FileSystem::getFileModificationTime):
913         * platform/FileSystem.h:
914         * platform/SearchPopupMenu.h:
915         * platform/cocoa/SearchPopupMenuCocoa.h:
916         * platform/cocoa/SearchPopupMenuCocoa.mm:
917         (WebCore::toSystemClockTime):
918         (WebCore::toNSDateFromSystemClock):
919         (WebCore::removeRecentlyModifiedRecentSearches):
920         * platform/graphics/MediaPlayer.cpp:
921         (WebCore::MediaPlayer::clearMediaCache):
922         * platform/graphics/MediaPlayer.h:
923         * platform/graphics/MediaPlayerPrivate.h:
924         (WebCore::MediaPlayerPrivateInterface::clearMediaCache):
925         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
926         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
927         (WebCore::toSystemClockTime):
928         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
929         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
930         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
931         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
932         * platform/network/CacheValidation.cpp:
933         (WebCore::computeCurrentAge):
934         (WebCore::computeFreshnessLifetimeForHTTPFamily):
935         (WebCore::updateRedirectChainStatus):
936         (WebCore::redirectChainAllowsReuse):
937         (WebCore::parseCacheControlDirectives):
938         * platform/network/CacheValidation.h:
939         (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
940         * platform/network/HTTPParsers.cpp:
941         (WebCore::parseHTTPDate):
942         * platform/network/HTTPParsers.h:
943         * platform/network/PlatformCookieJar.h:
944         * platform/network/ResourceResponseBase.cpp:
945         (WebCore::ResourceResponseBase::cacheControlMaxAge const):
946         (WebCore::parseDateValueInHeader):
947         (WebCore::ResourceResponseBase::date const):
948         (WebCore::ResourceResponseBase::age const):
949         (WebCore::ResourceResponseBase::expires const):
950         (WebCore::ResourceResponseBase::lastModified const):
951         * platform/network/ResourceResponseBase.h:
952         * platform/network/cf/CookieJarCFNet.cpp:
953         (WebCore::deleteAllCookiesModifiedSince):
954         * platform/network/curl/CookieJarCurl.cpp:
955         (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
956         (WebCore::deleteAllCookiesModifiedSince):
957         * platform/network/curl/CookieJarCurl.h:
958         * platform/network/curl/CurlCacheEntry.cpp:
959         (WebCore::CurlCacheEntry::CurlCacheEntry):
960         (WebCore::CurlCacheEntry::isCached):
961         (WebCore::CurlCacheEntry::parseResponseHeaders):
962         * platform/network/curl/CurlCacheEntry.h:
963         * platform/network/mac/CookieJarMac.mm:
964         (WebCore::deleteAllCookiesModifiedSince):
965         * platform/network/soup/CookieJarSoup.cpp:
966         (WebCore::deleteAllCookiesModifiedSince):
967         * platform/win/SearchPopupMenuWin.cpp:
968         (WebCore::SearchPopupMenuWin::loadRecentSearches):
969         * rendering/RenderSearchField.cpp:
970         (WebCore::RenderSearchField::addSearchResult):
971
972 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
973
974         [Attachment Support] Introduce data structures and IPC support for writing promised blobs
975         https://bugs.webkit.org/show_bug.cgi?id=181189
976
977         Reviewed by Tim Horton.
978
979         Introduces a new header containing structs to be used for writing blob data when dragging. PromisedBlobInfo
980         represents information needed to declare data on the pasteboard that will eventually be provided via a Blob.
981         This includes the type and filename of the Blob-backed content. PromisedBlobData represents information needed
982         to actually deliver the Blob's content to the platform, and is sent some time after its corresponding
983         PromisedBlobInfo. The content may either be in the form of a file path (as is the case using the previous
984         declareAndWriteAttachment codepath) or a data buffer (which we would use if the Blob is not already backed by a
985         file on disk).
986
987         No new tests, since there is no observable change in functionality yet.
988
989         * WebCore.xcodeproj/project.pbxproj:
990         * platform/PromisedBlobInfo.h: Added.
991         (WebCore::PromisedBlobInfo::operator bool const):
992         (WebCore::PromisedBlobData::hasData const):
993         (WebCore::PromisedBlobData::hasFile const):
994         (WebCore::PromisedBlobData::operator bool const):
995         (WebCore::PromisedBlobData::fulfills const):
996
997 2018-01-02  Brady Eidson  <beidson@apple.com>
998
999         Make MessagePortChannel::takeAllMessagesFromRemote asynchronous.
1000         https://bugs.webkit.org/show_bug.cgi?id=181205
1001
1002         Reviewed by Alex Christensen.
1003
1004         No new tests (No behavior change)
1005
1006         This is needed for the ongoing WK2 MessagePort work.
1007
1008         For WK1 in-process MessagePorts it is still synchronous; no behavior change.
1009
1010         * dom/InProcessMessagePortChannel.cpp:
1011         (WebCore::InProcessMessagePortChannel::takeAllMessagesFromRemote):
1012         * dom/InProcessMessagePortChannel.h:
1013
1014         * dom/MessagePort.cpp:
1015         (WebCore::MessagePort::dispatchMessages):
1016         * dom/MessagePortChannel.h:
1017
1018 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
1019
1020         Add a WebAuthentication runtime feature flag
1021         https://bugs.webkit.org/show_bug.cgi?id=181220
1022         <rdar://problem/36055305>
1023
1024         Reviewed by Brent Fulgham.
1025
1026         This patch basically renames the CredentialManagement runtime feature flag into
1027         WebAuthentication runtime feature flag.
1028
1029         No tests.
1030
1031         * Modules/credentialmanagement/BasicCredential.idl:
1032         * Modules/credentialmanagement/CredentialsContainer.idl:
1033         * Modules/credentialmanagement/NavigatorCredentials.idl:
1034         * Modules/webauthn/PublicKeyCredential.idl:
1035         * page/RuntimeEnabledFeatures.h:
1036         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled):
1037         (WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const):
1038         (WebCore::RuntimeEnabledFeatures::setCredentialManagementEnabled): Deleted.
1039         (WebCore::RuntimeEnabledFeatures::credentialManagementEnabled const): Deleted.
1040
1041 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1042
1043         [Attachment Support] Don't Blob-convert images and attachments with https:, http: or data: urls
1044         https://bugs.webkit.org/show_bug.cgi?id=181143
1045         <rdar://problem/36200381>
1046
1047         Reviewed by Tim Horton.
1048
1049         Clients such as Mail would expect pasting or dropping an image with src="https://..." to result in the source
1050         URL being preserved (i.e. staying as remote images) instead of creating image attachments out of them. This
1051         patch hooks into the shouldConvertToBlob() check added in r226272 so that it applies to attachment element
1052         replacement as well.
1053
1054         Test: WKAttachmentTests.DoNotInsertDataURLImagesAsAttachments
1055
1056         * editing/cocoa/WebContentReaderCocoa.mm:
1057         (WebCore::shouldConvertToBlob):
1058         (WebCore::replaceRichContentWithAttachments):
1059
1060 2018-01-02  Brady Eidson  <beidson@apple.com>
1061
1062         Identify MessagePorts by a globally unique MessagePortIdentifier.
1063         https://bugs.webkit.org/show_bug.cgi?id=181172
1064
1065         Reviewed by Alex Christensen.
1066
1067         No new tests (Behavior change covered by all existing tests).
1068
1069         This cleans up the abstract MessagePortChannel interface to be in terms of identifiers
1070         instead of actual MessagePort objects.
1071         
1072         The identifiers are compounded with the current ProcessIdentifier meaning they are global
1073         across all processes for the running UI process, enabling easy cross-process communication.
1074         
1075         (Actual cross-process communication comes in a followup)
1076         
1077         * WebCore.xcodeproj/project.pbxproj:
1078         
1079         * dom/InProcessMessagePortChannel.cpp:
1080         (WebCore::InProcessMessagePortChannel::createChannelBetweenPorts):
1081         (WebCore::InProcessMessagePortChannel::isConnectedTo):
1082         (WebCore::InProcessMessagePortChannel::entangleWithRemoteIfOpen):
1083         (WebCore::InProcessMessagePortChannel::entangleIfOpen): Deleted.
1084         * dom/InProcessMessagePortChannel.h:
1085         
1086         * dom/MessageChannel.cpp:
1087         (WebCore::MessageChannel::MessageChannel):
1088         (WebCore::m_port2):
1089         
1090         * dom/MessagePort.cpp:
1091         (WebCore::allMessagePortsLock):
1092         (WebCore::MessagePort::ref const):
1093         (WebCore::MessagePort::deref const):
1094         (WebCore::MessagePort::existingMessagePortForIdentifier):
1095         (WebCore::MessagePort::MessagePort):
1096         (WebCore::MessagePort::~MessagePort):
1097         (WebCore::MessagePort::postMessage):
1098         (WebCore::MessagePort::entangleWithRemote):
1099         (WebCore::MessagePort::entanglePorts):
1100         (WebCore::MessagePort::entangle): Deleted.
1101         * dom/MessagePort.h:
1102         
1103         * dom/MessagePortChannel.h:
1104         
1105         * dom/MessagePortIdentifier.h: Added.
1106         (WebCore::operator==):
1107         (WebCore::MessagePortIdentifier::encode const):
1108         (WebCore::MessagePortIdentifier::decode):
1109         (WebCore::MessagePortIdentifier::hash const):
1110         (WTF::MessagePortIdentifierHash::hash):
1111         (WTF::MessagePortIdentifierHash::equal):
1112         (WTF::HashTraits<WebCore::MessagePortIdentifier>::emptyValue):
1113         (WTF::HashTraits<WebCore::MessagePortIdentifier>::constructDeletedValue):
1114         (WTF::HashTraits<WebCore::MessagePortIdentifier>::isDeletedValue):
1115
1116 2018-01-02  Youenn Fablet  <youenn@apple.com>
1117
1118         Memory cache should not reuse resources with different credential fetch option
1119         https://bugs.webkit.org/show_bug.cgi?id=181212
1120
1121         Reviewed by Alex Christensen.
1122
1123         Covered by rebased test.
1124
1125         * loader/cache/CachedResourceLoader.cpp:
1126         (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
1127
1128 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
1129
1130         Update Credential Management API for WebAuthentication
1131         https://bugs.webkit.org/show_bug.cgi?id=181082
1132         <rdar://problem/36055239>
1133
1134         Reviewed by Brent Fulgham.
1135
1136         Part 2/2
1137
1138         This patch implements Core API from Credential Management API: https://www.w3.org/TR/credential-management-1/#core.
1139         which is required by WebAuthN. It also sets the CredentialManagement runtime flag to enable testing. Note that it
1140         introduces a dummy PublicKeyCredential interface for testing functionalities of the Credential interface, which
1141         cannot be instantiated.
1142
1143         Tests: http/wpt/credential-management/credentialscontainer-create-basics.https.html
1144                http/wpt/credential-management/credentialscontainer-get-basics.https.html
1145                http/wpt/credential-management/credentialscontainer-preventSilentAccess-basics.https.html
1146                http/wpt/credential-management/idl.https.html
1147
1148         * CMakeLists.txt:
1149         * DerivedSources.make:
1150         * Modules/credentialmanagement/BasicCredential.cpp:
1151         (WebCore::BasicCredential::BasicCredential):
1152         (WebCore::BasicCredential::type const):
1153         * Modules/credentialmanagement/BasicCredential.h:
1154         (WebCore::BasicCredential::discovery const):
1155         * Modules/credentialmanagement/BasicCredential.idl:
1156         * Modules/credentialmanagement/CredentialCreationOptions.h:
1157         * Modules/credentialmanagement/CredentialCreationOptions.idl:
1158         * Modules/credentialmanagement/CredentialRequestOptions.h:
1159         * Modules/credentialmanagement/CredentialRequestOptions.idl:
1160         * Modules/credentialmanagement/CredentialsContainer.cpp:
1161         (WebCore::CredentialsContainer::CredentialsContainer):
1162         (WebCore::CredentialsContainer::isSameOriginWithItsAncestors):
1163         (WebCore::CredentialsContainer::dispatchTask):
1164         (WebCore::CredentialsContainer::get):
1165         (WebCore::CredentialsContainer::store):
1166         (WebCore::CredentialsContainer::isCreate):
1167         (WebCore::CredentialsContainer::preventSilentAccess):
1168         * Modules/credentialmanagement/CredentialsContainer.h:
1169         (WebCore::CredentialsContainer::create):
1170         (WebCore::CredentialsContainer::CredentialsContainer): Deleted.
1171         * Modules/credentialmanagement/CredentialsContainer.idl:
1172         * Modules/credentialmanagement/NavigatorCredentials.cpp:
1173         (WebCore::NavigatorCredentials::credentials):
1174         * Modules/credentialmanagement/NavigatorCredentials.h:
1175         * Modules/credentialmanagement/NavigatorCredentials.idl:
1176         * Modules/webauthn/PublicKeyCredential.cpp: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
1177         (WebCore::PublicKeyCredential::PublicKeyCredential):
1178         (WebCore::PublicKeyCredential::collectFromCredentialStore):
1179         (WebCore::PublicKeyCredential::discoverFromExternalSource):
1180         (WebCore::PublicKeyCredential::store):
1181         (WebCore::PublicKeyCredential::create):
1182         * Modules/webauthn/PublicKeyCredential.h: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
1183         * Modules/webauthn/PublicKeyCredential.idl: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.idl.
1184         * Sources.txt:
1185         * WebCore.xcodeproj/project.pbxproj:
1186         * bindings/js/WebCoreBuiltinNames.h:
1187         * page/RuntimeEnabledFeatures.h:
1188
1189 2018-01-02  Oleksandr Skachkov  <gskachkov@gmail.com>
1190
1191         WebAssembly: sending module to iframe fails
1192         https://bugs.webkit.org/show_bug.cgi?id=179263
1193
1194         Reviewed by JF Bastien.
1195
1196         Allow use WebAssembly.Module as input parameters for postMessage 
1197         in window and iframe object. To prevent sending message to iframe
1198         that is not ready, in iframe-* test we are waiting message from
1199         iframe only after that we send message to it.   
1200
1201         Tests: wasm/iframe-parent-postmessage.html
1202                wasm/iframe-postmessage.html
1203                wasm/window-postmessage.html
1204
1205         * bindings/js/SerializedScriptValue.cpp:
1206         (WebCore::CloneSerializer::dumpIfTerminal):
1207         * bindings/js/SerializedScriptValue.h:
1208         * page/DOMWindow.cpp:
1209         (WebCore::DOMWindow::postMessage):
1210
1211 == Rolled over to ChangeLog-2018-01-01 ==