[Mac] PiP window can get "stuck" if PiP is closed while Safari window is minimized.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-13  Jer Noble  <jer.noble@apple.com>
2
3         [Mac] PiP window can get "stuck" if PiP is closed while Safari window is minimized.
4         https://bugs.webkit.org/show_bug.cgi?id=194621
5         <rdar://problem/48002560>
6
7         Reviewed by Eric Carlson.
8
9         When Safari is minimized, no rAF() requests are executed. Don't gate responding to presentation
10         change events in the media-controller.js on rAF().
11
12         * Modules/modern-media-controls/media/media-controller.js:
13         (MediaController.prototype._returnMediaLayerToInlineIfNeeded):
14
15 2019-02-13  John Wilander  <wilander@apple.com>
16
17         Ignore Ad Click Attribution where source and destination are same-site
18         https://bugs.webkit.org/show_bug.cgi?id=194620
19         <rdar://problem/47890018>
20
21         Reviewed by Jiewen Tan.
22
23         Updated the existing test.
24
25         We should not accept Ad Click Attribution requests where the site of the
26         anchor tag and its addestination attribute are same-site. Such attributions
27         don’t make sense (the site can track intra-site clicks through better means)
28         and would just lead to increased memory use where are the pending
29         attributions are stored.
30
31         For ports that don't have access to the Public Suffix List, this patch
32         only checks that the hosts don't match, i.e. not just eTLD+1.
33
34         * html/HTMLAnchorElement.cpp:
35         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
36             Now returns WTF::nullopt if the current document and the
37             addestination are same site. Also fixed a console message
38             typo.
39
40 2019-02-13  Eric Carlson  <eric.carlson@apple.com> and Youenn Fablet  <youenn@apple.com>
41
42         getUserMedia with an ideal deviceId constraint doesn't always select the correct device
43         https://bugs.webkit.org/show_bug.cgi?id=193614
44
45         Reviewed by Eric Carlson.
46
47         Compute a fitness score based on constraints.
48         For each constraint, a fitness score is computed from the distance.
49         The smaller the distance, the higher the score.
50         Fitness scores are then summed to give a device fitness score.
51         Matching devices are then sorted according the fitness score.
52
53         For important constraints, deviceId and facingMode, add a more important weight.
54         This ensures that should any of these ideal constraints are set, they will be respected.
55
56         Restrict our automatic setting of default constraints to not add a default ideal facingMode in case of existing deviceId constraint.
57         Do not set a default ideal frameRate if width and height are already set.
58
59         Covered by updated test.
60
61         * platform/mediastream/MediaConstraints.cpp:
62         (WebCore::FlattenedConstraint::set):
63         (WebCore::MediaConstraints::setDefaultVideoConstraints):
64         * platform/mediastream/RealtimeMediaSource.cpp:
65         (WebCore::RealtimeMediaSource::fitnessDistance):
66         (WebCore::RealtimeMediaSource::selectSettings):
67         (WebCore::RealtimeMediaSource::supportsConstraints):
68         (WebCore::RealtimeMediaSource::applyConstraints):
69         * platform/mediastream/RealtimeMediaSource.h:
70         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
71         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
72
73 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
74
75         [iOS] Add a hack to work around buggy video control library
76         https://bugs.webkit.org/show_bug.cgi?id=194615
77         <rdar://problem/46146946>
78
79         Reviewed by Jer Noble.
80
81         Test: media/ios/video-volume-ios-quirk.html
82
83         * html/HTMLMediaElement.cpp:
84         (WebCore::HTMLMediaElement::setVolume): Change m_volume for one turn of the runloop.
85         (WebCore::HTMLMediaElement::cancelPendingTasks): Clear the task queue used to restore m_volume.
86         (WebCore::HTMLMediaElement::closeTaskQueues): Close it.
87         * html/HTMLMediaElement.h:
88
89 2019-02-13  Jer Noble  <jer.noble@apple.com>
90
91         [Cocoa] Media elements will restart network buffering just before suspending
92         https://bugs.webkit.org/show_bug.cgi?id=193691
93
94         Reviewed by Eric Carlson.
95
96         API Test: WebKit.ProcessSuspendMediaBuffering
97
98         Allow the Page to suspend all media buffering in its child Documents.
99
100         * dom/Document.cpp:
101         (WebCore::Document::suspendAllMediaBuffering):
102         (WebCore::Document::resumeAllMediaBuffering):
103         * dom/Document.h:
104         * html/MediaElementSession.cpp:
105         (WebCore::MediaElementSession::dataBufferingPermitted const):
106         (WebCore::MediaElementSession::suspendBuffering):
107         (WebCore::MediaElementSession::resumeBuffering):
108         (WebCore::MediaElementSession::bufferingSuspended const):
109         * html/MediaElementSession.h:
110         * page/Page.cpp:
111         (WebCore::Page::suspendAllMediaBuffering):
112         (WebCore::Page::resumeAllMediaBuffering):
113         * page/Page.h:
114         (WebCore::Page::mediaPlaybackIsSuspended const):
115         (WebCore::Page::mediaBufferingIsSuspended const):
116         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
117         * platform/audio/PlatformMediaSession.h:
118         (WebCore::PlatformMediaSession::suspendBuffering):
119         (WebCore::PlatformMediaSession::resumeBuffering):
120         * platform/audio/PlatformMediaSessionManager.cpp:
121         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
122         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
123         * platform/audio/PlatformMediaSessionManager.h:
124
125 2019-02-13  Jer Noble  <jer.noble@apple.com>
126
127         Entering fullscreen inside a shadow root will not set fullscreen pseudoclasses outside of root
128         https://bugs.webkit.org/show_bug.cgi?id=194516
129         <rdar://problem/44678353>
130
131         Reviewed by Antoine Quint.
132
133         Test: fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html
134
135         When walking up the element ancestor chain, use parentElementInComposedTree() to
136         walk past the shadow root boundary.
137
138         * dom/Element.cpp:
139         (WebCore::parentCrossingFrameBoundaries):
140
141 2019-02-13  Chris Dumez  <cdumez@apple.com>
142
143         Unreviewed, update localizable strings.
144
145         * en.lproj/Localizable.strings:
146
147 2019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
148
149         Further restricting webarchive loads
150         https://bugs.webkit.org/show_bug.cgi?id=194567
151         <rdar://problem/47610130>
152
153         Reviewed by Youenn Fablet.
154
155         This patch futher restricts main frame webarchive loads to the followings:
156         1) loaded by clients;
157         2) loaded by drag;
158         3) reloaded from any of the previous two.
159
160         It moves setAlwaysAllowLocalWebarchive, which is used for testing only, from Document
161         to FrameLoader such that the option is remembered during redirections.
162
163         Covered by API tests.
164
165         * dom/Document.h:
166         (WebCore::Document::setAlwaysAllowLocalWebarchive): Deleted.
167         (WebCore::Document::alwaysAllowLocalWebarchive const): Deleted.
168         * loader/DocumentLoader.cpp:
169         (WebCore::DocumentLoader::disallowWebArchive const):
170         * loader/DocumentLoader.h:
171         (WebCore::DocumentLoader::setAllowsWebArchiveForMainFrame):
172         (WebCore::DocumentLoader::allowsWebArchiveForMainFrame):
173         * loader/FrameLoadRequest.h:
174         (WebCore::FrameLoadRequest::setIsRequestFromClientOrUserInput):
175         (WebCore::FrameLoadRequest::isRequestFromClientOrUserInput):
176         * loader/FrameLoader.cpp:
177         (WebCore::FrameLoader::load):
178         (WebCore::FrameLoader::reload):
179         * loader/FrameLoader.h:
180         (WebCore::FrameLoader::setAlwaysAllowLocalWebarchive):
181         (WebCore::FrameLoader::alwaysAllowLocalWebarchive const):
182         * page/DragController.cpp:
183         (WebCore::DragController::performDragOperation):
184         * testing/Internals.cpp:
185         (WebCore::Internals::setAlwaysAllowLocalWebarchive const):
186         * testing/Internals.h:
187         * testing/Internals.idl:
188
189 2019-02-13  Jer Noble  <jer.noble@apple.com>
190
191         Null-deref crash at SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged()
192         https://bugs.webkit.org/show_bug.cgi?id=194613
193         <rdar://problem/48023912>
194
195         Reviewed by Eric Carlson.
196
197         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
198         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
199
200 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
201
202         Unreviewed, fix unused variable warnings after r241148/r241251
203         https://bugs.webkit.org/show_bug.cgi?id=194348
204         <rdar://problem/47566449>
205
206         * Modules/mediasource/SourceBuffer.cpp:
207         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
208         (WebCore::SourceBuffer::evictCodedFrames):
209         (WebCore::SourceBuffer::provideMediaData):
210
211 2019-02-13  Sihui Liu  <sihui_liu@apple.com>
212
213         REGRESSION: [ Mac Debug WK2 ] Layout Test storage/indexeddb/key-type-infinity-private.html is a flaky crash
214         https://bugs.webkit.org/show_bug.cgi?id=194413
215         <rdar://problem/47897254>
216
217         Reviewed by Brady Eidson.
218
219         IDB clients expected transaction operations to be executed in order, but in 
220         UniqueIDBDatabase::immediateCloseForUserDelete, callbacks in callback map were errored out randomly.
221         This patch added a callback queue to UniqueIDBDatabase to make sure callbacks will be called in the same order
222         as IDB Server receives the request.
223
224         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
225         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
226         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
227         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
228         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
229         (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
230         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
231         (WebCore::IDBServer::UniqueIDBDatabase::performCountCallback):
232         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
233         * Modules/indexeddb/server/UniqueIDBDatabase.h:
234
235 2019-02-13  John Wilander  <wilander@apple.com>
236
237         Store Ad Click Attribution requests in the network process
238         https://bugs.webkit.org/show_bug.cgi?id=194510
239         <rdar://problem/47650118>
240
241         Reviewed by Alex Christensen and Daniel Bates.
242
243         Test: http/tests/adClickAttribution/store-ad-click-attribution.html
244
245         This patch adds support functions for validation and storage of
246         WebCore::AdClickAttribution objects. It also adds WTF::HashTraits so that
247         WebCore::AdClickAttribution::Source and WebCore::AdClickAttribution::Destination
248         can be used in a HashMap.
249
250         * loader/AdClickAttribution.cpp:
251         (WebCore::AdClickAttribution::toString const):
252         * loader/AdClickAttribution.h:
253         (WebCore::AdClickAttribution::Source::operator== const):
254         (WebCore::AdClickAttribution::Source::deletedValue):
255         (WebCore::AdClickAttribution::Source::constructDeletedValue):
256         (WebCore::AdClickAttribution::Source::deleteValue):
257         (WebCore::AdClickAttribution::Source::isDeletedValue const):
258         (WebCore::AdClickAttribution::SourceHash::hash):
259         (WebCore::AdClickAttribution::SourceHash::equal):
260         (WebCore::AdClickAttribution::Destination::operator== const):
261         (WebCore::AdClickAttribution::Destination::matches const):
262             This convenience function allows matching of a WTF::URL object.
263         (WebCore::AdClickAttribution::Destination::deletedValue):
264         (WebCore::AdClickAttribution::Destination::constructDeletedValue):
265         (WebCore::AdClickAttribution::Destination::deleteValue):
266         (WebCore::AdClickAttribution::Destination::isDeletedValue const):
267         (WebCore::AdClickAttribution::DestinationHash::hash):
268         (WebCore::AdClickAttribution::DestinationHash::equal):
269         (WebCore::AdClickAttribution::source const):
270         (WebCore::AdClickAttribution::destination const):
271             Getters added to support mapped storage based on source and destination.
272         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::emptyValue):
273         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::constructDeletedValue):
274         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::isDeletedValue):
275         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::emptyValue):
276         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::constructDeletedValue):
277         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::isDeletedValue):
278         * loader/NavigationAction.h:
279         (WebCore::NavigationAction::adClickAttribution const):
280         (WebCore::NavigationAction::adClickAttribution): Deleted.
281             Corrected the constness of this function.
282
283 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
284
285         Revert r240434
286         https://bugs.webkit.org/show_bug.cgi?id=194600
287         <rdar://problem/48044566>
288
289         Reviewed by Brent Fulgham.
290
291         * html/HTMLMediaElement.cpp:
292         (WebCore::HTMLMediaElement::setVolume):
293         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
294         (WebCore::HTMLMediaElement::updateVolume):
295         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
296         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
297
298 2019-02-13  Alex Christensen  <achristensen@webkit.org>
299
300         Stop using setDefersLoading from WebCore
301         https://bugs.webkit.org/show_bug.cgi?id=194315
302
303         Reviewed by Jer Noble.
304
305         That is what CompletionHandlers are for.
306
307         * loader/MediaResourceLoader.cpp:
308         (WebCore::MediaResource::responseReceived):
309         (WebCore::MediaResource::setDefersLoading): Deleted.
310         * loader/MediaResourceLoader.h:
311         * platform/graphics/PlatformMediaResourceLoader.h:
312         (WebCore::PlatformMediaResourceClient::responseReceived):
313         (WebCore::PlatformMediaResource::stop):
314         (WebCore::PlatformMediaResource::setDefersLoading): Deleted.
315         * platform/network/cocoa/WebCoreNSURLSession.mm:
316         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
317         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
318         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
319         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
320
321 2019-02-13  Jer Noble  <jer.noble@apple.com>
322
323         [Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size.
324         https://bugs.webkit.org/show_bug.cgi?id=194580
325         <rdar://problem/42727739>
326
327         Reviewed by Eric Carlson.
328
329         * platform/cocoa/CoreVideoSoftLink.cpp:
330         * platform/cocoa/CoreVideoSoftLink.h:
331         * platform/graphics/cv/PixelBufferConformerCV.cpp:
332         (WebCore::CVPixelBufferGetBytePointerCallback):
333         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
334
335 2019-02-13  Antoine Quint  <graouts@apple.com>
336
337         Support simulated mouse events on iOS based on a PlatformTouchEvent
338         https://bugs.webkit.org/show_bug.cgi?id=194501
339         <rdar://problem/46910790>
340
341         Reviewed by Dean Jackson.
342
343         Add support for two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and
344         whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. To facilitate
345         that, we allow for a MouseEvent to be created, much like a PointerEvent, based on a PlatformTouchEvent. Then, we set a flag on Event within
346         EventTarget::innerInvokeEventListeners() to see whether any page code has been evaluated as a result of a mousemove event being dispatched.
347         Finally, we also track mouse events when invalidating touch regions provided the required internal runtime flag is on.
348
349         Test: fast/events/touch/ios/mouse-events-dispatch-with-touch.html
350
351         * SourcesCocoa.txt:
352         * WebCore.xcodeproj/project.pbxproj:
353         * dom/Event.cpp:
354         * dom/Event.h:
355         (WebCore::Event::hasEncounteredListener const):
356         (WebCore::Event::setHasEncounteredListener):
357         * dom/EventNames.h:
358         (WebCore::EventNames::isTouchRelatedEventType const):
359         (WebCore::EventNames::touchRelatedEventNames const):
360         (WebCore::EventNames::extendedTouchRelatedEventNames const):
361         (WebCore::EventNames::isTouchEventType const): Deleted.
362         (WebCore::EventNames::touchAndPointerEventNames const): Deleted.
363         * dom/EventTarget.cpp:
364         (WebCore::EventTarget::innerInvokeEventListeners):
365         * dom/MouseEvent.h:
366         * dom/Node.cpp:
367         (WebCore::Node::moveNodeToNewDocument):
368         (WebCore::tryAddEventListener):
369         (WebCore::tryRemoveEventListener):
370         (WebCore::Node::defaultEventHandler):
371         * dom/ios/MouseEventIOS.cpp: Added.
372         (WebCore::mouseEventType):
373         (WebCore::MouseEvent::create):
374         * dom/ios/PointerEventIOS.cpp:
375         (WebCore::pointerEventType):
376         (WebCore::PointerEvent::create):
377         (WebCore::eventType): Deleted.
378         * page/DOMWindow.cpp:
379         (WebCore::DOMWindow::addEventListener):
380         (WebCore::DOMWindow::removeEventListener):
381         * page/EventHandler.h:
382         * page/RuntimeEnabledFeatures.h:
383         (WebCore::RuntimeEnabledFeatures::mouseEventsSimulationEnabled const):
384         (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
385         (WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const):
386         (WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled):
387
388 2019-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
389
390         [FreeType] Unable to render some Hebrew characters
391         https://bugs.webkit.org/show_bug.cgi?id=194498
392
393         Reviewed by Michael Catanzaro.
394
395         We are failing to find a font for some of the combining character sequences because normalization is failing due
396         to overflow error. In case of overflow, normalize returns the required length for the normalized characters, so
397         we should handle that case to resize the output buffer and try again.
398
399         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
400         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
401
402 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
403
404         Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
405         https://bugs.webkit.org/show_bug.cgi?id=194582
406
407         Reviewed by Antti Koivisto.
408
409         Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong
410         from the non-generated identifier being sent to us as it was the case in this failure.
411
412         * loader/PolicyChecker.cpp:
413         (WebCore::PolicyCheckIdentifier::isValidFor):
414
415 2019-02-13  Commit Queue  <commit-queue@webkit.org>
416
417         Unreviewed, rolling out r241273.
418         https://bugs.webkit.org/show_bug.cgi?id=194579
419
420         This change is causing a flaky assertion failure crash in High
421         Sierra Debug (Requested by ShawnRoberts on #webkit).
422
423         Reverted changeset:
424
425         "Stop using setDefersLoading from WebCore"
426         https://bugs.webkit.org/show_bug.cgi?id=194315
427         https://trac.webkit.org/changeset/241273
428
429 2019-02-12  Mark Lam  <mark.lam@apple.com>
430
431         Remove unnecessary null check in bindings.
432         https://bugs.webkit.org/show_bug.cgi?id=194581
433
434         Reviewed by Yusuke Suzuki.
435
436         It is always safe to call visitor.containsOpaqueRoot(root) with a null root pointer.
437         It will just return false.  Since we don't expect the root pointer to be null in
438         the common case, having a null check here is also not optimal.  We'll remove this
439         unneeded null check.
440
441         * bindings/scripts/CodeGeneratorJS.pm:
442         (GenerateImplementation):
443         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
444         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
445
446 2019-02-12  Rob Buis  <rbuis@igalia.com>
447
448         Align with Fetch on data: URLs
449         https://bugs.webkit.org/show_bug.cgi?id=182325
450
451         Reviewed by Alex Christensen.
452
453         The MIME type part of the data url should be serialized as
454         specified in step 3 under "data" [1].
455
456         Test: web-platform-tests/fetch/data-urls/processing.any.js
457
458         [1] https://fetch.spec.whatwg.org/#concept-scheme-fetch 
459
460         * platform/network/DataURLDecoder.cpp:
461         (WebCore::DataURLDecoder::parseMediaType):
462
463 2019-02-12  Alex Christensen  <achristensen@webkit.org>
464
465         Build fix after r241320
466         https://bugs.webkit.org/show_bug.cgi?id=194271
467
468         * page/Frame.cpp:
469         (WebCore::Frame::requestDOMPasteAccess):
470
471 2019-02-12  Justin Fan  <justin_fan@apple.com>
472
473         [WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
474         https://bugs.webkit.org/show_bug.cgi?id=194552
475
476         Reviewed by Dean Jackson.
477
478         WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
479         Consolidate the two versions of these classes in our implementation.
480
481         Affected layout tests updated with new names. No change in behavior.
482
483         * CMakeLists.txt:
484         * DerivedSources-input.xcfilelist:
485         * DerivedSources-output.xcfilelist:
486         * DerivedSources.make:
487         * Modules/webgpu/GPUBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl.
488         * Modules/webgpu/GPUBufferUsage.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl.
489         * Modules/webgpu/WebGPUBufferUsage.h: Removed.
490         * Modules/webgpu/WebGPUDevice.cpp:
491         (WebCore::WebGPUDevice::createBuffer const):
492         * Modules/webgpu/WebGPUDevice.h:
493         * Modules/webgpu/WebGPUDevice.idl:
494         * Sources.txt:
495         * WebCore.xcodeproj/project.pbxproj:
496         * bindings/js/WebCoreBuiltinNames.h:
497         * platform/graphics/gpu/GPUBufferDescriptor.h: Moved out GPUBufferUsage.
498         * platform/graphics/gpu/GPUBufferUsage.h: Moved from GPUBufferDescriptor.h.
499
500 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
501
502         Unreviewed, try to fix the internal iOS build after r241321
503
504         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
505
506 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
507
508         Allow pages to trigger programmatic paste from script on iOS
509         https://bugs.webkit.org/show_bug.cgi?id=194271
510         <rdar://problem/47808810>
511
512         Reviewed by Tim Horton.
513
514         Tests: editing/pasteboard/ios/dom-paste-confirmation.html
515                editing/pasteboard/ios/dom-paste-consecutive-confirmations.html
516                editing/pasteboard/ios/dom-paste-rejection.html
517                editing/pasteboard/ios/dom-paste-requires-user-gesture.html
518
519         * dom/UserGestureIndicator.cpp:
520         (WebCore::UserGestureIndicator::~UserGestureIndicator):
521
522         Reset a gesture token's DOM paste access when exiting the scope of a user gesture. This prevents DOM paste
523         access permissions from leaking into `setTimeout()` callbacks when we forward user gesture tokens.
524
525         * dom/UserGestureIndicator.h:
526         (WebCore::UserGestureToken::resetDOMPasteAccess):
527
528 2019-02-12  Chris Fleizach  <cfleizach@apple.com>
529
530         AX: IsolatedTree: Implement more attributes
531         https://bugs.webkit.org/show_bug.cgi?id=193911
532         <rdar://problem/47599217>
533
534         Reviewed by Daniel Bates.
535
536         Make use of new HIServices SPI to use a secondary AX thread.
537         Store root node/focused node status in IsolatedTree rather than on the element.
538         Implement the following attributes: children, parent, isIgnored, isTree, isTreeItem, relativeFrame, speechHint, title, description.
539         Implement hit-testing using relative-frames.
540         Ensure that WKAccessibilityWebPageObject queries happen on main thread when they need to.
541
542         * SourcesCocoa.txt:
543         * WebCore.xcodeproj/project.pbxproj:
544         * accessibility/AXObjectCache.cpp:
545         (WebCore::AXObjectCache::generateIsolatedAccessibilityTree):
546         * accessibility/AXObjectCache.h:
547         (WebCore::AXObjectCache::focusedUIElementForPage):
548         * accessibility/AccessibilityAttachment.cpp:
549         (WebCore::AccessibilityAttachment::accessibilityText const):
550         (WebCore::AccessibilityAttachment::accessibilityText): Deleted.
551         * accessibility/AccessibilityAttachment.h:
552         * accessibility/AccessibilityImageMapLink.cpp:
553         (WebCore::AccessibilityImageMapLink::accessibilityText const):
554         (WebCore::AccessibilityImageMapLink::accessibilityText): Deleted.
555         * accessibility/AccessibilityImageMapLink.h:
556         * accessibility/AccessibilityMediaControls.cpp:
557         (WebCore::AccessibilityMediaControl::accessibilityText const):
558         (WebCore::AccessibilityMediaControl::accessibilityText): Deleted.
559         * accessibility/AccessibilityMediaControls.h:
560         * accessibility/AccessibilityNodeObject.cpp:
561         (WebCore::AccessibilityNodeObject::accessibilityText const):
562         (WebCore::AccessibilityNodeObject::accessibilityText): Deleted.
563         * accessibility/AccessibilityNodeObject.h:
564         * accessibility/AccessibilityObject.cpp:
565         (WebCore::AccessibilityObject::convertFrameToSpace const):
566         (WebCore::AccessibilityObject::relativeFrame const):
567         (WebCore::AccessibilityObject::elementAccessibilityHitTest const):
568         (WebCore::AccessibilityObject::focusedUIElement const):
569         * accessibility/AccessibilityObject.h:
570         (WebCore::AccessibilityObject::accessibilityText const):
571         (WebCore::AccessibilityObject::isLink const): Deleted.
572         (WebCore::AccessibilityObject::isImage const): Deleted.
573         (WebCore::AccessibilityObject::isAttachment const): Deleted.
574         (WebCore::AccessibilityObject::isFileUploadButton const): Deleted.
575         (WebCore::AccessibilityObject::isImageMapLink const): Deleted.
576         (WebCore::AccessibilityObject::isMediaControlLabel const): Deleted.
577         (WebCore::AccessibilityObject::isTree const): Deleted.
578         (WebCore::AccessibilityObject::isTreeItem const): Deleted.
579         (WebCore::AccessibilityObject::isScrollbar const): Deleted.
580         (WebCore::AccessibilityObject::accessibilityHitTest const): Deleted.
581         (WebCore::AccessibilityObject::accessibilityText): Deleted.
582         (WebCore::AccessibilityObject::roleValue const): Deleted.
583         (WebCore::AccessibilityObject::wrapper const): Deleted.
584         * accessibility/AccessibilityObjectInterface.h: Replaced.
585         * accessibility/AccessibilityRenderObject.cpp:
586         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
587         (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest const):
588         (WebCore::AccessibilityRenderObject::elementAccessibilityHitTest const):
589         (WebCore::AccessibilityRenderObject::accessibilityHitTest const):
590         (WebCore::AccessibilityRenderObject::selectedChildren):
591         * accessibility/AccessibilityRenderObject.h:
592         * accessibility/AccessibilitySVGElement.cpp:
593         (WebCore::AccessibilitySVGElement::accessibilityText const):
594         (WebCore::AccessibilitySVGElement::accessibilityText): Deleted.
595         * accessibility/AccessibilitySVGElement.h:
596         * accessibility/AccessibilityScrollView.cpp:
597         (WebCore::AccessibilityScrollView::accessibilityHitTest const):
598         * accessibility/AccessibilityScrollView.h:
599         * accessibility/ios/AccessibilityObjectIOS.mm:
600         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
601         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
602         (-[WebAccessibilityObjectWrapper fileUploadButtonReturnsValueInTitle]): Deleted.
603         * accessibility/isolatedtree: Replaced.
604         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
605         (WebCore::AXIsolatedTree::treePageCache):
606         (WebCore::AXIsolatedTree::AXIsolatedTree):
607         (WebCore::AXIsolatedTree::nodeInTreeForID):
608         (WebCore::AXIsolatedTree::nodeForID const):
609         (WebCore::AXIsolatedTree::focusedUIElement):
610         (WebCore::AXIsolatedTree::setRootNodeID):
611         (WebCore::AXIsolatedTree::setFocusedNodeID):
612         (WebCore::AXIsolatedTree::setInitialRequestInProgress):
613         (WebCore::AXIsolatedTree::applyPendingChanges):
614         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
615         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
616         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
617         (WebCore::AXIsolatedTreeNode::~AXIsolatedTreeNode):
618         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
619         (WebCore::AXIsolatedTreeNode::setProperty):
620         (WebCore::AXIsolatedTreeNode::setParent):
621         (WebCore::AXIsolatedTreeNode::setTreeIdentifier):
622         (WebCore::AXIsolatedTreeNode::focusedUIElement const):
623         (WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const):
624         (WebCore::AXIsolatedTreeNode::accessibilityHitTest const):
625         (WebCore::AXIsolatedTreeNode::tree const):
626         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
627         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
628         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
629         * accessibility/mac/AXObjectCacheMac.mm:
630         (WebCore::AXObjectCache::associateIsolatedTreeNode):
631         * accessibility/mac/AccessibilityObjectBase.mm: Added.
632         (WebCore::AccessibilityObject::speechHintAttributeValue const):
633         (WebCore::AccessibilityObject::descriptionAttributeValue const):
634         (WebCore::AccessibilityObject::titleAttributeValue const):
635         (WebCore::AccessibilityObject::helpTextAttributeValue const):
636         * accessibility/mac/AccessibilityObjectMac.mm:
637         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
638         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
639         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
640         (addChildToArray):
641         (convertToNSArray):
642         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
643         (-[WebAccessibilityObjectWrapperBase detach]):
644         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
645         (-[WebAccessibilityObjectWrapperBase accessibilityObject]):
646         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
647         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
648         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
649         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
650         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
651         (convertPathToScreenSpaceFunction):
652         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
653         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
654         (-[WebAccessibilityObjectWrapperBase titleTagShouldBeUsedInDescriptionField]): Deleted.
655         (-[WebAccessibilityObjectWrapperBase fileUploadButtonReturnsValueInTitle]): Deleted.
656         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
657         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
658         (-[WebAccessibilityObjectWrapper childrenVectorSize]):
659         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
660         (-[WebAccessibilityObjectWrapper position]):
661         (-[WebAccessibilityObjectWrapper subrole]):
662         (-[WebAccessibilityObjectWrapper roleDescription]):
663         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
664         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
665         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
666         (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
667         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
668         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
669
670 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
671
672         Allow pages to trigger programmatic paste from script on iOS
673         https://bugs.webkit.org/show_bug.cgi?id=194271
674         <rdar://problem/47808810>
675
676         Reviewed by Ryosuke Niwa.
677
678         Add support for allowing script to trigger programmatic paste commands. Currently on macOS and iOS, the ability
679         to trigger programmatic paste (i.e. `document.execCommand('Paste');`) is disabled by default, such that
680         execCommand is simply a no-op that returns false. This policy is a privacy measure (common among other major
681         browsers) that prevents untrusted web content from sniffing content from the system pasteboard (even on user
682         interaction, since unintended user interaction occasionally happens as well!).
683
684         In order to make it possible for web pages to programmatically paste without opening the door to privacy and
685         security issues, we make paste commands triggered from bindings present platform UI on iOS, in the form of a
686         callout bar with the single option to paste. This UI is dismissed upon any user interaction; furthermore, any
687         user interaction short of explicitly triggering the "Paste" action subsequently prevents the page from executing
688         the paste (and causes execCommand to return false). However, if the paste action is chosen by the user, we
689         instead follow through with the programmatic paste command.
690
691         New tests to come in a followup patch.
692
693         * WebCore.xcodeproj/project.pbxproj:
694         * dom/DOMPasteAccessPolicy.h: Added.
695         * dom/UserGestureIndicator.h:
696         (WebCore::UserGestureToken::domPasteAccessPolicy const):
697         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
698
699         Add helpers on UserGestureToken to update and query the current DOM paste access policy. The access policies are
700         "NotRequestedYet" (i.e. pending a response from the user), "Granted" (the user has granted DOM paste access to
701         the page), or "Denied" (the user has prevented the page from reading the contents of the clipboard). When DOM
702         paste access is granted or rejected, make this decision sticky until the end of the current user gesture.
703
704         * editing/EditorCommand.cpp:
705         (WebCore::executePaste):
706         (WebCore::executePasteAndMatchStyle):
707         (WebCore::executePasteAsPlainText):
708         (WebCore::executePasteAsQuotation):
709
710         When executing a paste command where the source is DOM bindings, request DOM paste if needed before proceeding
711         with the paste.
712
713         (WebCore::supportedPaste):
714         * loader/EmptyClients.cpp:
715         * page/EditorClient.h:
716         * page/Frame.cpp:
717         (WebCore::Frame::requestDOMPasteAccess):
718
719         Add a helper method that requests access to the clipboard on behalf of script when pasting.
720
721         * page/Frame.h:
722         * page/Settings.yaml:
723
724         Introduce a new WebCore setting, used to gate DOM paste access requests.
725
726 2019-02-12  Alex Christensen  <achristensen@webkit.org>
727
728         Remove setDefersLoading infrastructure from WebKit2
729         https://bugs.webkit.org/show_bug.cgi?id=194506
730
731         Reviewed by Brady Eidson.
732
733         setDefersLoading is inherently racy from WebCore to the NetworkProcess,
734         it adds unwanted complexity to the initialization and use of network objects,
735         and it has led to many unrecoverable hang bugs over the years.
736         We needed to force it into WebKit2 to transition some existing clients who relied on it,
737         but we have recently finished transitioning those clients to other solutions, mostly
738         completion handlers.
739
740         * inspector/PageScriptDebugServer.cpp:
741         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
742
743 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
744
745         Unreviewed, fix build warnings after content extensions enablement
746         https://bugs.webkit.org/show_bug.cgi?id=193622
747         <rdar://problem/47982850>
748
749         * contentextensions/DFABytecode.h:
750         (WebCore::ContentExtensions::instructionSizeWithArguments):
751         * contentextensions/DFABytecodeCompiler.h:
752         * contentextensions/URLFilterParser.cpp:
753         (WebCore::ContentExtensions::URLFilterParser::statusString):
754
755 2019-02-12  Justin Fan  <justin_fan@apple.com>
756
757         [Web GPU] DepthStencilAttachment implementation
758         https://bugs.webkit.org/show_bug.cgi?id=194458
759         <rdar://problem/47932446>
760
761         Reviewed by Dean Jackson.
762
763         Implement ability to provide a depth attachment to the render pass encoder. Also implement
764         GPULoad/StoreOp and update color attachments' implementation for full functionality.
765
766         Test: webgpu/depth-enabled-triangle-strip.html
767
768         Update project files for new symbols:
769         * CMakeLists.txt:
770         * DerivedSources-input.xcfilelist:
771         * DerivedSources-output.xcfilelist:
772         * DerivedSources.make:
773         * Sources.txt:
774         * WebCore.xcodeproj/project.pbxproj:
775
776         * Modules/webgpu/GPUColor.idl: Renamed from WebGPUColor.idl
777         * Modules/webgpu/GPULoadOp.idl: Added. Interface for attachment operation enum.
778         * Modules/webgpu/GPUStoreOp.idl: Ditto.
779         * Modules/webpug/WebGPUColor.h: Removed.
780         * Modules/webgpu/WebGPUCommandBuffer.cpp: Refactored descriptor validation logic out of this file.
781         (WebCore::WebGPUCommandBuffer::beginRenderPass):
782         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Added. Now owns code for validating descriptors.
783         (WebCore::WebGPURenderPassDescriptor::validateAndConvertToGPUVersion const):
784         * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h/idl: Removed. Code moved into WebGPURenderPassDescriptor.
785         * Modules/webgpu/WebGPURenderPassDescriptor.h: Move sub-descriptor definitions into this file.
786         * Modules/webgpu/WebGPURenderPassDescriptor.idl: Ditto.
787         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Make depthStencilState optional to match API update.
788         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
789         * Modules/webgpu/WebGPUTextureView.h:
790         * platform/graphics/gpu/GPULoadOp.h: Added.
791         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Removed (moved into GPURenderPassDescriptor).
792         * platform/graphics/gpu/GPURenderPassDescriptor.h: Mirror WebGPU* changes.
793         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Make depthStencilState optional.
794         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
795         * platform/graphics/gpu/GPUStoreOp.h: Added.
796         * platform/graphics/gpu/GPUTexture.h:
797         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
798         (WebCore::loadActionForGPULoadOp): Added.
799         (WebCore::storeActionForGPUStoreOp): Added.
800         (WebCore::populateMtlColorAttachmentsArray): Added. Create all expected color attachments, rather than just the first.
801         (WebCore::populateMtlDepthStencilAttachment): Added.
802         (WebCore::GPURenderPassEncoder::create):
803         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Make depthStencilState optional.
804         (WebCore::GPURenderPipeline::create):
805
806 2019-02-12  David Kilzer  <ddkilzer@apple.com>
807
808         REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
809         <https://webkit.org/b/194529>
810         <rdar://problem/47924449>
811
812         Reviewed by Eric Carlson.
813
814         * SourcesCocoa.txt:
815         - Do not include DataDetectorsCoreSoftLink.mm in unified
816           sources.
817         * WebCore.xcodeproj/project.pbxproj:
818         - Add DataDetectorsCoreSoftLink.mm to the WebCore target now
819           that it isn't part of the unifed sources.
820         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
821         - Switch from using SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL() to
822           SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE() when linking
823           DataDetectorsCore.framework. None of the other macros assume
824           this framework is optional, and it was likely made optional
825           originally because the framework was new to iOS and thus
826           didn't exist on older versions.
827         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
828         - Change use of SOFT_LINK_CLASS_FOR_SOURCE() macros to
829           SOFT_LINK_CLASS() since the latter can only be used with
830           SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation).  This broke after
831           the fix for <wtf/SoftLinking.h> was applied.
832
833 2019-02-12  Youenn Fablet  <youenn@apple.com>
834
835         Make use of is<SubresourceLoader>
836         https://bugs.webkit.org/show_bug.cgi?id=194541
837
838         Reviewed by Alex Christensen.
839
840         No change of behavior.
841
842         * inspector/agents/InspectorNetworkAgent.cpp:
843         (WebCore::InspectorNetworkAgent::didReceiveResponse):
844         * loader/SubresourceLoader.h:
845         (isType):
846
847 2019-02-12  Mark Lam  <mark.lam@apple.com>
848
849         Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions.
850         https://bugs.webkit.org/show_bug.cgi?id=194530
851         <rdar://problem/47973274>
852
853         Reviewed by Chris Dumez.
854
855         This is needed to fix a null pointer dereference that arises from the following scenario:
856         1. a Document detaches from its StyleSheetList.
857         2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet
858            to be scanned and collected by the GC.
859         3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and
860            discovers a null owner pointer.
861
862         This patch fixes this issue by applying the following null checks:
863
864         1. Add a null check in JSNodeCustom.h's root().
865
866            root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm.
867            isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result
868            to root().  However, depending on which class the ownerNode() method belongs to,
869            it can either return a pointer or a reference.  The null check only makes sense
870            in the pointer case.
871
872            To accommodate the 2 forms, root() itself is has an overload that takes a
873            reference instead of a pointer.
874
875            Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode()
876            returns, it can't discern when the result is a pointer and apply the null check.
877            Instead, we just add the null check to the version of root() that takes a
878            pointer.  If the node pointer is null, we'll return a null opaque root.
879
880         2. Fix CodeGeneratorJS.pm to null check the opaque root before using it.
881
882         * bindings/js/JSNodeCustom.h:
883         (WebCore::root):
884         * bindings/scripts/CodeGeneratorJS.pm:
885         (GenerateImplementation):
886         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
887         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
888
889 2019-02-12  Andy Estes  <aestes@apple.com>
890
891         [iOSMac] Enable Parental Controls Content Filtering
892         https://bugs.webkit.org/show_bug.cgi?id=194521
893         <rdar://39732376>
894
895         Reviewed by Tim Horton.
896
897         * Configurations/FeatureDefines.xcconfig:
898         * platform/ContentFilterUnblockHandler.h:
899         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
900         * platform/cocoa/ParentalControlsContentFilter.mm:
901
902 2019-02-11  Jer Noble  <jer.noble@apple.com>
903
904         Unreviewed build fix; add a HAVE_CELESTIAL guard around Celestial framework usage.
905
906         * platform/audio/ios/MediaSessionManagerIOS.h:
907         * platform/audio/ios/MediaSessionManagerIOS.mm:
908         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
909
910 2019-02-12  Antti Koivisto  <antti@apple.com>
911
912         Crash in WebCore::ScrollingTree::updateTreeFromStateNode
913         https://bugs.webkit.org/show_bug.cgi?id=194538
914         <rdar://problem/47841926>
915
916         Reviewed by Zalan Bujtas.
917
918         * page/scrolling/ScrollingTree.cpp:
919         (WebCore::ScrollingTree::updateTreeFromStateNode):
920
921         Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent.
922
923 2019-02-12  Zalan Bujtas  <zalan@apple.com>
924
925         [LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
926         https://bugs.webkit.org/show_bug.cgi?id=194540
927
928         Reviewed by Antti Koivisto.
929
930         Use FormattingContext::computeBorderAndPadding instead.
931
932         * layout/FormattingContext.cpp:
933         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
934         * layout/FormattingContext.h:
935         * layout/inlineformatting/InlineFormattingContext.cpp:
936         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
937         * layout/inlineformatting/InlineFormattingContext.h:
938
939 2019-02-12  Zalan Bujtas  <zalan@apple.com>
940
941         [LFC][IFC] Add intrinsic width support for float boxes.
942         https://bugs.webkit.org/show_bug.cgi?id=194528
943
944         Reviewed by Antti Koivisto.
945
946         This patch implements a very simple float box support for intrinsic width.
947
948         * layout/inlineformatting/InlineFormattingContext.cpp:
949         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
950         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
951         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
952         (WebCore::Layout::InlineFormattingContext::computeMargin const):
953         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const): Deleted.
954         * layout/inlineformatting/InlineFormattingContext.h:
955
956 2019-02-12  Rob Buis  <rbuis@igalia.com>
957
958         Implement serializing in MIME type parser
959         https://bugs.webkit.org/show_bug.cgi?id=193909
960
961         Reviewed by Darin Adler.
962
963         Implement serializing in MIME type parser [1], to preserve the parameter
964         order the Vector m_parameterNames is introduced, since HashMaps do not
965         guarantee any order.
966
967         Test: ParsedContentType.Serialize
968
969         [1] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
970
971         * platform/network/ParsedContentType.cpp:
972         (WebCore::skipSpaces):
973         (WebCore::parseQuotedString):
974         (WebCore::ParsedContentType::parseContentType):
975         (WebCore::ParsedContentType::parameterValueForName const):
976         (WebCore::ParsedContentType::parameterCount const):
977         (WebCore::ParsedContentType::setContentType):
978         (WebCore::ParsedContentType::setContentTypeParameter):
979         (WebCore::ParsedContentType::serialize const):
980         * platform/network/ParsedContentType.h:
981
982 2019-02-08  Chris Fleizach  <cfleizach@apple.com>
983
984         AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc
985         https://bugs.webkit.org/show_bug.cgi?id=182280
986         <rdar://problem/37018386>
987
988         Reviewed by Alan Bujtas.
989
990         Remove the possibility that changing children calls back into updating layout by
991         handling children changes in a deferred manner.
992
993         This follows the same architecture as many other deferred changes, but also requires us to check deferred changes
994         in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children.
995
996         A few tests had to be modified to no longer change the tree and then check the children immediately. 
997
998         * accessibility/AXObjectCache.cpp:
999         (WebCore::AXObjectCache::remove):
1000         (WebCore::AXObjectCache::childrenChanged):
1001         (WebCore::AXObjectCache::prepareForDocumentDestruction):
1002         (WebCore::AXObjectCache::performDeferredCacheUpdate):
1003         * accessibility/AXObjectCache.h:
1004         * accessibility/AccessibilityObject.cpp:
1005         (WebCore::AccessibilityObject::updateBackingStore):
1006         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1007         (convertToNSArray):
1008         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1009
1010 2019-02-11  Myles C. Maxfield  <mmaxfield@apple.com>
1011
1012         [Cocoa] Ask platform for generic font family mappings
1013         https://bugs.webkit.org/show_bug.cgi?id=187723
1014         <rdar://problem/41892438>
1015
1016         Reviewed by Brent Fulgham.
1017
1018         WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
1019         When trying to style a character with a generic font family, we first look to see if
1020         we have a mapping for the particular script the character is rendered with, and if we
1021         don't find a match, we then check USCRIPT_COMMON.
1022
1023         In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
1024         the only scripts which won't use the API families) is in
1025         SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
1026         for the CJK scripts.
1027
1028         The mappings inside SettingsBase are incorrect and conflict with our policy regarding
1029         user-installed fonts. Instead, we should be consulting with the platform for some of
1030         these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
1031         API still has to work to set the mappings for untagged content. Therefore, we use the
1032         system mappings for language-tagged content, and the API mappings for non-language-tagged
1033         content. This is a good balance that makes sure we always have a good mapping for every
1034         language, but API clients can still set the mappings, too.
1035
1036         Test: fast/text/ja-sans-serif.html
1037
1038         * css/CSSComputedStyleDeclaration.cpp:
1039         * css/CSSFontSelector.cpp:
1040         (WebCore::resolveGenericFamily):
1041         * css/parser/CSSPropertyParser.cpp:
1042         (WebCore::consumeFontFamily):
1043         * page/cocoa/SettingsBaseCocoa.mm:
1044         (WebCore::SettingsBase::initializeDefaultFontFamilies):
1045         (WebCore::osakaMonoIsInstalled): Deleted.
1046         * platform/graphics/FontDescription.cpp:
1047         (WebCore::FontDescription::platformResolveGenericFamily):
1048         * platform/graphics/FontDescription.h:
1049         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1050         (WebCore::computeSpecializedChineseLocale):
1051         (WebCore::cachedSpecializedChineseLocale):
1052         (WebCore::languageChanged):
1053         (WebCore::FontDescription::platformResolveGenericFamily):
1054         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1055         (WebCore::SystemFontDatabaseCoreText::clear):
1056         (WebCore::genericFamily):
1057         (WebCore::SystemFontDatabaseCoreText::serifFamily):
1058         (WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
1059         (WebCore::SystemFontDatabaseCoreText::cursiveFamily):
1060         (WebCore::SystemFontDatabaseCoreText::fantasyFamily):
1061         (WebCore::SystemFontDatabaseCoreText::monospaceFamily):
1062         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
1063
1064 2019-02-11  Adrian Perez de Castro  <aperez@igalia.com>
1065
1066         [GTK][WPE] Add content extensions support in WKTR and unskip layout tests
1067         https://bugs.webkit.org/show_bug.cgi?id=193622
1068
1069         Reviewed by Michael Catanzaro.
1070
1071         No new tests needed.
1072
1073         * SourcesCocoa.txt: Remove loader/ResourceLoadInfo.cpp, it's not Cocoa-specific anymore.
1074         * Sources.txt: Add loader/ResourceLoadInfo.cpp, all ports use it now.
1075
1076 2019-02-11  Daniel Bates  <dabates@apple.com>
1077
1078         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1079         https://bugs.webkit.org/show_bug.cgi?id=191446
1080         <rdar://problem/45929460>
1081
1082         Reviewed by Tim Horton.
1083
1084         Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
1085         on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
1086         to be passed to WebKit.
1087
1088         Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
1089                fast/events/touch/ios/pointer-events-with-modifiers.html
1090                fast/events/touch/ios/touch-events-with-modifiers.html
1091
1092         * platform/ios/PlatformEventFactoryIOS.mm:
1093         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1094         * platform/ios/WebEvent.h:
1095         * platform/ios/WebEvent.mm:
1096         (-[WebEvent initWithMouseEventType:timeStamp:location:]):
1097         (-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
1098
1099 2019-02-11  Jer Noble  <jer.noble@apple.com>
1100
1101         [Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
1102         https://bugs.webkit.org/show_bug.cgi?id=194504
1103
1104         Reviewed by Eric Carlson.
1105
1106         This allows the MediaRemote framework to associate the WebContent process with its host application.
1107
1108         * Modules/mediastream/UserMediaRequest.cpp:
1109         (WebCore::UserMediaRequest::start):
1110         * platform/audio/PlatformMediaSessionManager.h:
1111         (WebCore::PlatformMediaSessionManager::prepareToSendUserMediaPermissionRequest):
1112         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
1113         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1114         (MediaSessionManagerCocoa::prepareToSendUserMediaPermissionRequest):
1115         (MediaSessionManagerCocoa::providePresentingApplicationPIDIfNecessary):
1116         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1117
1118 2019-02-11  Commit Queue  <commit-queue@webkit.org>
1119
1120         Unreviewed, rolling out r241272 and r241276.
1121         https://bugs.webkit.org/show_bug.cgi?id=194514
1122
1123         Broke the Apple Internal build and the fix requires human
1124         intervention :( (Requested by dydz on #webkit).
1125
1126         Reverted changesets:
1127
1128         "[iOS] Mouse/Touch/Pointer events are missing modifier keys"
1129         https://bugs.webkit.org/show_bug.cgi?id=191446
1130         https://trac.webkit.org/changeset/241272
1131
1132         "Fix internal iOS build after r241272"
1133         https://bugs.webkit.org/show_bug.cgi?id=191446
1134         https://trac.webkit.org/changeset/241276
1135
1136 2019-02-11  Alex Christensen  <achristensen@webkit.org>
1137
1138         Stop using setDefersLoading from WebCore
1139         https://bugs.webkit.org/show_bug.cgi?id=194315
1140
1141         Reviewed by Jer Noble.
1142
1143         That is what CompletionHandlers are for.
1144
1145         * loader/MediaResourceLoader.cpp:
1146         (WebCore::MediaResource::responseReceived):
1147         (WebCore::MediaResource::setDefersLoading): Deleted.
1148         * loader/MediaResourceLoader.h:
1149         * platform/graphics/PlatformMediaResourceLoader.h:
1150         (WebCore::PlatformMediaResourceClient::responseReceived):
1151         (WebCore::PlatformMediaResource::stop):
1152         (WebCore::PlatformMediaResource::setDefersLoading): Deleted.
1153         * platform/network/cocoa/WebCoreNSURLSession.mm:
1154         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
1155         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
1156         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
1157         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
1158
1159 2019-02-11  Daniel Bates  <dabates@apple.com>
1160
1161         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1162         https://bugs.webkit.org/show_bug.cgi?id=191446
1163         <rdar://problem/45929460>
1164
1165         Reviewed by Tim Horton.
1166
1167         Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
1168         on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
1169         to be passed to WebKit.
1170
1171         Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
1172                fast/events/touch/ios/pointer-events-with-modifiers.html
1173                fast/events/touch/ios/touch-events-with-modifiers.html
1174
1175         * platform/ios/PlatformEventFactoryIOS.mm:
1176         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1177         * platform/ios/WebEvent.h:
1178         * platform/ios/WebEvent.mm:
1179         (-[WebEvent initWithMouseEventType:timeStamp:location:]):
1180         (-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
1181
1182 2019-02-11  Daniel Bates  <dabates@apple.com>
1183
1184         Separate out outline-style: auto user-agent appearance from Mac animated focus ring drawing
1185         https://bugs.webkit.org/show_bug.cgi?id=193591
1186
1187         Reviewed by Simon Fraser.
1188
1189         Untangle the Mac-specific concept of animated focus ring drawing from the concepts of using
1190         the fancy shrink-wrapped focus ring appearance and using the platform focus ring color when
1191         outline-style: auto.
1192
1193         No functionality changed. So, no new tests.
1194
1195         * platform/graphics/GraphicsContext.h:
1196         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1197         (WebCore::drawFocusRing):
1198         (WebCore::drawFocusRingToContextAtTime):
1199         Change some macro guards.
1200
1201         * rendering/RenderElement.cpp:
1202         (WebCore::usePlatformFocusRingColorForOutlineStyleAuto): Added.
1203         (WebCore::useShrinkWrappedFocusRingForOutlineStyleAuto): Added.
1204         (WebCore::drawFocusRing): Added.
1205         (WebCore::RenderElement::paintFocusRing): Write in terms of drawFocusRing().
1206
1207 2019-02-11  Truitt Savell  <tsavell@apple.com>
1208
1209         Unreviewed, rolling out r241229.
1210
1211         Revision broke internal builds for watchOS.
1212
1213         Reverted changeset:
1214
1215         "[Cocoa] Ask platform for generic font family mappings"
1216         https://bugs.webkit.org/show_bug.cgi?id=187723
1217         https://trac.webkit.org/changeset/241229
1218
1219 2019-02-11  Youenn Fablet  <youenn@apple.com>
1220
1221         Make Request constructor throw if FetchRequestInit.signal is not undefined, null or an AbortSignal object
1222         https://bugs.webkit.org/show_bug.cgi?id=194404
1223         <rdar://problem/47891915>
1224
1225         Reviewed by Geoffrey Garen.
1226
1227         Align with the spec, except for known problematic web sites.
1228         Covered by updated test.
1229
1230         * Modules/fetch/FetchRequest.cpp:
1231         (WebCore::needsSignalQuirk):
1232         (WebCore::processInvalidSignal):
1233         (WebCore::FetchRequest::initializeWith):
1234
1235 2019-02-11  Zalan Bujtas  <zalan@apple.com>
1236
1237         [LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontalValues
1238         https://bugs.webkit.org/show_bug.cgi?id=194490
1239
1240         Reviewed by Antti Koivisto.
1241
1242         This is in preparation for adding floating preferred width computation support. It requires height computaiton
1243         which uses containing block width to resolve vertical margins.
1244
1245         * layout/FormattingContext.cpp:
1246         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1247         * layout/FormattingContext.h:
1248         * layout/FormattingContextGeometry.cpp:
1249         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1250         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1251         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1252         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
1253         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1254         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
1255         * layout/FormattingContextQuirks.cpp:
1256         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1257         * layout/LayoutUnits.h:
1258         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
1259         * layout/blockformatting/BlockFormattingContext.cpp:
1260         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1261         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1262         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1263         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1264         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1265         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1266         * layout/blockformatting/BlockMarginCollapse.cpp:
1267         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
1268         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
1269         * layout/inlineformatting/InlineFormattingContext.cpp:
1270         (WebCore::Layout::InlineFormattingContext::layout const):
1271         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1272         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1273         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
1274
1275 2019-02-11  Zalan Bujtas  <zalan@apple.com>
1276
1277         [LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrinsic widths consistently.
1278         https://bugs.webkit.org/show_bug.cgi?id=194483
1279
1280         Reviewed by Antti Koivisto.
1281
1282         Rename intrinsicWidthConstraints to computeIntrinsicWidthConstraints (it does not return the width values anymore).
1283
1284         * layout/FormattingContext.h:
1285         * layout/FormattingContextGeometry.cpp:
1286         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1287         * layout/blockformatting/BlockFormattingContext.cpp:
1288         (WebCore::Layout::BlockFormattingContext::computeIntrinsicWidthConstraints const):
1289         (WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const): Deleted.
1290         * layout/blockformatting/BlockFormattingContext.h:
1291         * layout/inlineformatting/InlineFormattingContext.cpp:
1292         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
1293         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
1294         (WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const): Deleted.
1295         * layout/inlineformatting/InlineFormattingContext.h:
1296
1297 2019-02-10  Zalan Bujtas  <zalan@apple.com>
1298
1299         [LFC] Fix spelling error.
1300         https://bugs.webkit.org/show_bug.cgi?id=194489
1301
1302         Reviewed by Simon Fraser.
1303
1304         instrinsic -> intrinsic
1305
1306         * layout/FormattingContext.h:
1307         * layout/FormattingContextGeometry.cpp:
1308         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1309         * layout/FormattingState.h:
1310         (WebCore::Layout::FormattingState::setIntrinsicWidthConstraints):
1311         (WebCore::Layout::FormattingState::clearIntrinsicWidthConstraints):
1312         (WebCore::Layout::FormattingState::intrinsicWidthConstraints const):
1313         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints): Deleted.
1314         (WebCore::Layout::FormattingState::clearInstrinsicWidthConstraints): Deleted.
1315         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const): Deleted.
1316         * layout/blockformatting/BlockFormattingContext.cpp:
1317         (WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const):
1318         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): Deleted.
1319         * layout/blockformatting/BlockFormattingContext.h:
1320         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1321         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraintsNeedChildrenWidth):
1322         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
1323         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth): Deleted.
1324         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): Deleted.
1325         * layout/inlineformatting/InlineFormattingContext.cpp:
1326         (WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const):
1327         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
1328         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): Deleted.
1329         * layout/inlineformatting/InlineFormattingContext.h:
1330
1331 2019-02-10  Darin Adler  <darin@apple.com>
1332
1333         Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
1334         https://bugs.webkit.org/show_bug.cgi?id=194485
1335
1336         Reviewed by Daniel Bates.
1337
1338         * Modules/websockets/WebSocket.cpp:
1339         (WebCore::encodeProtocolString): Use appendUnsignedAsHexFixedSize instead of String::format.
1340
1341         * css/parser/CSSParserToken.cpp:
1342         (WebCore::CSSParserToken::serialize const): Fixed style of many return statements
1343         that called a function returning void; doesn't match WebKit's prevailing style.
1344         Also use break instead of return. Used appendLiteral instead of append in many
1345         cases, and append character instead of single-character literal in others.
1346         Use appendUnsignedAsHex instead of String::format.
1347
1348         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1349         (WebCore::generateHashedName): Use appendUnsignedAsHex instad of appendUnsigned64AsHex.
1350         Should come back here and use makeString once we make HexNumber.h work with that.
1351
1352         * platform/mac/WebCoreNSURLExtras.mm: Removed unnecessary include of HexNumber.h.
1353
1354         * rendering/RenderTreeAsText.cpp:
1355         (WebCore::quoteAndEscapeNonPrintables): Use appendLiteral instead of multiple calls
1356         to character append. Touched because it was next to a call to appendUnsignedAsHex.
1357
1358 2019-02-10  Pablo Saavedra  <psaavedra@igalia.com>
1359
1360         libWPEWebKit-0.1.so: undefined reference to `JSC::JSValue::asCell() const
1361         https://bugs.webkit.org/show_bug.cgi?id=194484
1362
1363         Reviewed by Darin Adler.
1364
1365         * bindings/js/JSUndoItemCustom.cpp:
1366
1367 2019-02-10  Philippe Normand  <pnormand@igalia.com>
1368
1369         Unreviewed, GTK Debug build fix after r241148.
1370
1371         * Modules/mediasource/SourceBuffer.cpp:
1372         (WebCore::removeSamplesFromTrackBuffer):
1373         SourceBuffer::logClassName and friends are declared for
1374         !RELEASE_LOG_DISABLED builds so adapt calling sites accordingly.
1375
1376 2019-02-10  Zalan Bujtas  <zalan@apple.com>
1377
1378         [LFC][IFC] Add intrinsic width support for inline-block boxes
1379         https://bugs.webkit.org/show_bug.cgi?id=194479
1380
1381         Reviewed by Antti Koivisto.
1382
1383         Compute the intrinsic width for the inline-block (formatting context root) and set it as the content box width while
1384         laying out the content for the min/max width.
1385
1386         <div style="position: absolute">before<span id=inline-block style="display: inline-block">inline_block content<span>after</div>
1387
1388         The "inline-block" formatting root returns "inline_block" width for the minimum and "inline_block width" for
1389         the maximum width. These min/max values are used to figure out the intrinsic width for the parent <div>.
1390
1391         * layout/inlineformatting/InlineFormattingContext.cpp:
1392         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1393         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
1394         (WebCore::Layout::InlineFormattingContext::computeMargin const):
1395         * layout/inlineformatting/InlineFormattingContext.h:
1396         * page/FrameViewLayoutContext.cpp:
1397         (WebCore::layoutUsingFormattingContext):
1398
1399 2019-02-10  Zalan Bujtas  <zalan@apple.com>
1400
1401         [LFC][IFC] Add intrinsic width support for replaced boxes
1402         https://bugs.webkit.org/show_bug.cgi?id=194478
1403
1404         Reviewed by Antti Koivisto.
1405
1406         * layout/inlineformatting/InlineFormattingContext.cpp:
1407         (WebCore::Layout::InlineFormattingContext::layout const):
1408         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1409         (WebCore::Layout::InlineFormattingContext::computeMargin const):
1410         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
1411         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1412         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
1413         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const): Deleted.
1414         * layout/inlineformatting/InlineFormattingContext.h:
1415
1416 2019-02-10  Alicia Boya García  <aboya@igalia.com>
1417
1418         [MSE][GStreamer] Add missing return type to lambda
1419         https://bugs.webkit.org/show_bug.cgi?id=194414
1420
1421         Reviewed by Darin Adler.
1422
1423         Since g_signal_connect() is untyped, a compiler error was not
1424         generated when a lambda with a missing GstFlowReturn return type was
1425         provided for a signal that expects it.
1426
1427         This used to work before r240784 because a recent function call had
1428         set GST_FLOW_OK in the return value register and it happened to
1429         survive until the lambda function call ended. Starting on that commit
1430         such return value was removed and it stopped working on debug.
1431
1432         Of course, the actual problem is in the signature of the lambda
1433         function, and this patch fixes that.
1434
1435         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1436         (WebCore::AppendPipeline::AppendPipeline):
1437
1438 2019-02-09  Darin Adler  <darin@apple.com>
1439
1440         Eliminate unnecessary String temporaries by using StringConcatenateNumbers
1441         https://bugs.webkit.org/show_bug.cgi?id=194021
1442
1443         Reviewed by Geoffrey Garen.
1444
1445         For floating point numbers, String::number gives a fixed precision result,
1446         stripping trailing zeroes. When possible, I changed the code to instead use the
1447         equivalent of String::numberToStringECMAScript, which is what makeString does by
1448         default for floating point, gives the same results for many cases, and gives
1449         better results in many others. However, for floats, we do not yet have a good
1450         implementation, so instead I used FormattedNumber::fixedPrecision to match
1451         the old behavior.
1452
1453         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
1454         (WebCore::IDBTransactionInfo::loggingString const): Remove String::number and let
1455         makeString do the conversion without allocating/destroying a String.
1456         * Modules/websockets/ThreadableWebSocketChannel.cpp:
1457         (WebCore::ThreadableWebSocketChannel::create): Ditto.
1458         * Modules/websockets/WebSocket.cpp:
1459         (WebCore::WebSocket::connect): Ditto. Added a cast to "unsigned" to sidestep the
1460         ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
1461         and sometimes used for UTF-16 code units (UChar) and can be the same type.
1462
1463         * Modules/websockets/WebSocketChannel.cpp:
1464         (WebCore::WebSocketChannel::didFailSocketStream): Use ASCIILiteral when intializing
1465         a string instead of just a normal C literal. Switched to makeString so we could
1466         remove String::number and do the conversion without allocating/destroying a String.
1467         (WebCore::WebSocketChannel::didFail): Ditto.
1468         (WebCore::WebSocketChannel::processFrame): Ditto.
1469         * Modules/websockets/WebSocketFrame.cpp:
1470         (WebCore::WebSocketFrame::parseFrame): Ditto.
1471         * Modules/websockets/WebSocketHandshake.cpp:
1472         (WebCore::WebSocketHandshake::readServerHandshake): Ditto.
1473         * accessibility/AccessibilityRenderObject.cpp:
1474         (WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA const): Ditto.
1475         * bindings/js/JSDOMConvertNumbers.cpp:
1476         (WebCore::rangeErrorString): Ditto.
1477         * css/CSSAspectRatioValue.cpp:
1478         (WebCore::CSSAspectRatioValue::customCSSText const): Ditto. Used
1479         FormattedNumber::fixedPrecision since these are floats.
1480
1481         * css/DOMMatrixReadOnly.cpp:
1482         (WebCore::DOMMatrixReadOnly::toString const): Use
1483         StringBuilder::builder.appendECMAScriptNumber instead of
1484         String::numberToStringECMAScript so we can do it without allocating/destroying
1485         a String.
1486         * css/WebKitCSSMatrix.cpp:
1487         (WebCore::WebKitCSSMatrix::toString const): Ditto.
1488
1489         * dom/MessagePortIdentifier.h:
1490         (WebCore::MessagePortIdentifier::logString const): Remove String::number and let
1491         makeString do the conversion without allocating/destroying a String.
1492
1493         * editing/cocoa/DataDetection.mm:
1494         (WebCore::dataDetectorStringForPath): Remove unnecessary type casts on values
1495         passed to String::number and to StringBuilder::appendNumber. These could do
1496         harm if the values were out of range, and should not be necessary.
1497
1498         * history/BackForwardItemIdentifier.h:
1499         (WebCore::BackForwardItemIdentifier::logString const): Remove String::number
1500         and let makeString do the conversion without allocating/destroying a String.
1501         * html/FTPDirectoryDocument.cpp:
1502         (WebCore::processFileDateString): Ditto.
1503         * html/canvas/WebGLRenderingContextBase.cpp:
1504         (WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto.
1505         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Ditto.
1506         * inspector/agents/WebConsoleAgent.cpp:
1507         (WebCore::WebConsoleAgent::didReceiveResponse): Ditto.
1508         * loader/WorkerThreadableLoader.cpp:
1509         (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Ditto.
1510         * loader/appcache/ApplicationCacheGroup.cpp:
1511         (WebCore::ApplicationCacheGroup::didFailLoadingManifest): Ditto.
1512         * page/PageSerializer.cpp:
1513         (WebCore::PageSerializer::urlForBlankFrame): Ditto.
1514         * page/PrintContext.cpp:
1515         (WebCore::PrintContext::pageProperty): Ditto.
1516         (WebCore::PrintContext::pageSizeAndMarginsInPixels): Ditto.
1517
1518         * page/WheelEventTestTrigger.cpp:
1519         (WebCore::dumpState): Use StringBuilder::appendNumber instead of
1520         String::number so we can do it without allocating/destroying a String.
1521         Also use StringBuilder::appendLiteral on a literal.
1522
1523         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1524         (WebCore::ResourceUsageOverlay::platformDraw): Pass explicit
1525         KeepTrailingZeros to FormattedNumber::fixedPrecision to preserve behavior,
1526         since default is now to truncate trailing zeros.
1527
1528         * platform/graphics/Color.cpp:
1529         (WebCore::Color::cssText): Use StringBuilder::appendNumber instead of
1530         calling numberToFixedPrecisionString to do the same thing.
1531         * platform/graphics/ExtendedColor.cpp:
1532         (WebCore::ExtendedColor::cssText): Ditto.
1533
1534         * platform/graphics/ca/GraphicsLayerCA.cpp:
1535         (WebCore::animationIdentifier): Remove String::number and let makeString
1536         do the conversion without allocating/destroying a String. Had to add
1537         a typecast to convert the enumeration into an integer.
1538         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
1539         (WebCore::PlatformCAFilters::setFiltersOnLayer): Ditto.
1540         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1541         (WebCore::FontPlatformData::description const): Ditto.
1542
1543         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1544         (WebCore::MockMediaSample::MockMediaSample): Use AtomicString::number
1545         instead of String::number to avoid unneccessarily allocating an additional
1546         temporary String when an AtomicString already exists.
1547
1548         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1549         (WebCore::SocketStreamHandleImpl::reportErrorToClient): Remove String::number
1550         and let makeString do the conversion without allocating/destroying a String.
1551         * platform/sql/SQLiteDatabase.cpp:
1552         (WebCore::SQLiteDatabase::setMaximumSize): Ditto.
1553         (WebCore::SQLiteDatabase::setSynchronous): Ditto. Had to add a typecast to
1554         convert the enumeration into an integer.
1555         * svg/SVGAngleValue.cpp:
1556         (WebCore::SVGAngleValue::valueAsString const): Ditto.
1557         * svg/SVGLengthValue.cpp:
1558         (WebCore::SVGLengthValue::valueAsString const): Ditto.
1559         * testing/Internals.cpp:
1560         (WebCore::Internals::configurationForViewport): Ditto. Used
1561         FormattedNumber::fixedPrecision since these are floats.
1562         (WebCore::Internals::getCurrentCursorInfo): Use StringBuilder::appendNumber
1563         instead of calling numberToFixedPrecisionString to do the same thing.
1564         (WebCore::Internals::queueMicroTask): Remove String::number and let makeString
1565         do the conversion without allocating/destroying a String.
1566         (WebCore::appendOffsets): Use StringBuilder::appendNumber instead of
1567         String::number so we can do it without allocating/destroying a String.
1568
1569         * workers/service/ServiceWorkerClientIdentifier.h:
1570         (WebCore::ServiceWorkerClientIdentifier::toString const): Remove String::number
1571         and let makeString do the conversion without allocating/destroying a String.
1572         * workers/service/server/RegistrationDatabase.cpp:
1573         (WebCore::databaseFilenameFromVersion): Ditto.
1574
1575 2019-02-09  Zalan Bujtas  <zalan@apple.com>
1576
1577         [LFC][IFC] Add intrinsic width support for basic inline containers
1578         https://bugs.webkit.org/show_bug.cgi?id=194473
1579
1580         Reviewed by Antti Koivisto.
1581
1582         Preferred width computation logic is very similar to normal layout.
1583         One of the main difference is that the preferred width codepath does not provide valid containing block width.
1584         This patch implement basic inline container support by passing nullopt containing block width in UsedHorizontalValues. 
1585
1586         * layout/inlineformatting/InlineFormattingContext.cpp:
1587         (WebCore::Layout::InlineFormattingContext::layout const):
1588         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1589         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
1590         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
1591         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
1592         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1593         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
1594         * layout/inlineformatting/InlineFormattingContext.h:
1595
1596 2019-02-08  Myles C. Maxfield  <mmaxfield@apple.com>
1597
1598         [Cocoa] CTLineGetGlyphRuns() might return nullptr
1599         https://bugs.webkit.org/show_bug.cgi?id=194467
1600         <rdar://problem/42423999>
1601
1602         Reviewed by Simon Fraser.
1603
1604         Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future.
1605
1606         Covered by find/text/find-backwards.html
1607
1608         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1609         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1610
1611 2019-02-08  Myles C. Maxfield  <mmaxfield@apple.com>
1612
1613         [Cocoa] Ask platform for generic font family mappings
1614         https://bugs.webkit.org/show_bug.cgi?id=187723
1615         <rdar://problem/41892438>
1616
1617         Reviewed by Brent Fulgham.
1618
1619         WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
1620         When trying to style a character with a generic font family, we first look to see if
1621         we have a mapping for the particular script the character is rendered with, and if we
1622         don't find a match, we then check USCRIPT_COMMON.
1623
1624         In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
1625         the only scripts which won't use the API families) is in
1626         SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
1627         for the CJK scripts.
1628
1629         The mappings inside SettingsBase are incorrect and conflict with our policy regarding
1630         user-installed fonts. Instead, we should be consulting with the platform for some of
1631         these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
1632         API still has to work to set the mappings for untagged content. Therefore, we use the
1633         system mappings for language-tagged content, and the API mappings for non-language-tagged
1634         content. This is a good balance that makes sure we always have a good mapping for every
1635         language, but API clients can still set the mappings, too.
1636
1637         Test: fast/text/ja-sans-serif.html
1638
1639         * css/CSSComputedStyleDeclaration.cpp:
1640         * css/CSSFontSelector.cpp:
1641         (WebCore::resolveGenericFamily):
1642         * css/parser/CSSPropertyParser.cpp:
1643         (WebCore::consumeFontFamily):
1644         * page/cocoa/SettingsBaseCocoa.mm:
1645         (WebCore::SettingsBase::initializeDefaultFontFamilies):
1646         (WebCore::osakaMonoIsInstalled): Deleted.
1647         * platform/graphics/FontDescription.cpp:
1648         (WebCore::FontDescription::platformResolveGenericFamily):
1649         * platform/graphics/FontDescription.h:
1650         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1651         (WebCore::computeSpecializedChineseLocale):
1652         (WebCore::cachedSpecializedChineseLocale):
1653         (WebCore::languageChanged):
1654         (WebCore::FontDescription::platformResolveGenericFamily):
1655         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1656         (WebCore::SystemFontDatabaseCoreText::clear):
1657         (WebCore::SystemFontDatabaseCoreText::serifFamily):
1658         (WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
1659         (WebCore::SystemFontDatabaseCoreText::cursiveFamily):
1660         (WebCore::SystemFontDatabaseCoreText::fantasyFamily):
1661         (WebCore::SystemFontDatabaseCoreText::monospaceFamily):
1662         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
1663
1664 2019-02-08  Yusuke Suzuki  <ysuzuki@apple.com>
1665
1666         [JSC] Shrink sizeof(CodeBlock) more
1667         https://bugs.webkit.org/show_bug.cgi?id=194419
1668
1669         Reviewed by Mark Lam.
1670
1671         * testing/Internals.cpp:
1672         (WebCore::Internals::parserMetaData):
1673
1674 2019-02-08  Chris Dumez  <cdumez@apple.com>
1675
1676         [Cocoa] Optimize ResourceResponse::platformLazyInit()
1677         https://bugs.webkit.org/show_bug.cgi?id=194438
1678
1679         Reviewed by Alex Christensen.
1680
1681         Optimize ResourceResponse::platformLazyInit(). Most of the CPU time currently goes into getting the
1682         HTTP headers from CFNetwork:
1683         """
1684         Sample Count, Samples %, CPU %, Symbol
1685         46, 0.0%, 0.0%, WebCore::initializeHTTPHeaders(WebCore::OnlyCommonHeaders, NSHTTPURLResponse*, WebCore::HTTPHeaderMap&) (in WebCore)
1686         34, 0.0%, 0.0%,     HTTPHeaderDict::copyAsOrdinaryDict(__CFAllocator const*) const (in CFNetwork)
1687         11, 0.0%, 0.0%,     CFDictionaryApplyFunction (in CoreFoundation)
1688         """
1689
1690         We currently have 2 levels of initialization: CommonFieldsOnly & AllFields. With WebKit2, most ResourceResponses get sent over IPC
1691         and thus end up getting initialized twice, once with CommonFieldsOnly and then with AllFields.
1692         This would cause us to call the expensive HTTPHeaderDict::copyAsOrdinaryDict() twice instead of once, simply to initialize the common
1693         HTTP headers first and then the uncommon ones later.
1694
1695         This patch updates ResourceResponse::platformLazyInit() to initialize all HTTP headers at once, as soon as CommonFieldsOnly
1696         initialization is requested, so that we no longer copy all HTTP headers twice.
1697
1698         * platform/network/cocoa/ResourceResponseCocoa.mm:
1699         (WebCore::initializeHTTPHeaders):
1700         (WebCore::ResourceResponse::platformLazyInit):
1701
1702 2019-02-08  Justin Fan  <justin_fan@apple.com>
1703
1704         [Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
1705         https://bugs.webkit.org/show_bug.cgi?id=194443
1706
1707         Unreviewed build fix.
1708
1709         For MTLTextures, MTLStorageModeManaged is only available on macOS. Other platforms,
1710         if not using MTLStorageModePrivate, must use MTLStorageModeShared.
1711
1712         Behavior unchanged.
1713
1714         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
1715         (WebCore::storageModeForPixelFormatAndSampleCount):
1716
1717 2019-02-08  Per Arne Vollan  <pvollan@apple.com>
1718
1719         [WebVTT] Inline WebVTT styles should start with '::cue'
1720         https://bugs.webkit.org/show_bug.cgi?id=194227
1721         <rdar://problem/47791087>
1722
1723         Reviewed by Eric Carlson.
1724
1725         Check that the CSS string starts with '::cue' and is successfully parsed before adding it
1726         to the CSS stylesheet list. Also, the caption preferences CSS string should start with
1727         '::cue', since it is added inside the video shadow root element.
1728
1729         Test: media/track/track-cue-css.html
1730
1731         * html/track/WebVTTParser.cpp:
1732         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
1733         * page/CaptionUserPreferencesMediaAF.cpp:
1734         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):
1735
1736 2019-02-08  Youenn Fablet  <youenn@apple.com>
1737
1738         Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
1739         https://bugs.webkit.org/show_bug.cgi?id=194380
1740         <rdar://problem/47916514>
1741
1742         Reviewed by Eric Carlson.
1743
1744         Set whether VP8 is supported at creation of the page.
1745         This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.
1746
1747         Add internal API to enable resetting the factory to enable proper testing.
1748
1749         Covered by updated test.
1750
1751         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1752         (WebCore::createLibWebRTCPeerConnectionBackend):
1753         * page/Page.cpp:
1754         (WebCore::m_applicationManifest):
1755         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1756         * testing/Internals.cpp:
1757         (WebCore::Internals::clearPeerConnectionFactory):
1758         * testing/Internals.h:
1759         * testing/Internals.idl:
1760
1761 2019-02-08  Andy Estes  <aestes@apple.com>
1762
1763         [WebIDL] Support serializing sequences and FrozenArrays of non-interfaces
1764         https://bugs.webkit.org/show_bug.cgi?id=190997
1765         <rdar://problem/35983035>
1766
1767         Reviewed by Brent Fulgham.
1768
1769         Support serializing sequences and FrozenArrays of types that aren't interfaces. This is
1770         needed to properly serialize PaymentAddress, which has a FrozenArray of DOMStrings.
1771
1772         We should support serializing sequences of interfaces too, but that's slightly more
1773         complicated since it involves iterating the sequence and serializing each of its items. I
1774         left that as a follow-up task, since I don't see any IDLs that currently need this.
1775
1776         We also don't support serializing sequences with the CachedAttribute or CustomGetter
1777         extended attributes, because WebIDL specifies that a new array should be created when
1778         converting an IDL sequence into an ECMAScript value.
1779
1780         Added bindings test cases to TestSerialization.idl and PaymentAddress test cases to
1781         http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html.
1782
1783         * bindings/scripts/CodeGenerator.pm:
1784         (GetInterfaceForType): Renamed from GetInterfaceForAttribute.
1785         (IsSerializableType): Modified to allow sequences and FrozenArrays of non-interface types.
1786         (hasCachedAttributeOrCustomGetterExtendedAttribute): Added a helper to determine if an
1787         attribute has the CachedAttribute or CustomGetter extended attributes.
1788         (IsSerializableAttribute): Checked for sequences with the CachedAttribute or CustomGetter
1789         extended attributes before calling IsSerializableType.
1790         (GetInterfaceForAttribute): Renamed to GetInterfaceForType.
1791         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1792         * bindings/scripts/test/TestSerialization.idl:
1793
1794 2019-02-08  Sihui Liu  <sihui_liu@apple.com>
1795
1796         IndexedDB tests leak documents
1797         https://bugs.webkit.org/show_bug.cgi?id=189435
1798         <rdar://problem/44240043>
1799
1800         Reviewed by Geoffrey Garen.
1801
1802         Remove use of JSC::Strong in IndexedDatabase.
1803
1804         * Modules/indexeddb/IDBCursor.cpp:
1805         (WebCore::IDBCursor::update):
1806         (WebCore::IDBCursor::continuePrimaryKey):
1807         (WebCore::IDBCursor::continueFunction):
1808         (WebCore::IDBCursor::deleteFunction):
1809         (WebCore::IDBCursor::setGetResult):
1810         * Modules/indexeddb/IDBCursor.h:
1811         (WebCore::IDBCursor::key):
1812         (WebCore::IDBCursor::primaryKey):
1813         (WebCore::IDBCursor::value):
1814         (WebCore::IDBCursor::keyWrapper):
1815         (WebCore::IDBCursor::primaryKeyWrapper):
1816         (WebCore::IDBCursor::valueWrapper):
1817         (WebCore::IDBCursor::key const): Deleted.
1818         (WebCore::IDBCursor::primaryKey const): Deleted.
1819         (WebCore::IDBCursor::value const): Deleted.
1820         * Modules/indexeddb/IDBCursor.idl:
1821         * Modules/indexeddb/IDBCursorWithValue.idl:
1822         * Modules/indexeddb/IDBObjectStore.cpp:
1823         (WebCore::IDBObjectStore::putForCursorUpdate):
1824         * Modules/indexeddb/IDBObjectStore.h:
1825         * Modules/indexeddb/IDBRequest.cpp:
1826         (WebCore::IDBRequest::IDBRequest):
1827         (WebCore::IDBRequest::~IDBRequest):
1828         (WebCore::IDBRequest::result const):
1829         (WebCore::IDBRequest::setResult):
1830         (WebCore::IDBRequest::setResultToStructuredClone):
1831         (WebCore::IDBRequest::setResultToUndefined):
1832         (WebCore::IDBRequest::resultCursor):
1833         (WebCore::IDBRequest::willIterateCursor):
1834         (WebCore::IDBRequest::didOpenOrIterateCursor):
1835         * Modules/indexeddb/IDBRequest.h:
1836         (WebCore::IDBRequest::resultWrapper):
1837         * Modules/indexeddb/IDBRequest.idl:
1838         * Sources.txt:
1839         * WebCore.xcodeproj/project.pbxproj:
1840         * bindings/js/JSIDBCursorCustom.cpp:
1841         (WebCore::JSIDBCursor::key const):
1842         (WebCore::JSIDBCursor::primaryKey const):
1843         (WebCore::JSIDBCursor::visitAdditionalChildren):
1844         * bindings/js/JSIDBCursorWithValueCustom.cpp:
1845         (WebCore::JSIDBCursorWithValue::value const):
1846         (WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
1847         * bindings/js/JSIDBRequestCustom.cpp: Added.
1848         (WebCore::JSIDBRequest::result const):
1849         (WebCore::JSIDBRequest::visitAdditionalChildren):
1850         * inspector/agents/InspectorIndexedDBAgent.cpp:
1851
1852 2019-02-08  Zalan Bujtas  <zalan@apple.com>
1853
1854         [LFC] The used containing block width value is optional
1855         https://bugs.webkit.org/show_bug.cgi?id=194428
1856
1857         Reviewed by Antti Koivisto.
1858
1859         The preferred width codepath cannot provide a valid used containing block width value.
1860
1861         "The percentage is calculated with respect to the width of the generated box's containing block.
1862         If the containing block's width depends on this element's width, then the resulting layout is undefined in CSS 2.2."
1863
1864         Let's use 0 as used value for now.
1865
1866         * layout/FormattingContextGeometry.cpp:
1867         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1868         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1869         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1870         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1871         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1872         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1873         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1874         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
1875         * layout/LayoutUnits.h:
1876         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
1877         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1878         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1879         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1880         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1881         * page/FrameViewLayoutContext.cpp:
1882
1883 2019-02-08  Zalan Bujtas  <zalan@apple.com>
1884
1885         [LFC] Horizontal geometry compute functions should take the containing block's width as a used value
1886         https://bugs.webkit.org/show_bug.cgi?id=194424
1887
1888         Reviewed by Antti Koivisto.
1889
1890         This is in preparation for passing optional containing block width for the preferred with codepath. 
1891
1892         * layout/FormattingContext.cpp:
1893         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1894         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1895         * layout/FormattingContext.h:
1896         * layout/FormattingContextGeometry.cpp:
1897         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1898         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1899         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1900         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1901         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1902         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1903         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
1904         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1905         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
1906         * layout/LayoutUnits.h:
1907         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
1908         * layout/blockformatting/BlockFormattingContext.cpp:
1909         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1910         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1911         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1912         * layout/inlineformatting/InlineFormattingContext.cpp:
1913         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
1914         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
1915         * layout/inlineformatting/InlineFormattingContext.h:
1916         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1917         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1918
1919 2019-02-08  Benjamin Poulain  <benjamin@webkit.org>
1920
1921         clampTo(): do not convert the input to double when dealing with integers
1922         https://bugs.webkit.org/show_bug.cgi?id=194263
1923         <rdar://problem/47692312>
1924
1925         Reviewed by Darin Adler.
1926
1927         Make the calls to clampTo<float>() unambiguous.
1928
1929         * page/FrameView.cpp:
1930         (WebCore::FrameView::computeUpdatedLayoutViewportRect):
1931         * rendering/style/RenderStyle.h:
1932         (WebCore::RenderStyle::setOpacity):
1933         (WebCore::RenderStyle::setShapeImageThreshold):
1934
1935 2019-02-08  Eric Liang  <ericliang@apple.com>
1936
1937         When performing AXPress, check to see if the menu list is disabled.
1938         https://bugs.webkit.org/show_bug.cgi?id=193878
1939
1940         Reviewed by Chris Fleizach.
1941
1942         Test: accessibility/mac/press-not-work-for-disabled-menu-list.html
1943
1944         * accessibility/AXObjectCache.h:
1945         * accessibility/AccessibilityMenuList.cpp:
1946         (WebCore::AccessibilityMenuList::press):
1947         * accessibility/mac/AXObjectCacheMac.mm:
1948         (WebCore::AXObjectCache::postPlatformNotification):
1949
1950 2019-02-07  Devin Rousso  <drousso@apple.com>
1951
1952         PseudoElement created for any ::before/::after selector regardless of whether a content property exists
1953         https://bugs.webkit.org/show_bug.cgi?id=194423
1954         <rdar://problem/46787260>
1955
1956         Reviewed by Antti Koivisto.
1957
1958         Test: inspector/css/pseudo-creation.html
1959
1960         * style/StyleTreeResolver.cpp:
1961         (WebCore::Style::TreeResolver::resolvePseudoStyle):
1962         We should only be creating `PseudoElement`s if we actually have a `content` proprety in the
1963         `PseudoElement`'s style. Otherwise, we end up creating `PseudoElement`s for every CSS rule
1964         that has a `::before`/`::after`, only to immediately destroy them as there is nothing to show.
1965
1966 2019-02-07  Chris Dumez  <cdumez@apple.com>
1967
1968         Mark more heap-allocated classes as fast allocated
1969         https://bugs.webkit.org/show_bug.cgi?id=194422
1970
1971         Reviewed by Ryosuke Niwa.
1972
1973         * Modules/applepay/PaymentCoordinator.h:
1974         * Modules/beacon/NavigatorBeacon.h:
1975         * Modules/cache/DOMWindowCaches.h:
1976         * Modules/cache/WorkerGlobalScopeCaches.h:
1977         * Modules/credentialmanagement/NavigatorCredentials.h:
1978         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
1979         * Modules/gamepad/NavigatorGamepad.h:
1980         * Modules/indexeddb/IDBGetAllResult.h:
1981         * Modules/indexeddb/IDBGetResult.h:
1982         * Modules/indexeddb/IDBKeyData.h:
1983         * Modules/indexeddb/IDBValue.h:
1984         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
1985         * Modules/indexeddb/server/IndexValueEntry.h:
1986         * Modules/indexeddb/server/IndexValueStore.h:
1987         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1988         * Modules/indexeddb/server/MemoryCursor.h:
1989         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1990         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1991         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1992         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
1993         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1994         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1995         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
1996         * Modules/indexeddb/shared/IDBTransactionInfo.h:
1997         * Modules/mediacapabilities/NavigatorMediaCapabilities.h:
1998         * Modules/mediasession/WebMediaSessionManager.cpp:
1999         * Modules/mediastream/NavigatorMediaDevices.h:
2000         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
2001         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
2002         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
2003         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
2004         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
2005         * Modules/quota/DOMWindowQuota.h:
2006         * Modules/quota/NavigatorStorageQuota.h:
2007         * Modules/quota/WorkerNavigatorStorageQuota.h:
2008         * Modules/speech/DOMWindowSpeechSynthesis.h:
2009         * Modules/webaudio/BiquadProcessor.h:
2010         * Modules/webaudio/DelayProcessor.h:
2011         * Modules/webauthn/fido/FidoHidPacket.h:
2012         * Modules/webdriver/NavigatorWebDriver.h:
2013         * Modules/webgpu/DOMWindowWebGPU.h:
2014         * Modules/websockets/WebSocketChannel.h:
2015         * Modules/webvr/NavigatorWebVR.h:
2016         * accessibility/AXObjectCache.h:
2017         * bindings/js/DOMGCOutputConstraint.h:
2018         * bindings/js/DOMPromiseProxy.h:
2019         * bridge/c/c_runtime.h:
2020         * contentextensions/CombinedURLFilters.cpp:
2021         * crypto/CryptoAlgorithmParameters.h:
2022         * css/CSSComputedStyleDeclaration.h:
2023         * css/CSSRegisteredCustomProperty.h:
2024         * css/DOMCSSPaintWorklet.h:
2025         * css/DOMCSSRegisterCustomProperty.h:
2026         * css/StyleRule.h:
2027         * dom/ConstantPropertyMap.h:
2028         * dom/CustomElementReactionQueue.h:
2029         * dom/Document.h:
2030         * dom/GenericEventQueue.h:
2031         * dom/RejectedPromiseTracker.h:
2032         * dom/UserGestureIndicator.h:
2033         * editing/ReplaceSelectionCommand.cpp:
2034         * editing/SelectionRectGatherer.h:
2035         * editing/TextIterator.h:
2036         * editing/cocoa/HTMLConverter.mm:
2037         * fileapi/AsyncFileStream.cpp:
2038         * fileapi/AsyncFileStream.h:
2039         * html/forms/FileIconLoader.h:
2040         * html/parser/HTMLTreeBuilder.h:
2041         * html/track/WebVTTParser.h:
2042         * inspector/DOMPatchSupport.cpp:
2043         * loader/FrameLoaderClient.h:
2044         * loader/WorkerThreadableLoader.cpp:
2045         * page/IntersectionObserver.h:
2046         * page/PerformanceMonitor.h:
2047         * page/PerformanceUserTiming.h:
2048         * page/PrintContext.h:
2049         * page/ValidationMessageClient.h:
2050         * platform/ColorChooser.h:
2051         * platform/ControlStates.h:
2052         * platform/DataListSuggestionPicker.h:
2053         * platform/FileStream.h:
2054         * platform/KeyedCoding.h:
2055         * platform/LowPowerModeNotifier.h:
2056         * platform/PlatformSpeechSynthesizer.h:
2057         * platform/WebGLStateTracker.h:
2058         * platform/audio/AudioArray.h:
2059         * platform/audio/AudioDestination.h:
2060         * platform/audio/DownSampler.h:
2061         * platform/audio/DynamicsCompressor.h:
2062         * platform/audio/FFTFrame.h:
2063         * platform/audio/HRTFDatabase.h:
2064         * platform/audio/MultiChannelResampler.h:
2065         * platform/audio/Panner.h:
2066         * platform/audio/Reverb.h:
2067         * platform/audio/ReverbConvolver.h:
2068         * platform/audio/ReverbConvolverStage.h:
2069         * platform/audio/UpSampler.h:
2070         * platform/audio/mac/AudioSessionMac.cpp:
2071         * platform/audio/mac/CAAudioStreamDescription.h:
2072         * platform/audio/mac/CARingBuffer.h:
2073         * platform/cocoa/ScrollSnapAnimatorState.h:
2074         * platform/gamepad/PlatformGamepad.h:
2075         * platform/graphics/GraphicsLayer.cpp:
2076         * platform/graphics/GraphicsLayerFactory.h:
2077         * platform/graphics/PlatformTimeRanges.h:
2078         * platform/graphics/TextTrackRepresentation.h:
2079         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
2080         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2081         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2082         * platform/graphics/displaylists/DisplayListRecorder.h:
2083         * platform/network/cocoa/WebCoreNSURLSession.mm:
2084         * platform/sql/SQLiteDatabase.h:
2085         * platform/text/TextCodecICU.h:
2086         * rendering/GridBaselineAlignment.h:
2087         * rendering/GridTrackSizingAlgorithm.h:
2088         * rendering/RenderObject.h:
2089         * rendering/style/GridArea.h:
2090         * workers/service/context/SWContextManager.h:
2091
2092 2019-02-07  Justin Fan  <justin_fan@apple.com>
2093
2094         [Web GPU] GPUDevice::createTexture implementation prototype
2095         https://bugs.webkit.org/show_bug.cgi?id=194409
2096         <rdar://problem/47894312>
2097
2098         Reviewed by Myles C. Maxfield.
2099
2100         Test: textures-textureviews.html updated to test new functionality.
2101
2102         Implement GPUDevice::createTexture():
2103         * Modules/webgpu/WebGPUDevice.cpp:
2104         (WebCore::WebGPUDevice::createTexture const):
2105         * Modules/webgpu/WebGPUDevice.h:
2106         * Modules/webgpu/WebGPUDevice.idl:
2107         * Modules/webgpu/WebGPUTexture.cpp:
2108         (WebCore::WebGPUTexture::create): Modified to return non-nullable to match direction of API.
2109         (WebCore::WebGPUTexture::WebGPUTexture):
2110         * Modules/webgpu/WebGPUTexture.h:
2111
2112         Metal backend MTLTextureDescriptor and MTLTexture creation:
2113         * platform/graphics/gpu/GPUDevice.cpp:
2114         (WebCore::GPUDevice::tryCreateTexture const):
2115         * platform/graphics/gpu/GPUDevice.h:
2116         * platform/graphics/gpu/GPUTexture.h:
2117         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
2118         (WebCore::mtlTextureTypeForGPUTextureDescriptor):
2119         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
2120         (WebCore::storageModeForPixelFormatAndSampleCount):
2121         (WebCore::tryCreateMtlTextureDescriptor):
2122         (WebCore::GPUTexture::tryCreate):
2123         (WebCore::GPUTexture::createDefaultTextureView): Add ObjC try/catch guards.
2124
2125         Add GPUUtils.h/cpp for shared utility functions:
2126         * SourcesCocoa.txt:
2127         * WebCore.xcodeproj/project.pbxproj:
2128         * platform/graphics/gpu/GPUUtils.h: Added. Moved platformTextureFormatForGPUTextureFormat here.
2129         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2130         (WebCore::GPUSwapChain::setFormat):
2131         (WebCore::platformTextureFormatForGPUTextureFormat): Moved to GPUUtils.
2132         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Added.
2133         (WebCore::platformTextureFormatForGPUTextureFormat): Moved here to be referenced by multiple files.
2134
2135 2019-02-07  Sihui Liu  <sihui_liu@apple.com>
2136
2137         REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&)
2138         https://bugs.webkit.org/show_bug.cgi?id=194402
2139         <rdar://problem/47858241>
2140
2141         Reviewed by Geoffrey Garen.
2142
2143         r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be
2144         around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it
2145         is valid during access.
2146
2147         * Modules/indexeddb/server/ServerOpenDBRequest.cpp:
2148         (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
2149         (WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):
2150         * Modules/indexeddb/server/ServerOpenDBRequest.h:
2151
2152 2019-02-07  Timothy Hatcher  <timothy@apple.com>
2153
2154         Overflow element scrollbar is light for dark mode content.
2155         https://bugs.webkit.org/show_bug.cgi?id=194407
2156         rdar://problem/45991585
2157
2158         Reviewed by Beth Dakin.
2159
2160         Tested by css-dark-mode/supported-color-schemes-scrollbar.html.
2161
2162         * page/ChromeClient.h:
2163         (WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid
2164         short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1,
2165         that do not implement preferredScrollbarOverlayStyle().
2166         * page/FrameView.cpp:
2167         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case
2168         to auto detect overlay style when page() is null.
2169         * rendering/RenderLayer.cpp:
2170         (WebCore::RenderLayer::useDarkAppearance const): Added.
2171         * rendering/RenderLayer.h:
2172         * testing/Internals.cpp:
2173         (WebCore::Internals::scrollbarOverlayStyle const): Added Node argument.
2174         (WebCore::Internals::scrollbarUsingDarkAppearance const): Added.
2175         * testing/Internals.h:
2176         * testing/Internals.idl:
2177
2178 2019-02-07  Eric Carlson  <eric.carlson@apple.com>
2179
2180         [MSE] Convert debug-only logging to runtime logging
2181         https://bugs.webkit.org/show_bug.cgi?id=194348
2182         <rdar://problem/47566449>
2183
2184         Reviewed by Jer Noble.
2185
2186         No new tests, this just changes existing logging.
2187
2188         * Modules/mediasource/MediaSource.cpp:
2189         (WebCore::convertEnumerationToString):
2190         (WebCore::MediaSource::MediaSource):
2191         (WebCore::MediaSource::~MediaSource):
2192         (WebCore::MediaSource::setPrivateAndOpen):
2193         (WebCore::MediaSource::addedToRegistry):
2194         (WebCore::MediaSource::removedFromRegistry):
2195         (WebCore::MediaSource::durationChanged):
2196         (WebCore::MediaSource::seekToTime):
2197         (WebCore::MediaSource::completeSeek):
2198         (WebCore::MediaSource::setLiveSeekableRange):
2199         (WebCore::MediaSource::clearLiveSeekableRange):
2200         (WebCore::MediaSource::setDuration):
2201         (WebCore::MediaSource::setDurationInternal):
2202         (WebCore::MediaSource::setReadyState):
2203         (WebCore::MediaSource::endOfStream):
2204         (WebCore::MediaSource::streamEndedWithError):
2205         (WebCore::MediaSource::addSourceBuffer):
2206         (WebCore::MediaSource::removeSourceBuffer):
2207         (WebCore::MediaSource::isTypeSupported):
2208         (WebCore::MediaSource::detachFromElement):
2209         (WebCore::MediaSource::attachToElement):
2210         (WebCore::MediaSource::openIfInEndedState):
2211         (WebCore::MediaSource::suspend):
2212         (WebCore::MediaSource::resume):
2213         (WebCore::MediaSource::stop):
2214         (WebCore::MediaSource::onReadyStateChange):
2215         (WebCore::MediaSource::scheduleEvent):
2216         (WebCore::MediaSource::logChannel const):
2217         (WebCore::MediaSourceInternal::toString): Deleted.
2218         * Modules/mediasource/MediaSource.h:
2219         (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString):
2220         (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString):
2221         * Modules/mediasource/SourceBuffer.cpp:
2222         (WebCore::SourceBuffer::SourceBuffer):
2223         (WebCore::SourceBuffer::~SourceBuffer):
2224         (WebCore::SourceBuffer::remove):
2225         (WebCore::SourceBuffer::seekToTime):
2226         (WebCore::SourceBuffer::appendBufferInternal):
2227         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
2228         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
2229         (WebCore::removeSamplesFromTrackBuffer):
2230         (WebCore::SourceBuffer::removeCodedFrames):
2231         (WebCore::SourceBuffer::evictCodedFrames):
2232         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
2233         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2234         (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples):
2235         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
2236         (WebCore::SourceBuffer::provideMediaData):
2237         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
2238         (WebCore::SourceBuffer::monitorBufferingRate):
2239         (WebCore::SourceBuffer::logChannel const):
2240         * Modules/mediasource/SourceBuffer.h:
2241         * dom/Document.cpp:
2242         (WebCore::messageSourceForWTFLogChannel):
2243         (WebCore::Document::didLogMessage):
2244         * html/HTMLMediaElement.cpp:
2245         (WebCore::convertEnumerationToString):
2246         (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
2247         (WebCore::HTMLMediaElement::selectMediaResource):
2248         (WebCore::HTMLMediaElement::loadResource):
2249         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2250         (WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
2251         (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
2252         (WebCore::HTMLMediaElement::scheduleUpdatePlayState):
2253         (WebCore::HTMLMediaElement::scheduleUpdateMediaState):
2254         * platform/ContentType.cpp:
2255         (WebCore::ContentType::toJSONString const):
2256         * platform/ContentType.h:
2257         (WTF::LogArgument<WebCore::ContentType>::toString):
2258         * platform/MediaSample.h:
2259         (WebCore::MediaSample::toJSONString const):
2260         (WTF::LogArgument<WebCore::MediaSample>::toString):
2261         * platform/graphics/FloatSize.cpp:
2262         (WebCore::FloatSize::toJSONObject const):
2263         (WebCore::FloatSize::toJSONString const):
2264         * platform/graphics/FloatSize.h:
2265         (WTF::LogArgument<WebCore::FloatSize>::toString):
2266         * platform/graphics/MediaSourcePrivate.h:
2267         (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier):
2268         (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString):
2269         (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString):
2270         * platform/graphics/SourceBufferPrivate.h:
2271         (WebCore::SourceBufferPrivate::sourceBufferLogger const):
2272         (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier):
2273         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2274         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
2275         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
2276         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
2277         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
2278         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
2279         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
2280         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
2281         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2282         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier):
2283         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger):
2284         (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString):
2285         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2286         (WebCore::convertEnumerationToString):
2287         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2288         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
2289         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
2290         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
2291         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
2292         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
2293         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
2294         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
2295         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
2296         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
2297         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
2298         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
2299         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted):
2300         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted):
2301         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
2302         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
2303         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
2304         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
2305         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
2306         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2307         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2308         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
2309         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
2310         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
2311         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
2312         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
2313         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
2314         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState):
2315         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
2316         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
2317         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const):
2318         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2319         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2320         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
2321         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2322         (WebCore::MediaSampleAVFObjC::toJSONString const):
2323         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2324         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2325         (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
2326         (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC):
2327         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
2328         (WebCore::MediaSourcePrivateAVFObjC::logChannel const):
2329         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2330         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2331         (WebCore::bufferWasConsumedCallback):
2332         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2333         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
2334         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2335         (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
2336         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
2337         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
2338         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2339         (WebCore::SourceBufferPrivateAVFObjC::append):
2340         (WebCore::SourceBufferPrivateAVFObjC::abort):
2341         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
2342         (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
2343         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
2344         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2345         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
2346         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
2347         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
2348         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2349         (WebCore::SourceBufferPrivateAVFObjC::flush):
2350         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
2351         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2352         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
2353         (WebCore::SourceBufferPrivateAVFObjC::setActive):
2354         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
2355         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
2356         (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
2357         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
2358         (WebCore::SourceBufferPrivateAVFObjC::logChannel const):
2359
2360 2019-02-07  Youenn Fablet  <youenn@apple.com>
2361
2362         Simplify applyConstraints callbacks
2363         https://bugs.webkit.org/show_bug.cgi?id=194297
2364
2365         Reviewed by Eric Carlson.
2366
2367         Make use of one callback for both success and failure cases.
2368         No changed of behavior.
2369
2370         * Modules/mediastream/MediaStreamTrack.cpp:
2371         (WebCore::MediaStreamTrack::applyConstraints):
2372         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2373         (WebCore::MediaStreamTrackPrivate::applyConstraints):
2374         * platform/mediastream/MediaStreamTrackPrivate.h:
2375         * platform/mediastream/RealtimeMediaSource.cpp:
2376         (WebCore::RealtimeMediaSource::applyConstraints):
2377         * platform/mediastream/RealtimeMediaSource.h:
2378         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2379         (WebCore::AVVideoCaptureSource::create):
2380         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2381         (WebCore::CoreAudioCaptureSource::create):
2382         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2383         (WebCore::MockGStreamerAudioCaptureSource::applyConstraints):
2384         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
2385         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
2386         (WebCore::MockGStreamerVideoCaptureSource::applyConstraints):
2387         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
2388
2389 2019-02-07  Youenn Fablet  <youenn@apple.com>
2390
2391         Unable to sign in leetcode.
2392         https://bugs.webkit.org/show_bug.cgi?id=194366
2393         rdar://problem/47259025.
2394
2395         Reviewed by Chris Dumez.
2396
2397         In case a signal is passed as part of a FetchRequestInit,
2398         the IDL binding code is throwing an exception in case signal is not an AbortSignal object.
2399         This breaks an AbortSignal shim used in some web sites.
2400         Relaxed the IDL binding rule by marking signal as any and doing the conversion in FetchRequest.
2401
2402         Test: http/wpt/fetch/request-abort.html
2403         Also covered by manually signing in to leetcode.
2404
2405         * Modules/fetch/FetchRequest.cpp:
2406         (WebCore::FetchRequest::initializeWith):
2407         * Modules/fetch/FetchRequestInit.h:
2408         (WebCore::FetchRequestInit::hasMembers const):
2409         * Modules/fetch/FetchRequestInit.idl:
2410
2411 2019-02-07  Youenn Fablet  <youenn@apple.com>
2412
2413         Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
2414         https://bugs.webkit.org/show_bug.cgi?id=194312
2415
2416         Reviewed by Eric Carlson.
2417
2418         Add a way for sources to know when they are ended, i.e. that they will never be started again.
2419         No observable change of behavior.
2420
2421         * platform/mediastream/RealtimeMediaSource.cpp:
2422         (WebCore::RealtimeMediaSource::requestStop):
2423         * platform/mediastream/RealtimeMediaSource.h:
2424
2425 2019-02-07  Jer Noble  <jer.noble@apple.com>
2426
2427         HTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject parent class
2428         https://bugs.webkit.org/show_bug.cgi?id=194360
2429
2430         HTMLMediaElement registers the Document used to create it with ActiveDOMObject, when it should
2431         really use that Document's contextDocument(). Rather than just fix this in HTMLMediaElement,
2432         make sure that the correct document is used everywhere by adding a new ActiveDOMObject constructor
2433         taking a Document&, and making an explicitly deleted Document* constructor to catch any new cases.
2434
2435         Reviewed by Geoffrey Garen.
2436
2437         * Modules/applepay/ApplePaySession.cpp:
2438         (WebCore::ApplePaySession::ApplePaySession):
2439         * Modules/mediarecorder/MediaRecorder.cpp:
2440         (WebCore::MediaRecorder::MediaRecorder):
2441         * Modules/mediastream/MediaDevices.cpp:
2442         (WebCore::MediaDevices::MediaDevices):
2443         * Modules/mediastream/UserMediaRequest.cpp:
2444         (WebCore::UserMediaRequest::UserMediaRequest):
2445         * Modules/notifications/Notification.cpp:
2446         (WebCore::Notification::Notification):
2447         * Modules/paymentrequest/PaymentRequest.cpp:
2448         (WebCore::PaymentRequest::PaymentRequest):
2449         * Modules/webaudio/AudioContext.cpp:
2450         (WebCore::AudioContext::AudioContext):
2451         * animation/WebAnimation.cpp:
2452         (WebCore::WebAnimation::WebAnimation):
2453         * css/FontFaceSet.cpp:
2454         (WebCore::FontFaceSet::FontFaceSet):
2455         * dom/ActiveDOMObject.cpp:
2456         (WebCore::ActiveDOMObject::ActiveDOMObject):
2457         * dom/ActiveDOMObject.h:
2458         * dom/Document.h:
2459         (WebCore::ActiveDOMObject::ActiveDOMObject):
2460         * html/HTMLMarqueeElement.cpp:
2461         (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
2462         * html/HTMLMediaElement.cpp:
2463         (WebCore::HTMLMediaElement::HTMLMediaElement):
2464         * html/HTMLSourceElement.cpp:
2465         (WebCore::HTMLSourceElement::HTMLSourceElement):
2466         * page/IntersectionObserver.cpp:
2467         (WebCore::IntersectionObserver::IntersectionObserver):
2468
2469 2019-02-07  Zalan Bujtas  <zalan@apple.com>
2470
2471         [LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
2472         https://bugs.webkit.org/show_bug.cgi?id=194391
2473
2474         Reviewed by Antti Koivisto.
2475
2476         The spec is not clear about this but that's what matches the current behaviour.
2477
2478         Test: fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html
2479
2480         * layout/FormattingContext.cpp:
2481         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2482
2483 2019-02-07  Zalan Bujtas  <zalan@apple.com>
2484
2485         [LFC] Use dedicated data structures for optional used values (input to geometry functions)
2486         https://bugs.webkit.org/show_bug.cgi?id=194376
2487
2488         Reviewed by Antti Koivisto.
2489
2490         This is in preparation for being able to pass in the containing block's width as an optional used value.
2491         During layout we always have a valid width for the containing block, however it's not the case while computing the preferred width.
2492
2493         * layout/FormattingContext.cpp:
2494         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2495         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
2496         * layout/FormattingContext.h:
2497         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
2498         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): Deleted.
2499         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
2500         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted.
2501         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
2502         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
2503         (): Deleted.
2504         (WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
2505         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
2506         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
2507         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
2508         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): Deleted.
2509         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
2510         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
2511         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted.
2512         * layout/FormattingContextGeometry.cpp:
2513         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2514         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2515         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2516         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2517         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2518         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2519         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
2520         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2521         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
2522         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
2523         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2524         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
2525         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2526         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2527         * layout/LayoutUnits.h:
2528         * layout/blockformatting/BlockFormattingContext.cpp:
2529         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2530         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2531         * layout/blockformatting/BlockFormattingContext.h:
2532         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted.
2533         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted.
2534         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted.
2535         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
2536         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
2537         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2538         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2539         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2540         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2541         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2542         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2543         * layout/inlineformatting/InlineFormattingContext.cpp:
2544         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
2545         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2546         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2547         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2548         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2549         * page/FrameViewLayoutContext.cpp:
2550         (WebCore::layoutUsingFormattingContext):
2551
2552 2019-02-07  Antti Koivisto  <antti@apple.com>
2553
2554         Infinite recursion via CachedResource::~CachedResource
2555         https://bugs.webkit.org/show_bug.cgi?id=194378
2556         <rdar://problem/42023295>
2557
2558         Reviewed by Daniel Bates.
2559
2560         I don't know the exact steps to trigger this but the mechanism seems clear.
2561
2562         1) An existing resource is removed from or replaced in CachedResourceLoader::m_documentResources map.
2563         2) This decrements the handle count of resource and causes it be deleted.
2564         3) CachedResource::~CachedResource calls m_owningCachedResourceLoader->removeCachedResource(*this). This only happens with
2565            resources that are "owned" by CachedResourceLoader which is a rare special case (used by image document and if memory cache is disabled).
2566         4) CachedResourceLoader::removeCachedResource looks up the resource from the map which causes a temporary CachedResourceHandle to be created.
2567            This increments the handle count of the resource from 0 back to 1.
2568         5) When the temporary dies, CachedResource::~CachedResource is called again and we cycle back to 3).
2569
2570         The fix here is simply to remove CachedResourceLoader::removeCachedResource call from ~CachedResource.
2571         It is a leftover from when the map contained raw pointers instead of owning CachedResourceHandles.
2572
2573         Since m_documentResources map has a handle to the resource, the only way we are in the destructor is that the resource
2574         has been removed from the map already (or is in process of being removed like in this crash). Any call that does anything
2575         other than bail out is going to crash.
2576
2577         CachedResource::n_owningCachedResourceLoader member and CachedResourceLoader::removeCachedResource function only exist to
2578         support this erranous call so they are removed as well.
2579
2580         * loader/ImageLoader.cpp:
2581         (WebCore::ImageLoader::updateFromElement):
2582         * loader/cache/CachedResource.cpp:
2583         (WebCore::CachedResource::~CachedResource):
2584
2585         This is the substantive change. The rest just removes now-dead code.
2586
2587         * loader/cache/CachedResource.h:
2588         (WebCore::CachedResource::setOwningCachedResourceLoader): Deleted.
2589         * loader/cache/CachedResourceLoader.cpp:
2590         (WebCore::CachedResourceLoader::~CachedResourceLoader):
2591         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2592         (WebCore::CachedResourceLoader::requestResource):
2593         (WebCore::CachedResourceLoader::loadResource):
2594         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
2595         (WebCore::CachedResourceLoader::removeCachedResource): Deleted.
2596         * loader/cache/CachedResourceLoader.h:
2597
2598 2019-02-07  Miguel Gomez  <magomez@igalia.com>
2599
2600         [WPE] Implement GStreamer based holepunch
2601         https://bugs.webkit.org/show_bug.cgi?id=193715
2602
2603         Reviewed by Xabier Rodriguez-Calvar.
2604
2605         Implement GStreamer based holepunch functionality. Instead of getting the video frames from the
2606         video sink and drawing then, the player just draws a transparent rectangle on the position where
2607         the video should be. MediaPlayerPrivateGStreamerBase will instantiate a platform dependant video
2608         sink which will be in charge of displaying the video frames in some way (usually on a plane below
2609         the browser), and will push empty frames to the compositor indicating that the rectangle to draw
2610         should overwrite the existent content. TextureMapperPlatformLayerBuffer::HolePunchClient is used
2611         to tell the video sink where to position the video so it's set below the browser transparent hole.
2612
2613         Added ManualTest wpe/video-player-holepunch.html to test the feature.
2614
2615         * platform/graphics/MediaPlayer.cpp:
2616         (WebCore::MediaPlayer::shouldIgnoreIntrinsicSize):
2617         * platform/graphics/MediaPlayer.h:
2618         * platform/graphics/MediaPlayerPrivate.h:
2619         (WebCore::MediaPlayerPrivateInterface::shouldIgnoreIntrinsicSize):
2620         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2621         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
2622         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
2623         (WebCore::setRectangleToVideoSink):
2624         (WebCore::GStreamerHolePunchClient::GStreamerHolePunchClient):
2625         (WebCore::MediaPlayerPrivateGStreamerBase::createHolePunchVideoSink):
2626         (WebCore::MediaPlayerPrivateGStreamerBase::pushNextHolePunchBuffer):
2627         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2628         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2629         * platform/graphics/texmap/TextureMapper.h:
2630         * platform/graphics/texmap/TextureMapperGL.cpp:
2631         (WebCore::TextureMapperGL::drawSolidColor):
2632         * platform/graphics/texmap/TextureMapperGL.h:
2633         * platform/graphics/texmap/TextureMapperLayer.cpp:
2634         (WebCore::TextureMapperLayer::paintSelf):
2635         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2636         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
2637         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2638         (WebCore::TextureMapperPlatformLayerBuffer::setHolePunchClient):
2639         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2640         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
2641         * rendering/RenderVideo.cpp:
2642         (WebCore::RenderVideo::videoBox const):
2643
2644 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
2645
2646         Unreviewed, rolling out r240759 and r240944.
2647
2648         Some timer uses are done off the main thread, WebCore::Timer
2649         cannot be used
2650
2651         Reverted changesets:
2652
2653         "<rdar://problem/47570443> Responsiveness timers are too
2654         expensive for frequent events"
2655         https://bugs.webkit.org/show_bug.cgi?id=194003
2656         https://trac.webkit.org/changeset/240759
2657
2658         "Use deferrable timer to restart the Responsiveness Timer on
2659         each wheel event"
2660         https://bugs.webkit.org/show_bug.cgi?id=194135
2661         https://trac.webkit.org/changeset/240944
2662
2663 2019-02-06  Keith Rollin  <krollin@apple.com>
2664
2665         Update .xcfilelist files
2666
2667         Unreviewed build fix.
2668
2669         * DerivedSources-input.xcfilelist:
2670         * DerivedSources-output.xcfilelist:
2671
2672 2019-02-06  Devin Rousso  <drousso@apple.com>
2673
2674         Web Inspector: DOM: don't send the entire function string with each event listener
2675         https://bugs.webkit.org/show_bug.cgi?id=194293
2676         <rdar://problem/47822809>
2677
2678         Reviewed by Joseph Pecoraro.
2679
2680         Test: inspector/dom/getEventListenersForNode.html
2681
2682         * inspector/agents/InspectorDOMAgent.cpp:
2683         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2684
2685 2019-02-06  Andy Estes  <aestes@apple.com>
2686
2687         [Payment Request] It should be possible to require a phonetic name for shipping contacts
2688         https://bugs.webkit.org/show_bug.cgi?id=194311
2689         <rdar://46733045>
2690
2691         Reviewed by Alex Christensen.
2692
2693         It should be possible to require that a shipping contact has a phonetic name in Payment Request.
2694         To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to
2695         ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data.
2696
2697         Since required shipping contact fields can now be specified both in
2698         requiredShippingContactFields and PaymentOptions, we merge the required fields from these
2699         two sources such that, e.g., email is required if it is specified in either place.
2700
2701         So that clients can detect this new feature, the API version number is bumped from 5 to 6.
2702
2703         Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html.
2704
2705         * DerivedSources.make:
2706         * Modules/applepay/ApplePayPaymentRequest.h:
2707         * Modules/applepay/ApplePayPaymentRequest.idl:
2708         * Modules/applepay/ApplePayRequestBase.cpp:
2709         (WebCore::convertAndValidate):
2710         * Modules/applepay/ApplePayRequestBase.h:
2711         * Modules/applepay/ApplePayRequestBase.idl:
2712         * Modules/applepay/ApplePaySession.cpp:
2713         (WebCore::convertAndValidate):
2714         * Modules/applepay/PaymentCoordinatorClient.cpp: Added.
2715         (WebCore::PaymentCoordinatorClient::supportsVersion):
2716         * Modules/applepay/PaymentCoordinatorClient.h:
2717         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2718         (WebCore::mergePaymentOptions):
2719         (WebCore::ApplePayPaymentHandler::show):
2720         * SourcesCocoa.txt:
2721         * WebCore.xcodeproj/project.pbxproj:
2722         * loader/EmptyClients.cpp:
2723         * testing/MockPaymentContactFields.h: Added.
2724         (WebCore::MockPaymentContactFields::MockPaymentContactFields):
2725         * testing/MockPaymentContactFields.idl: Added.
2726         * testing/MockPaymentCoordinator.cpp:
2727         (WebCore::MockPaymentCoordinator::showPaymentUI):
2728         (WebCore::MockPaymentCoordinator::supportsVersion): Deleted.
2729         * testing/MockPaymentCoordinator.h:
2730         * testing/MockPaymentCoordinator.idl:
2731
2732 2019-02-06  Yusuke Suzuki  <ysuzuki@apple.com>
2733
2734         [JSC] PrivateName to PublicName hash table is wasteful
2735         https://bugs.webkit.org/show_bug.cgi?id=194277
2736
2737         Reviewed by Michael Saboff.
2738
2739         Use WebCoreBuiltinNames instead of adding WebCore names to JSC CommonIdentifiers.
2740
2741         * bindings/js/JSDOMWindowCustom.cpp:
2742         (WebCore::addCrossOriginPropertyNames):
2743         * bindings/js/JSLocationCustom.cpp:
2744         (WebCore::getOwnPropertySlotCommon):
2745         (WebCore::putCommon):
2746         * bindings/js/WebCoreBuiltinNames.h:
2747
2748 2019-02-06  Keith Rollin  <krollin@apple.com>
2749
2750         Really enable the automatic checking and regenerations of .xcfilelists during builds
2751         https://bugs.webkit.org/show_bug.cgi?id=194357
2752         <rdar://problem/47861231>
2753
2754         Reviewed by Chris Dumez.
2755
2756         Bug 194124 was supposed to enable the automatic checking and
2757         regenerating of .xcfilelist files during the build. While related
2758         changes were included in that patch, the change to actually enable the
2759         operation somehow was omitted. This patch actually enables the
2760         operation. The check-xcfilelist.sh scripts now check
2761         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
2762         from the checking.
2763
2764         No new tests since there should be no observable behavior difference.
2765
2766         * Scripts/check-xcfilelists.sh:
2767
2768 2019-02-06  John Wilander  <wilander@apple.com>
2769
2770         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
2771         https://bugs.webkit.org/show_bug.cgi?id=194325
2772         <rdar://problem/47840283>
2773
2774         Reviewed by Chris Dumez.
2775
2776         No new tests. This is just data forwarding. Once the data is stored, I will create
2777         test infrastructure to query it.
2778
2779         * html/HTMLAnchorElement.cpp:
2780         (WebCore::HTMLAnchorElement::handleClick):
2781         * loader/AdClickAttribution.h:
2782         (WebCore::AdClickAttribution::encode const):
2783         (WebCore::AdClickAttribution::decode):
2784         (WebCore::AdClickAttribution::Conversion::encode const):
2785         (WebCore::AdClickAttribution::Conversion::decode):
2786             Infrastructure for IPC.
2787         * loader/FrameLoader.cpp:
2788         (WebCore::FrameLoader::urlSelected):
2789         (WebCore::FrameLoader::loadURLIntoChildFrame):
2790         (WebCore::FrameLoader::loadFrameRequest):
2791         (WebCore::FrameLoader::loadURL):
2792             These functions forward the optional WebCore::AdClickAttribution object
2793             FrameLoader::loadURL() creates the NavigationAction object and sets the
2794             WebCore::AdClickAttribution object on there.
2795         * loader/FrameLoader.h:
2796         (WebCore::FrameLoader::urlSelected):
2797         (WebCore::FrameLoader::loadURL):
2798         * loader/NavigationAction.h:
2799         (WebCore::NavigationAction::adClickAttribution):
2800         (WebCore::NavigationAction::setAdClickAttribution):
2801
2802 2019-02-06  Justin Fan  <justin_fan@apple.com>
2803
2804         [Web GPU] Implement supporting dictionaries for GPUTexture
2805         https://bugs.webkit.org/show_bug.cgi?id=194354
2806
2807         Reviewed by Dean Jackson.
2808
2809         Add dictionaries needed to create a GPUTextureDescriptor.
2810
2811         No new tests; no change in behavior. 
2812
2813         New interface and dictionaries added:
2814         * Modules/webgpu/GPUExtent3D.idl:
2815         * Modules/webgpu/GPUTextureDescriptor.idl:
2816         * Modules/webgpu/GPUTextureDimension.idl:
2817         * Modules/webgpu/GPUTextureUsage.idl:
2818         * platform/graphics/gpu/GPUExtent3D.h:
2819         * platform/graphics/gpu/GPUTextureDescriptor.h:
2820         * platform/graphics/gpu/GPUTextureDimension.h:
2821         * platform/graphics/gpu/GPUTextureUsage.h:
2822
2823         Update WebGPUTextureFormatEnum to GPUTextureFormat:
2824         * Modules/webgpu/WebGPUTextureFormatEnum.h: Removed.
2825         * Modules/webgpu/GPUTextureFormat.idl: Renamed from WebGPUTextureFormatEnum.idl and updated to hyphen-case.
2826         * platform/graphics/gpu/GPUTextureFormat.h: Renamed from GPUTextureFormatEnum and updated for hyphen-case IDL.
2827         * Modules/webgpu/WebGPUSwapChain.cpp:
2828         * Modules/webgpu/WebGPUSwapChain.h:
2829         * Modules/webgpu/WebGPUSwapChain.idl:
2830         * platform/graphics/gpu/GPUSwapChain.h:
2831         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2832         (WebCore::platformTextureFormatForGPUTextureFormat):
2833         (WebCore::GPUSwapChain::setFormat):
2834
2835         Update project files with new symbols:
2836         * CMakeLists.txt:
2837         * DerivedSources.make:
2838         * Sources.txt:
2839         * WebCore.xcodeproj/project.pbxproj:
2840         * bindings/js/WebCoreBuiltinNames.h:
2841
2842 2019-02-12  Dean Jackson  <dino@apple.com>
2843
2844         BitmapRenderer should handle existing ImageBuffers
2845         https://bugs.webkit.org/show_bug.cgi?id=194555
2846         <rdar://problem/47857150>
2847
2848         Reviewed by Tim Horton.
2849
2850         Our logic in ImageBitmapRenderingContext assumed that
2851         it had always created the ImageBuffer being used. However, it's
2852         valid to call something like toBlob() or toDataURL() before creating
2853         a context, so we need to handle the case where an ImageBuffer
2854         already exists.
2855
2856         Test: fast/canvas/bitmaprenderer-created-after-toBlob.html
2857
2858         * html/HTMLCanvasElement.cpp:
2859         (WebCore::HTMLCanvasElement::createImageBuffer const): Move some logic into setImageBuffer.
2860         (WebCore::HTMLCanvasElement::setImageBuffer const): Make sure to clear the state saver.
2861
2862 2019-02-06  Daniel Bates  <dabates@apple.com>
2863
2864         Standardize on ControlKey instead of CtrlKey
2865         https://bugs.webkit.org/show_bug.cgi?id=194317
2866
2867         Reviewed by Tim Horton.
2868
2869         * dom/UIEventWithKeyState.cpp:
2870         (WebCore::UIEventWithKeyState::modifiersFromInitializer):
2871         (WebCore::UIEventWithKeyState::setModifierKeys):
2872         * dom/UIEventWithKeyState.h:
2873         (WebCore::UIEventWithKeyState::ctrlKey const):
2874         * page/ios/EventHandlerIOS.mm:
2875         (WebCore::EventHandler::accessKeyModifiers):
2876         * page/mac/EventHandlerMac.mm:
2877         (WebCore::EventHandler::accessKeyModifiers):
2878         * platform/PlatformEvent.h:
2879         (WebCore::PlatformEvent::controlKey const):
2880         (WebCore::PlatformEvent::PlatformEvent):
2881         (WebCore::PlatformEvent::ctrlKey const): Deleted.
2882         * platform/cocoa/KeyEventCocoa.mm:
2883         (WebCore::PlatformKeyboardEvent::getCurrentModifierState):
2884         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2885         (WebCore::modifiersForGdkKeyEvent):
2886         * platform/gtk/PlatformMouseEventGtk.cpp:
2887         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2888         * platform/gtk/PlatformWheelEventGtk.cpp:
2889         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2890         * platform/ios/KeyEventIOS.mm:
2891         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
2892         * platform/ios/PlatformEventFactoryIOS.mm:
2893         (WebCore::modifiersForEvent):
2894         * platform/mac/KeyEventMac.mm:
2895         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
2896         * platform/mac/PlatformEventFactoryMac.mm:
2897         (WebCore::modifiersForEvent):
2898         * testing/Internals.cpp:
2899         (WebCore::Internals::accessKeyModifiers const):
2900
2901 2019-02-06  Alex Christensen  <achristensen@webkit.org>
2902
2903         Fix WatchOS build
2904         https://bugs.webkit.org/show_bug.cgi?id=194353
2905
2906         Rubber stamped by Tim Horton and Wenson Hsieh.
2907
2908         * rendering/RenderThemeIOS.mm:
2909         (WebCore::iconForAttachment):
2910
2911 2019-02-06  Olivier Blin  <olivier.blin@softathome.com>
2912
2913         [SVG] fix SVGURIReference build by including SVGElement
2914         https://bugs.webkit.org/show_bug.cgi?id=194292
2915
2916         Reviewed by Michael Catanzaro.
2917
2918         * svg/SVGURIReference.h:
2919         SVGURIReference is making use of SVGElement in its constructor, but
2920         it was not declared.
2921
2922         The issue was not seen in unified builds because it was grouped with
2923         other files including SVGElement.
2924
2925 2019-02-06  Zalan Bujtas  <zalan@apple.com>
2926
2927         [LFC][IFC] Move line layout code to a dedicated file
2928         https://bugs.webkit.org/show_bug.cgi?id=194328
2929
2930         Reviewed by Antti Koivisto.
2931
2932         * Sources.txt:
2933         * WebCore.xcodeproj/project.pbxproj:
2934         * layout/inlineformatting/InlineFormattingContext.cpp:
2935         (WebCore::Layout::InlineFormattingContext::layout const):
2936         (WebCore::Layout::isTrimmableContent): Deleted.
2937         (WebCore::Layout::InlineFormattingContext::initializeNewLine const): Deleted.
2938         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): Deleted.
2939         (WebCore::Layout::InlineFormattingContext::createFinalRuns const): Deleted.
2940         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): Deleted.
2941         (WebCore::Layout::InlineFormattingContext::closeLine const): Deleted.
2942         (WebCore::Layout::InlineFormattingContext::appendContentToLine const): Deleted.
2943         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): Deleted.
2944         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const): Deleted.
2945         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): Deleted.
2946         * layout/inlineformatting/InlineFormattingContext.h:
2947         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::hasContent const):
2948         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isClosed const):
2949         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isFirstLine const):
2950         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::runs):
2951         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalLeft const):
2952         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::availableWidth const):
2953         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::lastRunType const):
2954         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalTop const):
2955         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalBottom const):
2956         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalHeight const):
2957         (WebCore::Layout::InlineFormattingContext::Line::hasContent const): Deleted.
2958         (WebCore::Layout::InlineFormattingContext::Line::isClosed const): Deleted.
2959         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): Deleted.
2960         (WebCore::Layout::InlineFormattingContext::Line::runs): Deleted.
2961         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
2962         (WebCore::Layout::InlineFormattingContext::Line::availableWidth const): Deleted.
2963         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const): Deleted.
2964         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const): Deleted.
2965         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): Deleted.
2966         (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): Deleted.
2967         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2968         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
2969         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): Deleted.
2970         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): Deleted.
2971         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): Deleted.
2972         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): Deleted.
2973         * layout/inlineformatting/Line.cpp:
2974         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::init):
2975         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalLeft):
2976         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalRight):
2977         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalRight const):
2978         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::appendContent):
2979         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::close):
2980         (WebCore::Layout::InlineFormattingContext::Line::init): Deleted.
2981         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): Deleted.
2982         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): Deleted.
2983         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): Deleted.
2984         (WebCore::Layout::InlineFormattingContext::Line::appendContent): Deleted.
2985         (WebCore::Layout::InlineFormattingContext::Line::close): Deleted.
2986
2987 2019-02-06  Youenn Fablet  <youenn@apple.com>
2988
2989         CoreAudioCaptureSource should not configure its audio unit until it starts producing data
2990         https://bugs.webkit.org/show_bug.cgi?id=194310
2991
2992         Reviewed by Eric Carlson.
2993
2994         Delay the configuration of the audio unit until the source is instructed to start producing data.
2995         This allows the UIProcess to not start changing the audio unit when
2996         checking for constraints during getUserMedia call before the prompt.
2997         Covered by manual testing.
2998
2999         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3000         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
3001         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
3002         (WebCore::CoreAudioCaptureSource::startProducingData):
3003         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3004
3005 2019-02-06  Youenn Fablet  <youenn@apple.com>
3006
3007         Disable audio ducking at Audio Unit setup time
3008         https://bugs.webkit.org/show_bug.cgi?id=194303
3009
3010         Reviewed by Eric Carlson.
3011
3012         When creating a CoreAudioCaptureSource, the audio unit might be
3013         reconfigured if a past audio capture was done.
3014         This might trigger audio ducking which is undone in startInternal.
3015         In some cases, startInternal will never call start.
3016         In that case, the audio unit will continue ducking the other processing.
3017         To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal.
3018
3019         In addition to that, once a shared unit is created, it stays alive until the UIProcess exits.
3020         This might affect all applications.
3021         Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened.
3022         This has noticeable effects in the quality of audio being played on bluetooth devices.
3023
3024         Covered by manual tests.
3025
3026         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3027         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
3028         (WebCore::CoreAudioSharedUnit::unduck):
3029         (WebCore::CoreAudioSharedUnit::startInternal):
3030         (WebCore::CoreAudioSharedUnit::captureFailed):
3031         (WebCore::CoreAudioSharedUnit::stopProducingData):
3032
3033 2019-02-06  Antti Koivisto  <antti@apple.com>
3034
3035         RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
3036         https://bugs.webkit.org/show_bug.cgi?id=194333
3037         <rdar://problem/47822929>
3038
3039         Reviewed by Zalan Bujtas.
3040
3041         Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
3042         the legacy animation code triggering a resource load.
3043
3044         Test: http/tests/contentextensions/css-display-none-keyframe.html
3045
3046         * style/StyleScope.cpp:
3047         (WebCore::Style::Scope::scheduleUpdate):
3048
3049         Avoid clearing the style resolver if we are in the middle of a style resolution.
3050         A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
3051
3052 2019-02-06  Pablo Saavedra  <psaavedra@igalia.com>
3053
3054         Build failure after r240315
3055         https://bugs.webkit.org/show_bug.cgi?id=194341
3056
3057         Reviewed by Wenson Hsieh.
3058
3059         * bindings/js/JSUndoItemCustom.cpp:
3060         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
3061
3062 2019-02-05  Ryosuke Niwa  <rniwa@webkit.org>
3063
3064         REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name
3065         https://bugs.webkit.org/show_bug.cgi?id=194329
3066
3067         Reviewed by Geoffrey Garen.
3068
3069         The bug was caused by the code path for when navigating with a specific target frame name that does not exist
3070         never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous
3071         navigation, resulting in this release assertion.
3072
3073         Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix.
3074
3075         Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html
3076
3077         * loader/FrameLoader.cpp:
3078         (WebCore::FrameLoader::loadURL):
3079
3080 2019-02-05  Claudio Saavedra  <csaavedra@igalia.com>
3081
3082         [FreeType] Build fix for Debian stable
3083
3084         Unreviewed build fix.
3085
3086         Debian stable currently has a version of fontconfig that doesn't
3087         yet have FC_COLOR. #ifdef its use to fix the build.
3088
3089         * platform/graphics/freetype/FontCacheFreeType.cpp:
3090         (WebCore::FontCache::systemFallbackForCharacters):
3091
3092 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3093
3094         Stop using blobRegistry in NetworkProcess
3095         https://bugs.webkit.org/show_bug.cgi?id=194027
3096
3097         Reviewed by Youenn Fablet.
3098
3099         Also stop using NetworkBlobRegistry::singleton.
3100         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
3101         We now have to resolve all blob file references while we still have a
3102         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
3103         using the singleton after we have passed everything to the loading code, but it works the same
3104         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
3105         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
3106         which extensions to revoke.
3107
3108         * platform/network/BlobRegistryImpl.h:
3109         * platform/network/FormData.cpp:
3110         (WebCore::appendBlobResolved):
3111         (WebCore::FormData::resolveBlobReferences):
3112         * platform/network/FormData.h:
3113         * platform/network/cf/FormDataStreamCFNet.cpp:
3114         (WebCore::createHTTPBodyCFReadStream):
3115         * platform/network/curl/CurlFormDataStream.cpp:
3116         (WebCore::CurlFormDataStream::CurlFormDataStream):
3117
3118 2019-02-05  Truitt Savell  <tsavell@apple.com>
3119
3120         Unreviewed, rolling out r240984.
3121
3122         Revision casued two API timeouts
3123
3124         Reverted changeset:
3125
3126         "Stop using blobRegistry in NetworkProcess"
3127         https://bugs.webkit.org/show_bug.cgi?id=194027
3128         https://trac.webkit.org/changeset/240984
3129
3130 2019-02-05  Keith Rollin  <krollin@apple.com>
3131
3132         Enable the automatic checking and regenerations of .xcfilelists during builds
3133         https://bugs.webkit.org/show_bug.cgi?id=194124
3134         <rdar://problem/47721277>
3135
3136         Reviewed by Tim Horton.
3137
3138         Bug 193790 add a facility for checking -- during build time -- that
3139         any needed .xcfilelist files are up-to-date and for updating them if
3140         they are not. This facility was initially opt-in by setting
3141         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
3142         the process seemed robust. Its now time to enable this facility and
3143         make it opt-out. If there is a need to disable this facility, set and
3144         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
3145         running `make` or `build-webkit`, or before running Xcode from the
3146         command line.
3147
3148         Additionally, remove the step that generates a list of source files
3149         going into the UnifiedSources build step. It's only necessarily to
3150         specify Sources.txt and SourcesCocoa.txt as inputs.
3151
3152         No new tests since there should be no observable behavior difference.
3153
3154         * UnifiedSources-input.xcfilelist: Removed.
3155         * WebCore.xcodeproj/project.pbxproj:
3156
3157 2019-02-05  Keith Rollin  <krollin@apple.com>
3158
3159         Update .xcfilelist files
3160         https://bugs.webkit.org/show_bug.cgi?id=194121
3161         <rdar://problem/47720863>
3162
3163         Reviewed by Tim Horton.
3164
3165         Preparatory to enabling the facility for automatically updating the
3166         .xcfilelist files, check in a freshly-updated set so that not everyone
3167         runs up against having to regenerate them themselves.
3168
3169         No new tests since there should be no observable behavior difference.
3170
3171         * DerivedSources-input.xcfilelist:
3172         * DerivedSources-output.xcfilelist:
3173
3174 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3175
3176         Stop using blobRegistry in NetworkProcess
3177         https://bugs.webkit.org/show_bug.cgi?id=194027
3178
3179         Reviewed by Youenn Fablet.
3180
3181         Also stop using NetworkBlobRegistry::singleton.
3182         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
3183         We now have to resolve all blob file references while we still have a
3184         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
3185         using the singleton after we have passed everything to the loading code, but it works the same
3186         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
3187         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
3188         which extensions to revoke.
3189
3190         * platform/network/BlobRegistryImpl.h:
3191         * platform/network/FormData.cpp:
3192         (WebCore::appendBlobResolved):
3193         (WebCore::FormData::resolveBlobReferences):
3194         * platform/network/FormData.h:
3195         * platform/network/cf/FormDataStreamCFNet.cpp:
3196         (WebCore::createHTTPBodyCFReadStream):
3197         * platform/network/curl/CurlFormDataStream.cpp:
3198         (WebCore::CurlFormDataStream::CurlFormDataStream):
3199
3200 2019-02-05  Ryan Haddad  <ryanhaddad@apple.com>
3201
3202         Unreviewed, rolling out r240742.
3203
3204         Causes crashes on iOS simulator.
3205
3206         Reverted changeset:
3207
3208         "[iOS] Keyups for non-modifier keys identified as "Dead" when
3209         not focused in a content-editable element"
3210         https://bugs.webkit.org/show_bug.cgi?id=192824
3211         https://trac.webkit.org/changeset/240742
3212
3213 2019-02-05  Zalan Bujtas  <zalan@apple.com>
3214
3215         [LFC][IFC] collectInlineContent should use pre-computed margins, paddings and borders
3216         https://bugs.webkit.org/show_bug.cgi?id=194269
3217
3218         Reviewed by Antti Koivisto.
3219
3220         In this patch we pre-compute the margins padding and borders for formatting context roots, replaced boxes and non-replaced containers.
3221         These property values are input to collectInlineContent's inline item detaching logic.
3222
3223         * layout/inlineformatting/InlineFormattingContext.cpp:
3224         (WebCore::Layout::nextInPreOrder):
3225         (WebCore::Layout::InlineFormattingContext::layout const):
3226         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
3227         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
3228         * layout/inlineformatting/InlineFormattingContext.h:
3229         * layout/layouttree/LayoutBox.h: ran out bits. 
3230
3231 2019-02-05  Antoine Quint  <graouts@apple.com>
3232
3233         REGRESSION (r240579): com.apple.WebKit.WebContent at WebCore: WebCore::Document::absoluteEventRegionForNode
3234         https://bugs.webkit.org/show_bug.cgi?id=194284
3235         <rdar://problem/47774298>
3236
3237         Reviewed by Antti Koivisto.
3238
3239         The m_touchActionElements list needs to be HashSet<RefPtr<Element>> instead of HashSet<Element*>. It was initially storing raw pointers based on m_touchEventTargets
3240         which is an EventTargetSet (typedef’d to HashCountedSet<Node*>), but that's because these nodes have an event listener registered for them and as such are kept alive,
3241         whereas elements with a touch-action property aren’t. Elements are removed from this list from Document::nodeWillBeRemoved() and from Document::updateTouchActionElements(),
3242         the latter being called from Style::TreeResolver::resolveElement().
3243
3244         * dom/Document.cpp:
3245         (WebCore::Document::updateTouchActionElements):
3246         * dom/Document.h:
3247         (WebCore::Document::touchActionElements const):
3248
3249 2019-02-05  Benjamin Poulain  <benjamin@webkit.org>
3250
3251         Hit testing functions optimizations
3252         https://bugs.webkit.org/show_bug.cgi?id=194073
3253         <rdar://problem/47692312>
3254
3255         Reviewed by Zalan Bujtas.
3256
3257         This patch implements some easy optimizations that speed up
3258         hit testing without changing the algorithms.
3259
3260         * page/FrameViewLayoutContext.h:
3261         The code for:
3262             view().frameView().layoutContext().isPaintOffsetCacheEnabled()
3263         followed by:
3264             view().frameView().layoutContext().layoutState()
3265         was loading all the intermediate values twice and calling layoutState()
3266         twice.
3267
3268         By marking the function as pure, Clang can CSE the whole thing and
3269         remove the duplicated code.
3270
3271         * platform/graphics/LayoutRect.h:
3272         (WebCore::LayoutRect::isInfinite const):
3273         That one is pretty funny.
3274
3275         Since LayoutRect::isInfinite() was implemented before operator==() is
3276         declared, the compiler was falling back to the implicit convertion to FloatRect()
3277         before doing any comparison.
3278
3279         This explains a bunch of the convertions to float when using LayoutRect.
3280
3281         * rendering/RenderBox.cpp:
3282         (WebCore::RenderBox::mapLocalToContainer const):
3283         Just reoder to make the register nice and clean for the optimization described above.
3284
3285 2019-02-04  Yusuke Suzuki  <ysuzuki@apple.com>
3286
3287         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
3288         https://bugs.webkit.org/show_bug.cgi?id=193993
3289
3290         Reviewed by Keith Miller.
3291
3292         * bindings/scripts/CodeGeneratorJS.pm:
3293         (GenerateHeader):
3294         * bridge/runtime_method.h:
3295
3296 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
3297
3298         Move some macOS/iOS scrolling code into the scrolling/cocoa directory
3299         https://bugs.webkit.org/show_bug.cgi?id=194245
3300
3301         Reviewed by Zalan Bujtas.
3302
3303         ScrollingTreeFixedNode and ScrollingTreeStickyNode are used on iOS and macOS, so move them to the cocoa
3304         directory.
3305
3306         Standardize on the ordering of ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC).
3307
3308         Stop building ScrollingThread for iOS (it's never used), and stub out some functions so things build.
3309
3310         * SourcesCocoa.txt:
3311         * WebCore.xcodeproj/project.pbxproj:
3312         * page/scrolling/ScrollingThread.cpp:
3313         (WebCore::ScrollingThread::initializeRunLoop):
3314         (WebCore::ScrollingThread::wakeUpRunLoop):
3315         (WebCore::ScrollingThread::threadRunLoopSourceCallback):
3316         * page/scrolling/cocoa/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h.
3317         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm.
3318         * page/scrolling/cocoa/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h.
3319         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm.
3320         * page/scrolling/mac/ScrollingThreadMac.mm:
3321         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
3322         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3323
3324 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
3325
3326         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3327         https://bugs.webkit.org/show_bug.cgi?id=174816
3328
3329         Reviewed by Michael Catanzaro.
3330
3331         Tests: enabled fast/url/user-visible/.
3332
3333         * testing/Internals.cpp:
3334         (WebCore::Internals::userVisibleString): Enable method on all platforms.
3335
3336 2019-02-04  Fujii Hironori  <Hironori.Fujii@sony.com>
3337
3338         [curl] ASSERTION FAILED: !m_didNotifyResponse || m_multipartHandle
3339         https://bugs.webkit.org/show_bug.cgi?id=190895
3340
3341         Reviewed by Ross Kirsling.
3342
3343         An assertion was failing in CurlRequest::invokeDidReceiveResponse
3344         because DidReceiveResponse was already dispatched. This condition
3345         was met if CurlRequestScheduler::completeTransfer is called while
3346         waiting for the reply for the first DidReceiveResponse.
3347
3348         No new tests, covered by existing tests.
3349
3350         * platform/network/curl/CurlRequest.h:
3351         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
3352         Return true if m_didNotifyResponse is false disregard to
3353         m_didReturnFromNotify.
3354
3355 2019-02-04  Said Abou-Hallawa  <said@apple.com>
3356
3357         [CG] Enable setAdditionalSupportedImageTypes for WK1
3358         https://bugs.webkit.org/show_bug.cgi?id=194190
3359
3360         Reviewed by Tim Horton.
3361
3362         Move the function webCoreStringVectorFromNSStringArray from WebKit to
3363         WebCore so it can be used by both WebKit and WebKitLegacy.
3364
3365         * platform/mac/StringUtilities.h:
3366         * platform/mac/StringUtilities.mm:
3367         (WebCore::webCoreStringVectorFromNSStringArray):
3368
3369 2019-02-04  Justin Fan  <justin_fan@apple.com>
3370
3371         [Web GPU] Code clean-up for RenderPipeline backend
3372         https://bugs.webkit.org/show_bug.cgi?id=194238
3373
3374         Reviewed by Dean Jackson.
3375
3376         Replace dot syntax setters with calls to setter methods, and remove unnecessary setter calls for 
3377         the input state's descriptor arrays.
3378
3379         Covered by existing tests; no change in behavior.
3380
3381         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3382         (WebCore::tryCreateMtlDepthStencilState): Refactor to use implicit setters rather than dot syntax.
3383         (WebCore::setInputStateForPipelineDescriptor): Ditto, and remove unnecessary setter calls on array objects.
3384
3385 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
3386
3387         Use deferrable timer to restart the Responsiveness Timer on each wheel event
3388         https://bugs.webkit.org/show_bug.cgi?id=194135
3389         <rdar://problem/47724099>
3390
3391         Reviewed by Simon Fraser.
3392
3393         The original DeferrableOneShotTimer was not really deferrable.
3394         What it allows is to restart the count down from scratch after