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