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