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