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