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