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