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