[MediaStream] Calculate width or height when constraints contain only the other
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
2
3         [MediaStream] Calculate width or height when constraints contain only the other
4         https://bugs.webkit.org/show_bug.cgi?id=192632
5         <rdar://problem/46665734>
6
7         Unreviewed, remove an unneeded assert.
8
9         * platform/mediastream/RealtimeVideoSource.cpp:
10         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers):
11
12 2018-12-13  Zach Li  <zachli@apple.com>
13
14         Update Credit Card AutoFill button icon
15         https://bugs.webkit.org/show_bug.cgi?id=192637
16         rdar://problem/46545006
17
18         Reviewed by Chris Dumez.
19
20         * css/html.css:
21         (input::-webkit-credit-card-auto-fill-button):
22
23 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
24
25         [MediaStream] Calculate width or height when constraints contain only the other
26         https://bugs.webkit.org/show_bug.cgi?id=192632
27         <rdar://problem/46665734>
28
29         Reviewed by Youenn Fablet.
30
31         Test: fast/mediastream/constraint-intrinsic-size.html
32
33         * platform/graphics/RemoteVideoSample.cpp:
34         (WebCore::RemoteVideoSample::create): Log errors with RELEASE_LOG_ERROR.
35
36         * platform/graphics/cv/ImageTransferSessionVT.h:
37         (WebCore::ImageTransferSessionVT::pixelFormat const): New.
38
39         * platform/mediastream/RealtimeMediaSource.cpp:
40         (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Replace current size with new size.
41         (WebCore::RealtimeMediaSource::setSize): Don't notify about width and height.
42         (WebCore::RealtimeMediaSource::size const): Use intrinsic size when necessary.
43         (WebCore::RealtimeMediaSource::setIntrinsicSize): New.
44         (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Deleted.
45         * platform/mediastream/RealtimeMediaSource.h:
46
47         * platform/mediastream/RealtimeVideoSource.cpp:
48         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): No more remoteVideoSampleAvailable.
49
50         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
51         (WebCore::DisplayCaptureSourceCocoa::settings): Report size correctly.
52         (WebCore::DisplayCaptureSourceCocoa::frameSize const): Use intrinsicSize().
53         (WebCore::DisplayCaptureSourceCocoa::emitFrame): No more remoteVideoSampleAvailable.
54         (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): Deleted.
55         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
56         (WebCore::DisplayCaptureSourceCocoa::intrinsicSize const): Deleted.
57
58         * platform/mock/MockRealtimeVideoSource.cpp:
59         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Report intrinsic size.
60         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Minor cleanup.
61         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRateWithPreset):  Report intrinsic size.
62         (WebCore::MockRealtimeVideoSource::drawText): Don't render preset info for display source.
63         * platform/mock/MockRealtimeVideoSource.h:
64
65 2018-12-13  David Kilzer  <ddkilzer@apple.com>
66
67         clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp
68         <https://webkit.org/b/192661>
69         <rdar://problem/46694035>
70
71         Reviewed by Daniel Bates.
72
73         * dom/Document.cpp:
74         (WebCore::Document::updateIntersectionObservations):
75         (WebCore::Document::notifyIntersectionObserversTimerFired):
76         * dom/Element.cpp:
77         (WebCore::Element::didMoveToNewDocument):
78         (WebCore::Element::disconnectFromIntersectionObservers):
79         - Change loop variables from `auto` to `const auto&` to prevent
80           unnecessary copies of WeakPtr<IntersectionObserver> or
81           struct IntersectionObserverRegistration objects.
82
83 2018-12-13  Carlos Garcia Campos  <cgarcia@igalia.com>
84
85         [FreeType] Remove HarfBuzzFace
86         https://bugs.webkit.org/show_bug.cgi?id=192589
87
88         Reviewed by Michael Catanzaro.
89
90         This was used to share the common implementation with the chromium port, but now that only freetype based ports
91         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
92         since we are already caching glyphs in Font.
93
94         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
95         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
96         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
97         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
98         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
99         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
100         OpenType math.
101         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
102         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
103         (WebCore::doubleToHarfBuzzPosition): Ditto.
104         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
105         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
106         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
107         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
108         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
109         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
110         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
111         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
112         * platform/graphics/harfbuzz/HbUniquePtr.h:
113         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
114         * platform/graphics/opentype/OpenTypeMathData.cpp:
115         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
116
117 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
118
119         [FreeType] Add initial implementation of variation fonts
120         https://bugs.webkit.org/show_bug.cgi?id=192151
121
122         Reviewed by Michael Catanzaro.
123
124         * css/CSSFontFaceSource.cpp:
125         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
126         * loader/cache/CachedFont.cpp:
127         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
128         * platform/graphics/FontPlatformData.h:
129         (WebCore::FontPlatformData::isFixedWidth const):
130         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
131         * platform/graphics/freetype/FontCacheFreeType.cpp:
132         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
133         pattern.
134         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
135         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
136         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
137         (WebCore::defaultVariationValues): Parse font variations table.
138         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
139         * platform/graphics/freetype/FontCacheFreeType.h: Added.
140         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
141         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
142         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
143         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
144         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
145         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
146         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
147         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
148         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
149         FC_FONT_VARIATIONS value from the pattern.
150         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
151         pattern.
152         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
153         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
154         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
155         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
156         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
157         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
158         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
159         * platform/graphics/win/FontCustomPlatformData.cpp:
160         (WebCore::FontCustomPlatformData::fontPlatformData):
161         * platform/graphics/win/FontCustomPlatformData.h:
162
163 2018-12-12  Fujii Hironori  <Hironori.Fujii@sony.com>
164
165         [Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFrame' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
166         https://bugs.webkit.org/show_bug.cgi?id=192618
167
168         Reviewed by Alex Christensen.
169
170         No new tests, no behavior changes.
171
172         * platform/win/PopupMenuWin.h:
173         * platform/win/WCDataObject.cpp:
174         * platform/win/WCDataObject.h:
175
176 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
177
178         REGRESSION (r238090): CAPCHA UI jumps to the wrong location
179         https://bugs.webkit.org/show_bug.cgi?id=192651
180         rdar://problem/46531919
181
182         Reviewed by Zalan Bujtas.
183         
184         When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
185         bit to say that descendants need their geometry updated (because they now have to
186         compute their positions relative to a different ancestor). This wasn't happening
187         in the layerStyleChanged() code path.
188         
189         In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
190         we can address a FIXME and only dirty direct children, not all descendants (that code was
191         written before the child-only dirty bit existed).
192
193         Test: compositing/geometry/update-child-geometry-on-compositing-change.html
194
195         * rendering/RenderLayerCompositor.cpp:
196         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
197         (WebCore::RenderLayerCompositor::layerStyleChanged):
198
199 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
200
201         Make TextInputController.legacyAttributedString take DOM nodes and offsets
202         https://bugs.webkit.org/show_bug.cgi?id=192653
203
204         Reviewed by Wenson Hsieh.
205
206         No new tests since there should be no observable behavioral change other than
207         TextInputController API in DumpRenderTree.
208
209         * editing/cocoa/HTMLConverter.h:
210         * editing/cocoa/HTMLConverter.mm:
211         (WebCore::attributedStringFromSelection):
212         (WebCore::attributedStringBetweenStartAndEnd): Added.
213
214 2018-12-12  Ryosuke Niwa  <rniwa@webkit.org>
215
216         Fix macOS builds after r239145.
217
218         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
219
220 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
221
222         REGRESSION (r238357): Pins on Yelp map disappear
223         https://bugs.webkit.org/show_bug.cgi?id=192597
224         rdar://problem/46578285
225
226         Reviewed by Zalan Bujtas.
227
228         RenderLayerCompositor::updateBackingAndHierarchy() had a bug where if a RenderLayer gained
229         a negative z-order child (triggering creation of a foreground layer), we'd fail to 
230         call the "setChildren()" with the vector containing that foreground layer.
231         
232         When updateBackingAndHierarchy() stops visiting descendants because none are composited,
233         it may still have to update the child list with the foreground layer, so make sure
234         the code handles this case.
235
236         Tests: compositing/z-order/add-negative-z-child.html
237                compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html
238
239         * rendering/RenderLayer.cpp:
240         (WebCore::outputPaintOrderTreeRecursive):
241         * rendering/RenderLayerCompositor.cpp:
242         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
243
244 2018-12-12  YUHAN WU  <yuhan_wu@apple.com>
245
246         Implement non-timeslice mode encoding for MediaRecorder
247         https://bugs.webkit.org/show_bug.cgi?id=192069
248         <rdar://problem/46443290>
249
250         Reviewed by Eric Carlson.
251
252         Implement the encoding for non-timeslice mode of MediaRecorder.
253         It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
254         Add a API in internals to allow testings to turn on the mock source.
255
256         Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
257
258         * Modules/mediarecorder/MediaRecorder.cpp:
259         (WebCore::MediaRecorder::create):
260         (WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
261         (WebCore::MediaRecorder::getPrivateImpl):
262         (WebCore::MediaRecorder::MediaRecorder):
263         (WebCore::MediaRecorder::stopRecording):
264         (WebCore::MediaRecorder::stopRecordingInternal):
265         (WebCore::MediaRecorder::createRecordingDataBlob):
266         (WebCore::MediaRecorder::scheduleDeferredTask):
267         * Modules/mediarecorder/MediaRecorder.h:
268         * Modules/mediarecorder/MediaRecorder.idl:
269         * SourcesCocoa.txt:
270         * WebCore.xcodeproj/project.pbxproj:
271         * platform/mediarecorder/MediaRecorderPrivate.h:
272         (WebCore::MediaRecorderPrivate::stopRecording):
273         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
274         (WebCore::MediaRecorderPrivateAVFImpl::create):
275         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
276         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
277         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
278         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
279         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
280         (WebCore::MediaRecorderPrivateAVFImpl::mimeType):
281         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
282         * platform/mediarecorder/MediaRecorderPrivateMock.cpp:
283         (WebCore::MediaRecorderPrivateMock::fetchData):
284         (WebCore::MediaRecorderPrivateMock::mimeType):
285         * platform/mediarecorder/MediaRecorderPrivateMock.h:
286         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added.
287         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
288         (WebCore::MediaRecorderPrivateWriter::clear):
289         (WebCore::MediaRecorderPrivateWriter::setupWriter):
290         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
291         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
292         (WebCore::copySampleBufferWithCurrentTimeStamp):
293         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
294         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
295         (WebCore::MediaRecorderPrivateWriter::stopRecording):
296         * testing/Internals.cpp:
297         (WebCore::createRecorderMockSource):
298         (WebCore::Internals::setCustomPrivateRecorderCreator):
299         * testing/Internals.h:
300         * testing/Internals.idl:
301
302 2018-12-12  Justin Fan  <justin_fan@apple.com>
303
304         [WebGPU] Vertex buffers and WebGPUInputState
305         https://bugs.webkit.org/show_bug.cgi?id=192611
306
307         Reviewed by Dean Jackson.
308
309         Test: webgpu/vertex-buffer-triangle-strip.html
310
311         Basic implementation of vertex buffers with Metal shading language in WebGPU. In 
312         WebGPURenderPipelineDescriptor, refactor to match updated shader stage structure and add 
313         WebGPUInputStateDescriptor. Also implement WebGPURenderPassEncoder::setVertexBuffers.
314
315         Add symbols and files for WebGPUIndexFormat, WebGPUInputStateDescriptor, WebGPUInputStepMode, 
316         WebGPUVertexAttributeDescriptor, WebGPUVertexFormat, WebGPUVertexInputDescriptor:
317         * CMakeLists.txt:
318         * DerivedSources.make:
319         * Sources.txt:
320         * WebCore.xcodeproj/project.pbxproj:
321         * bindings/js/WebCoreBuiltinNames.h:
322
323         Add and implement interfaces and dictionaries for WebGPUInputState:
324         * Modules/webgpu/WebGPUBuffer.cpp:
325         (WebCore::WebGPUBuffer::WebGPUBuffer):
326         * Modules/webgpu/WebGPUBuffer.h:
327         (WebCore::WebGPUBuffer::buffer const): Added getter for backing GPUBuffer.
328         * Modules/webgpu/WebGPUBufferDescriptor.h:
329         * Modules/webgpu/WebGPUBufferDescriptor.idl: Moving WebGPUBufferUsage out into its own IDL.
330         * Modules/webgpu/WebGPUDevice.h:
331         * Modules/webgpu/WebGPUIndexFormat.h: Added.
332         * Modules/webgpu/WebGPUIndexFormat.idl: Added. 
333         * Modules/webgpu/WebGPUInputStateDescriptor.h: Added.
334         * Modules/webgpu/WebGPUInputStateDescriptor.idl: Added.
335         * Modules/webgpu/WebGPUInputStepMode.h: Added.
336         * Modules/webgpu/WebGPUInputStepMode.idl: Added.
337         * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Added.
338         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl: Added.
339         * Modules/webgpu/WebGPUVertexFormat.h: Added.
340         * Modules/webgpu/WebGPUVertexFormat.idl: Added.
341         * Modules/webgpu/WebGPUVertexInputDescriptor.h: Added.
342         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: Added.
343         * platform/graphics/gpu/GPUInputStateDescriptor.h: Added.
344         * platform/graphics/gpu/GPURenderPassEncoder.h: Added.
345         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Added.
346         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Added.
347         * platform/graphics/gpu/GPUVertexInputDescriptor.h: Added.
348
349         Refactor to support updated structure of pipeline descriptor in sketch IDL:
350         * Modules/webgpu/WebGPUDevice.cpp:
351         (WebCore::validateAndConvertPipelineStage):
352         (WebCore::WebGPUDevice::createRenderPipeline const):
353         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
354         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
355         * Modules/webgpu/WebGPUPipelineStageDescriptor.h:
356         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
357         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
358         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
359         * Modules/webgpu/WebGPUShaderStage.*: Removed.
360
361         Add and implement setVertexBuffers:
362         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
363         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Added. 
364         * Modules/webgpu/WebGPURenderPassEncoder.h:
365         * Modules/webgpu/WebGPURenderPassEncoder.idl: 
366         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
367         (WebCore::GPURenderPassEncoder::setVertexBuffers):
368         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
369         (WebCore::setInputStateForPipelineDescriptor):
370         (WebCore::GPURenderPipeline::create):
371
372 2018-12-12  Tim Horton  <timothy_horton@apple.com>
373
374         REGRESSION (r237565): >20 Find in Page highlights in one tile results in a single giant highlight
375         https://bugs.webkit.org/show_bug.cgi?id=192642
376         <rdar://problem/46498246>
377
378         Reviewed by Geoffrey Garen.
379
380         No new tests; adjusted an existing test instead.
381
382         * platform/graphics/PathUtilities.cpp:
383         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
384         Instead of uniting when we fail to shrink-wrap, just return the original rects.
385         This seems like a more reasonable default in most cases.
386
387 2018-12-12  Vivek Seth  <v_seth@apple.com>
388
389         HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
390         https://bugs.webkit.org/show_bug.cgi?id=192375
391         <rdar://problem/45851159>
392
393         Reviewed by Chris Dumez.
394
395         Use simulated redirect to tell clients that HTTPS Upgrade happened.
396
397         * platform/network/ResourceResponseBase.cpp:
398         (WebCore::ResourceResponseBase::syntheticRedirectResponse):
399         * platform/network/ResourceResponseBase.h:
400         * platform/network/mac/WebCoreURLResponse.mm:
401         (WebCore::synthesizeRedirectResponseIfNecessary):
402
403 2018-12-12  Chris Dumez  <cdumez@apple.com>
404
405         Add a preference to enable / disable devicemotion and deviceorientation events
406         https://bugs.webkit.org/show_bug.cgi?id=192631
407         <rdar://problem/46646244>
408
409         Reviewed by Geoffrey Garen.
410
411         Add setting to toggle support for the deviceorientation / devicemotion events:
412         - https://w3c.github.io/deviceorientation/
413
414         * page/DOMWindow.cpp:
415         (WebCore::DOMWindow::addEventListener):
416         * page/Settings.yaml:
417
418 2018-12-11  Ryosuke Niwa  <rniwa@webkit.org>
419
420         Make HTMLConverter take two Positions in preparation to make it work with shadow DOM
421         https://bugs.webkit.org/show_bug.cgi?id=192613
422
423         Reviewed by Darin Adler.
424
425         This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with
426         a selection which spans across shadow boundaries in the future.
427
428         No new tests since there should be no observable behavioral change.
429
430         * editing/cocoa/EditorCocoa.mm:
431         (WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard.
432         (WebCore::Editor::writeSelection): Ditto.
433         * editing/cocoa/HTMLConverter.h:
434         * editing/cocoa/HTMLConverter.mm:
435         (HTMLConverter::HTMLConverter): Now takes two Position's.
436         (HTMLConverter::convert): Updated to work with Position's.
437         (HTMLConverter::_processText): Ditto.
438         (HTMLConverter::_traverseNode): Ditto.
439         (HTMLConverter::_traverseFooterNode): Ditto.
440         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto.
441         (WebCore::attributedStringFromRange): Ditto.
442         (WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange
443         in order to preserve the exact behavior.
444
445 2018-12-12  Michael Catanzaro  <mcatanzaro@igalia.com>
446
447         Unreviewed manual rollout of r239100-r239102 and r239116
448         https://bugs.webkit.org/show_bug.cgi?id=192151
449         <rdar://problem/46655586>
450
451         * css/CSSFontFaceSource.cpp:
452         (WebCore::CSSFontFaceSource::font):
453         * loader/cache/CachedFont.cpp:
454         (WebCore::CachedFont::platformDataFromCustomData):
455         * platform/FreeType.cmake:
456         * platform/graphics/FontPlatformData.h:
457         (WebCore::FontPlatformData::isFixedWidth const): Deleted.
458         * platform/graphics/cairo/FontCustomPlatformData.h:
459         * platform/graphics/freetype/FontCacheFreeType.cpp:
460         (WebCore::FontCache::systemFallbackForCharacters):
461         (WebCore::FontCache::createFontPlatformData):
462         (WebCore::getFontPropertiesFromPattern): Deleted.
463         (WebCore::defaultVariationValues): Deleted.
464         (WebCore::buildVariationSettings): Deleted.
465         * platform/graphics/freetype/FontCacheFreeType.h: Removed.
466         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
467         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
468         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
469         (WebCore::FontCustomPlatformData::fontPlatformData):
470         (WebCore::FontCustomPlatformData::supportsFormat):
471         (WebCore::defaultFontconfigOptions): Deleted.
472         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
473         (WebCore::setCairoFontOptionsFromFontConfigPattern):
474         (WebCore::getDefaultFontconfigOptions):
475         (WebCore::FontPlatformData::FontPlatformData):
476         (WebCore::FontPlatformData::operator=):
477         (WebCore::FontPlatformData::harfBuzzFace const):
478         (WebCore::FontPlatformData::platformIsEqual const):
479         (WebCore::FontPlatformData::buildScaledFont):
480         (WebCore::FontPlatformData::fcPattern const): Deleted.
481         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Deleted.
482         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
483         (WebCore::Font::platformCreateScaledFont const):
484         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
485         (WebCore::fontFeatures):
486         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
487         (WebCore::floatToHarfBuzzPosition): Deleted.
488         (WebCore::doubleToHarfBuzzPosition): Deleted.
489         (WebCore::harfBuzzFontFunctions): Deleted.
490         (WebCore::findScriptForVerticalGlyphSubstitution): Deleted.
491         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Added.
492         (WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
493         (WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
494         (WebCore::HarfBuzzFace::cache):
495         (WebCore::HarfBuzzFace::HarfBuzzFace):
496         (WebCore::HarfBuzzFace::~HarfBuzzFace):
497         (WebCore::findScriptForVerticalGlyphSubstitution):
498         (WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
499         * platform/graphics/harfbuzz/HarfBuzzFace.h: Added.
500         (WebCore::HarfBuzzFace::CacheEntry::create):
501         (WebCore::HarfBuzzFace::CacheEntry::face):
502         (WebCore::HarfBuzzFace::CacheEntry::glyphCache):
503         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Added.
504         (WebCore::floatToHarfBuzzPosition):
505         (WebCore::doubleToHarfBuzzPosition):
506         (WebCore::CairoGetGlyphWidthAndExtents):
507         (WebCore::harfBuzzGetGlyph):
508         (WebCore::harfBuzzGetGlyphHorizontalAdvance):
509         (WebCore::harfBuzzGetGlyphHorizontalOrigin):
510         (WebCore::harfBuzzGetGlyphExtents):
511         (WebCore::harfBuzzCairoTextGetFontFuncs):
512         (WebCore::harfBuzzCairoGetTable):
513         (WebCore::HarfBuzzFace::createFace):
514         (WebCore::HarfBuzzFace::createFont):
515         * platform/graphics/harfbuzz/HbUniquePtr.h:
516         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Deleted.
517         * platform/graphics/opentype/OpenTypeMathData.cpp:
518         (WebCore::OpenTypeMathData::OpenTypeMathData):
519         * platform/graphics/win/FontCustomPlatformData.cpp:
520         (WebCore::FontCustomPlatformData::fontPlatformData):
521         * platform/graphics/win/FontCustomPlatformData.h:
522         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
523         (WebCore::FontCustomPlatformData::fontPlatformData):
524
525 2018-12-12  Chris Dumez  <cdumez@apple.com>
526
527         Unreviewed attempt to fix Windows Cairo build after r239100.
528
529         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
530         (WebCore::FontCustomPlatformData::fontPlatformData):
531
532 2018-12-12  Wenson Hsieh  <wenson_hsieh@apple.com>
533
534         [iOS] A few API tests are failing after r239086
535         https://bugs.webkit.org/show_bug.cgi?id=192608
536
537         Reviewed by Zalan Bujtas.
538
539         These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing
540         the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest
541         fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab
542         the highest fidelity path using Vector::first().
543
544         While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths,
545         this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear.
546
547         * platform/PasteboardItemInfo.h:
548         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
549         * platform/ios/PasteboardIOS.mm:
550         (WebCore::Pasteboard::readRespectingUTIFidelities):
551         (WebCore::Pasteboard::readFilePaths):
552
553 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
554
555         Unreviewed. Fix WPE build after r239101.
556
557         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include <hb-ot.h>
558
559 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
560
561         [FreeType] Remove HarfBuzzFace
562         https://bugs.webkit.org/show_bug.cgi?id=192589
563
564         Reviewed by Michael Catanzaro.
565
566         This was used to share the common implementation with the chromium port, but now that only freetype based ports
567         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
568         since we are already caching glyphs in Font.
569
570         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
571         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
572         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
573         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
574         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
575         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
576         OpenType math.
577         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
578         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
579         (WebCore::doubleToHarfBuzzPosition): Ditto.
580         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
581         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
582         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
583         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
584         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
585         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
586         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
587         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
588         * platform/graphics/harfbuzz/HbUniquePtr.h:
589         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
590         * platform/graphics/opentype/OpenTypeMathData.cpp:
591         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
592
593 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
594
595         [FreeType] Add initial implementation of variation fonts
596         https://bugs.webkit.org/show_bug.cgi?id=192151
597
598         Reviewed by Michael Catanzaro.
599
600         * css/CSSFontFaceSource.cpp:
601         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
602         * loader/cache/CachedFont.cpp:
603         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
604         * platform/graphics/FontPlatformData.h:
605         (WebCore::FontPlatformData::isFixedWidth const):
606         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
607         * platform/graphics/freetype/FontCacheFreeType.cpp:
608         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
609         pattern.
610         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
611         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
612         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
613         (WebCore::defaultVariationValues): Parse font variations table.
614         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
615         * platform/graphics/freetype/FontCacheFreeType.h: Added.
616         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
617         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
618         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
619         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
620         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
621         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
622         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
623         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
624         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
625         FC_FONT_VARIATIONS value from the pattern.
626         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
627         pattern.
628         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
629         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
630         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
631         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
632         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
633         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
634         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
635         * platform/graphics/win/FontCustomPlatformData.cpp:
636         (WebCore::FontCustomPlatformData::fontPlatformData):
637         * platform/graphics/win/FontCustomPlatformData.h:
638
639 2018-12-11  Justin Michaud  <justin_michaud@apple.com>
640
641         Implement feature flag for CSS Typed OM
642         https://bugs.webkit.org/show_bug.cgi?id=192610
643
644         Reviewed by Ryosuke Niwa.
645
646         * Configurations/FeatureDefines.xcconfig:
647         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
648         * css/typedom/StylePropertyMapReadOnly.h:
649         * css/typedom/StylePropertyMapReadOnly.idl:
650         * css/typedom/TypedOMCSSImageValue.h:
651         * css/typedom/TypedOMCSSImageValue.idl:
652         * css/typedom/TypedOMCSSNumericValue.h:
653         * css/typedom/TypedOMCSSNumericValue.idl:
654         * css/typedom/TypedOMCSSStyleValue.h:
655         * css/typedom/TypedOMCSSStyleValue.idl:
656         * css/typedom/TypedOMCSSUnitValue.h:
657         * css/typedom/TypedOMCSSUnitValue.idl:
658         * css/typedom/TypedOMCSSUnparsedValue.h:
659         * css/typedom/TypedOMCSSUnparsedValue.idl:
660         * features.json:
661         * html/ImageBitmap.cpp:
662         * html/ImageBitmap.h:
663         * html/canvas/CanvasDrawImage.idl:
664         * html/canvas/CanvasFillStrokeStyles.idl:
665         * html/canvas/CanvasRenderingContext2DBase.cpp:
666         * html/canvas/CanvasRenderingContext2DBase.h:
667         * inspector/InspectorCanvas.cpp:
668         (WebCore::InspectorCanvas::buildAction):
669         * page/RuntimeEnabledFeatures.h:
670         (WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled):
671         (WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const):
672         * page/WindowOrWorkerGlobalScope.idl:
673
674 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
675
676         connectedCallback is invoked during the removal of the element inside another element's connectedCallback
677         https://bugs.webkit.org/show_bug.cgi?id=183586
678         <rdar://problem/38403504>
679
680         Reviewed by Frédéric Wang.
681
682         Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760
683
684         After much discussion, it's unclear that there is a clear path forward to fixing the oddness that
685         the presence of a custom element reaction changes the timing at which another reaction callback gets invoked.
686         So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability.
687
688         Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element
689         does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in:
690         https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction
691             1. Let definition be element's custom element definition.
692             2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName.
693             3. If callback is null, then return
694             4. If callbackName is "attributeChangedCallback", then:
695                 1. Let attributeName be the first element of args.
696                 2. If definition's observed attributes does not contain attributeName, then return.
697             5. Add a new callback reaction to element's custom element reaction queue, with callback function callback
698                and arguments args.
699             6. Enqueue an element on the appropriate element queue given element.
700
701         Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html
702
703         * dom/CustomElementReactionQueue.cpp:
704         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
705         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
706         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
707         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
708         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
709         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
710         (WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue.
711         * dom/CustomElementReactionQueue.h:
712
713 2018-12-11  Justin Fan  <justin_fan@apple.com>
714
715         [WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU
716         https://bugs.webkit.org/show_bug.cgi?id=192516
717
718         Reviewed by Dean Jackson.
719
720         Test: webgpu/buffers.html
721
722         Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation.
723
724         Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor:
725         * CMakeLists.txt:
726         * DerivedSources.make:
727         * Sources.txt:
728         * SourcesCocoa.txt:
729         * WebCore.xcodeproj/project.pbxproj:
730         * bindings/js/WebCoreBuiltinNames.h:
731
732         * Modules/webgpu/WebGPUBuffer.cpp: Added.
733         (WebCore::WebGPUBuffer::create):
734         (WebCore::WebGPUBuffer::WebGPUBuffer):
735         * Modules/webgpu/WebGPUBuffer.h: Added.
736         (WebCore::WebGPUBuffer::mapping const):
737         (WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear.
738         (WebCore::WebGPUBuffer::destroy): Unimplemented stub.
739         * Modules/webgpu/WebGPUBuffer.idl: Added.
740         * Modules/webgpu/WebGPUBufferDescriptor.h: Added.
741         * Modules/webgpu/WebGPUBufferDescriptor.idl: Added.
742         * Modules/webgpu/WebGPUDevice.cpp:
743         (WebCore::WebGPUDevice::createBuffer const): Added.
744         * platform/graphics/gpu/GPUBuffer.h:
745         (WebCore::GPUBuffer::platformBuffer const):
746         (WebCore::GPUBuffer::mapping const):
747         * platform/graphics/gpu/GPUBufferDescriptor.h: Added.
748         * platform/graphics/gpu/GPUDevice.cpp:
749         (WebCore::GPUDevice::createBuffer const): Added.
750         * platform/graphics/gpu/GPUDevice.h:
751         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added.
752         (WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer. 
753         (WebCore::GPUBuffer::GPUBuffer):
754         (WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first.
755
756         Small benign edits, most to make nullability more consistent in WebGPU classes:
757         * Modules/webgpu/WebGPUCommandBuffer.cpp:
758         (WebCore::WebGPUCommandBuffer::create):
759         (WebCore::WebGPUCommandBuffer::beginRenderPass):
760         * Modules/webgpu/WebGPUCommandBuffer.h:
761         * Modules/webgpu/WebGPUDevice.cpp:
762         (WebCore::WebGPUDevice::create):
763         (WebCore::WebGPUDevice::WebGPUDevice):
764         (WebCore::WebGPUDevice::createShaderModule const):
765         (WebCore::WebGPUDevice::createRenderPipeline const):
766         (WebCore::WebGPUDevice::createCommandBuffer const):
767         * Modules/webgpu/WebGPUDevice.h:
768         (WebCore::WebGPUDevice::device const):
769         * Modules/webgpu/WebGPUDevice.idl:
770         * Modules/webgpu/WebGPUQueue.cpp:
771         (WebCore::WebGPUQueue::create):
772         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
773         (WebCore::WebGPURenderPassEncoder::create):
774         * Modules/webgpu/WebGPURenderPassEncoder.h:
775         * Modules/webgpu/WebGPUShaderModule.cpp:
776         (WebCore::WebGPUShaderModule::create):
777         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
778         * Modules/webgpu/WebGPUShaderModule.h:
779         (WebCore::WebGPUShaderModule::module const):
780         * Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes.
781         * Modules/webgpu/WebGPUTexture.cpp:
782         (WebCore::WebGPUTexture::create):
783         (WebCore::WebGPUTexture::createDefaultTextureView):
784         * Modules/webgpu/WebGPUTextureView.cpp:
785         (WebCore::WebGPUTextureView::create):
786         * Modules/webgpu/WebGPUTextureView.h:
787         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
788         (WebCore::GPUQueue::create):
789         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
790         (WebCore::GPURenderPipeline::create):
791         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
792         (WebCore::GPUShaderModule::create):
793         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
794         (WebCore::GPUSwapChain::setDevice):
795         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
796         (WebCore::GPUTexture::GPUTexture):
797
798 2018-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
799
800         [Win][Clang] Fix warning -Wmissing-field-initializers
801         https://bugs.webkit.org/show_bug.cgi?id=192584
802
803         Reviewed by Yusuke Suzuki.
804
805         Initialize a struct with '{ }' instead of '= {0}'.
806
807         No new tests, no behavior changes.
808
809         * platform/graphics/win/FontCacheWin.cpp:
810         (WebCore::FontCache::lastResortFallbackFont):
811         * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
812         (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
813         * platform/win/ClipboardUtilitiesWin.cpp:
814         (WebCore::setFileDescriptorData):
815         (WebCore::setFileContentData):
816         (WebCore::setUCharData):
817         (WebCore::setUtf8Data):
818         (WebCore::setCFData):
819         * platform/win/CursorWin.cpp:
820         (WebCore::createSharedCursor):
821         * platform/win/DefWndProcWindowClass.cpp:
822         (WebCore::registerClass):
823         * platform/win/DragImageWin.cpp:
824         (WebCore::createDragImageIconForCachedImageFilename):
825         * platform/win/PasteboardWin.cpp:
826         (WebCore::writeURL):
827         (WebCore::Pasteboard::writeString):
828         (WebCore::Pasteboard::writeRangeToDataObject):
829         (WebCore::Pasteboard::writePlainTextToDataObject):
830         (WebCore::writeFileToDataObject):
831         (WebCore::Pasteboard::writeMarkup):
832         * platform/win/PopupMenuWin.cpp:
833         (WebCore::PopupMenuWin::show):
834         * platform/win/SSLKeyGeneratorWin.cpp:
835         (WebCore::WebCore::signedPublicKeyAndChallengeString):
836
837 2018-12-11  Jer Noble  <jer.noble@apple.com>
838
839         Globally namespaced objects shouldn't use framework-prefixed names
840         https://bugs.webkit.org/show_bug.cgi?id=192600
841
842         Reviewed by Eric Carlson.
843
844         Rename CMSampleBufferIs... -> isCMSampleBuffer...
845
846         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
847         (WebCore::isCMSampleBufferRandomAccess):
848         (WebCore::isCMSampleBufferNonDisplaying):
849         (WebCore::MediaSampleAVFObjC::flags const):
850         (WebCore::CMSampleBufferIsRandomAccess): Deleted.
851         (WebCore::CMSampleBufferIsNonDisplaying): Deleted.
852
853 2018-12-11  Brent Fulgham  <bfulgham@apple.com>
854
855         Don't attempt to compute animated values when there is no relevant animation
856         https://bugs.webkit.org/show_bug.cgi?id=192591
857         <rdar://problem/34336946>
858
859         Reviewed by Dean Jackson.
860
861         Check if the property is supposed to be animated, or has animatable features, before
862         attempting to calculate the current animated value.
863
864         Test: svg/animations/avoid-calculating-for-non-animating-elements.html
865
866         * svg/SVGAnimateElementBase.cpp:
867         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
868
869 2018-12-11  Chris Dumez  <cdumez@apple.com>
870
871         Unreviewed, fix typos in console log from r239087.
872
873         * page/DOMWindow.cpp:
874         (WebCore::DOMWindow::addEventListener):
875
876 2018-12-11  Tim Horton  <timothy_horton@apple.com>
877
878         WebCore shouldn't have a Objective-C class named NSCursor
879         https://bugs.webkit.org/show_bug.cgi?id=192602
880         <rdar://problem/46615532>
881
882         Reviewed by Wenson Hsieh.
883
884         * platform/ios/wak/WAKAppKitStubs.h:
885         * platform/ios/wak/WAKAppKitStubs.m:
886         (+[NSCursor setHiddenUntilMouseMoves:]): Deleted.
887         Get rid of the class.
888         Also remove a comment that seems to have detached from wherever it's supposed to be.
889
890 2018-12-11  Chris Dumez  <cdumez@apple.com>
891
892         Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
893         https://bugs.webkit.org/show_bug.cgi?id=192595
894         <rdar://problem/46382603>
895
896         Reviewed by Dean Jackson.
897
898         Tests: http/tests/events/device-orientation-motion-non-secure-context.html
899                http/tests/events/device-orientation-motion-secure-context.html
900
901         * page/DOMWindow.cpp:
902         (WebCore::DOMWindow::addEventListener):
903         * page/SecurityOrigin.h:
904         (WebCore::SecurityOrigin::setIsPotentiallyTrustworthy):
905         * testing/Internals.cpp:
906         (WebCore::Internals::markContextAsInsecure):
907         (WebCore::Internals::postTask):
908         * testing/Internals.h:
909         * testing/Internals.idl:
910
911 2018-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>
912
913         [iOS] Send the full list of file upload URLs and types in PasteboardItemInfo
914         https://bugs.webkit.org/show_bug.cgi?id=192598
915         Work towards <rdar://problem/35626913>
916
917         Reviewed by Tim Horton.
918
919         Refactors PasteboardItemInfo to contain lists of file URLs and corresponding pasteboard types, instead of just
920         a "preferred" file upload URL and type. See below for more details.
921
922         * platform/PasteboardItemInfo.h:
923         (WebCore::PasteboardItemInfo::pathForContentType const):
924
925         Add a helper method to find a file upload URL corresponding to a given type.
926
927         (WebCore::PasteboardItemInfo::encode const):
928         (WebCore::PasteboardItemInfo::decode):
929
930         Change `pathForFileUpload` to `pathsForFileUpload`, and `contentTypeForFileUpload` to `contentTypesForFileUpload`.
931
932         * platform/ios/AbstractPasteboard.h:
933         * platform/ios/PasteboardIOS.mm:
934         (WebCore::Pasteboard::readRespectingUTIFidelities):
935
936         Adjust this to take the file path for the highest fidelity representation in `pathsForContentType`.
937
938         (WebCore::Pasteboard::readFilePaths):
939         * platform/ios/PlatformPasteboardIOS.mm:
940         (WebCore::PlatformPasteboard::informationForItemAtIndex):
941         * platform/ios/WebItemProviderPasteboard.h:
942         * platform/ios/WebItemProviderPasteboard.mm:
943         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
944         (-[NSItemProvider web_fileUploadContentTypes]):
945
946         Replace `web_containsFileUploadContent` with `web_fileUploadContentTypes`, which returns the full list of file
947         upload content types (rather than just a `BOOL` indicating whether one or more of these types exist).
948
949         (-[WebItemProviderPasteboard fileUploadURLsAtIndex:fileTypes:]):
950         (-[WebItemProviderPasteboard numberOfFiles]):
951         (-[NSItemProvider web_containsFileUploadContent]): Deleted.
952         (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): Deleted.
953
954         Replaced with `-fileUploadURLsAtIndex:fileTypes:`. This implementation currently just returns the highest
955         fidelity loaded type identifier, but this is wrong because it doesn't take into account inline data types that
956         shouldn't be represented as data for file uploads (for instance, it never makes sense to upload the internal
957         data serialization for an `NSURL` as a file on the web).
958
959         Instead, use existing logic in `web_fileUploadContentTypes` to determine which file types can be treated as file
960         uploads, and return all of these file types that we've loaded.
961
962 2018-12-11  Don Olmstead  <don.olmstead@sony.com>
963
964         Resource Load Statistics: Use common implementation within NetworkStorageSession
965         https://bugs.webkit.org/show_bug.cgi?id=192592
966
967         Reviewed by Alex Christensen.
968
969         There's nothing within the resource load statistics implementation contained
970         in NetworkStorageSessionCFNet that was CF specific. All of the resource load
971         statistics methods are moved from that file to the root NetworkStorageSession
972         implementation.
973
974         * platform/network/NetworkStorageSession.cpp:
975         (WebCore::getPartitioningDomain):
976         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
977         (WebCore::NetworkStorageSession::shouldBlockCookies const):
978         (WebCore::NetworkStorageSession::maxAgeCacheCap):
979         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
980         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
981         (WebCore::NetworkStorageSession::removePrevalentDomains):
982         (WebCore::NetworkStorageSession::hasStorageAccess const):
983         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
984         (WebCore::NetworkStorageSession::grantStorageAccess):
985         (WebCore::NetworkStorageSession::removeStorageAccessForFrame):
986         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
987         (WebCore::NetworkStorageSession::removeAllStorageAccess):
988         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
989         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
990         * platform/network/NetworkStorageSession.h:
991         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
992         (WebCore::getPartitioningDomain): Deleted.
993         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): Deleted.
994         (WebCore::NetworkStorageSession::shouldBlockCookies const): Deleted.
995         (WebCore::NetworkStorageSession::maxAgeCacheCap): Deleted.
996         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): Deleted.
997         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted.
998         (WebCore::NetworkStorageSession::removePrevalentDomains): Deleted.
999         (WebCore::NetworkStorageSession::hasStorageAccess const): Deleted.
1000         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const): Deleted.
1001         (WebCore::NetworkStorageSession::grantStorageAccess): Deleted.
1002         (WebCore::NetworkStorageSession::removeStorageAccessForFrame): Deleted.
1003         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
1004         (WebCore::NetworkStorageSession::removeAllStorageAccess): Deleted.
1005         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): Deleted.
1006         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): Deleted.
1007
1008 2018-12-11  Devin Rousso  <drousso@apple.com>
1009
1010         Web Inspector: overlay bounds rulers don't match element when page is scrolled
1011         https://bugs.webkit.org/show_bug.cgi?id=192577
1012
1013         Reviewed by Joseph Pecoraro.
1014
1015         When drawing the highlight for a node, the canvas is translated based on the scroll position
1016         of the node. This translation was not applied to the bounds calculations, which meant that
1017         the bounds always drew where the node would have been if it wasn't scrolled.
1018
1019         * inspector/InspectorOverlayPage.js:
1020         (Bounds.prototype.get minX):
1021         (Bounds.prototype.get minY):
1022         (Bounds.prototype.get maxX):
1023         (Bounds.prototype.get maxY):
1024         (Bounds.prototype.offset): Added.
1025         (drawNodeHighlight):
1026         Drive-by: draw bounds for every node being highlighted instead of just the first one.
1027         Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast.
1028
1029 2018-12-11  Andy Estes  <aestes@apple.com>
1030
1031         Introduce makeBlockPtr for lambdas
1032         https://bugs.webkit.org/show_bug.cgi?id=192594
1033
1034         Reviewed by Alex Christensen.
1035
1036         Adopted makeBlockPtr.
1037
1038         * platform/cocoa/FileMonitorCocoa.mm:
1039         (WebCore::FileMonitor::FileMonitor):
1040         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
1041         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
1042         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm:
1043         (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
1044         * platform/network/cocoa/WebCoreNSURLSession.mm:
1045         (-[WebCoreNSURLSession addDelegateOperation:]):
1046         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
1047         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1048         (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
1049
1050 2018-12-10  Brent Fulgham  <bfulgham@apple.com>
1051
1052         SVGViewSpec objects should mark relevant SVG elements
1053         https://bugs.webkit.org/show_bug.cgi?id=192567
1054         <rdar://problem/46491325>
1055
1056         Reviewed by Ryosuke Niwa.
1057
1058         SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to
1059         recognize the relevant SVGElement as active as long as the SVGViewSpec is active.
1060
1061         Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare
1062         pointer to the SVGElement, so switched to a WeakPtr.
1063
1064         Test: svg/animations/view-dependency-crash.html
1065
1066         * Sources.txt: Add new files.
1067         * WebCore.xcodeproj/project.pbxproj: Ditto.
1068         * bindings/js/JSSVGViewSpecCustom.cpp: Added.
1069         (WebCore::JSSVGViewSpec::visitAdditionalChildren):
1070         * svg/SVGElement.h:
1071         * svg/SVGPathElement.h:
1072         * svg/SVGViewSpec.cpp:
1073         (WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element.
1074         * svg/SVGViewSpec.h:
1075         * svg/SVGViewSpec.idl:
1076         * svg/properties/SVGAttributeOwnerProxy.cpp: Added.
1077         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to
1078         the underling SVGElement.
1079         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
1080         * svg/properties/SVGAttributeOwnerProxy.h:
1081         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file.
1082         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
1083         * svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use.
1084
1085 2018-12-10  Benjamin Poulain  <benjamin@webkit.org>
1086
1087         <rdar://problem/45296285> Content blocker rule "raw" blocks media elements from loading
1088         https://bugs.webkit.org/show_bug.cgi?id=192439
1089
1090         Reviewed by Dean Jackson.
1091
1092         This broken when WebKit switched to NSURLSession.
1093         In CachedResourceLoader::requestResource(), toResourceType() was turning media load into RAW.
1094
1095         Test: http/tests/contentextensions/video-element-resource-type.html
1096
1097         * loader/ResourceLoadInfo.cpp:
1098         (WebCore::toResourceType):
1099
1100 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
1101
1102         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
1103         https://bugs.webkit.org/show_bug.cgi?id=192573
1104
1105         Reviewed by Simon Fraser.
1106
1107         * Configurations/FeatureDefines.xcconfig:
1108
1109 2018-12-10  Justin Michaud  <justin_michaud@apple.com>
1110
1111         CS Painting API should support multiple worklets.
1112         https://bugs.webkit.org/show_bug.cgi?id=192335
1113
1114         Reviewed by Dean Jackson.
1115
1116         Adds a new map to support separate paint worklet global scopes (one for each worklet). Also
1117         adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required
1118         for paint would not trigger a repaint if there had not been a valid value set before.
1119
1120         Test: fast/css-custom-paint/multiple-worklets.html
1121
1122         * css/CSSPaintImageValue.cpp:
1123         (WebCore::CSSPaintImageValue::image):
1124         * css/StyleResolver.cpp:
1125         (WebCore::StyleResolver::applyProperty):
1126         * dom/Document.cpp:
1127         (WebCore::Document::prepareForDestruction):
1128         (WebCore::Document::paintWorkletGlobalScope):
1129         (WebCore::Document::setPaintWorkletGlobalScope):
1130         * dom/Document.h:
1131         (WebCore::Document::paintWorkletGlobalScope): Deleted.
1132         * rendering/style/RenderStyle.cpp:
1133         (WebCore::changedCustomPaintWatchedProperty):
1134         * worklets/Worklet.cpp:
1135         (WebCore::Worklet::addModule):
1136         * worklets/WorkletGlobalScope.cpp:
1137         (WebCore::WorkletGlobalScope::prepareForDestruction):
1138
1139 2018-12-10  Youenn Fablet  <youenn@apple.com>
1140
1141         Remove derived classes of RealtimeMediaSourceCenter
1142         https://bugs.webkit.org/show_bug.cgi?id=192546
1143
1144         Reviewed by Eric Carlson.
1145
1146         Remove virtual methods of RealtimeMediaSourceCenter and remove derived classes of it.
1147         Instead port specific implementation directly implement the needed default factory methods.
1148
1149         Renamed some methods for improved consistency.
1150         Moved some static variables as RealtimeMediaSourceCenter members.
1151
1152         No change of behavior.
1153
1154         * WebCore.xcodeproj/project.pbxproj:
1155         * page/DeprecatedGlobalSettings.cpp:
1156         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1157         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
1158         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
1159         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
1160         (WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState):
1161         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
1162         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
1163         (WebCore::RealtimeMediaSourceCenter::audioCaptureFactory):
1164         (WebCore::RealtimeMediaSourceCenter::setVideoFactory):
1165         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
1166         (WebCore::RealtimeMediaSourceCenter::videoCaptureFactory):
1167         (WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
1168         (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
1169         (WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
1170         * platform/mediastream/RealtimeMediaSourceCenter.h:
1171         * platform/mediastream/RealtimeVideoSource.cpp:
1172         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
1173         (WebCore::RealtimeVideoSource::prepareToProduceData):
1174         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
1175         (WebCore::RealtimeMediaSourceCenter::singleton):
1176         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
1177         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
1178         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
1179         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: Removed.
1180         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1181         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
1182         (WebCore::AVVideoCaptureSource::setupCaptureSession):
1183         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1184         (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
1185         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
1186         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1187         (WebCore::RealtimeMediaSourceCenter::singleton):
1188         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
1189         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
1190         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
1191         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Removed.
1192         * platform/mock/MockRealtimeAudioSource.cpp:
1193         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
1194         (WebCore::MockRealtimeAudioSource::startProducingData):
1195         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1196         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
1197         (WebCore::MockRealtimeMediaSourceCenter::audioCaptureFactory):
1198         (WebCore::MockRealtimeMediaSourceCenter::videoCaptureFactory):
1199         * platform/mock/MockRealtimeMediaSourceCenter.h:
1200
1201 2018-12-10  Youenn Fablet  <youenn@apple.com>
1202
1203         DataChannels created asynchronously never open and are unusable
1204         https://bugs.webkit.org/show_bug.cgi?id=192566
1205
1206         Reviewed by Eric Carlson.
1207
1208         For every new data channel (remote or local), we should check the underlying backend state.
1209         This allows firing events if needed.
1210         We were not always doing that which was prohibiting sending some open
1211         events for data channels created after the SCTP connection is set up.
1212
1213         Covered by updated test.
1214
1215         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
1216         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
1217         (WebCore::LibWebRTCDataChannelHandler::setClient):
1218         (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
1219         (WebCore::LibWebRTCDataChannelHandler::checkState):
1220         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
1221
1222 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
1223
1224         Use WeakPtr to refer to VTTCue in VTTCueBox
1225         https://bugs.webkit.org/show_bug.cgi?id=192575
1226
1227         Reviewed by Eric Carlson.
1228
1229         Address the FIXME in VTTCue::~VTTCue by clearing VTTCueBox::m_cue when VTTCue goes away.
1230         This is implemented by simply using WeakPtr.
1231
1232         No new tests since there shoul be no behaivoral change.
1233
1234         * html/track/TextTrackCueGeneric.cpp:
1235         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
1236         * html/track/VTTCue.cpp:
1237         (WebCore::VTTCueBox::VTTCueBox):
1238         (WebCore::VTTCueBox::getCue const):
1239         (WebCore::VTTCueBox::applyCSSProperties):
1240         (WebCore::VTTCue::~VTTCue):
1241         * html/track/VTTCue.h:
1242         (WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const):
1243
1244 2018-12-10  Mark Lam  <mark.lam@apple.com>
1245
1246         PropertyAttribute needs a CustomValue bit.
1247         https://bugs.webkit.org/show_bug.cgi?id=191993
1248         <rdar://problem/46264467>
1249
1250         Reviewed by Saam Barati.
1251
1252         This patch revealed a bug in the CodeGenerator where a constructor property is
1253         set with a ReadOnly attribute.  This conflicts with the WebIDL link (see clause
1254         12 in https://heycam.github.io/webidl/#interface-prototype-object) which states
1255         that it should be [Writable].  The ReadOnly attribute is now removed.
1256
1257         On the WebCore side, this change is covered by existing tests.
1258
1259         * bindings/scripts/CodeGeneratorJS.pm:
1260         (GenerateImplementation):
1261         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1262         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
1263
1264 2018-12-10  Antti Koivisto  <antti@apple.com>
1265
1266         Rename "forced style recalc" to "full style rebuild"
1267         https://bugs.webkit.org/show_bug.cgi?id=192572
1268
1269         Reviewed by Zalan Bujtas.
1270
1271         The old name is confusing.
1272
1273         * css/CSSComputedStyleDeclaration.cpp:
1274         (WebCore::hasValidStyleForProperty):
1275         * dom/Document.cpp:
1276         (WebCore::Document::scheduleStyleRebuild):
1277         (WebCore::Document::scheduleStyleRecalc):
1278         (WebCore::Document::unscheduleStyleRecalc):
1279         (WebCore::Document::hasPendingStyleRebuild const):
1280         (WebCore::Document::resolveStyle):
1281         (WebCore::Document::needsStyleRecalc const):
1282         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
1283         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
1284         (WebCore::Document::setDesignMode):
1285         (WebCore::Document::webkitDidExitFullScreenForElement):
1286         (WebCore::Document::setAnimatingFullScreen):
1287         (WebCore::Document::setFullscreenControlsHidden):
1288         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
1289         (WebCore::Document::hasPendingForcedStyleRecalc const): Deleted.
1290         * dom/Document.h:
1291         * dom/Element.cpp:
1292         (WebCore::Element::needsStyleInvalidation const):
1293         * page/Page.cpp:
1294         (WebCore::Page::updateStyleAfterChangeInEnvironment):
1295         * style/StyleScope.cpp:
1296         (WebCore::Style::Scope::updateActiveStyleSheets):
1297
1298 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
1299
1300         Include CoreGraphics.h from WebCorePrefix.h
1301         https://bugs.webkit.org/show_bug.cgi?id=192557
1302
1303         Reviewed by Tim Horton.
1304
1305         The theory is that this will improve build time. Let's try and see what bots say.
1306
1307         * WebCorePrefix.h:
1308
1309 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1310
1311         [iOS] Unable to upload data that conforms to "public.item" but not "public.content"
1312         https://bugs.webkit.org/show_bug.cgi?id=192555
1313         <rdar://problem/35204990>
1314
1315         Reviewed by Tim Horton.
1316
1317         Add support for uploading content that conforms to "public.item" via drag and drop. Currently, iOS WebKit only
1318         supports data that conforms to "public.content", but there exist several types of files that conform to
1319         "public.item" but not "public.content". See below for more detail.
1320
1321         Test: DragAndDropTests.ExternalSourcePKCS12ToSingleFileInput
1322
1323         * platform/ios/PasteboardIOS.mm:
1324         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
1325
1326         Update this to include "public.item", and remove "public.folder", which is now redundant because "public.folder"
1327         conforms to "public.item".
1328
1329         * platform/ios/WebItemProviderPasteboard.mm:
1330         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
1331
1332         Pull out the "contains content that is supported for file uploads" part of this helper method into a separate
1333         method, and use it within `-web_containsFileURLAndFileUploadContent`. Note that this prevents "public.url"-
1334         conformant data from being uploaded as files (i.e., we never want to upload a URL string *itself* as a file).
1335         Drawing this distinction ensures that we don't confuse item providers that contain just a URL as files when
1336         dropping into a file upload area or file input (see API test: ExternalSourceZIPArchiveAndURLToSingleFileInput
1337         for an example of this corner case).
1338
1339         (-[NSItemProvider web_containsFileUploadContent]):
1340         (-[WebItemProviderPasteboard numberOfFiles]):
1341
1342         Refactor this to use `-web_containsFileUploadContent`.
1343
1344 2018-12-10  Chris Dumez  <cdumez@apple.com>
1345
1346         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
1347         https://bugs.webkit.org/show_bug.cgi?id=192509
1348         <rdar://problem/46500832>
1349
1350         Reviewed by Alex Christensen.
1351
1352         * loader/DocumentLoader.h:
1353         (WebCore::DocumentLoader::setCustomUserAgent):
1354         (WebCore::DocumentLoader::customUserAgent const):
1355         * loader/FrameLoader.cpp:
1356         (WebCore::FrameLoader::userAgent const):
1357
1358 2018-12-10  Adrian Perez de Castro  <aperez@igalia.com>
1359
1360         [GLib] FileSystem::moveFile() should fall back to copying
1361         https://bugs.webkit.org/show_bug.cgi?id=192562
1362
1363         Reviewed by Michael Catanzaro.
1364
1365         No new tests needed.
1366
1367         * platform/glib/FileSystemGlib.cpp:
1368         (WebCore::FileSystem::moveFile): Use g_file_move() instead of a plain g_rename(), which
1369         provides a fall-back which does copy+delete when a direct move or rename cannot be done.
1370
1371 2018-12-10  Simon Fraser  <simon.fraser@apple.com>
1372
1373         Allow control over child order when adding nodes to the scrolling tree
1374         https://bugs.webkit.org/show_bug.cgi?id=176914
1375         <rdar://problem/46542237>
1376         
1377         Re-land r239010 after over-zealous rollout.
1378
1379         * page/scrolling/AsyncScrollingCoordinator.cpp:
1380         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
1381         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
1382         * page/scrolling/AsyncScrollingCoordinator.h:
1383         * page/scrolling/ScrollingCoordinator.h:
1384         (WebCore::ScrollingCoordinator::attachToStateTree):
1385         * page/scrolling/ScrollingStateNode.cpp:
1386         (WebCore::ScrollingStateNode::insertChild):
1387         (WebCore::ScrollingStateNode::indexOfChild const):
1388         * page/scrolling/ScrollingStateNode.h:
1389         * page/scrolling/ScrollingStateTree.cpp:
1390         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
1391         (WebCore::ScrollingStateTree::attachNode):
1392         * page/scrolling/ScrollingStateTree.h:
1393
1394 2018-12-10  Antti Koivisto  <antti@apple.com>
1395
1396         Document should throttle style recalc even when m_pendingStyleRecalcShouldForce is true.
1397         https://bugs.webkit.org/show_bug.cgi?id=191695
1398
1399         Reviewed by Zalan Bujtas.
1400
1401         * dom/Document.cpp:
1402         (WebCore::Document::scheduleStyleRecalc):
1403
1404         Don't test for m_pendingStyleRecalcShouldForce.
1405
1406         (WebCore::Document::hasPendingStyleRecalc const):
1407         (WebCore::Document::hasPendingForcedStyleRecalc const):
1408
1409         Don't base the pending status of these function on whether the timer is running.
1410         Instead check if the style is invalid.
1411
1412 2018-12-10  Rob Buis  <rbuis@igalia.com>
1413
1414         XMLHttpRequest removes spaces from content-types before processing
1415         https://bugs.webkit.org/show_bug.cgi?id=8644
1416
1417         Reviewed by Chris Dumez.
1418
1419         Stop trimming white space characters from the middle of
1420         type/subtype value. Also make sure whitespace being parsed
1421         adheres to OWS definition from RFC 7230 Section 3.2.3
1422         (referenced by RFC 7231), i.e. space or HT.
1423
1424         Based on http://crrev.com/416586.
1425
1426         Behavior matches Firefox and Chrome.
1427
1428         Tests: http/tests/xmlhttprequest/supported-xml-content-types.html
1429                web-platform-tests/mimesniff/mime-types/parsing.any.html
1430                web-platform-tests/mimesniff/mime-types/parsing.any.worker.html
1431
1432         * platform/network/HTTPParsers.cpp:
1433         (WebCore::extractMIMETypeFromMediaType):
1434
1435 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1436
1437         [iOS] Caret is obscured by finger when dragging over an editable element
1438         https://bugs.webkit.org/show_bug.cgi?id=192499
1439         <rdar://problem/46570101>
1440
1441         Reviewed by Tim Horton.
1442
1443         * page/DragActions.h:
1444
1445         Move DragHandlingMethod to DragActions.h, and drive-by fix some minor issues (i.e. make a couple of enum classes
1446         use 8 bits, fix the indentation levels, and update the copyright year). Also add `EnumTraits` for
1447         DragHandlingMethod so that it may be encoded over IPC.
1448
1449         * page/DragController.cpp:
1450         (WebCore::dragIsHandledByDocument):
1451
1452         Simplify this helper function.
1453
1454         (WebCore::DragController::tryDocumentDrag):
1455         * page/DragController.h:
1456
1457         Expose the current DragHandlingMethod via a const getter method.
1458
1459         (WebCore::DragController::dragHandlingMethod const):
1460
1461 2018-12-10  Youenn Fablet  <youenn@apple.com>
1462
1463         Make mock capture happen in the process used for real capture
1464         https://bugs.webkit.org/show_bug.cgi?id=192544
1465
1466         Reviewed by Eric Carlson.
1467
1468         MockRealtimeMediaSourceCenter previously was setting its factories whenever mock capture is on.
1469         Add booleans to choose which source (audio, video, display) will actually be toggled on.
1470
1471         Covered by existing tests.
1472
1473         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1474         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
1475         * platform/mock/MockRealtimeMediaSourceCenter.h:
1476         (WebCore::MockRealtimeMediaSourceCenter::setMockAudioCaptureEnabled):
1477         (WebCore::MockRealtimeMediaSourceCenter::setMockVideoCaptureEnabled):
1478         (WebCore::MockRealtimeMediaSourceCenter::setMockDisplayCaptureEnabled):
1479
1480 2018-12-10  Dean Jackson  <dino@apple.com>
1481
1482         Use text/javascript as recommended by the HTML specification
1483         https://bugs.webkit.org/show_bug.cgi?id=192525
1484         <rdar://problem/46569636>
1485
1486         Reviewed by Jon Lee.
1487
1488         The HTML specification says we should use text/javascript for
1489         JavaScript files:
1490         https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type
1491
1492         * loader/cache/CachedScript.cpp: Replace application/javascript with text/javascript.
1493         (WebCore::CachedScript::CachedScript):
1494         * platform/network/ios/WebCoreURLResponseIOS.mm: Ditto.
1495         (WebCore::createExtensionToMIMETypeMap):
1496         * platform/network/mac/WebCoreURLResponse.mm: Ditto.
1497         (WebCore::createExtensionToMIMETypeMap):
1498
1499 2018-12-10  Dean Jackson  <dino@apple.com>
1500
1501         [iOS] Make WebGPU work with remote layer hosting
1502         https://bugs.webkit.org/show_bug.cgi?id=192508
1503         <rdar://problem/46560649>
1504
1505         Reviewed by Tim Horton.
1506
1507         WebGPU wasn't working on iOS because we were not correctly
1508         identifying the CALayers for remote hosting. Fix this by
1509         adding a new CALayer type, WebGPULayer. This will also
1510         eventually hold the code to render WebGPU into a canvas.
1511
1512         Covered by the existing reference tests (on device).
1513
1514         * SourcesCocoa.txt: Add new files.
1515         * WebCore.xcodeproj/project.pbxproj: Ditto.
1516
1517         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer
1518         class for remote hosting.
1519         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
1520         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1521
1522         * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance
1523         from CAMetalLayer.
1524         * platform/graphics/cocoa/WebGPULayer.mm: Added.
1525         (-[WebGPULayer init]):
1526         (-[WebGPULayer copyImageSnapshotWithColorSpace:]):
1527
1528         * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather
1529         than CALayer.
1530
1531         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that
1532         the WebGPULayer has a reference back to this object, which it
1533         will use in the future.
1534         (WebCore::GPUSwapChain::create):
1535         (WebCore::GPUSwapChain::GPUSwapChain):
1536
1537 2018-12-10  Truitt Savell  <tsavell@apple.com>
1538
1539         Unreviewed, rolling out r238965.
1540
1541         Caused internal iOS build failures
1542
1543         Reverted changeset:
1544
1545         "[iOS] Make WebGPU work with remote layer hosting"
1546         https://bugs.webkit.org/show_bug.cgi?id=192508
1547         https://trac.webkit.org/changeset/238965
1548
1549 2018-12-10  Youenn Fablet  <youenn@apple.com>
1550
1551         MockLibWebRTCPeerConnectionFactory should isolate copy its test case
1552         https://bugs.webkit.org/show_bug.cgi?id=192545
1553
1554         Reviewed by Eric Carlson.
1555
1556         Isolate copy the test case member so that it can be destroyed on another thread.
1557         Covered by existing test that should no longer crash.
1558
1559         * testing/MockLibWebRTCPeerConnection.cpp:
1560         (WebCore::useMockRTCPeerConnectionFactory):
1561         (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
1562         * testing/MockLibWebRTCPeerConnection.h:
1563         (WebCore::MockLibWebRTCPeerConnectionFactory::create):
1564
1565 2018-12-09  Youenn Fablet  <youenn@apple.com>
1566
1567         Move capture manager from RealtimeMediaSourceCenter to capture factory
1568         https://bugs.webkit.org/show_bug.cgi?id=192542
1569
1570         Reviewed by Eric Carlson.
1571
1572         We should be able to run mock captures in wither UIProcess or WebProcess.
1573         Currently, mock capture is only done in WebProcess.
1574         This patch is a first step towards that goal.
1575
1576         It also simplifies RealtimeMediaSourceCenter implementation by starting to remove virtual methods.
1577         Further refactoring will remove the need to subclass RealtimeMediaSourceCenter.
1578         Instead, remaining virtual methods will become non virtual and their
1579         implementation will become port specific.
1580
1581         Removed a JS internal method that is not longer used to further simplify RealtimeMediaSourceCenter.
1582
1583         No visible change of behavior.
1584         Covered by existing tests.
1585
1586         * platform/mediastream/CaptureDeviceManager.h:
1587         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1588         (WebCore::RealtimeMediaSourceCenter::singleton):
1589         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
1590         (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
1591         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
1592         (WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID):
1593         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
1594         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
1595         (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
1596         * platform/mediastream/RealtimeMediaSourceCenter.h:
1597         * platform/mediastream/RealtimeMediaSourceFactory.h:
1598         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
1599         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1600         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
1601         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
1602         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1603         (WebCore::CoreAudioCaptureSourceFactory::audioCaptureDeviceManager):
1604         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1605         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1606         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
1607         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1608         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
1609         (WebCore::MockRealtimeMediaSourceCenter::audioFactory):
1610         (WebCore::MockRealtimeMediaSourceCenter::videoFactory):
1611         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
1612         * platform/mock/MockRealtimeMediaSourceCenter.h:
1613         (WebCore::MockRealtimeMediaSourceCenter::audioCaptureDeviceManager):
1614         (WebCore::MockRealtimeMediaSourceCenter::videoCaptureDeviceManager):
1615         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureDeviceManager):
1616         * testing/Internals.cpp:
1617         * testing/Internals.h:
1618         * testing/Internals.idl:
1619
1620 2018-12-09  Commit Queue  <commit-queue@webkit.org>
1621
1622         Unreviewed, rolling out r239010.
1623         https://bugs.webkit.org/show_bug.cgi?id=192537
1624
1625         Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
1626         scrolling-layers-state.html again (Requested by ap on
1627         #webkit).
1628
1629         Reverted changeset:
1630
1631         "Allow control over child order when adding nodes to the
1632         scrolling tree"
1633         https://bugs.webkit.org/show_bug.cgi?id=176914
1634         https://trac.webkit.org/changeset/239010
1635
1636 2018-12-08  Eric Carlson  <eric.carlson@apple.com>
1637
1638         [MediaStream] Scaled video frames should be resized in letterbox mode
1639         https://bugs.webkit.org/show_bug.cgi?id=192528
1640         <rdar://problem/46576638>
1641
1642         Reviewed by Darin Adler.
1643
1644         Test: fast/mediastream/resize-letterbox.html
1645
1646         * platform/graphics/cv/ImageTransferSessionVT.mm:
1647         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT): Use letterbox resize mode, not trim.
1648
1649         * platform/mock/MockRealtimeVideoSource.cpp:
1650         (WebCore::MockRealtimeVideoSource::captureSize const): "Capture" at the preset size, not 
1651         necessarily at the requested size to be more like a physical camera.
1652         (WebCore::MockRealtimeVideoSource::settingsDidChange):
1653         (WebCore::MockRealtimeVideoSource::drawAnimation):
1654         (WebCore::MockRealtimeVideoSource::drawBoxes):
1655         (WebCore::MockRealtimeVideoSource::drawText):
1656         (WebCore::MockRealtimeVideoSource::generateFrame):
1657         (WebCore::MockRealtimeVideoSource::imageBuffer const):
1658         * platform/mock/MockRealtimeVideoSource.h:
1659
1660 2018-12-08  Alex Christensen  <achristensen@webkit.org>
1661
1662         Don't programmatically capitalize safe browsing warning buttons
1663         https://bugs.webkit.org/show_bug.cgi?id=192531
1664         <rdar://problem/46417791>
1665
1666         Reviewed by Darin Adler.
1667
1668         This doesn't work so well in other languages.
1669         Capitalize the source strings in English instead.
1670
1671         * en.lproj/Localizable.strings:
1672
1673 2018-12-08  Frederic Wang  <fwang@igalia.com>
1674
1675         Allow control over child order when adding nodes to the scrolling tree
1676         https://bugs.webkit.org/show_bug.cgi?id=176914
1677         <rdar://problem/46542237>
1678
1679         Reviewed by Simon Fraser.
1680
1681         Based on an earlier patch by Simon Fraser.
1682
1683         Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent,
1684         but with no control over sibling order. To allow for correct hit-testing overflow and
1685         frame scrolling nodes, we have to build the scrolling tree in z-order.
1686
1687         This patch adds a 'childIndex' parameter to attachNode() which gives control over
1688         sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value
1689         for childIndex so the current behavior (appending new nodes at the end of child list) is
1690         preserved.
1691
1692         One test marked as flakey, since scrolling tree order is currently dependent on HashSet
1693         traversal order.
1694
1695         * page/scrolling/AsyncScrollingCoordinator.cpp:
1696         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
1697         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
1698         * page/scrolling/AsyncScrollingCoordinator.h:
1699         * page/scrolling/ScrollingCoordinator.h:
1700         (WebCore::ScrollingCoordinator::attachToStateTree):
1701         * page/scrolling/ScrollingStateNode.cpp:
1702         (WebCore::ScrollingStateNode::insertChild):
1703         (WebCore::ScrollingStateNode::indexOfChild const):
1704         * page/scrolling/ScrollingStateNode.h:
1705         * page/scrolling/ScrollingStateTree.cpp:
1706         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
1707         (WebCore::ScrollingStateTree::attachNode):
1708         * page/scrolling/ScrollingStateTree.h:
1709
1710 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
1711
1712         [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
1713         https://bugs.webkit.org/show_bug.cgi?id=192511
1714         <rdar://problem/46562063>
1715
1716         Reviewed by Youenn Fablet.
1717
1718         Test: http/tests/media/media-stream/device-change-event-in-iframe.html
1719
1720         * Modules/mediastream/MediaDevices.cpp:
1721         (WebCore::MediaDevices::addEventListener): Don't fire the event unless the document can
1722         access a camera or microphone.
1723
1724 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
1725
1726         [MediaStream] Address post-review comments after r238904
1727         https://bugs.webkit.org/show_bug.cgi?id=192514
1728         <rdar://problem/46564302>
1729
1730         Reviewed by Youenn Fablet.
1731
1732         No new tests, no functional change.
1733
1734         * platform/graphics/cv/ImageTransferSessionVT.mm:
1735         (WebCore::ImageTransferSessionVT::setSize):
1736         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1737         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
1738
1739 2018-12-07  Antti Koivisto  <antti@apple.com>
1740
1741         [LFC] Rename LayoutFormattingState files to LayoutState
1742         https://bugs.webkit.org/show_bug.cgi?id=192520
1743
1744         Reviewed by Zalan Bujtas.
1745
1746         Match the class name.
1747
1748         * layout/FormattingContext.cpp:
1749         * layout/FormattingContextQuirks.cpp:
1750         * layout/FormattingState.h:
1751         * layout/LayoutFormattingState.cpp: Removed.
1752         * layout/LayoutFormattingState.h: Removed.
1753         * layout/LayoutState.cpp: Copied from Source/WebCore/layout/LayoutFormattingState.cpp.
1754         * layout/LayoutState.h: Copied from Source/WebCore/layout/LayoutFormattingState.h.
1755         * layout/Verification.cpp:
1756         * layout/blockformatting/BlockFormattingContext.cpp:
1757         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1758         * layout/blockformatting/BlockInvalidation.cpp:
1759         * layout/floats/FloatAvoider.cpp:
1760         * layout/floats/FloatingContext.cpp:
1761         * layout/floats/FloatingState.cpp:
1762         * layout/inlineformatting/InlineFormattingContext.cpp:
1763         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1764         * layout/inlineformatting/InlineInvalidation.cpp:
1765         * layout/layouttree/LayoutTreeBuilder.cpp:
1766         * page/FrameViewLayoutContext.cpp:
1767
1768 2018-12-07  Justin Michaud  <justin_michaud@apple.com>
1769
1770         CSS Painting API code cleanup
1771         https://bugs.webkit.org/show_bug.cgi?id=192480
1772
1773         Reviewed by Dean Jackson.
1774
1775         No new tests, since the existing tests should cover it.
1776
1777         * bindings/js/JSDOMWrapper.cpp:
1778         (WebCore::outputConstraintSubspaceFor):
1779         (WebCore::globalObjectOutputConstraintSubspaceFor):
1780         * bindings/js/JSWorkletGlobalScopeBase.cpp:
1781         (WebCore::toJS):
1782         * css/CSSPaintCallback.h:
1783         * platform/graphics/CustomPaintImage.cpp:
1784         (WebCore::CustomPaintImage::doCustomPaint):
1785         * platform/graphics/CustomPaintImage.h:
1786         * rendering/style/RenderStyle.cpp:
1787         (WebCore::RenderStyle::addCustomPaintWatchProperty):
1788         (WebCore::changedCustomPaintWatchedProperty):
1789         (WebCore::RenderStyle::changeRequiresRepaint const):
1790         * worklets/PaintWorkletGlobalScope.cpp:
1791         (WebCore::PaintWorkletGlobalScope::registerPaint):
1792         * worklets/PaintWorkletGlobalScope.h:
1793
1794 2018-12-07  Youenn Fablet  <youenn@apple.com>
1795
1796         Update libwebrtc up to 0d007d7c4f
1797         https://bugs.webkit.org/show_bug.cgi?id=192316
1798
1799         Reviewed by Eric Carlson.
1800
1801         Update include according new libwebrtc.
1802
1803         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1804
1805 2018-12-07  Dean Jackson  <dino@apple.com>
1806
1807         [iOS] Make WebGPU work with remote layer hosting
1808         https://bugs.webkit.org/show_bug.cgi?id=192508
1809         <rdar://problem/46560649>
1810
1811         Reviewed by Tim Horton.
1812
1813         WebGPU wasn't working on iOS because we were not correctly
1814         identifying the CALayers for remote hosting. Fix this by
1815         adding a new CALayer type, WebGPULayer. This will also
1816         eventually hold the code to render WebGPU into a canvas.
1817
1818         Covered by the existing reference tests (on device).
1819
1820         * SourcesCocoa.txt: Add new files.
1821         * WebCore.xcodeproj/project.pbxproj: Ditto.
1822
1823         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer
1824         class for remote hosting.
1825         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
1826         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1827
1828         * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance
1829         from CAMetalLayer.
1830         * platform/graphics/cocoa/WebGPULayer.mm: Added.
1831         (-[WebGPULayer init]):
1832         (-[WebGPULayer copyImageSnapshotWithColorSpace:]):
1833
1834         * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather
1835         than CALayer.
1836
1837         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that
1838         the WebGPULayer has a reference back to this object, which it
1839         will use in the future.
1840         (WebCore::GPUSwapChain::create):
1841         (WebCore::GPUSwapChain::GPUSwapChain):
1842
1843 2018-12-07  Antti Koivisto  <antti@apple.com>
1844
1845         Rename LayoutState to RenderLayoutState
1846         https://bugs.webkit.org/show_bug.cgi?id=192504
1847
1848         Reviewed by Zalan Bujtas.
1849
1850         The name is better used in LFC.
1851
1852         * Sources.txt:
1853         * WebCore.xcodeproj/project.pbxproj:
1854         * page/FrameViewLayoutContext.cpp:
1855         (WebCore::FrameViewLayoutContext::layoutState const):
1856         (WebCore::FrameViewLayoutContext::pushLayoutState):
1857         (WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded):
1858         * page/FrameViewLayoutContext.h:
1859         * rendering/LayoutState.cpp: Removed.
1860         * rendering/LayoutState.h: Removed.
1861         * rendering/RenderBlock.cpp:
1862         * rendering/RenderBlock.h:
1863         * rendering/RenderBlockFlow.cpp:
1864         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
1865         * rendering/RenderBlockLineLayout.cpp:
1866         * rendering/RenderBox.cpp:
1867         * rendering/RenderEmbeddedObject.cpp:
1868         * rendering/RenderFragmentedFlow.cpp:
1869         * rendering/RenderGrid.cpp:
1870         * rendering/RenderImage.cpp:
1871         * rendering/RenderInline.cpp:
1872         * rendering/RenderLayoutState.cpp: Copied from Source/WebCore/rendering/LayoutState.cpp.
1873         (WebCore::RenderLayoutState::RenderLayoutState):
1874         (WebCore::RenderLayoutState::computeOffsets):
1875         (WebCore::RenderLayoutState::computeClipRect):
1876         (WebCore::RenderLayoutState::computePaginationInformation):
1877         (WebCore::RenderLayoutState::pageLogicalOffset const):
1878         (WebCore::RenderLayoutState::computeLineGridPaginationOrigin):
1879         (WebCore::RenderLayoutState::propagateLineGridInfo):
1880         (WebCore::RenderLayoutState::establishLineGrid):
1881         (WebCore::RenderLayoutState::addLayoutDelta):
1882         (WebCore::RenderLayoutState::layoutDeltaMatches const):
1883         (WebCore::LayoutState::LayoutState): Deleted.
1884         (WebCore::LayoutState::computeOffsets): Deleted.
1885         (WebCore::LayoutState::computeClipRect): Deleted.
1886         (WebCore::LayoutState::computePaginationInformation): Deleted.
1887         (WebCore::LayoutState::pageLogicalOffset const): Deleted.
1888         (WebCore::LayoutState::computeLineGridPaginationOrigin): Deleted.
1889         (WebCore::LayoutState::propagateLineGridInfo): Deleted.
1890         (WebCore::LayoutState::establishLineGrid): Deleted.
1891         (WebCore::LayoutState::addLayoutDelta): Deleted.
1892         (WebCore::LayoutState::layoutDeltaMatches const): Deleted.
1893         * rendering/RenderLayoutState.h: Copied from Source/WebCore/rendering/LayoutState.h.
1894         (WebCore::RenderLayoutState::RenderLayoutState):
1895         (WebCore::LayoutState::LayoutState): Deleted.
1896         (WebCore::LayoutState::isPaginated const): Deleted.
1897         (WebCore::LayoutState::pageLogicalHeight const): Deleted.
1898         (WebCore::LayoutState::pageLogicalHeightChanged const): Deleted.
1899         (WebCore::LayoutState::lineGrid const): Deleted.
1900         (WebCore::LayoutState::lineGridOffset const): Deleted.
1901         (WebCore::LayoutState::lineGridPaginationOrigin const): Deleted.
1902         (WebCore::LayoutState::paintOffset const): Deleted.
1903         (WebCore::LayoutState::layoutOffset const): Deleted.
1904         (WebCore::LayoutState::pageOffset const): Deleted.
1905         (WebCore::LayoutState::needsBlockDirectionLocationSetBeforeLayout const): Deleted.
1906         (WebCore::LayoutState::renderer const): Deleted.
1907         (WebCore::LayoutState::clipRect const): Deleted.
1908         (WebCore::LayoutState::isClipped const): Deleted.
1909         (WebCore::LayoutState::layoutDelta const): Deleted.
1910         * rendering/RenderListBox.cpp:
1911         * rendering/RenderMediaControlElements.cpp:
1912         * rendering/RenderMultiColumnFlow.cpp:
1913         * rendering/RenderTable.cpp:
1914         * rendering/RenderTableRow.cpp:
1915         * rendering/RenderTableSection.cpp:
1916         * rendering/RenderVTTCue.cpp:
1917         * rendering/RenderView.cpp:
1918         * rendering/RenderView.h:
1919         * rendering/RootInlineBox.cpp:
1920         * rendering/svg/RenderSVGRoot.cpp:
1921         (WebCore::RenderSVGRoot::layout):
1922
1923 2018-12-07  Antti Koivisto  <antti@apple.com>
1924
1925         [LFC] Rename formattingContext() to createFormattingContext()
1926         https://bugs.webkit.org/show_bug.cgi?id=192500
1927
1928         Reviewed by Zalan Bujtas.
1929
1930         * layout/FormattingContext.cpp:
1931         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1932         * layout/FormattingState.h:
1933         * layout/LayoutFormattingState.cpp:
1934         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1935         * layout/blockformatting/BlockFormattingState.cpp:
1936         (WebCore::Layout::BlockFormattingState::createFormattingContext):
1937         (WebCore::Layout::BlockFormattingState::formattingContext): Deleted.
1938         * layout/blockformatting/BlockFormattingState.h:
1939         * layout/inlineformatting/InlineFormattingContext.cpp:
1940         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1941         * layout/inlineformatting/InlineFormattingState.h:
1942
1943 2018-12-07  Truitt Savell  <tsavell@apple.com>
1944
1945         Unreviewed, rolling out r238947.
1946
1947         Revision caused fast/visual-viewport/tiled-drawing/zoomed-
1948         fixed-scrolling-layers-state.html to constantly fail
1949
1950         Reverted changeset:
1951
1952         "Allow control over child order when adding nodes to the
1953         scrolling tree"
1954         https://bugs.webkit.org/show_bug.cgi?id=176914
1955         https://trac.webkit.org/changeset/238947
1956
1957 2018-12-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1958
1959         [Attachment Support] Cloned attachment elements lose their unique identifiers
1960         https://bugs.webkit.org/show_bug.cgi?id=192483
1961
1962         Reviewed by Tim Horton.
1963
1964         This patch adds logic to ensure that the unique identifier of a cloned attachment element is the same as the
1965         unique identifier of the original attachment element. If the cloned attachment is inserted into the same
1966         document as the original attachment, then we will exercise the same codepath for copied-and-pasted attachments,
1967         and assign a new unique identifier to the attachment element, while creating a new `_WKAttachment` in the client
1968         that's backed by the same `NSFileWrapper`.
1969
1970         Test: WKAttachmentTests.AttachmentIdentifierOfClonedAttachment
1971
1972         * html/HTMLAttachmentElement.cpp:
1973         (WebCore::HTMLAttachmentElement::copyNonAttributePropertiesFromElement):
1974         * html/HTMLAttachmentElement.h:
1975
1976 2018-12-07  Rob Buis  <rbuis@igalia.com>
1977
1978         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
1979         https://bugs.webkit.org/show_bug.cgi?id=192288
1980
1981         Reviewed by Frédéric Wang.
1982
1983         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
1984         as they do the same thing. Also remove std::optional from parseAccessControlAllowList
1985         since the function can't fail.
1986
1987         * WebCore.order:
1988         * loader/CrossOriginAccessControl.cpp:
1989         (WebCore::validatePreflightResponse):
1990         * loader/CrossOriginPreflightResultCache.cpp:
1991         (WebCore::CrossOriginPreflightResultCacheItem::parse):
1992         * loader/CrossOriginPreflightResultCache.h:
1993         * platform/network/HTTPParsers.cpp:
1994         (WebCore::parseAccessControlExposeHeadersAllowList): Deleted.
1995         * platform/network/HTTPParsers.h:
1996         (WebCore::parseAccessControlAllowList):
1997         * platform/network/ResourceResponseBase.cpp:
1998         (WebCore::ResourceResponseBase::filter):
1999         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2000
2001 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
2002
2003         [iOS] Don't update AVPlayerViewController currentTime while scrubbing
2004         https://bugs.webkit.org/show_bug.cgi?id=192438
2005         <rdar://problem/42977046>
2006
2007         Reviewed by Jer Noble.
2008
2009         No new tests, tested manually.
2010
2011         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2012         (WebCore::PlaybackSessionInterfaceAVKit::currentTimeChanged): Don't report change during scrubbing.
2013
2014         * platform/ios/WebAVPlayerController.h:
2015         * platform/ios/WebAVPlayerController.mm:
2016         (-[WebAVPlayerController beginScrubbing:]): Set _isScrubbing.
2017         (-[WebAVPlayerController endScrubbing:]): Ditto.
2018         (-[WebAVPlayerController isScrubbing]): Return _isScrubbing.
2019
2020 2018-12-07  Thibault Saunier  <tsaunier@igalia.com>
2021
2022         [WPE][GTK] Implement WebAudioSourceProviderGStreamer to allow bridging MediaStream and the WebAudio APIs
2023         https://bugs.webkit.org/show_bug.cgi?id=186933
2024
2025         Reusing the AudioSourceProviderGStreamer itself as it was doing almost everything we needed,
2026         just added a constructor to be able to create it from a MediaStreamTrackPrivate and made it a
2027         WebAudioSourceProvider which only means it is now a ThreadSafeRefCounted.
2028
2029         Sensibily refactored GStreamerMediaStreamSource so that we could reuse it to track a single
2030         MediaStreamTrack.
2031
2032         Reviewed by Philippe Normand.
2033
2034         Enabled all tests depending on that feature.
2035
2036         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
2037         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
2038         (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
2039         (WebCore::AudioSourceProviderGStreamer::setClient):
2040         * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
2041         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2042         (WebCore::MediaStreamTrackPrivate::audioSourceProvider):
2043         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
2044         (WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer):
2045         * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
2046         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
2047         (WebCore::webkitMediaStreamSrcSetupSrc):
2048         (WebCore::webkitMediaStreamSrcSetupAppSrc):
2049         (WebCore::webkitMediaStreamSrcAddTrack):
2050         (WebCore::webkitMediaStreamSrcSetStream):
2051         (WebCore::webkitMediaStreamSrcNew):
2052         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h:
2053         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2054         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource):
2055         (WebCore::WrappedMockRealtimeAudioSource::start):
2056         (WebCore::WrappedMockRealtimeAudioSource::addHum):
2057         (WebCore::WrappedMockRealtimeAudioSource::render):
2058         (WebCore::WrappedMockRealtimeAudioSource::settingsDidChange):
2059         (WebCore::MockGStreamerAudioCaptureSource::startProducingData):
2060         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
2061         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Handle the case where input buffers
2062           are "big" and process all the data we can for each runs of the method.
2063
2064 2018-12-06  Alexey Proskuryakov  <ap@apple.com>
2065
2066         Move USE_NEW_THEME out of WebCore's config.h
2067         https://bugs.webkit.org/show_bug.cgi?id=192426
2068
2069         Reviewed by Tim Horton.
2070
2071         * config.h:
2072
2073 2018-12-06  Frederic Wang  <fwang@igalia.com>
2074
2075         Allow control over child order when adding nodes to the scrolling tree
2076         https://bugs.webkit.org/show_bug.cgi?id=176914
2077
2078         Reviewed by Simon Fraser.
2079
2080         Based on an earlier patch by Simon Fraser.
2081
2082         Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent,
2083         but with no control over sibling order. To allow for correct hit-testing overflow and
2084         frame scrolling nodes, we have to build the scrolling tree in z-order.
2085
2086         This patch adds a 'childIndex' parameter to attachNode() which gives control over
2087         sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value
2088         for childIndex so the current behavior (appending new nodes at the end of child list) is
2089         preserved.
2090
2091         No new tests, behavior unchanged and already covered by existing tests.
2092
2093         * page/scrolling/AsyncScrollingCoordinator.cpp:
2094         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
2095         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2096         * page/scrolling/AsyncScrollingCoordinator.h:
2097         * page/scrolling/ScrollingCoordinator.h:
2098         (WebCore::ScrollingCoordinator::attachToStateTree):
2099         * page/scrolling/ScrollingStateNode.cpp:
2100         (WebCore::ScrollingStateNode::insertChild):
2101         (WebCore::ScrollingStateNode::indexOfChild const):
2102         * page/scrolling/ScrollingStateNode.h:
2103         * page/scrolling/ScrollingStateTree.cpp:
2104         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
2105         (WebCore::ScrollingStateTree::attachNode):
2106         * page/scrolling/ScrollingStateTree.h:
2107
2108 2018-12-06  Yongjun Zhang  <yongjun_zhang@apple.com>
2109
2110         We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
2111         https://bugs.webkit.org/show_bug.cgi?id=192377
2112         <rdar://problem/46364206>
2113
2114         Reviewed by Tim Horton.
2115
2116         If the page specifies width=device-width or initial-scale=1 in the viewport meta tag, we should use the
2117         native device width and ignore the minimum effective device width in ViewportConfiguration. The patch
2118         also introduces scalableNativeWebpageParameters() which uses the device width as default and also allows the page
2119         to shrink-to-fit. If a page doesn't have viewport meta tag, or if the width argument isn't device-width
2120         and the initial scale isn't 1, we will use scalableNativeWebpageParameters() as the default configuration.
2121
2122         Tests: fast/viewport/ios/ignore-minimum-device-width-for-page-with-viewport-device-width.html
2123                fast/viewport/ios/use-minimum-device-width-for-page-without-viewport-meta.html
2124
2125         * page/ViewportConfiguration.cpp:
2126         (WebCore::ViewportConfiguration::updateDefaultConfiguration): pick the default configuration based on
2127             the page's viewport arguments. Also, we will always fall back to scalableNativeWebpageParameters() if we
2128             can ignore scaling constraints.
2129         (WebCore::ViewportConfiguration::setViewportArguments): When page sends us new ViewportArguments, pick
2130             up the correponsding default configuration before updating the configuration.
2131         (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): When m_canIgnoreScalingConstraints is
2132             changed, try to pick up the correponsding default configuration.
2133         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Add a new default set of viewport Parameters
2134             this is very close to nativeWebpageParameters() excpet that it allows shrink to fit and its minimum scale
2135             is 0.25. We will use this Parameters for pages that doesn't have viewport meta tag; or the width is
2136             not device-width and initial scale is not 1.
2137         (WebCore::ViewportConfiguration::updateConfiguration): If the page's viewport argument doesn't override
2138             the default width, use the m_minimumLayoutSize.width().
2139         * page/ViewportConfiguration.h:
2140         (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const): A helper method to tell
2141             if we should avoid using minimum effective device width.
2142         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): If we are using a default
2143             configuration that is neither nativeWebpageParameters() nor scalableNativeWebpageParameters(), don't override
2144             it.
2145         (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const): Add a helper method to return minimum
2146             effective device width based on shouldIgnoreMinimumEffectiveDeviceWidth().
2147         (WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor const): Use minimumEffectiveDeviceWidth().
2148
2149 2018-12-06  Adrian Perez de Castro  <aperez@igalia.com>
2150
2151         Content Extensions: Misc fixes to debugging / perf testing code
2152         https://bugs.webkit.org/show_bug.cgi?id=192474
2153
2154         Reviewed by Mark Lam.
2155
2156         This make it possible to build the content extensions support with the
2157         debugging features enabled. In particular, building with
2158         CONTENT_EXTENSIONS_PERFORMANCE_REPORTING enabled was broken.
2159
2160         No new tests needed.
2161
2162         * contentextensions/ContentExtensionCompiler.cpp:
2163         (WebCore::ContentExtensions::compileRuleList): Remove usage of removed
2164         variables machinesWihthoutConditionsCount,
2165         totalBytecodeSizeForMachinesWithoutConditions,
2166         machinesWithConditionsCount, and
2167         totalBytecodeSizeForMachinesWithConditions.
2168         * contentextensions/DFA.cpp:
2169         (WebCore::ContentExtensions::DFA::debugPrintDot const):
2170         Use "%" PRIu64 instead of "%llu" to format uint64_t values.
2171         * contentextensions/NFA.cpp:
2172         (WebCore::ContentExtensions::NFA::debugPrintDot const):
2173         Use "%" PRIu64 instead of "%llu" to format uint64_t values.
2174
2175 2018-12-06  Alex Christensen  <achristensen@webkit.org>
2176
2177         Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
2178         https://bugs.webkit.org/show_bug.cgi?id=192452
2179
2180         Reviewed by Anders Carlsson.
2181
2182         * loader/LoaderStrategy.h:
2183         * loader/ResourceLoader.cpp:
2184         (WebCore::ResourceLoader::didRetrieveDerivedDataFromCache): Deleted.
2185         * loader/ResourceLoader.h:
2186         * loader/ResourceLoaderOptions.h:
2187         * loader/SubresourceLoader.cpp:
2188         (WebCore::SubresourceLoader::didRetrieveDerivedDataFromCache): Deleted.
2189         * loader/SubresourceLoader.h:
2190         * loader/ThreadableLoader.cpp:
2191         (WebCore::ThreadableLoaderOptions::isolatedCopy const):
2192         * loader/cache/CachedResource.h:
2193         (WebCore::CachedResource::didRetrieveDerivedDataFromCache): Deleted.
2194
2195 2018-12-06  Zalan Bujtas  <zalan@apple.com>
2196
2197         [LFC][BFC][MarginCollapsing] HeightAndMargin::margin is always the non-collapsed margin value.
2198         https://bugs.webkit.org/show_bug.cgi?id=192345
2199
2200         Reviewed by Antti Koivisto.
2201
2202         Rename HeightAndMargin::margin to HeightAndMargin::nonCollapsedMargin.
2203
2204         * layout/FormattingContext.cpp:
2205         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
2206         * layout/LayoutUnits.h:
2207         (WebCore::Layout::HeightAndMargin::usedMarginValues const):
2208         * layout/blockformatting/BlockFormattingContext.cpp:
2209         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2210         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2211         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2212         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2213         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2214         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
2215         * layout/inlineformatting/InlineFormattingContext.cpp:
2216         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2217
2218 2018-12-06  Zalan Bujtas  <zalan@apple.com>
2219
2220         [LFC][BFC][MarginCollapsing] Add MarginCollapse::establishesBlockFormattingContext
2221         https://bugs.webkit.org/show_bug.cgi?id=192297
2222
2223         Reviewed by Antti Koivisto.
2224
2225         WebKit treats the document element renderer as a block formatting context root.
2226
2227         * layout/blockformatting/BlockMarginCollapse.cpp:
2228         (WebCore::Layout::establishesBlockFormattingContext):
2229         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent):
2230         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
2231
2232 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
2233
2234         [GStreamer] -DENABLE_VIDEO=ON -DENABLE_OPENGL=OFF still tries to build GstreamerGL
2235         https://bugs.webkit.org/show_bug.cgi?id=191998
2236
2237         Reviewed by Philippe Normand.
2238
2239         Fix compilation with -DENABLE_VIDEO=ON and -DENABLE_OPENGL=OFF due to GStreamerGL.
2240
2241         No new tests required. Only fixing the build with certain flags.
2242
2243         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2244         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): add required #if ENABLE(WEBGL).
2245
2246 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
2247
2248         REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
2249         https://bugs.webkit.org/show_bug.cgi?id=191997
2250
2251         Reviewed by Philippe Normand.
2252
2253         Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
2254
2255         No new tests required. Only fixing build.
2256
2257         * platform/gtk/PlatformWheelEventGtk.cpp:
2258         (WebCore::PlatformWheelEvent::PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
2259
2260 2018-12-05  Don Olmstead  <don.olmstead@sony.com>
2261
2262         [PlayStation] Enable WebCore
2263         https://bugs.webkit.org/show_bug.cgi?id=192384
2264
2265         Reviewed by Brent Fulgham.
2266
2267         Implements WebCore for the PlayStation platform.
2268
2269         * PlatformPlayStation.cmake: Added.
2270         * loader/cache/CachedResourceLoader.cpp:
2271         * platform/generic/KeyedDecoderGeneric.cpp: Added.
2272         (WebCore::KeyedDecoder::decoder):
2273         (WebCore::KeyedDecoderGeneric::KeyedDecoderGeneric):
2274         (WebCore::KeyedDecoderGeneric::~KeyedDecoderGeneric):
2275         (WebCore::KeyedDecoderGeneric::decodeBytes):
2276         (WebCore::KeyedDecoderGeneric::decodeBool):
2277         (WebCore::KeyedDecoderGeneric::decodeUInt32):
2278         (WebCore::KeyedDecoderGeneric::decodeUInt64):
2279         (WebCore::KeyedDecoderGeneric::decodeInt32):
2280         (WebCore::KeyedDecoderGeneric::decodeInt64):
2281         (WebCore::KeyedDecoderGeneric::decodeFloat):
2282         (WebCore::KeyedDecoderGeneric::decodeDouble):
2283         (WebCore::KeyedDecoderGeneric::decodeString):
2284         (WebCore::KeyedDecoderGeneric::beginObject):
2285         (WebCore::KeyedDecoderGeneric::endObject):
2286         (WebCore::KeyedDecoderGeneric::beginArray):
2287         (WebCore::KeyedDecoderGeneric::beginArrayElement):
2288         (WebCore::KeyedDecoderGeneric::endArrayElement):
2289         (WebCore::KeyedDecoderGeneric::endArray):
2290         * platform/generic/KeyedDecoderGeneric.h: Added.
2291         * platform/generic/KeyedEncoderGeneric.cpp: Added.
2292         (WebCore::KeyedEncoder::encoder):
2293         (WebCore::KeyedEncoderGeneric::KeyedEncoderGeneric):
2294         (WebCore::KeyedEncoderGeneric::~KeyedEncoderGeneric):
2295         (WebCore::KeyedEncoderGeneric::encodeBytes):
2296         (WebCore::KeyedEncoderGeneric::encodeBool):
2297         (WebCore::KeyedEncoderGeneric::encodeUInt32):
2298         (WebCore::KeyedEncoderGeneric::encodeUInt64):
2299         (WebCore::KeyedEncoderGeneric::encodeInt32):
2300         (WebCore::KeyedEncoderGeneric::encodeInt64):
2301         (WebCore::KeyedEncoderGeneric::encodeFloat):
2302         (WebCore::KeyedEncoderGeneric::encodeDouble):
2303         (WebCore::KeyedEncoderGeneric::encodeString):
2304         (WebCore::KeyedEncoderGeneric::beginObject):
2305         (WebCore::KeyedEncoderGeneric::endObject):
2306         (WebCore::KeyedEncoderGeneric::beginArray):
2307         (WebCore::KeyedEncoderGeneric::beginArrayElement):
2308         (WebCore::KeyedEncoderGeneric::endArrayElement):
2309         (WebCore::KeyedEncoderGeneric::endArray):
2310         (WebCore::KeyedEncoderGeneric::finishEncoding):
2311         * platform/generic/KeyedEncoderGeneric.h: Added.
2312         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2313         (WebCore::defaultCookieJarPath):
2314         * platform/network/playstation/CurlSSLHandlePlayStation.cpp: Added.
2315         (WebCore::getCACertPathEnv):
2316         (WebCore::CurlSSLHandle::platformInitialize):
2317         * platform/network/playstation/NetworkStateNotifierPlayStation.cpp: Added.
2318         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
2319         (WebCore::NetworkStateNotifier::startObserving):
2320         * platform/playstation/EventLoopPlayStation.cpp: Added.
2321         (WebCore::EventLoop::cycle):
2322         * platform/playstation/MIMETypeRegistryPlayStation.cpp: Added.
2323         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
2324         (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
2325         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
2326         * platform/playstation/PlatformScreenPlayStation.cpp: Added.
2327         (WebCore::screenDepth):
2328         (WebCore::screenDepthPerComponent):
2329         (WebCore::screenIsMonochrome):
2330         (WebCore::screenHasInvertedColors):
2331         (WebCore::screenRect):
2332         (WebCore::screenAvailableRect):
2333         (WebCore::screenSupportsExtendedColor):
2334         * platform/playstation/ScrollbarThemePlayStation.cpp: Added.
2335         (WebCore::ScrollbarTheme::nativeTheme):
2336         (WebCore::ScrollbarThemePlayStation::scrollbarThickness):
2337         (WebCore::ScrollbarThemePlayStation::hasButtons):
2338         (WebCore::ScrollbarThemePlayStation::hasThumb):
2339         (WebCore::ScrollbarThemePlayStation::backButtonRect):
2340         (WebCore::ScrollbarThemePlayStation::forwardButtonRect):
2341         (WebCore::ScrollbarThemePlayStation::trackRect):
2342         (WebCore::ScrollbarThemePlayStation::paintTrackBackground):
2343         (WebCore::ScrollbarThemePlayStation::paintThumb):
2344         * platform/playstation/ScrollbarThemePlayStation.h: Added.
2345         * platform/playstation/UserAgentPlayStation.cpp: Added.
2346         (WebCore::standardUserAgent):
2347         (WebCore::standardUserAgentForURL):
2348         * rendering/RenderThemePlayStation.cpp: Added.
2349         (WebCore::RenderTheme::singleton):
2350         (WebCore::RenderThemePlayStation::updateCachedSystemFontDescription const):
2351         * rendering/RenderThemePlayStation.h: Added.
2352
2353 2018-12-05  Ryosuke Niwa  <rniwa@webkit.org>
2354
2355         Null pointer crash in DocumentOrderedMap::getElementById via FormAssociatedElement::findAssociatedForm
2356         https://bugs.webkit.org/show_bug.cgi?id=192392
2357
2358         Reviewed by Dean Jackson.
2359
2360         The crash was caused by FormAssociatedElement::findAssociatedForm invoking DocumentOrderedMap::getElementById
2361         and de-referencing nullptr Attribute* via IdTargetObserver before Element::attributeChanged had updated
2362         ElementData::m_idForStyleResolution.
2363
2364         Fixed it by updating m_idForStyleResolution before invoking IdTargetObservers.
2365
2366         Test: fast/dom/remove-id-form-associated-elemet-id-observer-crash.html
2367
2368         * dom/Element.cpp:
2369         (WebCore::Element::attributeChanged): Fixed the bug.
2370
2371 2018-12-05  Youenn Fablet  <youenn@apple.com>
2372
2373         Enable the possibility to do video capture in UIProcess
2374         https://bugs.webkit.org/show_bug.cgi?id=192394
2375
2376         Reviewed by Eric Carlson.
2377
2378         Create IOSurface-backed sample buffers so that we can easily send them through IPC.
2379         Manually tested.
2380
2381         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2382         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2383
2384 2018-12-05  Youenn Fablet  <youenn@apple.com>
2385
2386         Update ServiceWorkerContainer::getRegistration lambdas
2387         https://bugs.webkit.org/show_bug.cgi?id=192376
2388
2389         Reviewed by Chris Dumez.
2390
2391         There is no need to pass 'this' in lambdas as the last lambda
2392         takes a ScriptExecutionContext&.
2393         No change of behavior.
2394
2395         * workers/service/ServiceWorkerContainer.cpp:
2396         (WebCore::ServiceWorkerContainer::getRegistration):
2397         (WebCore::ServiceWorkerContainer::getRegistrations):
2398
2399 2018-12-05  Chris Dumez  <cdumez@apple.com>
2400
2401         Crash under WebCore::cachedDocumentWrapper()
2402         https://bugs.webkit.org/show_bug.cgi?id=192421
2403         <rdar://problem/37114163>
2404
2405         Reviewed by Alex Christensen.
2406
2407         Fix potential null defererence of the value returned by toJSDOMWindow(). For example,
2408         if the window is frameless, it would return null.
2409
2410         * bindings/js/JSDocumentCustom.cpp:
2411         (WebCore::cachedDocumentWrapper):
2412
2413 2018-12-05  Eric Carlson  <eric.carlson@apple.com>
2414
2415         [MediaStream] Cleanup up Mac screen capture class
2416         https://bugs.webkit.org/show_bug.cgi?id=192379
2417         <rdar://problem/46465458>
2418
2419         Reviewed by Youenn Fablet.
2420
2421         No new tests, tested manually.
2422
2423         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
2424         (WebCore::DisplayCaptureManagerCocoa::captureDevices): Initialize Screen devices first so
2425         they are first in the list of devices.
2426
2427         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2428         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2429         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Cleanup. Always capture at the
2430         native screen size to work around a bug.
2431         (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange): Deleted.
2432
2433 2018-12-05  Commit Queue  <commit-queue@webkit.org>
2434
2435         Unreviewed, rolling out r238844, r238846, and r238874.
2436         https://bugs.webkit.org/show_bug.cgi?id=192414
2437
2438         The layout tests added with this change are flaky. (Requested
2439         by ryanhaddad on #webkit).
2440
2441         Reverted changesets:
2442
2443         "Implement non-timeslice mode encoding for MediaRecorder"
2444         https://bugs.webkit.org/show_bug.cgi?id=192069
2445         https://trac.webkit.org/changeset/238844
2446
2447         "Fix the build"
2448         https://trac.webkit.org/changeset/238846
2449
2450         "Fix MediaRecorder flaky tests"
2451         https://bugs.webkit.org/show_bug.cgi?id=192371
2452         https://trac.webkit.org/changeset/238874
2453
2454 2018-12-05  Frederic Wang  <fwang@igalia.com>
2455
2456         Minor refactoring of the scrolling code
2457         https://bugs.webkit.org/show_bug.cgi?id=192398
2458
2459         Reviewed by Simon Fraser.
2460
2461         Based on an earlier patch by Simon Fraser.
2462
2463         This patch performs some minor refactoring of the scrolling code:
2464         - Rename ScrollingCoordinator::uniqueScrollLayerID() to uniqueScrollingNodeID() since it
2465           is really a node id.
2466         - Inline ScrollingStateTree::setRootStateNode() so we only need to forward declare
2467           ScrollingStateFrameScrollingNode in headers.
2468         - Pass argument to ScrollingStateTree::addNode() as a reference rather than a pointer.
2469         - Initialize ScrollingStateTree::m_changedProperties and ScrollingStateTree::m_parent in
2470           the header file.
2471         - Remove obsolete comment about ScrollingCoordinatorMac.
2472
2473         No new tests, behavior unchanged.
2474
2475         * page/scrolling/ScrollingCoordinator.cpp:
2476         (WebCore::ScrollingCoordinator::uniqueScrollingNodeID):
2477         (WebCore::ScrollingCoordinator::uniqueScrollLayerID): Deleted.
2478         * page/scrolling/ScrollingCoordinator.h:
2479         * page/scrolling/ScrollingStateNode.cpp:
2480         (WebCore::ScrollingStateNode::ScrollingStateNode):
2481         * page/scrolling/ScrollingStateNode.h:
2482         * page/scrolling/ScrollingStateTree.cpp:
2483         (WebCore::ScrollingStateTree::attachNode):
2484         (WebCore::ScrollingStateTree::setRootStateNode):
2485         (WebCore::ScrollingStateTree::addNode):
2486         * page/scrolling/ScrollingStateTree.h:
2487         (WebCore::ScrollingStateTree::setRootStateNode): Deleted.
2488         * page/scrolling/ScrollingTree.cpp:
2489         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2490         * rendering/RenderLayerCompositor.cpp:
2491         (WebCore::RenderLayerCompositor::attachScrollingNode):
2492
2493 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2494
2495         Turn WritingDirection into an enum class
2496         https://bugs.webkit.org/show_bug.cgi?id=192401
2497         Work towards <rdar://problem/42075638>
2498
2499         Reviewed by Dan Bernstein.
2500
2501         Change WritingDirection from an enum to an enum class. No change in behavior.
2502
2503         * editing/ApplyStyleCommand.cpp:
2504         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
2505         (WebCore::ApplyStyleCommand::applyInlineStyle):
2506         * editing/EditingStyle.cpp:
2507         (WebCore::EditingStyle::textDirection const):
2508         (WebCore::EditingStyle::textDirectionForSelection):
2509         * editing/Editor.cpp:
2510         (WebCore::Editor::setBaseWritingDirection):
2511         (WebCore::Editor::baseWritingDirectionForSelectionStart const):
2512         * editing/EditorCommand.cpp:
2513         (WebCore::stateTextWritingDirectionLeftToRight):
2514         (WebCore::stateTextWritingDirectionNatural):
2515         (WebCore::stateTextWritingDirectionRightToLeft):
2516         * editing/WritingDirection.h:
2517
2518         Additionally wrap this enum in `namespace WebCore`, and update the copyright year.
2519
2520         * editing/ios/EditorIOS.mm:
2521         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
2522         * page/ContextMenuController.cpp:
2523         (WebCore::ContextMenuController::contextMenuItemSelected):
2524         * testing/Internals.cpp:
2525         (WebCore::Internals::setBaseWritingDirection):
2526
2527 2018-12-05  Alicia Boya García  <aboya@igalia.com>
2528
2529         [MSE][GStreamer] Remove the AppendPipeline state machine
2530         https://bugs.webkit.org/show_bug.cgi?id=192204
2531
2532         Reviewed by Xabier Rodriguez-Calvar.
2533
2534         This patch tries to reduce the complexity of the AppendPipeline by
2535         removing the appendState state machine and cleaning all the
2536         conditional code around it that is not necessary anymore.
2537
2538         For the most part the behavior is the same, but some edge cases have
2539         been improved in the process:
2540
2541         Demuxing errors now result in the append being flagged as
2542         ParsingFailed and the error being propagated to the application. This
2543         fixes media/media-source/media-source-error-crash.html (or at least
2544         gets it up to date with cross platform expectations).
2545
2546         AbortableTaskQueue now allows the task handler to perform an abort
2547         safely. This is used in the GstBus error message sync handler, since
2548         it needs to ask the MainThread to raise a parse error, which will in
2549         turn abort. An API test has been added for this new functionality.
2550         Also, code has been added to the API tests to ensure the correct
2551         destruction of the response object, especially in this case.
2552
2553         The code handling invalid track codecs has been made clearer by also
2554         explicitly raising a parse error, but it should not expose behavior
2555         differences for the application. A test has been added for this
2556         behavior: web-platform-tests/media-source/mediasource-invalid-codec.html
2557
2558         The reporting of EOS events have been made more rigorous. EOS is only
2559         expected after a demuxing error, otherwise it's a g_critical.
2560
2561         AppendPipeline::abort() has been renamed to
2562         AppendPipeline::resetParserState() to honor the fact that it's not
2563         only called when the user calls abort() and match better the names
2564         used in the spec.
2565
2566         Test: imported/w3c/web-platform-tests/media-source/mediasource-invalid-codec.html
2567
2568         * platform/AbortableTaskQueue.h:
2569         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2570         (WebCore::assertedElementSetState):
2571         (WebCore::AppendPipeline::AppendPipeline):
2572         (WebCore::AppendPipeline::~AppendPipeline):
2573         (WebCore::AppendPipeline::handleErrorSyncMessage):
2574         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
2575         (WebCore::AppendPipeline::handleNeedContextSyncMessage):
2576         (WebCore::AppendPipeline::appsinkCapsChanged):
2577         (WebCore::AppendPipeline::handleEndOfAppend):
2578         (WebCore::AppendPipeline::appsinkNewSample):
2579         (WebCore::AppendPipeline::didReceiveInitializationSegment):
2580         (WebCore::AppendPipeline::resetParserState):
2581         (WebCore::AppendPipeline::pushNewBuffer):
2582         (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
2583         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromStreamingThread):
2584         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
2585         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
2586         (WebCore::AppendPipeline::dumpAppendState): Deleted.
2587         (WebCore::AppendPipeline::demuxerNoMorePads): Deleted.
2588         (WebCore::AppendPipeline::setAppendState): Deleted.
2589         (WebCore::AppendPipeline::appsinkEOS): Deleted.
2590         (WebCore::AppendPipeline::resetPipeline): Deleted.
2591         (WebCore::AppendPipeline::abort): Deleted.
2592         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2593         (WebCore::AppendPipeline::appendState): Deleted.
2594         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2595         (WebCore::MediaSourceClientGStreamerMSE::abort):
2596         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
2597         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2598         (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed):
2599         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2600
2601 2018-12-05  Rob Buis  <rbuis@igalia.com>
2602
2603         [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
2604         https://bugs.webkit.org/show_bug.cgi?id=114965
2605
2606         Reviewed by Frédéric Wang.
2607
2608         HEAD requests should not be changed to GET after 303 redirects, see [1].
2609         This was fixed earlier for GTK [2].
2610
2611         Behavior matches Firefox and Chrome.
2612
2613         [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
2614         [2] https://bugs.webkit.org/show_bug.cgi?id=110127
2615
2616         Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
2617                web-platform-tests/fetch/api/redirect/redirect-method-worker.html
2618                http/tests/xmlhttprequest/head-redirection.html
2619
2620         * platform/network/mac/ResourceHandleMac.mm:
2621         (WebCore::ResourceHandle::willSendRequest):
2622
2623 2018-12-05  Rob Buis  <rbuis@igalia.com>
2624
2625         Align with Fetch on data: URLs
2626         https://bugs.webkit.org/show_bug.cgi?id=182325
2627
2628         Reviewed by Alex Christensen.
2629
2630         Do not accept data URLs that do not contain a comma
2631         character, as specified in the relevant specs [1, 2].
2632
2633         Behavior matches Firefox and Chrome.
2634
2635         Test: web-platform-tests/fetch/api/basic/scheme-data.any.html
2636
2637         [1] https://tools.ietf.org/html/rfc2397
2638         [2] https://fetch.spec.whatwg.org/#data-url-processor
2639
2640         * platform/network/DataURLDecoder.cpp:
2641         (WebCore::DataURLDecoder::parseMediaType):
2642         (WebCore::DataURLDecoder::DecodeTask::DecodeTask):
2643         (WebCore::DataURLDecoder::DecodeTask::process):
2644         (WebCore::DataURLDecoder::createDecodeTask):
2645         (WebCore::DataURLDecoder::decode):
2646
2647 2018-12-05  Frederic Wang  <fwang@igalia.com>
2648
2649         Unreviewed build fix.
2650
2651         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Add missing header.
2652
2653 2018-12-05  Javier Fernandez  <jfernandez@igalia.com>
2654
2655         [css-grid] Crash on debug changing the style of a positioned element
2656         https://bugs.webkit.org/show_bug.cgi?id=191473
2657
2658         Reviewed by Dean Jackson and Zalan Bujtas.
2659
2660         When an box becomes {out-of,in}-flow, it may be re-parented and it may become a grid
2661         item. In that case, we must mark the RenderGrid as dirty, so that the grid items
2662         placement logic is executed again.
2663
2664         Test: fast/css-grid-layout/grid-crash-out-of-flow-positioned-element.html
2665
2666         * rendering/updating/RenderTreeBuilder.cpp:
2667         (WebCore::childFlowStateChangesAndAffectsParentBlock): Consider the case of a box's new parent being a grid container.
2668
2669 2018-12-04  Frederic Wang  <fwang@igalia.com>
2670
2671         Always pass scrollingGeometry to update*ScrollingNode functions
2672         https://bugs.webkit.org/show_bug.cgi?id=192358
2673
2674         Reviewed by Simon Fraser.
2675
2676         Currently, the scrollingGeometry parameter of updateOverflowScrollingNode is always used
2677         while the one of updateFrameScrollingNode is never used. Both of them are passed as possibly
2678         null pointers. This commit makes things more consistent by making the parameter a reference
2679         and explicitly setting the scrollingGeometry of updateFrameScrollingNode. This will help
2680         other efforts (such as support for macOS/iOS asynchronous scrolling of overflow nodes /
2681         subframes or for CSS overscroll-behavior) for which new data members have to be passed to the
2682         scrolling nodes.
2683
2684         No new tests, no behavior changes.
2685
2686         * page/scrolling/AsyncScrollingCoordinator.cpp:
2687         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
2688         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
2689         * page/scrolling/AsyncScrollingCoordinator.h:
2690         * page/scrolling/ScrollingCoordinator.h:
2691         (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
2692         (WebCore::ScrollingCoordinator::updateOverflowScrollingNode):
2693         * rendering/RenderLayerCompositor.cpp:
2694         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
2695         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2696
2697 2018-12-04  Ryosuke Niwa  <rniwa@webkit.org>
2698
2699         Crash in HTMLCollection::updateNamedElementCache
2700         https://bugs.webkit.org/show_bug.cgi?id=192347
2701
2702         Reviewed by Darin Adler.
2703
2704         The bug was caused by CollectionIndexCache's nodeAt caching the length of 1
2705         when there are no matching elements in the subtree when the index is non-zero.
2706
2707         A related bug was fixed in r182125 but we were not considering the possibility
2708         that the index given to this function might be non-zero even when there were
2709         no matching elements.
2710
2711         Test: fast/dom/options-collection-zero-length-crash.html
2712
2713         * dom/CollectionIndexCache.h:
2714         (WebCore::CollectionIndexCache<Collection, Iterator>::nodeAt):
2715
2716 2018-11-30  Jiewen Tan  <jiewen_tan@apple.com>
2717
2718         Don't report resource timing to parent frame for history items
2719         https://bugs.webkit.org/show_bug.cgi?id=192273
2720         <rdar://problem/45163764>
2721
2722         Reviewed by Youenn Fablet.
2723
2724         We should not report history items to its parent frame as those are less
2725         interested to its parent and might not be the first navigation in the iframes.
2726
2727         This change aligns the behavior when a cached document is not available for the
2728         history item with the available case as we don't report resource timing for any
2729         cached main document.
2730
2731         Test: http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html
2732
2733         * loader/FrameLoader.cpp:
2734         (WebCore::FrameLoader::loadDifferentDocumentItem):
2735
2736 2018-12-04  Simon Fraser  <simon.fraser@apple.com>
2737
2738         REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
2739         https://bugs.webkit.org/show_bug.cgi?id=192320
2740         <rdar://problem/46429833>
2741
2742         Reviewed by Zalan Bujtas.
2743         
2744         Re-land r238840 with a more reliable test.
2745         
2746         When we fall into slow scrolling mode (for example, because of background-attachment: fixed),
2747         RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers
2748         for viewport-constrained objects so we update them.
2749         
2750         This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already
2751         does enough dirtying that fixed layers nested inside scrollers get updated.
2752
2753         Test: compositing/fixed-with-main-thread-scrolling.html
2754
2755         * rendering/RenderLayerCompositor.cpp:
2756         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2757
2758 2018-12-04  Youenn Fablet  <youenn@apple.com>
2759
2760         Fix MediaRecorder flaky tests
2761         https://bugs.webkit.org/show_bug.cgi?id=192371
2762
2763         Reviewed by Eric Carlson.
2764
2765         No change of behavior.
2766
2767         * testing/Internals.cpp:
2768         (WebCore::Internals::resetToConsistentState):
2769         Reset to use real MediaRecorder by default.
2770
2771 2018-12-04  Justin Michaud  <justin_michaud@apple.com>
2772
2773         CSS Painting API should allow image values in inputProperties
2774         https://bugs.webkit.org/show_bug.cgi?id=192200
2775
2776         Reviewed by Dean Jackson.
2777
2778         Adds new TypedOMCSSImageValue wrapper. We rename all the existing ones so that the naming is consistent (CSSImageValue is already a thing).
2779         Finally, we let CanvasRenderingContext2DBase render these.
2780
2781         Tests: fast/css-custom-paint/arguments.html
2782                fast/css-custom-paint/image.html
2783
2784         * CMakeLists.txt:
2785         * DerivedSources.make:
2786         * Sources.txt:
2787         * WebCore.xcodeproj/project.pbxproj:
2788         * bindings/js/CallTracerTypes.h:
2789         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp.
2790         (WebCore::toJSNewlyCreated):
2791         (WebCore::toJS):
2792         * bindings/js/WebCoreBuiltinNames.h:
2793         * css/CSSComputedStyleDeclaration.cpp:
2794         (WebCore::ComputedStyleExtractor::customPropertyValue):
2795         * css/CSSCustomPropertyValue.cpp:
2796         (WebCore::CSSCustomPropertyValue::equals const):
2797         (WebCore::CSSCustomPropertyValue::customCSSText const):
2798         (WebCore::CSSCustomPropertyValue::tokens const):
2799         * css/CSSCustomPropertyValue.h:
2800         * css/CSSPaintImageValue.cpp:
2801         (WebCore::CSSPaintImageValue::image):
2802         * css/typedom/StylePropertyMapReadOnly.h:
2803         (WebCore::StylePropertyMapReadOnly::create):
2804         (WebCore::StylePropertyMapReadOnly::get const):
2805         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
2806         * css/typedom/StylePropertyMapReadOnly.idl:
2807         * css/typedom/TypedOMCSSImageValue.h: Copied from Source/WebCore/css/typedom/CSSUnitValue.h.
2808         * css/typedom/TypedOMCSSImageValue.idl: Copied from Source/WebCore/css/typedom/CSSStyleValue.idl.
2809         * css/typedom/TypedOMCSSNumericValue.h: Renamed from Source/WebCore/css/typedom/CSSNumericValue.h.
2810         * css/typedom/TypedOMCSSNumericValue.idl: Renamed from Source/WebCore/css/typedom/CSSNumericValue.idl.
2811         * css/typedom/TypedOMCSSStyleValue.h: Renamed from Source/WebCore/css/typedom/CSSStyleValue.h.
2812         (WebCore::TypedOMCSSStyleValue::isImageValue):
2813         * css/typedom/TypedOMCSSStyleValue.idl: Renamed from Source/WebCore/css/typedom/CSSStyleValue.idl.
2814         * css/typedom/TypedOMCSSUnitValue.h: Renamed from Source/WebCore/css/typedom/CSSUnitValue.h.
2815         * css/typedom/TypedOMCSSUnitValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnitValue.idl.
2816         * css/typedom/TypedOMCSSUnparsedValue.h: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.h.
2817         * css/typedom/TypedOMCSSUnparsedValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.idl.
2818         * html/ImageBitmap.cpp:
2819         (WebCore::ImageBitmap::createPromise):
2820         * html/ImageBitmap.h:
2821         * html/canvas/CanvasDrawImage.idl:
2822         * html/canvas/CanvasFillStrokeStyles.idl:
2823         * html/canvas/CanvasRenderingContext.cpp:
2824         (WebCore::CanvasRenderingContext::checkOrigin):
2825         * html/canvas/CanvasRenderingContext.h:
2826         * html/canvas/CanvasRenderingContext2DBase.cpp:
2827         (WebCore::size):
2828         (WebCore::CanvasRenderingContext2DBase::drawImage):
2829         (WebCore::CanvasRenderingContext2DBase::createPattern):
2830         * html/canvas/CanvasRenderingContext2DBase.h:
2831         * inspector/InspectorCanvas.cpp:
2832         (WebCore::InspectorCanvas::buildAction):
2833         * page/WindowOrWorkerGlobalScope.idl:
2834         * platform/graphics/CustomPaintImage.cpp:
2835         (WebCore::CustomPaintImage::doCustomPaint):
2836
2837 2018-12-04  Chris Dumez  <cdumez@apple.com>
2838
2839         Regression(r238817) PSON Page Cache API tests are failing
2840         https://bugs.webkit.org/show_bug.cgi?id=192348
2841
2842         Reviewed by Alex Christensen.
2843
2844         * page/MemoryRelease.cpp:
2845         (WebCore::releaseCriticalMemory):
2846         (WebCore::releaseMemory):
2847         * page/MemoryRelease.h:
2848
2849 2018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
2850
2851         Unreviewed, rolling out r238838.
2852
2853         The layout test added with this change is failing on iOS.
2854
2855         Reverted changeset:
2856
2857         "Thick overlines and line-throughs grow in the wrong
2858         direction"
2859         https://bugs.webkit.org/show_bug.cgi?id=192264
2860         https://trac.webkit.org/changeset/238838
2861
2862 2018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
2863
2864         Unreviewed, rolling out r238840.
2865
2866         The layout test added with this change is frequently failing.
2867
2868         Reverted changeset:
2869
2870         "REGRESSION (r238090): position:fixed sidebar on
2871         https://www.w3.org/TR/SVG2/coords.html does not stay fixed"
2872         https://bugs.webkit.org/show_bug.cgi?id=192320
2873         https://trac.webkit.org/changeset/238840
2874
2875 2018-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2876
2877         [SOUP] Move URLSoup back to WebCore after r238771
2878         https://bugs.webkit.org/show_bug.cgi?id=192306
2879
2880         Reviewed by Michael Catanzaro.
2881
2882         Add soupURIToURL() and urlToSoupURI() to replace the URL contructor taking a Soup URI and
2883         URL::createSoupURI(). Fix several build failures that showed up after removing the soup includes from URL
2884         header.
2885
2886         * platform/Cookie.h:
2887         * platform/SharedBuffer.h:
2888         * platform/SourcesSoup.txt:
2889         * platform/network/soup/CookieSoup.cpp:
2890         * platform/network/soup/GUniquePtrSoup.h: Renamed from Source/WTF/wtf/glib/GUniquePtrSoup.h.
2891         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2892         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
2893         (WebCore::NetworkStorageSession::deleteCookie const):
2894         (WebCore::NetworkStorageSession::getCookies):
2895         (WebCore::NetworkStorageSession::getRawCookies const):
2896         (WebCore::cookiesForSession):
2897         * platform/network/soup/ResourceErrorSoup.cpp:
2898         (WebCore::failingURI):
2899         * platform/network/soup/ResourceHandleSoup.cpp:
2900         * platform/network/soup/ResourceRequest.h:
2901         (WebCore::ResourceRequest::ResourceRequest):
2902         * platform/network/soup/ResourceRequestSoup.cpp:
2903         (WebCore::ResourceRequest::updateSoupMessageMembers const):
2904         (WebCore::ResourceRequest::updateFromSoupMessage):
2905         (WebCore::ResourceRequest::createSoupURI const):
2906         * platform/network/soup/ResourceResponseSoup.cpp:
2907         (WebCore::ResourceResponse::updateFromSoupMessage):
2908         * platform/network/soup/SocketStreamHandleImpl.h:
2909         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2910         (WebCore::SocketStreamHandleImpl::create):
2911         * platform/network/soup/SoupNetworkSession.cpp:
2912         * platform/network/soup/URLSoup.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp.
2913         (WebCore::soupURIToURL):
2914         (WebCore::urlToSoupURI):
2915         * platform/network/soup/URLSoup.h: Renamed from Source/WTF/wtf/glib/URLSoup.cpp.
2916
2917 2018-12-04  Devin Rousso  <drousso@apple.com>
2918
2919         Web Inspector: Audit: tests should support async operations
2920         https://bugs.webkit.org/show_bug.cgi?id=192171
2921         <rdar://problem/46423562>
2922
2923         Reviewed by Joseph Pecoraro.
2924
2925         * page/Settings.yaml:
2926         * dom/ScriptExecutionContext.cpp:
2927         (ScriptExecutionContext::reportUnhandledPromiseRejection):
2928         Add setting for muting the "Unhandled Promise Rejection" console message.
2929
2930 2018-12-03  Tim Horton  <timothy_horton@apple.com>
2931
2932         Fix the build
2933
2934         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2935         Unified sources, of course.
2936
2937 2018-12-03  Youenn Fablet  <youenn@apple.com>
2938
2939         A sender created through addTransceiver and populated using addTrack should have its source set
2940         https://bugs.webkit.org/show_bug.cgi?id=192136
2941
2942         Reviewed by Eric Carlson.
2943
2944         In case libwebrtc backend is already created, we need to make sure to
2945         set the track source to the libwebrtc sender backend that is actually
2946         tied to the sender.
2947
2948         Covered by updated test.
2949
2950         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2951         (WebCore::LibWebRTCPeerConnectionBackend::removeTrack):
2952         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2953         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
2954         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
2955
2956 2018-12-03  YUHAN WU  <yuhan_wu@apple.com>
2957
2958         Implement non-timeslice mode encoding for MediaRecorder
2959         https://bugs.webkit.org/show_bug.cgi?id=192069
2960
2961         Reviewed by Youenn Fablet.
2962
2963         Implement the encoding for non-timeslice mode of MediaRecorder.
2964         It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
2965         Add a API in internals to allow testings to turn on the mock source.
2966
2967         Tests: http/wpt/mediarecorder/MediaRecorder-AV-audio-only-dataavailable.html
2968                http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
2969                http/wpt/mediarecorder/MediaRecorder-AV-video-only-dataavailable.html
2970
2971         * Modules/mediarecorder/MediaRecorder.cpp:
2972         (WebCore::MediaRecorder::create):
2973         (WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
2974         (WebCore::MediaRecorder::getPrivateImpl):
2975         (WebCore::MediaRecorder::MediaRecorder):
2976         (WebCore::MediaRecorder::stopRecording):
2977         (WebCore::MediaRecorder::stopRecordingInternal):
2978         (WebCore::MediaRecorder::createRecordingDataBlob):
2979         (WebCore::MediaRecorder::scheduleDeferredTask):
2980         * Modules/mediarecorder/MediaRecorder.h:
2981         * Modules/mediarecorder/MediaRecorder.idl:
2982         * SourcesCocoa.txt:
2983         * WebCore.xcodeproj/project.pbxproj:
2984         * platform/mediarecorder/MediaRecorderPrivate.h:
2985         (WebCore::MediaRecorderPrivate::stopRecording):
2986         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
2987         (WebCore::MediaRecorderPrivateAVFImpl::create):
2988         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVImpl):
2989         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
2990         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
2991         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
2992         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
2993         (WebCore::MediaRecorderPrivateAVFImpl::mimeType):
2994         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
2995         * platform/mediarecorder/MediaRecorderPrivateMock.cpp:
2996         (WebCore::MediaRecorderPrivateMock::fetchData):
2997         (WebCore::MediaRecorderPrivateMock::mimeType):
2998         * platform/mediarecorder/MediaRecorderPrivateMock.h:
2999         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: Added.
3000         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
3001         (WebCore::MediaRecorderPrivateWriter::setupWriter):
3002         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
3003         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
3004         (WebCore::copySampleBufferWithCurrentTimeStamp):
3005         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
3006         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
3007         (WebCore::MediaRecorderPrivateWriter::stopRecording):
3008         (WebCore::MediaRecorderPrivateWriter::fetchData):
3009         * testing/Internals.cpp:
3010         (WebCore::createRecorderMockSource):
3011         (WebCore::Internals::setCustomPrivateRecorderCreator):
3012         * testing/Internals.h:
3013         * testing/Internals.idl:
3014
3015 2018-12-03  Simon Fraser  <simon.fraser@apple.com>
3016
3017         REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
3018         https://bugs.webkit.org/show_bug.cgi?id=192320
3019         <rdar://problem/46429833>
3020
3021         Reviewed by Zalan Bujtas.
3022         
3023         When we fall into slow scrolling mode (for example, because of background-attachment: fixed),
3024         RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers
3025         for viewport-constrained objects so we update them.
3026         
3027         This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already
3028         does enough dirtying that fixed layers nested inside scrollers get updated.
3029
3030         Test: compositing/fixed-with-main-thread-scrolling.html
3031
3032         * rendering/RenderLayerCompositor.cpp:
3033         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3034
3035 2018-12-03  Justin Michaud  <justin_michaud@apple.com>
3036
3037         CSS Painting API should scale display list when drawing
3038         https://bugs.webkit.org/show_bug.cgi?id=192217
3039
3040         Reviewed by Simon Fraser.
3041
3042         When we replay the display list, fix the scaling. The separate buffer is needed to make sure that globalCompositeOperation functions correctly.
3043
3044         * html/CustomPaintCanvas.cpp:
3045         (WebCore::CustomPaintCanvas::replayDisplayList const):
3046         * html/CustomPaintCanvas.h:
3047         * platform/graphics/CustomPaintImage.cpp:
3048         (WebCore::CustomPaintImage::doCustomPaint):
3049
3050 2018-12-03  Myles C. Maxfield  <mmaxfield@apple.com>
3051
3052         Thick overlines and line-throughs grow in the wrong direction
3053         https://bugs.webkit.org/show_bug.cgi?id=192264
3054
3055         Reviewed by Dean Jackson.
3056
3057         Overlines should grow upward, and line-throughs should stay centered.
3058
3059         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
3060
3061         * rendering/TextDecorationPainter.cpp:
3062         (WebCore::TextDecorationPainter::paintTextDecoration):
3063         * style/InlineTextBoxStyle.cpp:
3064         (WebCore::visualOverflowForDecorations):
3065
3066 2018-12-03  Simon Fraser  <simon.fraser@apple.com>
3067
3068         Viewport-constrained renderers are always RenderLayerModelObjects
3069         https://bugs.webkit.org/show_bug.cgi?id=192342
3070
3071         Reviewed by Myles C. Maxfield.
3072
3073         addViewportConstrainedObject/removeViewportConstrainedObject can take RenderLayerModelObjects,
3074         since all viewport-constrained renderers have layers.
3075
3076         * page/FrameView.cpp:
3077         (WebCore::FrameView::addViewportConstrainedObject):
3078         (WebCore::FrameView::removeViewportConstrainedObject):
3079         * page/FrameView.h:
3080         * rendering/RenderLayerModelObject.cpp:
3081         (WebCore::RenderLayerModelObject::styleDidChange): The 0 argument is actually a nullptr RenderGeometryMap,
3082         which has a default value, and the comment was obsolete.
3083
3084 2018-12-03  Don Olmstead  <don.olmstead@sony.com>
3085
3086         Fix some unused parameter warnings
3087         https://bugs.webkit.org/show_bug.cgi?id=192336
3088
3089         Reviewed by Fujii Hironori.
3090
3091         * Modules/indexeddb/server/IDBSerialization.cpp:
3092         (WebCore::isLegacySerializedIDBKeyData):
3093         * platform/FileSystem.cpp:
3094         (WebCore::FileSystem::openAndLockFile):
3095         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3096         (WebCore::GraphicsContext3D::bindVertexArray):
3097         * platform/network/curl/CertificateInfo.h:
3098         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
3099         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
3100
3101 2018-12-03  Keith Rollin  <krollin@apple.com>
3102
3103         Add .xcfilelist files
3104         https://bugs.webkit.org/show_bug.cgi?id=192082
3105         <rdar://problem/46312533>
3106
3107         Reviewed by Brent Fulgham.
3108
3109         Add .xcfilelist files for Generate Derived Sources and Generate
3110         Unified Sources build phases in Xcode. These are just being staged for
3111         now; they'll be added to the Xcode projects later.
3112
3113         No new tests -- no changed functionality.
3114
3115         * DerivedSources-input.xcfilelist: Added.
3116         * DerivedSources-output.xcfilelist: Added.
3117         * UnifiedSources-input.xcfilelist: Added.
3118         * UnifiedSources-output.xcfilelist: Added.
3119
3120 2018-12-03  Alex Christensen  <achristensen@webkit.org>
3121
3122         Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler
3123         https://bugs.webkit.org/show_bug.cgi?id=192272
3124
3125         Reviewed by Brady Eidson.
3126
3127         This is needed for rdar://problem/45910057
3128         Covered by an API test.
3129
3130         * loader/EmptyFrameLoaderClient.h:
3131         * loader/FrameLoader.cpp:
3132         (WebCore::FrameLoader::prepareForLoadStart):
3133         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
3134         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
3135         * loader/FrameLoader.h:
3136         * loader/FrameLoaderClient.h:
3137
3138 2018-12-03  Zalan Bujtas  <zalan@apple.com>
3139
3140         [iOS] Unreviewed build fix.
3141
3142         * page/DOMTimer.cpp:
3143         (WebCore::DOMTimer::fired):
3144
3145 2018-12-03  Jer Noble  <jer.noble@apple.com>
3146
3147         Get rid of old, dead Mac video fullscreen code.
3148         https://bugs.webkit.org/show_bug.cgi?id=192315
3149
3150         Reviewed by Eric Carlson.
3151
3152         * PlatformMac.cmake:
3153         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3154         (WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
3155
3156 2018-12-03  Ryosuke Niwa  <rniwa@webkit.org>
3157
3158         title attribute on style & link elements should be ignored inside a shadow tree
3159         https://bugs.webkit.org/show_bug.cgi?id=191297
3160
3161         Reviewed by Antti Koivisto.
3162
3163         Fixed the by not setting the stylesheet's title even when the title content attribute is present
3164         or set on SVG/HTML style and link elements inside a shadow tree.
3165
3166         Test: fast/shadow-dom/stylesheet-title-in-shadow-tree.html
3167
3168         * dom/InlineStyleSheetOwner.cpp:
3169         (WebCore::InlineStyleSheetOwner::createSheet):
3170         * html/HTMLLinkElement.cpp:
3171         (WebCore::HTMLLinkElement::parseAttribute):
3172         (WebCore::HTMLLinkElement::initializeStyleSheet):
3173         * html/HTMLStyleElement.cpp:
3174         (WebCore::HTMLStyleElement::parseAttribute):
3175         * style/StyleScope.cpp:
3176         (WebCore::Style::Scope::collectActiveStyleSheets):
3177         * svg/SVGStyleElement.cpp:
3178         (WebCore::SVGStyleElement::parseAttribute):
3179
3180 2018-12-03  Zalan Bujtas  <zalan@apple.com>
3181
3182         [iOS] Add logging channel for hover related content observation
3183         https://bugs.webkit.org/show_bug.cgi?id=192312
3184
3185         Reviewed by Simon Fraser.
3186
3187         * dom/Document.cpp:
3188         (WebCore::Document::scheduleStyleRecalc):
3189         (WebCore::Document::updateStyleIfNeeded):
3190         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
3191         * page/DOMTimer.cpp:
3192         (WebCore::DOMTimer::install):
3193         (WebCore::DOMTimer::fired):
3194         * page/DOMWindow.cpp:
3195         (WebCore::DOMWindow::clearTimeout):
3196         * page/Frame.cpp:
3197         (WebCore::Frame::willDetachPage):
3198         * platform/Logging.h:
3199
3200 2018-12-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3201
3202         [SOUP] Use SoupSession instead of SoupSessionAsync
3203         https://bugs.webkit.org/show_bug.cgi?id=107451
3204
3205         Reviewed by Carlos Garcia Campos.
3206
3207         With glib-networking 2.57.1, WebKit is no longer able to load TLS error pages. The problem
3208         is a network process deadlock caused by a change in how glib-networking performs certificate
3209         verification. Previously it verified certificates *after* the TLS handshake had completed,
3210         which was weirdly late, but previously not problematic. But now that TLS 1.3 exists,
3211         application data can be sent before certificate verification occurs, which is no good. So I
3212         moved verification to occur during the handshake. I needed to do this regardless because I
3213         need to add a new callback in GnuTLS for another feature. This introduced a deadlock in
3214         WebKit:
3215
3216          - glib-networking detects an unacceptable certificate, emits accept-certificate signal
3217          - NetworkDataTaskSoup::tlsConnectionAcceptCertificate calls
3218            NetworkDataTaskSoup::invalidateAndCancel calls NetworkDataTaskSoup::clearRequest
3219          - NetworkDataTaskSoup::clearRequest calls soup_session_cancel_message
3220
3221         The problem is that, in the deprecated SoupSessionAsync used by WebKit, cancellation is
3222         always *synchronous* despite the name of the class. So soup_session_cancel_message winds up
3223         doing its thing to close everything out, and that eventually ends up in a synchronous call
3224         to g_tls_connection_gnutls_close. The close operation can't proceed until the TLS handshake
3225         is finished, and the handshake is blocked waiting for WebKit to return from its
3226         accept-certificate handler. So the close operation winds up polling forever waiting for the
3227         handshake to finish. Deadlock.
3228
3229         The only changes required in WebKit to use the modern SoupSession are adjustments for the
3230         new default property values. Most of the properties we used to set explicitly are now
3231         defaults and should be removed. Additionally, SoupSession has default timeouts, which we
3232         want to override to allow NetworkDataTaskSoup to implement its own timeouts.
3233
3234         No new tests because this is covered by TestSSL (which would be failing if run with the
3235         newer glib-networking).
3236
3237         * platform/network/soup/SoupNetworkSession.cpp:
3238         (WebCore::SoupNetworkSession::SoupNetworkSession):
3239
3240 2018-12-03  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3241
3242         Use WallTime for file time
3243         https://bugs.webkit.org/show_bug.cgi?id=192287
3244
3245         Reviewed by Darin Adler.
3246
3247         This patch changes a type of file time from double to WallTime to use strongly typed file time.
3248
3249         No behavior change.
3250
3251         * Modules/webdatabase/Database.cpp:
3252         (WebCore::Database::details const):
3253         * Modules/webdatabase/DatabaseDetails.h:
3254         (WebCore::DatabaseDetails::DatabaseDetails):
3255         (WebCore::DatabaseDetails::creationTime const):
3256         (WebCore::DatabaseDetails::modificationTime const):
3257         * Modules/webdatabase/DatabaseManager.cpp:
3258         (WebCore::DatabaseManager::ProposedDatabase::ProposedDatabase):
3259         * Modules/webdatabase/DatabaseTracker.cpp:
3260         (WebCore::DatabaseTracker::detailsForNameAndOrigin):
3261         * fileapi/AsyncFileStream.cpp:
3262         (WebCore::AsyncFileStream::getSize):
3263         * fileapi/AsyncFileStream.h:
3264         * fileapi/File.cpp:
3265         (WebCore::File::lastModified const):
3266         * page/Page.cpp:
3267         (WebCore::Page::userStyleSheetLocationChanged):
3268         (WebCore::Page::userStyleSheet const):
3269         * page/Page.h:
3270         * platform/FileMetadata.h:
3271         * platform/FileStream.cpp:
3272         (WebCore::FileStream::getSize):
3273         * platform/FileStream.h:
3274         * platform/FileSystem.cpp:
3275         (WebCore::FileSystem::getFileModificationTime): Deleted.
3276         * platform/FileSystem.h:
3277         (WebCore::FileSystem::invalidFileTime): Deleted.
3278         (WebCore::FileSystem::isValidFileTime): Deleted.
3279         * platform/glib/FileSystemGlib.cpp:
3280         (WebCore::FileSystem::getFileCreationTime):
3281         (WebCore::FileSystem::getFileModificationTime):
3282         (WebCore::FileSystem::fileMetadataUsingFunction):
3283         * platform/network/BlobDataFileReference.cpp:
3284         (WebCore::BlobDataFileReference::BlobDataFileReference):
3285         (WebCore::BlobDataFileReference::expectedModificationTime):
3286         * platform/network/BlobDataFileReference.h:
3287         * platform/network/FormData.cpp:
3288         (WebCore::FormData::appendFile):
3289         (WebCore::FormData::appendFileRange):
3290         * platform/network/FormData.h:
3291         (WebCore::FormDataElement::FormDataElement):
3292         (WebCore::FormDataElement::EncodedFileData::decode):
3293         * platform/network/cf/FormDataStreamCFNet.cpp:
3294         (WebCore::advanceCurrentStream):
3295         * platform/network/soup/ResourceRequestSoup.cpp:
3296         (WebCore::appendEncodedBlobItemToSoupMessageBody):
3297         * platform/posix/FileSystemPOSIX.cpp:
3298         (WebCore::FileSystem::getFileCreationTime):
3299         (WebCore::FileSystem::getFileModificationTime):
3300         * platform/sql/SQLiteFileSystem.cpp:
3301         (WebCore::SQLiteFileSystem::databaseCreationTime):
3302         (WebCore::SQLiteFileSystem::databaseModificationTime):
3303         * platform/sql/SQLiteFileSystem.h:
3304         * platform/win/FileSystemWin.cpp:
3305         (WebCore::FileSystem::getFileModificationTime):
3306         (WebCore::FileSystem::getFileCreationTime):
3307         (WebCore::FileSystem::findDataToFileMetadata):
3308
3309 2018-12-03  Dean Jackson  <dino@apple.com>
3310
3311         Fix iOS Simulator Release test crashes.
3312
3313         * platform/network/ios/WebCoreURLResponseIOS.mm:
3314         (WebCore::adjustMIMETypeIfNecessary): Check for null before using the
3315         new MIME type.
3316
3317 2018-12-03  Eric Carlson  <eric.carlson@apple.com>
3318
3319         [MediaStream] 'devicechange' event when more capture device information are revealed.
3320         https://bugs.webkit.org/show_bug.cgi?id=192268
3321
3322         Reviewed by Youenn Fablet.
3323
3324         Test: fast/mediastream/enumerate-devices-change-event.html
3325
3326         * Modules/mediastream/MediaDevicesRequest.cpp:
3327         (WebCore::MediaDevicesRequest::start): Remove code to modify device based on access, that is
3328         now done in the UI process.
3329         (WebCore::MediaDevicesRequest::filterDeviceList): Deleted.
3330         * Modules/mediastream/MediaDevicesRequest.h:
3331         * platform/mediastream/RealtimeMediaSourceCenter.h:
3332
3333 2018-12-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3334
3335         [iOSMac] Unable to upload non-image files using drag and drop in WKWebView
3336         https://bugs.webkit.org/show_bug.cgi?id=192283
3337         <rdar://problem/46399461>
3338
3339         Reviewed by Ryosuke Niwa.
3340
3341         Currently on iOS, file URLs aren't generally written to the pasteboard during drag and drop unless the
3342         application providing the data explicitly registers "public.file-url" to item providers. As such, our current
3343         logic on iOS for handling drops does not attempt to prevent "public.file-url" from being advertised as the
3344         "text/uri-list" MIME type in DataTransfer, though we do currently succeed in suppressing access to the file URL.
3345
3346         However, on iOSMac, the scenario in which file URLs are registered to item providers becomes pertinent when
3347         uploading files from other macOS apps (e.g. Finder) into a WKWebView running in iOSMac. Furthermore, the
3348         `preferredPresentationStyle` flag on `NSItemProvider` is unavailable in iOSMac; currently, this flag is our
3349         primary cue on iOS that an item should be treated as an attachment rather than inline data. In order to support
3350         file uploads in iOSMac, we make several adjustments to drop handling logic in iOS to handle the case where the
3351         "public.file-url" type is registered. See below for more details.
3352
3353         Tests:  DragAndDropTests.DataTransferExposePlainTextWithFileURLAsFile
3354                 DragAndDropTests.DataTransferGetDataWhenDroppingImageWithFileURL
3355
3356         * platform/PasteboardItemInfo.h:
3357         (WebCore::PasteboardItemInfo::encode const):
3358         (WebCore::PasteboardItemInfo::decode):
3359
3360         Add a new flag that is set if and only if the item provider contains the "public.file-url" type, and also
3361         contains some non-URL data type that conforms to one of the file types supported for file uploads (i.e.
3362         "public.content", zip archives, and folders).
3363
3364         * platform/cocoa/PasteboardCocoa.mm:
3365         (WebCore::Pasteboard::fileContentState):
3366
3367         Consider the pasteboard to contain files in the case where one or more of the items contains a file URL, along
3368         with some other pasteboard data that can be represented as a file upload.
3369
3370         * platform/ios/PlatformPasteboardIOS.mm:
3371         (WebCore::PlatformPasteboard::informationForItemAtIndex):
3372         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3373
3374         If the pasteboard contains "public.file-url", don't consider "text/uri-list" to be one of the data types that's
3375         safe to expose to the page. Our current behavior in this case is that we will advertise "text/uri-list" as a
3376         pasteboard type in the DataTransfer, but if the page attempts to request this information, we simply return the
3377         empty string. Instead, we shouldn't expose "text/uri-list" as a type in the first place.
3378
3379         * platform/ios/WebItemProviderPasteboard.h:
3380         * platform/ios/WebItemProviderPasteboard.mm:
3381
3382         Add a few more `__bridge`-ing casts where appropriate.
3383
3384         (typeConformsToTypes):
3385
3386         Move this further up the file so that it can be used in `NSItemProvider (WebCoreExtras)`.
3387
3388         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
3389
3390         Add a helper method on NSItemProvider to determine whether an item provider has a file URL, as well as a content
3391         type suitable for file uploads.
3392
3393         (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
3394
3395         This currently always returns `NO` in iOSMac; instead, return `YES` on both iOS and iOSMac in the case where the
3396         item provider contains a file URL and content which may be uploaded.
3397
3398         (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]):
3399         (-[WebItemProviderPasteboard typeIdentifiersToLoad:]):
3400
3401         Refactor this to take an `NSItemProvider` instead of a list of type identifiers, and bail out of loading data
3402         for "public.url" if the item provider contains a file URL.
3403
3404         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
3405         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]): Deleted.
3406
3407 2018-12-02  Zalan Bujtas  <zalan@apple.com>
3408
3409         Add a runtime feature flag for LayoutFormattingContext.
3410         https://bugs.webkit.org/show_bug.cgi?id=192280
3411
3412         Reviewed by Simon Fraser.
3413
3414         * Configurations/FeatureDefines.xcconfig:
3415         * page/FrameViewLayoutContext.cpp:
3416         (WebCore::layoutUsingFormattingContext):
3417         * page/RuntimeEnabledFeatures.h:
3418         (WebCore::RuntimeEnabledFeatures::setLayoutFormattingContextEnabled):
3419         (WebCore::RuntimeEnabledFeatures::layoutFormattingContextEnabled const):
3420
3421 2018-12-01  Brent Fulgham  <bfulgham@apple.com>
3422
3423         Lifetime of HTMLMediaElement is not properly handled in asynchronous actions
3424         https://bugs.webkit.org/show_bug.cgi?id=192087
3425         <rdar://problem/45975230>