Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-02  David Kilzer  <ddkilzer@apple.com>
2
3         Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
4         <https://webkit.org/b/193016>
5         <rdar://problem/46925703>
6
7         Reviewed by Simon Fraser.
8
9         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
10         (WebCore::copySampleBufferWithCurrentTimeStamp):
11         - Change to return RetainPtr<CMSampleBufferRef>.
12         - Check return value of CMSampleBufferCreateCopyWithNewTiming().
13         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
14         - Check return value of copySampleBufferWithCurrentTimeStamp().
15         - Fix leak by using RetainPtr<CMSampleBufferRef> returned from
16           copySampleBufferWithCurrentTimeStamp() instead of leaking
17           `bufferWithCurrentTime` by using retainPtr().
18         (WebCore::createAudioFormatDescription):
19         - Extract method from appendAudioSampleBuffer() to return
20           RetainPtr<CMFormatDescriptionRef> after calling
21           CMAudioFormatDescriptionCreate().
22         - Check return value of CMAudioFormatDescriptionCreate().
23         (WebCore::createAudioSampleBufferWithPacketDescriptions):
24         - Extract method from appendAudioSampleBuffer() to return
25           RetainPtr<CMSampleBufferRef> after calling
26           CMAudioSampleBufferCreateWithPacketDescriptions().
27         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
28         - Check return values of createAudioFormatDescription() and
29           createAudioSampleBufferWithPacketDescriptions().
30         - Fix leaks by extracting code into helper methods that return
31           RetainPtr<> objects instead of leaking CMFormatDescriptionRef
32           directly or leaking `sampleBuffer` by using retainPtr().
33
34 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
35
36         Add support for using the current text selection as the find string on iOS
37         https://bugs.webkit.org/show_bug.cgi?id=193034
38         <rdar://problem/45138739>
39
40         Reviewed by Tim Horton.
41
42         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
43         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
44         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
45         able to trigger find-in-page with this string.
46
47         Test: WebKit.UseSelectionAsFindString
48
49         * editing/Editor.cpp:
50         (WebCore::Editor::canCopyExcludingStandaloneImages const):
51
52         Make this helper function cross-platform.
53
54         * editing/Editor.h:
55         * editing/EditorCommand.cpp:
56         (WebCore::createCommandMap):
57         * editing/cocoa/EditorCocoa.mm:
58         (WebCore::Editor::takeFindStringFromSelection):
59
60         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
61         find string (see WebKit/ChangeLog for more details).
62
63         * editing/mac/EditorMac.mm:
64         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
65         (WebCore::Editor::takeFindStringFromSelection): Deleted.
66         * loader/EmptyClients.cpp:
67         * page/EditorClient.h:
68
69         Add a new editor client method to send the string for find-in-page to the UI process.
70
71 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
72
73         Web Inspector: Implement `queryObjects` Command Line API
74         https://bugs.webkit.org/show_bug.cgi?id=176766
75         <rdar://problem/34890689>
76
77         Reviewed by Joseph Pecoraro.
78
79         Test: inspector/console/queryObjects.html
80
81         * inspector/CommandLineAPIModuleSource.js:
82         (CommandLineAPI):
83         (CommandLineAPIImpl.prototype.queryObjects): Added.
84
85 2019-01-02  Charles Vazac  <cvazac@gmail.com>
86
87         Fix resourcetimingbufferfull bubbles attribute
88         https://bugs.webkit.org/show_bug.cgi?id=193087
89
90         Reviewed by Chris Dumez.
91
92         This change is covered by web-platform-tests [1].
93
94         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
95
96         * page/Performance.cpp:
97         (WebCore::Performance::resourceTimingBufferFullTimerFired):
98
99 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
100
101         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
102         https://bugs.webkit.org/show_bug.cgi?id=193010
103
104         Reviewed by Zalan Bujtas.
105
106         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
107         and make it an enum class.
108
109         * page/FrameView.cpp:
110         (WebCore::FrameView::scrollLayerID const):
111         * rendering/RenderLayer.h:
112         * rendering/RenderLayerBacking.cpp:
113         (WebCore::RenderLayerBacking::~RenderLayerBacking):
114         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
115         (WebCore::operator<<):
116         * rendering/RenderLayerBacking.h:
117         * rendering/RenderLayerCompositor.cpp:
118         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
119         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
120         (WebCore::scrollCoordinationRoleForNodeType):
121         (WebCore::RenderLayerCompositor::attachScrollingNode):
122         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
123         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
124         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
125         * rendering/RenderLayerCompositor.h:
126
127 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
128
129         Don't spin up a CalcParser if the current token is not a function token
130         https://bugs.webkit.org/show_bug.cgi?id=193067
131
132         Reviewed by Zalan Bujtas.
133
134         Various functions in CSSPropertyParserHelpers fall back to trying to parse
135         a calc expression if the normal parsing fails. Don't do this unless the
136         current token is a function token, which should be slightly more efficient.
137
138         * css/parser/CSSPropertyParserHelpers.cpp:
139         (WebCore::CSSPropertyParserHelpers::consumeInteger):
140         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
141         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
142         (WebCore::CSSPropertyParserHelpers::consumeNumber):
143         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
144         (WebCore::CSSPropertyParserHelpers::consumeLength):
145         (WebCore::CSSPropertyParserHelpers::consumePercent):
146         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
147         (WebCore::CSSPropertyParserHelpers::consumeAngle):
148         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
149         (WebCore::CSSPropertyParserHelpers::consumeTime):
150
151 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
152
153         Support css-color-4 rgb functions
154         https://bugs.webkit.org/show_bug.cgi?id=192321
155
156         Reviewed by Zalan Bujtas.
157         
158         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
159         The differences are:
160         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
161             rgb(128 34 56)
162             rgb(128 34 56 / 50%)
163         2. Floating point values are allowed, and rounded:
164             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
165         3. rgba() is a pure alias for rgb(), so these are equivalent:
166             rgb(128 34 56 / 50%)
167             rgba(128 34 56 / 50%)
168             
169         hsl()/hsla() parsing was already updated to this new syntax in r230861.
170
171         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
172
173         * css/parser/CSSPropertyParserHelpers.cpp:
174         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
175         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
176         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
177
178 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
179
180         Handle calc() expressions in gradient color stops
181         https://bugs.webkit.org/show_bug.cgi?id=193066
182         rdar://problem/46961985
183
184         Reviewed by Sam Weinig.
185         
186         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
187         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
188         calc values as well as angle ones.
189
190         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
191         just as isPx() etc do.
192
193         Test: fast/gradients/conic-calc-stop-position.html
194
195         * css/CSSPrimitiveValue.h:
196         (WebCore::CSSPrimitiveValue::isAngle const):
197         * css/parser/CSSPropertyParserHelpers.cpp:
198         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
199         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
200
201 2018-12-31  Keith Miller  <keith_miller@apple.com>
202
203         SourceProviders should use an actual URL instead of a string
204         https://bugs.webkit.org/show_bug.cgi?id=192734
205
206         Reviewed by Yusuke Suzuki.
207
208         Remove ScriptSourceCode's URL member and make the url() method
209         reference the URL on the SourceProvider. Also, avoid some
210         ref count churn.
211
212         Additionally, this patch fixes an existing bug in
213         WorkletGlobalScope() that would use a ScriptSourceCode after
214         WTFMoving it.
215
216         * bindings/js/CachedScriptSourceProvider.h:
217         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
218         * bindings/js/ScheduledAction.cpp:
219         (WebCore::ScheduledAction::execute):
220         * bindings/js/ScriptController.cpp:
221         (WebCore::ScriptController::executeScriptInWorld):
222         (WebCore::ScriptController::executeScript):
223         * bindings/js/ScriptSourceCode.h:
224         (WebCore::ScriptSourceCode::ScriptSourceCode):
225         (WebCore::ScriptSourceCode::m_code):
226         (WebCore::ScriptSourceCode::url const):
227         (WebCore::ScriptSourceCode::m_url): Deleted.
228         * dom/ScriptElement.cpp:
229         (WebCore::ScriptElement::prepareScript):
230         (WebCore::ScriptElement::requestModuleScript):
231         (WebCore::ScriptElement::executePendingScript):
232         * html/HTMLMediaElement.cpp:
233         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
234         * page/Frame.cpp:
235         (WebCore::Frame::injectUserScriptImmediately):
236         * workers/WorkerGlobalScope.cpp:
237         (WebCore::WorkerGlobalScope::importScripts):
238         * workers/WorkerThread.cpp:
239         (WebCore::WorkerThread::workerThread):
240         * worklets/WorkletGlobalScope.cpp:
241         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
242         * xml/parser/XMLDocumentParserLibxml2.cpp:
243         (WebCore::XMLDocumentParser::endElementNs):
244
245 2019-01-01  Jeff Miller  <jeffm@apple.com>
246
247         Update user-visible copyright strings to include 2019
248         https://bugs.webkit.org/show_bug.cgi?id=192811
249
250         Reviewed by Mark Lam.
251
252         * Info.plist:
253
254 2018-12-30  David Kilzer  <ddkilzer@apple.com>
255
256         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
257         <https://webkit.org/b/193058>
258         <rdar://problem/46979275>
259
260         Reviewed by Yusuke Suzuki.
261
262         * rendering/BorderEdge.cpp:
263         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
264         match new instance variable order.
265         * rendering/BorderEdge.h: Reorder instance variables to save
266         8 padding bytes.
267
268 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
269
270         [JSC] Remove one indirection in JSObject::toStringName
271         https://bugs.webkit.org/show_bug.cgi?id=193037
272
273         Reviewed by Keith Miller.
274
275         Use old JSObject::toStringName function here.
276
277         * bindings/js/JSDOMConstructorBase.cpp:
278         (WebCore::JSDOMConstructorBase::className):
279         (WebCore::JSDOMConstructorBase::toStringName):
280         * bindings/js/JSDOMConstructorBase.h:
281         (WebCore::JSDOMConstructorBase::className): Deleted.
282
283 2018-12-27  Alex Christensen  <achristensen@webkit.org>
284
285         Resurrect Mac CMake build
286         https://bugs.webkit.org/show_bug.cgi?id=192658
287
288         Reviewed by Yusuke Suzuki.
289
290         This makes it so JSC and most of WebCore builds.
291         WebCore's use of ARC seems inconsistent, so I'll fix that later.
292
293         * PlatformMac.cmake:
294         * config.h:
295
296 2018-12-26  Jim Mason  <jmason@ibinx.com>
297
298         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
299         https://bugs.webkit.org/show_bug.cgi?id=193036
300
301         Reviewed by Michael Catanzaro.
302
303         * platform/graphics/FontPlatformData.h:
304         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
305
306 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
307
308         Remove "using namespace std;"
309         https://bugs.webkit.org/show_bug.cgi?id=192973
310         <rdar://problem/46937309>
311
312         Unreviewed Windows port Debug builds fix.
313
314         No new tests since no behavior changes.
315
316         * accessibility/win/AXObjectCacheWin.cpp:
317         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
318
319 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
320
321         Remove "using namespace std;"
322         https://bugs.webkit.org/show_bug.cgi?id=192973
323
324         Reviewed by Alex Christensen.
325
326         Removed "using namespace std" statement, and use std:: prefix.
327
328         No new tests since no behavior changes.
329
330         * accessibility/win/AXObjectCacheWin.cpp:
331         * platform/graphics/GraphicsContext3DPrivate.cpp:
332         * platform/graphics/cairo/ImageBufferCairo.cpp:
333         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
334         * platform/graphics/win/FontWin.cpp:
335         (WebCore::FontCascade::floatWidthForComplexText const):
336         * platform/graphics/win/GraphicsContextCGWin.cpp:
337         * platform/graphics/win/GraphicsContextCairoWin.cpp:
338         * platform/graphics/win/GraphicsContextDirect2D.cpp:
339         * platform/graphics/win/GraphicsContextWin.cpp:
340         * platform/graphics/win/SimpleFontDataCGWin.cpp:
341         * platform/graphics/win/UniscribeController.cpp:
342         (WebCore::UniscribeController::UniscribeController):
343         (WebCore::UniscribeController::shapeAndPlaceItem):
344         * platform/image-decoders/ScalableImageDecoder.cpp:
345         * platform/text/LocaleICU.cpp:
346         * platform/text/win/LocaleWin.cpp:
347         * platform/win/ScrollbarThemeWin.cpp:
348         * rendering/RenderRubyRun.cpp:
349         (WebCore::RenderRubyRun::layoutBlock):
350         * rendering/RenderThemeWin.cpp:
351         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
352         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
353         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
354         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
355         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
356         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
357         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
358
359 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
360
361         Change ScrollingNodeType to an enum class
362         https://bugs.webkit.org/show_bug.cgi?id=193009
363
364         Reviewed by Zalan Bujtas.
365
366         Change the ScrollingNodeType enum to an enum class.
367         
368         No behavior change.
369
370         * page/scrolling/AsyncScrollingCoordinator.cpp:
371         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
372         * page/scrolling/ScrollingCoordinator.cpp:
373         (WebCore::operator<<):
374         * page/scrolling/ScrollingCoordinator.h:
375         * page/scrolling/ScrollingStateFixedNode.cpp:
376         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
377         * page/scrolling/ScrollingStateNode.h:
378         (WebCore::ScrollingStateNode::isFixedNode const):
379         (WebCore::ScrollingStateNode::isStickyNode const):
380         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
381         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
382         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
383         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
384         * page/scrolling/ScrollingStateStickyNode.cpp:
385         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
386         * page/scrolling/ScrollingStateTree.cpp:
387         (WebCore::ScrollingStateTree::createNode):
388         (WebCore::ScrollingStateTree::attachNode):
389         * page/scrolling/ScrollingTreeNode.h:
390         (WebCore::ScrollingTreeNode::isFixedNode const):
391         (WebCore::ScrollingTreeNode::isStickyNode const):
392         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
393         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
394         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
395         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
396         * page/scrolling/ios/ScrollingTreeIOS.cpp:
397         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
398         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
399         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
400         * page/scrolling/mac/ScrollingTreeMac.cpp:
401         (ScrollingTreeMac::createScrollingTreeNode):
402         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
403         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
404         * platform/graphics/GraphicsLayerClient.h:
405         * rendering/RenderLayerCompositor.cpp:
406         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
407         (WebCore::scrollCoordinationRoleForNodeType):
408         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
409         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
410
411 2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
412
413         [HarfBuzz] Width not correctly reported as 0 for zero font size
414         https://bugs.webkit.org/show_bug.cgi?id=192986
415
416         Reviewed by Michael Catanzaro.
417
418         Fixes test fast/text/font-size-zero.html
419
420         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
421         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
422         size is zero.
423
424 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
425
426         Use Ref<> as much as possible
427         https://bugs.webkit.org/show_bug.cgi?id=192808
428
429         Reviewed by Alex Christensen.
430
431         * Modules/encryptedmedia/NavigatorEME.cpp:
432         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
433         * Modules/fetch/FetchBody.cpp:
434         (WebCore::FetchBody::bodyAsFormData const):
435         * Modules/geolocation/Geolocation.cpp:
436         (WebCore::Geolocation::getCurrentPosition):
437         (WebCore::Geolocation::watchPosition):
438         * Modules/indexeddb/IDBDatabase.cpp:
439         (WebCore::IDBDatabase::objectStoreNames const):
440         * Modules/indexeddb/IDBDatabase.h:
441         * Modules/indexeddb/IDBObjectStore.cpp:
442         (WebCore::IDBObjectStore::indexNames const):
443         * Modules/indexeddb/IDBObjectStore.h:
444         * Modules/indexeddb/IDBTransaction.cpp:
445         (WebCore::IDBTransaction::scheduleOperation):
446         * Modules/indexeddb/IDBTransaction.h:
447         * Modules/indexeddb/client/TransactionOperation.h:
448         (WebCore::IDBClient::createTransactionOperation):
449         * Modules/mediastream/MediaDevices.cpp:
450         (WebCore::MediaDevices::getUserMedia const):
451         (WebCore::MediaDevices::getDisplayMedia const):
452         * Modules/mediastream/UserMediaRequest.cpp:
453         (WebCore::UserMediaRequest::create):
454         * Modules/mediastream/UserMediaRequest.h:
455         * Modules/webaudio/AudioParam.cpp:
456         (WebCore::AudioParam::calculateFinalValues):
457         * Modules/webaudio/ScriptProcessorNode.cpp:
458         (WebCore::ScriptProcessorNode::initialize):
459         * Modules/webdatabase/SQLStatement.cpp:
460         (WebCore::SQLStatement::execute):
461         * Modules/webgpu/WebGPU.cpp:
462         (WebCore::WebGPU::requestAdapter const):
463         * Modules/webgpu/WebGPUAdapter.cpp:
464         (WebCore::WebGPUAdapter::create):
465         * Modules/webgpu/WebGPUAdapter.h:
466         * Modules/webgpu/WebGPUBuffer.cpp:
467         (WebCore::WebGPUBuffer::create):
468         * Modules/webgpu/WebGPUBuffer.h:
469         * Modules/webgpu/WebGPUCommandBuffer.cpp:
470         (WebCore::WebGPUCommandBuffer::create):
471         (WebCore::WebGPUCommandBuffer::beginRenderPass):
472         * Modules/webgpu/WebGPUCommandBuffer.h:
473         * Modules/webgpu/WebGPUDevice.cpp:
474         (WebCore::WebGPUDevice::create):
475         (WebCore::WebGPUDevice::createBuffer const):
476         (WebCore::WebGPUDevice::createShaderModule const):
477         (WebCore::WebGPUDevice::createRenderPipeline const):
478         (WebCore::WebGPUDevice::createCommandBuffer const):
479         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
480         (WebCore::WebGPURenderPassEncoder::create):
481         * Modules/webgpu/WebGPURenderPassEncoder.h:
482         * Modules/webgpu/WebGPURenderPipeline.cpp:
483         (WebCore::WebGPURenderPipeline::create):
484         * Modules/webgpu/WebGPURenderPipeline.h:
485         * Modules/webgpu/WebGPUShaderModule.cpp:
486         (WebCore::WebGPUShaderModule::create):
487         * Modules/webgpu/WebGPUShaderModule.h:
488         * Modules/webgpu/WebGPUTexture.cpp:
489         (WebCore::WebGPUTexture::createDefaultTextureView):
490         * Modules/webgpu/WebGPUTextureView.cpp:
491         (WebCore::WebGPUTextureView::create):
492         * Modules/webgpu/WebGPUTextureView.h:
493         * accessibility/AXObjectCache.cpp:
494         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
495         * accessibility/atk/AXObjectCacheAtk.cpp:
496         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
497         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
498         (webkitAccessibleHyperlinkGetStartIndex):
499         (webkitAccessibleHyperlinkGetEndIndex):
500         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
501         (getSelectionOffsetsForObject):
502         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
503         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
504         * bindings/js/JSDOMGlobalObjectTask.cpp:
505         * bindings/js/JSDOMWindowBase.cpp:
506         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
507         * bindings/js/JSWorkerGlobalScopeBase.cpp:
508         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
509         * bindings/js/ScriptControllerMac.mm:
510         (WebCore::ScriptController::createScriptInstanceForWidget):
511         * bindings/js/SerializedScriptValue.cpp:
512         (WebCore::CloneDeserializer::readTerminal):
513         (WebCore::SerializedScriptValue::create):
514         * bridge/objc/objc_instance.h:
515         * bridge/objc/objc_instance.mm:
516         (ObjcInstance::create):
517         * css/CSSComputedStyleDeclaration.cpp:
518         (WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
519         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
520         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
521         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
522         * css/CSSComputedStyleDeclaration.h:
523         * css/CSSFontFaceSource.cpp:
524         (WebCore::CSSFontFaceSource::load):
525         * css/CSSStyleSheet.cpp:
526         (WebCore::CSSStyleSheet::rules):
527         * css/FontFace.cpp:
528         (WebCore::FontFace::unicodeRange const):
529         (WebCore::FontFace::featureSettings const):
530         * css/InspectorCSSOMWrappers.cpp:
531         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
532         * css/SVGCSSComputedStyleDeclaration.cpp:
533         (WebCore::strokeDashArrayToCSSValueList):
534         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
535         * css/StyleResolver.cpp:
536         (WebCore::StyleResolver::createFilterOperations):
537         * css/StyleRule.cpp:
538         (WebCore::StyleRuleBase::createCSSOMWrapper const):
539         * css/StyleRule.h:
540         * dom/ChildListMutationScope.cpp:
541         (WebCore::ChildListMutationAccumulator::getOrCreate):
542         * dom/ChildListMutationScope.h:
543         * dom/DocumentMarkerController.cpp:
544         (WebCore::updateRenderedRectsForMarker):
545         * dom/InlineStyleSheetOwner.cpp:
546         (WebCore::InlineStyleSheetOwner::createSheet):
547         * dom/PointerEvent.h:
548         * dom/UserGestureIndicator.h:
549         (WebCore::UserGestureToken::create):
550         * editing/AlternativeTextController.cpp:
551         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
552         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
553         (WebCore::AlternativeTextController::respondToUnappliedEditing):
554         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
555         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
556         * editing/ApplyStyleCommand.cpp:
557         (WebCore::ApplyStyleCommand::applyBlockStyle):
558         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
559         * editing/CompositeEditCommand.cpp:
560         (WebCore::CompositeEditCommand::targetRanges const):
561         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
562         (WebCore::CompositeEditCommand::moveParagraphs):
563         * editing/DeleteSelectionCommand.cpp:
564         (WebCore::DeleteSelectionCommand::mergeParagraphs):
565         * editing/Editing.cpp:
566         (WebCore::visiblePositionForIndexUsingCharacterIterator):
567         * editing/EditingStyle.cpp:
568         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
569         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
570         (WebCore::EditingStyle::prepareToApplyAt):
571         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
572         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
573         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
574         (WebCore::extractPropertiesNotIn):
575         * editing/Editor.cpp:
576         (WebCore::Editor::setBaseWritingDirection):
577         (WebCore::Editor::setComposition):
578         * editing/EditorCommand.cpp:
579         (WebCore::executeApplyParagraphStyle):
580         (WebCore::executeMakeTextWritingDirectionLeftToRight):
581         (WebCore::executeMakeTextWritingDirectionNatural):
582         (WebCore::executeMakeTextWritingDirectionRightToLeft):
583         * editing/FormatBlockCommand.cpp:
584         (WebCore::FormatBlockCommand::formatRange):
585         * editing/RemoveFormatCommand.cpp:
586         (WebCore::RemoveFormatCommand::doApply):
587         * editing/ReplaceRangeWithTextCommand.cpp:
588         (WebCore::ReplaceRangeWithTextCommand::targetRanges const):
589         * editing/ReplaceSelectionCommand.cpp:
590         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
591         (WebCore::handleStyleSpansBeforeInsertion):
592         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
593         * editing/SpellingCorrectionCommand.cpp:
594         (WebCore::SpellingCorrectionCommand::targetRanges const):
595         * editing/TextCheckingHelper.cpp:
596         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
597         * editing/TypingCommand.cpp:
598         (WebCore::TypingCommand::insertText):
599         (WebCore::TypingCommand::willAddTypingToOpenCommand):
600         * editing/VisibleUnits.cpp:
601         (WebCore::distanceBetweenPositions):
602         * editing/cocoa/EditorCocoa.mm:
603         (WebCore::Editor::selectionInWebArchiveFormat):
604         * editing/ios/DictationCommandIOS.cpp:
605         (WebCore::DictationCommandIOS::doApply):
606         * editing/ios/EditorIOS.mm:
607         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
608         (WebCore::Editor::removeUnchangeableStyles):
609         (WebCore::Editor::writeImageToPasteboard):
610         * editing/mac/EditorMac.mm:
611         (WebCore::Editor::replaceNodeFromPasteboard):
612         (WebCore::Editor::imageInWebArchiveFormat):
613         * editing/markup.cpp:
614         (WebCore::styleFromMatchedRulesAndInlineDecl):
615         (WebCore::createFragmentForTransformToFragment):
616         * fileapi/FileReaderLoader.cpp:
617         (WebCore::FileReaderLoader::didFinishLoading):
618         * html/FTPDirectoryDocument.cpp:
619         (WebCore::createTemplateDocumentData):
620         * html/HTMLMediaElement.cpp:
621         (WebCore::HTMLMediaElement::scheduleEvent):
622         (WebCore::HTMLMediaElement::createMediaControls):
623         * html/HTMLTableElement.cpp:
624         (WebCore::HTMLTableElement::createSharedCellStyle):
625         * html/HTMLTableElement.h:
626         * html/URLUtils.h:
627         (WebCore::URLUtils<T>::origin const):
628         * html/parser/HTMLConstructionSite.cpp:
629         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
630         * html/shadow/TextControlInnerElements.cpp:
631         (WebCore::TextControlInnerElement::resolveCustomStyle):
632         * html/track/WebVTTParser.cpp:
633         (WebCore::WebVTTParser::createNewCue):
634         * inspector/DOMPatchSupport.cpp:
635         * inspector/InspectorCanvas.cpp:
636         (WebCore::InspectorCanvas::buildInitialState):
637         (WebCore::InspectorCanvas::buildAction):
638         * inspector/InspectorFrontendClientLocal.cpp:
639         (WebCore::InspectorFrontendClientLocal::openInNewTab):
640         * inspector/InspectorStyleSheet.cpp:
641         (WebCore::asCSSRuleList):
642         (WebCore::InspectorStyle::styleWithProperties const):
643         (WebCore::InspectorStyleSheet::ensureSourceData):
644         * inspector/agents/InspectorCanvasAgent.cpp:
645         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
646         * inspector/agents/InspectorIndexedDBAgent.cpp:
647         (WebCore::Inspector::keyPathFromIDBKeyPath):
648         * inspector/agents/InspectorPageAgent.cpp:
649         (WebCore::InspectorPageAgent::archive):
650         * loader/EmptyClients.cpp:
651         (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
652         (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
653         (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
654         (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
655         * loader/FrameLoader.cpp:
656         (WebCore::FrameLoader::loadURL):
657         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
658         (WebCore::FrameLoader::loadDifferentDocumentItem):
659         * loader/WorkerThreadableLoader.cpp:
660         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
661         * loader/archive/mhtml/MHTMLParser.cpp:
662         (WebCore::MHTMLParser::addResourceToArchive):
663         (WebCore::MHTMLParser::parseNextPart):
664         * loader/cache/MemoryCache.cpp:
665         (WebCore::MemoryCache::addImageToCache):
666         (WebCore::MemoryCache::removeResourcesWithOrigin):
667         * page/DOMWindow.cpp:
668         (WebCore::DOMWindow::getMatchedCSSRules const):
669         (WebCore::DOMWindow::createWindow):
670         * page/EventHandler.cpp:
671         (WebCore::textDistance):
672         * page/Page.cpp:
673         (WebCore::Page::userStyleSheet const):
674         * page/animation/CSSPropertyAnimation.cpp:
675         (WebCore::blendFilterOperations):
676         * page/ios/FrameIOS.mm:
677         (WebCore::Frame::initWithSimpleHTMLDocument):
678         (WebCore::Frame::interpretationsForCurrentRoot const):
679         * page/mac/ServicesOverlayController.mm:
680         (WebCore::ServicesOverlayController::Highlight::fadeIn):
681         (WebCore::ServicesOverlayController::Highlight::fadeOut):
682         * platform/SharedBuffer.cpp:
683         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
684         * platform/audio/HRTFElevation.cpp:
685         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
686         * platform/audio/SincResampler.cpp:
687         (WebCore::SincResampler::consumeSource):
688         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
689         (WebCore::AudioFileReader::createBus):
690         * platform/audio/mac/AudioFileReaderMac.cpp:
691         (WebCore::AudioFileReader::createBus):
692         * platform/graphics/Icon.h:
693         (WebCore::Icon::create):
694         * platform/graphics/InbandTextTrackPrivate.h:
695         (WebCore::InbandTextTrackPrivate::create):
696         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
697         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
698         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
699         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
700         (WebCore::fulfillRequestWithKeyData):
701         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
702         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
703         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
704         (WebCore::MediaSourcePrivateAVFObjC::create):
705         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
706         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
707         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
708         (WebCore::SourceBufferPrivateAVFObjC::create):
709         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
710         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
711         * platform/graphics/ca/TileController.cpp:
712         (WebCore::TileController::createTileLayer):
713         * platform/graphics/ca/TileController.h:
714         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
715         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
716         (WebCore::CACFLayerTreeHost::create):
717         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
718         (WebCore::GPUBuffer::create):
719         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
720         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
721         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
722         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
723         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
724         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
725         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
726         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
727         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
728         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
729         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
730         (WebCore::AppendPipeline::appsinkNewSample):
731         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
732         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
733         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
734         (WebCore::ISOTrackEncryptionBox::parse):
735         * platform/graphics/texmap/TextureMapperAnimation.cpp:
736         (WebCore::applyFilterAnimation):
737         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
738         (WebCore::TextureMapperPlatformLayerBuffer::clone):
739         * platform/graphics/transforms/TransformOperations.cpp:
740         (WebCore::TransformOperations::blendByMatchingOperations const):
741         * platform/image-decoders/ico/ICOImageDecoder.cpp:
742         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
743         * platform/mock/mediasource/MockBox.cpp:
744         (WebCore::MockInitializationBox::MockInitializationBox):
745         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
746         (WebCore::MockSourceBufferPrivate::create):
747         (WebCore::MockSourceBufferPrivate::append):
748         * platform/mock/mediasource/MockSourceBufferPrivate.h:
749         * platform/mock/mediasource/MockTracks.h:
750         (WebCore::MockTextTrackPrivate::create):
751         (WebCore::MockVideoTrackPrivate::create):
752         * platform/network/FormData.h:
753         (WebCore::FormData::decode):
754         * platform/network/cocoa/CookieStorageObserver.h:
755         * platform/network/cocoa/CookieStorageObserver.mm:
756         (WebCore::CookieStorageObserver::create):
757         * platform/network/soup/ResourceRequestSoup.cpp:
758         (WebCore::appendEncodedBlobItemToSoupMessageBody):
759         (WebCore::ResourceRequest::updateSoupMessageBody const):
760         * platform/text/hyphen/HyphenationLibHyphen.cpp:
761         (WebCore::HyphenationDictionary::createNull):
762         (WebCore::HyphenationDictionary::create):
763         * platform/win/SearchPopupMenuWin.cpp:
764         (WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
765         (WebCore::SearchPopupMenuWin::popupMenu):
766         * platform/win/SearchPopupMenuWin.h:
767         * rendering/RenderThemeIOS.mm:
768         (WebCore::applyCommonButtonPaddingToStyle):
769         (WebCore::RenderThemeIOS::paintProgressBar):
770         (WebCore::RenderThemeIOS::adjustButtonStyle const):
771         (WebCore::paintAttachmentIcon):
772         * rendering/svg/SVGRenderTreeAsText.cpp:
773         (WebCore::writeSVGResourceContainer):
774         * storage/Storage.cpp:
775         (WebCore::Storage::create):
776         (WebCore::Storage::Storage):
777         * storage/Storage.h:
778         (WebCore::Storage::area const):
779         * storage/StorageNamespace.h:
780         * storage/StorageNamespaceProvider.cpp:
781         (WebCore::StorageNamespaceProvider::localStorageArea):
782         * storage/StorageNamespaceProvider.h:
783         * svg/SVGElement.cpp:
784         (WebCore::SVGElement::getPresentationAttribute):
785         * svg/SVGFEBlendElement.cpp:
786         (WebCore::SVGFEBlendElement::build):
787         * svg/SVGFEColorMatrixElement.cpp:
788         (WebCore::SVGFEColorMatrixElement::build):
789         * svg/SVGFEComponentTransferElement.cpp:
790         (WebCore::SVGFEComponentTransferElement::build):
791         * svg/SVGFECompositeElement.cpp:
792         (WebCore::SVGFECompositeElement::build):
793         * svg/SVGFEDiffuseLightingElement.cpp:
794         (WebCore::SVGFEDiffuseLightingElement::build):
795         * svg/SVGFEDisplacementMapElement.cpp:
796         (WebCore::SVGFEDisplacementMapElement::build):
797         * svg/SVGFEDropShadowElement.cpp:
798         (WebCore::SVGFEDropShadowElement::build):
799         * svg/SVGFEGaussianBlurElement.cpp:
800         (WebCore::SVGFEGaussianBlurElement::build):
801         * svg/SVGFEMergeElement.cpp:
802         (WebCore::SVGFEMergeElement::build):
803         * svg/SVGFEMorphologyElement.cpp:
804         (WebCore::SVGFEMorphologyElement::build):
805         * svg/SVGFEOffsetElement.cpp:
806         (WebCore::SVGFEOffsetElement::build):
807         * svg/SVGFESpecularLightingElement.cpp:
808         (WebCore::SVGFESpecularLightingElement::build):
809         * svg/SVGFETileElement.cpp:
810         (WebCore::SVGFETileElement::build):
811         * testing/GCObservation.h:
812         * xml/XSLTProcessor.cpp:
813         (WebCore::XSLTProcessor::createDocumentFromSource):
814         * xml/parser/XMLDocumentParser.cpp:
815         (WebCore::XMLDocumentParser::parseDocumentFragment):
816
817 2018-12-21  Chris Dumez  <cdumez@apple.com>
818
819         navigator.userAgent in service workers does not reflect customUserAgent set by client
820         https://bugs.webkit.org/show_bug.cgi?id=192951
821
822         Reviewed by Youenn Fablet.
823
824         Whenever a service worker client registers itself, also pass its effective user agent.
825         In the network process, for each origin, we store the latest client's user agent and
826         use it when starting the service worker.
827
828         * dom/Document.cpp:
829         (WebCore::Document::setServiceWorkerConnection):
830         * loader/DocumentLoader.cpp:
831         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
832         * workers/service/SWClientConnection.h:
833         * workers/service/server/SWServer.cpp:
834         (WebCore::SWServer::serviceWorkerClientUserAgent const):
835         (WebCore::SWServer::installContextData):
836         (WebCore::SWServer::runServiceWorker):
837         (WebCore::SWServer::registerServiceWorkerClient):
838         * workers/service/server/SWServer.h:
839         * workers/service/server/SWServerToContextConnection.h:
840         * workers/service/server/SWServerWorker.cpp:
841         (WebCore::SWServerWorker::userAgent const):
842         * workers/service/server/SWServerWorker.h:
843
844 2018-12-21  Youenn Fablet  <youenn@apple.com>
845
846         RTCRtpSender.setParameters() does set active parameter
847         https://bugs.webkit.org/show_bug.cgi?id=192848
848
849         Reviewed by Eric Carlson.
850
851         Covered by updated test.
852
853         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
854         (WebCore::updateRTCRtpSendParameters):
855         The routine was updating the local value, not the out parameter.
856
857 2018-12-21  Eric Carlson  <eric.carlson@apple.com>
858
859         'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
860         https://bugs.webkit.org/show_bug.cgi?id=187896
861         <rdar://problem/42681445>
862
863         Reviewed by Jer Noble.
864
865         No new tests, tested manually.
866
867         * platform/mediastream/mac/AVVideoCaptureSource.h:
868         * platform/mediastream/mac/AVVideoCaptureSource.mm:
869         (WebCore::AVVideoCaptureSource::deviceDisconnected):
870         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
871         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
872         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
873         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
874         (WebCore::deviceHasInputStreams):
875         (WebCore::isValidCaptureDevice):
876         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
877         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
878         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
879         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
880         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
881         (WebCore::CoreAudioSharedUnit::setCaptureDevice):
882         (WebCore::CoreAudioSharedUnit::devicesChanged):
883         (WebCore::CoreAudioSharedUnit::startProducingData):
884         (WebCore::CoreAudioSharedUnit::startInternal):
885         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
886         (WebCore::CoreAudioSharedUnit::captureFailed):
887         (WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
888         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
889         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
890         * platform/mediastream/mac/CoreAudioCaptureSource.h:
891
892 2018-12-20  Ryosuke Niwa  <rniwa@webkit.org>
893
894         REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
895         TestWebKitAPI.QuickLook.LegacyQuickLookContent
896         https://bugs.webkit.org/show_bug.cgi?id=192859
897         <rdar://problem/46887237>
898
899         Reviewed by Antti Koivisto.
900
901         After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
902         is inside a delegate callback even when there is a ScriptDisallowedScope defined.
903
904         Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
905         by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
906
907         Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
908
909         * dom/ContainerNodeAlgorithms.cpp:
910         (WebCore::notifyChildNodeInserted):
911         (WebCore::notifyChildNodeRemoved):
912         * dom/Document.cpp:
913         (WebCore::Document::nodeChildrenWillBeRemoved):
914         (WebCore::Document::nodeWillBeRemoved):
915         * dom/ScriptDisallowedScope.h:
916         (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
917         * html/HTMLFormElement.cpp:
918         (WebCore:: const):
919
920 2018-12-21  Joseph Pecoraro  <pecoraro@apple.com>
921
922         Update status of some WebCore features in features.json
923         https://bugs.webkit.org/show_bug.cgi?id=192998
924
925         Reviewed by Tim Horton.
926
927         * features.json:
928         - Variation Fonts: Supported
929         - Conic Gradients: Supported in Preview
930         - Web Share: Supported in Preview
931         - <datalist>: Supported in Preview
932         - Intersection Observers: Supported in Preview
933
934 2018-12-21  Zalan Bujtas  <zalan@apple.com>
935
936         [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
937         https://bugs.webkit.org/show_bug.cgi?id=192357
938         <rdar://problem/42852260>
939
940         Reviewed by Simon Fraser.
941
942         Do not try to paint the file picker when painting is disabled.
943
944         * rendering/RenderFileUploadControl.cpp:
945         (WebCore::RenderFileUploadControl::paintObject):
946
947 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
948
949         [WebAuthN] userPresence should always be true
950         https://bugs.webkit.org/show_bug.cgi?id=192835
951         <rdar://problem/46538788>
952
953         Reviewed by Brent Fulgham.
954
955         In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
956         This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
957         After discussing with other members of the working group, we decided to make userPresence always default to true.
958
959         Covered by exisiting tests.
960
961         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
962         (fido::encodeGetAssertionRequestAsCBOR):
963
964 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
965
966         [WebAuthN] Import an APDU coder from Chromium
967         https://bugs.webkit.org/show_bug.cgi?id=192949
968         <rdar://problem/46879933>
969
970         Reviewed by Brent Fulgham.
971
972         This patch imports an APDU coder from Chromium. Here is the documentation:
973         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
974         APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
975
976         Here is a list of files that are imported from Chromium:
977         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
978         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
979         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
980         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
981         https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
982
983         Covered by API tests.
984
985         * Modules/webauthn/apdu/ApduCommand.cpp: Added.
986         (apdu::ApduCommand::createFromMessage):
987         (apdu::ApduCommand::ApduCommand):
988         (apdu::ApduCommand::getEncodedCommand const):
989         * Modules/webauthn/apdu/ApduCommand.h: Added.
990         * Modules/webauthn/apdu/ApduResponse.cpp: Added.
991         (apdu::ApduResponse::createFromMessage):
992         (apdu::ApduResponse::ApduResponse):
993         (apdu::ApduResponse::getEncodedResponse const):
994         * Modules/webauthn/apdu/ApduResponse.h: Added.
995         * Sources.txt:
996         * WebCore.xcodeproj/project.pbxproj:
997
998 2018-12-21  Jer Noble  <jer.noble@apple.com>
999
1000         Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
1001         https://bugs.webkit.org/show_bug.cgi?id=192985
1002         <rdar://problem/46750743>
1003
1004         Reviewed by Eric Carlson.
1005
1006         Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
1007
1008         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
1009         (WebCore::WebKitMediaKeys::setMediaElement):
1010         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
1011         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1012         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1013         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1014         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1015         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
1016
1017 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
1018
1019         CSS variables don't work for colors in "border" property
1020         https://bugs.webkit.org/show_bug.cgi?id=192922
1021
1022         Reviewed by Simon Fraser.
1023
1024         ParseColorFunction no longer consumes anything if the color was not valid.
1025
1026         Test: css-custom-properties-api/border-variable-parsing.html
1027
1028         * css/parser/CSSPropertyParserHelpers.cpp:
1029         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
1030
1031 2018-12-21  Justin Fan  <justin_fan@apple.com>
1032
1033         [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
1034         https://bugs.webkit.org/show_bug.cgi?id=192990
1035
1036         Reviewed by Myles C. Maxfield.
1037
1038         Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
1039         Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
1040
1041         No new tests; no change in behavior.
1042
1043         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
1044         (WebCore::WebGPUBindGroupLayout::create):
1045         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
1046         * Modules/webgpu/WebGPUBindGroupLayout.h:
1047         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
1048         * Modules/webgpu/WebGPUDevice.cpp:
1049         (WebCore::WebGPUDevice::createBindGroupLayout const):
1050         * platform/graphics/gpu/GPUBindGroupLayout.h:
1051         * platform/graphics/gpu/GPUDevice.cpp:
1052         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. 
1053         (WebCore::GPUDevice::createBindGroupLayout const): Deleted.
1054         * platform/graphics/gpu/GPUDevice.h:
1055         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1056         (WebCore::appendArgumentToArray):
1057         (WebCore::newEncoder):
1058         (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
1059         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1060         (WebCore::appendArgumentToArrayInMap): Deleted.
1061         (WebCore::GPUBindGroupLayout::create): Deleted.
1062
1063         Deleted unneeded GPUBindGroupLayout.cpp:
1064         * Sources.txt:
1065         * WebCore.xcodeproj/project.pbxproj:
1066         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
1067
1068 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
1069
1070         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
1071         https://bugs.webkit.org/show_bug.cgi?id=190466
1072
1073         Reviewed by Youenn Fablet.
1074
1075         Added persistency to the DeviceIdHashSaltStorage.
1076
1077         * platform/glib/FileSystemGlib.cpp:
1078         (WebCore::FileSystem::getFileSize): Implemented this function to
1079         allow sharing code with the statistics storage class.
1080         * platform/glib/KeyedDecoderGlib.cpp:
1081         (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
1082         condition to control situations where the key is empty, it can
1083         happen if the user modifies the file in the disk.
1084         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
1085         to make work compilation with debug, unified builds.
1086
1087 2018-12-21  Zalan Bujtas  <zalan@apple.com>
1088
1089         Synchronous media query evaluation could destroy current Frame/FrameView.
1090         https://bugs.webkit.org/show_bug.cgi?id=192781
1091         <rdar://problem/34416793>
1092
1093         Reviewed by Chris Dumez.
1094
1095         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
1096
1097         Test: printing/print-with-media-query-destory.html
1098
1099         * loader/DocumentLoader.cpp:
1100         (WebCore::DocumentLoader::finishedLoading):
1101         * page/Frame.cpp:
1102         (WebCore::Frame::setPrinting):
1103         * page/FrameView.cpp:
1104         (WebCore::FrameView::forceLayoutForPagination):
1105         * page/PrintContext.cpp:
1106         (WebCore::PrintContext::PrintContext):
1107         (WebCore::PrintContext::computePageRects):
1108         (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
1109         (WebCore::PrintContext::begin):
1110         (WebCore::PrintContext::computeAutomaticScaleFactor):
1111         (WebCore::PrintContext::spoolPage):
1112         (WebCore::PrintContext::spoolRect):
1113         (WebCore::PrintContext::end):
1114         * page/PrintContext.h:
1115         (WebCore::PrintContext::frame const): Deleted.
1116
1117 2018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1118
1119         Setting the file wrapper and content type of an attachment to a PDF should update its image
1120         https://bugs.webkit.org/show_bug.cgi?id=192984
1121         <rdar://problem/46798028>
1122
1123         Reviewed by Tim Horton.
1124
1125         Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
1126         Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
1127
1128         * html/HTMLAttachmentElement.cpp:
1129         (WebCore::mimeTypeIsSuitableForInlineImageAttachment):
1130         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
1131
1132 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
1133
1134         Repeated background images with zero size should display the background color
1135         https://bugs.webkit.org/show_bug.cgi?id=192962
1136
1137         Reviewed by Antti Koivisto.
1138
1139         Test: fast/backgrounds/background-repeat-with-zero-size.html
1140
1141         * platform/LengthSize.h:
1142         (WebCore::LengthSize::isEmpty const):
1143         * rendering/RenderBoxModelObject.cpp:
1144         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1145         * rendering/style/FillLayer.h:
1146         (WebCore::FillLayer::isEmpty const):
1147
1148 2018-12-21  Manuel Rego Casasnovas  <rego@igalia.com>
1149
1150         [css-grid] Fix percentages in relative offsets for grid items
1151         https://bugs.webkit.org/show_bug.cgi?id=190492
1152
1153         Reviewed by Sergio Villar Senin.
1154
1155         The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
1156         where the containing block is the grid area.
1157         The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
1158
1159         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
1160
1161         * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
1162         (WebCore::RenderBox::overrideContainingBlockContentWidth const):
1163         (WebCore::RenderBox::overrideContainingBlockContentHeight const):
1164         (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
1165         (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
1166         * rendering/RenderBox.h:
1167         * rendering/RenderBoxModelObject.cpp:
1168         (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
1169         to take into account overrideContainingBlockContentWidth|Height for grid items.
1170         * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
1171         that will be overridden in RenderBox.
1172         (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
1173         (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
1174         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
1175         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
1176
1177 2018-12-20  Justin Fan  <justin_fan@apple.com>
1178
1179         [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
1180         https://bugs.webkit.org/show_bug.cgi?id=192956
1181
1182         Reviewed by Myles Maxfield.
1183
1184         No testable behavior change. Existing tests cover possible crashing.
1185
1186         Add GPUBindGroupLayoutMetal.mm:
1187         * SourcesCocoa.txt:
1188         * WebCore.xcodeproj/project.pbxproj:
1189
1190         Flesh out GPUBindGroupLayout::create:
1191         * platform/graphics/gpu/GPUBindGroupLayout.cpp:
1192         * platform/graphics/gpu/GPUBindGroupLayout.h:
1193         * platform/graphics/gpu/GPUDevice.cpp:
1194         (WebCore::GPUDevice::createBindGroupLayout const):
1195         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
1196         (WebCore::appendArgumentToArrayInMap): Added.
1197         (WebCore::GPUBindGroupLayout::create):
1198         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1199         (WebCore::MTLDataTypeForBindingType): Added.
1200
1201 2018-12-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1202
1203         Unreviewed, remove stray #pragma once added to .cpp file
1204
1205         * svg/properties/SVGAttributeOwnerProxy.cpp:
1206
1207 2018-12-20  Justin Michaud  <justin_michaud@apple.com>
1208
1209         Adding runtime-enabled attribute to Element prevents inlining property access
1210         https://bugs.webkit.org/show_bug.cgi?id=192901
1211
1212         Add a call to flattenDictionaryObject after disabling runtime-enabled attributes.
1213
1214         Reviewed by Ryosuke Niwa.
1215
1216         * bindings/scripts/CodeGeneratorJS.pm:
1217         (GenerateImplementation):
1218         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1219         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
1220         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1221         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
1222         * bindings/scripts/test/JS/JSTestNode.cpp:
1223         (WebCore::JSTestNodePrototype::finishCreation):
1224         * bindings/scripts/test/JS/JSTestObj.cpp:
1225         (WebCore::JSTestObjPrototype::finishCreation):
1226
1227 2018-12-20  Chris Dumez  <cdumez@apple.com>
1228
1229         Use Optional::hasValue() instead of Optional::has_value()
1230         https://bugs.webkit.org/show_bug.cgi?id=192948
1231
1232         Reviewed by Tim Horton.
1233
1234         * bindings/js/DOMPromiseProxy.h:
1235         (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
1236         (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
1237         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
1238         * dom/DataTransferItemList.h:
1239         (WebCore::DataTransferItemList::hasItems const):
1240         * dom/EventTarget.cpp:
1241         (WebCore::EventTarget::addEventListener):
1242         * html/HTMLMediaElement.cpp:
1243         (WebCore::HTMLMediaElement::captionDisplayMode):
1244         * platform/graphics/MediaPlayer.cpp:
1245         (WebCore::MediaPlayer::wouldTaintOrigin const):
1246         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1247         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1248         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1249         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
1250         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1251         (webKitMediaSrcUpdatePresentationSize):
1252         * platform/mac/NSScrollerImpDetails.mm:
1253         (WebCore::ScrollerStyle::recommendedScrollerStyle):
1254         * rendering/RenderListItem.cpp:
1255         (WebCore::RenderListItem::setExplicitValue):
1256
1257 2018-12-20  Chris Dumez  <cdumez@apple.com>
1258
1259         Move HTTPS_UPGRADE code behind a runtime flag, off by default
1260         https://bugs.webkit.org/show_bug.cgi?id=192937
1261
1262         Reviewed by Youenn Fablet.
1263
1264         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
1265
1266         * page/Settings.yaml:
1267
1268 2018-12-20  Youenn Fablet  <youenn@apple.com>
1269
1270         Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
1271         https://bugs.webkit.org/show_bug.cgi?id=192838
1272
1273         Reviewed by Chris Dumez.
1274
1275         Generate constructor code in case of a Private but not Public constructor.
1276         Make sure this is correctly exposed in global objects.
1277         Add JS built-in constructor implementations for those two objects.
1278
1279         Also add JS built-in constructors for controller and byob request.
1280         To keep existing behavior, JS built-ins calling these constructors need to pass
1281         an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
1282         In the latter case, the constructor will throw.
1283
1284         Covered by existing tests, no observable change of behavior.
1285
1286         * Modules/streams/ReadableByteStreamController.idl:
1287         * Modules/streams/ReadableByteStreamController.js:
1288         (initializeReadableByteStreamController):
1289         (getter.byobRequest):
1290         * Modules/streams/ReadableByteStreamInternals.js:
1291         (privateInitializeReadableByteStreamController): Deleted.
1292         (privateInitializeReadableStreamBYOBRequest): Deleted.
1293         * Modules/streams/ReadableStream.js:
1294         (initializeReadableStream):
1295         * Modules/streams/ReadableStreamBYOBReader.js:
1296         (initializeReadableStreamBYOBReader):
1297         * Modules/streams/ReadableStreamBYOBRequest.idl:
1298         * Modules/streams/ReadableStreamBYOBRequest.js:
1299         (initializeReadableStreamBYOBRequest):
1300         * Modules/streams/ReadableStreamDefaultController.idl:
1301         * Modules/streams/ReadableStreamDefaultController.js:
1302         (initializeReadableStreamDefaultController):
1303         (enqueue):
1304         * Modules/streams/ReadableStreamDefaultReader.js:
1305         (initializeReadableStreamDefaultReader):
1306         * Modules/streams/ReadableStreamInternals.js:
1307         (readableStreamDefaultControllerError): Deleted.
1308         * Sources.txt:
1309         * UnifiedSources-input.xcfilelist:
1310         * WebCore.xcodeproj/project.pbxproj:
1311         * bindings/js/JSDOMBuiltinConstructor.h:
1312         * bindings/js/JSDOMGlobalObject.cpp:
1313         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1314         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
1315         * bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
1316         * bindings/scripts/CodeGeneratorJS.pm:
1317         (GeneratePropertiesHashTable):
1318         * bindings/scripts/preprocess-idls.pl:
1319         (shouldExposeInterface):
1320
1321 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1322
1323         [WebAuthN] Remove hash from Client Data
1324         https://bugs.webkit.org/show_bug.cgi?id=192727
1325         <rdar://problem/46746673>
1326
1327         Reviewed by Brent Fulgham.
1328
1329         The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec:
1330         https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it.
1331
1332         Covered by existing tests.
1333
1334         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1335         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
1336
1337 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1338
1339         [WebAuthN] Add a runtime flag for local authenticator
1340         https://bugs.webkit.org/show_bug.cgi?id=192792
1341         <rdar://problem/46798738>
1342
1343         Reviewed by Brent Fulgham.
1344
1345         No tests.
1346
1347         This patch adds a runtime flag for local authenticator and removes ways to
1348         set the runtime flag for web authentication in LegacyWebKit.
1349
1350         * page/RuntimeEnabledFeatures.h:
1351         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled):
1352         (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const):
1353
1354 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
1355
1356         Pointer lock causes abandoned documents
1357         https://bugs.webkit.org/show_bug.cgi?id=188727
1358         rdar://problem/44248197
1359         
1360         Reviewed by Simon Fraser.
1361
1362         Fixes --world-leaks in these tests:
1363
1364         pointer-lock/locked-element-removed-from-dom.html
1365         pointer-lock/mouse-event-delivery.html
1366         fast/shadow-dom/pointerlockelement-in-slot.html
1367
1368         PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document.
1369
1370         * page/PointerLockController.cpp:
1371         (WebCore::PointerLockController::elementRemoved):
1372         (WebCore::PointerLockController::documentDetached):
1373         (WebCore::PointerLockController::didAcquirePointerLock):
1374         * page/PointerLockController.h:
1375
1376 2018-12-20  Chris Dumez  <cdumez@apple.com>
1377
1378         Use Optional::valueOr() instead of Optional::value_or()
1379         https://bugs.webkit.org/show_bug.cgi?id=192933
1380
1381         Reviewed by Geoffrey Garen.
1382
1383         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1384         (WebCore::convert):
1385         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
1386         * Modules/encryptedmedia/MediaKeySession.cpp:
1387         (WebCore::MediaKeySession::load):
1388         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1389         (WebCore::IDBDatabaseIdentifier::hash const):
1390         * Modules/indexeddb/IDBFactory.cpp:
1391         (WebCore::IDBFactory::open):
1392         * Modules/mediastream/MediaStreamTrack.cpp:
1393         (WebCore::MediaStreamTrack::applyConstraints):
1394         * Modules/mediastream/RTCDTMFSender.cpp:
1395         (WebCore::RTCDTMFSender::insertDTMF):
1396         * Modules/webdatabase/SQLTransaction.cpp:
1397         (WebCore::SQLTransaction::executeSql):
1398         * Modules/webvr/VRFrameData.cpp:
1399         (WebCore::VRFrameData::update):
1400         * animation/AnimationTimeline.cpp:
1401         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
1402         * animation/DeclarativeAnimation.cpp:
1403         (WebCore::DeclarativeAnimation::cancel):
1404         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1405         * animation/KeyframeEffect.cpp:
1406         (WebCore::computeMissingKeyframeOffsets):
1407         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1408         * animation/WebAnimation.cpp:
1409         (WebCore::WebAnimation::runPendingPlayTask):
1410         (WebCore::WebAnimation::runPendingPauseTask):
1411         * bindings/js/SerializedScriptValue.cpp:
1412         (WebCore::CloneSerializer::write):
1413         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1414         (WebCore::CryptoAlgorithmHMAC::generateKey):
1415         (WebCore::CryptoAlgorithmHMAC::importKey):
1416         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
1417         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1418         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1419         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1420         (WebCore::CryptoKeyRSA::importSpki):
1421         (WebCore::CryptoKeyRSA::importPkcs8):
1422         * crypto/keys/CryptoKeyRSA.cpp:
1423         (WebCore::CryptoKeyRSA::importJwk):
1424         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1425         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1426         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1427         * crypto/mac/CryptoKeyRSAMac.cpp:
1428         (WebCore::CryptoKeyRSA::importSpki):
1429         (WebCore::CryptoKeyRSA::importPkcs8):
1430         * css/CSSComputedStyleDeclaration.cpp:
1431         (WebCore::counterToCSSValue):
1432         * css/CSSFontFace.cpp:
1433         (WebCore::calculateItalicRange):
1434         * css/CSSPrimitiveValue.cpp:
1435         (WebCore::CSSPrimitiveValue::doubleValue const):
1436         * css/CSSStyleSheet.cpp:
1437         (WebCore::CSSStyleSheet::addRule):
1438         * css/DOMMatrix.cpp:
1439         (WebCore::DOMMatrix::rotateSelf):
1440         * css/DOMMatrixReadOnly.cpp:
1441         (WebCore::DOMMatrixReadOnly::validateAndFixup):
1442         * css/StyleBuilderCustom.h:
1443         (WebCore::StyleBuilderCustom::applyValueCounter):
1444         * css/parser/MediaQueryParser.cpp:
1445         (WebCore::MediaQueryParser::commitMediaQuery):
1446         * dom/Document.h:
1447         (WebCore::Document::referrerPolicy const):
1448         * dom/Element.cpp:
1449         (WebCore::toScrollAlignment):
1450         * dom/EventTarget.cpp:
1451         (WebCore::EventTarget::addEventListener):
1452         * dom/MutationObserver.cpp:
1453         (WebCore::MutationObserver::observe):
1454         * editing/cocoa/FontAttributeChangesCocoa.mm:
1455         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
1456         * fileapi/File.cpp:
1457         (WebCore::File::File):
1458         * html/DOMTokenList.cpp:
1459         (WebCore::DOMTokenList::toggle):
1460         * html/HTMLOListElement.h:
1461         * html/ImageBitmap.cpp:
1462         (WebCore::croppedSourceRectangleWithFormatting):
1463         * html/canvas/CanvasPattern.cpp:
1464         (WebCore::CanvasPattern::setTransform):
1465         * html/canvas/CanvasRenderingContext2DBase.cpp:
1466         (WebCore::CanvasRenderingContext2DBase::setTransform):
1467         (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
1468         (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
1469         * html/canvas/Path2D.cpp:
1470         (WebCore::Path2D::addPath):
1471         * inspector/InspectorCanvas.cpp:
1472         (WebCore::InspectorCanvas::buildAction):
1473         * inspector/InspectorFrontendHost.cpp:
1474         (WebCore::populateContextMenu):
1475         * layout/FormattingContext.cpp:
1476         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1477         * layout/FormattingContextGeometry.cpp:
1478         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1479         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1480         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1481         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1482         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1483         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1484         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
1485         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1486         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1487         * layout/FormattingContextQuirks.cpp:
1488         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1489         * layout/MarginTypes.h:
1490         (WebCore::Layout::VerticalMargin::usedValues const):
1491         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1492         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1493         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1494         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1495         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1496         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1497         * layout/displaytree/DisplayBox.h:
1498         (WebCore::Display::Box::width const):
1499         (WebCore::Display::Box::height const):
1500         (WebCore::Display::Box::contentBoxTop const):
1501         (WebCore::Display::Box::contentBoxLeft const):
1502         * layout/floats/FloatingContext.cpp:
1503         (WebCore::Layout::Iterator::set):
1504         * layout/inlineformatting/InlineFormattingContext.cpp:
1505         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
1506         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
1507         * loader/FrameLoader.cpp:
1508         (WebCore::FrameLoader::urlSelected):
1509         * loader/NavigationAction.cpp:
1510         * page/FrameView.cpp:
1511         (WebCore::FrameView::setLayoutViewportOverrideRect):
1512         (WebCore::FrameView::documentToAbsoluteScaleFactor const):
1513         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
1514         * page/Page.cpp:
1515         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
1516         * page/SecurityOriginData.cpp:
1517         (WebCore::SecurityOriginData::databaseIdentifier const):
1518         * page/SecurityOriginData.h:
1519         (WebCore::SecurityOriginDataHash::hash):
1520         * page/SecurityOriginHash.h:
1521         (WebCore::SecurityOriginHash::hash):
1522         * page/ViewportConfiguration.cpp:
1523         (WebCore::ViewportConfiguration::setViewLayoutSize):
1524         * page/WindowFeatures.cpp:
1525         (WebCore::parseDialogFeatures):
1526         * page/animation/AnimationBase.cpp:
1527         (WebCore::AnimationBase::updateStateMachine):
1528         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
1529         (WebCore::AnimationBase::getTimeToNextEvent const):
1530         (WebCore::AnimationBase::freezeAtTime):
1531         (WebCore::AnimationBase::getElapsedTime const):
1532         * page/animation/CSSAnimationController.cpp:
1533         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
1534         * page/cocoa/ResourceUsageThreadCocoa.mm:
1535         (WebCore::ResourceUsageThread::platformThreadBody):
1536         * page/linux/ResourceUsageThreadLinux.cpp:
1537         (WebCore::ResourceUsageThread::platformThreadBody):
1538         * platform/graphics/ComplexTextController.cpp:
1539         (WebCore::ComplexTextController::offsetForPosition):
1540         * platform/graphics/FontCache.h:
1541         (WebCore::FontDescriptionKey::computeHash const):
1542         * platform/graphics/FontCascade.cpp:
1543         (WebCore::FontCascade::drawText const):
1544         (WebCore::FontCascade::drawEmphasisMarks const):
1545         (WebCore::FontCascade::displayListForTextRun const):
1546         (WebCore::FontCascade::adjustSelectionRectForText const):
1547         (WebCore::FontCascade::codePath const):
1548         * platform/graphics/FontSelectionAlgorithm.cpp:
1549         (WebCore::FontSelectionAlgorithm::styleDistance const):
1550         * platform/graphics/FontSelectionAlgorithm.h:
1551         (WebCore::operator<<):
1552         (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
1553         (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
1554         (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
1555         * platform/graphics/ShadowBlur.cpp:
1556         (WebCore::ShadowBlur::calculateLayerBoundingRect):
1557         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1558         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1559         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1560         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1561         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1562         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
1563         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1564         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
1565         * platform/graphics/ca/GraphicsLayerCA.cpp:
1566         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1567         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1568         (WebCore::preparePlatformFont):
1569         * platform/graphics/filters/FETurbulence.cpp:
1570         (WebCore::FETurbulence::fillRegion const):
1571         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1572         (WebCore::initializeGStreamer):
1573         * platform/graphics/texmap/TextureMapperLayer.cpp:
1574         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
1575         (WebCore::TextureMapperLayer::replicaTransform):
1576         (WebCore::TextureMapperLayer::syncAnimations):
1577         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1578         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
1579         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
1580         * platform/graphics/transforms/TransformState.cpp:
1581         (WebCore::TransformState::mappedPoint const):
1582         (WebCore::TransformState::mapQuad const):
1583         (WebCore::TransformState::flattenWithTransform):
1584         * platform/network/CacheValidation.cpp:
1585         (WebCore::computeCurrentAge):
1586         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1587         * platform/network/NetworkStateNotifier.cpp:
1588         (WebCore::NetworkStateNotifier::onLine):
1589         * rendering/FloatingObjects.cpp:
1590         (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
1591         (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
1592         * rendering/GridBaselineAlignment.cpp:
1593         (WebCore::GridBaselineAlignment::ascentForChild const):
1594         * rendering/GridTrackSizingAlgorithm.cpp:
1595         (WebCore::GridTrack::setGrowthLimit):
1596         (WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
1597         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
1598         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
1599         (WebCore::sortByGridTrackGrowthPotential):
1600         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
1601         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1602         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
1603         * rendering/PaintInfo.h:
1604         (WebCore::PaintInfo::applyTransform):
1605         * rendering/RenderBox.cpp:
1606         (WebCore::RenderBox::computeLogicalHeight const):
1607         * rendering/RenderCounter.cpp:
1608         (WebCore::planCounter):
1609         * rendering/RenderDeprecatedFlexibleBox.cpp:
1610         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1611         * rendering/RenderFlexibleBox.cpp:
1612         (WebCore::RenderFlexibleBox::baselinePosition const):
1613         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
1614         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
1615         * rendering/RenderGrid.cpp:
1616         (WebCore::RenderGrid::gridGap const):
1617         (WebCore::RenderGrid::baselinePosition const):
1618         * rendering/RenderLayer.cpp:
1619         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1620         * rendering/RenderListBox.cpp:
1621         (WebCore::RenderListBox::paintItem):
1622         (WebCore::RenderListBox::listIndexIsVisible):
1623         * rendering/RenderMultiColumnSet.cpp:
1624         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
1625         * rendering/RenderTable.cpp:
1626         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
1627         * rendering/RenderTableCell.cpp:
1628         (WebCore::RenderTableCell::cellBaselinePosition const):
1629         * rendering/RenderTableSection.cpp:
1630         (WebCore::RenderTableSection::firstLineBaseline const):
1631         * rendering/RenderText.cpp:
1632         (WebCore::RenderText::computePreferredLogicalWidths):
1633         (WebCore::RenderText::previousOffset const):
1634         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
1635         (WebCore::RenderText::nextOffset const):
1636         (WebCore::RenderText::stringView const):
1637         * rendering/RenderView.cpp:
1638         (WebCore::RenderView::layout):
1639         * rendering/mathml/RenderMathMLBlock.cpp:
1640         (WebCore::RenderMathMLBlock::baselinePosition const):
1641         * rendering/mathml/RenderMathMLBlock.h:
1642         (WebCore::RenderMathMLBlock::ascentForChild):
1643         * rendering/style/GridPosition.cpp:
1644         (WebCore::GridPosition::max):
1645         * rendering/style/TextUnderlineOffset.h:
1646         (WebCore::TextUnderlineOffset::lengthOr const):
1647         * rendering/svg/RenderSVGContainer.cpp:
1648         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
1649         * rendering/svg/RenderSVGForeignObject.cpp:
1650         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
1651         * rendering/svg/RenderSVGImage.cpp:
1652         (WebCore::RenderSVGImage::nodeAtFloatPoint):
1653         * rendering/svg/RenderSVGResourceClipper.cpp:
1654         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
1655         * rendering/svg/RenderSVGResourceFilter.cpp:
1656         (WebCore::RenderSVGResourceFilter::postApplyResource):
1657         * rendering/svg/RenderSVGRoot.cpp:
1658         (WebCore::RenderSVGRoot::nodeAtPoint):
1659         * rendering/svg/RenderSVGShape.cpp:
1660         (WebCore::RenderSVGShape::nodeAtFloatPoint):
1661         * rendering/svg/RenderSVGText.cpp:
1662         (WebCore::RenderSVGText::nodeAtFloatPoint):
1663         * rendering/svg/SVGRenderingContext.cpp:
1664         (WebCore::SVGRenderingContext::clipToImageBuffer):
1665         * svg/SVGToOTFFontConversion.cpp:
1666         (WebCore::SVGToOTFFontConverter::processGlyphElement):
1667         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1668
1669 2018-12-20  Jer Noble  <jer.noble@apple.com>
1670
1671         REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
1672         https://bugs.webkit.org/show_bug.cgi?id=192941
1673         <rdar://problem/46874096>
1674
1675         Reviewed by Brent Fulgham.
1676
1677         Don't delete the locked lock before unlocking the lock. 
1678
1679         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1680         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
1681
1682 2018-12-20  Keith Rollin  <krollin@apple.com>
1683
1684         Improve release-level page-load logging
1685         https://bugs.webkit.org/show_bug.cgi?id=192872
1686         <rdar://problem/46850309>
1687
1688         Reviewed by Chris Dumez.
1689
1690         There are a number of reported bugs that are difficult or impossible
1691         to track down with our current level of logging. Additionally, some
1692         software groups lower in the page-loading stack have requested logging
1693         sufficient for tracking a user-visible error message down to the
1694         requested resource that caused the message. Add more-comprehensive
1695         logging to address these issues/requests.
1696
1697         No new tests -- no changed functionality.
1698
1699         * loader/DocumentLoader.cpp:
1700         (WebCore::DocumentLoader::setMainDocumentError):
1701         (WebCore::DocumentLoader::mainReceivedError):
1702         (WebCore::DocumentLoader::stopLoading):
1703         (WebCore::DocumentLoader::notifyFinished):
1704         (WebCore::DocumentLoader::willSendRequest):
1705         (WebCore::DocumentLoader::continueAfterContentPolicy):
1706         (WebCore::DocumentLoader::startLoadingMainResource):
1707         (WebCore::DocumentLoader::loadMainResource):
1708         (WebCore::DocumentLoader::cancelMainResourceLoad):
1709         * loader/FrameLoader.cpp:
1710         (WebCore::FrameLoader::urlSelected):
1711         (WebCore::FrameLoader::loadURLIntoChildFrame):
1712         (WebCore::FrameLoader::loadArchive):
1713         (WebCore::FrameLoader::loadInSameDocument):
1714         (WebCore::FrameLoader::loadFrameRequest):
1715         (WebCore::FrameLoader::loadURL):
1716         (WebCore::FrameLoader::load):
1717         (WebCore::FrameLoader::loadWithNavigationAction):
1718         (WebCore::FrameLoader::loadWithDocumentLoader):
1719         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1720         (WebCore::FrameLoader::reload):
1721         (WebCore::FrameLoader::setState):
1722         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1723         (WebCore::FrameLoader::loadPostRequest):
1724         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1725         (WebCore::FrameLoader::loadDifferentDocumentItem):
1726         * loader/ProgressTracker.cpp:
1727         (WebCore::ProgressItem::ProgressItem):
1728         (WebCore::ProgressTracker::reset):
1729         (WebCore::ProgressTracker::progressStarted):
1730         (WebCore::ProgressTracker::progressCompleted):
1731         (WebCore::ProgressTracker::finalProgressComplete):
1732         (WebCore::ProgressTracker::incrementProgress):
1733         (WebCore::ProgressTracker::completeProgress):
1734         (WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const):
1735         * loader/ProgressTracker.h:
1736         * loader/ResourceLoader.cpp:
1737         (WebCore::ResourceLoader::loadDataURL):
1738         (WebCore::ResourceLoader::willSendRequestInternal):
1739         (WebCore::ResourceLoader::didFinishLoading):
1740         (WebCore::ResourceLoader::didFail):
1741         (WebCore::ResourceLoader::willSendRequestAsync):
1742         (WebCore::ResourceLoader::wasBlocked):
1743         (WebCore::ResourceLoader::cannotShowURL):
1744         * loader/SubresourceLoader.cpp:
1745         (WebCore::SubresourceLoader::willSendRequestInternal):
1746         (WebCore::=):
1747         (WebCore::SubresourceLoader::didReceiveResponse):
1748         (WebCore::SubresourceLoader::didFinishLoading):
1749         (WebCore::SubresourceLoader::didFail):
1750         (WebCore::SubresourceLoader::willCancel):
1751         * loader/cache/CachedResource.cpp:
1752         (WebCore::CachedResource::load):
1753
1754 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
1755
1756         Switch tabs before retuning PiP video to inline.
1757         https://bugs.webkit.org/show_bug.cgi?id=192767
1758         rdar://problem/46006046
1759
1760         Reviewed by Jer Noble.
1761
1762         No new tests because this code path only happens with a user action on system UI.
1763
1764         When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
1765
1766         * platform/mac/VideoFullscreenInterfaceMac.mm:
1767         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
1768
1769 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1770
1771         Unreviewed, fix GTK build after r239410
1772
1773         It added a new file to the build, breaking the unified sources magic that obscured a bug in
1774         URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was
1775         included via another source file in the unified source bundle.
1776
1777         * platform/network/soup/URLSoup.h:
1778
1779 2018-12-19  Chris Dumez  <cdumez@apple.com>
1780
1781         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
1782         https://bugs.webkit.org/show_bug.cgi?id=192728
1783         <rdar://problem/46746779>
1784
1785         Reviewed by Geoff Garen.
1786
1787         * Modules/*:
1788         * animation/*:
1789         * bindings/*:
1790         * crypto/*:
1791         * css/*:
1792         * dom/*:
1793         * editing/*:
1794         * fileapi/*:
1795         * html/*:
1796         * inspector/*:
1797         * layout/*:
1798         * loader/*:
1799         * mathml/*:
1800         * page/*:
1801         * platform/*:
1802         * plugins/*:
1803         * rendering/*:
1804         * testing/*:
1805         * workers/*:
1806         * xml/*:
1807
1808 2018-12-19  Jer Noble  <jer.noble@apple.com>
1809
1810         Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1811         https://bugs.webkit.org/show_bug.cgi?id=192896
1812         <rdar://46732186>
1813
1814         Reviewed by Eric Carlson.
1815
1816         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1817         (WebCore::AudioSourceProviderAVFObjC::initCallback):
1818
1819 2018-12-19  Timothy Hatcher  <timothy@apple.com>
1820
1821         REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent
1822         https://bugs.webkit.org/show_bug.cgi?id=188891
1823         rdar://problem/42344352
1824
1825         Reviewed by Simon Fraser.
1826
1827         * rendering/RenderLayerCompositor.cpp:
1828         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
1829         Don't return early when m_layerForOverhangAreas is null to avoid skipping
1830         setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate().
1831
1832 2018-12-19  Justin Fan  <justin_fan@apple.com>
1833
1834         [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
1835         https://bugs.webkit.org/show_bug.cgi?id=192843
1836         <rdar://problem/46820395>
1837
1838         Reviewed by Myles Maxfield.
1839
1840         Test: webgpu/pipeline-layouts.html
1841
1842         Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout:
1843         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
1844         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
1845         * Modules/webgpu/WebGPUBindGroupLayout.h:
1846         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter.
1847         * Modules/webgpu/WebGPUDevice.cpp:
1848         (WebCore::WebGPUDevice::createPipelineLayout const): Added.
1849         * Modules/webgpu/WebGPUDevice.h:
1850         * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout.
1851         * Modules/webgpu/WebGPUPipelineLayout.cpp: Added.
1852         (WebCore::WebGPUPipelineLayout::create):
1853         (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
1854         * Modules/webgpu/WebGPUPipelineLayout.h: Added.
1855         * Modules/webgpu/WebGPUPipelineLayout.idl: Added.
1856         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added.
1857         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added.
1858         * platform/graphics/gpu/GPUDevice.cpp:
1859         (WebCore::GPUDevice::createPipelineLayout const): Added.
1860         * platform/graphics/gpu/GPUDevice.h:
1861         * platform/graphics/gpu/GPUPipelineLayout.cpp: Added.
1862         (WebCore::GPUPipelineLayout::create):
1863         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
1864         * platform/graphics/gpu/GPUPipelineLayout.h: Added.
1865         * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added.
1866
1867         Add files and symbols to project:
1868         * CMakeLists.txt:
1869         * DerivedSources.make:
1870         * Sources.txt:
1871         * WebCore.xcodeproj/project.pbxproj:
1872         * bindings/js/WebCoreBuiltinNames.h:
1873
1874         Add missing include:
1875         * Modules/webgpu/WebGPUQueue.h:
1876
1877 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
1878
1879         SVGUseElement::findTarget should return nullptr when there is a cycle
1880         https://bugs.webkit.org/show_bug.cgi?id=192840
1881
1882         Reviewed by Tim Horton.
1883
1884         r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target.
1885         Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when
1886         the SVG use element itself had a corresponding element.
1887
1888         No new tests since there should be no behavioral change.
1889
1890         * svg/SVGUseElement.cpp:
1891         (WebCore::SVGUseElement::updateShadowTree):
1892         (WebCore::SVGUseElement::findTarget const):
1893
1894 2018-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
1895
1896         [WHLSL] Add a handwritten lexer
1897         https://bugs.webkit.org/show_bug.cgi?id=192294
1898
1899         Reviewed by Jon Lee.
1900
1901         This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The
1902         implementation matches the lexing rules in the spec (specifically, the rules that start
1903         with an uppercase letter). The spec is at
1904         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4.
1905
1906         This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283.
1907
1908         No new tests because the lexer isn't hooked up yet; there are tests in the parser,
1909         once that gets committed.
1910
1911         * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added.
1912         (WebCore::WHLSL::Lexer::Token::typeName):
1913         (WebCore::WHLSL::Lexer::recognizeKeyword):
1914         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
1915         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
1916         (WebCore::WHLSL::isWhitespace):
1917         (WebCore::WHLSL::isNewline):
1918         (WebCore::WHLSL::Lexer::skipWhitespace):
1919         (WebCore::WHLSL::Lexer::skipLineComment):
1920         (WebCore::WHLSL::Lexer::skipLongComment):
1921         (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const):
1922         (WebCore::WHLSL::Lexer::decimalIntLiteral const):
1923         (WebCore::WHLSL::Lexer::decimalUintLiteral const):
1924         (WebCore::WHLSL::isHexadecimalCharacter):
1925         (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const):
1926         (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const):
1927         (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const):
1928         (WebCore::WHLSL::Lexer::intLiteral const):
1929         (WebCore::WHLSL::Lexer::uintLiteral const):
1930         (WebCore::WHLSL::Lexer::digit const):
1931         (WebCore::WHLSL::Lexer::digitStar const):
1932         (WebCore::WHLSL::Lexer::character const):
1933         (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const):
1934         (WebCore::WHLSL::Lexer::coreFloatLiteral const):
1935         (WebCore::WHLSL::Lexer::floatLiteral const):
1936         (WebCore::WHLSL::Lexer::validIdentifier const):
1937         (WebCore::WHLSL::Lexer::identifier const):
1938         (WebCore::WHLSL::Lexer::operatorName const):
1939         * Modules/webgpu/WHLSL/WHLSLLexer.h: Added.
1940         (WebCore::WHLSL::Lexer::Lexer):
1941         (WebCore::WHLSL::Lexer::consumeToken):
1942         (WebCore::WHLSL::Lexer::unconsumeToken):
1943         (WebCore::WHLSL::Lexer::state const):
1944         (WebCore::WHLSL::Lexer::setState):
1945         (WebCore::WHLSL::Lexer::isFullyConsumed const):
1946         (WebCore::WHLSL::Lexer::errorString):
1947         (WebCore::WHLSL::Lexer::string const):
1948         (WebCore::WHLSL::Lexer::anyCharacter const):
1949         * Sources.txt:
1950         * WebCore.xcodeproj/project.pbxproj:
1951
1952 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
1953
1954         Web Inspector: Timelines: correctly label Intersection Observer callbacks
1955         https://bugs.webkit.org/show_bug.cgi?id=192669
1956         <rdar://problem/46702490>
1957
1958         Reviewed by Joseph Pecoraro.
1959
1960         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
1961         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
1962         that they get correctly labeled in the Inspector timeline.
1963
1964         * dom/MutationObserver.cpp:
1965         (WebCore::MutationObserver::deliver):
1966         * en.lproj/Localizable.strings:
1967         * inspector/InspectorInstrumentation.cpp:
1968         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
1969         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
1970         * inspector/InspectorInstrumentation.h:
1971         (WebCore::InspectorInstrumentation::willFireObserverCallback):
1972         (WebCore::InspectorInstrumentation::didFireObserverCallback):
1973         * inspector/TimelineRecordFactory.cpp:
1974         (WebCore::TimelineRecordFactory::createObserverCallbackData):
1975         * inspector/TimelineRecordFactory.h:
1976         * inspector/agents/InspectorTimelineAgent.cpp:
1977         (WebCore::InspectorTimelineAgent::willFireObserverCallback):
1978         (WebCore::InspectorTimelineAgent::didFireObserverCallback):
1979         (WebCore::toProtocol):
1980         * inspector/agents/InspectorTimelineAgent.h:
1981         * page/IntersectionObserver.cpp:
1982         (WebCore::IntersectionObserver::notify):
1983         * page/PerformanceObserver.cpp:
1984         (WebCore::PerformanceObserver::deliver):
1985
1986 2018-12-19  Claudio Saavedra  <csaavedra@igalia.com>
1987
1988         ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { }
1989         https://bugs.webkit.org/show_bug.cgi?id=192854
1990
1991         Reviewed by Alex Christensen.
1992
1993         * contentextensions/DFANode.h: Define CharRange's chars as signed
1994
1995 2018-12-19  Youenn Fablet  <youenn@apple.com>
1996
1997         Remove RTCRtpTransceiver.setDirection
1998         https://bugs.webkit.org/show_bug.cgi?id=192869
1999
2000         Reviewed by Alex Christensen.
2001
2002         Covered by rebased test.
2003
2004         * Modules/mediastream/RTCRtpTransceiver.idl:
2005
2006 2018-12-19  Jer Noble  <jer.noble@apple.com>
2007
2008         Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
2009         https://bugs.webkit.org/show_bug.cgi?id=192856
2010         <rdar://problem/46843245>
2011
2012         Reviewed by Alex Christensen.
2013
2014         Some decoders exposed through VideoToolbox will decode asynchronously even when 
2015         kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
2016
2017         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2018         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
2019
2020 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
2021
2022         Allow clients to set the navigator platform
2023         https://bugs.webkit.org/show_bug.cgi?id=192735
2024
2025         Reviewed by Tim Horton.
2026
2027         Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm.
2028
2029         Lots of piping to allow the setting of a custom navigator platform.
2030
2031         * loader/DocumentLoader.h:
2032         (WebCore::DocumentLoader::setCustomNavigatorPlatform):
2033         (WebCore::DocumentLoader::customNavigatorPlatform const):
2034         * loader/FrameLoader.cpp:
2035         (WebCore::FrameLoader::navigatorPlatform const):
2036         * loader/FrameLoader.h:
2037         * page/Navigator.cpp:
2038         (WebCore::Navigator::platform const):
2039         * page/Navigator.h:
2040         * page/NavigatorBase.cpp:
2041         (WebCore::NavigatorBase::platform const):
2042         (WebCore::NavigatorBase::platform): Deleted.
2043         * page/NavigatorBase.h:
2044
2045 2018-12-19  Ryan Haddad  <ryanhaddad@apple.com>
2046
2047         Unreviewed, rolling out r239347.
2048
2049         Caused the leaks bot to hit an exception and the new test
2050         crashes on certain configurations.
2051
2052         Reverted changeset:
2053
2054         "Synchronous media query evaluation could destroy current
2055         Frame/FrameView."
2056         https://bugs.webkit.org/show_bug.cgi?id=192781
2057         https://trac.webkit.org/changeset/239347
2058
2059 2018-12-19  Truitt Savell  <tsavell@apple.com>
2060
2061         Unreviewed, rolling out r239358.
2062
2063         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
2064         crash on Debug bots
2065
2066         Reverted changeset:
2067
2068         "Clean up IndexedDB files between tests"
2069         https://bugs.webkit.org/show_bug.cgi?id=192796
2070         https://trac.webkit.org/changeset/239358
2071
2072 2018-12-19  Don Olmstead  <don.olmstead@sony.com>
2073
2074         Sync some include directories in WebCore
2075         https://bugs.webkit.org/show_bug.cgi?id=192819
2076
2077         Reviewed by Michael Catanzaro.
2078
2079         Added missing include directories around features that have only been enabled on
2080         Apple ports. Removes obsolete directories from list and moves harfbuzz directories
2081         into the freetype cmake file.
2082
2083         * CMakeLists.txt:
2084         * platform/FreeType.cmake:
2085
2086 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2087
2088         [MSE] Remove unused method: stopAskingForMoreSamples()
2089         https://bugs.webkit.org/show_bug.cgi?id=192754
2090
2091         Reviewed by Xabier Rodriguez-Calvar.
2092
2093         The stopAskingForMoreSamples() method from SourceBufferPrivate is not
2094         being used by anyone. SourceBuffer is not calling it and no
2095         SourceBufferPrivate is implementing it. Let's remove that noise.
2096
2097         * platform/graphics/SourceBufferPrivate.h:
2098         (WebCore::SourceBufferPrivate::setActive):
2099         (WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted.
2100         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2101         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted.
2102         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2103
2104 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2105
2106         [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
2107         https://bugs.webkit.org/show_bug.cgi?id=192827
2108
2109         Reviewed by Xabier Rodriguez-Calvar.
2110
2111         This patch makes two dead code removal changes in
2112         SourceBufferPrivateClient:
2113
2114         First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
2115         virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
2116         is only inherited by SourceBuffer, it makes no sense to have default
2117         implementations there (they will never be used), moreso it being a
2118         client interface.
2119
2120         Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
2121         to had an empty implementation, which SourceBuffer did not overwrite,
2122         therefore making any calls to it useless.
2123
2124         All calls to sourceBufferPrivateSeekToTime() have been removed:
2125
2126         SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
2127         itself, used to call this method. This patch deletes it completely.
2128
2129         MockSourceBufferPrivate::seekToTime(), which only called this empty
2130         method, has also been removed along with its only usage in
2131         MockMediaSourcePrivate::seekToTime().
2132
2133         * platform/graphics/SourceBufferPrivateClient.h:
2134         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
2135         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
2136         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2137         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2138         (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
2139         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
2140         (WebCore::MockMediaSourcePrivate::seekToTime):
2141         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2142         (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
2143         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2144
2145 2018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2146
2147         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
2148         https://bugs.webkit.org/show_bug.cgi?id=192815
2149
2150         Reviewed by Jer Noble.
2151
2152         https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration
2153         says that distinctiveIdentifier and persistentState default to
2154         optional. Our implementation does not define a default leaving it
2155         to the first option of the enum, which currently is Required.
2156
2157         * platform/encryptedmedia/CDMKeySystemConfiguration.h:
2158
2159 2018-12-19  Rob Buis  <rbuis@igalia.com>
2160
2161         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
2162         https://bugs.webkit.org/show_bug.cgi?id=192288
2163
2164         Reviewed by Frédéric Wang.
2165
2166         Prefer return value to out parameter for parseAccessControlAllowList.
2167
2168         * loader/CrossOriginPreflightResultCache.cpp:
2169         (WebCore::CrossOriginPreflightResultCacheItem::parse):
2170         * platform/network/HTTPParsers.h:
2171         (WebCore::parseAccessControlAllowList):
2172         * platform/network/ResourceResponseBase.cpp:
2173         (WebCore::ResourceResponseBase::filter):
2174         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2175
2176 2018-12-18  Zan Dobersek  <zdobersek@igalia.com>
2177
2178         REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
2179         https://bugs.webkit.org/show_bug.cgi?id=192230
2180
2181         Reviewed by Carlos Garcia Campos.
2182
2183         Single tile can after r235165 be assigned multiple content updates
2184         without a commit occurring between each update, whereas before these
2185         commits were done for each update.
2186
2187         To avoid repeating updates for a single tile purging information about
2188         the previous update, these updates are now accumulated inside a Vector
2189         and then iterated over during the commit phase.
2190
2191         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
2192         (WebCore::CoordinatedBackingStoreTile::addUpdate):
2193         (WebCore::CoordinatedBackingStoreTile::swapBuffers):
2194         (WebCore::CoordinatedBackingStore::updateTile):
2195         (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
2196         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
2197         (WebCore::CoordinatedBackingStoreTile::scale const):
2198
2199 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2200
2201         [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
2202         https://bugs.webkit.org/show_bug.cgi?id=192842
2203         <rdar://problem/46823586>
2204
2205         Reviewed by Tim Horton.
2206
2207         Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
2208         registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
2209         inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
2210         this is internally tracked in <rdar://problem/46830277>.
2211
2212         * platform/ios/PlatformPasteboardIOS.mm:
2213         (WebCore::PlatformPasteboard::write):
2214
2215 2018-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2216
2217         Unreviewed, add a missing UNUSED_PARAM()
2218
2219         * Modules/mediarecorder/MediaRecorder.cpp:
2220         (WebCore::MediaRecorder::getPrivateImpl):
2221
2222 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
2223
2224         Update CSS Properties and Values API to use new cycle fallback behaviour
2225         https://bugs.webkit.org/show_bug.cgi?id=192800
2226
2227         Reviewed by Antti Koivisto.
2228
2229         Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
2230         wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. 
2231
2232         * css/CSSCustomPropertyValue.h:
2233         * css/CSSVariableReferenceValue.cpp:
2234         (WebCore::resolveVariableReference):
2235         * css/DOMCSSRegisterCustomProperty.cpp:
2236         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2237         * css/StyleResolver.cpp:
2238         (WebCore::StyleResolver::applyCascadedCustomProperty):
2239         * css/parser/CSSPropertyParser.cpp:
2240         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
2241
2242 2018-12-18  Daniel Bates  <dabates@apple.com>
2243
2244         Wrong value for key property in keydown and keyup events generated holding Control key
2245         https://bugs.webkit.org/show_bug.cgi?id=192788
2246         <rdar://problem/46795214>
2247
2248         Reviewed by Wenson Hsieh.
2249
2250         Similar to what we do on Mac, compute the DOM key property from the characters ignoring
2251         modifier keys input string when the Control key is held down.
2252
2253         * platform/ios/PlatformEventFactoryIOS.mm:
2254         (WebCore::keyForKeyEvent):
2255         * platform/mac/PlatformEventFactoryMac.mm:
2256         (WebCore::keyForKeyEvent):
2257
2258 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
2259
2260         Clean up IndexedDB files between tests
2261         https://bugs.webkit.org/show_bug.cgi?id=192796
2262
2263         Reviewed by Geoffrey Garen.
2264
2265         We should clean up the IndexedDB files between tests to make sure each test is independent of others.
2266
2267         This patch also fixes some issues in IDB.
2268
2269         Covered by existing tests.
2270
2271         * Modules/indexeddb/server/IDBServer.cpp:
2272         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2273         We should shut down all open databases instead of databases from open database connections before deleting 
2274         files, because database starts accessing files before connection to database is established.
2275
2276         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2277         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
2278         We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase 
2279         and UniqueIDBDatabase can be destructed after shutdown.
2280
2281         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2282         didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be 
2283         invoked during the hard close.
2284
2285         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
2286         Tasks like didOpenBackingStore could be posted from database thread to main thread after 
2287         immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any 
2288         database operation. 
2289
2290         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
2291         performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access 
2292         m_backingStore when m_backingStore may already be deleted. 
2293
2294         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2295         immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort. 
2296         m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in 
2297         transactionCompleted, so they do not need to be cleared here.
2298
2299 2018-12-18  Myles C. Maxfield  <mmaxfield@apple.com>
2300
2301         Thick overlines and line-throughs grow in the wrong direction
2302         https://bugs.webkit.org/show_bug.cgi?id=192264
2303
2304         Reviewed by Dean Jackson.
2305
2306         Overlines should grow upward, and line-throughs should stay centered.
2307
2308         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
2309
2310         * rendering/TextDecorationPainter.cpp:
2311         (WebCore::TextDecorationPainter::paintTextDecoration):
2312         * style/InlineTextBoxStyle.cpp:
2313         (WebCore::visualOverflowForDecorations):
2314
2315 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
2316
2317         Some iOS app crash in FrameLoader::checkCompleted
2318         https://bugs.webkit.org/show_bug.cgi?id=192804
2319         <rdar://problem/44240573>
2320
2321         Reviewed by Tim Horton.
2322
2323         It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
2324         is trying to send a delegate message. Disable the release assertion while this is happening
2325         so that iOS app would not crash.
2326
2327         Unfortunately no new test as there is no way to easily test UIWebView in iOS,
2328         and this requires a race between the web thread & the main thread.
2329
2330         * dom/ScriptDisallowedScope.h:
2331         (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
2332         * platform/ios/wak/WebCoreThread.h:
2333         * platform/ios/wak/WebCoreThread.mm:
2334         (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
2335         (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
2336         (SendDelegateMessage):
2337
2338 2018-12-18  David Kilzer  <ddkilzer@apple.com>
2339
2340         clang-tidy: Use const reference for MediaTime parameter to prevent object copy
2341         <https://webkit.org/b/192814>
2342
2343         Reviewed by Mark Lam.
2344
2345         * bindings/js/JSDOMConvertNumbers.h:
2346         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
2347
2348 2018-12-18  Justin Fan  <justin_fan@apple.com>
2349
2350         [WebGPU] BindGroupLayout and Device::createBindGroupLayout
2351         https://bugs.webkit.org/show_bug.cgi?id=192817
2352
2353         Reviewed by Dean Jackson.
2354
2355         Update bind-group-layouts to test new functionality.
2356
2357         Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
2358         * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
2359         (WebCore::WebGPUBindGroupLayout::create):
2360         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2361         * Modules/webgpu/WebGPUBindGroupLayout.h: Added.
2362         * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
2363         * Modules/webgpu/WebGPUDevice.cpp:
2364         (WebCore::WebGPUDevice::createBindGroupLayout const): Added.
2365         * Modules/webgpu/WebGPUDevice.h:
2366         * Modules/webgpu/WebGPUDevice.idl:
2367         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
2368         (WebCore::GPUBindGroupLayout::tryCreate):
2369         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2370         * platform/graphics/gpu/GPUBindGroupLayout.h: Added.
2371         * platform/graphics/gpu/GPUDevice.cpp:
2372         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
2373         * platform/graphics/gpu/GPUDevice.h:
2374
2375         Add files and symbols to project:
2376         * CMakeLists.txt:
2377         * DerivedSources.make:
2378         * Sources.txt:
2379         * WebCore.xcodeproj/project.pbxproj:
2380         * bindings/js/WebCoreBuiltinNames.h:
2381
2382         Missing includes that were previously provided via UnifiedSources:
2383         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
2384         * platform/sql/SQLiteFileSystem.h:
2385
2386 2018-12-18  Youenn Fablet  <youenn@apple.com>
2387
2388         Make ReadableStreamXX constructs use PrivateIdentifier
2389         https://bugs.webkit.org/show_bug.cgi?id=192771
2390
2391         Reviewed by Chris Dumez.
2392
2393         PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
2394         Covered by existing binding tests.
2395
2396         * Modules/streams/ReadableByteStreamController.idl:
2397         * Modules/streams/ReadableStreamBYOBReader.idl:
2398         * Modules/streams/ReadableStreamBYOBRequest.idl:
2399         * Modules/streams/ReadableStreamDefaultController.idl:
2400         * Modules/streams/ReadableStreamDefaultReader.idl:
2401         * bindings/scripts/CodeGeneratorJS.pm:
2402         (NeedsConstructorProperty):
2403         * bindings/scripts/preprocess-idls.pl:
2404         (shouldExposeInterface):
2405         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
2406         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
2407         * bindings/scripts/test/TestCustomConstructor.idl: Removed.
2408
2409 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2410
2411         Synchronous media query evaluation could destroy current Frame/FrameView.
2412         https://bugs.webkit.org/show_bug.cgi?id=192781
2413         <rdar://problem/34416793>
2414
2415         Reviewed by Chris Dumez.
2416
2417         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
2418
2419         Test: printing/print-with-media-query-destory.html
2420
2421         * loader/DocumentLoader.cpp:
2422         (WebCore::DocumentLoader::finishedLoading):
2423         * page/Frame.cpp:
2424         (WebCore::Frame::setPrinting):
2425         * page/FrameView.cpp:
2426         (WebCore::FrameView::forceLayoutForPagination):
2427
2428 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
2429
2430         Web Inspector: m3u8 content not shown, it should be text
2431         https://bugs.webkit.org/show_bug.cgi?id=192731
2432         <rdar://problem/46747728>
2433
2434         Reviewed by Devin Rousso.
2435
2436         * inspector/NetworkResourcesData.cpp:
2437         (WebCore::NetworkResourcesData::setResourceContent):
2438         Don't clobber data if setting empty content on a resource that has content.
2439
2440         * inspector/agents/InspectorNetworkAgent.cpp:
2441         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
2442         Additional non-"text/" mime types that can be treated as text.
2443
2444         * platform/MIMETypeRegistry.cpp:
2445         (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
2446         * platform/MIMETypeRegistry.h:
2447         Detect media playlist mime types that are text (m3u8/m3u).
2448
2449 2018-12-18  Daniel Bates  <dabates@apple.com>
2450
2451         Remove <meta http-equiv=set-cookie> support
2452         https://bugs.webkit.org/show_bug.cgi?id=185077
2453         <rdar://problem/41791397>
2454
2455         Reviewed by Brent Fulgham.
2456
2457         Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
2458         the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
2459         removed support for this pragma and Firefox has an open bug to remove it.
2460
2461         * dom/Document.cpp:
2462         (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
2463         was ignored instead of setting the cookie.
2464         * html/parser/XSSAuditor.cpp:
2465         (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
2466         as dangerous and erase attribute http-equiv when we find it because we no longer honor
2467         this pragma.
2468
2469 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
2470
2471         CSS Typed OM should expose attributeStyleMap
2472         https://bugs.webkit.org/show_bug.cgi?id=192671
2473
2474         Reviewed by Ryosuke Niwa.
2475
2476         Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
2477         TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
2478
2479         Test: css-typedom/attributeStyleMap.html
2480
2481         * CMakeLists.txt:
2482         * DerivedSources.make:
2483         * Sources.txt:
2484         * WebCore.xcodeproj/project.pbxproj:
2485         * bindings/js/WebCoreBuiltinNames.h:
2486         * css/ElementCSSInlineStyle.idl:
2487         * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
2488         * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
2489         * css/typedom/StylePropertyMapReadOnly.cpp: Added.
2490         (WebCore::StylePropertyMapReadOnly::reifyValue):
2491         (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
2492         * css/typedom/StylePropertyMapReadOnly.h:
2493         (WebCore::StylePropertyMapReadOnly::create): Deleted.
2494         (WebCore::StylePropertyMapReadOnly::get const): Deleted.
2495         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
2496         * css/typedom/StylePropertyMapReadOnly.idl:
2497         * css/typedom/TypedOMCSSImageValue.h:
2498         * dom/Element.cpp:
2499         (WebCore::Element::attributeStyleMap):
2500         (WebCore::Element::setAttributeStyleMap):
2501         * dom/Element.h:
2502         * dom/ElementRareData.cpp:
2503         * dom/ElementRareData.h:
2504         (WebCore::ElementRareData::attributeStyleMap):
2505         (WebCore::ElementRareData::setAttributeStyleMap):
2506         * dom/StyledElement.cpp:
2507         (WebCore::StyledElement::ensureAttributeStyleMap):
2508         * dom/StyledElement.h:
2509         * html/canvas/CanvasRenderingContext2DBase.cpp:
2510         (WebCore::size):
2511         (WebCore::CanvasRenderingContext2DBase::drawImage):
2512         * platform/graphics/CustomPaintImage.cpp:
2513         (WebCore::extractComputedProperty):
2514         (WebCore::CustomPaintImage::doCustomPaint):
2515
2516 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2517
2518         Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
2519         https://bugs.webkit.org/show_bug.cgi?id=192785
2520         <rdar://problem/45321184>
2521
2522         Reviewed by Tim Horton.
2523
2524         Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
2525         currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
2526         need to know when the user is typing in a text form control, but the page is preventing default text insertion
2527         behavior and instead updating values programmatically.
2528
2529         Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
2530
2531         * html/TextFieldInputType.cpp:
2532         (WebCore::TextFieldInputType::setValue):
2533
2534 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2535
2536         [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
2537         https://bugs.webkit.org/show_bug.cgi?id=192801
2538
2539         Reviewed by Antti Koivisto.
2540
2541         * layout/blockformatting/BlockFormattingContext.h:
2542         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2543         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2544         * layout/blockformatting/BlockMarginCollapse.cpp:
2545         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
2546
2547 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2548
2549         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
2550         https://bugs.webkit.org/show_bug.cgi?id=192799
2551
2552         Reviewed by Antti Koivisto.
2553
2554         * layout/blockformatting/BlockFormattingContext.h:
2555         * layout/blockformatting/BlockMarginCollapse.cpp:
2556         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
2557         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2558
2559 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2560
2561         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
2562         https://bugs.webkit.org/show_bug.cgi?id=192798
2563
2564         Reviewed by Antti Koivisto.
2565
2566         * layout/blockformatting/BlockFormattingContext.h:
2567         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2568         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2569         * layout/blockformatting/BlockMarginCollapse.cpp:
2570         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
2571         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
2572         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2573         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2574
2575 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2576
2577         [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
2578         https://bugs.webkit.org/show_bug.cgi?id=192794
2579
2580         Reviewed by Antti Koivisto.
2581
2582         * layout/blockformatting/BlockFormattingContext.h:
2583         * layout/blockformatting/BlockMarginCollapse.cpp:
2584         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
2585         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
2586         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2587
2588 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2589
2590         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
2591         https://bugs.webkit.org/show_bug.cgi?id=192791
2592
2593         Reviewed by Antti Koivisto.
2594
2595         * layout/blockformatting/BlockMarginCollapse.cpp:
2596         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
2597         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
2598
2599 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2600
2601         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
2602         https://bugs.webkit.org/show_bug.cgi?id=192787
2603
2604         Reviewed by Antti Koivisto.
2605
2606         * layout/blockformatting/BlockFormattingContext.h:
2607         * layout/blockformatting/BlockMarginCollapse.cpp:
2608         (WebCore::Layout::hasClearance):
2609         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
2610         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
2611         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
2612         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2613
2614 2018-12-17  Fujii Hironori  <Hironori.Fujii@sony.com>
2615
2616         [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
2617         https://bugs.webkit.org/show_bug.cgi?id=192752
2618
2619         Reviewed by Don Olmstead.
2620
2621         No new tests, no behavior changes.
2622
2623         * platform/graphics/win/DIBPixelData.cpp:
2624         Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
2625         * platform/graphics/win/FontPlatformDataWin.cpp:
2626         (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
2627         * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
2628         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2629         Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
2630         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
2631         Reorder the initializer list.
2632         (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
2633         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
2634         (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
2635         (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
2636         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
2637         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
2638         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
2639         (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
2640         * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
2641         (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
2642         (WebCore::Font::boundsForGDIGlyph const): Ditto.
2643         (WebCore::Font::widthForGDIGlyph const): Ditto.
2644         * platform/graphics/win/UniscribeController.cpp:
2645         (WebCore::UniscribeController::UniscribeController):
2646         Reorder the initializer list.
2647         (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
2648         (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
2649
2650 2018-12-17  Eric Carlson  <eric.carlson@apple.com>
2651
2652         [MediaStream] A stream's first video frame should be rendered
2653         https://bugs.webkit.org/show_bug.cgi?id=192629
2654         <rdar://problem/46664353>
2655
2656         Reviewed by Youenn Fablet.
2657
2658         Test: fast/mediastream/media-stream-renders-first-frame.html
2659
2660         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2661         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2662         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2663         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2664         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
2665         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
2666         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
2667         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
2668         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
2669         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
2670         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
2671         * platform/mediastream/RealtimeMediaSource.cpp:
2672         (WebCore::RealtimeMediaSource::size const):
2673         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2674         (WebCore::AVVideoCaptureSource::processNewFrame):
2675         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2676         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
2677
2678 2018-12-17  Justin Michaud  <justin_michaud@apple.com>
2679
2680         Bindings generator should support Conditional= along with CachedAttribute
2681         https://bugs.webkit.org/show_bug.cgi?id=192721
2682
2683         Reviewed by Ryosuke Niwa.
2684
2685         Fix a bug where specifying both attributes causes compilation errors because the compile-time
2686         condition is not included in the derived code.
2687
2688         * bindings/scripts/CodeGeneratorJS.pm:
2689         (GenerateImplementation):
2690         * bindings/scripts/test/JS/JSTestObj.cpp:
2691         (WebCore::jsTestObjCachedAttribute3Getter):
2692         (WebCore::jsTestObjCachedAttribute3):
2693         (WebCore::JSTestObj::visitChildren):
2694         * bindings/scripts/test/JS/JSTestObj.h:
2695         * bindings/scripts/test/TestObj.idl:
2696
2697 2018-12-17  David Kilzer  <ddkilzer@apple.com>
2698
2699         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
2700         <https://webkit.org/b/192707>
2701         <rdar://problem/46734926>
2702
2703         Reviewed by Daniel Bates.
2704
2705         * platform/CPUMonitor.cpp:
2706         (WebCore::CPUMonitor::setCPULimit):
2707         * platform/CPUMonitor.h:
2708         (WebCore::CPUMonitor::setCPULimit):
2709         - Change parameter to const reference to fix unnecessary copies.
2710
2711 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
2712
2713         offsetLeft and offsetParent should adjust across shadow boundaries
2714         https://bugs.webkit.org/show_bug.cgi?id=157437
2715         <rdar://problem/26154021>
2716
2717         Reviewed by Simon Fraser.
2718
2719         Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
2720         the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
2721         and https://github.com/w3c/webcomponents/issues/763
2722
2723         The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
2724         In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
2725         the one which is in the same tree as a shadow-inclusive ancestor of the context object.
2726
2727         For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
2728         inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
2729         then its offset parent, etc... until we find the offset parent in the same tree as the context object.
2730
2731         Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
2732         (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
2733         the same tree as the context object but as well as any offset parent which is in its ancestor trees.
2734
2735         Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
2736
2737         * dom/Element.cpp:
2738         (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
2739         (WebCore::collectAncestorTreeScopeAsHashSet): Added.
2740         (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
2741         which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
2742         (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
2743         (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
2744         until it finds the first offset parent which is a shadow-including ancestor.
2745         (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
2746         (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
2747         functions meant to be used for bindings code.
2748         * dom/Element.h:
2749         * html/HTMLElement.idl:
2750
2751 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
2752
2753         Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
2754         https://bugs.webkit.org/show_bug.cgi?id=192780
2755         rdar://problem/43394387
2756
2757         Reviewed by Tim Horton.
2758         
2759         macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
2760         memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
2761         
2762         Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
2763         and consult it when making decisions that affect layer backing store format.
2764
2765         Tested by new results for existing tests.
2766
2767         * platform/graphics/FontCascade.cpp:
2768         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
2769         * platform/graphics/FontCascade.h:
2770         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2771         (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
2772         it once.
2773         * rendering/RenderLayerBacking.cpp:
2774         (WebCore::RenderLayerBacking::updateAfterDescendants):
2775         * testing/Internals.cpp:
2776         (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::
2777
2778 2018-12-17  Daniel Bates  <dabates@apple.com>
2779
2780         Make DocumentMarker::allMarkers() constexpr
2781         https://bugs.webkit.org/show_bug.cgi?id=192634
2782
2783         Reviewed by Simon Fraser.
2784
2785         The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
2786         it constexpr to do just that.
2787
2788         * dom/DocumentMarker.h:
2789         (WebCore::DocumentMarker::allMarkers):
2790
2791 2018-12-17  Justin Fan  <justin_fan@apple.com>
2792
2793         [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
2794         https://bugs.webkit.org/show_bug.cgi?id=192726
2795
2796         Reviewed by Myles C. Maxfield.
2797
2798         Test: webgpu/bind-group-layouts.html
2799         Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
2800         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
2801         * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
2802         * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
2803         * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
2804         * Modules/webgpu/WebGPUShaderStageBit.h: Added.
2805         * Modules/webgpu/WebGPUShaderStageBit.idl: Added.
2806         * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
2807         * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.
2808
2809         Add the new symbols and files to the project:
2810         * CMakeLists.txt:
2811         * DerivedSources.make:
2812         * Sources.txt:
2813         * WebCore.xcodeproj/project.pbxproj:
2814         * bindings/js/WebCoreBuiltinNames.h:
2815
2816         Small FIXME update for later:
2817         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2818         (WebCore::GPURenderPassEncoder::setVertexBuffers):
2819
2820 2018-12-17  Zalan Bujtas  <zalan@apple.com>
2821
2822         Unreviewed build fix.
2823
2824         * page/ios/FrameIOS.mm:
2825         (WebCore::Frame::interpretationsForCurrentRoot const):
2826
2827 2018-12-17  Zalan Bujtas  <zalan@apple.com>
2828
2829         Reproducible ASSERTion failure when toggling layer borders with find-in-page up
2830         https://bugs.webkit.org/show_bug.cgi?id=192762
2831         <rdar://problem/46676873>
2832
2833         Reviewed by Simon Fraser.
2834
2835         DocumentMarkerController::markersFor() should take a reference instead of a Node*.
2836
2837         Test: editing/document-marker-null-check.html
2838
2839         * dom/DocumentMarkerController.cpp:
2840         (DocumentMarkerController::hasMarkers):
2841         * dom/DocumentMarkerController.h:
2842         * editing/AlternativeTextController.cpp:
2843         (WebCore::AlternativeTextController::respondToChangedSelection):
2844         * editing/Editor.cpp:
2845         (WebCore::Editor::selectionStartHasMarkerFor const):
2846         * rendering/InlineTextBox.cpp:
2847         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
2848         * rendering/RenderReplaced.cpp:
2849         (WebCore::RenderReplaced::paint):
2850         * rendering/RenderText.cpp:
2851         (WebCore::RenderText::draggedContentRangesBetweenOffsets const):
2852         * rendering/SimpleLineLayout.cpp:
2853         (WebCore::SimpleLineLayout::canUseForWithReason):
2854         * testing/Internals.cpp:
2855         (WebCore::Internals::markerCountForNode):
2856
2857 2018-12-17  Commit Queue  <commit-queue@webkit.org>
2858
2859         Unreviewed, rolling out r239265 and r239274.
2860         https://bugs.webkit.org/show_bug.cgi?id=192765
2861
2862         unorm_normalize is deprecated, and broke an internal build
2863         (Requested by Truitt on #webkit).
2864
2865         Reverted changesets:
2866
2867         "[GTK][WPE] Need a function to convert internal URI to display
2868         ("pretty") URI"
2869         https://bugs.webkit.org/show_bug.cgi?id=174816
2870         https://trac.webkit.org/changeset/239265
2871
2872         "Fix the Apple Internal Mac build with a newer SDK"
2873         https://trac.webkit.org/changeset/239274
2874
2875 2018-12-17  Daniel Bates  <dabates@apple.com>
2876
2877         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
2878         https://bugs.webkit.org/show_bug.cgi?id=192633
2879
2880         Reviewed by Wenson Hsieh.
2881
2882         UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
2883         input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
2884         for binary compatibility.
2885
2886         * platform/ios/WebEvent.h:
2887         * platform/ios/WebEvent.mm:
2888         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
2889
2890 2018-12-17  Matt Lewis  <jlewis3@apple.com>
2891
2892         Unreviewed, rolling out r239254.
2893
2894         This broke the Windows 10 Debug build
2895
2896         Reverted changeset:
2897
2898         "Replace many uses of String::format with more type-safe
2899         alternatives"
2900         https://bugs.webkit.org/show_bug.cgi?id=192742
2901         https://trac.webkit.org/changeset/239254
2902
2903 2018-12-17  Antoine Quint  <graouts@apple.com>
2904
2905         [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
2906         https://bugs.webkit.org/show_bug.cgi?id=192758
2907
2908         Reviewed by Dean Jackson.
2909
2910         We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
2911         gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
2912         less bookkeeping to perform.
2913
2914         No new test since there is no user-observable change.
2915
2916         * animation/WebAnimation.cpp:
2917         (WebCore::WebAnimation::updateFinishedState):
2918         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
2919         (WebCore::WebAnimation::performMicrotask): Deleted.
2920         * animation/WebAnimation.h:
2921
2922 2018-12-17  Antoine Quint  <graouts@apple.com>
2923
2924         [Web Animations] Ensure we don't update an animation's finished state twice when updating animations
2925         https://bugs.webkit.org/show_bug.cgi?id=192757
2926
2927         Reviewed by Dean Jackson.
2928
2929         When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
2930         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
2931         whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
2932         next call to resolve(), unless any of the timing properties have changed in the meantime.
2933
2934         No new test since there is no user-observable change.
2935
2936         * animation/WebAnimation.cpp:
2937         (WebCore::WebAnimation::timingDidChange):
2938         (WebCore::WebAnimation::tick):
2939         (WebCore::WebAnimation::resolve):
2940         * animation/WebAnimation.h:
2941
2942 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
2943
2944         REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
2945         https://bugs.webkit.org/show_bug.cgi?id=192725
2946         rdar://problem/46011418
2947
2948         Reviewed by Antoine Quint.
2949
2950         There were two problems with backing store attachment and animation.
2951         
2952         First, animations are an input into the "backing store attached" logic, so when they change
2953         we should set the CoverageRectChanged bit on GraphicsLayerCA.
2954         
2955         Secondly, when an ancestor has unknown animation extent, all its descendants need to
2956         get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
2957         the current layer has no animation extent.
2958
2959         Tests: compositing/backing/animate-into-view-with-descendant.html
2960                compositing/backing/animate-into-view.html
2961
2962         * platform/graphics/ca/GraphicsLayerCA.cpp:
2963         (WebCore::GraphicsLayerCA::addAnimation):
2964         (WebCore::GraphicsLayerCA::removeAnimation):
2965         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2966
2967 2018-12-17  Zalan Bujtas  <zalan@apple.com>
2968
2969         [LFC][BFC][MarginCollapsing] Unify margin collapse function naming
2970         https://bugs.webkit.org/show_bug.cgi?id=192747
2971
2972         Reviewed by Antti Koivisto.
2973
2974         Rename some margin collapse getters.
2975
2976         * layout/blockformatting/BlockFormattingContext.h:
2977         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2978         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2979         * layout/blockformatting/BlockMarginCollapse.cpp:
2980         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
2981         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
2982         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
2983         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
2984         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
2985         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
2986         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
2987         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
2988         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2989         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
2990         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
2991         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
2992         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
2993         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2994         (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
2995         (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
2996         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
2997         (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
2998         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
2999         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.
3000
3001 2018-12-17  David Kilzer  <ddkilzer@apple.com>
3002
3003         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
3004         <https://webkit.org/b/192751>
3005         <rdar://problem/46771623>
3006
3007         Reviewed by Daniel Bates.
3008
3009         Change loop variables to const references to avoid unnecessary
3010         copies.
3011
3012         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3013         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3014         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3015         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
3016         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3017         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
3018         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3019         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
3020         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
3021         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
3022         (WebCore::IDBDatabaseInfo::loggingString const):
3023         * Modules/mediasource/SourceBuffer.cpp:
3024         (WebCore::removeSamplesFromTrackBuffer):
3025         * accessibility/AccessibilityRenderObject.cpp:
3026         (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
3027         * accessibility/AccessibilityTableRow.cpp:
3028         (WebCore::AccessibilityTableRow::headerObject):
3029         * animation/KeyframeEffect.cpp:
3030         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
3031         * crypto/keys/CryptoKeyRSA.cpp:
3032         (WebCore::CryptoKeyRSA::importJwk):
3033         (WebCore::CryptoKeyRSA::exportJwk const):
3034         * css/CSSComputedStyleDeclaration.cpp:
3035         (WebCore::OrderedNamedLinesCollector::appendLines const):
3036         * dom/DataTransfer.cpp:
3037         (WebCore::readURLsFromPasteboardAsString):
3038         * dom/TreeScope.cpp:
3039         (WebCore::TreeScope::elementsFromPoint):
3040         * html/track/WebVTTParser.cpp:
3041         (WebCore::WebVTTParser::checkAndStoreRegion):
3042         * inspector/agents/InspectorTimelineAgent.cpp:
3043         (WebCore::InspectorTimelineAgent::setInstruments):
3044         * page/Page.cpp:
3045         (WebCore::Page::updateIntersectionObservations):
3046         * page/TextIndicator.cpp:
3047         (WebCore::estimatedBackgroundColorForRange):
3048         * page/animation/KeyframeAnimation.cpp:
3049         (WebCore::KeyframeAnimation::computeLayoutDependency):
3050         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3051         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3052         * platform/graphics/ca/GraphicsLayerCA.cpp:
3053         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
3054         (WebCore::GraphicsLayerCA::updateAnimations):
3055         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
3056         * platform/graphics/mac/ImageMac.mm:
3057         (WebCore::BitmapImage::tiffRepresentation):
3058         * rendering/HitTestResult.cpp:
3059         (WebCore::HitTestResult::append):
3060         * testing/Internals.cpp:
3061         (WebCore::Internals::acceleratedAnimationsForElement):
3062
3063 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
3064
3065         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3066         https://bugs.webkit.org/show_bug.cgi?id=174816
3067
3068         Reviewed by Michael Catanzaro.
3069
3070         Tests: enabled fast/url/user-visible/.
3071
3072         * testing/Internals.cpp:
3073         (WebCore::Internals::userVisibleString): Enable method on all platforms.
3074
3075 2018-12-15  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3076
3077         Null pointer dereference in JSC::WriteBarrierBase()
3078         https://bugs.webkit.org/show_bug.cgi?id=191252
3079
3080         Reviewed by Keith Miller.
3081
3082         * bindings/js/JSCustomElementRegistryCustom.cpp:
3083         (WebCore::JSCustomElementRegistry::whenDefined):
3084         * bindings/js/JSDOMPromiseDeferred.cpp:
3085         (WebCore::createDeferredPromise):
3086         * bindings/js/JSDOMPromiseDeferred.h:
3087         (WebCore::DeferredPromise::create):
3088         (WebCore::callPromiseFunction):
3089         * bindings/js/JSDOMWindowBase.cpp:
3090         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
3091         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
3092         * bindings/js/ScriptModuleLoader.cpp:
3093         (WebCore::ScriptModuleLoader::fetch):
3094         (WebCore::rejectPromise):
3095
3096 2018-12-15  Darin Adler  <darin@apple.com>
3097
3098         Use warning-ignoring macros more consistently and simply
3099         https://bugs.webkit.org/show_bug.cgi?id=192743
3100
3101         Reviewed by Mark Lam.
3102
3103         * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
3104         IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
3105         files like this one with non-clang compilers, and no need to worry about
3106         them when choosing the macro.
3107
3108         * crypto/mac/CryptoKeyRSAMac.cpp:
3109         (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3110
3111         * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
3112         the "unknown-pragmas" trick, which the macro should take care of.
3113         * css/makevalues.pl: Ditto.
3114         * platform/ColorData.gperf: Ditto.
3115
3116         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3117         (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
3118         (see rationale above for Objective-C++).
3119
3120         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3121         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
3122         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3123         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3124         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
3125
3126         * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
3127         (see rationale above for Objective-C++).
3128
3129         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3130         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
3131         Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3132
3133         * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
3134         (see rationale above for Objective-C++).
3135
3136         * platform/network/cocoa/ResourceResponseCocoa.mm:
3137         (WebCore::ResourceResponse::platformCertificateInfo const): Use
3138         ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3139
3140 2018-12-15  Darin Adler  <darin@apple.com>
3141
3142         Replace many uses of String::format with more type-safe alternatives
3143         https://bugs.webkit.org/show_bug.cgi?id=192742
3144
3145         Reviewed by Mark Lam.
3146
3147         A while back, String::format was more efficient than string concatenation,
3148         but that is no longer true, and we should prefer String::number, makeString,
3149         or concatenation with the "+" operator to String::format for new code.
3150
3151         This is not as good for programmers who are fond of printf formatting
3152         style, and in some cases it's a little harder to read the strings
3153         interspersed with variables rather than a format string, but it's better
3154         in a few ways:
3155
3156         - more efficient (I didn't measure the difference, but it's definitely
3157           slower to use String::Format which calls vsnprintf twice than to use
3158           the WTF code)
3159         - works in a type-safe way without a need to use a format specifier such
3160           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
3161           subtle differences between platforms
3162         - allows us to use StringView in some cases to sidestep the need to
3163           allocate temporary WTF::String objects
3164         - does not require converting each WTF::String to a C string, allowing
3165           us to remove many cases of ".utf8().data()" and similar expressions,
3166           eliminating the allocation of temporary WTF::CString objects
3167
3168         This patch covers a batch of easiest-to-convert call sites.
3169         Later patches will allow us to deprecate or remove String::format.
3170
3171         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3172         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
3173         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3174         (WebCore::IDBCursorInfo::loggingString const): Ditto.
3175         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
3176         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
3177         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
3178         (WebCore::IDBGetRecordData::loggingString const): Ditto.
3179         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
3180         (WebCore::IDBIndexInfo::loggingString const): Ditto.
3181         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
3182         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
3183         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
3184         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3185         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
3186         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3187         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
3188         * Modules/webdatabase/Database.cpp:
3189         (WebCore::formatErrorMessage): Ditto.
3190         * Modules/webdatabase/SQLError.h:
3191         (WebCore::SQLError::create): Ditto.
3192
3193         * bindings/scripts/CodeGeneratorJS.pm:
3194         (GenerateImplementation): Use makeString.
3195
3196         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3197         * bindings/scripts/test/JS/JSMapLike.cpp:
3198         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3199         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3200         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3201         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3202         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3203         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3204         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3205         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3206         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3207         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3208         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3209         * bindings/scripts/test/JS/JSTestException.cpp:
3210         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3211         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3212         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3213         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3214         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3215         * bindings/scripts/test/JS/JSTestInterface.cpp:
3216         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3217         * bindings/scripts/test/JS/JSTestIterable.cpp:
3218         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3219         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3220         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3221         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3222         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3223         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3224         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3225         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3226         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3227         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3228         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3229         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3230         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3231         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3232         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3233         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3234         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3235         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3236         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3237         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3238         * bindings/scripts/test/JS/JSTestNode.cpp:
3239         * bindings/scripts/test/JS/JSTestObj.cpp:
3240         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3241         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3242         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3243         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3244         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3245         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3246         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
3247         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3248         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3249         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3250         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3251         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3252         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3253         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3254         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3255         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3256         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3257         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3258         Updated expected results.
3259 :
3260         * css/parser/CSSPropertyParserHelpers.cpp:
3261         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
3262         and makeString.
3263
3264         * html/HTMLSelectElement.cpp:
3265         (WebCore::HTMLSelectElement::setLength): Use makeString.
3266         * html/ImageDocument.cpp:
3267         (WebCore::ImageDocument::imageUpdated): Ditto.
3268         * html/parser/XSSAuditor.cpp:
3269         (WebCore::XSSAuditor::init): Ditto.
3270         * inspector/InspectorFrontendClientLocal.cpp:
3271         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
3272         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
3273         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
3274         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
3275         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
3276         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
3277         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
3278         * page/MemoryRelease.cpp:
3279         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
3280
3281         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3282         (WebCore::formatByteNumber): Use String::number.
3283         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
3284
3285         * page/cocoa/ResourceUsageThreadCocoa.mm:
3286         (WebCore::logFootprintComparison): Use makeString.
3287         * platform/animation/TimingFunction.cpp:
3288         (WebCore::TimingFunction::cssText const): Ditto.
3289
3290         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3291         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
3292         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3293         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
3294
3295         * platform/graphics/ca/GraphicsLayerCA.cpp:
3296         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
3297         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
3298         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
3299         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
3300         * platform/mock/MockRealtimeVideoSource.cpp:
3301         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
3302
3303         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
3304
3305         * platform/network/ParsedContentRange.cpp:
3306         (WebCore::ParsedContentRange::headerValue const): Use makeString.
3307
3308         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
3309         compiler conditionals and reorganized the start/stop of namespaces.
3310         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
3311
3312         * platform/sql/SQLiteDatabase.cpp:
3313         (WebCore::unauthorizedSQLFunction): Use makeString.
3314         * rendering/RenderLayerCompositor.cpp:
3315         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
3316         * workers/service/server/RegistrationDatabase.cpp:
3317         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
3318         (WebCore::RegistrationDatabase::importRecords): Ditto.
3319
3320 2018-12-15  Youenn Fablet  <youenn@apple.com>
3321
3322         Make RTCRtpSender.setParameters to activate specific encodings
3323         https://bugs.webkit.org/show_bug.cgi?id=192732
3324
3325         Reviewed by Eric Carlson.
3326
3327         The conversion between libwebrtc and WebCore is lossy for send parameters.
3328         Libwebrtc checking the differences of values, call to setParameters will often fail.
3329
3330         Given some parameters cannot be exposed, the sender backend keeps the
3331         current set of parameters when gathered and reuses them when parameters are set.
3332
3333         For encodings, we only change activate/maxBitRate/maxFrameRate as
3334         these are the most important parameters to be able to modify.
3335
3336         Covered by added tests in webrtc/video.html.
3337
3338         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
3339         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
3340         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
3341         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
3342         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
3343         (WebCore::fromRTCRtpSendParameters):
3344         (WebCore::fromRTCEncodingParameters): Deleted.
3345         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
3346
3347 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
3348
3349         Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
3350         https://bugs.webkit.org/show_bug.cgi?id=192724
3351         <rdar://problem/46745911>
3352
3353         Reviewed by Devin Rousso.
3354
3355         iOS never installs the InspectorOverlay page as a page overlay.
3356         It also uses its own node highlighting painting. Avoid any work
3357         and resources associated with the overlay page for iOS.
3358
3359         * inspector/InspectorOverlay.cpp:
3360         (WebCore::InspectorOverlay::paint):
3361         (WebCore::InspectorOverlay::update):
3362         (WebCore::InspectorOverlay::overlayPage):
3363         (WebCore::evaluateCommandInOverlay):
3364
3365 2018-12-14  Youenn Fablet  <youenn@apple.com>
3366
3367         MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
3368         https://bugs.webkit.org/show_bug.cgi?id=192720
3369
3370         Reviewed by Eric Carlson.
3371
3372         Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
3373         as the latter is a ref counted object.
3374         Made some refactoring to return early in case of error.
3375
3376         Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
3377         the MediaRecorder will stop listening for its tracks.
3378         Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
3379
3380         Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
3381
3382         * Modules/mediarecorder/MediaRecorder.cpp:
3383         (WebCore::MediaRecorder::didAddOrRemoveTrack):
3384         (WebCore::MediaRecorder::setNewRecordingState): Deleted.
3385         * Modules/mediarecorder/MediaRecorder.h:
3386         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
3387         (WebCore::MediaRecorderPrivateAVFImpl::create):
3388         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
3389         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
3390         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
3391         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
3392         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
3393         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
3394         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
3395         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3396         (WebCore::MediaRecorderPrivateWriter::create):
3397         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
3398         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
3399         (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
3400
3401 2018-12-14  Youenn Fablet  <youenn@apple.com>
3402
3403         getSenders/getReceivers() should not return closed transceiver senders/receivers
3404         https://bugs.webkit.org/show_bug.cgi?id=192706
3405
3406         Reviewed by Eric Carlson.
3407
3408         Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
3409         This forces us to compute the sender/receiver list at getter call time.
3410         Updated the internal call sites of senders to use the list of transceivers instead.
3411
3412         Covered by updated WPT tests.
3413
3414         * Modules/mediastream/RTCPeerConnection.cpp:
3415         (WebCore::RTCPeerConnection::addTrack):
3416         (WebCore::RTCPeerConnection::getSenders const):
3417         (WebCore::RTCPeerConnection::getReceivers const):
3418         * Modules/mediastream/RTCPeerConnection.h:
3419         * Modules/mediastream/RTCRtpTransceiver.cpp:
3420         (WebCore::RTCRtpTransceiver::stopped const):
3421         (WebCore::RtpTransceiverSet::append):
3422         (WebCore::RtpTransceiverSet::senders const):
3423         (WebCore::RtpTransceiverSet::receivers const):
3424         * Modules/mediastream/RTCRtpTransceiver.h:
3425         (WebCore::RtpTransceiverSet::senders const): Deleted.
3426         (WebCore::RtpTransceiverSet::receivers const): Deleted.
3427         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3428         (WebCore::findExistingSender):
3429         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
3430
3431 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3432
3433         clang-tidy: Fix unnecessary copy of objects for operator==() methods
3434         <https://webkit.org/b/192712>
3435         <rdar://problem/46739332>
3436
3437         Reviewed by Andy Estes.
3438
3439         * contentextensions/HashableActionList.h:
3440         (WebCore::ContentExtensions::HashableActionList::operator== const):
3441         (WebCore::ContentExtensions::HashableActionList::operator!= const):
3442         * platform/network/FormData.h:
3443         (WebCore::FormDataElement::EncodedFileData::operator== const):
3444         (WebCore::FormDataElement::EncodedBlobData::operator== const):
3445         - Change arguments from const to const reference to avoid
3446           copies.
3447
3448 2018-12-14  Jer Noble  <jer.noble@apple.com>
3449
3450         CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
3451         https://bugs.webkit.org/show_bug.cgi?id=192713
3452         <rdar://problem/46739706>
3453
3454         Reviewed by Eric Carlson.
3455
3456         A callback is being called twice, and the second time has a null Promise. Instead of these
3457         callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
3458         have ASSERTS() that they are called once-and-only-once.
3459
3460         * platform/encryptedmedia/CDMInstanceSession.h:
3461         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3462         (WebCore::CDMInstanceSessionClearKey::closeSession):
3463         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3464         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
3465         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
3466         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
3467         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
3468         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
3469
3470 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3471
3472         clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
3473         <https://webkit.org/b/192708>
3474         <rdar://problem/46735907>
3475
3476         Reviewed by Jer Noble.
3477
3478         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3479         (WebCore::toSample):
3480         - Make argument a const reference.
3481
3482         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3483         - Update method signatures for implementation changes.
3484         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3485         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset):
3486         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
3487         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
3488         - Make RetainPtr<> argument an rvalue reference and use WTFMove().
3489         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3490         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
3491         - Make RetainPtr<> argument a const reference.
3492
3493         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3494         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
3495         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
3496         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
3497         - Change for loop keys to be const references.
3498
3499         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3500         - Update method signatures for implementation changes.
3501         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3502         (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
3503         (WebCore::SourceBufferPrivateAVFObjC::seekToTime):
3504         - Make Mediatime arguments a const reference.
3505
3506 2018-12-14  Simon Fraser  <simon.fraser@apple.com>
3507
3508         REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
3509         https://bugs.webkit.org/show_bug.cgi?id=188655
3510         rdar://problem/43382687
3511
3512         Reviewed by Antoine Quint.
3513
3514         The logic that computes animation extent, used by backing store attachment code, failed
3515         to account for the behavior where a keyframe animation with a missing 0% keyframe uses
3516         the transform from the unanimated style. This resulted in the computed extent being wrong,
3517         which caused us to remove the layer's backing store in some scenarios.
3518
3519         Fix both animation code paths to use the renderer style if the first keyframe doesn't
3520         contain a transform.
3521
3522         Tests: compositing/backing/backing-store-attachment-empty-keyframe.html
3523                legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html
3524
3525         * animation/KeyframeEffect.cpp:
3526         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
3527         * page/animation/KeyframeAnimation.cpp:
3528         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
3529
3530 2018-12-14  Chris Dumez  <cdumez@apple.com>
3531
3532         [PSON] Stop exposing PolicyAction::Suspend to WebCore
3533         https://bugs.webkit.org/show_bug.cgi?id=192701
3534
3535         Reviewed by Brady Eidson.
3536
3537         Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore.
3538
3539         * loader/DocumentLoader.cpp:
3540         (WebCore::DocumentLoader::continueAfterContentPolicy):
3541         * loader/FrameLoaderTypes.h:
3542         * loader/PolicyChecker.cpp:
3543         (WebCore::PolicyChecker::checkNavigationPolicy):
3544         (WebCore::PolicyChecker::checkNewWindowPolicy):
3545
3546 2018-12-14  Youenn Fablet  <youenn@apple.com>
3547
3548         IDB should store RTCCertificate
3549         https://bugs.webkit.org/show_bug.cgi?id=192599
3550
3551         Reviewed by Brady Eidson.
3552
3553         In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
3554         Instead, create an empty object so that the deserialization can still succeed.
3555         This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.
3556
3557         Test: webrtc/certificates-indexeddb.html
3558
3559         * bindings/js/SerializedScriptValue.cpp:
3560         (WebCore::CloneDeserializer::readTerminal):
3561
3562 2018-12-14  Zalan Bujtas  <zalan@apple.com>
3563
3564         [LFC][BFC] Transition to logical margin types.
3565         https://bugs.webkit.org/show_bug.cgi?id=192699
3566
3567         Reviewed by Antti Koivisto.
3568
3569         This is in preparation for moving over to logical types.
3570         (This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))
3571
3572         * layout/FormattingContext.cpp:
3573         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3574         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3575         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3576         * layout/FormattingContext.h:
3577         * layout/FormattingContextGeometry.cpp:
3578         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
3579         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3580         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3581         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3582         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3583         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3584         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3585         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3586         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3587         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3588         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
3589         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
3590         * layout/FormattingContextQuirks.cpp:
3591         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
3592         * layout/MarginTypes.h:
3593         (WebCore::Layout::VerticalMargin::usedValues const):
3594         * layout/Verification.cpp:
3595         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3596         * layout/blockformatting/BlockFormattingContext.cpp:
3597         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
3598         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
3599         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
3600         (WebCore::Layout::hasPrecomputedMarginBefore):
3601         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3602         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
3603         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3604         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3605         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3606         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
3607         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
3608         (WebCore::Layout::hasPrecomputedMarginTop): Deleted.
3609         * layout/blockformatting/BlockFormattingContext.h:
3610         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3611         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3612         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3613         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
3614         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
3615         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3616         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
3617         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
3618         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
3619         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
3620         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
3621         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3622         (WebCore::Layout::hasMarginBeforeQuirkValue):
3623         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3624         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
3625         (WebCore::Layout::hasMarginTopQuirkValue): Deleted.
3626         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
3627         * layout/blockformatting/BlockMarginCollapse.cpp:
3628         (WebCore::Layout::isMarginBeforeCollapsedWithSibling):
3629         (WebCore::Layout::isMarginAfterCollapsedWithSibling):
3630         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
3631         (WebCore::Layout::isMarginAfterCollapsedThrough):
3632         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
3633         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
3634         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
3635         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
3636         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
3637         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3638         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
3639         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
3640         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
3641         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
3642         (WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
3643         (WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
3644         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
3645         (WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
3646         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
3647         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
3648         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
3649         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
3650         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
3651         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
3652         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
3653         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
3654         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
3655         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
3656         * layout/displaytree/DisplayBox.cpp:
3657         (WebCore::Display::Box::Box):
3658         (WebCore::Display::Box::marginBox const):
3659         (WebCore::Display::Box::nonCollapsedMarginBox const):
3660         * layout/displaytree/DisplayBox.h:
3661         (WebCore::Display::Box::rectWithMargin const):
3662         (WebCore::Display::Box::estimatedMarginBefore const):
3663         (WebCore::Display::Box::setEstimatedMarginBefore):
3664         (WebCore::Display::Box::top const):
3665         (WebCore::Display::Box::topLeft const):
3666         (WebCore::Display::Box::setVerticalMargin):
3667         (WebCore::Display::Box::marginBefore const):
3668         (WebCore::Display::Box::marginStart const):
3669         (WebCore::Display::Box::marginAfter const):
3670         (WebCore::Display::Box::marginEnd const):
3671         (WebCore::Display::Box::nonCollapsedMarginBefore const):
3672         (WebCore::Display::Box::nonCollapsedMarginAfter const):
3673         (WebCore::Display::Box::nonComputedMarginStart const):
3674         (WebCore::Display::Box::nonComputedMarginEnd const):
3675         (WebCore::Display::Box::estimatedMarginTop const): Deleted.
3676         (WebCore::Display::Box::setEstimatedMarginTop): Deleted.
3677         (WebCore::Display::Box::marginTop const): Deleted.
3678         (WebCore::Display::Box::marginLeft const): Deleted.
3679         (WebCore::Display::Box::marginBottom const): Deleted.
3680         (WebCore::Display::Box::marginRight const): Deleted.
3681         (WebCore::Display::Box::nonCollapsedMarginTop const): Deleted.
3682         (WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted.
3683         (WebCore::Display::Box::nonComputedMarginLeft const): Deleted.
3684         (WebCore::Display::Box::nonComputedMarginRight const): Deleted.
3685         * layout/floats/FloatAvoider.cpp:
3686         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
3687         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
3688         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
3689         * layout/floats/FloatAvoider.h:
3690         (WebCore::Layout::FloatAvoider::marginBefore const):
3691         (WebCore::Layout::FloatAvoider::marginAfter const):
3692         (WebCore::Layout::FloatAvoider::marginStart const):
3693         (WebCore::Layout::FloatAvoider::marginEnd const):
3694         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
3695         (WebCore::Layout::FloatAvoider::marginTop const): Deleted.
3696         (WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
3697         (WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
3698         (WebCore::Layout::FloatAvoider::marginRight const): Deleted.
3699         * layout/floats/FloatBox.cpp:
3700         (WebCore::Layout::FloatBox::rect const):
3701         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
3702         (WebCore::Layout::FloatBox::verticalPositionCandidate):
3703         (WebCore::Layout::FloatBox::initialVerticalPosition const):
3704         * layout/floats/FloatingContext.cpp:
3705         (WebCore::Layout::FloatingContext::positionForFloat const):
3706         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3707         * layout/inlineformatting/InlineFormattingContext.cpp:
3708         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
3709
3710 2018-12-14  Zalan Bujtas  <zalan@apple.com>
3711
3712         [LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
3713         https://bugs.webkit.org/show_bug.cgi?id=192692
3714
3715         Reviewed by Antti Koivisto.
3716
3717         This is in preparation for completing block margin collapsing.
3718
3719         * WebCore.xcodeproj/project.pbxproj:
3720         * layout/FormattingContext.cpp:
3721         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3722         * layout/FormattingContext.h:
3723         * layout/FormattingContextGeometry.cpp:
3724         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3725         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3726         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3727         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3728         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
3729         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
3730         * layout/LayoutState.cpp:
3731         (WebCore::Layout::LayoutState::LayoutState):
3732         * layout/LayoutUnits.h:
3733         (WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted.
3734         * layout/MarginTypes.h: Added.
3735         (WebCore::Layout::VerticalMargin::nonCollapsedValues const):
3736         (WebCore::Layout::VerticalMargin::collapsedValues const):
3737         (WebCore::Layout::VerticalMargin::setCollapsedValues):
3738         (WebCore::Layout::VerticalMargin::VerticalMargin):
3739         (WebCore::Layout::VerticalMargin::usedValues const):
3740         * layout/blockformatting/BlockFormattingContext.cpp:
3741         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3742         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3743         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3744         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3745         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3746         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3747         * layout/displaytree/DisplayBox.cpp:
3748         (WebCore::Display::Box::Box):
3749         * layout/displaytree/DisplayBox.h:
3750         (WebCore::Display::Box::setHorizontalMargin):
3751         (WebCore::Display::Box::setVerticalMargin):
3752         (WebCore::Display::Box::setHorizontalNonComputedMargin):
3753         (WebCore::Display::Box::verticalMargin const):
3754         (WebCore::Display::Box::marginTop const):
3755         (WebCore::Display::Box::marginLeft const):
3756         (WebCore::Display::Box::marginBottom const):
3757         (WebCore::Display::Box::marginRight const):
3758         (WebCore::Display::Box::nonCollapsedMarginTop const):
3759         (WebCore::Display::Box::nonCollapsedMarginBottom const):
3760         (WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted.
3761         * layout/floats/FloatingContext.cpp:
3762         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3763         * layout/inlineformatting/InlineFormattingContext.cpp:
3764         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
3765
3766 2018-12-14  Fujii Hironori  <Hironori.Fujii@sony.com>
3767
3768         [Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
3769         https://bugs.webkit.org/show_bug.cgi?id=192693
3770
3771         Reviewed by Ross Kirsling.
3772
3773         No new tests, no behavior changes.
3774
3775         * platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list.
3776         * platform/win/CursorWin.cpp:
3777         (WebCore::loadCursorByName): Changed the argument type of 'name' to const char*.
3778         * platform/win/DefWndProcWindowClass.cpp:
3779         (WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'.
3780         * platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'.
3781         * platform/win/PasteboardWin.cpp:
3782         (WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'.
3783         (WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning.
3784         * platform/win/PlatformMouseEventWin.cpp:
3785         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list.
3786         * platform/win/PopupMenuWin.cpp:
3787         (WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'.
3788         * platform/win/PopupMenuWin.h: Marked override methods with 'override'.
3789         * platform/win/SSLKeyGeneratorWin.cpp:
3790         (WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace.
3791         (WebCore::signedPublicKeyAndChallengeString): Ditto.
3792         * platform/win/SearchPopupMenuDB.cpp:
3793         (WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT.
3794         * platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86).
3795         * platform/win/SystemInfo.cpp:
3796         (WebCore::osVersionForUAString): Added default case.
3797
3798 2018-12-13  Youenn Fablet  <youenn@apple.com>
3799
3800         RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
3801         https://bugs.webkit.org/show_bug.cgi?id=192685
3802
3803         Reviewed by Eric Carlson.
3804
3805         In case the remote description contains a rejected m section,
3806         the corresponding transceiver should be marked as stopped.
3807         Libwebrtc backend has that information so pipe it up to JS.
3808
3809         Covered by updated WPT test.
3810
3811         * Modules/mediastream/RTCRtpTransceiver.cpp:
3812         (WebCore::RTCRtpTransceiver::stopped const):
3813         * Modules/mediastream/RTCRtpTransceiver.h:
3814         (WebCore::RTCRtpTransceiver::stopped const): Deleted.
3815         * Modules/mediastream/RTCRtpTransceiverBackend.h:
3816         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
3817         (WebCore::LibWebRTCRtpTransceiverBackend::stopped const):
3818         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
3819
3820 2018-12-13  Mark Lam  <mark.lam@apple.com>
3821
3822         Ensure that StructureFlags initialization always starts with Base::StructureFlags.
3823         https://bugs.webkit.org/show_bug.cgi?id=192686
3824
3825         Reviewed by Keith Miller.
3826
3827         No new tests needed because there's no new functionality.  Just refactoring.
3828
3829         * bindings/js/JSDOMWindowProperties.h:
3830         * bindings/scripts/CodeGeneratorJS.pm:
3831         (GenerateHeader):
3832         (GeneratePrototypeDeclaration):
3833         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3834         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
3835         * bindings/scripts/test/JS/JSTestEventTarget.h:
3836         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3837         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
3838         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
3839         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
3840         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
3841         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
3842         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
3843         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
3844         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
3845         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
3846         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
3847         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
3848         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
3849         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
3850         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
3851         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
3852         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
3853         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
3854         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
3855         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
3856         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
3857         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
3858         * bindings/scripts/test/JS/JSTestObj.h:
3859         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3860         * bindings/scripts/test/JS/JSTestPluginInterface.h:
3861         * bindings/scripts/test/JS/JSTestTypedefs.h:
3862
3863 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
3864
3865         Make HTMLConverter work across shadow boundaries
3866         https://bugs.webkit.org/show_bug.cgi?id=192640
3867
3868         Reviewed by Wenson Hsieh.
3869
3870         Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions.
3871
3872         Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html
3873                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html
3874                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html
3875                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html
3876                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html
3877                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html
3878                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html
3879                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html
3880
3881         * dom/Position.cpp:
3882         (WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter
3883         and serializePreservingVisualAppearanceInternal.
3884         * dom/Position.h:
3885         * editing/cocoa/HTMLConverter.mm:
3886         (HTMLConverter::convert):
3887         (HTMLConverterCaches::propertyValueForNode):
3888         (HTMLConverterCaches::floatPropertyValueForNode):
3889         (HTMLConverter::_blockLevelElementForNode):
3890         (HTMLConverterCaches::colorPropertyValueForNode):
3891         (HTMLConverter::aggregatedAttributesForAncestors):
3892         (HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
3893         (HTMLConverter::_processElement):
3894         (HTMLConverter::_traverseNode):
3895         (HTMLConverter::_traverseFooterNode):
3896         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
3897         (WebCore::attributedStringFromSelection):
3898         * editing/markup.cpp:
3899         (WebCore::commonShadowIncludingAncestor): Moved to Position.cpp.
3900
3901 2018-12-13  Youenn Fablet  <youenn@apple.com>
3902
3903         Trying to play a media element synchronously after setting srcObject should succeed without user gesture
3904         https://bugs.webkit.org/show_bug.cgi?id=192679
3905
3906         Reviewed by Eric Carlson.
3907
3908         Check the srcObject mediaProvider value which is set synchronously.
3909         Covered by updated fast/mediastream/local-audio-playing-event.html.
3910
3911         * html/HTMLMediaElement.h:
3912         (WebCore::HTMLMediaElement::hasMediaStreamSrcObject const):
3913
3914 2018-12-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3915
3916         [iOS] Support dropping contact card data (public.vcard) in editable content
3917         https://bugs.webkit.org/show_bug.cgi?id=192570
3918         <rdar://problem/35626913>
3919
3920         Reviewed by Tim Horton.
3921
3922         Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details.
3923
3924         Tests:  DragAndDropTests.ExternalSourceContactIntoEditableAreas
3925                 DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea
3926                 DragAndDropTests.ExternalSourceMapItemIntoEditableAreas
3927                 WKAttachmentTestsIOS.InsertDroppedContactAsAttachment
3928                 WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment
3929
3930         * editing/WebContentReader.h:
3931         * editing/cocoa/WebContentReaderCocoa.mm:
3932         (WebCore::attachmentForFilePath):
3933
3934         Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths`
3935         as well as `readVirtualContactFile`.
3936
3937         (WebCore::WebContentReader::readFilePaths):
3938         (WebCore::WebContentReader::readVirtualContactFile):
3939
3940         Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting
3941         fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is
3942         empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a
3943         contact, there is no associated URL, so we only have an attachment.
3944
3945         * platform/Pasteboard.h:
3946         * platform/ios/PasteboardIOS.mm:
3947         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
3948
3949         Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for
3950         "public.vcard" data, which is then passed on to the web content reader. Additionally, by returning
3951         `ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents
3952         of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since
3953         "public.vcard" conforms to "public.text").
3954
3955         (WebCore::Pasteboard::read):
3956         (WebCore::Pasteboard::readRespectingUTIFidelities):
3957         * platform/ios/WebItemProviderPasteboard.mm:
3958         (-[NSItemProvider web_fileUploadContentTypes]):
3959
3960         Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is
3961         tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only
3962         suitable for deserialization into an `MKMapItem`.
3963
3964 2018-12-13  Devin Rousso  <drousso@apple.com>
3965
3966         Web Inspector: remove DOM.BackendNodeId and associated commands/events
3967         https://bugs.webkit.org/show_bug.cgi?id=192478
3968
3969         Reviewed by Matt Baker.
3970
3971         Removing unused code, so no change in functionality.
3972
3973         * inspector/agents/InspectorDOMAgent.h:
3974         * inspector/agents/InspectorDOMAgent.cpp:
3975         (WebCore::InspectorDOMAgent::discardBindings):
3976         (WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted.
3977         (WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted.
3978         (WebCore::InspectorDOMAgen