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