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