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