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