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