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