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