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