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