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