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