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