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