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