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