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