bd7c4b8da8113110176011bc1f0c14f40677afb7
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-27  John Wilander  <wilander@apple.com>
2
3         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
4         https://bugs.webkit.org/show_bug.cgi?id=195071
5         <rdar://problem/48417690>
6
7         Reviewed by Alex Christensen and Brent Fulgham.
8
9         No new tests. This patch maintains functionality covered by plenty of layout
10         tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
11
12         This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
13         and makes the necessary infrastructure changes to support that.
14
15         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
16         HashSets since we never used the counts for anything. This change simplified
17         encoding and decoding for IPC and will eventually simplify encoding and
18         decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
19         model version 14 and below.
20
21         The patch also makes WebCore::RegistrableDomain's String constructor private.
22         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
23         is introduced to better signal to users that creating a registrable domain
24         object with a string may create an object that doesn't match a registrable
25         domain in a valid HTTP-family URL. This change (private String constructor)
26         motivated a change in WebCore::AdClickAttribution where the Source and
27         Destination structs now take a URL as parameter instead of a String.
28
29         Finally, this patch harmonizes parameter and variable naming, going from
30         "origin" to "domain" and "mainFrame" to "topFrame."
31
32         * html/HTMLAnchorElement.cpp:
33         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
34         * html/HTMLMediaElement.cpp:
35         (WebCore::HTMLMediaElement::mediaSessionTitle const):
36         * loader/AdClickAttribution.h:
37         (WebCore::AdClickAttribution::Source::Source):
38         (WebCore::AdClickAttribution::Source::deletedValue):
39         (WebCore::AdClickAttribution::Destination::Destination):
40         (WebCore::AdClickAttribution::Destination::deletedValue):
41         (WebCore::AdClickAttribution::decode):
42         * loader/ResourceLoadObserver.cpp:
43         (WebCore::ResourceLoadObserver::logSubresourceLoading):
44         (WebCore::ResourceLoadObserver::logWebSocketLoading):
45         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
46         (WebCore::ResourceLoadObserver::statisticsForURL):
47         (WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
48         * loader/ResourceLoadObserver.h:
49         * loader/ResourceLoadStatistics.cpp:
50         (WebCore::encodeHashSet):
51         (WebCore::ResourceLoadStatistics::encode const):
52         (WebCore::decodeHashCountedSet):
53         (WebCore::decodeHashSet):
54         (WebCore::ResourceLoadStatistics::decode):
55         (WebCore::appendHashSet):
56         (WebCore::ResourceLoadStatistics::toString const):
57         (WebCore::ResourceLoadStatistics::merge):
58         (WebCore::encodeHashCountedSet): Deleted.
59         (WebCore::encodeOriginHashSet): Deleted.
60         (WebCore::decodeOriginHashSet): Deleted.
61         (WebCore::appendHashCountedSet): Deleted.
62         * loader/ResourceLoadStatistics.h:
63         * platform/RegistrableDomain.h:
64         (WebCore::RegistrableDomain::uncheckedCreateFromString):
65         (WebCore::RegistrableDomain::RegistrableDomain):
66         * testing/Internals.cpp:
67         (WebCore::Internals::resourceLoadStatisticsForURL):
68         (WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
69         * testing/Internals.h:
70         * testing/Internals.idl:
71
72 2019-02-27  Justin Fan  <justin_fan@apple.com>
73
74         [Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
75         https://bugs.webkit.org/show_bug.cgi?id=195077
76         <rdar://problem/47805229>
77
78         Reviewed by Dean Jackson.
79
80         Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be 
81         used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
82         update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
83
84         Tests: webgpu/buffer-command-buffer-races.html
85                webgpu/map-read-buffers.html
86
87         * Modules/webgpu/WebGPUBindGroup.h:
88         (WebCore::WebGPUBindGroup::bindGroup const):
89         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
90         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
91         * Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
92         (WebCore::WebGPUBuffer::setSubData):
93         (WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
94         (WebCore::WebGPUBuffer::destroy):
95         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
96         * Modules/webgpu/WebGPUBuffer.h:
97         (WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
98         * Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
99         * Modules/webgpu/WebGPUCommandBuffer.cpp:
100         (WebCore::WebGPUCommandBuffer::beginRenderPass):
101         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
102         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
103         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
104         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
105         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
106         * Sources.txt:
107         * WebCore.xcodeproj/project.pbxproj:
108         * platform/graphics/gpu/GPUBuffer.h:
109         (WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
110         (WebCore::GPUBuffer::isVertex const):
111         (WebCore::GPUBuffer::isUniform const):
112         (WebCore::GPUBuffer::isStorage const):
113         (WebCore::GPUBuffer::isReadOnly const):
114         (WebCore::GPUBuffer::isMappable const):
115         (WebCore::GPUBuffer::isMapWrite const):
116         (WebCore::GPUBuffer::isMapRead const):
117         (WebCore::GPUBuffer::isMapWriteable const):
118         (WebCore::GPUBuffer::isMapReadable const):
119         * platform/graphics/gpu/GPUBufferBinding.h:
120         * platform/graphics/gpu/GPUCommandBuffer.h:
121         (WebCore::GPUCommandBuffer::usedBuffers const):
122         (WebCore::GPUCommandBuffer::useBuffer):
123         * platform/graphics/gpu/GPUDevice.cpp:
124         (WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
125         (WebCore::GPUDevice::tryCreateBuffer const): Deleted.
126         * platform/graphics/gpu/GPUDevice.h:
127         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
128         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
129         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
130         (WebCore::GPUProgrammablePassEncoder::commandBuffer const):
131         * platform/graphics/gpu/GPURenderPassEncoder.h:
132         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
133         (WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
134         (WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
135         (WebCore::GPUBuffer::GPUBuffer):
136         (WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
137         (WebCore::GPUBuffer::state const):
138         (WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
139         (WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
140         (WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
141         (WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
142         (WebCore::GPUBuffer::registerMappingCallback):
143         (WebCore::GPUBuffer::runMappingCallback):
144         (WebCore::GPUBuffer::unmap):
145         (WebCore::GPUBuffer::destroy):
146         (WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
147         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
148         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
149         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
150         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
151         (WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
152         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
153         (WebCore::GPURenderPassEncoder::tryCreate):
154         (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
155         (WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
156         (WebCore::GPURenderPassEncoder::create): Deleted.
157
158         Buffer size updates in the IDL:
159         * Modules/webgpu/GPUBufferDescriptor.idl:
160         * Modules/webgpu/WebGPUBuffer.idl:
161         * Modules/webgpu/WebGPUBufferBinding.idl:
162         * Modules/webgpu/WebGPUCommandBuffer.idl:
163         * Modules/webgpu/WebGPURenderPassEncoder.idl:
164         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
165         * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
166
167 2019-02-27  Youenn Fablet  <youenn@apple.com>
168
169         Remove LeetCode FetchRequest quirk
170         https://bugs.webkit.org/show_bug.cgi?id=195100
171
172         Reviewed by Alex Christensen.
173
174         Covered by manual testing.
175
176         * Modules/fetch/FetchRequest.cpp:
177         (WebCore::needsSignalQuirk):
178
179 2019-02-27  Chris Dumez  <cdumez@apple.com>
180
181         Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
182         https://bugs.webkit.org/show_bug.cgi?id=195101
183         <rdar://problem/48423023>
184
185         Reviewed by Geoffrey Garen.
186
187         Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
188         tries to register a "devicemotion" event listener and fails because the API is disabled. This is
189         needed to unblock the site and proceed with the login flow.
190
191         Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
192         guard the quirk behind this flag.
193
194         * page/DOMWindow.cpp:
195         (WebCore::DOMWindow::addEventListener):
196         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
197         * page/DOMWindow.h:
198
199 2019-02-27  Antoine Quint  <graouts@apple.com>
200
201         Support Pointer Events on macOS
202         https://bugs.webkit.org/show_bug.cgi?id=195008
203         <rdar://problem/47454419>
204
205         Reviewed by Dean Jackson.
206
207         We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
208         a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
209         exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
210         and the same behavior also extends to "pointerup".
211
212         Tests: pointerevents/mouse/over-enter-out-leave.html
213                pointerevents/mouse/pointer-capture.html
214                pointerevents/mouse/pointer-event-basic-properties.html
215                pointerevents/mouse/pointer-events-before-mouse-events.html
216                pointerevents/mouse/pointerdown-prevent-default.html
217
218         * Configurations/FeatureDefines.xcconfig:
219         * dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
220         property does not have any effect on macOS.
221         (WebCore::Document::invalidateRenderingDependentRegions):
222         (WebCore::Document::nodeWillBeRemoved):
223         (WebCore::Document::updateTouchActionElements):
224         * dom/Document.h:
225         * dom/Element.cpp:
226         (WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
227         If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
228         the mouse event.
229         * dom/PointerEvent.cpp:
230         (WebCore::pointerEventType):
231         (WebCore::PointerEvent::create):
232         * dom/PointerEvent.h:
233         * page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
234         (WebCore::hierarchyHasCapturingEventListeners):
235         (WebCore::EventHandler::updateMouseEventTargetNode):
236         * page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
237         (WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
238         (WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
239         pending target override needs to be considered to determine whether a given element has pointer capture enabled.
240         (WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
241         it is set.
242         * page/PointerLockController.cpp: Fix a build error which only happened on macOS.
243         * style/StyleTreeResolver.cpp:
244         (WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
245
246 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
247
248         Network Process is put to suspended when holding locked IndexedDB files
249         https://bugs.webkit.org/show_bug.cgi?id=195024
250         <rdar://problem/45194169>
251
252         Reviewed by Geoffrey Garen.
253
254         We found network process was suspended when IDBDatabase was being closed in the background database thread, 
255         holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by 
256         taking background assertion in UI process until the closes are done and locks are released.
257
258         * Modules/indexeddb/server/IDBServer.cpp:
259         (WebCore::IDBServer::IDBServer::create):
260         (WebCore::IDBServer::IDBServer::IDBServer):
261         (WebCore::IDBServer::IDBServer::createBackingStore):
262         (WebCore::IDBServer::IDBServer::closeDatabase):
263         (WebCore::IDBServer::IDBServer::didCloseDatabase):
264         * Modules/indexeddb/server/IDBServer.h:
265         (WebCore::IDBServer::IDBServer::create):
266         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
267         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
268         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
269         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
270         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
271         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
272         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
273         * Modules/indexeddb/server/UniqueIDBDatabase.h:
274
275 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
276
277         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
278         https://bugs.webkit.org/show_bug.cgi?id=194973
279
280         Reviewed by Antti Koivisto.
281
282         This patch cleans up how the scrolling tree responds to scrolls.
283
284         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
285         UI process scroll position.
286
287         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
288         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
289         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
290         updates related layers on this node (counter-scrolling layers etc), and then tells the
291         scrolling tree, which recurses through descendant nodes so they can adjust their layer
292         positions.
293
294         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
295         which does the above other than setting scrolledContentsLayer (since we're reacting to
296         layer state changes, not producing them).
297
298         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
299         ScrollingTree does the tree walk so classes don't have to implement
300         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
301         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
302         need to cross frame boundaries).
303
304         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
305         since the fixed state was computed with the "layout" scroll position, so we have to account
306         for the scroll delta since the last committed position. It's possible we could improve this
307         in future.
308
309         * page/scrolling/ScrollingTree.cpp:
310         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
311         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
312         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
313         (WebCore::ScrollingTree::mainFrameLayoutViewport):
314         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
315         * page/scrolling/ScrollingTree.h:
316         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
317         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
318         * page/scrolling/ScrollingTreeFrameHostingNode.h:
319         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
320         (WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
321         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
322         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
323         * page/scrolling/ScrollingTreeNode.cpp:
324         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
325         (WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
326         * page/scrolling/ScrollingTreeNode.h:
327         * page/scrolling/ScrollingTreeScrollingNode.cpp:
328         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
329         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
330         (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
331         (WebCore::ScrollingTreeScrollingNode::scrollBy):
332         (WebCore::ScrollingTreeScrollingNode::scrollTo):
333         (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
334         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
335         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
336         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
337         (WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
338         * page/scrolling/ScrollingTreeScrollingNode.h:
339         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
340         (WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
341         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
342         * page/scrolling/ThreadedScrollingTree.cpp:
343         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
344         * page/scrolling/ThreadedScrollingTree.h:
345         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
346         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
347         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
348         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
349         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
350         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
351         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
352         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
353         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
354         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
355         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
356         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
357         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
358         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
359         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
360         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
361         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
362         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
363         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
364         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
365         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
366         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
367         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
368         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
369         (): Deleted.
370         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
371         (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
372         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
373         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
374         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
375         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
376         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
377         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
378         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
379         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
380         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
381         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
382         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
383         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
384         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
385         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
386
387 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
388
389         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
390         https://bugs.webkit.org/show_bug.cgi?id=194973
391
392         Reviewed by Antti Koivisto.
393
394         The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
395         layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
396         and require different code for each scrolling node subclass, and adds a choke point that we can use to update
397         the layout viewport.
398         
399         We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
400         an alias for the scroll position.
401
402         Add some isRootNode() checks for things that should only affect the main frame.
403
404         * page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
405         no sense here.
406         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
407         (WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
408         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
409         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
410         (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
411         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
412         * page/scrolling/ScrollingTreeScrollingNode.cpp:
413         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
414         (WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
415         (WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
416         * page/scrolling/ScrollingTreeScrollingNode.h:
417         (WebCore::ScrollingTreeScrollingNode::scrollPosition const):
418         * page/scrolling/ios/ScrollingTreeIOS.cpp:
419         (WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
420         * page/scrolling/ios/ScrollingTreeIOS.h:
421         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
422         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
423         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
424         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
425         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
426         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
427         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
428         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
429         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
430         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
431         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
432
433 2019-02-27  Ulrich Pflueger  <up@nanocosmos.de>
434
435         [MSE] SourceBuffer sample time increment vs. last frame duration check is broken
436         https://bugs.webkit.org/show_bug.cgi?id=194747
437         <rdar://problem/48148469>
438
439         Reviewed by Jer Noble.
440
441         Prevent unintended frame drops by including last frame duration in discontinuity check. 
442
443         Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html
444
445         * Modules/mediasource/SourceBuffer.cpp:
446         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
447
448 2019-02-27  Timothy Hatcher  <timothy@apple.com>
449
450         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
451         https://bugs.webkit.org/show_bug.cgi?id=195086
452         rdar://problem/48419124
453
454         Reviewed by Tim Horton.
455
456         * platform/mac/ScrollAnimatorMac.mm:
457         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
458
459 2019-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
460
461         Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
462         https://bugs.webkit.org/show_bug.cgi?id=195067
463         <rdar://problem/44812080>
464
465         Reviewed by Tim Horton.
466
467         This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
468         would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
469         by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
470         really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
471         specific guards around this logic.
472
473         Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
474         a very subtle behavior change covered by the new layout test below.
475
476         Test: editing/undo/redo-text-insertion-in-non-editable-node.html
477
478         * editing/InsertIntoTextNodeCommand.cpp:
479         (WebCore::InsertIntoTextNodeCommand::doReapply):
480         * editing/InsertIntoTextNodeCommand.h:
481
482 2019-02-26  Keith Miller  <keith_miller@apple.com>
483
484         Code quality cleanup in NeverDestroyed
485         https://bugs.webkit.org/show_bug.cgi?id=194824
486
487         Reviewed by Mark Lam.
488
489         name_names.pl should not just assume the layout of LazyNeverDestroyed.
490
491         * dom/make_names.pl:
492         (printNamesCppFile):
493
494 2019-02-26  Zalan Bujtas  <zalan@apple.com>
495
496         Do not try to observe the timer when Page is nullptr
497         https://bugs.webkit.org/show_bug.cgi?id=195076
498
499         Reviewed by Tim Horton.
500
501         Covered by fast/dom/Window/timer-null-script-execution-context.html.
502
503         * page/DOMTimer.cpp:
504         (WebCore::DOMTimer::install):
505
506 2019-02-20  Jer Noble  <jer.noble@apple.com>
507
508         [Cocoa] Media elements will restart network buffering just before suspending
509         https://bugs.webkit.org/show_bug.cgi?id=193691
510
511         Reviewed by Eric Carlson.
512
513         API Test: WebKit.ProcessSuspendMediaBuffering
514
515         Allow the Page to suspend all media buffering in its child Documents.
516
517         * dom/Document.cpp:
518         (WebCore::Document::suspendAllMediaBuffering):
519         (WebCore::Document::resumeAllMediaBuffering):
520         * dom/Document.h:
521         * html/MediaElementSession.cpp:
522         (WebCore::MediaElementSession::dataBufferingPermitted const):
523         (WebCore::MediaElementSession::suspendBuffering):
524         (WebCore::MediaElementSession::resumeBuffering):
525         (WebCore::MediaElementSession::bufferingSuspended const):
526         * html/MediaElementSession.h:
527         * page/Page.cpp:
528         (WebCore::Page::suspendAllMediaBuffering):
529         (WebCore::Page::resumeAllMediaBuffering):
530         * page/Page.h:
531         (WebCore::Page::mediaPlaybackIsSuspended const):
532         (WebCore::Page::mediaBufferingIsSuspended const):
533         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
534         * platform/audio/PlatformMediaSession.h:
535         (WebCore::PlatformMediaSession::suspendBuffering):
536         (WebCore::PlatformMediaSession::resumeBuffering):
537         * platform/audio/PlatformMediaSessionManager.cpp:
538         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
539         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
540         * platform/audio/PlatformMediaSessionManager.h:
541
542 2019-02-26  Youenn Fablet  <youenn@apple.com>
543
544         Move service worker response validation from the service worker client to the service worker itself
545         https://bugs.webkit.org/show_bug.cgi?id=194716
546
547         Reviewed by Geoffrey Garen.
548
549         Added response validation at service worker side.
550
551         No change of behavior except for now logging validation error messages in the console.
552         Covered by rebased tests.
553
554         * workers/service/context/ServiceWorkerFetch.cpp:
555         (WebCore::ServiceWorkerFetch::validateResponse):
556         (WebCore::ServiceWorkerFetch::processResponse):
557         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
558
559 2019-02-26  Sihui Liu  <sihui_liu@apple.com>
560
561         [Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
562         https://bugs.webkit.org/show_bug.cgi?id=195036
563
564         Reviewed by Geoffrey Garen.
565
566         When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but 
567         also transactions in committing process.
568
569         Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise 
570         there is a reference cycle of TransactionOpration.
571
572         Covered by existing tests storage/indexeddb/IDBObject-leak.html.
573
574         * Modules/indexeddb/IDBDatabase.cpp:
575         (WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
576         * Modules/indexeddb/IDBTransaction.cpp:
577         (WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
578         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
579         (WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
580         * Modules/indexeddb/client/IDBConnectionProxy.h:
581         * Modules/indexeddb/client/TransactionOperation.h:
582         (WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the 
583         operation is in completion process. 
584
585 2019-02-26  Zalan Bujtas  <zalan@apple.com>
586
587         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
588         https://bugs.webkit.org/show_bug.cgi?id=195066
589         <rdar://problem/48411682>
590
591         Reviewed by Tim Horton.
592
593         Now all the empty clearContentChangeObservers() implementations can be removed.
594
595         * dom/Document.cpp:
596         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
597         * loader/EmptyClients.h:
598         * page/ChromeClient.h:
599         * page/Frame.cpp:
600         (WebCore::Frame::willDetachPage):
601         * page/ios/ContentChangeObserver.h:
602         * page/ios/ContentChangeObserver.mm:
603         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
604         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
605         (WebCore::ContentChangeObserver::willDetachPage):
606
607 2019-02-26  Zalan Bujtas  <zalan@apple.com>
608
609         [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
610         https://bugs.webkit.org/show_bug.cgi?id=195062
611         <rdar://problem/48409258>
612
613         Reviewed by Tim Horton.
614
615         Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
616
617         * dom/Document.cpp:
618         (WebCore::Document::scheduleStyleRecalc):
619         * page/DOMTimer.cpp:
620         (WebCore::DOMTimer::install):
621         * page/ios/ContentChangeObserver.h:
622         * page/ios/ContentChangeObserver.mm:
623         (WebCore::ContentChangeObserver::didInstallDOMTimer):
624         (WebCore::ContentChangeObserver::didScheduleStyleRecalc):
625         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
626
627 2019-02-26  Chris Dumez  <cdumez@apple.com>
628
629         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
630         https://bugs.webkit.org/show_bug.cgi?id=195054
631         <rdar://problem/48330549>
632
633         Reviewed by Geoff Garen.
634
635         Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.
636
637         * page/MemoryRelease.cpp:
638         (WebCore::releaseNoncriticalMemory):
639         (WebCore::releaseCriticalMemory):
640         (WebCore::releaseMemory):
641         * page/MemoryRelease.h:
642
643 2019-02-26  Commit Queue  <commit-queue@webkit.org>
644
645         Unreviewed, rolling out r241970.
646         https://bugs.webkit.org/show_bug.cgi?id=195057
647
648         made the QuickLook.LegacyQuickLookContent API test flakey
649         (Requested by estes on #webkit).
650
651         Reverted changeset:
652
653         "[iOS] Break a reference cycle between PreviewLoader and
654         ResourceLoader"
655         https://bugs.webkit.org/show_bug.cgi?id=194964
656         https://trac.webkit.org/changeset/241970
657
658 2019-02-26  Zalan Bujtas  <zalan@apple.com>
659
660         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
661         https://bugs.webkit.org/show_bug.cgi?id=195023
662         <rdar://problem/48381885>
663
664         Reviewed by Tim Horton.
665
666         In the future we might decide that certain activities don't require DOMTimer observation, but that should
667         be internal to ContentChangeObserver.
668
669         * page/ios/ContentChangeObserver.h:
670         * page/ios/ContentChangeObserver.mm:
671         (WebCore::ContentChangeObserver::startObservingContentChanges):
672         (WebCore::ContentChangeObserver::stopObservingContentChanges):
673         * page/ios/EventHandlerIOS.mm:
674         (WebCore::EventHandler::mouseMoved):
675
676 2019-02-26  Zalan Bujtas  <zalan@apple.com>
677
678         [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
679         https://bugs.webkit.org/show_bug.cgi?id=195032
680         <rdar://problem/48388063>
681
682         Reviewed by Tim Horton.
683
684         This might eventually turn into a regular start/stop content observing call.
685
686         * dom/Document.cpp:
687         (WebCore::Document::updateStyleIfNeeded):
688         * page/ios/ContentChangeObserver.h:
689         * page/ios/ContentChangeObserver.mm:
690         (WebCore::ContentChangeObserver::startObservingStyleResolve):
691         (WebCore::ContentChangeObserver::stopObservingStyleResolve):
692
693 2019-02-26  Zalan Bujtas  <zalan@apple.com>
694
695         [ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
696         https://bugs.webkit.org/show_bug.cgi?id=195035
697         <rdar://problem/48389123>
698
699         Reviewed by Tim Horton.
700
701         Visibility checking logic belongs to ContentChangeObserver.
702
703         * page/ios/ContentChangeObserver.h:
704         * page/ios/ContentChangeObserver.mm:
705         (WebCore::elementImplicitVisibility):
706         (WebCore::ContentChangeObserver::StyleChange::StyleChange):
707         (WebCore::ContentChangeObserver::StyleChange::~StyleChange):
708         * rendering/updating/RenderTreeUpdater.cpp:
709         (WebCore::RenderTreeUpdater::updateElementRenderer):
710         (WebCore::elementImplicitVisibility): Deleted.
711         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
712         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
713
714 2019-02-26  Philippe Normand  <pnormand@igalia.com>
715
716         [EGL] Runtime support for RGB565 pixel layout
717         https://bugs.webkit.org/show_bug.cgi?id=194817
718
719         Reviewed by Carlos Garcia Campos.
720
721         Currently our graphics pipeline always relies on a ARGB8888 (32
722         bpp) pixel configuration. On some low-end (old) embedded platforms
723         the graphics driver is sometimes optimized for 16 bpp
724         configurations, such as RGB565. On those platforms the application
725         can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
726         "RGB565" to adjust to the best pixel configuration supported by
727         the screen and graphics driver.
728
729         * platform/graphics/egl/GLContextEGL.cpp:
730         (WebCore::GLContextEGL::getEGLConfig):
731
732 2019-02-26  Philippe Normand  <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
733
734         [WPE] Add API for webview background color configuration
735         https://bugs.webkit.org/show_bug.cgi?id=192305
736
737         Reviewed by Michael Catanzaro.
738
739         Adapt the FrameView API to allow a default non-white background color.
740
741         * page/Frame.cpp:
742         (WebCore::Frame::createView): Replace isTransparent argument with a background color one.
743         * page/Frame.h:
744         * page/FrameView.cpp:
745         (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
746         (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
747         used only in non-dark-mode-css build configurations.
748         * page/FrameView.h:
749         * testing/Internals.cpp:
750         (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
751
752 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
753
754         scalableNativeWebpageParameters() is not preserved on new page navigation.
755         https://bugs.webkit.org/show_bug.cgi?id=194892
756         <rdar://problem/47538280>
757
758         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
759         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
760         configuration until we derive the right values from viewport meta-tag.
761
762         Reviewed by Wenson Hsieh.
763
764         Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
765
766         * page/ViewportConfiguration.cpp:
767         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
768         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
769         (WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
770             based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
771         (WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
772         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
773         * page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
774             static method to fixedNativeWebpageParameters which better reflects the actual behavior.
775
776 2019-02-25  Zalan Bujtas  <zalan@apple.com>
777
778         [ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
779         https://bugs.webkit.org/show_bug.cgi?id=194988
780         <rdar://problem/48343040>
781
782         Reviewed by Tim Horton.
783
784         ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
785
786         * page/DOMWindow.cpp:
787         (WebCore::DOMWindow::clearTimeout):
788         * page/ios/ContentChangeObserver.h:
789         * page/ios/ContentChangeObserver.mm:
790         (WebCore::ContentChangeObserver::startObservingDOMTimer):
791         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
792         (WebCore::ContentChangeObserver::removeDOMTimer):
793
794 2019-02-25  Zalan Bujtas  <zalan@apple.com>
795
796         [ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
797         https://bugs.webkit.org/show_bug.cgi?id=194987
798         <rdar://problem/48342910>
799
800         Reviewed by Tim Horton.
801
802         Content obvservation logic should all move to the ContentChangeObserver class.
803
804         * page/DOMTimer.cpp:
805         (WebCore::DOMTimer::install):
806         (WebCore::DOMTimer::fired):
807         * page/Page.cpp:
808         (WebCore::Page::Page):
809         * page/Page.h:
810         (WebCore::Page::contentChangeObserver):
811         * page/ios/ContentChangeObserver.h:
812         * page/ios/ContentChangeObserver.mm:
813         (WebCore::ContentChangeObserver::ContentChangeObserver):
814         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
815         (WebCore::ContentChangeObserver::startObservingDOMTimer):
816         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
817         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
818         (WebCore::ContentChangeObserver::addObservedDOMTimer):
819         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
820
821 2019-02-25  John Wilander  <wilander@apple.com>
822
823         Introduce and adopt new class RegistrableDomain for eTLD+1
824         https://bugs.webkit.org/show_bug.cgi?id=194791
825         <rdar://problem/48179240>
826
827         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
828
829         A new API test was added. Plenty of existing layout tests under
830         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
831
832         This patch introduces and adopts a new class called WebCore::RegistrableDomain
833         which represents a domain's eTLD+1 (effective top level domain plus one) and is
834         the basis for the term "site," as in same-site. Other popular names include
835         high-level domain, primary domain, and top privately controlled/owned domain.
836         Effective top level domains are enumerated on the Public Suffix List
837         (https://publicsuffix.org).
838
839         This class just uses the full domain for when the Public Suffix List cannot help
840         finding the registrable domain and for WebKit ports that haven't enabled
841         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
842         for the null or unique origin (this matches how these origins were handled
843         before).
844
845         The implementation is a wrapper around a String and the functions and class
846         members that now make use of this new class used to handle regular String
847         objects which didn't help much in terms of type safety or guarantees that the
848         string had already been converted to an eTLD+1.
849
850         We've at least two bad bugs in the Storage Access API because of confusion
851         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
852         will prohibit such bugs in the future.
853
854         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
855         WebCore::RegistrableDomain for partitioning in a later patch.
856
857         This patch also enhances parameter naming by:
858         - Removing parts that refer to "primary" as in primaryDomain.
859         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
860         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
861         - Using the term "domain" consistently instead of e.g. "host."
862
863         * WebCore.xcodeproj/project.pbxproj:
864         * dom/Document.cpp:
865         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
866         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
867         * dom/Document.h:
868         * html/HTMLAnchorElement.cpp:
869         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
870         * html/HTMLMediaElement.cpp:
871         (WebCore::HTMLMediaElement::mediaSessionTitle const):
872         * loader/AdClickAttribution.cpp:
873         (WebCore::AdClickAttribution::url const):
874         (WebCore::AdClickAttribution::referrer const):
875         (WebCore::AdClickAttribution::toString const):
876         * loader/AdClickAttribution.h:
877         (WebCore::AdClickAttribution::Source::Source):
878         (WebCore::AdClickAttribution::Source::matches const):
879         (WebCore::AdClickAttribution::Source::deleteValue):
880         (WebCore::AdClickAttribution::Destination::Destination):
881         (WebCore::AdClickAttribution::Destination::matches const):
882         (WebCore::AdClickAttribution::Destination::deleteValue):
883         * loader/ResourceLoadObserver.cpp:
884         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
885         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
886         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
887         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
888         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
889         (WebCore::ResourceLoadObserver::logSubresourceLoading):
890         (WebCore::ResourceLoadObserver::logWebSocketLoading):
891         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
892         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
893         (WebCore::ResourceLoadObserver::logFontLoad):
894         (WebCore::ResourceLoadObserver::logCanvasRead):
895         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
896         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
897         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
898         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
899         (WebCore::ResourceLoadObserver::statisticsForOrigin):
900         (WebCore::primaryDomain): Deleted.
901         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
902         * loader/ResourceLoadObserver.h:
903         * loader/ResourceLoadStatistics.cpp:
904         (WebCore::ResourceLoadStatistics::encode const):
905         (WebCore::ResourceLoadStatistics::decode):
906         (WebCore::ResourceLoadStatistics::toString const):
907         (WebCore::ResourceLoadStatistics::merge):
908         (WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
909         * loader/ResourceLoadStatistics.h:
910         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
911         * page/Page.cpp:
912         (WebCore::Page::logNavigation):
913         (WebCore::Page::mainFrameLoadStarted):
914         * page/Page.h:
915         * page/PerformanceMonitor.cpp:
916         (WebCore::reportPageOverPostLoadResourceThreshold):
917         * platform/RegistrableDomain.h: Added.
918         (WebCore::RegistrableDomain::RegistrableDomain):
919         (WebCore::RegistrableDomain::isEmpty const):
920         (WebCore::RegistrableDomain::string const):
921         (WebCore::RegistrableDomain::operator!= const):
922         (WebCore::RegistrableDomain::operator== const):
923         (WebCore::RegistrableDomain::matches const):
924         (WebCore::RegistrableDomain::isolatedCopy const):
925         (WebCore::RegistrableDomain::isHashTableDeletedValue const):
926         (WebCore::RegistrableDomain::hash const):
927         (WebCore::RegistrableDomain::RegistrableDomainHash::hash):
928         (WebCore::RegistrableDomain::RegistrableDomainHash::equal):
929         (WebCore::RegistrableDomain::encode const):
930         (WebCore::RegistrableDomain::decode):
931         * platform/network/NetworkStorageSession.cpp:
932         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
933         (WebCore::NetworkStorageSession::shouldBlockCookies const):
934         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
935         (WebCore::NetworkStorageSession::removePrevalentDomains):
936         (WebCore::NetworkStorageSession::hasStorageAccess const):
937         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
938         (WebCore::NetworkStorageSession::grantStorageAccess):
939         (WebCore::getPartitioningDomain): Deleted.
940         * platform/network/NetworkStorageSession.h:
941
942 2019-02-25  Chris Fleizach  <cfleizach@apple.com>
943
944         AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
945         https://bugs.webkit.org/show_bug.cgi?id=190138
946         <rdar://problem/44907695>
947
948         Reviewed by Joanmarie Diggs.
949
950         Make sure that footer elements use the right role depending on their context.
951         If scoped to body, they become contentinfo. Otherwise they are just delineated by
952         a footer subrole.
953
954         * accessibility/AccessibilityObject.cpp:
955         (WebCore::AccessibilityObject::isLandmark const):
956         * accessibility/AccessibilityRenderObject.cpp:
957         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
958         (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
959         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
960         * accessibility/AccessibilityRenderObject.h:
961         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
962         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
963         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
964         (-[WebAccessibilityObjectWrapper subrole]):
965
966 2019-02-25  Sihui Liu  <sihui_liu@apple.com>
967
968         IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
969         https://bugs.webkit.org/show_bug.cgi?id=194709
970
971         Reviewed by Geoffrey Garen.
972
973         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
974         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
975  
976         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
977         between IDBOpenDBRequest and IDBTransaction.
978
979         Test: storage/indexeddb/IDBObject-leak.html
980
981         * Modules/indexeddb/IDBDatabase.cpp:
982         (WebCore::IDBDatabase::connectionToServerLost):
983         * Modules/indexeddb/IDBTransaction.cpp:
984         (WebCore::IDBTransaction::IDBTransaction):
985         (WebCore::IDBTransaction::~IDBTransaction):
986         (WebCore::IDBTransaction::connectionClosedFromServer):
987         * Modules/indexeddb/IDBTransaction.h:
988         * testing/Internals.cpp:
989         (WebCore::Internals::numberOfIDBTransactions const):
990         * testing/Internals.h:
991         * testing/Internals.idl:
992
993 2019-02-25  Zalan Bujtas  <zalan@apple.com>
994
995         Add missing stream parameter. Unreviewed.
996
997         * page/DOMTimer.cpp:
998         (WebCore::DOMTimer::fired):
999
1000 2019-02-25  Zalan Bujtas  <zalan@apple.com>
1001
1002         Unreviewed build fix after r242032.
1003
1004         * page/DOMTimer.cpp:
1005         (WebCore::DOMTimer::install):
1006
1007 2019-02-20  Darin Adler  <darin@apple.com>
1008
1009         Incorrect use of String::foldCase for font family names
1010         https://bugs.webkit.org/show_bug.cgi?id=194895
1011
1012         Reviewed by Myles C. Maxfield.
1013
1014         * platform/graphics/FontCascadeDescription.cpp:
1015         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
1016         familyNamesAreEqual instead of calling convertToASCIILowercase directly.
1017         (WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
1018         operator== when we want case sensitive family name comparisons. This is a special
1019         case to accomodate CoreText, which uses "."-prefix names for internal fonts that
1020         are treated case sensitively. (Ideally webpages would not use these fonts at all.)
1021         (WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
1022         when we want case sensitive family name hashing.
1023         (WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
1024         AtomicString so we can use this at an additional call site. Converting from an
1025         AtomicString to a String if free and automatic at the existing call sites. Use
1026         convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
1027         here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
1028         must be consistent. 2) this is considerably faster, and 3) font family names don't
1029         need arbitrary Unicode case folding, it's only A-Z that should be folded.
1030         * platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
1031         in the foldedFamilyName function.
1032
1033         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1034         (WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
1035         FontCascadeDescription::foldedFamilyName to correctly fold font family names.
1036
1037 2019-02-25  Charlie Turner  <cturner@igalia.com>
1038
1039         [EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
1040         https://bugs.webkit.org/show_bug.cgi?id=194992
1041
1042         Reviewed by Xabier Rodriguez-Calvar.
1043
1044         Refactoring, no new tests.
1045
1046         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1047         (transformCaps): Simplify the code a little. The idea to use this
1048         utility function came from a review upstream here:
1049         https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/67
1050
1051 2019-02-25  Alicia Boya García  <aboya@igalia.com>
1052
1053         [MSE][GStreamer] Batch player duration updates
1054         https://bugs.webkit.org/show_bug.cgi?id=194220
1055
1056         Reviewed by Xabier Rodriguez-Calvar.
1057
1058         This saves up a ton of CPU cycles doing layout unnecessarily when all
1059         the appended frames extend the duration of the movie, like in
1060         YTTV 2018 59.DASHLatencyVP9.
1061
1062         This patch is an optimization that introduces no new behavior.
1063
1064         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1065         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
1066         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1067         (WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges):
1068         (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
1069         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
1070         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1071
1072 2019-02-25  Miguel Gomez  <magomez@igalia.com>
1073
1074         [WPE] Add support for holepunch using an external video player
1075         https://bugs.webkit.org/show_bug.cgi?id=194899
1076
1077         Reviewed by Xabier Rodriguez-Calvar.
1078
1079         Implement the holepunch feature to allow playback using an external player. This creates
1080         a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
1081         whose goal is to just draw a transparent rectangle in the position where the video should be.
1082         This can be used to allow a player placed on a lower plane than the browser to become visible.
1083
1084         Added ManualTest wpe/video-player-holepunch-external.html to test the feature.
1085
1086         * PlatformWPE.cmake:
1087         * platform/HolePunch.cmake: Added.
1088         * platform/graphics/MediaPlayer.cpp:
1089         (WebCore::buildMediaEnginesVector):
1090         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
1091         (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
1092         (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
1093         (WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
1094         (WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
1095         (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
1096         (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
1097         (WebCore::MediaPlayerPrivateHolePunch::proxy const):
1098         (WebCore::mimeTypeCache):
1099         (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
1100         (WebCore::MediaPlayerPrivateHolePunch::supportsType):
1101         (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
1102         (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
1103         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
1104         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1105         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
1106
1107 2019-02-24  Zalan Bujtas  <zalan@apple.com>
1108
1109         Introduce ContentChangeObserver class
1110         https://bugs.webkit.org/show_bug.cgi?id=194977
1111         <rdar://problem/48338115>
1112
1113         Reviewed by Simon Fraser.
1114
1115         This patch is about piping through all the related WK* calls. 
1116
1117         * SourcesCocoa.txt:
1118         * WebCore.xcodeproj/project.pbxproj:
1119         * dom/Document.cpp:
1120         (WebCore::Document::scheduleStyleRecalc):
1121         (WebCore::Document::updateStyleIfNeeded):
1122         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1123         * loader/FrameLoader.cpp:
1124         * page/DOMTimer.cpp:
1125         (WebCore::DOMTimer::install):
1126         (WebCore::DOMTimer::fired):
1127         * page/DOMWindow.cpp:
1128         (WebCore::DOMWindow::clearTimeout):
1129         * page/Frame.cpp:
1130         (WebCore::Frame::willDetachPage):
1131         * page/Page.h:
1132         (WebCore::Page::contentChangeObserver):
1133         * page/ios/EventHandlerIOS.mm:
1134         (WebCore::EventHandler::mouseMoved):
1135         * rendering/updating/RenderTreeUpdater.cpp:
1136         (WebCore::RenderTreeUpdater::updateElementRenderer):
1137         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
1138         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
1139
1140 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
1141
1142         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
1143         https://bugs.webkit.org/show_bug.cgi?id=194984
1144
1145         Reviewed by Sam Weinig.
1146
1147         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
1148
1149         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
1150         current layout viewport rect. Instead, set the layout viewport on the root
1151         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
1152
1153         * page/scrolling/ScrollingTree.cpp:
1154         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1155         (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted.
1156         * page/scrolling/ScrollingTree.h:
1157         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1158         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
1159         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1160         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1161         * page/scrolling/ScrollingTreeNode.h:
1162         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1163         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange):
1164         * page/scrolling/ScrollingTreeScrollingNode.h:
1165         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1166         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1167         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
1168         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1169         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1170         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
1171         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1172         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1173         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1174         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
1175         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
1176
1177 2019-02-24  Devin Rousso  <drousso@apple.com>
1178
1179         Web Inspector: Change the InspectorOverlay to use native rather than canvas
1180         https://bugs.webkit.org/show_bug.cgi?id=105023
1181         <rdar://problem/13443692>
1182
1183         Reviewed by Brian Burg.
1184
1185         Should be no change in observed functionality.
1186
1187         * inspector/InspectorOverlay.h:
1188         * inspector/InspectorOverlay.cpp:
1189         (WebCore::truncateWithEllipsis): Added.
1190         (WebCore::localPointToRootPoint): Added.
1191         (WebCore::contentsQuadToCoordinateSystem):
1192         (WebCore::effectiveElementForNode): Added.
1193         (WebCore::quadToPath): Added.
1194         (WebCore::drawOutlinedQuadWithClip): Added.
1195         (WebCore::drawOutlinedQuad): Added.
1196         (WebCore::drawFragmentHighlight): Added.
1197         (WebCore::drawShapeHighlight): Added.
1198         (WebCore::InspectorOverlay::paint):
1199         (WebCore::InspectorOverlay::setIndicating):
1200         (WebCore::InspectorOverlay::shouldShowOverlay const):
1201         (WebCore::InspectorOverlay::update):
1202         (WebCore::InspectorOverlay::setShowPaintRects): Added.
1203         (WebCore::InspectorOverlay::showPaintRect):
1204         (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
1205         (WebCore::InspectorOverlay::drawNodeHighlight):
1206         (WebCore::InspectorOverlay::drawQuadHighlight):
1207         (WebCore::InspectorOverlay::drawPaintRects):
1208         (WebCore::InspectorOverlay::drawBounds): Added.
1209         (WebCore::InspectorOverlay::drawRulers):
1210         (WebCore::InspectorOverlay::drawElementTitle): Added.
1211         (WebCore::contentsQuadToPage): Deleted.
1212         (WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
1213         (WebCore::buildObjectForPoint): Deleted.
1214         (WebCore::buildObjectForRect): Deleted.
1215         (WebCore::buildArrayForQuad): Deleted.
1216         (WebCore::buildObjectForHighlight): Deleted.
1217         (WebCore::buildObjectForSize): Deleted.
1218         (WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
1219         (WebCore::buildArrayForRendererFragments): Deleted.
1220         (WebCore::localPointToRoot): Deleted.
1221         (WebCore::appendPathCommandAndPoints): Deleted.
1222         (WebCore::appendPathSegment): Deleted.
1223         (WebCore::buildObjectForShapeOutside): Deleted.
1224         (WebCore::buildObjectForElementData): Deleted.
1225         (WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
1226         (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
1227         (WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
1228         (WebCore::InspectorOverlay::overlayPage): Deleted.
1229         (WebCore::InspectorOverlay::forcePaint): Deleted.
1230         (WebCore::InspectorOverlay::reset): Deleted.
1231         (WebCore::evaluateCommandInOverlay): Deleted.
1232         (WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
1233         (WebCore::InspectorOverlay::freePage): Deleted.
1234
1235         * inspector/agents/InspectorPageAgent.cpp:
1236         (WebCore::InspectorPageAgent::disable):
1237         (WebCore::InspectorPageAgent::setShowPaintRects):
1238         Drive-by: rename `setShowingPaintRects` to better match the protocol.
1239
1240         * inspector/agents/page/PageDebuggerAgent.h:
1241         * inspector/agents/page/PageDebuggerAgent.cpp:
1242         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
1243         (WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
1244         Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
1245
1246         * inspector/InspectorController.h:
1247         * inspector/InspectorController.cpp:
1248         (WebCore::InspectorController::createLazyAgents):
1249         (WebCore::InspectorController::disconnectFrontend):
1250         (WebCore::InspectorController::disconnectAllFrontends):
1251         (WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.
1252
1253         * testing/Internals.h:
1254         * testing/Internals.idl:
1255         * testing/Internals.cpp:
1256         (WebCore::Internals::inspectorHighlightObject): Deleted.
1257
1258         * inspector/InspectorOverlayPage.css: Removed.
1259         * inspector/InspectorOverlayPage.html: Removed.
1260         * inspector/InspectorOverlayPage.js: Removed.
1261
1262         * CMakeLists.txt:
1263         * DerivedSources-input.xcfilelist:
1264         * DerivedSources-output.xcfilelist:
1265         * DerivedSources.make:
1266         * WebCore.xcodeproj/project.pbxproj:
1267
1268 2019-02-20  Darin Adler  <darin@apple.com>
1269
1270         Finish removing String::format
1271         https://bugs.webkit.org/show_bug.cgi?id=194893
1272
1273         Reviewed by Daniel Bates.
1274
1275         * dom/Document.cpp:
1276         (WebCore::Document::lastModified const): Use makeString and pad.
1277         * html/FTPDirectoryDocument.cpp:
1278         (WebCore::processFileDateString): Ditto.
1279
1280         * mathml/MathMLElement.cpp:
1281         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
1282
1283         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1284         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
1285
1286         * page/linux/ResourceUsageOverlayLinux.cpp:
1287         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
1288         (WebCore::gcTimerString): Use String::number.
1289
1290         * platform/DateComponents.cpp:
1291         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
1292         (WebCore::DateComponents::toString const): Ditto.
1293
1294         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
1295         and that was also inaccurate.
1296
1297         * platform/audio/HRTFElevation.cpp:
1298         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
1299         Use makeString and pad.
1300         * platform/mock/MockRealtimeVideoSource.cpp:
1301         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
1302         * rendering/RenderLayerCompositor.cpp:
1303         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
1304         * rendering/RenderTheme.cpp:
1305         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
1306
1307 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1308
1309         [WPE][GTK] Remove user agent quirk for washingtonpost.com
1310         https://bugs.webkit.org/show_bug.cgi?id=194981
1311
1312         Reviewed by Žan Doberšek.
1313
1314         Remove user agent quirk for washingtonpost.com because we support JPEG 2000 now.
1315
1316         * platform/UserAgentQuirks.cpp:
1317         (WebCore::urlRequiresChromeBrowser):
1318
1319 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
1320
1321         Remove remnants of iOS WK1 scrolling tree code
1322         https://bugs.webkit.org/show_bug.cgi?id=194980
1323
1324         Reviewed by Sam Weinig.
1325
1326         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
1327         to reduce maintenance costs and simplify.
1328
1329         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
1330         since that was the only concrete subclass, removing code which never applies to iOS WK2
1331         (e.g. the synchronous scrolling code path).
1332
1333         * SourcesCocoa.txt:
1334         * WebCore.xcodeproj/project.pbxproj:
1335         * page/FrameView.h:
1336         * page/scrolling/ScrollingCoordinator.cpp:
1337         * page/scrolling/ScrollingTree.h:
1338         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1339         * page/scrolling/ScrollingTreeNode.h:
1340         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1341         (WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
1342         * page/scrolling/ScrollingTreeScrollingNode.h:
1343         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
1344         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
1345         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
1346         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
1347         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
1348         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
1349         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
1350         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
1351         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
1352         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
1353         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
1354         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
1355         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
1356         (WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
1357         (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
1358         (WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
1359         (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
1360         (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
1361         (WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
1362         (WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
1363         (WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
1364         (WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
1365         (WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
1366         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
1367         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
1368         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
1369         * page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
1370         * page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
1371         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
1372         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
1373         * page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
1374         * page/scrolling/ios/ScrollingTreeIOS.h: Removed.
1375         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1376         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
1377
1378 2019-02-23  Justin Fan  <justin_fan@apple.com>
1379
1380         [WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
1381         https://bugs.webkit.org/show_bug.cgi?id=194665
1382
1383         Reviewed by Dean Jackson.
1384
1385         Test: map-write-buffers.html. Other tests updated to match new API.
1386
1387         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Added.
1388         (WebCore::validateBufferBindingType): Ensure buffer binding usages match the binding type.
1389         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Logic moved out from WebGPUDevice.cpp.
1390         * Modules/webgpu/WebGPUBindGroupDescriptor.h:
1391         * Modules/webgpu/WebGPUBuffer.cpp: Added GPUBuffer functionality.
1392         (WebCore::WebGPUBuffer::create):
1393         (WebCore::WebGPUBuffer::WebGPUBuffer):
1394         (WebCore::WebGPUBuffer::mapReadAsync):
1395         (WebCore::WebGPUBuffer::mapWriteAsync):
1396         (WebCore::WebGPUBuffer::unmap):
1397         (WebCore::WebGPUBuffer::destroy):
1398         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback): Register a mapping request on the GPUBuffer, if valid.
1399         * Modules/webgpu/WebGPUBuffer.h:
1400         (WebCore::WebGPUBuffer::buffer const):
1401         (WebCore::WebGPUBuffer::mapping const): Deleted.
1402         * Modules/webgpu/WebGPUBuffer.idl: Update to latest API and enable every function except setSubData.
1403         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1404         (WebCore::WebGPUCommandBuffer::beginRenderPass): Renamed descriptor conversion method.
1405         * Modules/webgpu/WebGPUDevice.cpp:
1406         (WebCore::WebGPUDevice::createBuffer const): Update to non-nullable return type.
1407         (WebCore::WebGPUDevice::createBindGroup const): Move descriptor validation logic to descriptor implementation.
1408         * Modules/webgpu/WebGPUDevice.h:
1409         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
1410         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const): Renamed from validateAndConvertToGPUVersion.
1411         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1412         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Add validation for submitted buffers.
1413         * platform/graphics/gpu/GPUBuffer.cpp: Added.
1414         (WebCore::GPUBuffer::PendingMappingCallback::PendingMappingCallback): New struct for retaining a reference to mapping callbacks.
1415         * platform/graphics/gpu/GPUBuffer.h: Add functionality to retain callbacks and usage bits.
1416         (WebCore::GPUBuffer::isVertex const):
1417         (WebCore::GPUBuffer::isUniform const):
1418         (WebCore::GPUBuffer::isStorage const):
1419         (WebCore::GPUBuffer::isReadOnly const):
1420         (WebCore::GPUBuffer::PendingMapPromise::create):
1421         (WebCore::GPUBuffer::isMappable const):
1422         (WebCore::GPUBuffer::isMapWriteable const):
1423         (WebCore::GPUBuffer::isMapReadable const):
1424         (WebCore::GPUBuffer::mapping const): Deleted.
1425         * platform/graphics/gpu/GPUBufferUsage.h: enum class cannot be logical ORed together.
1426         * platform/graphics/gpu/GPUDevice.cpp:
1427         (WebCore::GPUDevice::tryCreateBuffer const): Renamed from createBuffer. 
1428         (WebCore::GPUDevice::createBuffer const): Deleted.
1429         * platform/graphics/gpu/GPUDevice.h:
1430         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1431         (WebCore::GPUBuffer::tryCreateSharedBuffer): Attempt to create a MTLBuffer with shared memory.
1432         (WebCore::GPUBuffer::tryCreate): No longer use Gigacage-allocated memory for MTLBuffer.
1433         (WebCore::GPUBuffer::GPUBuffer):
1434         (WebCore::GPUBuffer::~GPUBuffer):
1435         (WebCore::GPUBuffer::registerMappingCallback): Register the provided callback to be executed when the staging buffer can be safely exposed.
1436         (WebCore::GPUBuffer::stagingBufferForRead): Prepare the arrayBuffer for reading and run the mapping callback.
1437         (WebCore::GPUBuffer::stagingBufferForWrite): Ditto, but for writing.
1438         (WebCore::GPUBuffer::unmap): If needed, copy the staging ArrayBuffer to the MTLBuffer. Unregister any mapping callback.
1439         (WebCore::GPUBuffer::destroy): Stub implementation for now. Frees the MTLBuffer as soon as possible.
1440         (WebCore::GPUBuffer::create): Deleted.
1441         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
1442         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Ensure only read-only GPUBuffers are used as read-only on the GPU.
1443
1444         Add symbols for new files:
1445         * Sources.txt:
1446         * WebCore.xcodeproj/project.pbxproj:
1447
1448 2019-02-23  Keith Miller  <keith_miller@apple.com>
1449
1450         Add new mac target numbers
1451         https://bugs.webkit.org/show_bug.cgi?id=194955
1452
1453         Reviewed by Tim Horton.
1454
1455         * Configurations/Base.xcconfig:
1456         * Configurations/DebugRelease.xcconfig:
1457
1458 2019-02-23  chris fleizach  <cfleizach@apple.com>
1459
1460         AX: WebKit is incorrectly mapping the <meter> element to progressbar
1461         https://bugs.webkit.org/show_bug.cgi?id=164051
1462         <rdar://problem/29055615>
1463
1464         Reviewed by Joanmarie Diggs.
1465
1466         Add a specific role for meter and map that to the appropriate mac role. 
1467
1468         * accessibility/AccessibilityNodeObject.cpp:
1469         (WebCore::AccessibilityNodeObject::canHaveChildren const):
1470         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
1471         * accessibility/AccessibilityObject.cpp:
1472         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
1473         (WebCore::AccessibilityObject::isRangeControl const):
1474         (WebCore::AccessibilityObject::computedRoleString const):
1475         * accessibility/AccessibilityObjectInterface.h:
1476         * accessibility/AccessibilityProgressIndicator.cpp:
1477         (WebCore::AccessibilityProgressIndicator::roleValue const):
1478         * accessibility/AccessibilityProgressIndicator.h:
1479         * accessibility/AccessibilityRenderObject.cpp:
1480         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
1481         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1482         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1483         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1484         (createAccessibilityRoleMap):
1485
1486 2019-02-22  Ryosuke Niwa  <rniwa@webkit.org>
1487
1488         Crash in SWServerJobQueue::runNextJobSynchronously
1489         https://bugs.webkit.org/show_bug.cgi?id=194974
1490
1491         Reviewed by Geoffrey Garen.
1492
1493         We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously
1494         or there is a timer heap corruption again :(
1495
1496         Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen
1497         but convert an existing release assert to a debug assert since this appears to be hitting
1498         too frequently in wild.
1499
1500         * workers/service/server/SWServerJobQueue.cpp:
1501         (WebCore::SWServerJobQueue::runNextJobSynchronously):
1502
1503 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
1504
1505         Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
1506         https://bugs.webkit.org/show_bug.cgi?id=194968
1507
1508         Reviewed by Antti Koivisto.
1509
1510         Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because
1511         you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them.
1512
1513         ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will
1514         reduce that.
1515
1516         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1517         (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method.
1518         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1519         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1520         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
1521         (WebCore::ScrollingTreeScrollingNode::clampScrollPosition const):
1522         (WebCore::ScrollingTreeScrollingNode::scrollBy):
1523         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted.
1524         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
1525         * page/scrolling/ScrollingTreeScrollingNode.h:
1526         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
1527         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1528         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
1529         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing.
1530         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1531         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1532         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1533         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1534         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
1535         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
1536         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1537         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1538         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
1539         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
1540         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1541         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
1542         * platform/PlatformWheelEvent.h:
1543         (WebCore::PlatformWheelEvent::delta const):
1544         * platform/ScrollTypes.h:
1545
1546 2019-02-22  Eric Liang  <ericliang@apple.com>
1547
1548         AX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria-flowto
1549         https://bugs.webkit.org/show_bug.cgi?id=194923
1550
1551         Reviewed by Chris Fleizach.
1552
1553         Added AXChildrenInNavigationOrder attribute that returns the same array as from AXChildren. It prevents AppKit from reordering elements from the fallback AXChildren attribute.
1554
1555         Test: accessibility/mac/children-in-navigation-order-returns-children.html
1556
1557         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1558         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1559
1560 2019-02-22  Tim Horton  <timothy_horton@apple.com>
1561
1562         ProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
1563         https://bugs.webkit.org/show_bug.cgi?id=194963
1564
1565         Reviewed by Dean Jackson.
1566
1567         Tested by existing failing API test.
1568
1569         * page/Page.cpp:
1570         (WebCore::Page::installedPageOverlaysChanged): Deleted.
1571         * page/Page.h:
1572         (WebCore::Page::pageOverlayController):
1573         * page/PageOverlayController.cpp:
1574         (WebCore::PageOverlayController::installedPageOverlaysChanged):
1575         (WebCore::PageOverlayController::detachViewOverlayLayers):
1576         (WebCore::PageOverlayController::installPageOverlay):
1577         (WebCore::PageOverlayController::uninstallPageOverlay):
1578         (WebCore::PageOverlayController::willDetachRootLayer): Deleted.
1579         * page/PageOverlayController.h:
1580         As intended by r240940, move installedPageOverlaysChanged to PageOverlayController.
1581         Also, make it ignore isInWindow state; otherwise, if you install a overlay
1582         and then come into window, nothing installs the root layer. There is no
1583         need for this code to follow in-window state manually anymore since
1584         the DrawingArea and RenderLayerCompositor just hook the layers up when needed.
1585
1586         Make some methods private, and make detachViewOverlayLayers only touch
1587         *view* overlays, so that we don't detach the document-relative root
1588         layer when you drop to having no view overlays. This maintains
1589         existing behavior because nothing was calling PageOverlayController::detachViewOverlayLayers.
1590
1591         Now there are no callers of willDetachRootLayer, so remove it.
1592
1593 2019-02-22  Andy Estes  <aestes@apple.com>
1594
1595         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
1596         https://bugs.webkit.org/show_bug.cgi?id=194964
1597         <rdar://problem/48279441>
1598
1599         Reviewed by Alex Christensen.
1600
1601         When a document's QuickLook preview is loaded, a reference cycle is created between
1602         PreviewLoader and ResourceLoader. Break the cycle by clearing m_previewLoader in
1603         ResourceLoader::releaseResources().
1604
1605         Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`.
1606
1607         * loader/ResourceLoader.cpp:
1608         (WebCore::ResourceLoader::releaseResources):
1609
1610 2019-02-22  Sihui Liu  <sihui_liu@apple.com>
1611
1612         Crash under IDBServer::IDBConnectionToClient::identifier() const
1613         https://bugs.webkit.org/show_bug.cgi?id=194843
1614         <rdar://problem/48203102>
1615
1616         Reviewed by Geoffrey Garen.
1617
1618         UniqueIDBDatabase should ignore requests from connections that are already closed.
1619
1620         Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually. 
1621         One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure
1622         disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore
1623         may start a version change transaction and ask for identifier from the connection that is already gone.
1624
1625         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
1626         (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
1627         * Modules/indexeddb/server/IDBConnectionToClient.h:
1628         (WebCore::IDBServer::IDBConnectionToClient::isClosed):
1629         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1630         (WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests):
1631         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
1632         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
1633         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1634
1635 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1636
1637         Input type "formatSetInlineTextDirection" is dispatched when changing paragraph-level text direction
1638         https://bugs.webkit.org/show_bug.cgi?id=194703
1639         <rdar://problem/48111775>
1640
1641         Reviewed by Ryosuke Niwa.
1642
1643         Currently, when changing text direction, WebKit always sends input events of type formatSetInlineTextDirection,
1644         even when changing paragraph text direction. Instead, we should be emitting formatSetBlockTextDirection in this
1645         scenario. This is problematic when using the context menus on macOS to change writing direction, since changing
1646         "Selection Direction" is currently indistinguishable from changing "Paragraph Direction".
1647
1648         To fix this, we split EditAction::SetWritingDirection into EditAction::SetInlineWritingDirection and
1649         EditAction::SetBlockWritingDirection, which emit inline and block text direction input events, respectively.
1650
1651         Tests: fast/events/before-input-events-prevent-block-text-direction.html
1652                fast/events/before-input-events-prevent-inline-text-direction.html
1653
1654         * editing/CompositeEditCommand.cpp:
1655         (WebCore::CompositeEditCommand::apply):
1656         * editing/EditAction.cpp:
1657         (WebCore::undoRedoLabel):
1658         * editing/EditAction.h:
1659         * editing/EditCommand.cpp:
1660         (WebCore::inputTypeNameForEditingAction):
1661         * editing/Editor.cpp:
1662         (WebCore::inputEventDataForEditingStyleAndAction):
1663         (WebCore::Editor::setBaseWritingDirection):
1664         * editing/EditorCommand.cpp:
1665         (WebCore::executeMakeTextWritingDirectionLeftToRight):
1666         (WebCore::executeMakeTextWritingDirectionNatural):
1667         (WebCore::executeMakeTextWritingDirectionRightToLeft):
1668
1669 2019-02-22  Rob Buis  <rbuis@igalia.com>
1670
1671         Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
1672         https://bugs.webkit.org/show_bug.cgi?id=160172
1673
1674         Reviewed by Frédéric Wang.
1675
1676         Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces
1677         from HTTPParsers instead.
1678
1679         No new tests, already covered by MathML tests.
1680
1681         * mathml/MathMLElement.cpp:
1682         (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted.
1683         * mathml/MathMLElement.h:
1684         * mathml/MathMLPresentationElement.cpp:
1685         (WebCore::MathMLPresentationElement::parseMathMLLength):
1686         * mathml/MathMLTokenElement.cpp:
1687         (WebCore::MathMLTokenElement::convertToSingleCodePoint):
1688
1689 2019-02-22  Eric Carlson  <eric.carlson@apple.com>
1690
1691         Update some media logging
1692         https://bugs.webkit.org/show_bug.cgi?id=194915
1693
1694         Reviewed by Jer Noble.
1695
1696         No new tests, no functional change.
1697
1698         * Modules/mediasource/SourceBuffer.cpp:
1699         (WebCore::SourceBuffer::evictCodedFrames):
1700         (WebCore::SourceBuffer::provideMediaData):
1701         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
1702
1703         * html/HTMLMediaElement.cpp:
1704         (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
1705         (WebCore::HTMLMediaElement::loadResource):
1706         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1707         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
1708         (WebCore::HTMLMediaElement::seekTask):
1709         (WebCore::HTMLMediaElement::playInternal):
1710         (WebCore::HTMLMediaElement::pauseInternal):
1711         (WebCore::HTMLMediaElement::setLoop):
1712         (WebCore::HTMLMediaElement::setControls):
1713         (WebCore::HTMLMediaElement::sourceWasRemoved):
1714
1715         * html/MediaElementSession.cpp:
1716         (WebCore::convertEnumerationToString):
1717
1718         * html/MediaElementSession.h:
1719         (WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString):
1720
1721         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1722         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1723
1724 2019-02-22  Rob Buis  <rbuis@igalia.com>
1725
1726         Fix unitless usage of mathsize
1727         https://bugs.webkit.org/show_bug.cgi?id=194940
1728
1729         Reviewed by Frédéric Wang.
1730
1731         Convert unitless lengths to percentage values to correct the computed
1732         font size.
1733
1734         * mathml/MathMLElement.cpp:
1735         (WebCore::convertToPercentageIfNeeded):
1736         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
1737
1738 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
1739
1740         Hardcode Visual Viewports on everywhere except iOS WK1
1741         https://bugs.webkit.org/show_bug.cgi?id=194928
1742
1743         Reviewed by Zalan Bujtas.
1744
1745         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
1746         change the default value of the Setting to 'true', and hardcode WebView on iOS to
1747         set it to false. The setting has shipped for several years and there's no need to turn
1748         it off now.
1749
1750         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
1751         Visual Viewports are not enabled.
1752         
1753         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
1754         that only runs in WK2
1755
1756         * page/Settings.yaml:
1757         * page/scrolling/AsyncScrollingCoordinator.cpp:
1758         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1759         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1760         (WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
1761         * page/scrolling/AsyncScrollingCoordinator.h:
1762         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1763         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1764         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
1765         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
1766         (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
1767         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1768         * page/scrolling/ScrollingTree.cpp:
1769         (WebCore::ScrollingTree::commitTreeState):
1770         * page/scrolling/ScrollingTree.h:
1771         (WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
1772         (WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
1773         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1774         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
1775         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1776         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
1777         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
1778
1779 2019-02-21  Darin Adler  <darin@apple.com>
1780
1781         Some refinements for Node and Document
1782         https://bugs.webkit.org/show_bug.cgi?id=194764
1783
1784         Reviewed by Ryosuke Niwa.
1785
1786         * accessibility/AccessibilityObject.cpp:
1787         (WebCore::AccessibilityObject::press): Use shadowHost instead of
1788         deprecatedShadowAncestorNode.
1789         (WebCore::AccessibilityObject::axObjectCache const): Tweak coding style.
1790         (WebCore::AccessibilityObject::focusedUIElement const): Use existing page
1791         function to streamline.
1792
1793         * accessibility/AccessibilityRenderObject.cpp:
1794         (WebCore::AccessibilityRenderObject::accessKey const): Use
1795         attributeWithoutSynchronization for efficiency and consistency with other
1796         code working with the accesskey attribute.
1797
1798         * dom/ContainerNode.cpp:
1799         (WebCore::ContainerNode::childrenChanged): Added call to
1800         invalidateAccessKeyCache, replacing old scheme tied to style recalculation.
1801
1802         * dom/DecodedDataDocumentParser.cpp:
1803         (WebCore::DecodedDataDocumentParser::appendBytes): Update for name and return
1804         type change of createDecoderIfNeeded to decoder.
1805         (WebCore::DecodedDataDocumentParser::flush): Ditto.
1806
1807         * dom/Document.cpp:
1808         (WebCore::Document::elementForAccessKey): Renamed from getElementForAccessKey
1809         to match WebKit coding style. Changed to use unique_ptr instead of separate
1810         boolean to keep track of map validity status.
1811         (WebCore::Document::buildAccessKeyCache): Renamed from buildAccessKeyMap to
1812         clarify that this is a cache. Changed to use composedTreeDescendants rather
1813         than explicit calls to shadowRoot. Use add instead of set so that first element
1814         in document order wins, instead of last element in document order. Updated
1815         to make a new map in a new unique_ptr instead of populating a map.
1816         (WebCore::Document::invalidateAccessKeyCacheSlowCase): Renamed from
1817         invalidateAccessKeyMap, and left an inline part in the header so the fast case
1818         of quickly checking for a null pointer can be inlined.
1819         (WebCore::Document::doctype const): Use downcast instead of static_cast.
1820         (WebCore::Document::scheduleStyleRecalc): Moved call to invalidateAccessKeyMap
1821         from here to childrenChanged and accesskey attribute change handling.
1822         (WebCore::Document::processFormatDetection): Set m_isTelephoneNumberParsingAllowed
1823         directly since this is the only place that does it and we don't need to factor
1824         that one line of code into a function.
1825         (WebCore::Document::getOverrideStyle): Moved to header since it's just a stub
1826         that always returns nullptr and can be inlined.
1827         (WebCore::Document::setIsTelephoneNumberParsingAllowed): Deleted.
1828         (WebCore::Document::ensureTemplateDocument): Removed nullptr frame argument to
1829         the create function, since Document::create now always involves no frame.
1830         (WebCore::Document::didAssociateFormControl): Changed argument type to a reference
1831         and simplified the logic with a local variable.
1832         (WebCore::Document::didAssociateFormControlsTimerFired): Simplified the null
1833         checks and rearranged things so that m_associatedFormControls will always
1834         get cleared even if the document is no longer associated with a page.
1835
1836         * dom/Document.h: Removed unnnecessary explicit values for enumerations (first
1837         value is always zero, etc.) and formatted simple enumerations in a single line
1838         for easier reading. Moved Document::create fucntion bodies out of line, removed
1839         the frame argument from the simple "create with URL" overload and made the frame
1840         argument for createNonRenderedPlaceholder be a reference rather than a pointer.
1841         Renamed getElementByAccessKey to elementForAccessKey, invalidateAccessKeyMap to
1842         invalidateAccessKeyCache, buildAccessKeyMap to buildAccessKeCache,
1843         m_elementsByAccessKey to m_accessKeyCache and changed its type.
1844         Removed bogus "DOM methods" comment, unused setParserFeature friend declaration,
1845         setIsTelephoneNumberParsingAllowed function, and m_accessKeyMapValid flag.
1846
1847         * dom/Document.idl: Added comment highlighting that getOverrideStyle is just a
1848         placeholder returning null.
1849
1850         * dom/Element.cpp:
1851         (WebCore::Element::attributeChanged): Call invalidateAccessKeyCache when the
1852         value of the accesskey attribute is changed. Also moved the class attribute code
1853         so the attributes here are in alphabetical order (only class and id were out of
1854         alphabetical order).
1855
1856         * dom/Node.cpp:
1857         (WebCore::Node::isDescendantOrShadowDescendantOf const): Rewrote to no longer
1858         use deprecatedShadowAncestorNode and used boolean operators to make it a
1859         single line and easier to understand. Also added a FIXME since the
1860         containsIncludingShadowDOM function is so similar, yet differently written.
1861         (WebCore::Node::contains const): Rewrote as a single line to make this easier
1862         to read and to *slightly* improve the speed in the "this == node" case.
1863         (WebCore::Node::containsIncludingHostElements const): Use downcast.
1864         (WebCore::Node::deprecatedShadowAncestorNode const): Deleted.
1865
1866         * dom/Node.h: Deleted now-unused deprecatedShadowAncestorNode.
1867
1868         * editing/ReplaceSelectionCommand.cpp:
1869         (WebCore::ReplacementFragment::ReplacementFragment): Rewrote to use shadowHost
1870         instead of deprecatedShadowAncestorNode.
1871
1872         * html/FormAssociatedElement.cpp:
1873         (WebCore::FormAssociatedElement::resetFormOwner): Pass reference to
1874         didAssociateFormControl.
1875         (WebCore::FormAssociatedElement::formAttributeChanged): Ditto.
1876
1877         * html/HTMLAreaElement.cpp:
1878         (WebCore::HTMLAreaElement::parseAttribute): Removed special case for accesskey
1879         attribute, because we want to call the base class parseAttribute in that case.
1880
1881         * html/HTMLFormElement.cpp:
1882         (WebCore::HTMLFormElement::insertedIntoAncestor): Pass reference to
1883         didAssociateFormControl.
1884
1885         * html/HTMLSelectElement.cpp:
1886         (WebCore::HTMLSelectElement::parseAttribute): Removed special case for accesskey
1887         attribute with mysterious FIXME, because we want to call the base class
1888         parseAttribute in that case. The old code had no effect before; the access key
1889         logic would still find the attribute; if the goal is to ignore the attribute
1890         for these elements we will need a different solution.
1891         * html/HTMLTextAreaElement.cpp:
1892         (WebCore::HTMLTextAreaElement::parseAttribute): Ditto.
1893
1894         * loader/DocumentLoader.cpp:
1895         (WebCore::DocumentLoader::DocumentLoader): Removed code that was always passing
1896         nullptr as the frame for the newly created DocumentWriter. It used m_frame, but
1897         m_frame was always null.
1898         (WebCore::DocumentLoader::attachToFrame): Pass reference to DocumentWriter::setFrame.
1899
1900         * loader/DocumentWriter.cpp:
1901         (WebCore::DocumentWriter::DocumentWriter): Deleted. The old version set m_frame to
1902         the passed in frame, which was always nullptr, and initialized some booleans and an
1903         enumeration, which are now initialized in the class definition.
1904         (WebCore::DocumentWriter::createDocument): Pass a reference for the frame.
1905         (WebCore::DocumentWriter::begin): Updated now that State is an enum class.
1906         (WebCore::DocumentWriter::decoder): Renamed from createDecoderIfNeeded and changed
1907         to return a reference.
1908         (WebCore::DocumentWriter::addData): Use RELEASE_ASSERT instead of if/CRASH and
1909         updated now that State is an enum class.
1910         (WebCore::DocumentWriter::insertDataSynchronously): Updated now that State is an
1911         enum class.
1912         (WebCore::DocumentWriter::end): Ditto.
1913
1914         * loader/DocumentWriter.h: Removed unneeded include and forward declaration.
1915         Removed the frame pointer argument to the constructor, caller was always passing a
1916         nullptr. Changed argument to setFrame to be a reference. Renamed createDecoderIfNeeded
1917         to decoder and changed it to return a reference. Initialized m_frame,
1918         m_hasReceivedSomeData, m_encodingWasChosenByUser, and m_state here so we don't need
1919         to initialize them in a constructor. Renamed the enum from WriterState to State since
1920         it's a member of DocumentWriter already, and made it an enum class rather than ending
1921         each enumeration value with WritingState.
1922
1923         * page/DragController.cpp:
1924         (WebCore::isEnabledColorInput): Removed boolean argument setToShadowAncestor. The
1925         one caller that formerly passed true now calls the new hasEnabledColorInputAsShadowHost
1926         function instead.
1927         (WebCore::hasEnabledColorInputAsShadowHost): Added.
1928         (WebCore::elementUnderMouse): Use shadowHost instead of deprecatedShadowAncestorNode.
1929         Also added FIXME since it seems this should instead be using parentElementInComposedTree.
1930         (WebCore::DragController::concludeEditDrag): Removed "false" argument to isEnabledColorInput.
1931         (WebCore::DragController::canProcessDrag): Removed "true" argument to isEnabledColorInput
1932         and added call to hasEnabledColorInputAsShadowHost. Also put the value of the node to drag
1933         into a local variable to simplify code.
1934         (WebCore::DragController::draggableElement const): Removed "false" argument to isEnabledColorInput.
1935
1936         * page/EventHandler.cpp:
1937         (WebCore::EventHandler::handleAccessKey): Update name of elementForAccessKey.
1938
1939         * page/FocusController.cpp:
1940         (WebCore::clearSelectionIfNeeded): Use shadowHost instead of deprecatedShadowAncestorNode.
1941
1942         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1943         (WebCore::createPageForServiceWorker): Pass reference instead of pointer for frame to
1944         Document::createNonRenderedPlaceholder.
1945
1946 2019-02-21  Daniel Bates  <dabates@apple.com>
1947
1948         Same Site Lax cookies are not sent with cross-site redirect from client-initiated load
1949         https://bugs.webkit.org/show_bug.cgi?id=194906
1950         <rdar://problem/44305947>
1951
1952         Reviewed by Brent Fulgham.
1953
1954         Ensure that a request for a top-level navigation is annotated as such regardless of whether
1955         the request has a computed Same Site policy.
1956
1957         "New loads" initiated by a the client (Safari) either by API or a human either explicitly
1958         typing a URL in the address bar or Command + clicking a hyperlink to open it in a new window/tab
1959         are always considered Same Site. This is by definition from the spec. [1] as we aren't navigating
1960         from an existing page. (Command + click should be thought of as a convenience to the user from
1961         having to copy the hyperlink's URL, create a new window, and paste the URL into the address bar).
1962         Currently the frame loader marks a request as a top-level navigation if and only if the request
1963         does not have a pre-computed Same Site policy. However, "New loads" have a pre-computed Same Site
1964         policy. So, these loads would never be marked as a top-level navigation by the frame loading code.
1965         Therefore, if the "new load" turned out to be a cross-site redirect then WebKit would incorrectly
1966         tell the networking stack that the load was a cross-site, non-top-level navigation, and per the
1967         Same Site spec [2], the networking stack would not send Same Site Lax cookies. Instead,
1968         WebKit should unconditionally ensure that requests are marked as a top-level navigation, if applicable.
1969
1970         [1] See Note for (1) in  <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.2>
1971         [2] <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7.1>
1972
1973         Test: http/tests/cookies/same-site/user-load-cross-site-redirect.php
1974
1975         * loader/FrameLoader.cpp:
1976         (WebCore::FrameLoader::addExtraFieldsToRequest): Unconditionally update the request's top-
1977         level navigation bit.
1978         * platform/network/ResourceRequestBase.cpp:
1979         (WebCore::ResourceRequestBase::setAsIsolatedCopy): Unconditionally copy a request's top-
1980         level navigation bit.
1981
1982 2019-02-21  Per Arne Vollan  <pvollan@apple.com>
1983
1984         Layout Test fast/text/international/khmer-selection.html is crashing
1985         https://bugs.webkit.org/show_bug.cgi?id=191368
1986
1987         Reviewed by Brent Fulgham.
1988
1989         GlyphBuffer's offset array wasn't getting filled by UniscribeController.
1990         Our underlining code requires this array.
1991
1992         Uniscribe gives us a character -> glyph mapping, so we just have to compute
1993         the inverse and give it to the GlyphBuffer.
1994
1995         This patch is written by Myles C. Maxfield.
1996
1997         Test: fast/text/international/khmer-selection.html.
1998
1999         * platform/graphics/GlyphBuffer.h:
2000         (WebCore::GlyphBuffer::add):
2001         * platform/graphics/displaylists/DisplayListItems.cpp:
2002         (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const):
2003         * platform/graphics/win/UniscribeController.cpp:
2004         (WebCore::UniscribeController::advance):
2005         (WebCore::UniscribeController::itemizeShapeAndPlace):
2006         (WebCore::UniscribeController::shapeAndPlaceItem):
2007         * platform/graphics/win/UniscribeController.h:
2008
2009 2019-02-21  Sihui Liu  <sihui_liu@apple.com>
2010
2011         IndexedDB: leak UniqueIDBDatabase in layout tests
2012         https://bugs.webkit.org/show_bug.cgi?id=194870
2013         <rdar://problem/48163812>
2014
2015         Reviewed by Geoffrey Garen.
2016
2017         UniqueIDBDatabase owns a pointer to itself after it is hard closed. It should release the pointer when it 
2018         receives confirmation from clients and all pending tasks are done. UniqueIDBDatabase already checks whether the
2019         pointer should be released when a database task finishes, but it didn't perform a check when a confirm message 
2020         is received. 
2021
2022         No new test as the order of task completion and confirmation arrival is uncertain.
2023
2024         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2025         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
2026
2027 2019-02-21  Andy Estes  <aestes@apple.com>
2028
2029         contentfiltering tests leak documents
2030         https://bugs.webkit.org/show_bug.cgi?id=189434
2031         <rdar://44239943>
2032
2033         Reviewed by Simon Fraser.
2034
2035         Changed ContentFilter to capture the blocked Frame as a WeakPtr to break a reference cycle.
2036
2037         This fixes world leaks in several tests in LayoutTests/contentfiltering/.
2038
2039         * bindings/js/ScriptController.h:
2040         * loader/ContentFilter.cpp:
2041         (WebCore::ContentFilter::didDecide):
2042
2043 2019-02-21  Don Olmstead  <don.olmstead@sony.com>
2044
2045         [CMake][Win] Fix !USE(CF) build of WebCore
2046         https://bugs.webkit.org/show_bug.cgi?id=194879
2047
2048         Reviewed by Konstantin Tokarev.
2049
2050         * PlatformAppleWin.cmake:
2051         * PlatformWin.cmake:
2052         * PlatformWinCairo.cmake:
2053
2054 2019-02-21  Zalan Bujtas  <zalan@apple.com>
2055
2056         [LFC][Floats] Add support for placing formatting roots in-between floats.
2057         https://bugs.webkit.org/show_bug.cgi?id=194902
2058
2059         Reviewed by Antti Koivisto.
2060
2061         This patch add support for placing a formatting root box in-between existing floats.
2062         The initial vertical position of a formatting root is its static position which can make the box
2063         placed above exsiting floats (whereas we can never place a regular float above existing floats.)
2064
2065         Test: fast/block/block-only/floats-and-block-formatting-roots.html
2066
2067         * layout/blockformatting/BlockFormattingContext.cpp:
2068         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2069         * layout/floats/FloatingContext.cpp:
2070         (WebCore::Layout::FloatPair::LeftRightIndex::isEmpty const):
2071         (WebCore::Layout::FloatPair::isEmpty const):
2072         (WebCore::Layout::FloatPair::operator* const):
2073         (WebCore::Layout::Iterator::operator* const):
2074         (WebCore::Layout::begin):
2075         (WebCore::Layout::end):
2076         (WebCore::Layout::FloatingContext::positionForFloat const):
2077         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
2078         (WebCore::Layout::findAvailablePosition):
2079         (WebCore::Layout::FloatingContext::findPositionForFloatBox const):
2080         (WebCore::Layout::FloatingContext::findPositionForFormattingContextRoot const):
2081         (WebCore::Layout::FloatPair::FloatPair):
2082         (WebCore::Layout::FloatPair::left const):
2083         (WebCore::Layout::FloatPair::right const):
2084         (WebCore::Layout::FloatPair::intersects const):
2085         (WebCore::Layout::FloatPair::operator == const):
2086         (WebCore::Layout::FloatPair::horizontalConstraints const):
2087         (WebCore::Layout::FloatPair::bottom const):
2088         (WebCore::Layout::Iterator::operator++):
2089         (WebCore::Layout::Iterator::set):
2090         (WebCore::Layout::FloatingPair::isEmpty const): Deleted.
2091         (WebCore::Layout::FloatingPair::verticalConstraint const): Deleted.
2092         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): Deleted.
2093         (WebCore::Layout::FloatingContext::floatingPosition const): Deleted.
2094         (WebCore::Layout::FloatingPair::FloatingPair): Deleted.
2095         (WebCore::Layout::FloatingPair::left const): Deleted.
2096         (WebCore::Layout::FloatingPair::right const): Deleted.
2097         (WebCore::Layout::FloatingPair::intersects const): Deleted.
2098         (WebCore::Layout::FloatingPair::operator == const): Deleted.
2099         (WebCore::Layout::FloatingPair::horizontalConstraints const): Deleted.
2100         (WebCore::Layout::FloatingPair::bottom const): Deleted.
2101         * layout/floats/FloatingContext.h:
2102
2103 2019-02-21  Rob Buis  <rbuis@igalia.com>
2104
2105         Update MIME type parser
2106         https://bugs.webkit.org/show_bug.cgi?id=180526
2107
2108         Reviewed by Darin Adler.
2109
2110         Further testing showed the MIME parser needs these fixes:
2111         - stripWhitespace is wrong for removing HTTP whitespace, use
2112           stripLeadingAndTrailingHTTPSpaces instead.
2113         - HTTP Token code points checking for Rfc2045 and Mimesniff were
2114           mixed up, use the dedicated isValidHTTPToken for Mimesniff mode.
2115         - Quoted Strings were not unescaped/escaped, this seems ok for
2116           serializing but is wrong when gettings individual parameter values.
2117           Implement [1] and [2] Step 2.4 to properly unescape and escape.
2118
2119         This change also tries to avoid hard to read uses of find.
2120
2121         Test: ParsedContentType.Serialize
2122
2123         [1] https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
2124         [2] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
2125
2126         * platform/network/ParsedContentType.cpp:
2127         (WebCore::skipSpaces):
2128         (WebCore::parseToken):
2129         (WebCore::isNotQuoteOrBackslash):
2130         (WebCore::collectHTTPQuotedString):
2131         (WebCore::containsNonTokenCharacters):
2132         (WebCore::parseQuotedString):
2133         (WebCore::ParsedContentType::parseContentType):
2134         (WebCore::ParsedContentType::create):
2135         (WebCore::ParsedContentType::setContentType):
2136         (WebCore::containsNonQuoteStringTokenCharacters):
2137         (WebCore::ParsedContentType::setContentTypeParameter):
2138         (WebCore::ParsedContentType::serialize const):
2139         (WebCore::substringForRange): Deleted.
2140         (WebCore::isNonTokenCharacter): Deleted.
2141         (WebCore::isNonQuotedStringTokenCharacter): Deleted.
2142         * platform/network/ParsedContentType.h:
2143
2144 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
2145
2146         REGRESSION (240698): Fixed position banners flicker and move when scrolling on iOS
2147         https://bugs.webkit.org/show_bug.cgi?id=194889
2148         rdar://problem/47755552
2149
2150         Reviewed by Tim Horton.
2151         
2152         After r240698 we could commit scrolling changes for a fixed node where the "viewportRectAtLastLayout" and the layer
2153         position were mismatched; this happened when AsyncScrollingCoordinator::reconcileScrollingState() came back from the UI process
2154         with an unstable update and set a new layoutViewport, then some other layout triggered a compositing tree update. During the tree
2155         update, we'd update the fixed scrolling node with the new viewport, and an old layer position.
2156         
2157         Fix by ensuring that we only update the geometry info for a scrolling tree node when we update layer geometry for the corresponding
2158         layer.
2159
2160         Not currently testable.
2161
2162         * rendering/RenderLayerCompositor.cpp:
2163         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2164
2165 2019-02-20  Dean Jackson  <dino@apple.com>
2166
2167         Rotation animations sometimes use the wrong origin (affects apple.com)
2168         https://bugs.webkit.org/show_bug.cgi?id=194878
2169         <rdar://problem/43908047>
2170
2171         Reviewed by Simon Fraser.
2172
2173         Some versions of CoreAnimation apply additive animations in reverse
2174         order. Detect this and reverse the list of animations we provide.
2175
2176         Update the existing animations/additive-transform-animations.html test to
2177         be a ref-test that would identify this failure. Previously it relied on
2178         a pixel test.
2179
2180         * platform/graphics/ca/GraphicsLayerCA.cpp: Use 
2181             HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
2182             not to flip the list of animations (and mark the correct ones as
2183             additive).
2184         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2185         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2186
2187 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
2188
2189         [Win] Guard CF usage in RenderThemeWin
2190         https://bugs.webkit.org/show_bug.cgi?id=194875
2191
2192         Reviewed by Alex Christensen.
2193
2194         No new tests. No change in behavior.
2195
2196         Add #if USE(CF) checks to RenderThemeWin so it can compile without CF support.
2197
2198         * rendering/RenderThemeWin.cpp:
2199         (WebCore::RenderThemeWin::stringWithContentsOfFile):
2200         (WebCore::RenderThemeWin::mediaControlsStyleSheet):
2201         (WebCore::RenderThemeWin::mediaControlsScript):
2202         * rendering/RenderThemeWin.h:
2203
2204 2019-02-20  Ryosuke Niwa  <rniwa@webkit.org>
2205
2206         Crash in DOMWindowExtension::suspendForPageCache
2207         https://bugs.webkit.org/show_bug.cgi?id=194871
2208
2209         Reviewed by Chris Dumez.
2210
2211         This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache.
2212
2213         We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via
2214         dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's.
2215         Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache
2216         to avoid the crash.
2217
2218         * page/DOMWindow.cpp:
2219         (WebCore::DOMWindow::willDestroyCachedFrame):
2220         (WebCore::DOMWindow::willDestroyDocumentInFrame):
2221         (WebCore::DOMWindow::willDetachDocumentFromFrame):
2222         (WebCore::DOMWindow::suspendForPageCache):
2223         (WebCore::DOMWindow::resumeFromPageCache):
2224         * page/DOMWindowExtension.cpp:
2225         (WebCore::DOMWindowExtension::suspendForPageCache):
2226
2227 2019-02-20  Alex Christensen  <achristensen@webkit.org>
2228
2229         Always call CompletionHandlers after r240909
2230         https://bugs.webkit.org/show_bug.cgi?id=194823
2231
2232         Reviewed by Ryosuke Niwa.
2233
2234         * loader/PolicyChecker.cpp:
2235         (WebCore::PolicyChecker::checkNavigationPolicy):
2236         (WebCore::PolicyChecker::checkNewWindowPolicy):
2237
2238 2019-02-20  Andy Estes  <aestes@apple.com>
2239
2240         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
2241         https://bugs.webkit.org/show_bug.cgi?id=194869
2242
2243         Rubber-stamped by Jer Noble.
2244
2245         * WebCore.xcodeproj/project.pbxproj:
2246
2247 2019-02-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2248
2249         drawImage() clears the canvas if it's the source of the image and globalCompositeOperation is "copy"
2250         https://bugs.webkit.org/show_bug.cgi?id=194746
2251
2252         Reviewed by Dean Jackson.
2253
2254         Test: fast/canvas/canvas-drawImage-composite-copy.html
2255
2256         If the source canvas of drawImage() is the same as the destination and
2257         globalCompositeOperation is set to "copy", copy the srcRect from the 
2258         canvas to a temporary buffer before calling clearCanvas() then drawImage
2259         from this temporary buffer.
2260
2261         * html/canvas/CanvasRenderingContext2DBase.cpp:
2262         (WebCore::CanvasRenderingContext2DBase::drawImage):
2263         * platform/graphics/ImageBuffer.cpp:
2264         (WebCore::ImageBuffer::copyRectToBuffer):
2265         * platform/graphics/ImageBuffer.h:
2266
2267 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
2268
2269         REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test
2270         https://bugs.webkit.org/show_bug.cgi?id=194866
2271
2272         Reviewed by Antti Koivisto.
2273
2274         r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing
2275         a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating
2276         the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places.
2277
2278         * rendering/RenderLayerCompositor.cpp:
2279         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
2280
2281 2019-02-20  Daniel Bates  <dabates@apple.com>
2282
2283         [iOS] Tweak UI for focus rings
2284         https://bugs.webkit.org/show_bug.cgi?id=194864
2285         <rdar://problem/47831886>
2286
2287         Reviewed by Brent Fulgham.
2288
2289         Make use of UIKit constants to make focus rings pretty.
2290
2291         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2292         (WebCore::drawFocusRingAtTime):
2293
2294 2019-02-20  Timothy Hatcher  <timothy@apple.com>
2295
2296         RenderThemeIOS should use RenderTheme's color cache instead of its own.
2297         https://bugs.webkit.org/show_bug.cgi?id=194822
2298         rdar://problem/48208296
2299
2300         Reviewed by Tim Horton.
2301
2302         Tested by fast/css/apple-system-colors.html.
2303
2304         * css/CSSValueKeywords.in:
2305         * css/parser/CSSPropertyParser.cpp:
2306         (WebCore::isAppleLegacyCssValueKeyword):
2307         * platform/graphics/Color.h:
2308         * platform/graphics/cg/ColorCG.cpp:
2309         (WebCore::makeRGBAFromCGColor):
2310         (WebCore::Color::Color):
2311         * rendering/RenderThemeIOS.h:
2312         * rendering/RenderThemeIOS.mm:
2313         (WebCore::RenderThemeIOS::systemColor const):
2314         * rendering/RenderThemeMac.mm:
2315         (WebCore::RenderThemeMac::systemColor const):
2316
2317 2019-02-20  Loïc Yhuel  <loic.yhuel@softathome.com>
2318
2319         Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
2320         https://bugs.webkit.org/show_bug.cgi?id=194819
2321
2322         Reviewed by Joseph Pecoraro.
2323
2324         Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html
2325
2326         * Modules/websockets/WebSocketChannel.h:
2327         (WebCore::WebSocketChannel::hasCreatedHandshake):
2328         * inspector/agents/page/PageNetworkAgent.cpp:
2329         Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable.
2330
2331 2019-02-20  Zalan Bujtas  <zalan@apple.com>
2332
2333         [LFC][Floats] Make FloatAvoider::resetPosition implicit
2334         https://bugs.webkit.org/show_bug.cgi?id=194855
2335
2336         Reviewed by Antti Koivisto.
2337
2338         Let's compute the initial top/left position during c'tor time.
2339         This is in preparation for fixing formatting root box placement in a float context.
2340
2341         * layout/floats/FloatAvoider.cpp:
2342         (WebCore::Layout::FloatAvoider::resetPosition): Deleted.
2343         * layout/floats/FloatAvoider.h:
2344         (WebCore::Layout::FloatAvoider::displayBox):
2345         (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
2346         * layout/floats/FloatBox.cpp:
2347         (WebCore::Layout::FloatBox::FloatBox):
2348         (WebCore::Layout::FloatBox::initialVerticalPosition const):
2349         * layout/floats/FloatBox.h:
2350         * layout/floats/FloatingContext.cpp:
2351         (WebCore::Layout::FloatingContext::floatingPosition const):
2352
2353 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
2354
2355         [MSVC] Fix compilation errors with lambdas in Service Workers
2356         https://bugs.webkit.org/show_bug.cgi?id=194841
2357
2358         Reviewed by Alex Christensen.
2359
2360         No new tests. No change in behavior.
2361
2362         MSVC has problems with the scoping of `this` within a nested lambda. In these cases `this` is
2363         referring to the enclosing lambda according to MSVC. This patch works around this behavior
2364         through by using the `protectedThis` pattern in WebKit code.
2365
2366         * workers/service/server/RegistrationDatabase.cpp:
2367         (WebCore::RegistrationDatabase::openSQLiteDatabase):
2368
2369 2019-02-20  Adrian Perez de Castro  <aperez@igalia.com>
2370
2371         [WPE][GTK] Enable support for CONTENT_EXTENSIONS
2372         https://bugs.webkit.org/show_bug.cgi?id=167941
2373
2374         Reviewed by Carlos Garcia Campos.
2375
2376         * platform/gtk/po/POTFILES.in: Added WebKitUserContentFilterStore.cpp
2377         to the list of files with translatable strings.
2378
2379 2019-02-19  Simon Fraser  <simon.fraser@apple.com>
2380
2381         REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view
2382         https://bugs.webkit.org/show_bug.cgi?id=194827
2383         rdar://problem/47620594
2384
2385         Reviewed by Antti Koivisto.
2386
2387         Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating
2388         layer configurations, since a repaint implies that a layer gains painted content. This is done
2389         via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}.
2390         The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation
2391         for the root. The configuration state that matters here is whether the layer contains painted content,
2392         and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(),
2393         and feeds into GraphicsLayer::drawsContent().
2394
2395         However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading,
2396         then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which
2397         causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing.
2398
2399         Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on
2400         the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer()
2401         to always return false for the RenderView's layer (the root).
2402         
2403         Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip
2404         properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add
2405         LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to
2406         respect it.
2407
2408         Test: compositing/visibility/root-visibility-toggle.html
2409
2410         * page/Frame.h:
2411         * platform/graphics/GraphicsLayer.cpp:
2412         (WebCore::GraphicsLayer::dumpProperties const):
2413         * platform/graphics/GraphicsLayerClient.h:
2414         (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const):
2415         * rendering/RenderLayerBacking.cpp:
2416         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
2417         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const):
2418         * rendering/RenderLayerBacking.h:
2419         * rendering/RenderLayerCompositor.cpp:
2420         (WebCore::RenderLayerCompositor::layerTreeAsText):
2421         * testing/Internals.cpp:
2422         (WebCore::toLayerTreeFlags):
2423         * testing/Internals.h:
2424         * testing/Internals.idl:
2425
2426 2019-02-19  Ryosuke Niwa  <rniwa@webkit.org>
2427
2428         REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window
2429         https://bugs.webkit.org/show_bug.cgi?id=194820
2430
2431         Reviewed by Geoffrey Garen.
2432
2433         This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader
2434         doesn’t require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's
2435         continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later,
2436         and we don't rely on PolicyChecker's load type until then.
2437
2438         Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly.
2439
2440         This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before
2441         invoking checkNewWindowPolicy which is not the right assumption.
2442
2443         Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html
2444
2445         * loader/FrameLoader.cpp:
2446         (WebCore::FrameLoader::loadURL):
2447         (WebCore::FrameLoader::load):
2448         (WebCore::FrameLoader::loadPostRequest):
2449
2450 2019-02-19  Zalan Bujtas  <zalan@apple.com>
2451
2452         Fix post-commit feedback.
2453
2454         Unreviewed. 
2455
2456         * layout/floats/FloatingContext.cpp:
2457         (WebCore::Layout::FloatingPair::intersects const):
2458
2459 2019-02-19  Zalan Bujtas  <zalan@apple.com>
2460
2461         [LFC][Floats] Remove redundant intersecting logic
2462         https://bugs.webkit.org/show_bug.cgi?id=194804
2463
2464         Reviewed by Antti Koivisto.
2465
2466         floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).
2467
2468         * layout/floats/FloatingContext.cpp:
2469         (WebCore::Layout::FloatingContext::floatingPosition const):
2470         (WebCore::Layout::FloatingPair::intersects const):
2471
2472 2019-02-19  Commit Queue  <commit-queue@webkit.org>
2473
2474         Unreviewed, rolling out r241722.
2475         https://bugs.webkit.org/show_bug.cgi?id=194801
2476
2477         Causing time outs and EWS failures after expectation file was
2478         added. (Requested by ShawnRoberts on #webkit).
2479
2480         Reverted changeset:
2481
2482         "IndexedDB: leak IDBDatabase and IDBTransacstion in layout
2483         tests"
2484         https://bugs.webkit.org/show_bug.cgi?id=194709
2485         https://trac.webkit.org/changeset/241722
2486
2487 2019-02-16  Darin Adler  <darin@apple.com>
2488
2489         Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
2490         https://bugs.webkit.org/show_bug.cgi?id=194752
2491
2492         Reviewed by Daniel Bates.
2493
2494         * Modules/websockets/WebSocket.cpp: Added an include of HexNumber.h. This previously
2495         got included because of Logger.h, but that no longer pulls in HexNumber.h.
2496
2497         * css/CSSMarkup.cpp: Removed unneeded include of StringBuffer.h.
2498         * css/CSSPrimitiveValue.cpp: Ditto.
2499
2500         * css/CSSUnicodeRangeValue.cpp:
2501         (WebCore::CSSUnicodeRangeValue::customCSSText const): Use makeString and hex instead
2502         of String::format and "%x".
2503
2504         * html/HTMLMediaElement.h:
2505         (WTF::ValueToString<WebCore::TextTrackCue::string): Use a non-template function,
2506         TextTrackCure::debugString, so we don't need to use HextNumber.h in a header.
2507
2508         * html/canvas/WebGLRenderingContextBase.cpp:
2509         (GetErrorString): Use makeString and hex instead of String::format and "%04x".
2510
2511         * html/track/TextTrackCue.cpp:
2512         (WebCore::TextTrackCue::debugString const): Added. Moved string conversion here
2513         from HTMLMediaElement.h and use makeString instead of String::format. Also use
2514         the word "debug" to make it clear that it's not OK to use this string, with a
2515         pointer value serialized into it, outside of debugging.
2516         * html/track/TextTrackCue.h: Added TextTrackCue::debugString.
2517
2518         * page/linux/ResourceUsageOverlayLinux.cpp:
2519         (WebCore::formatByteNumber): Use makeString and FormattedNumber::fixedWidth
2520         instead of String::format and "%.1f" etc.
2521
2522         * platform/cocoa/KeyEventCocoa.mm:
2523         (WebCore::keyIdentifierForCharCode): Use the new hex function here instead of
2524         the old code that did each of the four characters explicitly.
2525
2526         * platform/gamepad/mac/HIDGamepad.cpp:
2527         (WebCore::HIDGamepad::HIDGamepad): Use makeString instead of String::format.
2528
2529         * platform/graphics/Color.cpp:
2530         (WebCore::Color::nameForRenderTreeAsText const): Use hex instead of doing each
2531         digit separately.
2532
2533         * platform/graphics/FloatPolygon.cpp:
2534         (WebCore::FloatPolygonEdge::debugString const): Added. Moved string conversion here
2535         from the header and use makeString instead of String::format. Also use
2536         the word "debug" to make it clear that it's not OK to use this string, with a
2537         pointer value serialized into it, outside of debugging.
2538         * platform/graphics/FloatPolygon.h: Updated for the above.
2539
2540         * platform/graphics/ca/GraphicsLayerCA.cpp:
2541         (WebCore::GraphicsLayerCA::setName): Use makeString instead of String::format.
2542         (WebCore::GraphicsLayerCA::recursiveCommitChanges): DItto.
2543         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2544         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
2545         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Ditto.
2546         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2547         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): Ditto.
2548         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
2549         (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): Ditto.
2550         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2551         (WebCore::GStreamerVideoEncoder::makeElement): Ditto.
2552         (WebCore::GStreamerVideoEncoder::InitEncode): Ditto.
2553
2554         * platform/text/TextCodecLatin1.cpp: Removed unneeded include of StringBuffer.h
2555         and "using namespace WTF".
2556
2557         * platform/win/GDIObjectCounter.cpp:
2558         (WebCore::GDIObjectCounter::GDIObjectCounter): Use makeString instead of String::format.
2559         * platform/win/KeyEventWin.cpp:
2560         (WebCore::keyIdentifierForWindowsKeyCode): Ditto.
2561
2562         * rendering/FloatingObjects.cpp:
2563         (WebCore::FloatingObject::debugString const): Added. Moved string conversion here
2564         from the header and use makeString instead of String::format. Also use
2565         the word "debug" to make it clear that it's not OK to use this string, with a
2566         pointer value serialized into it, outside of debugging.
2567         * rendering/FloatingObjects.h: Updated for the above.
2568
2569         * rendering/RenderFragmentContainer.cpp:
2570         (WebCore::RenderFragmentContainer::debugString const): Added. Moved string
2571         conversion here from the header and use makeString instead of String::format.
2572         Also use the word "debug" to make it clear that it's not OK to use this string,
2573         with a pointer value serialized into it, outside of debugging.
2574         * rendering/RenderFragmentContainer.h: Updated for the above.
2575         * rendering/RenderFragmentedFlow.h: Ditto.
2576
2577         * testing/Internals.cpp:
2578         (WebCore::Internals::address): Use makeString instead of String::format.
2579
2580 2019-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2581
2582         [iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
2583         https://bugs.webkit.org/show_bug.cgi?id=194670
2584         <rdar://problem/39066529>
2585
2586         Reviewed by Tim Horton.
2587
2588         Adds support for pasting files on the pasteboard as attachment elements, if the attachment element runtime
2589         switch is enabled. Currently, the only types of data that can be pasted as attachments are images, which take a
2590         special codepath in WebContentReader::readImage.
2591
2592         This patch adds a readDataBuffer method that converts a given blob of data from the pasteboard into an
2593         attachment-element-backed representation in the DOM (i.e. either an attachment element or image element that
2594         contains an attachment element). In the case where the given pasteboard item has been explicitly marked as an
2595         attachment (via the preferredPresentationStyle hint) and the item has at least one type representation that
2596         conforms to "public.content", we take this codepath instead of first attempting the web content reading types
2597         supported by default in WebKit.
2598
2599         See below for more detail.
2600
2601         Test: WKAttachmentTestsIOS.InsertPastedFilesAsAttachments
2602
2603         * editing/Editor.cpp:
2604         (WebCore::Editor::clientReplacementURLForResource): Deleted.
2605         * editing/Editor.h:
2606         * editing/WebContentReader.h:
2607         * editing/cocoa/WebContentReaderCocoa.mm:
2608         (WebCore::mimeTypeFromContentType):
2609         (WebCore::contentTypeIsSuitableForInlineImageRepresentation):
2610         (WebCore::createFragmentAndAddResources):
2611         (WebCore::sanitizeMarkupWithArchive):
2612
2613         Remove all logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
2614
2615         (WebCore::WebContentReader::readImage):
2616         (WebCore::attachmentForFilePath):
2617         (WebCore::attachmentForData):
2618
2619         Add a helper that creates an attachment element for a given blob of data and content type. The logic here is
2620         quite similar to that of attachmentForFilePath, and we should find a way to either merge them, or pull out more
2621         of their similarities into helper functions.
2622
2623         (WebCore::WebContentReader::readDataBuffer):
2624         (WebCore::replaceSubresourceURLsWithURLsFromClient): Deleted.
2625
2626         Remove more logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
2627
2628         * loader/EmptyClients.cpp:
2629         * page/EditorClient.h:
2630         * platform/Pasteboard.h:
2631         * platform/PasteboardItemInfo.h:
2632         (WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const):
2633         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
2634         (WebCore::PasteboardItemInfo::encode const):
2635         (WebCore::PasteboardItemInfo::decode):
2636
2637         Add contentTypesByFidelity to PasteboardItemInfo, instead of requesting this information using a separate IPC
2638         message. This means we can also remove getTypesByFidelityForItemAtIndex, and just use the item's types in
2639         fidelity order instead.
2640
2641         * platform/PasteboardStrategy.h:
2642         * platform/PlatformPasteboard.h:
2643         * platform/ios/AbstractPasteboard.h:
2644         * platform/ios/PasteboardIOS.mm:
2645         (WebCore::Pasteboard::read):
2646
2647         Shave off (potentially many) sync IPC messages to the UI process by pulling each call to
2648         informationForItemAtIndex out of the inner loop when reading web content.
2649
2650         (WebCore::Pasteboard::readRespectingUTIFidelities):
2651
2652         Shave off one extraneous sync IPC message by rolling the types in fidelity order into the request for
2653         PasteboardItemInfo, instead of being sent in a separate message.
2654
2655         * platform/ios/PlatformPasteboardIOS.mm:
2656         (WebCore::PlatformPasteboard::informationForItemAtIndex):
2657
2658         Populate contentTypesForFileUpload in the case where UIPasteboard is used (i.e. copy and paste).
2659
2660         (WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex): Deleted.
2661         * platform/ios/WebItemProviderPasteboard.h:
2662         * platform/ios/WebItemProviderPasteboard.mm:
2663         (-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]): Deleted.
2664
2665 2019-02-18  Daniel Bates  <dabates@apple.com>
2666
2667         Clean up and modernize RenderThemeIOS::paintCheckboxDecorations()
2668         https://bugs.webkit.org/show_bug.cgi?id=194785
2669
2670         Reviewed by Simon Fraser.
2671
2672         Change from early return to else-clause to make the states clearer and make it more straightforward
2673         to share more common code. Use constexpr, allocate temporary vectors with inline capacity, and
2674         switch to uniform initializer syntax.
2675
2676         * rendering/RenderThemeIOS.mm:
2677         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
2678
2679 2019-02-18  Daniel Bates  <dabates@apple.com>
2680
2681         [iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour
2682         https://bugs.webkit.org/show_bug.cgi?id=193599
2683         <rdar://problem/47399602>
2684
2685         Reviewed by Simon Fraser.
2686
2687         For now, iOS uses a 3px outline width for its focus rings. Do not inset the focus ring on iOS
2688         for text fields, textareas, keygens, and selects so as to match the visual appearance of all
2689         the other controls.
2690
2691         Tests: fast/forms/ios/focus-button.html
2692                fast/forms/ios/focus-checkbox.html
2693                fast/forms/ios/focus-checked-checkbox.html
2694                fast/forms/ios/focus-checked-radio.html
2695                fast/forms/ios/focus-radio.html
2696                fast/forms/ios/focus-reset-button.html
2697                fast/forms/ios/focus-search-field.html
2698                fast/forms/ios/focus-submit-button.html
2699                fast/forms/ios/focus-text-field.html
2700                fast/forms/ios/focus-textarea.html
2701
2702         * css/html.css:
2703         (:focus): Use 3px outline width.
2704         (input:focus, textarea:focus, keygen:focus, select:focus): Guard this code to exclude it when building for iOS.
2705         * rendering/RenderBox.cpp:
2706         (WebCore::RenderBox::paintBoxDecorations): Add FIXME comment.
2707         * rendering/RenderElement.cpp:
2708         (WebCore::RenderElement::paintOutline): Call RenderTheme::adjustPaintRect() to adjust the paint rect.
2709         Otherwise, the focus rings for radios and checkboxes are drawn at the wrong y-coordinate and are not snug.
2710
2711 2019-02-18  Oriol Brufau  <obrufau@igalia.com>
2712
2713         [css-grid] Handle indefinite percentages in fit-content()
2714         https://bugs.webkit.org/show_bug.cgi?id=194509
2715
2716         Reviewed by Javier Fernandez.
2717
2718         Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html
2719
2720         If the size of the grid container depends on the size of its tracks,
2721         a percentage in fit-content() is indefinite. Without this patch, some
2722         places treated this case as fit-content(0), which prevented the grid
2723         container from growing enough to contain the max-content contribution
2724         of its grid items.
2725
2726         This patch treats such fit-content() as minmax(auto, max-content),
2727         but once the size of the grid container is known and it is laid out
2728         "for real", then the percentage is definite and it's used.
2729
2730         * rendering/GridTrackSizingAlgorithm.cpp:
2731         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
2732         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
2733
2734 2019-02-18  John Wilander  <wilander@apple.com>
2735
2736         Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
2737         https://bugs.webkit.org/show_bug.cgi?id=194777
2738         <rdar://problem/47731945>
2739
2740         Reviewed by Geoffrey Garen and Chris Dumez.
2741
2742         Test: http/tests/storageAccess/remove-requesting-iframe.html
2743
2744         * dom/Document.cpp:
2745         (WebCore::Document::hasFrameSpecificStorageAccess const):
2746             Now checks for the existence of the frame.
2747         (WebCore::Document::setHasFrameSpecificStorageAccess):
2748             Now checks for the existence of the frame.
2749         * loader/ResourceLoadObserver.cpp:
2750         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2751             Now checks that the session ID is valid.
2752
2753 2019-02-18  Jer Noble  <jer.noble@apple.com>
2754
2755         -[AVSampleBufferDisplayLayer player]: Unrecognized selector crash
2756         https://bugs.webkit.org/show_bug.cgi?id=194790
2757         <rdar://problem/33866742>
2758
2759         Reviewed by Jon Lee.
2760
2761         Ensure that a WebVideoContainerLayer's sole sublayer is actually an AVPlayerLayer (and not
2762         an AVSampleBufferDisplayLayer) before reporting that the layer type is LayerTypeAVPlayerLayer.
2763
2764         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2765         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
2766
2767 2019-02-18  Joseph Pecoraro  <pecoraro@apple.com>
2768
2769         Web Inspector: Better categorize CPU usage per-thread / worker
2770         https://bugs.webkit.org/show_bug.cgi?id=194564
2771
2772         Reviewed by Devin Rousso.
2773
2774         Test: inspector/cpu-profiler/threads.html
2775
2776         * workers/WorkerThread.cpp:
2777         (WebCore::WorkerThread::workerThreadsMutex):
2778         (WebCore::WorkerThread::workerThreadCount):
2779         (WebCore::WorkerThread::WorkerThread):
2780         (WebCore::WorkerThread::~WorkerThread):
2781         (WebCore::WorkerThread::workerThread):
2782         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
2783         * workers/WorkerThread.h:
2784         (WebCore::WorkerThread::identifier const):
2785         Expose the set of all WorkerThreads.
2786
2787         * inspector/agents/InspectorCPUProfilerAgent.cpp:
2788         (WebCore::InspectorCPUProfilerAgent::collectSample):
2789         Send inspector additional per-thread data.
2790
2791         * page/ResourceUsageData.h:
2792         (WebCore::WorkerCPUInfo::WorkerCPUInfo):
2793         * page/cocoa/ResourceUsageThreadCocoa.mm:
2794         (WebCore::ThreadInfo::ThreadInfo):
2795         (WebCore::threadInfos):
2796         (WebCore::ResourceUsageThread::platformCollectCPUData):
2797         (WebCore::threadSendRights): Deleted.
2798         (WebCore::cpuUsage): Deleted.
2799         Compute per-thread values on cocoa ports.
2800
2801         * page/linux/ResourceUsageThreadLinux.cpp:
2802         (WebCore::ResourceUsageThread::platformCollectCPUData):
2803         Stub per-thread values on linux ports.
2804
2805 2019-02-18  Jer Noble  <jer.noble@apple.com>
2806
2807         Uncaught Exception crash in MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus()
2808         https://bugs.webkit.org/show_bug.cgi?id=194786
2809
2810         Reviewed by Eric Carlson.
2811
2812         Convert a runtime crash to a debug assert by wrapping the call to -[AVPlayer removeObserver:forKeyPath:]
2813         in an exception handler.
2814
2815         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2816         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
2817
2818 2019-02-18  Daniel Bates  <dabates@apple.com>
2819
2820         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
2821         https://bugs.webkit.org/show_bug.cgi?id=192824
2822         <rdar://problem/47100332>
2823
2824         Reviewed by Wenson Hsieh.
2825
2826         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
2827         now that hardware key events to non-editable elements use the same code path as for editable elements. 
2828
2829         * platform/ios/KeyEventIOS.mm:
2830         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
2831         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
2832         (WebCore::isFunctionKey): Ditto.
2833         * platform/ios/WebEvent.mm:
2834         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
2835         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
2836
2837 2019-02-18  Eric Carlson  <eric.carlson@apple.com>
2838
2839         Add MSE logging configuration
2840         https://bugs.webkit.org/show_bug.cgi?id=194719
2841         <rdar://problem/48122151>
2842
2843         Reviewed by Joseph Pecoraro.
2844
2845         No new tests, updated inspector/console/webcore-logging.html.
2846
2847         * dom/Document.cpp:
2848         (WebCore::messageSourceForWTFLogChannel): Recognize the MSE logging channel.
2849
2850         * inspector/agents/WebConsoleAgent.cpp:
2851         (WebCore::WebConsoleAgent::getLoggingChannels): Ditto.
2852
2853 2019-02-18  Antoine Quint  <graouts@apple.com>
2854
2855         [iOS] Dispatch additional events along with pointerdown and pointerup
2856         https://bugs.webkit.org/show_bug.cgi?id=194776
2857         <rdar://problem/48164284>
2858
2859         Reviewed by Brent Fulgham.
2860
2861         The Pointer Events specification mandates that "pointerover" and "pointerenter" events precede a "pointerdown" event and that "pointerout"
2862         and "pointerleave" events follow a "pointerup" event. We remove the EventHandler::dispatchPointerEventForTouchAtIndex() method and replace
2863         it with a PointerCaptureController::dispatchEventForTouchAtIndex() that can handle the dispatch of such additional events correctly, also
2864         allowing for two PointerCaptureController methods (pointerEventWillBeDispatched and pointerEventWasDispatched) to become private.
2865
2866         Test: pointerevents/ios/over-enter-out-leave.html
2867
2868         * dom/EventNames.h: Add the new "pointerover", "pointerenter", "pointerout" and "pointerleave" event types.
2869         * dom/PointerEvent.h:
2870         * dom/ios/PointerEventIOS.cpp:
2871         (WebCore::PointerEvent::create):
2872         * page/EventHandler.cpp:
2873         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex): Deleted.
2874         * page/EventHandler.h:
2875         * page/PointerCaptureController.cpp:
2876         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): Take the existing code from EventHandler::dispatchPointerEventForTouchAtIndex()
2877         and extend it to dispatch additional events as mandated. Since several events may be dispatched we check whether the dispatch of any of those events
2878         had defaultPrevented() or defaultHanded() return true and return those values as a pair.
2879         (WebCore::PointerCaptureController::pointerEventWasDispatched):
2880         * page/PointerCaptureController.h:
2881
2882 2019-02-18  Sihui Liu  <sihui_liu@apple.com>
2883
2884         IndexedDB: leak IDBDatabase and IDBTransacstion in layout tests
2885         https://bugs.webkit.org/show_bug.cgi?id=194709
2886
2887         Reviewed by Geoffrey Garen.
2888
2889         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
2890         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
2891
2892         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
2893         between IDBOpenDBRequest and IDBTransaction.
2894
2895         Test: storage/indexeddb/IDBObject-leak.html
2896
2897         * Modules/indexeddb/IDBDatabase.cpp:
2898         (WebCore::IDBDatabase::connectionToServerLost):
2899         * Modules/indexeddb/IDBTransaction.cpp:
2900         (WebCore::IDBTransaction::IDBTransaction):
2901         (WebCore::IDBTransaction::~IDBTransaction):
2902         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
2903         (WebCore::IDBTransaction::connectionClosedFromServer):
2904         * Modules/indexeddb/IDBTransaction.h:
2905         * testing/Internals.cpp:
2906         (WebCore::Internals::numberOfIDBTransactions const):
2907         * testing/Internals.h:
2908         * testing/Internals.idl:
2909
2910 2019-02-18  Chris Fleizach  <cfleizach@apple.com>
2911
2912         AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
2913         https://bugs.webkit.org/show_bug.cgi?id=194742
2914
2915         Reviewed by Chris Dumez.
2916
2917         With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
2918         had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
2919
2920         This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
2921         receive notifications.
2922
2923         It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
2924         page load.
2925
2926         * accessibility/mac/AXObjectCacheMac.mm:
2927         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
2928
2929 2019-02-18  Megan Gardner  <megan_gardner@apple.com>
2930
2931         Turn On Smart Delete
2932         https://bugs.webkit.org/show_bug.cgi?id=194320
2933
2934         Reviewed by Ryosuke Niwa.
2935
2936         Updated the following tests to work with iOS:
2937         * editing/deleting/smart-delete-001.html:
2938         * editing/deleting/smart-delete-002.html:
2939         * editing/deleting/smart-delete-003.html:
2940         * editing/deleting/smart-delete-004.html:
2941         * editing/deleting/smart-delete-across-editable-boundaries-2.html:
2942         * editing/selection/delete-word-granularity-text-control.html:
2943
2944         Turn on Smart delete for iOS at all times. Modify checks to allow Mac and iOS and other 
2945         platforms to turn on smart delete when desired.
2946
2947         * editing/Editor.cpp:
2948         (WebCore::Editor::shouldSmartDelete):
2949         Allow platfroms to determine if smart delete should be on.
2950         On mac, this is via word granularity, on iOS this is just on all the time.
2951         (WebCore::Editor::canSmartCopyOrDelete):
2952         (WebCore::Editor::performCutOrCopy):
2953         * editing/Editor.h:
2954         * editing/EditorCommand.cpp:
2955         (WebCore::executeDelete):
2956         * editing/ios/EditorIOS.mm:
2957         (WebCore::Editor::shouldSmartDelete):
2958         * editing/mac/EditorMac.mm:
2959         (WebCore::Editor::shouldSmartDelete):
2960
2961 2019-02-17  David Kilzer  <ddkilzer@apple.com>
2962
2963         Unreviewed, rolling out r241620.
2964
2965         "Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
2966         (Requested by ddkilzer on #webkit.)
2967
2968         Reverted changeset:
2969
2970         "[WTF] Add environment variable helpers"
2971         https://bugs.webkit.org/show_bug.cgi?id=192405
2972         https://trac.webkit.org/changeset/241620
2973
2974 2019-02-16  Zalan Bujtas  <zalan@apple.com>
2975
2976         [LFC] RenderImage's default intrinsic size is 0.
2977         https://bugs.webkit.org/show_bug.cgi?id=194745
2978
2979         Reviewed by Antti Koivisto.
2980
2981         While the images are being loaded, their intrinsic size is set to 0 (RenderImage c'tor). Note that this code is temporary.
2982         * layout/layouttree/LayoutTreeBuilder.cpp:
2983         (WebCore::Layout::TreeBuilder::createSubTree):
2984
2985 2019-02-16  Zalan Bujtas  <zalan@apple.com>
2986
2987         [LFC][BFC] Add support for block replaced intrinsic width.
2988         https://bugs.webkit.org/show_bug.cgi?id=194705
2989
2990         Reviewed by Simon Fraser.
2991
2992         Replaced boxes should report their intrinsic width as preferred widths.
2993
2994         Test: fast/block/block-only/replaced-intrinsic-width-simple.html
2995
2996         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2997         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2998
2999 2019-02-16  Zalan Bujtas  <zalan@apple.com>
3000
3001         [LFC] Apply min/max width constraints to preferred width computation
3002         https://bugs.webkit.org/show_bug.cgi?id=194739
3003
3004         Reviewed by Simon Fraser.
3005
3006         Ensure that both min-height and max-height are taken into account while computing the preferred width.
3007
3008         Test: fast/block/block-only/min-max-and-preferred-width-simple.html
3009
3010         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3011         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
3012
3013 2019-02-15  Yusuke Suzuki  <ysuzuki@apple.com>
3014
3015         [JSC] Make builtin objects more lazily initialized under non-JIT mode
3016         https://bugs.webkit.org/show_bug.cgi?id=194727
3017
3018         Reviewed by Saam Barati.
3019
3020         * Modules/streams/ReadableByteStreamInternals.js:
3021         (privateInitializeReadableByteStreamController):
3022         (readableByteStreamControllerRespond):
3023
3024 2019-02-15  Dean Jackson  <dino@apple.com>
3025
3026         Allow emulation of user gestures from Web Inspector console
3027         https://bugs.webkit.org/show_bug.cgi?id=194725
3028         <rdar://problem/48126604>
3029
3030         Reviewed by Joseph Pecoraro and Devin Rousso.
3031
3032         Test: inspector/runtime/evaluate-userGestureEmulation.html
3033
3034         * inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create
3035         a UserGestureIndicator based on the emulateUserGesture option.
3036         (WebCore::PageRuntimeAgent::evaluate):
3037         * inspector/agents/page/PageRuntimeAgent.h:
3038
3039 2019-02-15  Chris Dumez  <cdumez@apple.com>
3040
3041         Sample domainsVisited diagnostic logging
3042         https://bugs.webkit.org/show_bug.cgi?id=194657
3043
3044         Reviewed by Ryosuke Niwa.
3045
3046         Sample domainsVisited diagnostic logging, we are getting a lot of data from
3047         this key and this is hurting our other keys.
3048
3049         * page/Page.cpp:
3050         (WebCore::Page::logNavigation):
3051
3052 2019-02-15  Ryosuke Niwa  <rniwa@webkit.org>
3053
3054         Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured()
3055         https://bugs.webkit.org/show_bug.cgi?id=194691
3056
3057         Reviewed by Simon Fraser.
3058
3059         The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document
3060         without updating the layout of ancestor documents (i.e. documents in which frame owner
3061         elements appear) even though it hit-tests against the top-level document's RenderView.
3062
3063         Fixed the bug by updating the layout of the top-level document as needed.
3064
3065         Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html
3066
3067         * html/HTMLPlugInElement.cpp:
3068         (WebCore::HTMLPlugInElement::isReplacementObscured):
3069
3070 2019-02-15  Ross Kirsling  <ross.kirsling@sony.com>
3071
3072         [WTF] Add environment variable helpers
3073         https://bugs.webkit.org/show_bug.cgi?id=192405
3074
3075         Reviewed by Michael Catanzaro.
3076
3077         * platform/NotImplemented.h:
3078         * platform/cocoa/SystemVersion.mm:
3079         (WebCore::createSystemMarketingVersion):
3080         * platform/graphics/gstreamer/GStreamerCommon.cpp:
3081         (WebCore::initializeGStreamer):
3082         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3083         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3084         * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
3085         (Nicosia::PaintingEngine::create):
3086         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
3087         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
3088         * platform/graphics/x11/PlatformDisplayX11.cpp:
3089         (WebCore::PlatformDisplayX11::create):
3090         * platform/gtk/RenderThemeWidget.cpp:
3091         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
3092         * platform/gtk/ScrollbarThemeGtk.cpp:
3093         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
3094         * platform/network/curl/CurlContext.cpp:
3095         (WebCore::CurlContext::CurlContext):
3096         (WebCore::EnvironmentVariableReader::read): Deleted.
3097         (WebCore::EnvironmentVariableReader::defined): Deleted.
3098         (WebCore::EnvironmentVariableReader::readAs): Deleted.
3099         (WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
3100         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
3101         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
3102         * platform/network/curl/NetworkStorageSessionCurl.cpp:
3103         (WebCore::defaultCookieJarPath):
3104         * platform/network/playstation/CurlSSLHandlePlayStation.cpp:
3105         (WebCore::getCACertPathEnv):
3106         * platform/network/win/CurlSSLHandleWin.cpp:
3107         (WebCore::getCACertPathEnv):
3108         * platform/text/hyphen/HyphenationLibHyphen.cpp:
3109         (WebCore::topLevelPath):
3110         (WebCore::webkitBuildDirectory):
3111         * platform/unix/LoggingUnix.cpp:
3112         (WebCore::logLevelString):
3113         * platform/win/LoggingWin.cpp:
3114         (WebCore::logLevelString):
3115         Utilize WTF::Environment where possible.
3116
3117 2019-02-15  Antoine Quint  <graouts@apple.com>
3118
3119         Add a method to dispatch a PointerEvent based on a PlatformTouchEvent
3120         https://bugs.webkit.org/show_bug.cgi?id=194702
3121         <rdar://problem/48109355>
3122
3123         Reviewed by Dean Jackson.
3124
3125         * page/EventHandler.cpp:
3126         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex):
3127         * page/EventHandler.h:
3128
3129 2019-02-15  Per Arne Vollan  <pvollan@apple.com>
3130
3131         [WebVTT] Inline WebVTT styles should start with '::cue'
3132         https://bugs.webkit.org/show_bug.cgi?id=194227
3133
3134         Reviewed by Eric Carlson.
3135
3136         The original fix in r241203 is not sufficient, since it only checks if the CSS string starts
3137         with '::cue'. Before accepting a CSS string from a WebVTT file, it should be checked that
3138         all selectors starts with '::cue'.
3139
3140         Test: media/track/track-cue-css.html
3141
3142         * html/track/WebVTTParser.cpp:
3143         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
3144
3145 2019-02-15  Youenn Fablet  <youenn@apple.com>
3146
3147         Add binding tests for ContextAllowsMediaDevices and ContextHasServiceWorkerScheme
3148         https://bugs.webkit.org/show_bug.cgi?id=194713
3149
3150         Reviewed by Eric Carlson.
3151
3152         Binding tests covering mediaDevices and serviceWorker attributes.
3153
3154         * bindings/scripts/test/JS/JSTestObj.cpp:
3155         (WebCore::JSTestObjPrototype::finishCreation):
3156         (WebCore::jsTestObjMediaDevices1Getter):
3157         (WebCore::jsTestObjMediaDevices1):
3158         (WebCore::jsTestObjMediaDevices2Getter):
3159         (WebCore::jsTestObjMediaDevices2):
3160         (WebCore::jsTestObjServiceWorkers1Getter):
3161         (WebCore::jsTestObjServiceWorkers1):
3162         (WebCore::jsTestObjServiceWorkers2Getter):
3163         (WebCore::jsTestObjServiceWorkers2):
3164         * bindings/scripts/test/TestObj.idl:
3165
3166 2019-02-15  Beth Dakin  <bdakin@apple.com>
3167
3168         Build fix.
3169
3170         * rendering/RenderThemeIOS.mm:
3171         (WebCore::iconForAttachment):
3172
3173 2019-02-15  Youenn Fablet  <youenn@apple.com>
3174
3175         Make ServiceWorkerClientFetch closer to WebResourceLoader
3176         https://bugs.webkit.org/show_bug.cgi?id=194651
3177
3178         Reviewed by Alex Christensen.
3179
3180         Check for redirection response and if so call a specific client API.
3181         Ensure ServiceWorkerFetch::Client gets called in the service worker thread proxy
3182         so that its m_connection is only accessed on that thread.
3183
3184         Covered by existing tests.
3185
3186         * platform/network/FormData.h:
3187         * platform/network/ResourceErrorBase.h:
3188         * workers/service/context/ServiceWorkerFetch.cpp:
3189         (WebCore::ServiceWorkerFetch::processResponse):
3190         * workers/service/context/ServiceWorkerFetch.h:
3191         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3192         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
3193         (WebCore::ServiceWorkerThreadProxy::continueDidReceiveFetchResponse):
3194         * workers/service/context/ServiceWorkerThreadProxy.h:
3195
3196 2019-02-15  Youenn Fablet  <youenn@apple.com>
3197
3198         Make navigator.mediaDevices SecureContext
3199         https://bugs.webkit.org/show_bug.cgi?id=194666
3200
3201         Reviewed by Eric Carlson.
3202
3203         Make navigator.mediaDevices SecureContext.
3204         This can still be enabled for unsecure context using the existing page settings.
3205         To cover that case, introduce ContextHasMediaDevices custom IDL keyword.
3206
3207         Covered by API test.
3208
3209         * Modules/mediastream/NavigatorMediaDevices.idl:
3210         * bindings/scripts/CodeGeneratorJS.pm:
3211         (GenerateRuntimeEnableConditionalString):
3212         * bindings/scripts/IDLAttributes.json:
3213         * dom/ScriptExecutionContext.cpp:
3214         (WebCore::ScriptExecutionContext::hasMediaDevices const):
3215         (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
3216         * dom/ScriptExecutionContext.h:
3217
3218 2019-02-15  Youenn Fablet  <youenn@apple.com>
3219
3220         WebSocket should not fire events after being stopped
3221         https://bugs.webkit.org/show_bug.cgi?id=194690
3222
3223         Reviewed by Geoffrey Garen.
3224
3225         dispatchOrQueueErrorEvent is scheduled using RunLoop::main().dispatch or dispatch_async.
3226         This makes it possible to dispatch an event while WebSocket is already stopped.
3227         Instead, use Document::postTask so that the task is only executed if WebSocket is not stopped.
3228
3229         As a refactoring, make use of PendingActivity to keep track of setPendingActivity/unsetPendingActivity more easily.
3230
3231         * Modules/websockets/WebSocket.cpp:
3232         (WebCore::WebSocket::stop):
3233         (WebCore::WebSocket::connect):
3234         * Modules/websockets/WebSocket.h:
3235
3236 2019-02-15  Youenn Fablet  <youenn@apple.com>
3237
3238         Performance should not fire events when its context is stopped
3239         https://bugs.webkit.org/show_bug.cgi?id=194689
3240
3241         Reviewed by Alex Christensen.
3242
3243         Stop the timer when its context is destroyed.
3244         Add an assertion to ensure the timer does not fire after context is destroyed.
3245
3246         * page/Performance.cpp:
3247         (WebCore::Performance::stop):
3248
3249 2019-02-15  Alex Christensen  <achristensen@webkit.org>
3250
3251         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
3252         https://bugs.webkit.org/show_bug.cgi?id=194523
3253
3254         Reviewed by Geoffrey Garen.
3255
3256         The scope of the FormCreationContext was limited to the scope of createHTTPBodyCFReadStream,
3257         so when it was used in formCreate it was lucky to get the same context if the stack hadn't been overwritten
3258         and if the FormData hadn't been freed.  Instead, keep it alive with new/delete like we do the FormStreamFields.
3259         A younger me should've noticed this when reviewing r218517.
3260
3261         * platform/network/cf/FormDataStreamCFNet.cpp:
3262         (WebCore::formCreate):
3263         (WebCore::createHTTPBodyCFReadStream):
3264
3265 2019-02-15  Commit Queue  <commit-queue@webkit.org>
3266
3267         Unreviewed, rolling out r241559 and r241566.
3268         https://bugs.webkit.org/show_bug.cgi?id=194710
3269
3270         Causes layout test crashes under GuardMalloc (Requested by
3271         ryanhaddad on #webkit).
3272
3273         Reverted changesets:
3274
3275         "[WTF] Add environment variable helpers"
3276         https://bugs.webkit.org/show_bug.cgi?id=192405
3277         https://trac.webkit.org/changeset/241559
3278
3279         "Unreviewed build fix for WinCairo Debug after r241559."
3280         https://trac.webkit.org/changeset/241566
3281
3282 2019-02-15  Youenn Fablet  <youenn@apple.com>
3283
3284         Stop the endpoint synchronously in RTCPeerConnection::close
3285         https://bugs.webkit.org/show_bug.cgi?id=194688
3286
3287         Reviewed by Eric Carlson.
3288
3289         In the case where the peer connection is being closed, it was asynchronously stopping the endpoint.
3290         But the endpoint, before being stopped, could try to fire an event.
3291         If the context is gone in between, we end up with a null pointer dereference.
3292
3293         * Modules/mediastream/RTCPeerConnection.cpp:
3294         (WebCore::RTCPeerConnection::close):
3295
3296 2019-02-15  Zalan Bujtas  <zalan@apple.com>
3297
3298         [LFC] Out-of-flow box is never a float box
3299         https://bugs.webkit.org/show_bug.cgi?id=194704
3300
3301         Reviewed by Antti Koivisto.
3302
3303         We can't have it both ways. Absolute positioning wins.
3304
3305         Test: fast/block/block-only/out-of-flow-is-never-float-box.html
3306
3307         * layout/layouttree/LayoutBox.cpp:
3308         (WebCore::Layout::Box::isFloatingPositioned const):
3309         (WebCore::Layout::Box::isLeftFloatingPositioned const):
3310         (WebCore::Layout::Box::isRightFloatingPositioned const):
3311
3312 2019-02-15  Philippe Normand  <pnormand@igalia.com>
3313
3314         [GStreamer] Simplify GObject class name check
3315         https://bugs.webkit.org/show_bug.cgi?id=194537
3316
3317         Reviewed by Michael Catanzaro.
3318
3319         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3320         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
3321         Use G_OBJECT_TYPE_NAME() to filter out uridecodebin child
3322         elements.
3323
3324 2019-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3325
3326         Refactor EditingStyle::textDirection to return an Optional<WritingDirection> instead of a bool
3327         https://bugs.webkit.org/show_bug.cgi?id=194686
3328
3329         Reviewed by Ryosuke Niwa.
3330
3331         Changes EditingStyle::textDirection to return an Optional<WritingDirection>, instead of taking a reference to
3332         the resulting WritingDirection. No change in behavior.
3333
3334         * editing/ApplyStyleCommand.cpp:
3335         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
3336         (WebCore::ApplyStyleCommand::applyInlineStyle):
3337         * editing/EditingStyle.cpp:
3338         (WebCore::EditingStyle::textDirection const):
3339         (WebCore::EditingStyle::textDirectionForSelection):
3340         * editing/EditingStyle.h:
3341
3342 2019-02-10  Darin Adler  <darin@apple.com>
3343
3344         Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
3345         https://bugs.webkit.org/show_bug.cgi?id=194487
3346
3347         Reviewed by Daniel Bates.
3348
3349         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
3350         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue): Use makeString
3351         instead of String::format.
3352
3353         * page/linux/ResourceUsageOverlayLinux.cpp:
3354         (WebCore::formatByteNumber): Use String::number instead of String::format.
3355
3356         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
3357         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
3358         Use makeString instead of String::format.
3359         * platform/glib/UserAgentGLib.cpp:
3360         (WebCore::platformVersionForUAString): Ditto.
3361         * platform/graphics/gstreamer/GStreamerCommon.cpp:
3362         (WebCore::simpleBusMessageCallback): Ditto.
3363         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3364         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Ditto.
3365         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3366         (WebCore::AppendPipeline::AppendPipeline): Ditto.
3367         (WebCore::AppendPipeline::handleStateChangeMessage): Ditto.
3368         (WebCore::AppendPipeline::resetParserState): Ditto.
3369         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3370         (WebCore::MediaPlayerPrivateGStreamerMSE::load): Ditto.
3371         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Ditto.
3372
3373         * platform/graphics/gtk/ImageBufferGtk.cpp:
3374         (WebCore::encodeImage): Use String::number instead of String::format.
3375
3376         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
3377         (WebCore::GStreamerAudioCaptureSource::create): Use makeString instead of
3378         String::format.
3379         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
3380         (WebCore::GStreamerCaptureDeviceManager::addDevice): Ditto.
3381         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
3382         (WebCore::webkitMediaStreamSrcAddPad): Ditto.
3383         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
3384         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
3385         * platform/network/curl/CookieJarDB.cpp:
3386         (WebCore::CookieJarDB::verifySchemaVersion): Ditto.
3387         * platform/win/SearchPopupMenuDB.cpp:
3388         (WebCore::SearchPopupMenuDB::verifySchemaVersion): Ditto.