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