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