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