[Attachment Support] Add plumbing for starting a drag with promised blob data
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [Attachment Support] Add plumbing for starting a drag with promised blob data
4         https://bugs.webkit.org/show_bug.cgi?id=181201
5
6         Reviewed by Tim Horton.
7
8         Adds logic to allow dragging an attachment element as a file by sending promised blob information to the UI
9         process. See comments below for more detail.
10
11         The only change in behavior is that dragging an attachment element will no longer write web content and injected
12         bundle data to the pasteboard if the attachment element's file attribute is nonnull. This will cause one
13         existing WK1 layout test to fail, but will otherwise not affect any attachment editing clients. On iOS,
14         attachment elements in the Mail viewer can be dragged, but each attachment's file is null, so we fall back to
15         current behavior; on macOS, Mail currently overrides the drag completely, beginning at -mouseDown:, so this
16         doesn't make a difference to macOS Mail either.
17
18         * editing/Editor.h:
19         * editing/cocoa/EditorCocoa.mm:
20         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
21
22         Add a helper method to retrieve an attachment element as web archive data, for moving attachments within the
23         same document. Also gives the injected editor bundle a chance to supply custom pasteboard types.
24
25         * loader/EmptyClients.cpp:
26         * page/DragClient.h:
27         (WebCore::DragClient::prepareToDragPromisedBlob):
28
29         Add new DragClient methods to send information about a promised blob to the UI process.
30
31         * page/DragController.cpp:
32         (WebCore::DragController::startDrag):
33
34         Call dragAttachmentElement when starting a drag on an attachment element.
35
36         (WebCore::DragController::dragAttachmentElement):
37
38         Try to begin dragging a given attachment element, propagating promised blob information to the client layers.
39         Returns true iff the attachment is backed by blob data (i.e. the file is nonnull).
40
41         * platform/PromisedBlobInfo.h:
42
43         Add a list of additional types and data to PromisedBlobInfo. In addition to the promised blob info, this would
44         allow injected bundle data and other private types alongside the main attachment data on the pasteboard.
45
46 2018-01-03  Simon Fraser  <simon.fraser@apple.com>
47
48         Remove the 'resolutionScale' parameter from ImageBufferDataCG get/putBytes
49         https://bugs.webkit.org/show_bug.cgi?id=181268
50
51         Reviewed by Alex Christensen.
52
53         These functions were always called with resolutionScale=1.
54
55         * platform/graphics/cg/ImageBufferCG.cpp:
56         (WebCore::ImageBuffer::getUnmultipliedImageData const):
57         (WebCore::ImageBuffer::getPremultipliedImageData const):
58         (WebCore::ImageBuffer::putByteArray):
59         * platform/graphics/cg/ImageBufferDataCG.cpp:
60         (WebCore::ImageBufferData::getData const):
61         (WebCore::ImageBufferData::putData):
62         (WebCore::affineWarpBufferData): Deleted.
63         * platform/graphics/cg/ImageBufferDataCG.h:
64
65 2018-01-03  John Wilander  <wilander@apple.com>
66
67         Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
68         https://bugs.webkit.org/show_bug.cgi?id=181270
69         <rdar://problem/36289544>
70
71         Reviewed by Alex Christensen.
72
73         No new tests. Existing test re-enabled.
74
75         This change refactors how the web process tells the network process
76         to remove storage access. Previously, this was done over the UI process
77         just like requests for storage access. But since no further reasoning
78         is needed, the message should go straight from the web process to the
79         network process for performance reasons and to minimize the risk of a
80         race.
81
82         As a consequence, the XPC code for storage access removal in the UI
83         process is deleted.
84
85         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
86         (WebCore::NetworkStorageSession::cookieStoragePartition const):
87             Removes the storageAccessAPIEnabled check since the flag
88             doesn't get propagated when the network process is created.
89             Figuring this out will take some work which is unnecessary
90             when we already gate access to the feature in Document.idl.
91
92 2018-01-03  James Craig  <jcraig@apple.com>
93
94         AX: when invert colors is on, double-invert certain media elements in UserAgentStyleSheet
95         https://bugs.webkit.org/show_bug.cgi?id=168447
96         <rdar://problem/30559874>
97
98         Reviewed by Simon Fraser.
99
100         Double-invert video when platform 'invert colors' setting is enabled. Behavior matches 
101         current 'Smart Invert' feature of Safari Reader on macOS/iOS and other iOS native apps.
102
103         Tests: accessibility/smart-invert-reference.html
104                accessibility/smart-invert.html
105
106         * Modules/modern-media-controls/controls/media-controls.css:
107         (@media (inverted-colors)):
108         (:host):
109         (picture):
110         * css/html.css:
111         (@media (inverted-colors)):
112         (video):
113
114 2018-01-03  Youenn Fablet  <youenn@apple.com>
115
116         LayoutTest http/tests/media/media-stream/disconnected-frame.html to consistently fail an assertion: !m_adoptionIsRequired
117         https://bugs.webkit.org/show_bug.cgi?id=181264
118
119         Reviewed by Eric Carlson.
120
121         Covered by http/tests/media/media-stream/disconnected-frame.html not crashing anymore in Debug builds.
122         Calling suspendIfNeeded in create method instead of constructor.
123
124         * Modules/mediastream/UserMediaRequest.cpp:
125         (WebCore::UserMediaRequest::create):
126         (WebCore::UserMediaRequest::UserMediaRequest):
127
128 2018-01-03  Antti Koivisto  <antti@apple.com>
129
130         Remove DeprecatedCSSOMValue::equals
131         https://bugs.webkit.org/show_bug.cgi?id=181241
132
133         Reviewed by Zalan Bujtas.
134
135         This is dead code.
136
137         * css/DeprecatedCSSOMValue.cpp:
138         (WebCore::compareCSSOMValues): Deleted.
139         (WebCore::DeprecatedCSSOMValue::equals const): Deleted.
140         * css/DeprecatedCSSOMValue.h:
141         (WebCore::DeprecatedCSSOMValue::operator== const): Deleted.
142         (WebCore::DeprecatedCSSOMComplexValue::equals const): Deleted.
143         * css/DeprecatedCSSOMValueList.cpp:
144         (WebCore::DeprecatedCSSOMValueList::equals const): Deleted.
145         * css/DeprecatedCSSOMValueList.h:
146
147 2018-01-03  Simon Fraser  <simon.fraser@apple.com>
148
149         feLighting is broken with primitiveUnits="objectBoundingBox"
150         https://bugs.webkit.org/show_bug.cgi?id=181197
151
152         Reviewed by Tim Horton.
153
154         With <filter primitiveUnits="objectBoundingBox"> we need to convert the coordinates
155         of fePointLights and feSpotLights into user space coordinates. Following
156         https://www.w3.org/TR/SVG/filters.html#FilterElementPrimitiveUnitsAttribute
157         this is done by treating them as fractions of the bounding box on the referencing
158         element, with treatment for z following https://www.w3.org/TR/SVG/coords.html#Units_viewport_percentage
159         
160         To do this, store the bounds of the referencing elemenet on SVGFilterBuilder as
161         targetBoundingBox, and store the primitiveUnits type. Then do the conversion of lighting
162         coordinates in SVGFESpecularLightingElement::build() and SVGFEDiffuseLightingElement::build().
163
164         Remove SVGFELightElement::findLightSource(), since we need to be able to pass the SVGFilterBuilder
165         to the lightSource() function so hoist the code up.
166
167         Tests: svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
168                svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
169                svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox-expected.svg
170                svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox.svg
171                svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
172                svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
173
174         * rendering/svg/RenderSVGResourceFilter.cpp:
175         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
176         * svg/SVGFEDiffuseLightingElement.cpp:
177         (WebCore::SVGFEDiffuseLightingElement::build):
178         * svg/SVGFEDistantLightElement.cpp:
179         (WebCore::SVGFEDistantLightElement::lightSource const):
180         * svg/SVGFEDistantLightElement.h:
181         * svg/SVGFELightElement.cpp:
182         (WebCore::SVGFELightElement::findLightSource): Deleted.
183         * svg/SVGFELightElement.h:
184         * svg/SVGFEPointLightElement.cpp:
185         (WebCore::SVGFEPointLightElement::lightSource const):
186         * svg/SVGFEPointLightElement.h:
187         * svg/SVGFESpecularLightingElement.cpp:
188         (WebCore::SVGFESpecularLightingElement::build):
189         * svg/SVGFESpotLightElement.cpp:
190         (WebCore::SVGFESpotLightElement::lightSource const):
191         * svg/SVGFESpotLightElement.h:
192         * svg/graphics/filters/SVGFilterBuilder.h:
193         (WebCore::SVGFilterBuilder::setTargetBoundingBox):
194         (WebCore::SVGFilterBuilder::targetBoundingBox const):
195         (WebCore::SVGFilterBuilder::primitiveUnits const):
196         (WebCore::SVGFilterBuilder::setPrimitiveUnits):
197
198 2018-01-03  Antti Koivisto  <antti@apple.com>
199
200         Crash beneath CSSValue::equals @ csas.cz
201         https://bugs.webkit.org/show_bug.cgi?id=181243
202         <rdar://problem/35990826>
203
204         Reviewed by Alex Christensen.
205
206         Test: fast/text/oblique-degree-equals-crash.html
207
208         * css/CSSFontStyleValue.cpp:
209         (WebCore::CSSFontStyleValue::equals const):
210
211         Null check both oblique pointers.
212
213 2018-01-03  Joseph Pecoraro  <pecoraro@apple.com>
214
215         Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
216         https://bugs.webkit.org/show_bug.cgi?id=180979
217         <rdar://problem/36146670>
218
219         Reviewed by Matt Baker.
220
221         * platform/graphics/cocoa/FontCacheCoreText.cpp:
222         (fontNameIsSystemFont):
223         (WebCore::FontCache::systemFontFamilies):
224         Switch to the original Mac algorithm before r180979 that uses
225         CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
226         available on iOS but now it is. This is a performance improvement on
227         both platforms, but significantly so on macOS. It also finds more,
228         valid, family names.
229
230 2018-01-03  Michael Catanzaro  <mcatanzaro@igalia.com>
231
232         ASSERTION FAILED: !source || is<Target>(*source) in CoordinatedGraphicsLayer::removeFromParent
233         https://bugs.webkit.org/show_bug.cgi?id=166568
234
235         Reviewed by Simon Fraser.
236
237         When a GraphicsLayer has a mask layer, it fails to properly unparent the mask layer before
238         it is destroyed. This leaves the mask layer with a dangling parent pointer. Fix it, while
239         taking care not to introduce yet another virtual function call during the execution of the
240         destructor.
241
242         * platform/graphics/GraphicsLayer.cpp:
243         (WebCore::GraphicsLayer::willBeDestroyed):
244
245 2018-01-03  Simon Fraser  <simon.fraser@apple.com>
246
247         SVG lighting filter lights are in the wrong coordinate system
248         https://bugs.webkit.org/show_bug.cgi?id=181147
249
250         Reviewed by Zalan Bujtas.
251
252         Point and spot light coordinates weren't being converted into buffer-relative
253         coordinates before being fed into the lighting math, resulting in incorrect light
254         rendering on Retina devices, and when the filter primitive region was clipped.
255
256         Fix by storing absoluteUnclippedSubregion on FilterEffect, which allows us to map
257         lighting points from user space coordinates into the coordinates of the buffer being
258         used for rendering. Also scale the light z coordinate by doing a dummy point mapping in x.
259
260         Rename members of PointLightSource and SpotLightSource to make it clear which coordinate
261         system they are in.
262
263         Tests include HiDPI tests.
264
265         Tests: svg/filters/fePointLight-coordinates-expected.svg
266                svg/filters/fePointLight-coordinates.svg
267                svg/filters/feSpotLight-coordinates-expected.svg
268                svg/filters/feSpotLight-coordinates.svg
269                svg/filters/hidpi/fePointLight-coordinates-expected.svg
270                svg/filters/hidpi/fePointLight-coordinates.svg
271                svg/filters/hidpi/feSpotLight-coordinates-expected.svg
272                svg/filters/hidpi/feSpotLight-coordinates.svg
273
274         * platform/graphics/FloatPoint3D.h: Make it easy to get and set the X and Y coords as a FloatPoint.
275         (WebCore::FloatPoint3D::xy const):
276         (WebCore::FloatPoint3D::setXY):
277         * platform/graphics/GeometryUtilities.cpp:
278         (WebCore::mapPoint):
279         (WebCore::mapRect):
280         * platform/graphics/GeometryUtilities.h: Helper to make a point between rects.
281         * platform/graphics/filters/DistantLightSource.cpp:
282         (WebCore::DistantLightSource::initPaintingData):
283         * platform/graphics/filters/DistantLightSource.h:
284         * platform/graphics/filters/FELighting.cpp:
285         (WebCore::FELighting::drawLighting):
286         * platform/graphics/filters/FilterEffect.cpp:
287         (WebCore::FilterEffect::mapPointFromUserSpaceToBuffer const):
288         * platform/graphics/filters/FilterEffect.h:
289         (WebCore::FilterEffect::setUnclippedAbsoluteSubregion):
290         * platform/graphics/filters/LightSource.h:
291         * platform/graphics/filters/PointLightSource.cpp:
292         (WebCore::PointLightSource::initPaintingData):
293         (WebCore::PointLightSource::computePixelLightingData const):
294         (WebCore::PointLightSource::setX):
295         (WebCore::PointLightSource::setY):
296         (WebCore::PointLightSource::setZ):
297         * platform/graphics/filters/PointLightSource.h:
298         (WebCore::PointLightSource::position const):
299         (WebCore::PointLightSource::PointLightSource):
300         * platform/graphics/filters/SpotLightSource.cpp:
301         (WebCore::SpotLightSource::initPaintingData):
302         (WebCore::SpotLightSource::computePixelLightingData const):
303         (WebCore::SpotLightSource::setX):
304         (WebCore::SpotLightSource::setY):
305         (WebCore::SpotLightSource::setZ):
306         (WebCore::SpotLightSource::setPointsAtX):
307         (WebCore::SpotLightSource::setPointsAtY):
308         (WebCore::SpotLightSource::setPointsAtZ):
309         * platform/graphics/filters/SpotLightSource.h:
310         (WebCore::SpotLightSource::position const):
311         (WebCore::SpotLightSource::direction const):
312         (WebCore::SpotLightSource::SpotLightSource):
313         * rendering/svg/RenderSVGResourceFilter.cpp:
314         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
315         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
316         (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
317
318 2018-01-03  Youenn Fablet  <youenn@apple.com>
319
320         Select service worker for documents with data/blob URLS
321         https://bugs.webkit.org/show_bug.cgi?id=181213
322
323         Reviewed by Alex Christensen.
324
325         Covered by updated test.
326
327         Reusing the service worker of the parent for blob/data URL documents.
328
329         * loader/DocumentLoader.cpp:
330         (WebCore::isLocalURL):
331         (WebCore::DocumentLoader::commitData):
332
333 2018-01-03  Ryan Haddad  <ryanhaddad@apple.com>
334
335         Unreviewed, rolling out r226352.
336
337         Breaks Sierra and El Capitan builds.
338
339         Reverted changeset:
340
341         "Web Inspector: Slow open time enumerating system fonts
342         (FontCache::systemFontFamilies)"
343         https://bugs.webkit.org/show_bug.cgi?id=180979
344         https://trac.webkit.org/changeset/226352
345
346 2018-01-03  Philippe Normand  <pnormand@igalia.com>
347
348         [GStreamer] The bus synchronous handler should be in the base player class
349         https://bugs.webkit.org/show_bug.cgi?id=181237
350
351         Reviewed by Carlos Garcia Campos.
352
353         Because this is where video rendering is handled.
354
355         No new tests, this is only a refactoring.
356
357         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
358         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
359         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
360         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
361
362 2018-01-03  Philippe Normand  <pnormand@igalia.com>
363
364         [GStreamer] move MediaSample implementation out of mse/
365         https://bugs.webkit.org/show_bug.cgi?id=179165
366
367         Reviewed by Carlos Garcia Campos.
368
369         This module isn't specific to MSE and can potentially be reused
370         elsewhere, for WebRTC for instance. Additionally the
371         ::platformSample() method was implemented and the code was cleaned up.
372
373         * platform/GStreamer.cmake:
374         * platform/MediaSample.h:
375         * platform/graphics/gstreamer/GStreamerMediaSample.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp.
376         (WebCore::GStreamerMediaSample::platformSample):
377         * platform/graphics/gstreamer/GStreamerMediaSample.h: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.h.
378         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
379         (WebCore::PlaybackPipeline::enqueueSample):
380
381 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
382
383         Unreviewed. Fix resource load stats tests on GLib based ports after r226355.
384
385         The monitor can be created in the work queue thread too.
386
387         * platform/glib/FileMonitorGLib.cpp:
388         (WebCore::FileMonitor::FileMonitor):
389
390 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
391
392         [GTK] Crash destroying WebCore::FileMonitor
393         https://bugs.webkit.org/show_bug.cgi?id=181138
394
395         Reviewed by Michael Catanzaro.
396
397         Ensure that platform file monitor is always created and destroyed in the work queue thread synchronously.
398
399         * platform/FileMonitor.h:
400         * platform/glib/FileMonitorGLib.cpp:
401         (WebCore::FileMonitor::FileMonitor):
402         (WebCore::FileMonitor::~FileMonitor):
403         (WebCore::FileMonitor::didChange):
404
405 2018-01-02  Joseph Pecoraro  <pecoraro@apple.com>
406
407         Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
408         https://bugs.webkit.org/show_bug.cgi?id=180979
409         <rdar://problem/36146670>
410
411         Reviewed by Matt Baker.
412
413         * platform/graphics/cocoa/FontCacheCoreText.cpp:
414         (WebCore::FontCache::systemFontFamilies):
415         Switch to the original Mac algorithm before r180979 that uses
416         CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
417         available on iOS but now it is. This is a performance improvement on
418         both platforms, but significantly so on macOS. It also finds more,
419         valid, family names.
420
421 2018-01-02  Yusuke Suzuki  <utatane.tea@gmail.com>
422
423         Unreviewed, fix GCC warning by using #include
424         https://bugs.webkit.org/show_bug.cgi?id=181189
425
426         This file is included in C++ files. Use #include instead of #import to suppress warning in GCC.
427
428         * platform/PromisedBlobInfo.h:
429
430 2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>
431
432         Remove std::chrono completely
433         https://bugs.webkit.org/show_bug.cgi?id=181186
434
435         Reviewed by Alex Christensen.
436
437         Use MonotonicTime, WallTime, and Seconds instead.
438         Changes are mechanical ones. But persistent network cache data is changed.
439         So we bump the version number of the cache storage.
440
441         * Modules/indexeddb/server/IDBServer.cpp:
442         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
443         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
444         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
445         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
446         * Modules/indexeddb/server/IDBServer.h:
447         * Modules/webdatabase/DatabaseTracker.cpp:
448         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
449         * Modules/webdatabase/DatabaseTracker.h:
450         * dom/Document.cpp:
451         (WebCore::Document::lastModified):
452         * html/HTMLMediaElement.cpp:
453         (WebCore::HTMLMediaElement::clearMediaCache):
454         * html/HTMLMediaElement.h:
455         (WebCore::HTMLMediaElement::clearMediaCache):
456         * loader/CrossOriginPreflightResultCache.cpp:
457         (WebCore::parseAccessControlMaxAge):
458         (WebCore::CrossOriginPreflightResultCacheItem::parse):
459         (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest const):
460         * loader/CrossOriginPreflightResultCache.h:
461         * loader/cache/CachedResource.cpp:
462         (WebCore::CachedResource::CachedResource):
463         (WebCore::CachedResource::freshnessLifetime const):
464         (WebCore::CachedResource::responseReceived):
465         (WebCore::CachedResource::updateResponseAfterRevalidation):
466         * loader/cache/CachedResource.h:
467         * platform/FileSystem.cpp:
468         (WebCore::FileSystem::getFileModificationTime):
469         * platform/FileSystem.h:
470         * platform/SearchPopupMenu.h:
471         * platform/cocoa/SearchPopupMenuCocoa.h:
472         * platform/cocoa/SearchPopupMenuCocoa.mm:
473         (WebCore::toSystemClockTime):
474         (WebCore::toNSDateFromSystemClock):
475         (WebCore::removeRecentlyModifiedRecentSearches):
476         * platform/graphics/MediaPlayer.cpp:
477         (WebCore::MediaPlayer::clearMediaCache):
478         * platform/graphics/MediaPlayer.h:
479         * platform/graphics/MediaPlayerPrivate.h:
480         (WebCore::MediaPlayerPrivateInterface::clearMediaCache):
481         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
482         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
483         (WebCore::toSystemClockTime):
484         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
485         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
486         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
487         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
488         * platform/network/CacheValidation.cpp:
489         (WebCore::computeCurrentAge):
490         (WebCore::computeFreshnessLifetimeForHTTPFamily):
491         (WebCore::updateRedirectChainStatus):
492         (WebCore::redirectChainAllowsReuse):
493         (WebCore::parseCacheControlDirectives):
494         * platform/network/CacheValidation.h:
495         (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
496         * platform/network/HTTPParsers.cpp:
497         (WebCore::parseHTTPDate):
498         * platform/network/HTTPParsers.h:
499         * platform/network/PlatformCookieJar.h:
500         * platform/network/ResourceResponseBase.cpp:
501         (WebCore::ResourceResponseBase::cacheControlMaxAge const):
502         (WebCore::parseDateValueInHeader):
503         (WebCore::ResourceResponseBase::date const):
504         (WebCore::ResourceResponseBase::age const):
505         (WebCore::ResourceResponseBase::expires const):
506         (WebCore::ResourceResponseBase::lastModified const):
507         * platform/network/ResourceResponseBase.h:
508         * platform/network/cf/CookieJarCFNet.cpp:
509         (WebCore::deleteAllCookiesModifiedSince):
510         * platform/network/curl/CookieJarCurl.cpp:
511         (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
512         (WebCore::deleteAllCookiesModifiedSince):
513         * platform/network/curl/CookieJarCurl.h:
514         * platform/network/curl/CurlCacheEntry.cpp:
515         (WebCore::CurlCacheEntry::CurlCacheEntry):
516         (WebCore::CurlCacheEntry::isCached):
517         (WebCore::CurlCacheEntry::parseResponseHeaders):
518         * platform/network/curl/CurlCacheEntry.h:
519         * platform/network/mac/CookieJarMac.mm:
520         (WebCore::deleteAllCookiesModifiedSince):
521         * platform/network/soup/CookieJarSoup.cpp:
522         (WebCore::deleteAllCookiesModifiedSince):
523         * platform/win/SearchPopupMenuWin.cpp:
524         (WebCore::SearchPopupMenuWin::loadRecentSearches):
525         * rendering/RenderSearchField.cpp:
526         (WebCore::RenderSearchField::addSearchResult):
527
528 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
529
530         [Attachment Support] Introduce data structures and IPC support for writing promised blobs
531         https://bugs.webkit.org/show_bug.cgi?id=181189
532
533         Reviewed by Tim Horton.
534
535         Introduces a new header containing structs to be used for writing blob data when dragging. PromisedBlobInfo
536         represents information needed to declare data on the pasteboard that will eventually be provided via a Blob.
537         This includes the type and filename of the Blob-backed content. PromisedBlobData represents information needed
538         to actually deliver the Blob's content to the platform, and is sent some time after its corresponding
539         PromisedBlobInfo. The content may either be in the form of a file path (as is the case using the previous
540         declareAndWriteAttachment codepath) or a data buffer (which we would use if the Blob is not already backed by a
541         file on disk).
542
543         No new tests, since there is no observable change in functionality yet.
544
545         * WebCore.xcodeproj/project.pbxproj:
546         * platform/PromisedBlobInfo.h: Added.
547         (WebCore::PromisedBlobInfo::operator bool const):
548         (WebCore::PromisedBlobData::hasData const):
549         (WebCore::PromisedBlobData::hasFile const):
550         (WebCore::PromisedBlobData::operator bool const):
551         (WebCore::PromisedBlobData::fulfills const):
552
553 2018-01-02  Brady Eidson  <beidson@apple.com>
554
555         Make MessagePortChannel::takeAllMessagesFromRemote asynchronous.
556         https://bugs.webkit.org/show_bug.cgi?id=181205
557
558         Reviewed by Alex Christensen.
559
560         No new tests (No behavior change)
561
562         This is needed for the ongoing WK2 MessagePort work.
563
564         For WK1 in-process MessagePorts it is still synchronous; no behavior change.
565
566         * dom/InProcessMessagePortChannel.cpp:
567         (WebCore::InProcessMessagePortChannel::takeAllMessagesFromRemote):
568         * dom/InProcessMessagePortChannel.h:
569
570         * dom/MessagePort.cpp:
571         (WebCore::MessagePort::dispatchMessages):
572         * dom/MessagePortChannel.h:
573
574 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
575
576         Add a WebAuthentication runtime feature flag
577         https://bugs.webkit.org/show_bug.cgi?id=181220
578         <rdar://problem/36055305>
579
580         Reviewed by Brent Fulgham.
581
582         This patch basically renames the CredentialManagement runtime feature flag into
583         WebAuthentication runtime feature flag.
584
585         No tests.
586
587         * Modules/credentialmanagement/BasicCredential.idl:
588         * Modules/credentialmanagement/CredentialsContainer.idl:
589         * Modules/credentialmanagement/NavigatorCredentials.idl:
590         * Modules/webauthn/PublicKeyCredential.idl:
591         * page/RuntimeEnabledFeatures.h:
592         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled):
593         (WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const):
594         (WebCore::RuntimeEnabledFeatures::setCredentialManagementEnabled): Deleted.
595         (WebCore::RuntimeEnabledFeatures::credentialManagementEnabled const): Deleted.
596
597 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
598
599         [Attachment Support] Don't Blob-convert images and attachments with https:, http: or data: urls
600         https://bugs.webkit.org/show_bug.cgi?id=181143
601         <rdar://problem/36200381>
602
603         Reviewed by Tim Horton.
604
605         Clients such as Mail would expect pasting or dropping an image with src="https://..." to result in the source
606         URL being preserved (i.e. staying as remote images) instead of creating image attachments out of them. This
607         patch hooks into the shouldConvertToBlob() check added in r226272 so that it applies to attachment element
608         replacement as well.
609
610         Test: WKAttachmentTests.DoNotInsertDataURLImagesAsAttachments
611
612         * editing/cocoa/WebContentReaderCocoa.mm:
613         (WebCore::shouldConvertToBlob):
614         (WebCore::replaceRichContentWithAttachments):
615
616 2018-01-02  Brady Eidson  <beidson@apple.com>
617
618         Identify MessagePorts by a globally unique MessagePortIdentifier.
619         https://bugs.webkit.org/show_bug.cgi?id=181172
620
621         Reviewed by Alex Christensen.
622
623         No new tests (Behavior change covered by all existing tests).
624
625         This cleans up the abstract MessagePortChannel interface to be in terms of identifiers
626         instead of actual MessagePort objects.
627         
628         The identifiers are compounded with the current ProcessIdentifier meaning they are global
629         across all processes for the running UI process, enabling easy cross-process communication.
630         
631         (Actual cross-process communication comes in a followup)
632         
633         * WebCore.xcodeproj/project.pbxproj:
634         
635         * dom/InProcessMessagePortChannel.cpp:
636         (WebCore::InProcessMessagePortChannel::createChannelBetweenPorts):
637         (WebCore::InProcessMessagePortChannel::isConnectedTo):
638         (WebCore::InProcessMessagePortChannel::entangleWithRemoteIfOpen):
639         (WebCore::InProcessMessagePortChannel::entangleIfOpen): Deleted.
640         * dom/InProcessMessagePortChannel.h:
641         
642         * dom/MessageChannel.cpp:
643         (WebCore::MessageChannel::MessageChannel):
644         (WebCore::m_port2):
645         
646         * dom/MessagePort.cpp:
647         (WebCore::allMessagePortsLock):
648         (WebCore::MessagePort::ref const):
649         (WebCore::MessagePort::deref const):
650         (WebCore::MessagePort::existingMessagePortForIdentifier):
651         (WebCore::MessagePort::MessagePort):
652         (WebCore::MessagePort::~MessagePort):
653         (WebCore::MessagePort::postMessage):
654         (WebCore::MessagePort::entangleWithRemote):
655         (WebCore::MessagePort::entanglePorts):
656         (WebCore::MessagePort::entangle): Deleted.
657         * dom/MessagePort.h:
658         
659         * dom/MessagePortChannel.h:
660         
661         * dom/MessagePortIdentifier.h: Added.
662         (WebCore::operator==):
663         (WebCore::MessagePortIdentifier::encode const):
664         (WebCore::MessagePortIdentifier::decode):
665         (WebCore::MessagePortIdentifier::hash const):
666         (WTF::MessagePortIdentifierHash::hash):
667         (WTF::MessagePortIdentifierHash::equal):
668         (WTF::HashTraits<WebCore::MessagePortIdentifier>::emptyValue):
669         (WTF::HashTraits<WebCore::MessagePortIdentifier>::constructDeletedValue):
670         (WTF::HashTraits<WebCore::MessagePortIdentifier>::isDeletedValue):
671
672 2018-01-02  Youenn Fablet  <youenn@apple.com>
673
674         Memory cache should not reuse resources with different credential fetch option
675         https://bugs.webkit.org/show_bug.cgi?id=181212
676
677         Reviewed by Alex Christensen.
678
679         Covered by rebased test.
680
681         * loader/cache/CachedResourceLoader.cpp:
682         (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
683
684 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
685
686         Update Credential Management API for WebAuthentication
687         https://bugs.webkit.org/show_bug.cgi?id=181082
688         <rdar://problem/36055239>
689
690         Reviewed by Brent Fulgham.
691
692         Part 2/2
693
694         This patch implements Core API from Credential Management API: https://www.w3.org/TR/credential-management-1/#core.
695         which is required by WebAuthN. It also sets the CredentialManagement runtime flag to enable testing. Note that it
696         introduces a dummy PublicKeyCredential interface for testing functionalities of the Credential interface, which
697         cannot be instantiated.
698
699         Tests: http/wpt/credential-management/credentialscontainer-create-basics.https.html
700                http/wpt/credential-management/credentialscontainer-get-basics.https.html
701                http/wpt/credential-management/credentialscontainer-preventSilentAccess-basics.https.html
702                http/wpt/credential-management/idl.https.html
703
704         * CMakeLists.txt:
705         * DerivedSources.make:
706         * Modules/credentialmanagement/BasicCredential.cpp:
707         (WebCore::BasicCredential::BasicCredential):
708         (WebCore::BasicCredential::type const):
709         * Modules/credentialmanagement/BasicCredential.h:
710         (WebCore::BasicCredential::discovery const):
711         * Modules/credentialmanagement/BasicCredential.idl:
712         * Modules/credentialmanagement/CredentialCreationOptions.h:
713         * Modules/credentialmanagement/CredentialCreationOptions.idl:
714         * Modules/credentialmanagement/CredentialRequestOptions.h:
715         * Modules/credentialmanagement/CredentialRequestOptions.idl:
716         * Modules/credentialmanagement/CredentialsContainer.cpp:
717         (WebCore::CredentialsContainer::CredentialsContainer):
718         (WebCore::CredentialsContainer::isSameOriginWithItsAncestors):
719         (WebCore::CredentialsContainer::dispatchTask):
720         (WebCore::CredentialsContainer::get):
721         (WebCore::CredentialsContainer::store):
722         (WebCore::CredentialsContainer::isCreate):
723         (WebCore::CredentialsContainer::preventSilentAccess):
724         * Modules/credentialmanagement/CredentialsContainer.h:
725         (WebCore::CredentialsContainer::create):
726         (WebCore::CredentialsContainer::CredentialsContainer): Deleted.
727         * Modules/credentialmanagement/CredentialsContainer.idl:
728         * Modules/credentialmanagement/NavigatorCredentials.cpp:
729         (WebCore::NavigatorCredentials::credentials):
730         * Modules/credentialmanagement/NavigatorCredentials.h:
731         * Modules/credentialmanagement/NavigatorCredentials.idl:
732         * Modules/webauthn/PublicKeyCredential.cpp: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
733         (WebCore::PublicKeyCredential::PublicKeyCredential):
734         (WebCore::PublicKeyCredential::collectFromCredentialStore):
735         (WebCore::PublicKeyCredential::discoverFromExternalSource):
736         (WebCore::PublicKeyCredential::store):
737         (WebCore::PublicKeyCredential::create):
738         * Modules/webauthn/PublicKeyCredential.h: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
739         * Modules/webauthn/PublicKeyCredential.idl: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.idl.
740         * Sources.txt:
741         * WebCore.xcodeproj/project.pbxproj:
742         * bindings/js/WebCoreBuiltinNames.h:
743         * page/RuntimeEnabledFeatures.h:
744
745 2018-01-02  Oleksandr Skachkov  <gskachkov@gmail.com>
746
747         WebAssembly: sending module to iframe fails
748         https://bugs.webkit.org/show_bug.cgi?id=179263
749
750         Reviewed by JF Bastien.
751
752         Allow use WebAssembly.Module as input parameters for postMessage 
753         in window and iframe object. To prevent sending message to iframe
754         that is not ready, in iframe-* test we are waiting message from
755         iframe only after that we send message to it.   
756
757         Tests: wasm/iframe-parent-postmessage.html
758                wasm/iframe-postmessage.html
759                wasm/window-postmessage.html
760
761         * bindings/js/SerializedScriptValue.cpp:
762         (WebCore::CloneSerializer::dumpIfTerminal):
763         * bindings/js/SerializedScriptValue.h:
764         * page/DOMWindow.cpp:
765         (WebCore::DOMWindow::postMessage):
766
767 == Rolled over to ChangeLog-2018-01-01 ==