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