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