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