Thick overlines and line-throughs grow in the wrong direction
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-12-18  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         Thick overlines and line-throughs grow in the wrong direction
4         https://bugs.webkit.org/show_bug.cgi?id=192264
5
6         Reviewed by Dean Jackson.
7
8         Overlines should grow upward, and line-throughs should stay centered.
9
10         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
11
12         * rendering/TextDecorationPainter.cpp:
13         (WebCore::TextDecorationPainter::paintTextDecoration):
14         * style/InlineTextBoxStyle.cpp:
15         (WebCore::visualOverflowForDecorations):
16
17 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
18
19         Some iOS app crash in FrameLoader::checkCompleted
20         https://bugs.webkit.org/show_bug.cgi?id=192804
21         <rdar://problem/44240573>
22
23         Reviewed by Tim Horton.
24
25         It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
26         is trying to send a delegate message. Disable the release assertion while this is happening
27         so that iOS app would not crash.
28
29         Unfortunately no new test as there is no way to easily test UIWebView in iOS,
30         and this requires a race between the web thread & the main thread.
31
32         * dom/ScriptDisallowedScope.h:
33         (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
34         * platform/ios/wak/WebCoreThread.h:
35         * platform/ios/wak/WebCoreThread.mm:
36         (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
37         (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
38         (SendDelegateMessage):
39
40 2018-12-18  David Kilzer  <ddkilzer@apple.com>
41
42         clang-tidy: Use const reference for MediaTime parameter to prevent object copy
43         <https://webkit.org/b/192814>
44
45         Reviewed by Mark Lam.
46
47         * bindings/js/JSDOMConvertNumbers.h:
48         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
49
50 2018-12-18  Justin Fan  <justin_fan@apple.com>
51
52         [WebGPU] BindGroupLayout and Device::createBindGroupLayout
53         https://bugs.webkit.org/show_bug.cgi?id=192817
54
55         Reviewed by Dean Jackson.
56
57         Update bind-group-layouts to test new functionality.
58
59         Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
60         * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
61         (WebCore::WebGPUBindGroupLayout::create):
62         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
63         * Modules/webgpu/WebGPUBindGroupLayout.h: Added.
64         * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
65         * Modules/webgpu/WebGPUDevice.cpp:
66         (WebCore::WebGPUDevice::createBindGroupLayout const): Added.
67         * Modules/webgpu/WebGPUDevice.h:
68         * Modules/webgpu/WebGPUDevice.idl:
69         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
70         (WebCore::GPUBindGroupLayout::tryCreate):
71         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
72         * platform/graphics/gpu/GPUBindGroupLayout.h: Added.
73         * platform/graphics/gpu/GPUDevice.cpp:
74         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
75         * platform/graphics/gpu/GPUDevice.h:
76
77         Add files and symbols to project:
78         * CMakeLists.txt:
79         * DerivedSources.make:
80         * Sources.txt:
81         * WebCore.xcodeproj/project.pbxproj:
82         * bindings/js/WebCoreBuiltinNames.h:
83
84         Missing includes that were previously provided via UnifiedSources:
85         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
86         * platform/sql/SQLiteFileSystem.h:
87
88 2018-12-18  Youenn Fablet  <youenn@apple.com>
89
90         Make ReadableStreamXX constructs use PrivateIdentifier
91         https://bugs.webkit.org/show_bug.cgi?id=192771
92
93         Reviewed by Chris Dumez.
94
95         PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
96         Covered by existing binding tests.
97
98         * Modules/streams/ReadableByteStreamController.idl:
99         * Modules/streams/ReadableStreamBYOBReader.idl:
100         * Modules/streams/ReadableStreamBYOBRequest.idl:
101         * Modules/streams/ReadableStreamDefaultController.idl:
102         * Modules/streams/ReadableStreamDefaultReader.idl:
103         * bindings/scripts/CodeGeneratorJS.pm:
104         (NeedsConstructorProperty):
105         * bindings/scripts/preprocess-idls.pl:
106         (shouldExposeInterface):
107         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
108         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
109         * bindings/scripts/test/TestCustomConstructor.idl: Removed.
110
111 2018-12-18  Zalan Bujtas  <zalan@apple.com>
112
113         Synchronous media query evaluation could destroy current Frame/FrameView.
114         https://bugs.webkit.org/show_bug.cgi?id=192781
115         <rdar://problem/34416793>
116
117         Reviewed by Chris Dumez.
118
119         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
120
121         Test: printing/print-with-media-query-destory.html
122
123         * loader/DocumentLoader.cpp:
124         (WebCore::DocumentLoader::finishedLoading):
125         * page/Frame.cpp:
126         (WebCore::Frame::setPrinting):
127         * page/FrameView.cpp:
128         (WebCore::FrameView::forceLayoutForPagination):
129
130 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
131
132         Web Inspector: m3u8 content not shown, it should be text
133         https://bugs.webkit.org/show_bug.cgi?id=192731
134         <rdar://problem/46747728>
135
136         Reviewed by Devin Rousso.
137
138         * inspector/NetworkResourcesData.cpp:
139         (WebCore::NetworkResourcesData::setResourceContent):
140         Don't clobber data if setting empty content on a resource that has content.
141
142         * inspector/agents/InspectorNetworkAgent.cpp:
143         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
144         Additional non-"text/" mime types that can be treated as text.
145
146         * platform/MIMETypeRegistry.cpp:
147         (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
148         * platform/MIMETypeRegistry.h:
149         Detect media playlist mime types that are text (m3u8/m3u).
150
151 2018-12-18  Daniel Bates  <dabates@apple.com>
152
153         Remove <meta http-equiv=set-cookie> support
154         https://bugs.webkit.org/show_bug.cgi?id=185077
155         <rdar://problem/41791397>
156
157         Reviewed by Brent Fulgham.
158
159         Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
160         the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
161         removed support for this pragma and Firefox has an open bug to remove it.
162
163         * dom/Document.cpp:
164         (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
165         was ignored instead of setting the cookie.
166         * html/parser/XSSAuditor.cpp:
167         (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
168         as dangerous and erase attribute http-equiv when we find it because we no longer honor
169         this pragma.
170
171 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
172
173         CSS Typed OM should expose attributeStyleMap
174         https://bugs.webkit.org/show_bug.cgi?id=192671
175
176         Reviewed by Ryosuke Niwa.
177
178         Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
179         TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
180
181         Test: css-typedom/attributeStyleMap.html
182
183         * CMakeLists.txt:
184         * DerivedSources.make:
185         * Sources.txt:
186         * WebCore.xcodeproj/project.pbxproj:
187         * bindings/js/WebCoreBuiltinNames.h:
188         * css/ElementCSSInlineStyle.idl:
189         * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
190         * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
191         * css/typedom/StylePropertyMapReadOnly.cpp: Added.
192         (WebCore::StylePropertyMapReadOnly::reifyValue):
193         (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
194         * css/typedom/StylePropertyMapReadOnly.h:
195         (WebCore::StylePropertyMapReadOnly::create): Deleted.
196         (WebCore::StylePropertyMapReadOnly::get const): Deleted.
197         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
198         * css/typedom/StylePropertyMapReadOnly.idl:
199         * css/typedom/TypedOMCSSImageValue.h:
200         * dom/Element.cpp:
201         (WebCore::Element::attributeStyleMap):
202         (WebCore::Element::setAttributeStyleMap):
203         * dom/Element.h:
204         * dom/ElementRareData.cpp:
205         * dom/ElementRareData.h:
206         (WebCore::ElementRareData::attributeStyleMap):
207         (WebCore::ElementRareData::setAttributeStyleMap):
208         * dom/StyledElement.cpp:
209         (WebCore::StyledElement::ensureAttributeStyleMap):
210         * dom/StyledElement.h:
211         * html/canvas/CanvasRenderingContext2DBase.cpp:
212         (WebCore::size):
213         (WebCore::CanvasRenderingContext2DBase::drawImage):
214         * platform/graphics/CustomPaintImage.cpp:
215         (WebCore::extractComputedProperty):
216         (WebCore::CustomPaintImage::doCustomPaint):
217
218 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
219
220         Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
221         https://bugs.webkit.org/show_bug.cgi?id=192785
222         <rdar://problem/45321184>
223
224         Reviewed by Tim Horton.
225
226         Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
227         currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
228         need to know when the user is typing in a text form control, but the page is preventing default text insertion
229         behavior and instead updating values programmatically.
230
231         Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
232
233         * html/TextFieldInputType.cpp:
234         (WebCore::TextFieldInputType::setValue):
235
236 2018-12-18  Zalan Bujtas  <zalan@apple.com>
237
238         [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
239         https://bugs.webkit.org/show_bug.cgi?id=192801
240
241         Reviewed by Antti Koivisto.
242
243         * layout/blockformatting/BlockFormattingContext.h:
244         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
245         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
246         * layout/blockformatting/BlockMarginCollapse.cpp:
247         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
248
249 2018-12-18  Zalan Bujtas  <zalan@apple.com>
250
251         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
252         https://bugs.webkit.org/show_bug.cgi?id=192799
253
254         Reviewed by Antti Koivisto.
255
256         * layout/blockformatting/BlockFormattingContext.h:
257         * layout/blockformatting/BlockMarginCollapse.cpp:
258         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
259         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
260
261 2018-12-18  Zalan Bujtas  <zalan@apple.com>
262
263         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
264         https://bugs.webkit.org/show_bug.cgi?id=192798
265
266         Reviewed by Antti Koivisto.
267
268         * layout/blockformatting/BlockFormattingContext.h:
269         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
270         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
271         * layout/blockformatting/BlockMarginCollapse.cpp:
272         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
273         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
274         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
275         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
276
277 2018-12-18  Zalan Bujtas  <zalan@apple.com>
278
279         [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
280         https://bugs.webkit.org/show_bug.cgi?id=192794
281
282         Reviewed by Antti Koivisto.
283
284         * layout/blockformatting/BlockFormattingContext.h:
285         * layout/blockformatting/BlockMarginCollapse.cpp:
286         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
287         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
288         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
289
290 2018-12-18  Zalan Bujtas  <zalan@apple.com>
291
292         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
293         https://bugs.webkit.org/show_bug.cgi?id=192791
294
295         Reviewed by Antti Koivisto.
296
297         * layout/blockformatting/BlockMarginCollapse.cpp:
298         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
299         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
300
301 2018-12-18  Zalan Bujtas  <zalan@apple.com>
302
303         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
304         https://bugs.webkit.org/show_bug.cgi?id=192787
305
306         Reviewed by Antti Koivisto.
307
308         * layout/blockformatting/BlockFormattingContext.h:
309         * layout/blockformatting/BlockMarginCollapse.cpp:
310         (WebCore::Layout::hasClearance):
311         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
312         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
313         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
314         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
315
316 2018-12-17  Fujii Hironori  <Hironori.Fujii@sony.com>
317
318         [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
319         https://bugs.webkit.org/show_bug.cgi?id=192752
320
321         Reviewed by Don Olmstead.
322
323         No new tests, no behavior changes.
324
325         * platform/graphics/win/DIBPixelData.cpp:
326         Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
327         * platform/graphics/win/FontPlatformDataWin.cpp:
328         (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
329         * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
330         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
331         Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
332         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
333         Reorder the initializer list.
334         (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
335         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
336         (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
337         (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
338         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
339         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
340         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
341         (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
342         * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
343         (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
344         (WebCore::Font::boundsForGDIGlyph const): Ditto.
345         (WebCore::Font::widthForGDIGlyph const): Ditto.
346         * platform/graphics/win/UniscribeController.cpp:
347         (WebCore::UniscribeController::UniscribeController):
348         Reorder the initializer list.
349         (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
350         (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
351
352 2018-12-17  Eric Carlson  <eric.carlson@apple.com>
353
354         [MediaStream] A stream's first video frame should be rendered
355         https://bugs.webkit.org/show_bug.cgi?id=192629
356         <rdar://problem/46664353>
357
358         Reviewed by Youenn Fablet.
359
360         Test: fast/mediastream/media-stream-renders-first-frame.html
361
362         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
363         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
364         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
365         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
366         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
367         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
368         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
369         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
370         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
371         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
372         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
373         * platform/mediastream/RealtimeMediaSource.cpp:
374         (WebCore::RealtimeMediaSource::size const):
375         * platform/mediastream/mac/AVVideoCaptureSource.mm:
376         (WebCore::AVVideoCaptureSource::processNewFrame):
377         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
378         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
379
380 2018-12-17  Justin Michaud  <justin_michaud@apple.com>
381
382         Bindings generator should support Conditional= along with CachedAttribute
383         https://bugs.webkit.org/show_bug.cgi?id=192721
384
385         Reviewed by Ryosuke Niwa.
386
387         Fix a bug where specifying both attributes causes compilation errors because the compile-time
388         condition is not included in the derived code.
389
390         * bindings/scripts/CodeGeneratorJS.pm:
391         (GenerateImplementation):
392         * bindings/scripts/test/JS/JSTestObj.cpp:
393         (WebCore::jsTestObjCachedAttribute3Getter):
394         (WebCore::jsTestObjCachedAttribute3):
395         (WebCore::JSTestObj::visitChildren):
396         * bindings/scripts/test/JS/JSTestObj.h:
397         * bindings/scripts/test/TestObj.idl:
398
399 2018-12-17  David Kilzer  <ddkilzer@apple.com>
400
401         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
402         <https://webkit.org/b/192707>
403         <rdar://problem/46734926>
404
405         Reviewed by Daniel Bates.
406
407         * platform/CPUMonitor.cpp:
408         (WebCore::CPUMonitor::setCPULimit):
409         * platform/CPUMonitor.h:
410         (WebCore::CPUMonitor::setCPULimit):
411         - Change parameter to const reference to fix unnecessary copies.
412
413 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
414
415         offsetLeft and offsetParent should adjust across shadow boundaries
416         https://bugs.webkit.org/show_bug.cgi?id=157437
417         <rdar://problem/26154021>
418
419         Reviewed by Simon Fraser.
420
421         Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
422         the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
423         and https://github.com/w3c/webcomponents/issues/763
424
425         The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
426         In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
427         the one which is in the same tree as a shadow-inclusive ancestor of the context object.
428
429         For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
430         inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
431         then its offset parent, etc... until we find the offset parent in the same tree as the context object.
432
433         Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
434         (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
435         the same tree as the context object but as well as any offset parent which is in its ancestor trees.
436
437         Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
438
439         * dom/Element.cpp:
440         (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
441         (WebCore::collectAncestorTreeScopeAsHashSet): Added.
442         (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
443         which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
444         (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
445         (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
446         until it finds the first offset parent which is a shadow-including ancestor.
447         (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
448         (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
449         functions meant to be used for bindings code.
450         * dom/Element.h:
451         * html/HTMLElement.idl:
452
453 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
454
455         Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
456         https://bugs.webkit.org/show_bug.cgi?id=192780
457         rdar://problem/43394387
458
459         Reviewed by Tim Horton.
460         
461         macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
462         memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
463         
464         Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
465         and consult it when making decisions that affect layer backing store format.
466
467         Tested by new results for existing tests.
468
469         * platform/graphics/FontCascade.cpp:
470         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
471         * platform/graphics/FontCascade.h:
472         * platform/graphics/cocoa/FontCascadeCocoa.mm:
473         (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
474         it once.
475         * rendering/RenderLayerBacking.cpp:
476         (WebCore::RenderLayerBacking::updateAfterDescendants):
477         * testing/Internals.cpp:
478         (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::
479
480 2018-12-17  Daniel Bates  <dabates@apple.com>
481
482         Make DocumentMarker::allMarkers() constexpr
483         https://bugs.webkit.org/show_bug.cgi?id=192634
484
485         Reviewed by Simon Fraser.
486
487         The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
488         it constexpr to do just that.
489
490         * dom/DocumentMarker.h:
491         (WebCore::DocumentMarker::allMarkers):
492
493 2018-12-17  Justin Fan  <justin_fan@apple.com>
494
495         [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
496         https://bugs.webkit.org/show_bug.cgi?id=192726
497
498         Reviewed by Myles C. Maxfield.
499
500         Test: webgpu/bind-group-layouts.html
501         Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
502         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
503         * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
504         * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
505         * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
506         * Modules/webgpu/WebGPUShaderStageBit.h: Added.
507         * Modules/webgpu/WebGPUShaderStageBit.idl: Added.
508         * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
509         * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.
510
511         Add the new symbols and files to the project:
512         * CMakeLists.txt:
513         * DerivedSources.make:
514         * Sources.txt:
515         * WebCore.xcodeproj/project.pbxproj:
516         * bindings/js/WebCoreBuiltinNames.h:
517
518         Small FIXME update for later:
519         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
520         (WebCore::GPURenderPassEncoder::setVertexBuffers):
521
522 2018-12-17  Zalan Bujtas  <zalan@apple.com>
523
524         Unreviewed build fix.
525
526         * page/ios/FrameIOS.mm:
527         (WebCore::Frame::interpretationsForCurrentRoot const):
528
529 2018-12-17  Zalan Bujtas  <zalan@apple.com>
530
531         Reproducible ASSERTion failure when toggling layer borders with find-in-page up
532         https://bugs.webkit.org/show_bug.cgi?id=192762
533         <rdar://problem/46676873>
534
535         Reviewed by Simon Fraser.
536
537         DocumentMarkerController::markersFor() should take a reference instead of a Node*.
538
539         Test: editing/document-marker-null-check.html
540
541         * dom/DocumentMarkerController.cpp:
542         (DocumentMarkerController::hasMarkers):
543         * dom/DocumentMarkerController.h:
544         * editing/AlternativeTextController.cpp:
545         (WebCore::AlternativeTextController::respondToChangedSelection):
546         * editing/Editor.cpp:
547         (WebCore::Editor::selectionStartHasMarkerFor const):
548         * rendering/InlineTextBox.cpp:
549         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
550         * rendering/RenderReplaced.cpp:
551         (WebCore::RenderReplaced::paint):
552         * rendering/RenderText.cpp:
553         (WebCore::RenderText::draggedContentRangesBetweenOffsets const):
554         * rendering/SimpleLineLayout.cpp:
555         (WebCore::SimpleLineLayout::canUseForWithReason):
556         * testing/Internals.cpp:
557         (WebCore::Internals::markerCountForNode):
558
559 2018-12-17  Commit Queue  <commit-queue@webkit.org>
560
561         Unreviewed, rolling out r239265 and r239274.
562         https://bugs.webkit.org/show_bug.cgi?id=192765
563
564         unorm_normalize is deprecated, and broke an internal build
565         (Requested by Truitt on #webkit).
566
567         Reverted changesets:
568
569         "[GTK][WPE] Need a function to convert internal URI to display
570         ("pretty") URI"
571         https://bugs.webkit.org/show_bug.cgi?id=174816
572         https://trac.webkit.org/changeset/239265
573
574         "Fix the Apple Internal Mac build with a newer SDK"
575         https://trac.webkit.org/changeset/239274
576
577 2018-12-17  Daniel Bates  <dabates@apple.com>
578
579         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
580         https://bugs.webkit.org/show_bug.cgi?id=192633
581
582         Reviewed by Wenson Hsieh.
583
584         UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
585         input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
586         for binary compatibility.
587
588         * platform/ios/WebEvent.h:
589         * platform/ios/WebEvent.mm:
590         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
591
592 2018-12-17  Matt Lewis  <jlewis3@apple.com>
593
594         Unreviewed, rolling out r239254.
595
596         This broke the Windows 10 Debug build
597
598         Reverted changeset:
599
600         "Replace many uses of String::format with more type-safe
601         alternatives"
602         https://bugs.webkit.org/show_bug.cgi?id=192742
603         https://trac.webkit.org/changeset/239254
604
605 2018-12-17  Antoine Quint  <graouts@apple.com>
606
607         [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
608         https://bugs.webkit.org/show_bug.cgi?id=192758
609
610         Reviewed by Dean Jackson.
611
612         We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
613         gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
614         less bookkeeping to perform.
615
616         No new test since there is no user-observable change.
617
618         * animation/WebAnimation.cpp:
619         (WebCore::WebAnimation::updateFinishedState):
620         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
621         (WebCore::WebAnimation::performMicrotask): Deleted.
622         * animation/WebAnimation.h:
623
624 2018-12-17  Antoine Quint  <graouts@apple.com>
625
626         [Web Animations] Ensure we don't update an animation's finished state twice when updating animations
627         https://bugs.webkit.org/show_bug.cgi?id=192757
628
629         Reviewed by Dean Jackson.
630
631         When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
632         twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
633         whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
634         next call to resolve(), unless any of the timing properties have changed in the meantime.
635
636         No new test since there is no user-observable change.
637
638         * animation/WebAnimation.cpp:
639         (WebCore::WebAnimation::timingDidChange):
640         (WebCore::WebAnimation::tick):
641         (WebCore::WebAnimation::resolve):
642         * animation/WebAnimation.h:
643
644 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
645
646         REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
647         https://bugs.webkit.org/show_bug.cgi?id=192725
648         rdar://problem/46011418
649
650         Reviewed by Antoine Quint.
651
652         There were two problems with backing store attachment and animation.
653         
654         First, animations are an input into the "backing store attached" logic, so when they change
655         we should set the CoverageRectChanged bit on GraphicsLayerCA.
656         
657         Secondly, when an ancestor has unknown animation extent, all its descendants need to
658         get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
659         the current layer has no animation extent.
660
661         Tests: compositing/backing/animate-into-view-with-descendant.html
662                compositing/backing/animate-into-view.html
663
664         * platform/graphics/ca/GraphicsLayerCA.cpp:
665         (WebCore::GraphicsLayerCA::addAnimation):
666         (WebCore::GraphicsLayerCA::removeAnimation):
667         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
668
669 2018-12-17  Zalan Bujtas  <zalan@apple.com>
670
671         [LFC][BFC][MarginCollapsing] Unify margin collapse function naming
672         https://bugs.webkit.org/show_bug.cgi?id=192747
673
674         Reviewed by Antti Koivisto.
675
676         Rename some margin collapse getters.
677
678         * layout/blockformatting/BlockFormattingContext.h:
679         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
680         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
681         * layout/blockformatting/BlockMarginCollapse.cpp:
682         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
683         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
684         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
685         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
686         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
687         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
688         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
689         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
690         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
691         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
692         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
693         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
694         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
695         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
696         (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
697         (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
698         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
699         (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
700         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
701         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.
702
703 2018-12-17  David Kilzer  <ddkilzer@apple.com>
704
705         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
706         <https://webkit.org/b/192751>
707         <rdar://problem/46771623>
708
709         Reviewed by Daniel Bates.
710
711         Change loop variables to const references to avoid unnecessary
712         copies.
713
714         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
715         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
716         * Modules/indexeddb/server/MemoryObjectStore.cpp:
717         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
718         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
719         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
720         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
721         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
722         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
723         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
724         (WebCore::IDBDatabaseInfo::loggingString const):
725         * Modules/mediasource/SourceBuffer.cpp:
726         (WebCore::removeSamplesFromTrackBuffer):
727         * accessibility/AccessibilityRenderObject.cpp:
728         (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
729         * accessibility/AccessibilityTableRow.cpp:
730         (WebCore::AccessibilityTableRow::headerObject):
731         * animation/KeyframeEffect.cpp:
732         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
733         * crypto/keys/CryptoKeyRSA.cpp:
734         (WebCore::CryptoKeyRSA::importJwk):
735         (WebCore::CryptoKeyRSA::exportJwk const):
736         * css/CSSComputedStyleDeclaration.cpp:
737         (WebCore::OrderedNamedLinesCollector::appendLines const):
738         * dom/DataTransfer.cpp:
739         (WebCore::readURLsFromPasteboardAsString):
740         * dom/TreeScope.cpp:
741         (WebCore::TreeScope::elementsFromPoint):
742         * html/track/WebVTTParser.cpp:
743         (WebCore::WebVTTParser::checkAndStoreRegion):
744         * inspector/agents/InspectorTimelineAgent.cpp:
745         (WebCore::InspectorTimelineAgent::setInstruments):
746         * page/Page.cpp:
747         (WebCore::Page::updateIntersectionObservations):
748         * page/TextIndicator.cpp:
749         (WebCore::estimatedBackgroundColorForRange):
750         * page/animation/KeyframeAnimation.cpp:
751         (WebCore::KeyframeAnimation::computeLayoutDependency):
752         * platform/graphics/DisplayRefreshMonitorManager.cpp:
753         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
754         * platform/graphics/ca/GraphicsLayerCA.cpp:
755         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
756         (WebCore::GraphicsLayerCA::updateAnimations):
757         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
758         * platform/graphics/mac/ImageMac.mm:
759         (WebCore::BitmapImage::tiffRepresentation):
760         * rendering/HitTestResult.cpp:
761         (WebCore::HitTestResult::append):
762         * testing/Internals.cpp:
763         (WebCore::Internals::acceleratedAnimationsForElement):
764
765 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
766
767         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
768         https://bugs.webkit.org/show_bug.cgi?id=174816
769
770         Reviewed by Michael Catanzaro.
771
772         Tests: enabled fast/url/user-visible/.
773
774         * testing/Internals.cpp:
775         (WebCore::Internals::userVisibleString): Enable method on all platforms.
776
777 2018-12-15  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
778
779         Null pointer dereference in JSC::WriteBarrierBase()
780         https://bugs.webkit.org/show_bug.cgi?id=191252
781
782         Reviewed by Keith Miller.
783
784         * bindings/js/JSCustomElementRegistryCustom.cpp:
785         (WebCore::JSCustomElementRegistry::whenDefined):
786         * bindings/js/JSDOMPromiseDeferred.cpp:
787         (WebCore::createDeferredPromise):
788         * bindings/js/JSDOMPromiseDeferred.h:
789         (WebCore::DeferredPromise::create):
790         (WebCore::callPromiseFunction):
791         * bindings/js/JSDOMWindowBase.cpp:
792         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
793         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
794         * bindings/js/ScriptModuleLoader.cpp:
795         (WebCore::ScriptModuleLoader::fetch):
796         (WebCore::rejectPromise):
797
798 2018-12-15  Darin Adler  <darin@apple.com>
799
800         Use warning-ignoring macros more consistently and simply
801         https://bugs.webkit.org/show_bug.cgi?id=192743
802
803         Reviewed by Mark Lam.
804
805         * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
806         IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
807         files like this one with non-clang compilers, and no need to worry about
808         them when choosing the macro.
809
810         * crypto/mac/CryptoKeyRSAMac.cpp:
811         (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
812
813         * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
814         the "unknown-pragmas" trick, which the macro should take care of.
815         * css/makevalues.pl: Ditto.
816         * platform/ColorData.gperf: Ditto.
817
818         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
819         (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
820         (see rationale above for Objective-C++).
821
822         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
823         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
824         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
825         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
826         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
827
828         * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
829         (see rationale above for Objective-C++).
830
831         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
832         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
833         Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
834
835         * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
836         (see rationale above for Objective-C++).
837
838         * platform/network/cocoa/ResourceResponseCocoa.mm:
839         (WebCore::ResourceResponse::platformCertificateInfo const): Use
840         ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
841
842 2018-12-15  Darin Adler  <darin@apple.com>
843
844         Replace many uses of String::format with more type-safe alternatives
845         https://bugs.webkit.org/show_bug.cgi?id=192742
846
847         Reviewed by Mark Lam.
848
849         A while back, String::format was more efficient than string concatenation,
850         but that is no longer true, and we should prefer String::number, makeString,
851         or concatenation with the "+" operator to String::format for new code.
852
853         This is not as good for programmers who are fond of printf formatting
854         style, and in some cases it's a little harder to read the strings
855         interspersed with variables rather than a format string, but it's better
856         in a few ways:
857
858         - more efficient (I didn't measure the difference, but it's definitely
859           slower to use String::Format which calls vsnprintf twice than to use
860           the WTF code)
861         - works in a type-safe way without a need to use a format specifier such
862           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
863           subtle differences between platforms
864         - allows us to use StringView in some cases to sidestep the need to
865           allocate temporary WTF::String objects
866         - does not require converting each WTF::String to a C string, allowing
867           us to remove many cases of ".utf8().data()" and similar expressions,
868           eliminating the allocation of temporary WTF::CString objects
869
870         This patch covers a batch of easiest-to-convert call sites.
871         Later patches will allow us to deprecate or remove String::format.
872
873         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
874         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
875         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
876         (WebCore::IDBCursorInfo::loggingString const): Ditto.
877         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
878         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
879         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
880         (WebCore::IDBGetRecordData::loggingString const): Ditto.
881         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
882         (WebCore::IDBIndexInfo::loggingString const): Ditto.
883         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
884         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
885         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
886         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
887         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
888         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
889         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
890         * Modules/webdatabase/Database.cpp:
891         (WebCore::formatErrorMessage): Ditto.
892         * Modules/webdatabase/SQLError.h:
893         (WebCore::SQLError::create): Ditto.
894
895         * bindings/scripts/CodeGeneratorJS.pm:
896         (GenerateImplementation): Use makeString.
897
898         * bindings/scripts/test/JS/JSInterfaceName.cpp:
899         * bindings/scripts/test/JS/JSMapLike.cpp:
900         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
901         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
902         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
903         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
904         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
905         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
906         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
907         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
908         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
909         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
910         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
911         * bindings/scripts/test/JS/JSTestException.cpp:
912         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
913         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
914         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
915         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
916         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
917         * bindings/scripts/test/JS/JSTestInterface.cpp:
918         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
919         * bindings/scripts/test/JS/JSTestIterable.cpp:
920         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
921         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
922         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
923         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
924         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
925         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
926         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
927         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
928         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
929         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
930         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
931         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
932         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
933         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
934         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
935         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
936         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
937         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
938         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
939         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
940         * bindings/scripts/test/JS/JSTestNode.cpp:
941         * bindings/scripts/test/JS/JSTestObj.cpp:
942         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
943         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
944         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
945         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
946         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
947         * bindings/scripts/test/JS/JSTestSerialization.cpp:
948         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
949         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
950         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
951         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
952         * bindings/scripts/test/JS/JSTestStringifier.cpp:
953         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
954         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
955         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
956         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
957         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
958         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
959         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
960         Updated expected results.
961 :
962         * css/parser/CSSPropertyParserHelpers.cpp:
963         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
964         and makeString.
965
966         * html/HTMLSelectElement.cpp:
967         (WebCore::HTMLSelectElement::setLength): Use makeString.
968         * html/ImageDocument.cpp:
969         (WebCore::ImageDocument::imageUpdated): Ditto.
970         * html/parser/XSSAuditor.cpp:
971         (WebCore::XSSAuditor::init): Ditto.
972         * inspector/InspectorFrontendClientLocal.cpp:
973         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
974         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
975         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
976         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
977         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
978         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
979         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
980         * page/MemoryRelease.cpp:
981         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
982
983         * page/cocoa/ResourceUsageOverlayCocoa.mm:
984         (WebCore::formatByteNumber): Use String::number.
985         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
986
987         * page/cocoa/ResourceUsageThreadCocoa.mm:
988         (WebCore::logFootprintComparison): Use makeString.
989         * platform/animation/TimingFunction.cpp:
990         (WebCore::TimingFunction::cssText const): Ditto.
991
992         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
993         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
994         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
995         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
996
997         * platform/graphics/ca/GraphicsLayerCA.cpp:
998         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
999         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
1000         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
1001         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
1002         * platform/mock/MockRealtimeVideoSource.cpp:
1003         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
1004
1005         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
1006
1007         * platform/network/ParsedContentRange.cpp:
1008         (WebCore::ParsedContentRange::headerValue const): Use makeString.
1009
1010         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
1011         compiler conditionals and reorganized the start/stop of namespaces.
1012         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
1013
1014         * platform/sql/SQLiteDatabase.cpp:
1015         (WebCore::unauthorizedSQLFunction): Use makeString.
1016         * rendering/RenderLayerCompositor.cpp:
1017         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
1018         * workers/service/server/RegistrationDatabase.cpp:
1019         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
1020         (WebCore::RegistrationDatabase::importRecords): Ditto.
1021
1022 2018-12-15  Youenn Fablet  <youenn@apple.com>
1023
1024         Make RTCRtpSender.setParameters to activate specific encodings
1025         https://bugs.webkit.org/show_bug.cgi?id=192732
1026
1027         Reviewed by Eric Carlson.
1028
1029         The conversion between libwebrtc and WebCore is lossy for send parameters.
1030         Libwebrtc checking the differences of values, call to setParameters will often fail.
1031
1032         Given some parameters cannot be exposed, the sender backend keeps the
1033         current set of parameters when gathered and reuses them when parameters are set.
1034
1035         For encodings, we only change activate/maxBitRate/maxFrameRate as
1036         these are the most important parameters to be able to modify.
1037
1038         Covered by added tests in webrtc/video.html.
1039
1040         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1041         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
1042         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
1043         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1044         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1045         (WebCore::fromRTCRtpSendParameters):
1046         (WebCore::fromRTCEncodingParameters): Deleted.
1047         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
1048
1049 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
1050
1051         Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
1052         https://bugs.webkit.org/show_bug.cgi?id=192724
1053         <rdar://problem/46745911>
1054
1055         Reviewed by Devin Rousso.
1056
1057         iOS never installs the InspectorOverlay page as a page overlay.
1058         It also uses its own node highlighting painting. Avoid any work
1059         and resources associated with the overlay page for iOS.
1060
1061         * inspector/InspectorOverlay.cpp:
1062         (WebCore::InspectorOverlay::paint):
1063         (WebCore::InspectorOverlay::update):
1064         (WebCore::InspectorOverlay::overlayPage):
1065         (WebCore::evaluateCommandInOverlay):
1066
1067 2018-12-14  Youenn Fablet  <youenn@apple.com>
1068
1069         MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
1070         https://bugs.webkit.org/show_bug.cgi?id=192720
1071
1072         Reviewed by Eric Carlson.
1073
1074         Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
1075         as the latter is a ref counted object.
1076         Made some refactoring to return early in case of error.
1077
1078         Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
1079         the MediaRecorder will stop listening for its tracks.
1080         Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
1081
1082         Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
1083
1084         * Modules/mediarecorder/MediaRecorder.cpp:
1085         (WebCore::MediaRecorder::didAddOrRemoveTrack):
1086         (WebCore::MediaRecorder::setNewRecordingState): Deleted.
1087         * Modules/mediarecorder/MediaRecorder.h:
1088         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
1089         (WebCore::MediaRecorderPrivateAVFImpl::create):
1090         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
1091         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
1092         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
1093         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
1094         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
1095         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
1096         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
1097         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1098         (WebCore::MediaRecorderPrivateWriter::create):
1099         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
1100         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1101         (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
1102
1103 2018-12-14  Youenn Fablet  <youenn@apple.com>
1104
1105         getSenders/getReceivers() should not return closed transceiver senders/receivers
1106         https://bugs.webkit.org/show_bug.cgi?id=192706
1107
1108         Reviewed by Eric Carlson.
1109
1110         Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
1111         This forces us to compute the sender/receiver list at getter call time.
1112         Updated the internal call sites of senders to use the list of transceivers instead.
1113
1114         Covered by updated WPT tests.
1115
1116         * Modules/mediastream/RTCPeerConnection.cpp:
1117         (WebCore::RTCPeerConnection::addTrack):
1118         (WebCore::RTCPeerConnection::getSenders const):
1119         (WebCore::RTCPeerConnection::getReceivers const):
1120         * Modules/mediastream/RTCPeerConnection.h:
1121         * Modules/mediastream/RTCRtpTransceiver.cpp:
1122         (WebCore::RTCRtpTransceiver::stopped const):
1123         (WebCore::RtpTransceiverSet::append):
1124         (WebCore::RtpTransceiverSet::senders const):
1125         (WebCore::RtpTransceiverSet::receivers const):
1126         * Modules/mediastream/RTCRtpTransceiver.h:
1127         (WebCore::RtpTransceiverSet::senders const): Deleted.
1128         (WebCore::RtpTransceiverSet::receivers const): Deleted.
1129         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1130         (WebCore::findExistingSender):
1131         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1132
1133 2018-12-14  David Kilzer  <ddkilzer@apple.com>
1134
1135         clang-tidy: Fix unnecessary copy of objects for operator==() methods
1136         <https://webkit.org/b/192712>
1137         <rdar://problem/46739332>
1138
1139         Reviewed by Andy Estes.
1140
1141         * contentextensions/HashableActionList.h:
1142         (WebCore::ContentExtensions::HashableActionList::operator== const):
1143         (WebCore::ContentExtensions::HashableActionList::operator!= const):
1144         * platform/network/FormData.h:
1145         (WebCore::FormDataElement::EncodedFileData::operator== const):
1146         (WebCore::FormDataElement::EncodedBlobData::operator== const):
1147         - Change arguments from const to const reference to avoid
1148           copies.
1149
1150 2018-12-14  Jer Noble  <jer.noble@apple.com>
1151
1152         CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
1153         https://bugs.webkit.org/show_bug.cgi?id=192713
1154         <rdar://problem/46739706>
1155
1156         Reviewed by Eric Carlson.
1157
1158         A callback is being called twice, and the second time has a null Promise. Instead of these
1159         callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
1160         have ASSERTS() that they are called once-and-only-once.
1161
1162         * platform/encryptedmedia/CDMInstanceSession.h:
1163         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1164         (WebCore::CDMInstanceSessionClearKey::closeSession):
1165         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1166         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
1167         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
1168         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
1169         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
1170         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
1171
1172 2018-12-14  David Kilzer  <ddkilzer@apple.com>
1173
1174         clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
1175         <https://webkit.org/b/192708>
1176         <rdar://problem/46735907>
1177
1178         Reviewed by Jer Noble.
1179
1180         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1181         (WebCore::toSample):
1182         - Make argument a const reference.
1183
1184         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1185         - Update method signatures for implementation changes.
1186         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1187         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset):
1188         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
1189         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
1190         - Make RetainPtr<> argument an rvalue reference and use WTFMove().
1191         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1192         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
1193         - Make RetainPtr<> argument a const reference.
1194
1195         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1196         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
1197         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
1198         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
1199         - Change for loop keys to be const references.
1200
1201         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1202         - Update method signatures for implementation changes.
1203         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1204         (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
1205         (WebCore::SourceBufferPrivateAVFObjC::seekToTime):
1206         - Make Mediatime arguments a const reference.
1207
1208 2018-12-14  Simon Fraser  <simon.fraser@apple.com>
1209
1210         REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
1211         https://bugs.webkit.org/show_bug.cgi?id=188655
1212         rdar://problem/43382687
1213
1214         Reviewed by Antoine Quint.
1215
1216         The logic that computes animation extent, used by backing store attachment code, failed
1217         to account for the behavior where a keyframe animation with a missing 0% keyframe uses
1218         the transform from the unanimated style. This resulted in the computed extent being wrong,
1219         which caused us to remove the layer's backing store in some scenarios.
1220
1221         Fix both animation code paths to use the renderer style if the first keyframe doesn't
1222         contain a transform.
1223
1224         Tests: compositing/backing/backing-store-attachment-empty-keyframe.html
1225                legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html
1226
1227         * animation/KeyframeEffect.cpp:
1228         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
1229         * page/animation/KeyframeAnimation.cpp:
1230         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
1231
1232 2018-12-14  Chris Dumez  <cdumez@apple.com>
1233
1234         [PSON] Stop exposing PolicyAction::Suspend to WebCore
1235         https://bugs.webkit.org/show_bug.cgi?id=192701
1236
1237         Reviewed by Brady Eidson.
1238
1239         Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore.
1240
1241         * loader/DocumentLoader.cpp:
1242         (WebCore::DocumentLoader::continueAfterContentPolicy):
1243         * loader/FrameLoaderTypes.h:
1244         * loader/PolicyChecker.cpp:
1245         (WebCore::PolicyChecker::checkNavigationPolicy):
1246         (WebCore::PolicyChecker::checkNewWindowPolicy):
1247
1248 2018-12-14  Youenn Fablet  <youenn@apple.com>
1249
1250         IDB should store RTCCertificate
1251         https://bugs.webkit.org/show_bug.cgi?id=192599
1252
1253         Reviewed by Brady Eidson.
1254
1255         In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
1256         Instead, create an empty object so that the deserialization can still succeed.
1257         This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.
1258
1259         Test: webrtc/certificates-indexeddb.html
1260
1261         * bindings/js/SerializedScriptValue.cpp:
1262         (WebCore::CloneDeserializer::readTerminal):
1263
1264 2018-12-14  Zalan Bujtas  <zalan@apple.com>
1265
1266         [LFC][BFC] Transition to logical margin types.
1267         https://bugs.webkit.org/show_bug.cgi?id=192699
1268
1269         Reviewed by Antti Koivisto.
1270
1271         This is in preparation for moving over to logical types.
1272         (This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))
1273
1274         * layout/FormattingContext.cpp:
1275         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1276         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1277         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1278         * layout/FormattingContext.h:
1279         * layout/FormattingContextGeometry.cpp:
1280         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
1281         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1282         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1283         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1284         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1285         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1286         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1287         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1288         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1289         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1290         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1291         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1292         * layout/FormattingContextQuirks.cpp:
1293         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1294         * layout/MarginTypes.h:
1295         (WebCore::Layout::VerticalMargin::usedValues const):
1296         * layout/Verification.cpp:
1297         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1298         * layout/blockformatting/BlockFormattingContext.cpp:
1299         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
1300         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
1301         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1302         (WebCore::Layout::hasPrecomputedMarginBefore):
1303         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1304         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1305         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1306         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1307         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1308         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
1309         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
1310         (WebCore::Layout::hasPrecomputedMarginTop): Deleted.
1311         * layout/blockformatting/BlockFormattingContext.h:
1312         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1313         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1314         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1315         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1316         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1317         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1318         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1319         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
1320         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
1321         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
1322         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
1323         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1324         (WebCore::Layout::hasMarginBeforeQuirkValue):
1325         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1326         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
1327         (WebCore::Layout::hasMarginTopQuirkValue): Deleted.
1328         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
1329         * layout/blockformatting/BlockMarginCollapse.cpp:
1330         (WebCore::Layout::isMarginBeforeCollapsedWithSibling):
1331         (WebCore::Layout::isMarginAfterCollapsedWithSibling):
1332         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
1333         (WebCore::Layout::isMarginAfterCollapsedThrough):
1334         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
1335         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
1336         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
1337         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
1338         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
1339         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
1340         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
1341         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
1342         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
1343         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
1344         (WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
1345         (WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
1346         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
1347         (WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
1348         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
1349         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
1350         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
1351         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
1352         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
1353         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
1354         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
1355         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
1356         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
1357         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
1358         * layout/displaytree/DisplayBox.cpp:
1359         (WebCore::Display::Box::Box):
1360         (WebCore::Display::Box::marginBox const):
1361         (WebCore::Display::Box::nonCollapsedMarginBox const):
1362         * layout/displaytree/DisplayBox.h:
1363         (WebCore::Display::Box::rectWithMargin const):
1364         (WebCore::Display::Box::estimatedMarginBefore const):
1365         (WebCore::Display::Box::setEstimatedMarginBefore):
1366         (WebCore::Display::Box::top const):
1367         (WebCore::Display::Box::topLeft const):
1368         (WebCore::Display::Box::setVerticalMargin):
1369         (WebCore::Display::Box::marginBefore const):
1370         (WebCore::Display::Box::marginStart const):
1371         (WebCore::Display::Box::marginAfter const):
1372         (WebCore::Display::Box::marginEnd const):
1373         (WebCore::Display::Box::nonCollapsedMarginBefore const):
1374         (WebCore::Display::Box::nonCollapsedMarginAfter const):
1375         (WebCore::Display::Box::nonComputedMarginStart const):
1376         (WebCore::Display::Box::nonComputedMarginEnd const):
1377         (WebCore::Display::Box::estimatedMarginTop const): Deleted.
1378         (WebCore::Display::Box::setEstimatedMarginTop): Deleted.
1379         (WebCore::Display::Box::marginTop const): Deleted.
1380         (WebCore::Display::Box::marginLeft const): Deleted.
1381         (WebCore::Display::Box::marginBottom const): Deleted.
1382         (WebCore::Display::Box::marginRight const): Deleted.
1383         (WebCore::Display::Box::nonCollapsedMarginTop const): Deleted.
1384         (WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted.
1385         (WebCore::Display::Box::nonComputedMarginLeft const): Deleted.
1386         (WebCore::Display::Box::nonComputedMarginRight const): Deleted.
1387         * layout/floats/FloatAvoider.cpp:
1388         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
1389         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
1390         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
1391         * layout/floats/FloatAvoider.h:
1392         (WebCore::Layout::FloatAvoider::marginBefore const):
1393         (WebCore::Layout::FloatAvoider::marginAfter const):
1394         (WebCore::Layout::FloatAvoider::marginStart const):
1395         (WebCore::Layout::FloatAvoider::marginEnd const):
1396         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
1397         (WebCore::Layout::FloatAvoider::marginTop const): Deleted.
1398         (WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
1399         (WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
1400         (WebCore::Layout::FloatAvoider::marginRight const): Deleted.
1401         * layout/floats/FloatBox.cpp:
1402         (WebCore::Layout::FloatBox::rect const):
1403         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
1404         (WebCore::Layout::FloatBox::verticalPositionCandidate):
1405         (WebCore::Layout::FloatBox::initialVerticalPosition const):
1406         * layout/floats/FloatingContext.cpp:
1407         (WebCore::Layout::FloatingContext::positionForFloat const):
1408         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1409         * layout/inlineformatting/InlineFormattingContext.cpp:
1410         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1411
1412 2018-12-14  Zalan Bujtas  <zalan@apple.com>
1413
1414         [LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
1415         https://bugs.webkit.org/show_bug.cgi?id=192692
1416
1417         Reviewed by Antti Koivisto.
1418
1419         This is in preparation for completing block margin collapsing.
1420
1421         * WebCore.xcodeproj/project.pbxproj:
1422         * layout/FormattingContext.cpp:
1423         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1424         * layout/FormattingContext.h:
1425         * layout/FormattingContextGeometry.cpp:
1426         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1427         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1428         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1429         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1430         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1431         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1432         * layout/LayoutState.cpp:
1433         (WebCore::Layout::LayoutState::LayoutState):
1434         * layout/LayoutUnits.h:
1435         (WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted.
1436         * layout/MarginTypes.h: Added.
1437         (WebCore::Layout::VerticalMargin::nonCollapsedValues const):
1438         (WebCore::Layout::VerticalMargin::collapsedValues const):
1439         (WebCore::Layout::VerticalMargin::setCollapsedValues):
1440         (WebCore::Layout::VerticalMargin::VerticalMargin):
1441         (WebCore::Layout::VerticalMargin::usedValues const):
1442         * layout/blockformatting/BlockFormattingContext.cpp:
1443         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1444         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1445         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1446         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1447         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1448         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1449         * layout/displaytree/DisplayBox.cpp:
1450         (WebCore::Display::Box::Box):
1451         * layout/displaytree/DisplayBox.h:
1452         (WebCore::Display::Box::setHorizontalMargin):
1453         (WebCore::Display::Box::setVerticalMargin):
1454         (WebCore::Display::Box::setHorizontalNonComputedMargin):
1455         (WebCore::Display::Box::verticalMargin const):
1456         (WebCore::Display::Box::marginTop const):
1457         (WebCore::Display::Box::marginLeft const):
1458         (WebCore::Display::Box::marginBottom const):
1459         (WebCore::Display::Box::marginRight const):
1460         (WebCore::Display::Box::nonCollapsedMarginTop const):
1461         (WebCore::Display::Box::nonCollapsedMarginBottom const):
1462         (WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted.
1463         * layout/floats/FloatingContext.cpp:
1464         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1465         * layout/inlineformatting/InlineFormattingContext.cpp:
1466         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1467
1468 2018-12-14  Fujii Hironori  <Hironori.Fujii@sony.com>
1469
1470         [Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
1471         https://bugs.webkit.org/show_bug.cgi?id=192693
1472
1473         Reviewed by Ross Kirsling.
1474
1475         No new tests, no behavior changes.
1476
1477         * platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list.
1478         * platform/win/CursorWin.cpp:
1479         (WebCore::loadCursorByName): Changed the argument type of 'name' to const char*.
1480         * platform/win/DefWndProcWindowClass.cpp:
1481         (WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'.
1482         * platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'.
1483         * platform/win/PasteboardWin.cpp:
1484         (WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'.
1485         (WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning.
1486         * platform/win/PlatformMouseEventWin.cpp:
1487         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list.
1488         * platform/win/PopupMenuWin.cpp:
1489         (WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'.
1490         * platform/win/PopupMenuWin.h: Marked override methods with 'override'.
1491         * platform/win/SSLKeyGeneratorWin.cpp:
1492         (WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace.
1493         (WebCore::signedPublicKeyAndChallengeString): Ditto.
1494         * platform/win/SearchPopupMenuDB.cpp:
1495         (WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT.
1496         * platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86).
1497         * platform/win/SystemInfo.cpp:
1498         (WebCore::osVersionForUAString): Added default case.
1499
1500 2018-12-13  Youenn Fablet  <youenn@apple.com>
1501
1502         RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
1503         https://bugs.webkit.org/show_bug.cgi?id=192685
1504
1505         Reviewed by Eric Carlson.
1506
1507         In case the remote description contains a rejected m section,
1508         the corresponding transceiver should be marked as stopped.
1509         Libwebrtc backend has that information so pipe it up to JS.
1510
1511         Covered by updated WPT test.
1512
1513         * Modules/mediastream/RTCRtpTransceiver.cpp:
1514         (WebCore::RTCRtpTransceiver::stopped const):
1515         * Modules/mediastream/RTCRtpTransceiver.h:
1516         (WebCore::RTCRtpTransceiver::stopped const): Deleted.
1517         * Modules/mediastream/RTCRtpTransceiverBackend.h:
1518         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
1519         (WebCore::LibWebRTCRtpTransceiverBackend::stopped const):
1520         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
1521
1522 2018-12-13  Mark Lam  <mark.lam@apple.com>
1523
1524         Ensure that StructureFlags initialization always starts with Base::StructureFlags.
1525         https://bugs.webkit.org/show_bug.cgi?id=192686
1526
1527         Reviewed by Keith Miller.
1528
1529         No new tests needed because there's no new functionality.  Just refactoring.
1530
1531         * bindings/js/JSDOMWindowProperties.h:
1532         * bindings/scripts/CodeGeneratorJS.pm:
1533         (GenerateHeader):
1534         (GeneratePrototypeDeclaration):
1535         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1536         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
1537         * bindings/scripts/test/JS/JSTestEventTarget.h:
1538         * bindings/scripts/test/JS/JSTestGlobalObject.h:
1539         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
1540         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
1541         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
1542         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
1543         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
1544         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
1545         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
1546         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
1547         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
1548         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
1549         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
1550         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
1551         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
1552         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
1553         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
1554         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
1555         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
1556         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
1557         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
1558         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
1559         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
1560         * bindings/scripts/test/JS/JSTestObj.h:
1561         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1562         * bindings/scripts/test/JS/JSTestPluginInterface.h:
1563         * bindings/scripts/test/JS/JSTestTypedefs.h:
1564
1565 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
1566
1567         Make HTMLConverter work across shadow boundaries
1568         https://bugs.webkit.org/show_bug.cgi?id=192640
1569
1570         Reviewed by Wenson Hsieh.
1571
1572         Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions.
1573
1574         Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html
1575                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html
1576                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html
1577                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html
1578                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html
1579                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html
1580                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html
1581                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html
1582
1583         * dom/Position.cpp:
1584         (WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter
1585         and serializePreservingVisualAppearanceInternal.
1586         * dom/Position.h:
1587         * editing/cocoa/HTMLConverter.mm:
1588         (HTMLConverter::convert):
1589         (HTMLConverterCaches::propertyValueForNode):
1590         (HTMLConverterCaches::floatPropertyValueForNode):
1591         (HTMLConverter::_blockLevelElementForNode):
1592         (HTMLConverterCaches::colorPropertyValueForNode):
1593         (HTMLConverter::aggregatedAttributesForAncestors):
1594         (HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
1595         (HTMLConverter::_processElement):
1596         (HTMLConverter::_traverseNode):
1597         (HTMLConverter::_traverseFooterNode):
1598         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
1599         (WebCore::attributedStringFromSelection):
1600         * editing/markup.cpp:
1601         (WebCore::commonShadowIncludingAncestor): Moved to Position.cpp.
1602
1603 2018-12-13  Youenn Fablet  <youenn@apple.com>
1604
1605         Trying to play a media element synchronously after setting srcObject should succeed without user gesture
1606         https://bugs.webkit.org/show_bug.cgi?id=192679
1607
1608         Reviewed by Eric Carlson.
1609
1610         Check the srcObject mediaProvider value which is set synchronously.
1611         Covered by updated fast/mediastream/local-audio-playing-event.html.
1612
1613         * html/HTMLMediaElement.h:
1614         (WebCore::HTMLMediaElement::hasMediaStreamSrcObject const):
1615
1616 2018-12-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1617
1618         [iOS] Support dropping contact card data (public.vcard) in editable content
1619         https://bugs.webkit.org/show_bug.cgi?id=192570
1620         <rdar://problem/35626913>
1621
1622         Reviewed by Tim Horton.
1623
1624         Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details.
1625
1626         Tests:  DragAndDropTests.ExternalSourceContactIntoEditableAreas
1627                 DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea
1628                 DragAndDropTests.ExternalSourceMapItemIntoEditableAreas
1629                 WKAttachmentTestsIOS.InsertDroppedContactAsAttachment
1630                 WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment
1631
1632         * editing/WebContentReader.h:
1633         * editing/cocoa/WebContentReaderCocoa.mm:
1634         (WebCore::attachmentForFilePath):
1635
1636         Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths`
1637         as well as `readVirtualContactFile`.
1638
1639         (WebCore::WebContentReader::readFilePaths):
1640         (WebCore::WebContentReader::readVirtualContactFile):
1641
1642         Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting
1643         fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is
1644         empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a
1645         contact, there is no associated URL, so we only have an attachment.
1646
1647         * platform/Pasteboard.h:
1648         * platform/ios/PasteboardIOS.mm:
1649         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
1650
1651         Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for
1652         "public.vcard" data, which is then passed on to the web content reader. Additionally, by returning
1653         `ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents
1654         of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since
1655         "public.vcard" conforms to "public.text").
1656
1657         (WebCore::Pasteboard::read):
1658         (WebCore::Pasteboard::readRespectingUTIFidelities):
1659         * platform/ios/WebItemProviderPasteboard.mm:
1660         (-[NSItemProvider web_fileUploadContentTypes]):
1661
1662         Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is
1663         tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only
1664         suitable for deserialization into an `MKMapItem`.
1665
1666 2018-12-13  Devin Rousso  <drousso@apple.com>
1667
1668         Web Inspector: remove DOM.BackendNodeId and associated commands/events
1669         https://bugs.webkit.org/show_bug.cgi?id=192478
1670
1671         Reviewed by Matt Baker.
1672
1673         Removing unused code, so no change in functionality.
1674
1675         * inspector/agents/InspectorDOMAgent.h:
1676         * inspector/agents/InspectorDOMAgent.cpp:
1677         (WebCore::InspectorDOMAgent::discardBindings):
1678         (WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted.
1679         (WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted.
1680         (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): Deleted.
1681
1682 2018-12-13  Chris Dumez  <cdumez@apple.com>
1683
1684         [PSON] We should not need to navigate to 'about:blank' to suspend pages
1685         https://bugs.webkit.org/show_bug.cgi?id=192668
1686         <rdar://problem/46701466>
1687
1688         Reviewed by Alex Christensen.
1689
1690         * history/PageCache.cpp:
1691         (WebCore::PageCache::addIfCacheable):
1692         * history/PageCache.h:
1693         * loader/DocumentLoader.cpp:
1694         (WebCore::DocumentLoader::redirectReceived):
1695         (WebCore::DocumentLoader::willSendRequest):
1696         (WebCore::DocumentLoader::startLoadingMainResource):
1697         * loader/DocumentLoader.h:
1698         * loader/FrameLoader.cpp:
1699         (WebCore::FrameLoader::init):
1700         (WebCore::FrameLoader::stopAllLoaders):
1701         (WebCore::FrameLoader::setDocumentLoader):
1702         (WebCore::FrameLoader::commitProvisionalLoad):
1703         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1704         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1705         * loader/FrameLoaderTypes.h:
1706         * loader/PolicyChecker.cpp:
1707         (WebCore::PolicyChecker::checkNavigationPolicy):
1708         * loader/PolicyChecker.h:
1709
1710 2018-12-13  Per Arne Vollan  <pvollan@apple.com>
1711
1712         [macOS] Inline WebVTT styles should override styles from Captions settings in System Preferences
1713         https://bugs.webkit.org/show_bug.cgi?id=192638
1714
1715         Reviewed by Eric Carlson.
1716
1717         It is currently not possible to override caption styles generated from System Preferences with inline
1718         WebVTT styles without adding !important. The reason for this is that the generated styles from
1719         System preferences are author styles which have higher priority than the inline WebVTT styles, which
1720         are user agent styles in the video user agent shadow tree. This can be fixed by moving the generated
1721         styles to the video user agent shadow tree. Inline WebVTT styles will then have higher priority since
1722         they are added after the generated styles. This patch also fixes a problem where inline styles could be
1723         added twice to the video user agent shadow root.
1724
1725         Test: media/track/track-cue-css.html
1726
1727         * dom/ExtensionStyleSheets.cpp:
1728         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
1729         * html/track/VTTCue.cpp:
1730         (WebCore::VTTCue::getDisplayTree):
1731         * page/CaptionUserPreferences.cpp:
1732         (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
1733         * page/Page.cpp:
1734         (WebCore::Page::setCaptionUserPreferencesStyleSheet):
1735
1736 2018-12-13  Jer Noble  <jer.noble@apple.com>
1737
1738         Fix leak of AVPlayer boundaryTimeObserver object.
1739         https://bugs.webkit.org/show_bug.cgi?id=192674
1740
1741         Reviewed by Eric Carlson.
1742
1743         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1744         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
1745
1746 2018-12-13  Brent Fulgham  <bfulgham@apple.com>
1747
1748         Don't attempt to animate invalid CSS properties
1749         https://bugs.webkit.org/show_bug.cgi?id=192630
1750         <rdar://problem/46664433>
1751
1752         Reviewed by Antoine Quint.
1753
1754         Inherited animation properties can cause child elements to think they need to animate CSS properties
1755         that they do not support, leading to nullptr crashes.
1756
1757         Recognize that CSSPropertyInvalid is a potential requested animation property, and handle it
1758         cleanly.
1759
1760         Tests: animations/invalid-property-animation.html
1761
1762         * page/animation/CompositeAnimation.cpp:
1763         (WebCore::CompositeAnimation::updateTransitions):
1764         * svg/SVGAnimateElementBase.cpp:
1765         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
1766
1767 2018-12-13  Timothy Hatcher  <timothy@apple.com>
1768
1769         REGRESSION (r230064): Focus rings on webpages are fainter than in native UI.
1770         https://bugs.webkit.org/show_bug.cgi?id=192639
1771         rdar://problem/42669297
1772
1773         Reviewed by Tim Horton.
1774
1775         The focus ring color passed to CoreGraphics is expected to be opaque, since they
1776         will apply opacity when drawing (because opacity is normally animated).
1777         We were getting this by accident before when the old `RenderThemeMac::systemColor()`
1778         used the old `convertNSColorToColor()`, which ignored alpha on NSColor.
1779         Existing tests use fixed test focus ring color.
1780
1781         * css/StyleResolver.cpp:
1782         (WebCore::StyleResolver::colorFromPrimitiveValue const): Use RenderTheme singleton for `focusRingColor()`.
1783         * html/canvas/CanvasRenderingContext2D.cpp:
1784         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Ditto.
1785         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1786         (WebCore::drawFocusRingAtTime): Use `CGContextStateSaver`.
1787         * platform/mac/ThemeMac.mm:
1788         (WebCore::drawCellFocusRingWithFrameAtTime): Force alpha to 1 on the focus ring color. Use `CGContextStateSaver`.
1789         * rendering/RenderElement.cpp:
1790         (WebCore::RenderElement::paintFocusRing): Use RenderTheme singleton for `focusRingColor()`.
1791         * rendering/RenderImage.cpp:
1792         (WebCore::RenderImage::paintAreaElementFocusRing): Ditto.
1793         * rendering/RenderTheme.cpp:
1794         (WebCore::RenderTheme::focusRingColor const): Made const. Cache the result of `platformFocusRingColor()`.
1795         * rendering/RenderTheme.h: Made `focusRingColor()` a member function instead of static.
1796         * rendering/RenderThemeMac.mm:
1797         (WebCore::RenderThemeMac::platformFocusRingColor const): Force alpha to 1 on the focus ring color.
1798         (WebCore::RenderThemeMac::systemColor const): Use `focusRingColor()`, instead of caching color here.
1799
1800 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
1801
1802         [MediaStream] Calculate width or height when constraints contain only the other
1803         https://bugs.webkit.org/show_bug.cgi?id=192632
1804         <rdar://problem/46665734>
1805
1806         Unreviewed, remove an unneeded assert.
1807
1808         * platform/mediastream/RealtimeVideoSource.cpp:
1809         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers):
1810
1811 2018-12-13  Zach Li  <zachli@apple.com>
1812
1813         Update Credit Card AutoFill button icon
1814         https://bugs.webkit.org/show_bug.cgi?id=192637
1815         rdar://problem/46545006
1816
1817         Reviewed by Chris Dumez.
1818
1819         * css/html.css:
1820         (input::-webkit-credit-card-auto-fill-button):
1821
1822 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
1823
1824         [MediaStream] Calculate width or height when constraints contain only the other
1825         https://bugs.webkit.org/show_bug.cgi?id=192632
1826         <rdar://problem/46665734>
1827
1828         Reviewed by Youenn Fablet.
1829
1830         Test: fast/mediastream/constraint-intrinsic-size.html
1831
1832         * platform/graphics/RemoteVideoSample.cpp:
1833         (WebCore::RemoteVideoSample::create): Log errors with RELEASE_LOG_ERROR.
1834
1835         * platform/graphics/cv/ImageTransferSessionVT.h:
1836         (WebCore::ImageTransferSessionVT::pixelFormat const): New.
1837
1838         * platform/mediastream/RealtimeMediaSource.cpp:
1839         (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Replace current size with new size.
1840         (WebCore::RealtimeMediaSource::setSize): Don't notify about width and height.
1841         (WebCore::RealtimeMediaSource::size const): Use intrinsic size when necessary.
1842         (WebCore::RealtimeMediaSource::setIntrinsicSize): New.
1843         (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Deleted.
1844         * platform/mediastream/RealtimeMediaSource.h:
1845
1846         * platform/mediastream/RealtimeVideoSource.cpp:
1847         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): No more remoteVideoSampleAvailable.
1848
1849         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1850         (WebCore::DisplayCaptureSourceCocoa::settings): Report size correctly.
1851         (WebCore::DisplayCaptureSourceCocoa::frameSize const): Use intrinsicSize().
1852         (WebCore::DisplayCaptureSourceCocoa::emitFrame): No more remoteVideoSampleAvailable.
1853         (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): Deleted.
1854         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
1855         (WebCore::DisplayCaptureSourceCocoa::intrinsicSize const): Deleted.
1856
1857         * platform/mock/MockRealtimeVideoSource.cpp:
1858         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Report intrinsic size.
1859         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Minor cleanup.
1860         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRateWithPreset):  Report intrinsic size.
1861         (WebCore::MockRealtimeVideoSource::drawText): Don't render preset info for display source.
1862         * platform/mock/MockRealtimeVideoSource.h:
1863
1864 2018-12-13  David Kilzer  <ddkilzer@apple.com>
1865
1866         clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp
1867         <https://webkit.org/b/192661>
1868         <rdar://problem/46694035>
1869
1870         Reviewed by Daniel Bates.
1871
1872         * dom/Document.cpp:
1873         (WebCore::Document::updateIntersectionObservations):
1874         (WebCore::Document::notifyIntersectionObserversTimerFired):
1875         * dom/Element.cpp:
1876         (WebCore::Element::didMoveToNewDocument):
1877         (WebCore::Element::disconnectFromIntersectionObservers):
1878         - Change loop variables from `auto` to `const auto&` to prevent
1879           unnecessary copies of WeakPtr<IntersectionObserver> or
1880           struct IntersectionObserverRegistration objects.
1881
1882 2018-12-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1883
1884         [FreeType] Remove HarfBuzzFace
1885         https://bugs.webkit.org/show_bug.cgi?id=192589
1886
1887         Reviewed by Michael Catanzaro.
1888
1889         This was used to share the common implementation with the chromium port, but now that only freetype based ports
1890         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
1891         since we are already caching glyphs in Font.
1892
1893         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
1894         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
1895         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
1896         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1897         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
1898         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
1899         OpenType math.
1900         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1901         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
1902         (WebCore::doubleToHarfBuzzPosition): Ditto.
1903         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
1904         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
1905         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
1906         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
1907         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
1908         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
1909         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
1910         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
1911         * platform/graphics/harfbuzz/HbUniquePtr.h:
1912         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
1913         * platform/graphics/opentype/OpenTypeMathData.cpp:
1914         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
1915
1916 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1917
1918         [FreeType] Add initial implementation of variation fonts
1919         https://bugs.webkit.org/show_bug.cgi?id=192151
1920
1921         Reviewed by Michael Catanzaro.
1922
1923         * css/CSSFontFaceSource.cpp:
1924         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
1925         * loader/cache/CachedFont.cpp:
1926         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
1927         * platform/graphics/FontPlatformData.h:
1928         (WebCore::FontPlatformData::isFixedWidth const):
1929         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
1930         * platform/graphics/freetype/FontCacheFreeType.cpp:
1931         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
1932         pattern.
1933         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
1934         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
1935         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
1936         (WebCore::defaultVariationValues): Parse font variations table.
1937         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
1938         * platform/graphics/freetype/FontCacheFreeType.h: Added.
1939         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1940         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
1941         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
1942         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
1943         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
1944         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
1945         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
1946         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1947         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
1948         FC_FONT_VARIATIONS value from the pattern.
1949         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
1950         pattern.
1951         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
1952         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
1953         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
1954         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1955         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
1956         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1957         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
1958         * platform/graphics/win/FontCustomPlatformData.cpp:
1959         (WebCore::FontCustomPlatformData::fontPlatformData):
1960         * platform/graphics/win/FontCustomPlatformData.h:
1961
1962 2018-12-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1963
1964         [Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFrame' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
1965         https://bugs.webkit.org/show_bug.cgi?id=192618
1966
1967         Reviewed by Alex Christensen.
1968
1969         No new tests, no behavior changes.
1970
1971         * platform/win/PopupMenuWin.h:
1972         * platform/win/WCDataObject.cpp:
1973         * platform/win/WCDataObject.h:
1974
1975 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
1976
1977         REGRESSION (r238090): CAPCHA UI jumps to the wrong location
1978         https://bugs.webkit.org/show_bug.cgi?id=192651
1979         rdar://problem/46531919
1980
1981         Reviewed by Zalan Bujtas.
1982         
1983         When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
1984         bit to say that descendants need their geometry updated (because they now have to
1985         compute their positions relative to a different ancestor). This wasn't happening
1986         in the layerStyleChanged() code path.
1987         
1988         In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
1989         we can address a FIXME and only dirty direct children, not all descendants (that code was
1990         written before the child-only dirty bit existed).
1991
1992         Test: compositing/geometry/update-child-geometry-on-compositing-change.html
1993
1994         * rendering/RenderLayerCompositor.cpp:
1995         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1996         (WebCore::RenderLayerCompositor::layerStyleChanged):
1997
1998 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
1999
2000         Make TextInputController.legacyAttributedString take DOM nodes and offsets
2001         https://bugs.webkit.org/show_bug.cgi?id=192653
2002
2003         Reviewed by Wenson Hsieh.
2004
2005         No new tests since there should be no observable behavioral change other than
2006         TextInputController API in DumpRenderTree.
2007
2008         * editing/cocoa/HTMLConverter.h:
2009         * editing/cocoa/HTMLConverter.mm:
2010         (WebCore::attributedStringFromSelection):
2011         (WebCore::attributedStringBetweenStartAndEnd): Added.
2012
2013 2018-12-12  Ryosuke Niwa  <rniwa@webkit.org>
2014
2015         Fix macOS builds after r239145.
2016
2017         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2018
2019 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
2020
2021         REGRESSION (r238357): Pins on Yelp map disappear
2022         https://bugs.webkit.org/show_bug.cgi?id=192597
2023         rdar://problem/46578285
2024
2025         Reviewed by Zalan Bujtas.
2026
2027         RenderLayerCompositor::updateBackingAndHierarchy() had a bug where if a RenderLayer gained
2028         a negative z-order child (triggering creation of a foreground layer), we'd fail to 
2029         call the "setChildren()" with the vector containing that foreground layer.
2030         
2031         When updateBackingAndHierarchy() stops visiting descendants because none are composited,
2032         it may still have to update the child list with the foreground layer, so make sure
2033         the code handles this case.
2034
2035         Tests: compositing/z-order/add-negative-z-child.html
2036                compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html
2037
2038         * rendering/RenderLayer.cpp:
2039         (WebCore::outputPaintOrderTreeRecursive):
2040         * rendering/RenderLayerCompositor.cpp:
2041         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2042
2043 2018-12-12  YUHAN WU  <yuhan_wu@apple.com>
2044
2045         Implement non-timeslice mode encoding for MediaRecorder
2046         https://bugs.webkit.org/show_bug.cgi?id=192069
2047         <rdar://problem/46443290>
2048
2049         Reviewed by Eric Carlson.
2050
2051         Implement the encoding for non-timeslice mode of MediaRecorder.
2052         It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
2053         Add a API in internals to allow testings to turn on the mock source.
2054
2055         Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
2056
2057         * Modules/mediarecorder/MediaRecorder.cpp:
2058         (WebCore::MediaRecorder::create):
2059         (WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
2060         (WebCore::MediaRecorder::getPrivateImpl):
2061         (WebCore::MediaRecorder::MediaRecorder):
2062         (WebCore::MediaRecorder::stopRecording):
2063         (WebCore::MediaRecorder::stopRecordingInternal):
2064         (WebCore::MediaRecorder::createRecordingDataBlob):
2065         (WebCore::MediaRecorder::scheduleDeferredTask):
2066         * Modules/mediarecorder/MediaRecorder.h:
2067         * Modules/mediarecorder/MediaRecorder.idl:
2068         * SourcesCocoa.txt:
2069         * WebCore.xcodeproj/project.pbxproj:
2070         * platform/mediarecorder/MediaRecorderPrivate.h:
2071         (WebCore::MediaRecorderPrivate::stopRecording):
2072         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
2073         (WebCore::MediaRecorderPrivateAVFImpl::create):
2074         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
2075         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
2076         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
2077         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
2078         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
2079         (WebCore::MediaRecorderPrivateAVFImpl::mimeType):
2080         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
2081         * platform/mediarecorder/MediaRecorderPrivateMock.cpp:
2082         (WebCore::MediaRecorderPrivateMock::fetchData):
2083         (WebCore::MediaRecorderPrivateMock::mimeType):
2084         * platform/mediarecorder/MediaRecorderPrivateMock.h:
2085         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added.
2086         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
2087         (WebCore::MediaRecorderPrivateWriter::clear):
2088         (WebCore::MediaRecorderPrivateWriter::setupWriter):
2089         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
2090         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
2091         (WebCore::copySampleBufferWithCurrentTimeStamp):
2092         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
2093         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
2094         (WebCore::MediaRecorderPrivateWriter::stopRecording):
2095         * testing/Internals.cpp:
2096         (WebCore::createRecorderMockSource):
2097         (WebCore::Internals::setCustomPrivateRecorderCreator):
2098         * testing/Internals.h:
2099         * testing/Internals.idl:
2100
2101 2018-12-12  Justin Fan  <justin_fan@apple.com>
2102
2103         [WebGPU] Vertex buffers and WebGPUInputState
2104         https://bugs.webkit.org/show_bug.cgi?id=192611
2105
2106         Reviewed by Dean Jackson.
2107
2108         Test: webgpu/vertex-buffer-triangle-strip.html
2109
2110         Basic implementation of vertex buffers with Metal shading language in WebGPU. In 
2111         WebGPURenderPipelineDescriptor, refactor to match updated shader stage structure and add 
2112         WebGPUInputStateDescriptor. Also implement WebGPURenderPassEncoder::setVertexBuffers.
2113
2114         Add symbols and files for WebGPUIndexFormat, WebGPUInputStateDescriptor, WebGPUInputStepMode, 
2115         WebGPUVertexAttributeDescriptor, WebGPUVertexFormat, WebGPUVertexInputDescriptor:
2116         * CMakeLists.txt:
2117         * DerivedSources.make:
2118         * Sources.txt:
2119         * WebCore.xcodeproj/project.pbxproj:
2120         * bindings/js/WebCoreBuiltinNames.h:
2121
2122         Add and implement interfaces and dictionaries for WebGPUInputState:
2123         * Modules/webgpu/WebGPUBuffer.cpp:
2124         (WebCore::WebGPUBuffer::WebGPUBuffer):
2125         * Modules/webgpu/WebGPUBuffer.h:
2126         (WebCore::WebGPUBuffer::buffer const): Added getter for backing GPUBuffer.
2127         * Modules/webgpu/WebGPUBufferDescriptor.h:
2128         * Modules/webgpu/WebGPUBufferDescriptor.idl: Moving WebGPUBufferUsage out into its own IDL.
2129         * Modules/webgpu/WebGPUDevice.h:
2130         * Modules/webgpu/WebGPUIndexFormat.h: Added.
2131         * Modules/webgpu/WebGPUIndexFormat.idl: Added. 
2132         * Modules/webgpu/WebGPUInputStateDescriptor.h: Added.
2133         * Modules/webgpu/WebGPUInputStateDescriptor.idl: Added.
2134         * Modules/webgpu/WebGPUInputStepMode.h: Added.
2135         * Modules/webgpu/WebGPUInputStepMode.idl: Added.
2136         * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Added.
2137         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl: Added.
2138         * Modules/webgpu/WebGPUVertexFormat.h: Added.
2139         * Modules/webgpu/WebGPUVertexFormat.idl: Added.
2140         * Modules/webgpu/WebGPUVertexInputDescriptor.h: Added.
2141         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: Added.
2142         * platform/graphics/gpu/GPUInputStateDescriptor.h: Added.
2143         * platform/graphics/gpu/GPURenderPassEncoder.h: Added.
2144         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Added.
2145         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Added.
2146         * platform/graphics/gpu/GPUVertexInputDescriptor.h: Added.
2147
2148         Refactor to support updated structure of pipeline descriptor in sketch IDL:
2149         * Modules/webgpu/WebGPUDevice.cpp:
2150         (WebCore::validateAndConvertPipelineStage):
2151         (WebCore::WebGPUDevice::createRenderPipeline const):
2152         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
2153         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
2154         * Modules/webgpu/WebGPUPipelineStageDescriptor.h:
2155         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
2156         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
2157         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
2158         * Modules/webgpu/WebGPUShaderStage.*: Removed.
2159
2160         Add and implement setVertexBuffers:
2161         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2162         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Added. 
2163         * Modules/webgpu/WebGPURenderPassEncoder.h:
2164         * Modules/webgpu/WebGPURenderPassEncoder.idl: 
2165         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2166         (WebCore::GPURenderPassEncoder::setVertexBuffers):
2167         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2168         (WebCore::setInputStateForPipelineDescriptor):
2169         (WebCore::GPURenderPipeline::create):
2170
2171 2018-12-12  Tim Horton  <timothy_horton@apple.com>
2172
2173         REGRESSION (r237565): >20 Find in Page highlights in one tile results in a single giant highlight
2174         https://bugs.webkit.org/show_bug.cgi?id=192642
2175         <rdar://problem/46498246>
2176
2177         Reviewed by Geoffrey Garen.
2178
2179         No new tests; adjusted an existing test instead.
2180
2181         * platform/graphics/PathUtilities.cpp:
2182         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
2183         Instead of uniting when we fail to shrink-wrap, just return the original rects.
2184         This seems like a more reasonable default in most cases.
2185
2186 2018-12-12  Vivek Seth  <v_seth@apple.com>
2187
2188         HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
2189         https://bugs.webkit.org/show_bug.cgi?id=192375
2190         <rdar://problem/45851159>
2191
2192         Reviewed by Chris Dumez.
2193
2194         Use simulated redirect to tell clients that HTTPS Upgrade happened.
2195
2196         * platform/network/ResourceResponseBase.cpp:
2197         (WebCore::ResourceResponseBase::syntheticRedirectResponse):
2198         * platform/network/ResourceResponseBase.h:
2199         * platform/network/mac/WebCoreURLResponse.mm:
2200         (WebCore::synthesizeRedirectResponseIfNecessary):
2201
2202 2018-12-12  Chris Dumez  <cdumez@apple.com>
2203
2204         Add a preference to enable / disable devicemotion and deviceorientation events
2205         https://bugs.webkit.org/show_bug.cgi?id=192631
2206         <rdar://problem/46646244>
2207
2208         Reviewed by Geoffrey Garen.
2209
2210         Add setting to toggle support for the deviceorientation / devicemotion events:
2211         - https://w3c.github.io/deviceorientation/
2212
2213         * page/DOMWindow.cpp:
2214         (WebCore::DOMWindow::addEventListener):
2215         * page/Settings.yaml:
2216
2217 2018-12-11  Ryosuke Niwa  <rniwa@webkit.org>
2218
2219         Make HTMLConverter take two Positions in preparation to make it work with shadow DOM
2220         https://bugs.webkit.org/show_bug.cgi?id=192613
2221
2222         Reviewed by Darin Adler.
2223
2224         This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with
2225         a selection which spans across shadow boundaries in the future.
2226
2227         No new tests since there should be no observable behavioral change.
2228
2229         * editing/cocoa/EditorCocoa.mm:
2230         (WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard.
2231         (WebCore::Editor::writeSelection): Ditto.
2232         * editing/cocoa/HTMLConverter.h:
2233         * editing/cocoa/HTMLConverter.mm:
2234         (HTMLConverter::HTMLConverter): Now takes two Position's.
2235         (HTMLConverter::convert): Updated to work with Position's.
2236         (HTMLConverter::_processText): Ditto.
2237         (HTMLConverter::_traverseNode): Ditto.
2238         (HTMLConverter::_traverseFooterNode): Ditto.
2239         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto.
2240         (WebCore::attributedStringFromRange): Ditto.
2241         (WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange
2242         in order to preserve the exact behavior.
2243
2244 2018-12-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2245
2246         Unreviewed manual rollout of r239100-r239102 and r239116
2247         https://bugs.webkit.org/show_bug.cgi?id=192151
2248         <rdar://problem/46655586>
2249
2250         * css/CSSFontFaceSource.cpp:
2251         (WebCore::CSSFontFaceSource::font):
2252         * loader/cache/CachedFont.cpp:
2253         (WebCore::CachedFont::platformDataFromCustomData):
2254         * platform/FreeType.cmake:
2255         * platform/graphics/FontPlatformData.h:
2256         (WebCore::FontPlatformData::isFixedWidth const): Deleted.
2257         * platform/graphics/cairo/FontCustomPlatformData.h:
2258         * platform/graphics/freetype/FontCacheFreeType.cpp:
2259         (WebCore::FontCache::systemFallbackForCharacters):
2260         (WebCore::FontCache::createFontPlatformData):
2261         (WebCore::getFontPropertiesFromPattern): Deleted.
2262         (WebCore::defaultVariationValues): Deleted.
2263         (WebCore::buildVariationSettings): Deleted.
2264         * platform/graphics/freetype/FontCacheFreeType.h: Removed.
2265         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2266         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
2267         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
2268         (WebCore::FontCustomPlatformData::fontPlatformData):
2269         (WebCore::FontCustomPlatformData::supportsFormat):
2270         (WebCore::defaultFontconfigOptions): Deleted.
2271         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2272         (WebCore::setCairoFontOptionsFromFontConfigPattern):
2273         (WebCore::getDefaultFontconfigOptions):
2274         (WebCore::FontPlatformData::FontPlatformData):
2275         (WebCore::FontPlatformData::operator=):
2276         (WebCore::FontPlatformData::harfBuzzFace const):
2277         (WebCore::FontPlatformData::platformIsEqual const):
2278         (WebCore::FontPlatformData::buildScaledFont):
2279         (WebCore::FontPlatformData::fcPattern const): Deleted.
2280         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Deleted.
2281         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2282         (WebCore::Font::platformCreateScaledFont const):
2283         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2284         (WebCore::fontFeatures):
2285         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2286         (WebCore::floatToHarfBuzzPosition): Deleted.
2287         (WebCore::doubleToHarfBuzzPosition): Deleted.
2288         (WebCore::harfBuzzFontFunctions): Deleted.
2289         (WebCore::findScriptForVerticalGlyphSubstitution): Deleted.
2290         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Added.
2291         (WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
2292         (WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
2293         (WebCore::HarfBuzzFace::cache):
2294         (WebCore::HarfBuzzFace::HarfBuzzFace):
2295         (WebCore::HarfBuzzFace::~HarfBuzzFace):
2296         (WebCore::findScriptForVerticalGlyphSubstitution):
2297         (WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
2298         * platform/graphics/harfbuzz/HarfBuzzFace.h: Added.
2299         (WebCore::HarfBuzzFace::CacheEntry::create):
2300         (WebCore::HarfBuzzFace::CacheEntry::face):
2301         (WebCore::HarfBuzzFace::CacheEntry::glyphCache):
2302         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Added.
2303         (WebCore::floatToHarfBuzzPosition):
2304         (WebCore::doubleToHarfBuzzPosition):
2305         (WebCore::CairoGetGlyphWidthAndExtents):
2306         (WebCore::harfBuzzGetGlyph):
2307         (WebCore::harfBuzzGetGlyphHorizontalAdvance):
2308         (WebCore::harfBuzzGetGlyphHorizontalOrigin):
2309         (WebCore::harfBuzzGetGlyphExtents):
2310         (WebCore::harfBuzzCairoTextGetFontFuncs):
2311         (WebCore::harfBuzzCairoGetTable):
2312         (WebCore::HarfBuzzFace::createFace):
2313         (WebCore::HarfBuzzFace::createFont):
2314         * platform/graphics/harfbuzz/HbUniquePtr.h:
2315         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Deleted.
2316         * platform/graphics/opentype/OpenTypeMathData.cpp:
2317         (WebCore::OpenTypeMathData::OpenTypeMathData):
2318         * platform/graphics/win/FontCustomPlatformData.cpp:
2319         (WebCore::FontCustomPlatformData::fontPlatformData):
2320         * platform/graphics/win/FontCustomPlatformData.h:
2321         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2322         (WebCore::FontCustomPlatformData::fontPlatformData):
2323
2324 2018-12-12  Chris Dumez  <cdumez@apple.com>
2325
2326         Unreviewed attempt to fix Windows Cairo build after r239100.
2327
2328         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2329         (WebCore::FontCustomPlatformData::fontPlatformData):
2330
2331 2018-12-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2332
2333         [iOS] A few API tests are failing after r239086
2334         https://bugs.webkit.org/show_bug.cgi?id=192608
2335
2336         Reviewed by Zalan Bujtas.
2337
2338         These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing
2339         the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest
2340         fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab
2341         the highest fidelity path using Vector::first().
2342
2343         While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths,
2344         this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear.
2345
2346         * platform/PasteboardItemInfo.h:
2347         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
2348         * platform/ios/PasteboardIOS.mm:
2349         (WebCore::Pasteboard::readRespectingUTIFidelities):
2350         (WebCore::Pasteboard::readFilePaths):
2351
2352 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2353
2354         Unreviewed. Fix WPE build after r239101.
2355
2356         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include <hb-ot.h>
2357
2358 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2359
2360         [FreeType] Remove HarfBuzzFace
2361         https://bugs.webkit.org/show_bug.cgi?id=192589
2362
2363         Reviewed by Michael Catanzaro.
2364
2365         This was used to share the common implementation with the chromium port, but now that only freetype based ports
2366         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
2367         since we are already caching glyphs in Font.
2368
2369         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
2370         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
2371         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
2372         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2373         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
2374         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
2375         OpenType math.
2376         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2377         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
2378         (WebCore::doubleToHarfBuzzPosition): Ditto.
2379         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
2380         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
2381         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
2382         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
2383         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
2384         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
2385         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
2386         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
2387         * platform/graphics/harfbuzz/HbUniquePtr.h:
2388         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
2389         * platform/graphics/opentype/OpenTypeMathData.cpp:
2390         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
2391
2392 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2393
2394         [FreeType] Add initial implementation of variation fonts
2395         https://bugs.webkit.org/show_bug.cgi?id=192151
2396
2397         Reviewed by Michael Catanzaro.
2398
2399         * css/CSSFontFaceSource.cpp:
2400         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
2401         * loader/cache/CachedFont.cpp:
2402         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
2403         * platform/graphics/FontPlatformData.h:
2404         (WebCore::FontPlatformData::isFixedWidth const):
2405         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
2406         * platform/graphics/freetype/FontCacheFreeType.cpp:
2407         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
2408         pattern.
2409         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
2410         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
2411         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
2412         (WebCore::defaultVariationValues): Parse font variations table.
2413         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
2414         * platform/graphics/freetype/FontCacheFreeType.h: Added.
2415         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2416         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
2417         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
2418         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
2419         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
2420         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
2421         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
2422         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2423         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
2424         FC_FONT_VARIATIONS value from the pattern.
2425         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
2426         pattern.
2427         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
2428         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
2429         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
2430         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2431         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
2432         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2433         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
2434         * platform/graphics/win/FontCustomPlatformData.cpp:
2435         (WebCore::FontCustomPlatformData::fontPlatformData):
2436         * platform/graphics/win/FontCustomPlatformData.h:
2437
2438 2018-12-11  Justin Michaud  <justin_michaud@apple.com>
2439
2440         Implement feature flag for CSS Typed OM
2441         https://bugs.webkit.org/show_bug.cgi?id=192610
2442
2443         Reviewed by Ryosuke Niwa.
2444
2445         * Configurations/FeatureDefines.xcconfig:
2446         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
2447         * css/typedom/StylePropertyMapReadOnly.h:
2448         * css/typedom/StylePropertyMapReadOnly.idl:
2449         * css/typedom/TypedOMCSSImageValue.h:
2450         * css/typedom/TypedOMCSSImageValue.idl:
2451         * css/typedom/TypedOMCSSNumericValue.h:
2452         * css/typedom/TypedOMCSSNumericValue.idl:
2453         * css/typedom/TypedOMCSSStyleValue.h:
2454         * css/typedom/TypedOMCSSStyleValue.idl:
2455         * css/typedom/TypedOMCSSUnitValue.h:
2456         * css/typedom/TypedOMCSSUnitValue.idl:
2457         * css/typedom/TypedOMCSSUnparsedValue.h:
2458         * css/typedom/TypedOMCSSUnparsedValue.idl:
2459         * features.json:
2460         * html/ImageBitmap.cpp:
2461         * html/ImageBitmap.h:
2462         * html/canvas/CanvasDrawImage.idl:
2463         * html/canvas/CanvasFillStrokeStyles.idl:
2464         * html/canvas/CanvasRenderingContext2DBase.cpp:
2465         * html/canvas/CanvasRenderingContext2DBase.h:
2466         * inspector/InspectorCanvas.cpp:
2467         (WebCore::InspectorCanvas::buildAction):
2468         * page/RuntimeEnabledFeatures.h:
2469         (WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled):
2470         (WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const):
2471         * page/WindowOrWorkerGlobalScope.idl:
2472
2473 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
2474
2475         connectedCallback is invoked during the removal of the element inside another element's connectedCallback
2476         https://bugs.webkit.org/show_bug.cgi?id=183586
2477         <rdar://problem/38403504>
2478
2479         Reviewed by Frédéric Wang.
2480
2481         Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760
2482
2483         After much discussion, it's unclear that there is a clear path forward to fixing the oddness that
2484         the presence of a custom element reaction changes the timing at which another reaction callback gets invoked.
2485         So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability.
2486
2487         Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element
2488         does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in:
2489         https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction
2490             1. Let definition be element's custom element definition.
2491             2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName.
2492             3. If callback is null, then return
2493             4. If callbackName is "attributeChangedCallback", then:
2494                 1. Let attributeName be the first element of args.
2495                 2. If definition's observed attributes does not contain attributeName, then return.
2496             5. Add a new callback reaction to element's custom element reaction queue, with callback function callback
2497                and arguments args.
2498             6. Enqueue an element on the appropriate element queue given element.
2499
2500         Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html
2501
2502         * dom/CustomElementReactionQueue.cpp:
2503         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
2504         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
2505         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
2506         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
2507         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
2508         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
2509         (WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue.
2510         * dom/CustomElementReactionQueue.h:
2511
2512 2018-12-11  Justin Fan  <justin_fan@apple.com>
2513
2514         [WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU
2515         https://bugs.webkit.org/show_bug.cgi?id=192516
2516
2517         Reviewed by Dean Jackson.
2518
2519         Test: webgpu/buffers.html
2520
2521         Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation.
2522
2523         Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor:
2524         * CMakeLists.txt:
2525         * DerivedSources.make:
2526         * Sources.txt:
2527         * SourcesCocoa.txt:
2528         * WebCore.xcodeproj/project.pbxproj:
2529         * bindings/js/WebCoreBuiltinNames.h:
2530
2531         * Modules/webgpu/WebGPUBuffer.cpp: Added.
2532         (WebCore::WebGPUBuffer::create):
2533         (WebCore::WebGPUBuffer::WebGPUBuffer):
2534         * Modules/webgpu/WebGPUBuffer.h: Added.
2535         (WebCore::WebGPUBuffer::mapping const):
2536         (WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear.
2537         (WebCore::WebGPUBuffer::destroy): Unimplemented stub.
2538         * Modules/webgpu/WebGPUBuffer.idl: Added.
2539         * Modules/webgpu/WebGPUBufferDescriptor.h: Added.
2540         * Modules/webgpu/WebGPUBufferDescriptor.idl: Added.
2541         * Modules/webgpu/WebGPUDevice.cpp:
2542         (WebCore::WebGPUDevice::createBuffer const): Added.
2543         * platform/graphics/gpu/GPUBuffer.h:
2544         (WebCore::GPUBuffer::platformBuffer const):
2545         (WebCore::GPUBuffer::mapping const):
2546         * platform/graphics/gpu/GPUBufferDescriptor.h: Added.
2547         * platform/graphics/gpu/GPUDevice.cpp:
2548         (WebCore::GPUDevice::createBuffer const): Added.
2549         * platform/graphics/gpu/GPUDevice.h:
2550         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added.
2551         (WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer. 
2552         (WebCore::GPUBuffer::GPUBuffer):
2553         (WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first.
2554
2555         Small benign edits, most to make nullability more consistent in WebGPU classes:
2556         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2557         (WebCore::WebGPUCommandBuffer::create):
2558         (WebCore::WebGPUCommandBuffer::beginRenderPass):
2559         * Modules/webgpu/WebGPUCommandBuffer.h:
2560         * Modules/webgpu/WebGPUDevice.cpp:
2561         (WebCore::WebGPUDevice::create):
2562         (WebCore::WebGPUDevice::WebGPUDevice):
2563         (WebCore::WebGPUDevice::createShaderModule const):
2564         (WebCore::WebGPUDevice::createRenderPipeline const):
2565         (WebCore::WebGPUDevice::createCommandBuffer const):
2566         * Modules/webgpu/WebGPUDevice.h:
2567         (WebCore::WebGPUDevice::device const):
2568         * Modules/webgpu/WebGPUDevice.idl:
2569         * Modules/webgpu/WebGPUQueue.cpp:
2570         (WebCore::WebGPUQueue::create):
2571         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2572         (WebCore::WebGPURenderPassEncoder::create):
2573         * Modules/webgpu/WebGPURenderPassEncoder.h:
2574         * Modules/webgpu/WebGPUShaderModule.cpp:
2575         (WebCore::WebGPUShaderModule::create):
2576         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
2577         * Modules/webgpu/WebGPUShaderModule.h:
2578         (WebCore::WebGPUShaderModule::module const):
2579         * Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes.
2580         * Modules/webgpu/WebGPUTexture.cpp:
2581         (WebCore::WebGPUTexture::create):
2582         (WebCore::WebGPUTexture::createDefaultTextureView):
2583         * Modules/webgpu/WebGPUTextureView.cpp:
2584         (WebCore::WebGPUTextureView::create):
2585         * Modules/webgpu/WebGPUTextureView.h:
2586         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2587         (WebCore::GPUQueue::create):
2588         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2589         (WebCore::GPURenderPipeline::create):
2590         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
2591         (WebCore::GPUShaderModule::create):
2592         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2593         (WebCore::GPUSwapChain::setDevice):
2594         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
2595         (WebCore::GPUTexture::GPUTexture):
2596
2597 2018-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
2598
2599         [Win][Clang] Fix warning -Wmissing-field-initializers
2600         https://bugs.webkit.org/show_bug.cgi?id=192584
2601
2602         Reviewed by Yusuke Suzuki.
2603
2604         Initialize a struct with '{ }' instead of '= {0}'.
2605
2606         No new tests, no behavior changes.
2607
2608         * platform/graphics/win/FontCacheWin.cpp:
2609         (WebCore::FontCache::lastResortFallbackFont):
2610         * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
2611         (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
2612         * platform/win/ClipboardUtilitiesWin.cpp:
2613         (WebCore::setFileDescriptorData):
2614         (WebCore::setFileContentData):
2615         (WebCore::setUCharData):
2616         (WebCore::setUtf8Data):
2617         (WebCore::setCFData):
2618         * platform/win/CursorWin.cpp:
2619         (WebCore::createSharedCursor):
2620         * platform/win/DefWndProcWindowClass.cpp:
2621         (WebCore::registerClass):
2622         * platform/win/DragImageWin.cpp:
2623         (WebCore::createDragImageIconForCachedImageFilename):
2624         * platform/win/PasteboardWin.cpp:
2625         (WebCore::writeURL):
2626         (WebCore::Pasteboard::writeString):
2627         (WebCore::Pasteboard::writeRangeToDataObject):
2628         (WebCore::Pasteboard::writePlainTextToDataObject):
2629         (WebCore::writeFileToDataObject):
2630         (WebCore::Pasteboard::writeMarkup):
2631         * platform/win/PopupMenuWin.cpp:
2632         (WebCore::PopupMenuWin::show):
2633         * platform/win/SSLKeyGeneratorWin.cpp:
2634         (WebCore::WebCore::signedPublicKeyAndChallengeString):
2635
2636 2018-12-11  Jer Noble  <jer.noble@apple.com>
2637
2638         Globally namespaced objects shouldn't use framework-prefixed names
2639         https://bugs.webkit.org/show_bug.cgi?id=192600
2640
2641         Reviewed by Eric Carlson.
2642
2643         Rename CMSampleBufferIs... -> isCMSampleBuffer...
2644
2645         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2646         (WebCore::isCMSampleBufferRandomAccess):
2647         (WebCore::isCMSampleBufferNonDisplaying):
2648         (WebCore::MediaSampleAVFObjC::flags const):
2649         (WebCore::CMSampleBufferIsRandomAccess): Deleted.
2650         (WebCore::CMSampleBufferIsNonDisplaying): Deleted.
2651
2652 2018-12-11  Brent Fulgham  <bfulgham@apple.com>
2653
2654         Don't attempt to compute animated values when there is no relevant animation
2655         https://bugs.webkit.org/show_bug.cgi?id=192591
2656         <rdar://problem/34336946>
2657
2658         Reviewed by Dean Jackson.
2659
2660         Check if the property is supposed to be animated, or has animatable features, before
2661         attempting to calculate the current animated value.
2662
2663         Test: svg/animations/avoid-calculating-for-non-animating-elements.html
2664
2665         * svg/SVGAnimateElementBase.cpp:
2666         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2667
2668 2018-12-11  Chris Dumez  <cdumez@apple.com>
2669
2670         Unreviewed, fix typos in console log from r239087.
2671
2672         * page/DOMWindow.cpp:
2673         (WebCore::DOMWindow::addEventListener):
2674
2675 2018-12-11  Tim Horton  <timothy_horton@apple.com>
2676
2677         WebCore shouldn't have a Objective-C class named NSCursor
2678         https://bugs.webkit.org/show_bug.cgi?id=192602
2679         <rdar://problem/46615532>
2680
2681         Reviewed by Wenson Hsieh.
2682
2683         * platform/ios/wak/WAKAppKitStubs.h:
2684         * platform/ios/wak/WAKAppKitStubs.m:
2685         (+[NSCursor setHiddenUntilMouseMoves:]): Deleted.
2686         Get rid of the class.
2687         Also remove a comment that seems to have detached from wherever it's supposed to be.
2688
2689 2018-12-11  Chris Dumez  <cdumez@apple.com>
2690
2691         Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
2692         https://bugs.webkit.org/show_bug.cgi?id=192595
2693         <rdar://problem/46382603>
2694
2695         Reviewed by Dean Jackson.
2696
2697         Tests: http/tests/events/device-orientation-motion-non-secure-context.html
2698                http/tests/events/device-orientation-motion-secure-context.html
2699
2700         * page/DOMWindow.cpp:
2701         (WebCore::DOMWindow::addEventListener):
2702         * page/SecurityOrigin.h:
2703         (WebCore::SecurityOrigin::setIsPotentiallyTrustworthy):
2704         * testing/Internals.cpp:
2705         (WebCore::Internals::markContextAsInsecure):
2706         (WebCore::Internals::postTask):
2707         * testing/Internals.h:
2708         * testing/Internals.idl:
2709
2710 2018-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2711
2712         [iOS] Send the full list of file upload URLs and types in PasteboardItemInfo
2713         https://bugs.webkit.org/show_bug.cgi?id=192598
2714         Work towards <rdar://problem/35626913>
2715
2716         Reviewed by Tim Horton.
2717
2718         Refactors PasteboardItemInfo to contain lists of file URLs and corresponding pasteboard types, instead of just
2719         a "preferred" file upload URL and type. See below for more details.
2720
2721         * platform/PasteboardItemInfo.h:
2722         (WebCore::PasteboardItemInfo::pathForContentType const):
2723
2724         Add a helper method to find a file upload URL corresponding to a given type.
2725
2726         (WebCore::PasteboardItemInfo::encode const):
2727         (WebCore::PasteboardItemInfo::decode):
2728
2729         Change `pathForFileUpload` to `pathsForFileUpload`, and `contentTypeForFileUpload` to `contentTypesForFileUpload`.
2730
2731         * platform/ios/AbstractPasteboard.h:
2732         * platform/ios/PasteboardIOS.mm:
2733         (WebCore::Pasteboard::readRespectingUTIFidelities):
2734
2735         Adjust this to take the file path for the highest fidelity representation in `pathsForContentType`.
2736
2737         (WebCore::Pasteboard::readFilePaths):
2738         * platform/ios/PlatformPasteboardIOS.mm:
2739         (WebCore::PlatformPasteboard::informationForItemAtIndex):
2740         * platform/ios/WebItemProviderPasteboard.h:
2741         * platform/ios/WebItemProviderPasteboard.mm:
2742         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
2743         (-[NSItemProvider web_fileUploadContentTypes]):
2744
2745         Replace `web_containsFileUploadContent` with `web_fileUploadContentTypes`, which returns the full list of file
2746         upload content types (rather than just a `BOOL` indicating whether one or more of these types exist).
2747
2748         (-[WebItemProviderPasteboard fileUploadURLsAtIndex:fileTypes:]):
2749         (-[WebItemProviderPasteboard numberOfFiles]):
2750         (-[NSItemProvider web_containsFileUploadContent]): Deleted.
2751         (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): Deleted.
2752
2753         Replaced with `-fileUploadURLsAtIndex:fileTypes:`. This implementation currently just returns the highest
2754         fidelity loaded type identifier, but this is wrong because it doesn't take into account inline data types that
2755         shouldn't be represented as data for file uploads (for instance, it never makes sense to upload the internal
2756         data serialization for an `NSURL` as a file on the web).
2757
2758         Instead, use existing logic in `web_fileUploadContentTypes` to determine which file types can be treated as file
2759         uploads, and return all of these file types that we've loaded.
2760
2761 2018-12-11  Don Olmstead  <don.olmstead@sony.com>
2762
2763         Resource Load Statistics: Use common implementation within NetworkStorageSession
2764         https://bugs.webkit.org/show_bug.cgi?id=192592
2765
2766         Reviewed by Alex Christensen.
2767
2768         There's nothing within the resource load statistics implementation contained
2769         in NetworkStorageSessionCFNet that was CF specific. All of the resource load
2770         statistics methods are moved from that file to the root NetworkStorageSession
2771         implementation.
2772
2773         * platform/network/NetworkStorageSession.cpp:
2774         (WebCore::getPartitioningDomain):
2775         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
2776         (WebCore::NetworkStorageSession::shouldBlockCookies const):
2777         (WebCore::NetworkStorageSession::maxAgeCacheCap):
2778         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
2779         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
2780         (WebCore::NetworkStorageSession::removePrevalentDomains):
2781         (WebCore::NetworkStorageSession::hasStorageAccess const):
2782         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
2783         (WebCore::NetworkStorageSession::grantStorageAccess):
2784         (WebCore::NetworkStorageSession::removeStorageAccessForFrame):
2785         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
2786         (WebCore::NetworkStorageSession::removeAllStorageAccess):
2787         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
2788         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
2789         * platform/network/NetworkStorageSession.h:
2790         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2791         (WebCore::getPartitioningDomain): Deleted.
2792         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): Deleted.
2793         (WebCore::NetworkStorageSession::shouldBlockCookies const): Deleted.
2794         (WebCore::NetworkStorageSession::maxAgeCacheCap): Deleted.
2795         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): Deleted.
2796         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted.
2797         (WebCore::NetworkStorageSession::removePrevalentDomains): Deleted.
2798         (WebCore::NetworkStorageSession::hasStorageAccess const): Deleted.
2799         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const): Deleted.
2800         (WebCore::NetworkStorageSession::grantStorageAccess): Deleted.
2801         (WebCore::NetworkStorageSession::removeStorageAccessForFrame): Deleted.
2802         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
2803         (WebCore::NetworkStorageSession::removeAllStorageAccess): Deleted.
2804         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): Deleted.
2805         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): Deleted.
2806
2807 2018-12-11  Devin Rousso  <drousso@apple.com>
2808
2809         Web Inspector: overlay bounds rulers don't match element when page is scrolled
2810         https://bugs.webkit.org/show_bug.cgi?id=192577
2811
2812         Reviewed by Joseph Pecoraro.
2813
2814         When drawing the highlight for a node, the canvas is translated based on the scroll position
2815         of the node. This translation was not applied to the bounds calculations, which meant that
2816         the bounds always drew where the node would have been if it wasn't scrolled.
2817
2818         * inspector/InspectorOverlayPage.js:
2819         (Bounds.prototype.get minX):
2820         (Bounds.prototype.get minY):
2821         (Bounds.prototype.get maxX):
2822         (Bounds.prototype.get maxY):
2823         (Bounds.prototype.offset): Added.
2824         (drawNodeHighlight):
2825         Drive-by: draw bounds for every node being highlighted instead of just the first one.
2826         Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast.
2827
2828 2018-12-11  Andy Estes  <aestes@apple.com>
2829
2830         Introduce makeBlockPtr for lambdas
2831         https://bugs.webkit.org/show_bug.cgi?id=192594
2832
2833         Reviewed by Alex Christensen.
2834
2835         Adopted makeBlockPtr.
2836
2837         * platform/cocoa/FileMonitorCocoa.mm:
2838         (WebCore::FileMonitor::FileMonitor):
2839         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
2840         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
2841         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm:
2842         (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
2843         * platform/network/cocoa/WebCoreNSURLSession.mm:
2844         (-[WebCoreNSURLSession addDelegateOperation:]):
2845         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
2846         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2847         (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
2848
2849 2018-12-10  Brent Fulgham  <bfulgham@apple.com>
2850
2851         SVGViewSpec objects should mark relevant SVG elements
2852         https://bugs.webkit.org/show_bug.cgi?id=192567
2853         <rdar://problem/46491325>
2854
2855         Reviewed by Ryosuke Niwa.
2856
2857         SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to
2858         recognize the relevant SVGElement as active as long as the SVGViewSpec is active.
2859
2860         Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare
2861         pointer to the SVGElement, so switched to a WeakPtr.
2862
2863         Test: svg/animations/view-dependency-crash.html
2864
2865         * Sources.txt: Add new files.
2866         * WebCore.xcodeproj/project.pbxproj: Ditto.
2867         * bindings/js/JSSVGViewSpecCustom.cpp: Added.
2868         (WebCore::JSSVGViewSpec::visitAdditionalChildren):
2869         * svg/SVGElement.h:
2870         * svg/SVGPathElement.h:
2871         * svg/SVGViewSpec.cpp:
2872         (WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element.
2873         * svg/SVGViewSpec.h:
2874         * svg/SVGViewSpec.idl:
2875         * svg/properties/SVGAttributeOwnerProxy.cpp: Added.
2876         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to
2877         the underling SVGElement.
2878         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
2879         * svg/properties/SVGAttributeOwnerProxy.h:
2880         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file.
2881         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
2882         * svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use.
2883
2884 2018-12-10  Benjamin Poulain  <benjamin@webkit.org>
2885
2886         <rdar://problem/45296285> Content blocker rule "raw" blocks media elements from loading
2887         https://bugs.webkit.org/show_bug.cgi?id=192439
2888
2889         Reviewed by Dean Jackson.
2890
2891         This broken when WebKit switched to NSURLSession.
2892         In CachedResourceLoader::requestResource(), toResourceType() was turning media load into RAW.
2893
2894         Test: http/tests/contentextensions/video-element-resource-type.html
2895
2896         * loader/ResourceLoadInfo.cpp:
2897         (WebCore::toResourceType):
2898
2899 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
2900
2901         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
2902         https://bugs.webkit.org/show_bug.cgi?id=192573
2903
2904         Reviewed by Simon Fraser.
2905
2906         * Configurations/FeatureDefines.xcconfig:
2907
2908 2018-12-10  Justin Michaud  <justin_michaud@apple.com>
2909
2910         CS Painting API should support multiple worklets.
2911         https://bugs.webkit.org/show_bug.cgi?id=192335
2912
2913         Reviewed by Dean Jackson.
2914
2915         Adds a new map to support separate paint worklet global scopes (one for each worklet). Also
2916         adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required
2917         for paint would not trigger a repaint if there had not been a valid value set before.
2918
2919         Test: fast/css-custom-paint/multiple-worklets.html
2920
2921         * css/CSSPaintImageValue.cpp:
2922         (WebCore::CSSPaintImageValue::image):
2923         * css/StyleResolver.cpp:
2924         (WebCore::StyleResolver::applyProperty):
2925         * dom/Document.cpp:
2926         (WebCore::Document::prepareForDestruction):
2927         (WebCore::Document::paintWorkletGlobalScope):
2928         (WebCore::Document::setPaintWorkletGlobalScope):
2929         * dom/Document.h:
2930         (WebCore::Document::paintWorkletGlobalScope): Deleted.
2931         * rendering/style/RenderStyle.cpp:
2932         (WebCore::changedCustomPaintWatchedProperty):
2933         * worklets/Worklet.cpp:
2934         (WebCore::Worklet::addModule):
2935         * worklets/WorkletGlobalScope.cpp:
2936         (WebCore::WorkletGlobalScope::prepareForDestruction):
2937
2938 2018-12-10  Youenn Fablet  <youenn@apple.com>
2939
2940         Remove derived classes of RealtimeMediaSourceCenter
2941         https://bugs.webkit.org/show_bug.cgi?id=192546
2942
2943         Reviewed by Eric Carlson.
2944
2945         Remove virtual methods of RealtimeMediaSourceCenter and remove derived classes of it.
2946         Instead port specific implementation directly implement the needed default factory methods.
2947
2948         Renamed some methods for improved consistency.
2949         Moved some static variables as RealtimeMediaSourceCenter members.
2950
2951         No change of behavior.
2952
2953         * WebCore.xcodeproj/project.pbxproj:
2954         * page/DeprecatedGlobalSettings.cpp:
2955         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2956         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
2957         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
2958         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
2959         (WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState):
2960         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
2961         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
2962         (WebCore::RealtimeMediaSourceCenter::audioCaptureFactory):
2963         (WebCore::RealtimeMediaSourceCenter::setVideoFactory):
2964         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
2965         (WebCore::RealtimeMediaSourceCenter::videoCaptureFactory):
2966         (WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
2967         (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
2968         (WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
2969         * platform/mediastream/RealtimeMediaSourceCenter.h:
2970         * platform/mediastream/RealtimeVideoSource.cpp:
2971         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
2972         (WebCore::RealtimeVideoSource::prepareToProduceData):
2973         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
2974         (WebCore::RealtimeMediaSourceCenter::singleton):
2975         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
2976         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
2977         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
2978         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: Removed.
2979         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2980         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
2981         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2982         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2983         (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
2984         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
2985         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2986         (WebCore::RealtimeMediaSourceCenter::singleton):
2987         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
2988         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
2989         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
2990         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Removed.
2991         * platform/mock/MockRealtimeAudioSource.cpp:
2992         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
2993         (WebCore::MockRealtimeAudioSource::startProducingData):
2994         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2995         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
2996         (WebCore::MockRealtimeMediaSourceCenter::audioCaptureFactory):
2997         (WebCore::MockRealtimeMediaSourceCenter::videoCaptureFactory):
2998         * platform/mock/MockRealtimeMediaSourceCenter.h:
2999
3000 2018-12-10  Youenn Fablet  <youenn@apple.com>
3001
3002         DataChannels created asynchronously never open and are unusable
3003         https://bugs.webkit.org/show_bug.cgi?id=192566
3004
3005         Reviewed by Eric Carlson.
3006
3007         For every new data channel (remote or local), we should check the underlying backend state.
3008         This allows firing events if needed.
3009         We were not always doing that which was prohibiting sending some open
3010         events for data channels created after the SCTP connection is set up.
3011
3012         Covered by updated test.
3013
3014         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
3015         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
3016         (WebCore::LibWebRTCDataChannelHandler::setClient):
3017         (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
3018         (WebCore::LibWebRTCDataChannelHandler::checkState):
3019         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
3020
3021 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
3022
3023         Use WeakPtr to refer to VTTCue in VTTCueBox
3024         https://bugs.webkit.org/show_bug.cgi?id=192575
3025
3026         Reviewed by Eric Carlson.
3027
3028         Address the FIXME in VTTCue::~VTTCue by clearing VTTCueBox::m_cue when VTTCue goes away.
3029         This is implemented by simply using WeakPtr.
3030
3031         No new tests since there shoul be no behaivoral change.
3032
3033         * html/track/TextTrackCueGeneric.cpp:
3034         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
3035         * html/track/VTTCue.cpp:
3036         (WebCore::VTTCueBox::VTTCueBox):
3037         (WebCore::VTTCueBox::getCue const):
3038         (WebCore::VTTCueBox::applyCSSProperties):
3039         (WebCore::VTTCue::~VTTCue):
3040         * html/track/VTTCue.h:
3041         (WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const):
3042
3043 2018-12-10  Mark Lam  <mark.lam@apple.com>
3044
3045         PropertyAttribute needs a CustomValue bit.
3046         https://bugs.webkit.org/show_bug.cgi?id=191993
3047         <rdar://problem/46264467>
3048
3049         Reviewed by Saam Barati.
3050
3051         This patch revealed a bug in the CodeGenerator where a constructor property is
3052         set with a ReadOnly attribute.  This conflicts with the WebIDL link (see clause
3053         12 in https://heycam.github.io/webidl/#interface-prototype-object) which states
3054         that it should be [Writable].  The ReadOnly attribute is now removed.
3055
3056         On the WebCore side, this change is covered by existing tests.
3057
3058         * bindings/scripts/CodeGeneratorJS.pm:
3059         (GenerateImplementation):
3060         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3061         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
3062
3063 2018-12-10  Antti Koivisto  <antti@apple.com>
3064
3065         Rename "forced style recalc" to "full style rebuild"
3066         https://bugs.webkit.org/show_bug.cgi?id=192572
3067
3068         Reviewed by Zalan Bujtas.
3069
3070         The old name is confusing.
3071
3072         * css/CSSComputedStyleDeclaration.cpp:
3073         (WebCore::hasValidStyleForProperty):
3074         * dom/Document.cpp:
3075         (WebCore::Document::scheduleStyleRebuild):
3076         (WebCore::Document::scheduleStyleRecalc):
3077         (WebCore::Document::unscheduleStyleRecalc):
3078         (WebCore::Document::hasPendingStyleRebuild const):
3079         (WebCore::Document::resolveStyle):
3080         (WebCore::Document::needsStyleRecalc const):
3081         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
3082         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
3083         (WebCore::Document::setDesignMode):
3084         (WebCore::Document::webkitDidExitFullScreenForElement):
3085         (WebCore::Document::setAnimatingFullScreen):
3086         (WebCore::Document::setFullscreenControlsHidden):
3087         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
3088         (WebCore::Document::hasPendingForcedStyleRecalc const): Deleted.
3089         * dom/Document.h:
3090         * dom/Element.cpp:
3091         (WebCore::Element::needsStyleInvalidation const):
3092         * page/Page.cpp:
3093         (WebCore::Page::updateStyleAfterChangeInEnvironment):
3094         * style/StyleScope.cpp:
3095         (WebCore::Style::Scope::updateActiveStyleSheets):
3096
3097 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
3098
3099         Include CoreGraphics.h from WebCorePrefix.h
3100         https://bugs.webkit.org/show_bug.cgi?id=192557
3101
3102         Reviewed by Tim Horton.
3103
3104         The theory is that this will improve build time. Let's try and see what bots say.
3105
3106         * WebCorePrefix.h:
3107
3108 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3109
3110         [iOS] Unable to upload data that conforms to "public.item" but not "public.content"
3111         https://bugs.webkit.org/show_bug.cgi?id=192555
3112         <rdar://problem/35204990>
3113
3114         Reviewed by Tim Horton.
3115
3116         Add support for uploading content that conforms to "public.item" via drag and drop. Currently, iOS WebKit only
3117         supports data that conforms to "public.content", but there exist several types of files that conform to
3118         "public.item" but not "public.content". See below for more detail.
3119
3120         Test: DragAndDropTests.ExternalSourcePKCS12ToSingleFileInput
3121
3122         * platform/ios/PasteboardIOS.mm:
3123         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
3124
3125         Update this to include "public.item", and remove "public.folder", which is now redundant because "public.folder"
3126         conforms to "public.item".
3127
3128         * platform/ios/WebItemProviderPasteboard.mm:
3129         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
3130
3131         Pull out the "contains content that is supported for file uploads" part of this helper method into a separate
3132         method, and use it within `-web_containsFileURLAndFileUploadContent`. Note that this prevents "public.url"-
3133         conformant data from being uploaded as files (i.e., we never want to upload a URL string *itself* as a file).
3134         Drawing this distinction ensures that we don't confuse item providers that contain just a URL as files when
3135         dropping into a file upload area or file input (see API test: ExternalSourceZIPArchiveAndURLToSingleFileInput
3136         for an example of this corner case).
3137
3138         (-[NSItemProvider web_containsFileUploadContent]):
3139         (-[WebItemProviderPasteboard numberOfFiles]):
3140
3141         Refactor this to use `-web_containsFileUploadContent`.
3142
3143 2018-12-10  Chris Dumez  <cdumez@apple.com>
3144
3145         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
3146         https://bugs.webkit.org/show_bug.cgi?id=192509
3147         <rdar://problem/46500832>
3148
3149         Reviewed by Alex Christensen.
3150
3151         * loader/DocumentLoader.h:
3152         (WebCore::DocumentLoader::setCustomUserAgent):
3153         (WebCore::DocumentLoader::customUserAgent const):
3154         * loader/FrameLoader.cpp:
3155         (WebCore::FrameLoader::userAgent const):
3156
3157 2018-12-10  Adrian Perez de Castro  <aperez@igalia.com>
3158
3159         [GLib] FileSystem::moveFile() should fall back to copying
3160         https://bugs.webkit.org/show_bug.cgi?id=192562
3161
3162         Reviewed by Michael Catanzaro.
3163
3164         No new tests needed.
3165
3166         * platform/glib/FileSystemGlib.cpp:
3167         (WebCore::FileSystem::moveFile): Use g_file_move() instead of a plain g_rename(), which
3168         provides a fall-back which does copy+delete when a direct move or rename cannot be done.
3169
3170 2018-12-10  Simon Fraser  <simon.fraser@apple.com>
3171
3172         Allow control over child order when adding nodes to the scrolling tree
3173         https://bugs.webkit.org/show_bug.cgi?id=176914
3174         <rdar://problem/46542237>
3175         
3176         Re-land r239010 after over-zealous rollout.
3177
3178         * page/scrolling/AsyncScrollingCoordinator.cpp:
3179         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
3180         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
3181         * page/scrolling/AsyncScrollingCoordinator.h:
3182         * page/scrolling/ScrollingCoordinator.h:
3183         (WebCore::ScrollingCoordinator::attachToStateTree):
3184         * page/scrolling/ScrollingStateNode.cpp:
3185         (WebCore::ScrollingStateNode::insertChild):
3186         (WebCore::ScrollingStateNode::indexOfChild const):
3187         * page/scrolling/ScrollingStateNode.h:
3188         * page/scrolling/ScrollingStateTree.cpp:
3189         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
3190         (WebCore::ScrollingStateTree::attachNode):
3191         * page/scrolling/ScrollingStateTree.h:
3192
3193 2018-12-10  Antti Koivisto  <antti@apple.com>
3194
3195         Document should throttle style recalc even when m_pendingStyleRecalcShouldForce is true.
3196         https://bugs.webkit.org/show_bug.cgi?id=191695
3197
3198         Reviewed by Zalan Bujtas.
3199
3200         * dom/Document.cpp:
3201         (WebCore::Document::scheduleStyleRecalc):
3202
3203         Don't test for m_pendingStyleRecalcShouldForce.
3204
3205         (WebCore::Document::hasPendingStyleRecalc const):
3206         (WebCore::Document::hasPendingForcedStyleRecalc const):
3207
3208         Don't base the pending status of these function on whether the timer is running.
3209         Instead check if the style is invalid.
3210
3211 2018-12-10  Rob Buis  <rbuis@igalia.com>
3212
3213         XMLHttpRequest removes spaces from content-types before processing
3214         https://bugs.webkit.org/show_bug.cgi?id=8644
3215
3216         Reviewed by Chris Dumez.
3217
3218         Stop trimming white space characters from the middle of
3219         type/subtype value. Also make sure whitespace being parsed
3220         adheres to OWS definition from RFC 7230 Section 3.2.3
3221         (referenced by RFC 7231), i.e. space or HT.
3222
3223         Based on http://crrev.com/416586.
3224
3225         Behavior matches Firefox and Chrome.
3226
3227         Tests: http/tests/xmlhttprequest/supported-xml-content-types.html
3228                web-platform-tests/mimesniff/mime-types/parsing.any.html
3229                web-platform-tests/mimesniff/mime-types/parsing.any.worker.html
3230
3231         * platform/network/HTTPParsers.cpp:
3232         (WebCore::extractMIMETypeFromMediaType):
3233
3234 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3235
3236         [iOS] Caret is obscured by finger when dragging over an editable element
3237         https://bugs.webkit.org/show_bug.cgi?id=192499
3238         <rdar://problem/46570101>
3239
3240         Reviewed by Tim Horton.
3241
3242         * page/DragActions.h:
3243
3244         Move DragHandlingMethod to DragActions.h, and drive-by fix some minor issues (i.e. make a couple of enum classes
3245         use 8 bits, fix the indentation levels, and update the copyright year). Also add `EnumTraits` for
3246         DragHandlingMethod so that it may be encoded over IPC.
3247
3248         * page/DragController.cpp:
3249         (WebCore::dragIsHandledByDocument):
3250
3251         Simplify this helper function.
3252
3253         (WebCore::DragController::tryDocumentDrag):
3254         * page/DragController.h:
3255
3256         Expose the current DragHandlingMethod via a const getter method.
3257
3258         (WebCore::DragController::dragHandlingMethod const):
3259
3260 2018-12-10  Youenn Fablet  <youenn@apple.com>
3261
3262         Make mock capture happen in the process used for real capture
3263         https://bugs.webkit.org/show_bug.cgi?id=192544
3264
3265         Reviewed by Eric Carlson.
3266
3267         MockRealtimeMediaSourceCenter previously was setting its factories whenever mock capture is on.
3268         Add booleans to choose which source (audio, video, display) will actually be toggled on.
3269
3270         Covered by existing tests.
3271
3272         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3273         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
3274         * platform/mock/MockRealtimeMediaSourceCenter.h:
3275         (WebCore::MockRealtimeMediaSourceCenter::setMockAudioCaptureEnabled):
3276         (WebCore::MockRealtimeMediaSourceCenter::setMockVideoCaptureEnabled):
3277         (WebCore::MockRealtimeMediaSourceCenter::setMockDisplayCaptureEnabled):
3278
3279 2018-12-10  Dean Jackson  <dino@apple.com>
3280
3281         Use text/javascript as recommended by the HTML specification
3282         https://bugs.webkit.org/show_bug.cgi?id=192525
3283         <rdar://problem/46569636>
3284
3285         Reviewed by Jon Lee.
3286
3287         The HTML specification says we should use text/javascript for
3288         JavaScript files:
3289         https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type
3290
3291         * loader/cache/CachedScript.cpp: Replace application/javascript with text/javascript.
3292         (WebCore::CachedScript::CachedScript):
3293         * platform/network/ios/WebCoreURLResponseIOS.mm: Ditto.
3294         (WebCore::createExtensionToMIMETypeMap):
3295         * platform/network/mac/WebCoreURLResponse.mm: Ditto.
3296         (WebCore::createExtensionToMIMETypeMap):
3297
3298 2018-12-10  Dean Jackson  <dino@apple.com>
3299
3300         [iOS] Make WebGPU work with remote layer hosting
3301         https://bugs.webkit.org/show_bug.cgi?id=192508
3302         <rdar://problem/46560649>
3303
3304         Reviewed by Tim Horton.
3305
3306         WebGPU wasn't working on iOS because we were not correctly
3307         identifying the CALayers for remote hosting. Fix this by
3308         adding a new CALayer type, WebGPULayer. This will also
3309         eventually hold the code to render WebGPU into a canvas.
3310
3311         Covered by the existing reference tests (on device).
3312
3313         * SourcesCocoa.txt: Add new files.
3314         * WebCore.xcodeproj/project.pbxproj: Ditto.
3315
3316         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer
3317         class for remote hosting.
3318         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
3319         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
3320
3321         * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance
3322         from CAMetalLayer.
3323         * platform/graphics/cocoa/WebGPULayer.mm: Added.
3324         (-[WebGPULayer init]):
3325         (-[WebGPULayer copyImageSnapshotWithColorSpace:]):
3326
3327         * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather
3328         than CALayer.
3329
3330         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that
3331         the WebGPULayer has a reference back to this object, which it
3332         will use in the future.
3333         (WebCore::GPUSwapChain::create):
3334         (WebCore::GPUSwapChain::GPUSwapChain):
3335
3336 2018-12-10  Truitt Savell  <tsavell@apple.com>
3337
3338         Unreviewed, rolling out r238965.
3339
3340         Caused internal iOS build failures
3341
3342         Reverted changeset:
3343
3344         "[iOS] Make WebGPU work with remote layer hosting"
3345         https://bugs.webkit.org/show_bug.cgi?id=192508
3346         https://trac.webkit.org/changeset/238965
3347
3348 2018-12-10  Youenn Fablet  <youenn@apple.com>
3349
3350         MockLibWebRTCPeerConnectionFactory should isolate copy its test case
3351         https://bugs.webkit.org/show_bug.cgi?id=192545
3352
3353         Reviewed by Eric Carlson.
3354
3355         Isolate copy the test case member so that it can be destroyed on another thread.
3356         Covered by existing test that should no longer crash.
3357
3358         * testing/MockLibWebRTCPeerConnection.cpp:
3359         (WebCore::useMockRTCPeerConnectionFactory):
3360         (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
3361         * testing/MockLibWebRTCPeerConnection.h:
3362         (WebCore::MockLibWebRTCPeerConnectionFactory::create):
3363
3364 2018-12-09  Youenn Fablet  <youenn@apple.com>
3365
3366         Move capture manager from RealtimeMediaSourceCenter to capture factory
3367         https://bugs.webkit.org/show_bug.cgi?id=192542
3368
3369         Reviewed by Eric Carlson.
3370
3371         We should be able to run mock captures in wither UIProcess or WebProcess.
3372         Currently, mock capture is only done in WebProcess.
3373         This patch is a first step towards that goal.
3374
3375         It also simplifies RealtimeMediaSourceCenter implementation by starting to remove virtual methods.
3376         Further refactoring will remove the need to subclass RealtimeMediaSourceCenter.
3377         Instead, remaining virtual methods will become non virtual and their
3378         implementation will become port specific.
3379
3380         Removed a JS internal method that is not longer used to further simplify RealtimeMediaSourceCenter.
3381
3382         No visible change of behavior.
3383         Covered by existing tests.
3384
3385         * platform/mediastream/CaptureDeviceManager.h:
3386         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
3387         (WebCore::RealtimeMediaSourceCenter::singleton):
3388         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
3389   &nbs