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