6e066c982ef7f923a042d83c6ad4414f86ba5218
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-31  Jer Noble  <jer.noble@apple.com>
2
3         NSInvalidArgumentException in [WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]
4         https://bugs.webkit.org/show_bug.cgi?id=194123
5         <rdar://problem/47721094>
6
7         Reviewed by Eric Carlson.
8
9         According to crash logs, AVSampleBufferDisplayLayer.error can go from an NSError* to nil; when such a change is KVO'd,
10         the NSKeyValueChangeNewKey is a NSNull. Detect this state and bail out early.
11
12         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
13         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
14
15 2019-01-31  Jer Noble  <jer.noble@apple.com>
16
17         [Cocoa][EME] AirPlaying a FairPlay-protected HLS stream fails to decrypt
18         https://bugs.webkit.org/show_bug.cgi?id=194114
19
20         Reviewed by Eric Carlson.
21
22         The AVAssetResourceLoaderDelegate must explicitly... delegate responsibility for FairPlay key
23         requests to the AVContentKeySession.
24
25         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
26         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
27
28 2019-01-31  Megan Gardner  <megan_gardner@apple.com>
29
30         Don't insert spaces at the beginning of a newline when using smart-copy-paste
31         https://bugs.webkit.org/show_bug.cgi?id=194070
32
33         Reviewed by Tim Horton.
34
35         If our inserted content end is at the beginning of a paragraph, do not insert a space.
36         Also, if our inserted content beginning is at the end of a paragraph, do not insert a space.
37
38         Test: editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea.html
39
40         * editing/ReplaceSelectionCommand.cpp:
41         (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
42
43 2019-01-31  Justin Fan  <justin_fan@apple.com>
44
45         [WebGPU] Build fix: disable MTLCopyAllDevices call on non-Mac platforms
46         https://bugs.webkit.org/show_bug.cgi?id=194120
47
48         Unreviewed build fix. 
49
50         No new tests; no change in behavior.
51
52         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
53         (WebCore::GPUDevice::create): Wrap problem code in #if PLATFORM(MAC).
54
55 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
56
57         Basic scrollability for async overflow scrolling on macOS
58         https://bugs.webkit.org/show_bug.cgi?id=194093
59
60         Reviewed by Antti Koivisto.
61
62         Give a ScrollingTreeOverflowScrollingNodeMac a ScrollingTreeScrollingNodeDelegateMac and have it keep track
63         of its layers so basic scrolling works for async overflow scroll.
64
65         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
66         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
67         (WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
68         (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
69         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
70         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
71         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
72         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
73         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
74         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
75         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
76         * rendering/RenderLayerBacking.cpp:
77         (WebCore::RenderLayerBacking::updateScrollingLayers):
78
79 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
80
81         Generalize ScrollingTreeScrollingNodeDelegate for use in macOS too, add a macOS subclass for frame/overflow scrolling
82         https://bugs.webkit.org/show_bug.cgi?id=194080
83
84         Reviewed by Antti Koivisto.
85
86         To share code between ScrollingTreeFrameScrollingNodeMac and ScrollingTreeOverflowScrollingNodeMac, build ScrollingTreeScrollingNodeDelegate
87         for macOS too, and add some helper functions to ScrollingTreeScrollingNodeDelegate.
88
89         Add a macOS subclass, ScrollingTreeScrollingNodeDelegateMac, which takes over the basic scrolling, rubber-banding
90         and scroll snapping functionality from ScrollingTreeFrameScrollingNodeMac. The delegate owns the ScrollController and
91         implements ScrollControllerClient.
92
93         ScrollingTreeFrameScrollingNodeMac now owns a ScrollingTreeScrollingNodeDelegateMac. A future patch
94         will add one to ScrollingTreeOverflowScrollingNodeMac.
95
96         No behavior change.
97
98         * SourcesCocoa.txt:
99         * WebCore.xcodeproj/project.pbxproj:
100         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
101         (WebCore::ScrollingTreeFrameScrollingNode::scrollBy): Deleted.
102         (WebCore::ScrollingTreeFrameScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
103         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
104         (WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor const):
105         * page/scrolling/ScrollingTreeNode.cpp:
106         (WebCore::ScrollingTreeNode::isRootNode const):
107         * page/scrolling/ScrollingTreeNode.h:
108         * page/scrolling/ScrollingTreeScrollingNode.cpp:
109         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
110         (WebCore::ScrollingTreeScrollingNode::scrollBy):
111         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints):
112         * page/scrolling/ScrollingTreeScrollingNode.h:
113         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const):
114         * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp:
115         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
116         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const):
117         (WebCore::ScrollingTreeScrollingNodeDelegate::minimumScrollPosition const):
118         (WebCore::ScrollingTreeScrollingNodeDelegate::maximumScrollPosition const):
119         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollableAreaSize const):
120         (WebCore::ScrollingTreeScrollingNodeDelegate::totalContentsSize const):
121         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledHorizontalScrollbar const):
122         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledVerticalScrollbar const):
123         (WebCore::ScrollingTreeScrollingNodeDelegate::horizontalScrollElasticity const):
124         (WebCore::ScrollingTreeScrollingNodeDelegate::verticalScrollElasticity const):
125         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
126         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
127         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
128         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
129         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
130         (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition const):
131         (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition const):
132         (WebCore::newGestureIsStarting): Deleted.
133         (WebCore::ScrollingTreeFrameScrollingNodeMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
134         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching): Deleted.
135         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching): Deleted.
136         (WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount): Deleted.
137         (WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection): Deleted.
138         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally): Deleted.
139         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically): Deleted.
140         (WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection): Deleted.
141         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy): Deleted.
142         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints): Deleted.
143         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
144         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary): Deleted.
145         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset const): Deleted.
146         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Deleted.
147         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor const): Deleted.
148         (WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Deleted.
149         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Deleted.
150         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtent const): Deleted.
151         (WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize const): Deleted.
152         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason const): Deleted.
153         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason const): Deleted.
154         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h.
155         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: Added.
156         (WebCore::ScrollingTreeScrollingNodeDelegateMac::ScrollingTreeScrollingNodeDelegateMac):
157         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollSnapPoints):
158         (WebCore::ScrollingTreeScrollingNodeDelegateMac::setActiveScrollSnapIndexForAxis):
159         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexForAxis const):
160         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexDidChange const):
161         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
162         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isScrollSnapInProgress const):
163         (WebCore::newGestureIsStarting):
164         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
165         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching):
166         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching):
167         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
168         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
169         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally):
170         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically):
171         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection):
172         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollBy):
173         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
174         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer):
175         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
176         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
177         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
178         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pageScaleFactor const):
179         (WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer):
180         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer):
181         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollExtent const):
182         (WebCore::ScrollingTreeScrollingNodeDelegateMac::viewportSize const):
183         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const):
184         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const):
185
186 2019-01-31  Jer Noble  <jer.noble@apple.com>
187
188         [Mac] Requesting PiP from two different WebViews gets PiP window "stuck"
189         https://bugs.webkit.org/show_bug.cgi?id=194099
190         <rdar://problem/47271323>
191
192         Reviewed by Eric Carlson.
193
194         When a different client requests the PiP window, the PiP framework will call -pipDidClose: without
195         first calling -pipActionStop:. This leaves the internal fullscreen state in a confused state where
196         the WebView will attempt to re-enter PiP once it gets focus, and can lead to a state where the two
197         WebViews will constantly try to steal PiP from one another, ad infinitum.
198
199         When receiving a notification that the PiP window closed when our internal state tells us that the
200         close was not requested, notify the client that PiP mode was exited, allowing them to set their
201         expected state to a correct and sane value.
202
203         * platform/mac/VideoFullscreenInterfaceMac.mm:
204         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
205
206 2019-01-31  Keith Rollin  <krollin@apple.com>
207
208         WebCore::WHLSL::AST::Expression copy constructor needs to be be default, not delete
209         https://bugs.webkit.org/show_bug.cgi?id=194055
210         <rdar://problem/47684570>
211
212         Reviewed by Myles C. Maxfield.
213
214         WebCore::WHLSL::AST::Expression has a deleted copy constructor.
215         EnumerationMemberLiteral, a subclass, has a default copy constructor.
216         Some compilers may complain that the latter's c'tor can't access the
217         former's, because it doesn't exist. Fix this by marking Expression's
218         c'tor as default.
219
220         No new tests since there should be no observable behavior difference.
221
222         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
223
224 2019-01-31  Alex Christensen  <achristensen@webkit.org>
225
226         Revert r238819 which is unneeded and caused a performance regression.
227         https://bugs.webkit.org/show_bug.cgi?id=192272
228         <rdar://problem/46664625>
229
230         * loader/EmptyFrameLoaderClient.h:
231         * loader/FrameLoader.cpp:
232         (WebCore::FrameLoader::prepareForLoadStart):
233         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
234         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
235         * loader/FrameLoader.h:
236         * loader/FrameLoaderClient.h:
237
238 2019-01-31  Justin Fan  <justin_fan@apple.com>
239
240         [WebGPU] WebGPUAdapterDescriptor -> GPURequestAdapterOptions and take powerPreference into account
241         https://bugs.webkit.org/show_bug.cgi?id=194068
242         <rdar://problem/47680215>
243
244         Reviewed by Dean Jackson.
245         
246         Per the Web GPU IDL, WebGPUAdapterDescriptor is now known as GPURequestAdapterOptions and is optional.
247         In addition, Web GPU now actually attempts to return an integrated GPU when a low-power adapter is requested.
248
249         Test: adapter-options.html
250
251         * Modules/webgpu/GPURequestAdapterOptions.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.idl.
252         * Modules/webgpu/WebGPU.cpp:
253         (WebCore::WebGPU::requestAdapter const):
254         * Modules/webgpu/WebGPU.h:
255         * Modules/webgpu/WebGPU.idl:
256         * Modules/webgpu/WebGPUAdapter.cpp:
257         (WebCore::WebGPUAdapter::create):
258         (WebCore::WebGPUAdapter::WebGPUAdapter):
259         * Modules/webgpu/WebGPUAdapter.h:
260         (WebCore::WebGPUAdapter::options const):
261         * Modules/webgpu/WebGPUDevice.cpp:
262         (WebCore::WebGPUDevice::create):
263         * platform/graphics/gpu/GPUDevice.h:
264         * platform/graphics/gpu/GPURequestAdapterOptions.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.h.
265         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
266         (WebCore::GPUDevice::create):
267
268 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
269
270         Formalize WebKitAdditions mechanism of LoadOptimizer
271         https://bugs.webkit.org/show_bug.cgi?id=193886
272         <rdar://problem/47696809>
273
274         Reviewed by Brent Fulgham.
275
276         Covered by existing tests.
277
278         * platform/network/ResourceRequestBase.h:
279         Export isolatedCopy().
280
281 2019-01-31  Jer Noble  <jer.noble@apple.com>
282
283         [Cocoa][EME] Modern EME uses a different path for SecureStop data than Legacy EME
284         https://bugs.webkit.org/show_bug.cgi?id=193988
285
286         Reviewed by Jon Lee.
287
288         Modern EME is writing SecureStop data as a file at the same path as the
289         directory used by Legacy EME; meaning, when Modern EME attempts to write
290         to that file, it will fail because a directory exists at the same path.
291
292         Add a migration step to take care of those instances where Modern EME Secure
293         Stop data was already written to disk, and move that previously written data
294         to the correct file path.
295
296         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
297         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
298         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
299         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
300         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
301         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
302         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
303         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
304
305 2019-01-31  Antti Koivisto  <antti@apple.com>
306
307         Call the frame main contents layer "rootContentsLayer" consistently.
308         https://bugs.webkit.org/show_bug.cgi?id=194089
309
310         Reviewed by Simon Fraser.
311
312         This is currently called "rootContentLayer" in the compositor and "scrolledContentsLayer" in the scrolling tree.
313         We want to reserve term "scrolledContentsLayer" to mean the direct child layer of the  scroll container layer
314         without any positioning oddities (which this isn't).
315
316         * page/scrolling/AsyncScrollingCoordinator.cpp:
317         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
318         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
319         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
320
321         Set the rootContentsLayer for frame. It is only used by the Mac frame scrolling code.
322
323         * page/scrolling/AsyncScrollingCoordinator.h:
324         * page/scrolling/ScrollingCoordinator.cpp:
325         (WebCore::ScrollingCoordinator::rootContentsLayerForFrameView):
326         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView): Deleted.
327         * page/scrolling/ScrollingCoordinator.h:
328         (WebCore::ScrollingCoordinator::setNodeLayers):
329         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
330         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
331         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
332         (WebCore::ScrollingStateFrameScrollingNode::setRootContentsLayer):
333         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
334         * page/scrolling/ScrollingStateFrameScrollingNode.h:
335
336         Introduce rootContentLayer for frames only.
337
338         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
339         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
340         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
341         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
342
343         Switch to using rootContentsLayer.
344
345         * rendering/RenderLayerCompositor.cpp:
346         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
347         (WebCore::RenderLayerCompositor::updateCompositingLayers):
348         (WebCore::RenderLayerCompositor::updateRootContentLayerClipping):
349         (WebCore::RenderLayerCompositor::layerTreeAsText):
350         (WebCore::RenderLayerCompositor::rootGraphicsLayer const):
351         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
352         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
353         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
354         (WebCore::RenderLayerCompositor::updateLayerForHeader):
355         (WebCore::RenderLayerCompositor::updateLayerForFooter):
356         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
357         (WebCore::RenderLayerCompositor::ensureRootLayer):
358         (WebCore::RenderLayerCompositor::destroyRootLayer):
359         (WebCore::RenderLayerCompositor::attachRootLayer):
360         (WebCore::RenderLayerCompositor::detachRootLayer):
361         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
362         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
363
364         Pass rootContentsLayer separately for frames only.
365         Pass null as frame scrolledContentsLayer until these are rearranged (it is not used).
366
367         * rendering/RenderLayerCompositor.h:
368
369 2019-01-31  Keith Rollin  <krollin@apple.com>
370
371         GCGamepad is deprecated
372         https://bugs.webkit.org/show_bug.cgi?id=194056
373         <rdar://problem/47685010>
374
375         Reviewed by Brady Eidson.
376
377         GCGamepad is deprecated, resulting in compiler warnings. Address this
378         for now by employing ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
379
380         No new tests since there should be no observable behavior difference.
381
382         * platform/gamepad/cocoa/GameControllerGamepad.mm:
383         (WebCore::GameControllerGamepad::setupAsGamepad):
384
385 2019-01-31  Darin Adler  <darin@apple.com>
386
387         Simplify and streamline code that creates an appropriate document based on MIME type
388         https://bugs.webkit.org/show_bug.cgi?id=193756
389
390         Reviewed by Chris Dumez.
391
392         * dom/DOMImplementation.cpp:
393         (WebCore::DOMImplementation::createDocument): Use equalLettersIgnoringASCIICase rather
394         than == for all the MIME type checks. Use MIMETypeRegistry::isSupportedImageMIMEType
395         instead of Image::supportsType. Rearranged checks so that all the combinations that
396         that take precedence over plug-ins are checked first, fixing some unimportant edge
397         cases where the plug-in database is initialized and doesn't need to be. Straightened
398         out the logic for various special types so that the checks are more independent from
399         each other and hence easier to understand.
400
401 2019-01-31  Alicia Boya García  <aboya@igalia.com>
402
403         [MSE][GStreamer] Unreviewed debug build fix, obsolete assert
404
405         Since m_playerPrivate is now a reference, it no longer has a default
406         cast to bool. But there is also no longer a need to assert it's non
407         null, so just remove the assert.
408
409         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
410         (WebCore::MediaSourceClientGStreamerMSE::append):
411
412 2019-01-31  Alicia Boya García  <aboya@igalia.com>
413
414         [MSE][GStreamer] Use reference instead of pointer in m_playerPrivate
415         https://bugs.webkit.org/show_bug.cgi?id=194091
416
417         Reviewed by Xabier Rodriguez-Calvar.
418
419         Since the pointer is initialized with the class, it's never null and
420         never changes, it's preferrable to use a reference instead of a
421         pointer.
422
423         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
424         (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
425         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
426         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
427         (WebCore::MediaSourceClientGStreamerMSE::abort):
428         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
429         (WebCore::MediaSourceClientGStreamerMSE::append):
430         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
431         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
432         (WebCore::MediaSourceClientGStreamerMSE::flush):
433         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
434         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
435         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
436         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
437
438 2019-01-31  Alexander Mikhaylenko  <exalm7659@gmail.com>
439
440         [GTK] Momentum scrolling stops abruptly before websites end
441         https://bugs.webkit.org/show_bug.cgi?id=193350
442
443         Reviewed by Carlos Garcia Campos.
444
445         Don't immediately set velocity to 0 when position reaches upper or bottom limit.
446         Instead, set it to the overshot distance, so that position exactly matches upper
447         or lower limit on the next frame, and then clamp velocity to 0 using the existing
448         mechanism.
449
450         * platform/ScrollAnimationKinetic.cpp:
451         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
452
453 2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
454
455         Unreviewed, fix incorrect string format
456         https://bugs.webkit.org/show_bug.cgi?id=193907
457         <rdar://problem/47604080>
458
459         * page/scrolling/ScrollingTree.cpp:
460         (WebCore::ScrollingTree::commitTreeState):
461
462 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
463
464         [Mac] Implement basic hit testing in the scrolling tree
465         https://bugs.webkit.org/show_bug.cgi?id=172917
466         <rdar://problem/34215516>
467
468         Reviewed by Antti Koivisto.
469
470         First steps to getting hit testing of scrolling nodes in the scrolling tree. Based on patch
471         by Frédéric Wang.
472
473         First we pipe the "async scrolling enabled" setting through to the ScrollingTree via
474         the root node (like the other settings; weird, but that's how it's done). For now,
475         we hit test in the scrolling tree if either async overflow or frame scrolling are enabled
476         (it's hard to deal with one without the other).
477
478         Nodes in the scrolling tree implement scrollingNodeForPoint() to implement hit testing.
479         Two helper functions exist to simplify coordinate conversion: parentToLocalPoint()
480         and localToContentsPoint(). Child nodes are hit-testing in reverse order to find nodes
481         hightest in Z first. Only scrolling nodes are returned (not sure if we'll ever need
482         to hit-test non-scrolling nodes). Nodes use parentRelativeScrollableRect and scroll positions
483         to do these point mappings.
484
485         handleWheelEvent() is changed to return a ScrollingEventResult.
486
487         Latching is not correct with this change when async frame scrolling is enabled. That needs
488         to be fixed separately.
489
490         No tests yet; for ease of testing, I'd like to add an Internals API to hit-test the
491         scrolling tree, rather than doing eventSender stuff everywhere.
492
493         * page/scrolling/AsyncScrollingCoordinator.cpp:
494         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
495         (WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const):
496         * page/scrolling/AsyncScrollingCoordinator.h:
497         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
498         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
499         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
500         (WebCore::ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled):
501         * page/scrolling/ScrollingStateFrameScrollingNode.h:
502         * page/scrolling/ScrollingTree.cpp:
503         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
504         (WebCore::ScrollingTree::handleWheelEvent):
505         (WebCore::ScrollingTree::commitTreeState):
506         (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
507         * page/scrolling/ScrollingTree.h:
508         (WebCore::ScrollingTree::asyncFrameOrOverflowScrollingEnabled const):
509         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
510         (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const):
511         * page/scrolling/ScrollingTreeFrameHostingNode.h:
512         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
513         (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const):
514         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
515         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
516         * page/scrolling/ScrollingTreeNode.cpp:
517         (WebCore::ScrollingTreeNode::scrollingNodeForPoint const):
518         * page/scrolling/ScrollingTreeNode.h:
519         (WebCore::ScrollingTreeNode::children const):
520         (WebCore::ScrollingTreeNode::parentToLocalPoint const):
521         (WebCore::ScrollingTreeNode::localToContentsPoint const):
522         * page/scrolling/ScrollingTreeScrollingNode.cpp:
523         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
524         (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const):
525         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
526         (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const):
527         * page/scrolling/ScrollingTreeScrollingNode.h:
528         * page/scrolling/ThreadedScrollingTree.cpp:
529         (WebCore::ThreadedScrollingTree::handleWheelEvent):
530         * page/scrolling/ThreadedScrollingTree.h:
531         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
532         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
533         (WebCore::ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent):
534         * page/scrolling/ios/ScrollingTreeIOS.h:
535         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
536         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
537         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
538         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
539
540 2019-01-31  Alicia Boya García  <aboya@igalia.com>
541
542         [MSE][GStreamer] Remove unused GstFlowReturn in AppendPipeline methods
543         https://bugs.webkit.org/show_bug.cgi?id=194067
544
545         Reviewed by Xabier Rodriguez-Calvar.
546
547         A couple methods in AppendPipeline were returning GstFlowReturn
548         despite there being no codepath (sans assertions) where values other
549         than GST_FLOW_OK are returned.
550
551         Therefore, it makes sense to just make these methods return void.
552
553         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
554         (WebCore::AppendPipeline::pushNewBuffer):
555         (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
556         * platform/graphics/gstreamer/mse/AppendPipeline.h:
557         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
558         (WebCore::MediaSourceClientGStreamerMSE::append):
559         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
560         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
561         (WebCore::SourceBufferPrivateGStreamer::append):
562
563 2019-01-31  Alicia Boya García  <aboya@igalia.com>
564
565         [MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE
566         https://bugs.webkit.org/show_bug.cgi?id=194069
567
568         Reviewed by Xabier Rodriguez-Calvar.
569
570         m_playerPrivate is non-NULL since MediaSourceClientGStreamerMSE
571         creation well until its destruction.
572
573         The only case that could make a NULL m_playerPrivate is
574         clearPlayerPrivate() but that method is not used anymore.
575
576         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
577         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
578         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
579         (WebCore::MediaSourceClientGStreamerMSE::abort):
580         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
581         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
582         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
583         (WebCore::MediaSourceClientGStreamerMSE::flush):
584         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
585         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
586         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
587         (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate): Deleted.
588         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
589
590 2019-01-31  Thibault Saunier  <tsaunier@igalia.com>
591
592         [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource
593         https://bugs.webkit.org/show_bug.cgi?id=194087
594
595         Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad
596         meaning that it makes sense that when any of the downstream pad is returning flushing, you should
597         return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned
598         *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream
599         source element task to PAUSED (because downstream returned flushing) on a branch that was not
600         flushing!
601
602         Reviewed by Philippe Normand.
603
604         This is a theorical race we can't really cover with tests.
605
606         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
607         (WebCore::webkitMediaStreamSrcChain):
608
609 2019-01-31  Zalan Bujtas  <zalan@apple.com>
610
611         [LFC] Margin before/after/start/end initial value is 0 and not auto.
612         https://bugs.webkit.org/show_bug.cgi?id=194090
613
614         Reviewed by Antti Koivisto.
615
616         Don't treat it like auto.
617
618         * layout/FormattingContextGeometry.cpp:
619         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
620         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
621
622 2019-01-31  Zalan Bujtas  <zalan@apple.com>
623
624         [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently
625         https://bugs.webkit.org/show_bug.cgi?id=194074
626
627         Reviewed by Antti Koivisto.
628
629         Check the used margin variables whether we already computed start/end values.
630
631         Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html
632
633         * layout/FormattingContextGeometry.cpp:
634         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
635
636 2019-01-31  Zalan Bujtas  <zalan@apple.com>
637
638         [LFC][BFC] Add support for block level replaced box.
639         https://bugs.webkit.org/show_bug.cgi?id=194071
640
641         Reviewed by Antti Koivisto.
642
643         * layout/layouttree/LayoutBox.cpp:
644         (WebCore::Layout::Box::Box):
645         * layout/layouttree/LayoutBox.h:
646         * layout/layouttree/LayoutTreeBuilder.cpp:
647         (WebCore::Layout::TreeBuilder::createSubTree):
648         (WebCore::Layout::outputLayoutBox):
649
650 2019-01-31  Chris Fleizach  <cfleizach@apple.com>
651
652         ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
653         https://bugs.webkit.org/show_bug.cgi?id=189094
654         <rdar://problem/43853526>
655
656         Reviewed by Zalan Bujtas.
657
658         Protect against access to objects and cache's that can be removed while an object is still in memory.
659
660         Unskipped flaky tests on mac-wk2.
661
662         * accessibility/mac/AXObjectCacheMac.mm:
663         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
664         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
665         (textMarkerForVisiblePosition):
666         (textMarkerRangeFromVisiblePositions):
667
668 2019-01-30  Chris Dumez  <cdumez@apple.com>
669
670         Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error
671         https://bugs.webkit.org/show_bug.cgi?id=194023
672         <rdar://problem/47417981>
673
674         Reviewed by Geoffrey Garen.
675
676         The issue was caused by the 'isTopSite' flag not getting properly set on the network request
677         in case of a cross-site history navigation (with process-swap). As a result, twitter.com was
678         not getting its same-site lax cookies.
679
680         The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were
681         bypassing this method entirely when continuing a load in a new process after a swap. This was
682         intentional as the network request is normally already fully populated by the previous process
683         and we do not want the new process to modify the request in any way (e.g. we would not want to
684         add a Origin header back after it was removed by the previous process). However, in case of a
685         History navigation, we do not actually pass a request along from one process to another. Instead,
686         we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process.
687         In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though
688         we are technically continuing a load in a new process.
689
690         We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're
691         continuing a load with a request and not when we're continuing a load with a HistoryItem.
692
693         Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php
694
695         * loader/FrameLoader.cpp:
696         (WebCore::FrameLoader::load):
697         (WebCore::FrameLoader::loadWithDocumentLoader):
698         (WebCore::FrameLoader::addExtraFieldsToRequest):
699         (WebCore::FrameLoader::loadDifferentDocumentItem):
700         * loader/FrameLoader.h:
701         (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const):
702
703 2019-01-30  Justin Fan  <justin_fan@apple.com>
704
705         [WebGPU] Support GPUDepthStencilStateDescriptor
706         https://bugs.webkit.org/show_bug.cgi?id=194048
707         <rdar://problem/46289645>
708
709         Reviewed by Dean Jackson.
710
711         Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder.
712
713         Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect 
714         without a depth texture attached.
715
716         New interface files added:
717         * Modules/webgpu/GPUCompareFunction.idl:
718         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
719         * platform/graphics/gpu/GPUCompareFunction.h:
720         * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
721
722         Modifications:
723         * Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline.
724         (WebCore::WebGPUDevice::createRenderPipeline const):
725         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor.
726         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
727         * platform/graphics/gpu/GPURenderPipeline.h: Ditto.
728         (WebCore::GPURenderPipeline::depthStencilState const): Getter.
729         (WebCore::GPURenderPipeline::platformRenderPipeline const):
730         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState.
731         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
732         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState.
733         (WebCore::GPURenderPassEncoder::setPipeline):
734         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState.
735         (WebCore::validateAndConvertDepthCompareFunctionToMtl):
736         (WebCore::tryCreateMtlDepthStencilState):
737         (WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create.
738         (WebCore::GPURenderPipeline::create):
739         (WebCore::GPURenderPipeline::GPURenderPipeline):
740
741         Added symbols for CompareFunction, DepthStencilStateDescriptor to the project:
742         * CMakeLists.txt:
743         * DerivedSources.make:
744         * Sources.txt:
745         * WebCore.xcodeproj/project.pbxproj:
746
747         * Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version.
748
749 2019-01-30  Jer Noble  <jer.noble@apple.com>
750
751         [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
752         https://bugs.webkit.org/show_bug.cgi?id=193984
753
754         Reviewed by Eric Carlson.
755
756         MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The
757         KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until
758         after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
759         completion handler is called.
760
761         Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID
762         changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed.
763
764         * Modules/encryptedmedia/MediaKeySession.cpp:
765         (WebCore::MediaKeySession::sessionIdChanged):
766         * Modules/encryptedmedia/MediaKeySession.h:
767         * platform/encryptedmedia/CDMInstanceSession.h:
768         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
769         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
770         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
771
772 2019-01-30  Keith Rollin  <krollin@apple.com>
773
774         FloatWithRect has invalid and inaccessible default constructor
775         https://bugs.webkit.org/show_bug.cgi?id=194057
776         <rdar://problem/47685211>
777
778         Reviewed by Zalan Bujtas.
779
780         FloatWithRect has a default constructor declared as 'default'. This
781         constructor is invalid because FloatWithRect has a data member that's
782         a reference that will not get initialized with this constructor. Since
783         it's invalid, and since it's private and not accessed by anything,
784         remove this constructor.
785
786         No new tests since there should be no observable behavior difference.
787
788         * rendering/line/LineLayoutState.h:
789
790 2019-01-30  Daniel Bates  <dabates@apple.com>
791
792         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
793         https://bugs.webkit.org/show_bug.cgi?id=192824
794         <rdar://problem/47100332>
795
796         Reviewed by Wenson Hsieh.
797
798         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
799         now that hardware key events to non-editable elements use the same code path as for editable elements. 
800
801         * platform/ios/KeyEventIOS.mm:
802         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
803         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
804         (WebCore::isFunctionKey): Ditto.
805         * platform/ios/WebEvent.mm:
806         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
807         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
808
809 2019-01-30  Jer Noble  <jer.noble@apple.com>
810
811         Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
812         https://bugs.webkit.org/show_bug.cgi?id=194063
813
814         Reviewed by Jon Lee.
815
816         * DerivedSources.make:
817
818 2019-01-30  Youenn Fablet  <youenn@apple.com>
819
820         Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe
821         https://bugs.webkit.org/show_bug.cgi?id=193747
822         <rdar://problem/47498196>
823
824         Reviewed by Chris Dumez.
825
826         Make ServiceWorkerJob be no longer ref counted.
827         Instead its lifetime is fully controlled by ServiceWorkerContainer.
828
829         Make sure that a failing load will remove the job from ServiceWorkerContainer job map.
830         This allows to ensure that these jobs do not stay forever.
831         Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful.
832
833         Before the patch, unsetPendingActivity was only called for successful jobs finishing.
834         In case of failing loads, ServiceWorkerContainer would leak.
835         Make sure that setPendingActivity/unsetPendingActivity is balanced by storing
836         a pending activity in the job map next to the job.
837
838         When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess.
839         This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone.
840
841         Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not.
842         Update type of exception to be SecurityError when load fails due to AccessControl.
843
844         Covered by existing tests.
845
846         * workers/service/ServiceWorkerContainer.cpp:
847         (WebCore::ServiceWorkerContainer::addRegistration):
848         (WebCore::ServiceWorkerContainer::removeRegistration):
849         (WebCore::ServiceWorkerContainer::updateRegistration):
850         (WebCore::ServiceWorkerContainer::scheduleJob):
851         (WebCore::ServiceWorkerContainer::jobFailedWithException):
852         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
853         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
854         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
855         (WebCore::ServiceWorkerContainer::jobDidFinish):
856         (WebCore::ServiceWorkerContainer::stop):
857         (WebCore::ServiceWorkerContainer::job):
858         * workers/service/ServiceWorkerContainer.h:
859         * workers/service/ServiceWorkerJob.cpp:
860         (WebCore::ServiceWorkerJob::failedWithException):
861         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
862         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
863         (WebCore::ServiceWorkerJob::startScriptFetch):
864         (WebCore::ServiceWorkerJob::didReceiveResponse):
865         (WebCore::ServiceWorkerJob::notifyFinished):
866         (WebCore::ServiceWorkerJob::cancelPendingLoad):
867         * workers/service/ServiceWorkerJob.h:
868         (WebCore::ServiceWorkerJob::hasPromise const):
869         (WebCore::ServiceWorkerJob::takePromise):
870         * workers/service/ServiceWorkerJobClient.h:
871         * workers/service/server/SWServerJobQueue.cpp:
872         (WebCore::SWServerJobQueue::scriptFetchFinished):
873
874 2019-01-30  Dean Jackson  <dino@apple.com>
875
876         PointerEvents - tiltX and tiltY are reversed
877         https://bugs.webkit.org/show_bug.cgi?id=194032
878         <rdar://problem/47674184>
879
880         Reviewed by Jon Lee.
881
882         I got tiltX and tiltY the wrong way around.
883
884         * dom/ios/PointerEventIOS.cpp: Flip the values.
885
886 2019-01-30  Zalan Bujtas  <zalan@apple.com>
887
888         [LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
889         https://bugs.webkit.org/show_bug.cgi?id=194001
890
891         Reviewed by Antti Koivisto.
892
893         Skip to the next position manually. This is exactly what we do in simple line layout.
894
895         * layout/inlineformatting/InlineRunProvider.cpp:
896         (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
897
898 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
899
900         Add some basic geometry information to the scrolling tree
901         https://bugs.webkit.org/show_bug.cgi?id=194002
902         rdar://problem/47656294
903
904         Reviewed by Antti Koivisto.
905
906         To allow hit-testing in the scrolling tree, store a parent-relative scrollable
907         rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
908         of the scrollable area, and whose origin is relative to the parent scrolling tree node.
909         
910         Frame hosting nodes need this rect because they take care of the geometry offset between
911         an iframe and its scrolling tree ancestor in the parent document.
912         
913         Based on a patch by Frédéric Wang in bug 172917.
914
915         * page/scrolling/AsyncScrollingCoordinator.cpp:
916         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
917         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
918         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
919         (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
920         (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
921         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
922         * page/scrolling/ScrollingStateFrameHostingNode.h:
923         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
924         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
925         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
926         * page/scrolling/ScrollingTreeFrameHostingNode.h:
927         (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
928         * rendering/RenderLayer.h:
929         * rendering/RenderLayerBacking.cpp:
930         (WebCore::RenderLayerBacking::updateScrollingLayers):
931         * rendering/RenderLayerCompositor.cpp:
932         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
933         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
934         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
935         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
936         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
937         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
938         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
939         * rendering/RenderLayerCompositor.h:
940
941 2019-01-30  Zalan Bujtas  <zalan@apple.com>
942
943         [LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
944         https://bugs.webkit.org/show_bug.cgi?id=194020
945
946         Reviewed by Antti Koivisto.
947
948         Check the used margin variables whether we already computed before/after values.
949
950         Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html
951
952         * layout/FormattingContextGeometry.cpp:
953         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
954
955 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
956
957         AX: Support color well on iOS
958         https://bugs.webkit.org/show_bug.cgi?id=194010
959
960         Reviewed by Joanmarie Diggs.
961
962         Test: accessibility/ios-simulator/color-well.html
963
964         Add support for color well on iOS.
965
966         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
967         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
968         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
969         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
970         (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
971         * en.lproj/Localizable.strings:
972         * platform/LocalizedStrings.cpp:
973         (WebCore::AXColorWellText):
974         * platform/LocalizedStrings.h:
975
976 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
977
978         AX: Role=switch not returning correct accessibilityValue
979         https://bugs.webkit.org/show_bug.cgi?id=194006
980
981         Reviewed by Joanmarie Diggs.
982
983         Return the toggle state of a role=switch element.        
984
985         Test: accessibility/ios-simulator/role-switch.html
986
987         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
988         (-[WebAccessibilityObjectWrapper accessibilityValue]):
989
990 2019-01-29  Rob Buis  <rbuis@igalia.com>
991
992         Align with Fetch on data: URLs
993         https://bugs.webkit.org/show_bug.cgi?id=182325
994
995         Reviewed by Alex Christensen.
996
997         Implement most remaining steps for data: URL processing [1].
998         Serialization is still to be implemented.
999
1000         To make the code in DataURLDecoder::parseMediaType more efficient,
1001         refactor ParsedContentType so that validation and parsing is done
1002         in one pass.
1003
1004         Test: web-platform-tests/fetch/data-urls/processing.any.js
1005
1006         [1] https://fetch.spec.whatwg.org/#data-urls
1007
1008         * Modules/encryptedmedia/CDM.cpp:
1009         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
1010         * platform/network/DataURLDecoder.cpp:
1011         (WebCore::DataURLDecoder::parseMediaType):
1012         (WebCore::DataURLDecoder::DecodeTask::process):
1013         * platform/network/MIMEHeader.cpp:
1014         (WebCore::MIMEHeader::parseHeader):
1015         * platform/network/ParsedContentType.cpp:
1016         (WebCore::containsNewline):
1017         (WebCore::ParsedContentType::parseContentType):
1018         (WebCore::ParsedContentType::create):
1019         (WebCore::isValidContentType):
1020         (WebCore::ParsedContentType::ParsedContentType):
1021         (WebCore::DummyParsedContentType::setContentType const): Deleted.
1022         (WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted.
1023         (WebCore::parseContentType): Deleted.
1024         * platform/network/ParsedContentType.h:
1025
1026 2019-01-29  Eric Carlson  <eric.carlson@apple.com>
1027
1028         [MSE] add more source buffer logging
1029         https://bugs.webkit.org/show_bug.cgi?id=193995
1030         <rdar://problem/47650399>
1031
1032         Reviewed by Jon Lee.
1033
1034         No new tests, no functional change.
1035
1036         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1037         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
1038         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
1039         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1040         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1041         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
1042         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
1043
1044 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
1045
1046         Add nodes to the scrolling tree in z-index order.
1047         https://bugs.webkit.org/show_bug.cgi?id=192529
1048         <rdar://problem/47402708>
1049
1050         Reviewed by Dean Jackson.
1051
1052         We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places.
1053         This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer
1054         walks to find them.
1055
1056         With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy()
1057         tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index
1058         (which makes it so that the scrolling tree correctly reflects layer z-order).
1059
1060         The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting
1061         nodes in their parent document.
1062
1063         There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking
1064         was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed()
1065         to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator().
1066
1067         updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1,
1068         and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator.
1069
1070         Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html
1071                scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html
1072
1073         * page/scrolling/ScrollingStateTree.cpp:
1074         (WebCore::ScrollingStateTree::insertNode):
1075         * page/scrolling/ScrollingTreeNode.cpp:
1076         (WebCore::ScrollingTreeNode::~ScrollingTreeNode):
1077         * platform/Logging.cpp:
1078         (WebCore::initializeLogChannelsIfNecessary):
1079         * rendering/RenderLayer.cpp:
1080         (WebCore::RenderLayer::setParent):
1081         (WebCore::RenderLayer::calculateClipRects const):
1082         * rendering/RenderLayerBacking.cpp:
1083         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1084         (WebCore::RenderLayerBacking::willBeDestroyed):
1085         (WebCore::RenderLayerBacking::updateGeometry):
1086         (WebCore::RenderLayerBacking::updateBackgroundLayer):
1087         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
1088         * rendering/RenderLayerBacking.h:
1089         * rendering/RenderLayerCompositor.cpp:
1090         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1091         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
1092         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1093         (WebCore::frameHostingNodeForFrame):
1094         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1095         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1096         (WebCore::RenderLayerCompositor::updateBacking):
1097         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
1098         (WebCore::RenderLayerCompositor::setIsInWindow):
1099         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
1100         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
1101         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
1102         (WebCore::RenderLayerCompositor::attachScrollingNode):
1103         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
1104         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
1105         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
1106         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1107         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
1108         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
1109         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
1110         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
1111         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
1112         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
1113         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer):
1114         (WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer):
1115         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer):
1116         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted.
1117         (WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op.
1118         (WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted.
1119         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now.
1120         (WebCore::canCoordinateScrollingForLayer): Deleted.
1121         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted.
1122         (WebCore::enclosingScrollingNodeID): Deleted.
1123         (WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted.
1124         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted.
1125         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted.
1126         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted.
1127         * rendering/RenderLayerCompositor.h:
1128
1129 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
1130
1131         Make sure we have a frame before trying to access its loader 
1132         https://bugs.webkit.org/show_bug.cgi?id=193985
1133         <rdar://problem/47618239>
1134
1135         Reviewed by Ryosuke Niwa.
1136
1137         * loader/ResourceLoadObserver.cpp:
1138         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1139
1140 2019-01-29  Andy Estes  <aestes@apple.com>
1141
1142         Try to fix the watchOS build.
1143
1144         * dom/Element.cpp:
1145
1146 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
1147
1148         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
1149         https://bugs.webkit.org/show_bug.cgi?id=193907
1150         rdar://problem/47604080
1151
1152         Reviewed by Frédéric Wang.
1153
1154         Recent scrolling tree changes can trigger unparenting and reparenting of subtrees in the
1155         state tree. If a subframe's state tree nodes are unparented, a scrolling tree commit would
1156         show these as nodes being destroyed, which destroyed the tree nodes. When re-parented, the
1157         commit would re-create the tree node, but the state node would only have a subset of the
1158         change flags set, so the new tree node would fail to get all of the state (for example, it
1159         would be missing layers and scrolling geometry).
1160
1161         Fix by ensuring that when we reparent state node subtrees, we set all the change flags
1162         so that the full set of data is sent to the scrolling tree (the UI process, in the case of iOS WK2).
1163         Annoyingly, virtual setAllPropertiesChanged() functions are needed so each state node subclass can
1164         set the right change flags.
1165
1166         This patch also gets rid of m_nodesRemovedSinceLastCommit in the state tree. We can gain the same
1167         information by using copying all of the nodeIDs in m_nodeMap into a HashSet, and removing nodes
1168         as we encounter them in the tree walk.
1169         
1170         Rename m_latchedNode to m_latchedNodeID in ScrollingTree, since it's a nodeID, not a node pointer.
1171
1172         Test: compositing/geometry/composited-frame-contents.html
1173
1174         * page/scrolling/ScrollingStateFixedNode.cpp:
1175         (WebCore::ScrollingStateFixedNode::setAllPropertiesChanged):
1176         * page/scrolling/ScrollingStateFixedNode.h:
1177         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1178         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
1179         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1180         * page/scrolling/ScrollingStateNode.cpp:
1181         (WebCore::ScrollingStateNode::setPropertyChanged):
1182         (WebCore::ScrollingStateNode::setAllPropertiesChanged):
1183         * page/scrolling/ScrollingStateNode.h:
1184         (WebCore::ScrollingStateNode::setPropertyChangedBit):
1185         * page/scrolling/ScrollingStateScrollingNode.cpp:
1186         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
1187         * page/scrolling/ScrollingStateScrollingNode.h:
1188         * page/scrolling/ScrollingStateStickyNode.cpp:
1189         (WebCore::ScrollingStateStickyNode::setAllPropertiesChanged):
1190         * page/scrolling/ScrollingStateStickyNode.h:
1191         * page/scrolling/ScrollingStateTree.cpp:
1192         (WebCore::ScrollingStateTree::insertNode): Add a RELEASE_ASSERT on the type of the node created
1193         if parentID == 0, since mistakes here can associate a ScrollingNodeType::MainFrame node with some
1194         other nodeID which can result in type confusion later.
1195         (WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
1196         (WebCore::ScrollingStateTree::commit):
1197         (WebCore::ScrollingStateTree::willRemoveNode):
1198         (WebCore::ScrollingStateTree::setRemovedNodes): Deleted.
1199         * page/scrolling/ScrollingStateTree.h:
1200         (WebCore::ScrollingStateTree::removedNodes const): Deleted.
1201         * page/scrolling/ScrollingTree.cpp:
1202         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
1203         (WebCore::ScrollingTree::commitTreeState):
1204         (WebCore::ScrollingTree::updateTreeFromStateNode):
1205         (WebCore::ScrollingTree::latchedNode):
1206         (WebCore::ScrollingTree::setLatchedNode):
1207         (WebCore::ScrollingTree::clearLatchedNode):
1208         (WebCore::ScrollingTree::scrollingTreeAsText):
1209         (WebCore::ScrollingTree::removeDestroyedNodes): Deleted.
1210         * page/scrolling/ScrollingTree.h:
1211         (WebCore::ScrollingTree::hasLatchedNode const):
1212         * rendering/RenderLayerCompositor.cpp:
1213         (WebCore::RenderLayerCompositor::ensureRootLayer): The scroll layer needs a 0,0,0 anchor point so that
1214         setting its position doesn't offset it relative to the center.
1215
1216 2019-01-29  Justin Fan  <justin_fan@apple.com>
1217
1218         [WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor
1219         https://bugs.webkit.org/show_bug.cgi?id=193926
1220         <rdar://problem/47327648>
1221
1222         Reviewed by Myles C. Maxfield.
1223
1224         Update vertex input to properly utilize inputSlot and shaderLocation fields, and add some validation.
1225
1226         Test: webgpu/vertex-buffer-triangle-strip.html
1227
1228         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: 
1229         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
1230         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1231         (WebCore::setInputStateForPipelineDescriptor): Properly retain Metal types.
1232         (WebCore::GPURenderPipeline::create): Provide error logging for MTLRenderPipelineState creation.
1233
1234 2019-01-29  Keith Rollin  <krollin@apple.com>
1235
1236         Add .xcfilelists to Run Script build phases
1237         https://bugs.webkit.org/show_bug.cgi?id=193792
1238         <rdar://problem/47201785>
1239
1240         Reviewed by Alex Christensen.
1241
1242         As part of supporting XCBuild, update the necessary Run Script build
1243         phases in their Xcode projects to refer to their associated
1244         .xcfilelist files.
1245
1246         Note that the addition of these files bumps the Xcode project version
1247         number to something that's Xcode 10 compatible. This change means that
1248         older versions of the Xcode IDE can't read these projects. Nor can it
1249         fully load workspaces that refer to these projects (the updated
1250         projects are shown as non-expandable placeholders). `xcodebuild` can
1251         still build these projects; it's just that the IDE can't open them.
1252
1253         Make special accommodations for incorporating .xcfilelists from
1254         WebKitAdditions.
1255
1256         No new tests since there should be no observable behavior difference.
1257
1258         * Configurations/Base.xcconfig:
1259         * Configurations/DebugRelease.xcconfig:
1260         * WebCore.xcodeproj/project.pbxproj:
1261
1262 2019-01-29  John Wilander  <wilander@apple.com>
1263
1264         Add data abstraction and validation for Ad Click Attribution
1265         https://bugs.webkit.org/show_bug.cgi?id=193916
1266         <rdar://problem/47603481>
1267
1268         Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen.
1269
1270         New API tests added.
1271
1272         Ad click attribution has two steps. First, the storage of an ad
1273         campaign ID for a click that takes the user to a destination
1274         site. Second, a conversion on the destination site that can be
1275         attributed to the ad click.
1276
1277         This patch adds a class that represents a request for ad click
1278         attribution. Validation makes sure that the bits of entropy
1279         reported through this mechanism is limited.
1280
1281         This feature is experimental and off by default.
1282
1283         * Sources.txt:
1284             Added loader/AdClickAttribution.cpp.
1285         * WebCore.xcodeproj/project.pbxproj:
1286         * loader/AdClickAttribution.cpp: Added.
1287         (WebCore::AdClickAttribution::isValid const):
1288         (WebCore::AdClickAttribution::setConversion):
1289         (WebCore::AdClickAttribution::url const):
1290         (WebCore::AdClickAttribution::referrer const):
1291         * loader/AdClickAttribution.h: Added.
1292         (WebCore::AdClickAttribution::Campaign::Campaign):
1293         (WebCore::AdClickAttribution::Campaign::isValid const):
1294         (WebCore::AdClickAttribution::Source::Source):
1295         (WebCore::AdClickAttribution::Destination::Destination):
1296         (WebCore::AdClickAttribution::Priority::Priority):
1297         (WebCore::AdClickAttribution::Conversion::Conversion):
1298         (WebCore::AdClickAttribution::Conversion::isValid const):
1299         (WebCore::AdClickAttribution::AdClickAttribution):
1300         (WebCore::AdClickAttribution::earliestTimeToSend const):
1301         * loader/DocumentLoader.cpp:
1302             Added missing #include "RuntimeEnabledFeatures.h".
1303
1304 2019-01-29  Zalan Bujtas  <zalan@apple.com>
1305
1306         [MathML] Move enum class ScriptType to MathMLScriptsElement.
1307         https://bugs.webkit.org/show_bug.cgi?id=193969
1308
1309         Reviewed by Antti Koivisto.
1310
1311         * mathml/MathMLScriptsElement.cpp:
1312         (WebCore::scriptTypeOf):
1313         * mathml/MathMLScriptsElement.h:
1314         * rendering/mathml/RenderMathMLScripts.cpp:
1315         (WebCore::RenderMathMLScripts::scriptType const):
1316         (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
1317         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
1318         (WebCore::RenderMathMLScripts::verticalMetrics):
1319         (WebCore::RenderMathMLScripts::layoutBlock):
1320         * rendering/mathml/RenderMathMLScripts.h:
1321         * rendering/mathml/RenderMathMLUnderOver.cpp:
1322         (WebCore::RenderMathMLUnderOver::isValid const):
1323         (WebCore::RenderMathMLUnderOver::under const):
1324         (WebCore::RenderMathMLUnderOver::over const):
1325         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths):
1326         (WebCore::RenderMathMLUnderOver::hasAccent const):
1327         (WebCore::RenderMathMLUnderOver::layoutBlock):
1328
1329 2019-01-29  Chris Dumez  <cdumez@apple.com>
1330
1331         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
1332         https://bugs.webkit.org/show_bug.cgi?id=193848
1333
1334         Reviewed by Youenn Fablet.
1335
1336         * dom/Document.cpp:
1337         * dom/MessageChannel.cpp:
1338         (WebCore::MessageChannel::MessageChannel):
1339         * dom/ScriptExecutionContext.cpp:
1340         (WebCore::ScriptExecutionContext::contextIdentifier const):
1341         * history/HistoryItem.cpp:
1342         (WebCore::HistoryItem::HistoryItem):
1343         * loader/DocumentLoader.cpp:
1344         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
1345         * page/DOMWindow.cpp:
1346         (WebCore::DOMWindow::DOMWindow):
1347         * platform/Process.cpp:
1348         (WebCore::Process::identifier):
1349         * workers/service/ServiceWorkerJobData.cpp:
1350         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
1351         * workers/service/server/RegistrationDatabase.cpp:
1352         (WebCore::RegistrationDatabase::importRecords):
1353         * workers/service/server/SWServer.cpp:
1354         (WebCore::SWServer::Connection::Connection):
1355         (WebCore::SWServer::updateWorker):
1356         * workers/service/server/SWServerRegistration.cpp:
1357         (WebCore::generateServiceWorkerRegistrationIdentifier):
1358         * workers/service/server/SWServerToContextConnection.cpp:
1359         (WebCore::generateServerToContextConnectionIdentifier):
1360
1361
1362 2019-01-29  Alex Christensen  <achristensen@webkit.org>
1363
1364         Use lambdas instead of member pointer functions for TransactionOperationImpl
1365         https://bugs.webkit.org/show_bug.cgi?id=193933
1366
1367         Reviewed by Tim Horton.
1368
1369         No change in behavior.  This just makes it easier to add new parameters to these functions in a straightforward manner.
1370
1371         * Modules/indexeddb/IDBObjectStore.cpp:
1372         (WebCore::IDBObjectStore::putOrAdd):
1373         * Modules/indexeddb/IDBTransaction.cpp:
1374         (WebCore::IDBTransaction::internalAbort):
1375         (WebCore::IDBTransaction::commit):
1376         (WebCore::IDBTransaction::createObjectStore):
1377         (WebCore::IDBTransaction::renameObjectStore):
1378         (WebCore::IDBTransaction::createIndex):
1379         (WebCore::IDBTransaction::renameIndex):
1380         (WebCore::IDBTransaction::doRequestOpenCursor):
1381         (WebCore::IDBTransaction::iterateCursor):
1382         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
1383         (WebCore::IDBTransaction::requestGetAllIndexRecords):
1384         (WebCore::IDBTransaction::requestGetRecord):
1385         (WebCore::IDBTransaction::requestIndexRecord):
1386         (WebCore::IDBTransaction::requestCount):
1387         (WebCore::IDBTransaction::requestDeleteRecord):
1388         (WebCore::IDBTransaction::requestClearObjectStore):
1389         (WebCore::IDBTransaction::requestPutOrAdd):
1390         (WebCore::IDBTransaction::deleteObjectStore):
1391         (WebCore::IDBTransaction::deleteIndex):
1392         * Modules/indexeddb/IDBTransaction.h:
1393         * Modules/indexeddb/client/TransactionOperation.h:
1394         (WebCore::IDBClient::TransactionOperation::doComplete):
1395         (WebCore::IDBClient::createTransactionOperation): Deleted.
1396
1397 2019-01-29  Zalan Bujtas  <zalan@apple.com>
1398
1399         [LFC][BFC][MarginCollapsing] Remove incorrect downcast<Container>
1400         https://bugs.webkit.org/show_bug.cgi?id=193964
1401
1402         Reviewed by Antti Koivisto.
1403
1404         * layout/blockformatting/BlockMarginCollapse.cpp:
1405         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1406
1407 2019-01-29  Zalan Bujtas  <zalan@apple.com>
1408
1409         [LFC][BFC] Do not ignore next sibling box while laying out BFC.
1410         https://bugs.webkit.org/show_bug.cgi?id=193954
1411
1412         Reviewed by Antti Koivisto.
1413
1414         When a block box has no child (<img style="display: block">), we should not ignore the next sibling (move the container check to the function to keep layout logic simple)
1415         Also inFlowNonReplacedWidthAndMargin() is called through inFlowReplacedWidthAndMargin() to compute margins.
1416
1417         * layout/blockformatting/BlockFormattingContext.cpp:
1418         (WebCore::Layout::BlockFormattingContext::layout const):
1419         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
1420         * layout/blockformatting/BlockFormattingContext.h:
1421         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1422         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1423
1424 2019-01-29  Zalan Bujtas  <zalan@apple.com>
1425
1426         [LFC][BFC][MarginCollapsing] Remove quirk from MarginCollapse::marginsCollapseThrough
1427         https://bugs.webkit.org/show_bug.cgi?id=193948
1428
1429         Reviewed by Antti Koivisto.
1430
1431         This is now implemented in BlockFormattingContext::Quirks::stretchedInFlowHeight().
1432
1433         * layout/blockformatting/BlockMarginCollapse.cpp:
1434         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
1435
1436 2019-01-29  Zalan Bujtas  <zalan@apple.com>
1437
1438         [LFC][BFC][MarginCollapsing] Anonymous block container's margin before does not collapse with previous inflow sibling margin after.
1439         https://bugs.webkit.org/show_bug.cgi?id=193952
1440
1441         Reviewed by Antti Koivisto.
1442
1443         * layout/blockformatting/BlockMarginCollapse.cpp:
1444         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
1445
1446 2019-01-29  Frederic Wang  <fwang@igalia.com>
1447
1448         Allow scrolling tree nodes to exist in a detached state
1449         https://bugs.webkit.org/show_bug.cgi?id=193754
1450
1451         Unreviewed build warning fix.
1452
1453         * page/scrolling/ScrollingStateTree.cpp:
1454         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): Remove
1455         unused variable.
1456
1457 2019-01-28  Ryosuke Niwa  <rniwa@webkit.org>
1458
1459         User agent string override for navigator.userAgent should be site specific quirks
1460         https://bugs.webkit.org/show_bug.cgi?id=193950
1461
1462         Reviewed by Brent Fulgham.
1463
1464         In order to make it possible to toggle the UA string override just for navigator.userAgent via Web Inspector,
1465         we need to put this override behind the site specific quirks. Because WebInspector overrides Page's setting
1466         without updating WKPreferences, there is no way for WKWebView client's to know whether the site specific quirks
1467         had been disabled or not.
1468
1469         * loader/DocumentLoader.h:
1470         (WebCore::DocumentLoader::setCustomJavaScriptUserAgentAsSiteSpecificQuirks):
1471         (WebCore::DocumentLoader::customJavaScriptUserAgentAsSiteSpecificQuirks const):
1472         (WebCore::DocumentLoader::setCustomJavaScriptUserAgent): Deleted.
1473         (WebCore::DocumentLoader::customJavaScriptUserAgent const): Deleted.
1474         * loader/FrameLoader.cpp:
1475         (WebCore::FrameLoader::userAgentForJavaScript const):
1476
1477 2019-01-28  Devin Rousso  <drousso@apple.com>
1478
1479         Web Inspector: provide a way to edit page WebRTC settings on a remote target
1480         https://bugs.webkit.org/show_bug.cgi?id=193863
1481         <rdar://problem/47572764>
1482
1483         Reviewed by Joseph Pecoraro.
1484
1485         Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html
1486               inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
1487
1488         * inspector/agents/InspectorPageAgent.cpp:
1489
1490         * page/Settings.yaml:
1491         * page/SettingsBase.h:
1492         * page/SettingsBase.cpp:
1493         (SettingsBase::iceCandidateFilteringEnabledChanged): Added.
1494         (SettingsBase::mockCaptureDevicesEnabledChanged): Added.
1495         * Scripts/GenerateSettings.rb:
1496         * Scripts/SettingsTemplates/Settings.cpp.erb:
1497         Add page-level settings for WebRTC preferences.
1498
1499         * Modules/mediastream/UserMediaController.cpp:
1500         (WebCore::UserMediaController::canCallGetUserMedia):
1501
1502         * testing/InternalSettings.cpp:
1503         (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
1504
1505         * testing/Internals.h:
1506         * testing/Internals.cpp:
1507         (WebCore::Internals::Internals):
1508         (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
1509         (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added.
1510
1511         * page/DeprecatedGlobalSettings.h:
1512         * page/DeprecatedGlobalSettings.cpp:
1513         (WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted.
1514         (WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted.
1515         (WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted.
1516         (WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted.
1517
1518 2019-01-28  Jer Noble  <jer.noble@apple.com>
1519
1520         webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic.
1521         https://bugs.webkit.org/show_bug.cgi?id=193923
1522         <rdar://problem/45956595>
1523
1524         Reviewed by Eric Carlson.
1525
1526         The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled
1527         and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue
1528         setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop.
1529
1530         * html/HTMLMediaElement.cpp:
1531         (WebCore::HTMLMediaElement::clearMediaPlayer):
1532         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
1533         (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
1534         (WebCore::HTMLMediaElement::dispatchEvent):
1535         * html/HTMLMediaElement.h:
1536
1537 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
1538
1539         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
1540         https://bugs.webkit.org/show_bug.cgi?id=193941
1541
1542         Reviewed by Alex Christensen.
1543
1544         * css/CSSBasicShapes.cpp:
1545         * css/CSSPrimitiveValue.cpp:
1546         * css/parser/CSSParser.cpp:
1547         * css/parser/CSSParserSelector.cpp:
1548         * css/parser/CSSPropertyParser.cpp:
1549         * dom/Document.cpp:
1550         * dom/EventListenerMap.cpp:
1551         * dom/EventTarget.cpp:
1552         * editing/Editor.cpp:
1553         * html/HTMLElement.cpp:
1554         * html/HTMLFontElement.cpp:
1555         * html/parser/HTMLTokenizer.cpp:
1556         * html/track/TrackBase.cpp:
1557         * loader/FTPDirectoryParser.cpp:
1558         * loader/TextResourceDecoder.cpp:
1559         * loader/cache/CachedResource.cpp:
1560         * page/ContextMenuController.cpp:
1561         * page/Navigator.cpp:
1562         * platform/Length.cpp:
1563         * platform/cocoa/KeyEventCocoa.mm:
1564         * platform/graphics/FontCascade.cpp:
1565         * platform/graphics/WidthIterator.cpp:
1566         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1567         * platform/ios/KeyEventIOS.mm:
1568         * platform/mac/KeyEventMac.mm:
1569         * platform/network/HTTPParsers.cpp:
1570         * platform/text/TextCodecUTF8.cpp:
1571         * platform/text/TextEncodingRegistry.cpp:
1572         * platform/win/KeyEventWin.cpp:
1573         * rendering/BidiRun.cpp:
1574         * rendering/FloatingObjects.cpp:
1575         * rendering/RenderBlock.cpp:
1576         * rendering/RenderListMarker.cpp:
1577         * rendering/RenderText.cpp:
1578
1579 2019-01-28  Fujii Hironori  <Hironori.Fujii@sony.com>
1580
1581         [Win] WebCore/platform/Process.h is conflicting with process.h
1582         https://bugs.webkit.org/show_bug.cgi?id=193944
1583
1584         Reviewed by Ross Kirsling.
1585
1586         Windows has process.h. Rename Process.h to ProcessIdentifier.h.
1587
1588         No new tests because there is no behavior change.
1589
1590         * Sources.txt:
1591         * UnifiedSources-input.xcfilelist:
1592         * WebCore.xcodeproj/project.pbxproj:
1593         * dom/MessagePortIdentifier.h:
1594         * dom/messageports/MessagePortChannel.h:
1595         * dom/messageports/MessagePortChannelProvider.h:
1596         * dom/messageports/MessagePortChannelRegistry.h:
1597         * history/BackForwardItemIdentifier.h:
1598         * page/GlobalWindowIdentifier.h:
1599         * platform/ProcessIdentifier.cpp: Renamed from Source/WebCore/platform/Process.cpp.
1600         (WebCore::Process::setIdentifier):
1601         (WebCore::Process::identifier):
1602         * platform/ProcessIdentifier.h: Renamed from Source/WebCore/platform/Process.h.
1603
1604 2019-01-28  Antoine Quint  <graouts@apple.com>
1605
1606         Implement capture for Pointer Events on iOS
1607         https://bugs.webkit.org/show_bug.cgi?id=193917
1608         <rdar://problem/47605689>
1609
1610         Reviewed by Dean Jackson.
1611
1612         We add a new PointerCaptureController object which gets notified upon dispatch of pointer events
1613         to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events,
1614         and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and
1615         releasePointerCapture().
1616
1617         Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
1618                pointerevents/ios/pointer-events-implicit-capture-release-exception.html
1619                pointerevents/ios/pointer-events-implicit-capture-release.html
1620                pointerevents/ios/pointer-events-implicit-capture.html
1621                pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html
1622
1623         * Sources.txt:
1624         * WebCore.xcodeproj/project.pbxproj:
1625         * dom/Element.cpp:
1626         (WebCore::Element::setPointerCapture):
1627         (WebCore::Element::releasePointerCapture):
1628         (WebCore::Element::hasPointerCapture):
1629         * dom/Element.h:
1630         * dom/Element.idl:
1631         * dom/EventNames.h:
1632         * dom/PointerEvent.h:
1633         * page/Page.cpp:
1634         (WebCore::Page::Page):
1635         * page/Page.h:
1636         (WebCore::Page::pointerCaptureController const):
1637         * page/PointerCaptureController.cpp: Added.
1638         (WebCore::PointerCaptureController::PointerCaptureController):
1639         (WebCore::PointerCaptureController::setPointerCapture):
1640         (WebCore::PointerCaptureController::releasePointerCapture):
1641         (WebCore::PointerCaptureController::hasPointerCapture):
1642         (WebCore::PointerCaptureController::pointerLockWasApplied):
1643         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
1644         (WebCore::PointerCaptureController::pointerEventWillBeDispatched):
1645         (WebCore::PointerCaptureController::pointerEventWasDispatched):
1646         (WebCore::PointerCaptureController::processPendingPointerCapture):
1647         * page/PointerCaptureController.h: Added.
1648         * page/PointerLockController.cpp:
1649         (WebCore::PointerLockController::requestPointerLock):
1650         * page/PointerLockController.h:
1651
1652 2019-01-28  Andy Estes  <aestes@apple.com>
1653
1654         [watchOS] Enable Parental Controls content filtering
1655         https://bugs.webkit.org/show_bug.cgi?id=193939
1656         <rdar://problem/46641912>
1657
1658         Reviewed by Ryosuke Niwa.
1659
1660         * Configurations/FeatureDefines.xcconfig:
1661
1662 2019-01-28  Dean Jackson  <dino@apple.com>
1663
1664         Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
1665         https://bugs.webkit.org/show_bug.cgi?id=193945
1666         <rdar://problem/47618922>
1667
1668         Reviewed by Antoine Quint.
1669
1670         Calculate the pressure, tiltX and tiltY values for incoming
1671         Pointer Events, which have values when the PlatformTouchEvent
1672         originated from a stylus.
1673
1674         Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html
1675
1676         * dom/PointerEvent.h: Default to "mouse".
1677         * dom/ios/PointerEventIOS.cpp: Calculate the values.
1678
1679 2019-01-28  Timothy Hatcher  <timothy@apple.com>
1680
1681         Make it easier for non-Apple ports to enable dark mode CSS support.
1682         https://bugs.webkit.org/show_bug.cgi?id=193882
1683
1684         Reviewed by Megan Gardner.
1685
1686         * page/FrameView.cpp:
1687         (WebCore::FrameView::updateBackgroundRecursively): Limit use of system
1688         background color to the Mac platform.
1689         * rendering/RenderTheme.cpp:
1690         (WebCore::RenderTheme::purgeCaches): Purge m_darkColorCache.
1691         (WebCore::RenderTheme::platformColorsDidChange): Reset m_darkColorCache.
1692         (WebCore::RenderTheme::colorCache const): Added m_darkColorCache.
1693         * rendering/RenderTheme.h:
1694         (WebCore::RenderTheme::colorCache const): Deleted.
1695         * rendering/RenderThemeMac.h:
1696         * rendering/RenderThemeMac.mm:
1697         (WebCore::RenderThemeMac::purgeCaches): Removed m_darkColorCache.
1698         (WebCore::RenderThemeMac::platformColorsDidChange): Deleted.
1699         (WebCore::RenderThemeMac::colorCache const): Deleted.
1700
1701 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
1702
1703         svg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree::unparentChildrenAndDestroyNode()
1704         https://bugs.webkit.org/show_bug.cgi?id=193930
1705
1706         Reviewed by Tim Horton.
1707
1708         ScrollingStateTree::unparentChildrenAndDestroyNode() should make a copy of the 'children' vector
1709         before iterating, since iteration mutates the array.
1710
1711         Tested by ASan tests.
1712
1713         * page/scrolling/ScrollingStateNode.h:
1714         (WebCore::ScrollingStateNode::takeChildren):
1715         * page/scrolling/ScrollingStateTree.cpp:
1716         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
1717
1718 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
1719
1720         css3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateNode::ScrollingStateNode
1721         https://bugs.webkit.org/show_bug.cgi?id=193925
1722
1723         Reviewed by Tim Horton.
1724
1725         Some css3/filters/ tests disable accelerated compositing (which is crazy). Make these
1726         tests not crash by ensuring that unparentNode() and unparentChildrenAndDestroyNode() clears the root
1727         node if it's the node being unparented or destroyed.
1728
1729         Tested by existing tests.
1730
1731         * page/scrolling/ScrollingStateTree.cpp:
1732         (WebCore::ScrollingStateTree::unparentNode):
1733         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
1734
1735 2019-01-28  Daniel Bates  <dabates@apple.com>
1736
1737         [iOS] Make Window virtual key code computation match Mac
1738         https://bugs.webkit.org/show_bug.cgi?id=193452
1739
1740         Reviewed by Ryosuke Niwa.
1741
1742         Use the same approach for computing the Windows virtual key code on iOS as we do on Mac for
1743         web compatibility. On Mac, we prefer to compute the  Windows virtual key code from the input
1744         strings of the key event and use the key event's keycode as a last resort.
1745
1746         Test: fast/events/ios/key-events-meta-alt-combinations.html
1747
1748         * platform/ios/PlatformEventFactoryIOS.h:
1749         * platform/ios/PlatformEventFactoryIOS.mm:
1750         (WebCore::isKeypadEvent): Added.
1751         (WebCore::windowsKeyCodeForKeyEvent): Added.
1752         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Modified to call
1753         WebCore::windowsKeyCodeForKeyEvent() to compute the Windows virtual key code.
1754
1755 2019-01-28  Antoine Quint  <graouts@apple.com>
1756
1757         Limit user-agent interactions based on the touch-action property on iOS
1758         https://bugs.webkit.org/show_bug.cgi?id=193447
1759
1760         Unreviewed build fix.
1761
1762         * dom/Element.cpp:
1763         (WebCore::parentCrossingFrameBoundaries):
1764
1765 2019-01-28  Eric Carlson  <eric.carlson@apple.com>
1766
1767         AVStreamSession isn't always available, make a HAVE compile flag for it
1768         https://bugs.webkit.org/show_bug.cgi?id=193889
1769         <rdar://problem/47452863>
1770
1771         Reviewed by Jer Noble.
1772
1773         No new tests, no functional change.
1774
1775         * page/Settings.yaml:
1776         * page/SettingsBase.cpp:
1777         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
1778         * page/SettingsBase.h:
1779         * page/cocoa/SettingsBaseCocoa.mm:
1780         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
1781         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1782         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
1783         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1784         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1785
1786         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1787         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1788         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging.
1789         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1790
1791         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1792         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1793         
1794         Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC.
1795
1796         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo
1797         -> isEqualToString.
1798         (WebCore::sourceBufferMap):
1799         (WebCore::nextMapID):
1800         (WebCore::bufferWasConsumedCallback):
1801         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1802         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
1803         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
1804         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1805         (WebCore::SourceBufferPrivateAVFObjC::append):
1806         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
1807         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
1808         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1809         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
1810         (-[WebBufferConsumedContext initWithParent:]): Deleted.
1811         (-[WebBufferConsumedContext parent]): Deleted.
1812
1813 2019-01-28  Rob Buis  <rbuis@igalia.com>
1814
1815         Update MIME type parser
1816         https://bugs.webkit.org/show_bug.cgi?id=180526
1817
1818         Reviewed by Frédéric Wang.
1819
1820         I overlooked step 11.9.3 [1], for Mimesniff we should not
1821         bail out on missing subtype, but keep trying. Note
1822         that Rfc2045 does require bailing out, as before.
1823
1824         Test: ParsedContentType unittest
1825
1826         [1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type
1827
1828         * platform/network/ParsedContentType.cpp:
1829         (WebCore::parseToken):
1830         (WebCore::parseContentType):
1831
1832 2019-01-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1833
1834         Unreviewed follow-up to r240557, restore a call to makeString
1835         https://bugs.webkit.org/show_bug.cgi?id=192742
1836         <rdar://problem/46757369>
1837
1838         It works if we add this #include that was missing. I got confused by the error messages and
1839         missed that there were two similarly-named headers.
1840
1841         * rendering/RenderLayerCompositor.cpp:
1842         (WebCore::RenderLayerCompositor::logLayerInfo):
1843
1844 2019-01-28  Oriol Brufau  <obrufau@igalia.com>
1845
1846         [css-logical] Reject unitless length quirk in 'inset' shorthand
1847         https://bugs.webkit.org/show_bug.cgi?id=193773
1848
1849         Reviewed by Manuel Rego Casasnovas.
1850
1851         Even though its longhands ('top', 'right', 'bottom', 'left') accept the
1852         unitless length quirk, the 'inset' shorthand is a new CSS property and
1853         should reject it. This was resolved by the CSS WG in
1854         https://github.com/w3c/csswg-drafts/issues/3525#issuecomment-456902648
1855
1856         Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html
1857                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002.html
1858                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html
1859                imported/w3c/web-platform-tests/quirks/unitless-length/limited-quirks.html
1860                imported/w3c/web-platform-tests/quirks/unitless-length/no-quirks.html
1861                imported/w3c/web-platform-tests/quirks/unitless-length/quirks.html
1862
1863         * css/parser/CSSPropertyParser.cpp:
1864         (WebCore::CSSPropertyParser::parseSingleValue):
1865
1866 2019-01-28  Zalan Bujtas  <zalan@apple.com>
1867
1868         [LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin collapsing
1869         https://bugs.webkit.org/show_bug.cgi?id=193896
1870
1871         Reviewed by Antti Koivisto.
1872
1873         This patch implements quirk margin value collapsing. There are a few "quirk" rules when it comes to margin collapsing.
1874
1875         1. Collapsed quirk margin values are ignored on quirk containers
1876
1877             <body>
1878               <p> p elements have 1em vertical (top/bottom) quirk margin
1879             </body>
1880
1881             In quirk mode, <p> and <body> (quirk container) collapses their vertical margins but <p>'s quirk values(1qem -> 16px) are ignored.
1882             Used vertical margin values on the <body> are top: 8px bottom: 8px.
1883
1884         2. Quirk margin values are turned into non-quirk values when collapsed with non-zero, non-quirk margins.
1885
1886             <body>
1887               <div style="margin-top: 1px">
1888                 <p> p elements have 1em vertical (top/bottom) quirk margin
1889               </div>
1890             </body>
1891
1892             When <p>'s vertical margin collapses with the parent <div>,
1893             - the collapsed before value becomes 16px (max(1qem, 1px)) and this collapsed value is now considered as a non-quirk value
1894             - the collapsed after value stays 1qem quirk value.
1895
1896             When <div> collapses with <body>
1897             - the collapsed before value becomes 16px (max(16px, 8px))
1898             - the <div>'s quirk after value gets ignored and the collapsed after value stays 8px.
1899             Used vertical margin values on the <body> are top: 16px (1em) bottom: 8px.
1900
1901         * layout/MarginTypes.h:
1902         (WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const):
1903         * layout/blockformatting/BlockFormattingContext.h:
1904         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1905         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin):
1906         (WebCore::Layout::hasMarginBeforeQuirkValue): Deleted.
1907         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): Deleted.
1908         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter): Deleted.
1909         * layout/blockformatting/BlockMarginCollapse.cpp:
1910         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
1911         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
1912         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
1913         (WebCore::Layout::computedPositiveAndNegativeMargin):
1914         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1915         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
1916
1917 2019-01-28  Zalan Bujtas  <zalan@apple.com>
1918
1919         [LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition
1920         https://bugs.webkit.org/show_bug.cgi?id=193872
1921
1922         Reviewed by Antti Koivisto.
1923
1924         This is taken care of by verticalPositionWithMargin() in BlockFormattingContext::computeHeightAndMargin(). 
1925
1926         * layout/blockformatting/BlockFormattingContext.cpp:
1927         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1928
1929 2019-01-28  cathie chen  <cathiechen@igalia.com>
1930
1931         Add missing #include in ScrollingTreeFrameScrollingNode.cpp
1932         https://bugs.webkit.org/show_bug.cgi?id=193905
1933
1934         Reviewed by Frédéric Wang.
1935
1936         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add
1937         #include "ScrollingStateFrameScrollingNode.h"
1938
1939 2019-01-28  Zalan Bujtas  <zalan@apple.com>
1940
1941         [LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
1942         https://bugs.webkit.org/show_bug.cgi?id=193894
1943
1944         Reviewed by Antti Koivisto.
1945
1946         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1947         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1948
1949 2019-01-28  Antoine Quint  <graouts@apple.com>
1950
1951         Limit user-agent interactions based on the touch-action property on iOS
1952         https://bugs.webkit.org/show_bug.cgi?id=193447
1953         <rdar://problem/47283874>
1954
1955         Reviewed by Antti Koivisto and Simon Fraser.
1956
1957         We now compile a list of elements with a non-auto touch-action property that is updated whenever an element has its style changed
1958         or is removed from its document. When the content of that list changes, we inform the scrolling coordinator such that it can compile
1959         a list of TouchActionData structures which hold the touch-action value, the ID of the nearest scroll node and the Region containing
1960         the bounds of each of those elements to send it up to the UI process along with touch regions. Computing the list of allowed touch
1961         actions for a given element accounts for not only the value specified directly on that element's style, but also in its hierarchy,
1962         crossing any frame boundary towards the top-level document's root node.
1963
1964         Tests: pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
1965                pointerevents/ios/touch-action-none-on-iframe.html
1966                pointerevents/ios/touch-action-none-on-parent.html
1967                pointerevents/ios/touch-action-none.html
1968                pointerevents/ios/touch-action-pan-x-pan-y.html
1969                pointerevents/ios/touch-action-pan-x.html
1970                pointerevents/ios/touch-action-pan-y.html
1971                pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html
1972                pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html
1973
1974         * WebCore.xcodeproj/project.pbxproj: Update how certain headers are exposed such that they can be used from WebKit.
1975         * dom/Document.cpp:
1976         (WebCore::Document::invalidateRenderingDependentRegions):
1977         (WebCore::Document::nodeWillBeRemoved): Ensure a node that is being removed from this document is no longer listed in its
1978         list of elements with a non-auto touch-action property.
1979         (WebCore::Document::absoluteEventRegionForNode):
1980         (WebCore::Document::absoluteRegionForEventTargets):
1981         (WebCore::Document::updateTouchActionElements): Create a list of elements with a non-auto touch-action property if one doesn't
1982         exist yet and update it to add the given element if it contains a non-auto touch-action, or remove it if it doesn't. If the contents
1983         of that list changed as a result, the scrolling coordinator is informed.
1984         * dom/Document.h:
1985         (WebCore::Document:: const):
1986         * dom/Element.cpp:
1987         (WebCore::parentCrossingFrameBoundaries):
1988         (WebCore::Element::computedTouchActions const): Provide the list of allowed touch actions accounting for the "touch-action" property
1989         specified on this element and all of its hierarchy, crossing frame boundary.
1990         (WebCore::Element::nearestScrollingNodeIDUsingTouchOverflowScrolling const): Provide the ScrollingNodeID, if any, for the nearest scrolling node
1991         for that element. This will allow the UI process to identify which scroll view's behavior to customize to reflect the element's allowed
1992         touch actions.
1993         * dom/Element.h:
1994         * page/scrolling/ScrollingCoordinator.cpp:
1995         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): Compute the region for all elements with a non-auto touch-action property
1996         throughout the provided frame and all of its subframes.
1997         * page/scrolling/ScrollingCoordinator.h:
1998         (WebCore::ScrollableAreaParameters::operator== const): Deleted.
1999         * page/scrolling/ScrollingCoordinatorTypes.h: Added.
2000         (WebCore::ScrollableAreaParameters::operator== const):
2001         * page/scrolling/ScrollingTree.cpp:
2002         (WebCore::ScrollingTree::touchActionDataAtPoint const): Query the list of TouchActionData objects for a match based on the provided point. Right
2003         now the logic is pretty crude, stopping at the first TouchActionData for which the region contains the provided point, but future patches will
2004         account for overlap and nesting.
2005         * page/scrolling/ScrollingTree.h:
2006         * page/scrolling/ScrollingTreeNode.h:
2007         * platform/EventTrackingRegions.cpp:
2008         (WebCore::operator==):
2009         * platform/EventTrackingRegions.h:
2010         (WebCore::operator!=):
2011         * style/StyleTreeResolver.cpp:
2012         (WebCore::Style::TreeResolver::resolveElement): Update the list of elements with a non-auto touch-action property when an element's style changes.
2013
2014 2019-01-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2015
2016         Unreviewed, fix WPE/GTK debug builds after r240557
2017         https://bugs.webkit.org/show_bug.cgi?id=192742
2018         <rdar://problem/46757369>
2019
2020         Also fix an improper format string that was recently added in a different commit.
2021
2022         * rendering/RenderLayerCompositor.cpp:
2023         (WebCore::RenderLayerCompositor::logLayerInfo):
2024         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
2025
2026 2018-12-15  Darin Adler  <darin@apple.com>
2027
2028         Replace many uses of String::format with more type-safe alternatives
2029         https://bugs.webkit.org/show_bug.cgi?id=192742
2030
2031         Reviewed by Mark Lam.
2032
2033         A while back, String::format was more efficient than string concatenation,
2034         but that is no longer true, and we should prefer String::number, makeString,
2035         or concatenation with the "+" operator to String::format for new code.
2036
2037         This is not as good for programmers who are fond of printf formatting
2038         style, and in some cases it's a little harder to read the strings
2039         interspersed with variables rather than a format string, but it's better
2040         in a few ways:
2041
2042         - more efficient (I didn't measure the difference, but it's definitely
2043           slower to use String::Format which calls vsnprintf twice than to use
2044           the WTF code)
2045         - works in a type-safe way without a need to use a format specifier such
2046           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
2047           subtle differences between platforms
2048         - allows us to use StringView in some cases to sidestep the need to
2049           allocate temporary WTF::String objects
2050         - does not require converting each WTF::String to a C string, allowing
2051           us to remove many cases of ".utf8().data()" and similar expressions,
2052           eliminating the allocation of temporary WTF::CString objects
2053
2054         This patch covers a batch of easiest-to-convert call sites.
2055         Later patches will allow us to deprecate or remove String::format.
2056
2057         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2058         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
2059         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
2060         (WebCore::IDBCursorInfo::loggingString const): Ditto.
2061         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
2062         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
2063         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
2064         (WebCore::IDBGetRecordData::loggingString const): Ditto.
2065         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
2066         (WebCore::IDBIndexInfo::loggingString const): Ditto.
2067         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
2068         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
2069         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
2070         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
2071         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
2072         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2073         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
2074         * Modules/webdatabase/Database.cpp:
2075         (WebCore::formatErrorMessage): Ditto.
2076         * Modules/webdatabase/SQLError.h:
2077         (WebCore::SQLError::create): Ditto.
2078
2079         * bindings/scripts/CodeGeneratorJS.pm:
2080         (GenerateImplementation): Use makeString.
2081
2082         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2083         * bindings/scripts/test/JS/JSMapLike.cpp:
2084         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2085         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2086         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2087         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2088         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2089         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2090         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2091         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2092         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2093         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2094         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2095         * bindings/scripts/test/JS/JSTestException.cpp:
2096         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2097         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2098         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2099         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2100         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2101         * bindings/scripts/test/JS/JSTestInterface.cpp:
2102         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2103         * bindings/scripts/test/JS/JSTestIterable.cpp:
2104         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2105         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2106         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2107         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2108         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2109         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2110         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2111         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2112         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2113         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2114         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2115         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2116         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2117         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2118         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2119         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2120         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2121         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2122         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2123         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2124         * bindings/scripts/test/JS/JSTestNode.cpp:
2125         * bindings/scripts/test/JS/JSTestObj.cpp:
2126         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2127         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2128         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2129         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2130         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2131         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2132         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2133         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2134         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2135         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2136         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2137         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2138         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2139         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2140         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2141         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2142         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2143         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2144         Updated expected results.
2145 :
2146         * css/parser/CSSPropertyParserHelpers.cpp:
2147         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
2148         and makeString.
2149
2150         * html/HTMLSelectElement.cpp:
2151         (WebCore::HTMLSelectElement::setLength): Use makeString.
2152         * html/ImageDocument.cpp:
2153         (WebCore::ImageDocument::imageUpdated): Ditto.
2154         * html/parser/XSSAuditor.cpp:
2155         (WebCore::XSSAuditor::init): Ditto.
2156         * inspector/InspectorFrontendClientLocal.cpp:
2157         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
2158         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
2159         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
2160         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
2161         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
2162         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
2163         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
2164         * page/MemoryRelease.cpp:
2165         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
2166
2167         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2168         (WebCore::formatByteNumber): Use String::number.
2169         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
2170
2171         * page/cocoa/ResourceUsageThreadCocoa.mm:
2172         (WebCore::logFootprintComparison): Use makeString.
2173         * platform/animation/TimingFunction.cpp:
2174         (WebCore::TimingFunction::cssText const): Ditto.
2175
2176         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2177         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
2178         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
2179         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
2180
2181         * platform/graphics/ca/GraphicsLayerCA.cpp:
2182         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
2183         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
2184         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
2185         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
2186         * platform/mock/MockRealtimeVideoSource.cpp:
2187         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
2188
2189         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
2190
2191         * platform/network/ParsedContentRange.cpp:
2192         (WebCore::ParsedContentRange::headerValue const): Use makeString.
2193
2194         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
2195         compiler conditionals and reorganized the start/stop of namespaces.
2196         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
2197
2198         * platform/sql/SQLiteDatabase.cpp:
2199         (WebCore::unauthorizedSQLFunction): Use makeString.
2200         * rendering/RenderLayerCompositor.cpp:
2201         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
2202         * workers/service/server/RegistrationDatabase.cpp:
2203         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
2204         (WebCore::RegistrationDatabase::importRecords): Ditto.
2205
2206 2019-01-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2207
2208         Remove a couple of PLATFORM defines intended for watchOS
2209         https://bugs.webkit.org/show_bug.cgi?id=193888
2210
2211         Reviewed by Alexey Proskuryakov.
2212
2213         Remove the use of !PLATFORM(WATCH), since this is true on every platform.
2214
2215         * editing/cocoa/DictionaryLookup.mm:
2216
2217 2019-01-27  Jiewen Tan  <jiewen_tan@apple.com>
2218
2219         Use a load optimizer for some sites
2220         https://bugs.webkit.org/show_bug.cgi?id=193881
2221         <rdar://problem/46325455>
2222
2223         Reviewed by Brent Fulgham.
2224
2225         Expose FormData::flatten to be used by the load optimizer.
2226
2227         * WebCore.xcodeproj/project.pbxproj:
2228         * platform/network/FormData.h:
2229
2230 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
2231
2232         Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
2233         https://bugs.webkit.org/show_bug.cgi?id=193879
2234
2235         Reviewed by Antti Koivisto.
2236
2237         Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
2238         This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
2239         makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
2240         updates of the scrolling tree node in an iframe.
2241         
2242         To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
2243         nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
2244         simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
2245         connect GraphicsLayers together.
2246         
2247         RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.
2248
2249         Tested by existing tests.
2250
2251         * page/FrameView.h:
2252         * rendering/RenderLayer.cpp:
2253         (WebCore::outputPaintOrderTreeRecursive):
2254         * rendering/RenderLayerBacking.cpp:
2255         (WebCore::RenderLayerBacking::updateConfiguration):
2256         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2257         * rendering/RenderLayerCompositor.cpp:
2258         (WebCore::frameContentsRenderView):
2259         (WebCore::RenderLayerCompositor::frameContentsCompositor):
2260         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2261         (WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
2262         (WebCore::RenderLayerCompositor::detachRootLayer):
2263         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
2264         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
2265         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
2266         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
2267         (WebCore::RenderLayerCompositor::attachScrollingNode):
2268         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
2269         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2270         * rendering/RenderLayerCompositor.h:
2271         * testing/Internals.cpp:
2272         (WebCore::Internals::scrollingStateTreeAsText const):
2273
2274 2019-01-27  Chris Fleizach  <cfleizach@apple.com>
2275
2276         AX: Introduce a static accessibility tree
2277         https://bugs.webkit.org/show_bug.cgi?id=193348
2278         <rdar://problem/47203295>
2279
2280         Reviewed by Ryosuke Niwa.
2281
2282         In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which 
2283         could be accessed on a different thread by assistive technologies.
2284         That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the 
2285         "live" AccessibilityObjects (which interact with both DOM and Render trees).
2286         These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree 
2287         representation and able to be read from anywhere.
2288         Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared 
2289         with AccessibilityObject.
2290         This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization.
2291
2292         * CMakeLists.txt:
2293         * Configurations/FeatureDefines.xcconfig:
2294         * Sources.txt:
2295         * WebCore.xcodeproj/project.pbxproj:
2296         * accessibility/AXObjectCache.cpp:
2297         (WebCore::AXObjectCache::remove):
2298         (WebCore::AXObjectCache::createIsolatedAccessibilityTree):
2299         (WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded):
2300         * accessibility/AXObjectCache.h:
2301         * accessibility/AccessibilityObject.h:
2302         * accessibility/AccessibilityObjectInterface.h: Added.
2303         * accessibility/isolatedtree: Added.
2304         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
2305         (WebCore::AXIsolatedTree::treeCache):
2306         (WebCore::AXIsolatedTree::AXIsolatedTree):
2307         (WebCore::AXIsolatedTree::create):
2308         (WebCore::AXIsolatedTree::treeForID):
2309         (WebCore::AXIsolatedTree::treeForPageID):
2310         (WebCore::AXIsolatedTree::nodeForID const):
2311         (WebCore::AXIsolatedTree::rootNode):
2312         (WebCore::AXIsolatedTree::removeNode):
2313         (WebCore::AXIsolatedTree::appendNodeChanges):
2314         (WebCore::AXIsolatedTree::applyPendingChanges):
2315         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
2316         (WebCore::AXIsolatedTree::treeIdentifier const):
2317         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
2318             To note: we don't mark the attribute map const because even though attributes don't change after initial creation,
2319             we may copy an existing node and replace specific values.
2320         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
2321         (WebCore::AXIsolatedTreeNode::create):
2322         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
2323         (WebCore::AXIsolatedTreeNode::setProperty):
2324         (WebCore::AXIsolatedTreeNode::doubleAttributeValue const):
2325         (WebCore::AXIsolatedTreeNode::unsignedAttributeValue const):
2326         (WebCore::AXIsolatedTreeNode::boolAttributeValue const):
2327         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
2328         (WebCore::AXIsolatedTreeNode::intAttributeValue const):
2329         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
2330         * accessibility/mac/AXObjectCacheMac.mm:
2331         (WebCore::AXObjectCache::associateIsolatedTreeNode):
2332         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2333         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2334         (-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
2335         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
2336         (-[WebAccessibilityObjectWrapperBase detach]):
2337         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
2338         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
2339         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
2340         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2341         (-[WebAccessibilityObjectWrapper role]):
2342         (-[WebAccessibilityObjectWrapper subrole]):
2343         (-[WebAccessibilityObjectWrapper roleDescription]):
2344         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2345         * dom/Document.cpp:
2346         (WebCore::Document::pageID const):
2347         * dom/Document.h:
2348
2349 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
2350
2351         Allow scrolling tree nodes to exist in a detached state
2352         https://bugs.webkit.org/show_bug.cgi?id=193754
2353
2354         Reviewed by Zalan Bujtas.
2355
2356         One of the (questionable?) design decisions of the scrolling tree is that the tree implementation
2357         is hidden behind the ScrollingCoordinator interface. That interface only allowed nodes to exist
2358         in a connected state; attachToStateTree() required a non-zero parent for any node that was not
2359         the root.
2360
2361         This makes it impossible to coordinate the hookup of the scrolling tree across frame boundaries;
2362         the scrolling tree has to have been fully constructed in ancestor frames before subframe nodes
2363         can be attached. This is a significant difference from compositing, where a subframe can create
2364         GraphicsLayers which don't have to be parented right away, and actually get parented later via
2365         a compositing update in the parent frame.
2366
2367         We want to be able to hook up the scrolling tree via the same code paths as GraphicsLayer
2368         connection (anything else is too confusing). So we need to be able to instantiate scrolling
2369         tree nodes in a disconnected state, and attach them later.
2370
2371         To achieve this, add the notion of "unparented" nodes to ScrollingCoordinator and the ScrollingStateTree.
2372         Allow clients to create unparented nodes, which can be attached later. ScrollingCoordinator stores
2373         the roots of unparented subtrees in an owning HashMap. Nodes in unparented trees are still referenced
2374         by m_stateNodeMap, so it's possible to find them and set state on them.
2375
2376         Clean up the ScrollingCoordinator interface to remove "state tree" terminology; the state vs. scrolling tree
2377         is really an implementation detail.
2378
2379         This also removes the special-casing of ScrollingNodeType::Subframe nodes which ScrollingStateTree stored
2380         in m_orphanedSubframeNodes; now the unparenting is controlled by the client.
2381
2382         Currently no code creates unparented nodes so there is no behavior change.
2383
2384         * dom/Document.cpp:
2385         (WebCore::Document::setPageCacheState):
2386         * page/scrolling/AsyncScrollingCoordinator.cpp:
2387         (WebCore::AsyncScrollingCoordinator::createNode):
2388         (WebCore::AsyncScrollingCoordinator::insertNode):
2389         (WebCore::AsyncScrollingCoordinator::unparentNode):
2390         (WebCore::AsyncScrollingCoordinator::unparentChildrenAndDestroyNode):
2391         (WebCore::AsyncScrollingCoordinator::detachAndDestroySubtree):
2392         (WebCore::AsyncScrollingCoordinator::clearAllNodes):
2393         (WebCore::AsyncScrollingCoordinator::parentOfNode const):
2394         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2395         (WebCore::AsyncScrollingCoordinator::attachToStateTree): Deleted.
2396         (WebCore::AsyncScrollingCoordinator::detachFromStateTree): Deleted.
2397         (WebCore::AsyncScrollingCoordinator::clearStateTree): Deleted.
2398         * page/scrolling/AsyncScrollingCoordinator.h:
2399         * page/scrolling/ScrollingCoordinator.h:
2400         (WebCore::ScrollingCoordinator::handleWheelEvent):
2401         (WebCore::ScrollingCoordinator::createNode):
2402         (WebCore::ScrollingCoordinator::insertNode):
2403         (WebCore::ScrollingCoordinator::unparentNode):
2404         (WebCore::ScrollingCoordinator::unparentChildrenAndDestroyNode):
2405         (WebCore::ScrollingCoordinator::detachAndDestroySubtree):
2406         (WebCore::ScrollingCoordinator::clearAllNodes):
2407         (WebCore::ScrollingCoordinator::parentOfNode const):
2408         (WebCore::ScrollingCoordinator::childrenOfNode const):
2409         (WebCore::ScrollingCoordinator::attachToStateTree): Deleted.
2410         (WebCore::ScrollingCoordinator::detachFromStateTree): Deleted.
2411         (WebCore::ScrollingCoordinator::clearStateTree): Deleted.
2412         * page/scrolling/ScrollingStateNode.cpp:
2413         (WebCore::ScrollingStateNode::removeFromParent):
2414         (WebCore::ScrollingStateNode::removeChild):
2415         * page/scrolling/ScrollingStateNode.h:
2416         * page/scrolling/ScrollingStateTree.cpp:
2417         (WebCore::ScrollingStateTree::ScrollingStateTree):
2418         (WebCore::ScrollingStateTree::createUnparentedNode):
2419         (WebCore::ScrollingStateTree::insertNode):
2420         (WebCore::ScrollingStateTree::unparentNode):
2421         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
2422         (WebCore::ScrollingStateTree::detachAndDestroySubtree):
2423         (WebCore::ScrollingStateTree::clear):
2424         (WebCore::ScrollingStateTree::commit):
2425         (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
2426         (WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved):
2427         (showScrollingStateTree):
2428         (WebCore::ScrollingStateTree::attachNode): Deleted.
2429         (WebCore::ScrollingStateTree::detachNode): Deleted.
2430         * page/scrolling/ScrollingStateTree.h:
2431         (WebCore::ScrollingStateTree::nodeCount const):
2432         * rendering/RenderLayerBacking.cpp:
2433         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2434         * rendering/RenderLayerCompositor.cpp:
2435         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
2436         (WebCore::RenderLayerCompositor::attachScrollingNode):
2437
2438 2019-01-26  Devin Rousso  <drousso@apple.com>
2439
2440         Web Inspector: provide a way to edit the user agent of a remote target
2441         https://bugs.webkit.org/show_bug.cgi?id=193862
2442         <rdar://problem/47359292>
2443
2444         Reviewed by Joseph Pecoraro.
2445
2446         Test: inspector/page/overrideUserAgent.html
2447
2448         * loader/FrameLoader.cpp:
2449         (WebCore::FrameLoader::userAgent const):
2450         (WebCore::FrameLoader::userAgentForJavaScript const):
2451
2452         * inspector/InspectorInstrumentation.h:
2453         (WebCore::InspectorInstrumentation::applyUserAgentOverride): Added.
2454         * inspector/InspectorInstrumentation.cpp:
2455         (WebCore::InspectorInstrumentation::applyUserAgentOverrideImpl): Added.
2456
2457         * inspector/agents/InspectorPageAgent.h:
2458         * inspector/agents/InspectorPageAgent.cpp:
2459         (WebCore::InspectorPageAgent::disable):
2460         (WebCore::InspectorPageAgent::overrideUserAgent): Added.
2461         (WebCore::InspectorPageAgent::applyUserAgentOverride): Added.
2462
2463 2019-01-26  Zalan Bujtas  <zalan@apple.com>
2464
2465         [LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
2466         https://bugs.webkit.org/show_bug.cgi?id=193867
2467
2468         Reviewed by Antti Koivisto.
2469
2470         The initial content top/bottom value is the border top + padding top.
2471
2472         This is only a problem when the box has float children only. While computing the height using the bottom-most float,
2473         we call "top = std::min(floatTop, top)". With 0 initial top value, this returns an incorrect result when the box
2474         has (top)border/padding.
2475
2476         Test: fast/block/block-only/abs-pos-with-border-padding-and-float-child.html
2477
2478         * layout/FormattingContextGeometry.cpp:
2479         (WebCore::Layout::contentHeightForFormattingContextRoot):
2480
2481 2019-01-26  Zalan Bujtas  <zalan@apple.com>
2482
2483         [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height.
2484         https://bugs.webkit.org/show_bug.cgi?id=193865
2485
2486         Reviewed by Antti Koivisto.
2487
2488         Height computation ->
2489         // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
2490         // ...the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom
2491         // margin does not collapse with the element's bottom margin
2492
2493         <div style="border: 1px solid green">
2494           <div style="margin-top: 100px;"></div>
2495         </div>
2496
2497         When the child vertical margins collapse through (margin-top = margin-bottom = 100px), the bottom edge of the bottom margin is
2498         the same as the bottom edge of the top margin which is alredy taken into use while positioning so technically the bottom margin value should be ignored. 
2499
2500         Test: fast/block/margin-collapse/collapsed-through-child-simple.html
2501
2502         * layout/MarginTypes.h:
2503         (WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const):
2504         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2505         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2506         * layout/displaytree/DisplayBox.h:
2507         (WebCore::Display::Box::hasCollapsedThroughMargin const):
2508
2509 2019-01-26  Zalan Bujtas  <zalan@apple.com>
2510
2511         [LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCollapsesWithLastInFlowChildMarginAfter should check for border/padding after values.
2512         https://bugs.webkit.org/show_bug.cgi?id=193864
2513
2514         Reviewed by Antti Koivisto.
2515
2516         * layout/blockformatting/BlockMarginCollapse.cpp:
2517         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2518         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
2519
2520 2019-01-26  Zalan Bujtas  <zalan@apple.com>
2521
2522         [LFC] Box::nextInFlowOrFloatingSibling() should always return sibling floats as well.
2523         https://bugs.webkit.org/show_bug.cgi?id=193855
2524
2525         Reviewed by Antti Koivisto.
2526
2527         Use iterative algorithm to find next/previous siblings.
2528
2529         * layout/layouttree/LayoutBox.cpp:
2530         (WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
2531
2532 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
2533
2534         Need a mechanism to override navigator.userAgent
2535         https://bugs.webkit.org/show_bug.cgi?id=193762
2536         <rdar://problem/47504939>
2537
2538         Reviewed by Brent Fulgham.
2539
2540         Added the ability to specify user agent string just for navigator.userAgent via DocumentLoader.
2541
2542         * loader/DocumentLoader.h:
2543         (WebCore::DocumentLoader::setCustomJavaScriptUserAgent):
2544         (WebCore::DocumentLoader::customJavaScriptUserAgent const):
2545         * loader/FrameLoader.cpp:
2546         (WebCore::FrameLoader::userAgentForJavaScript const):
2547         * loader/FrameLoader.h:
2548         * page/Navigator.cpp:
2549         (WebCore::Navigator::userAgent const):
2550
2551 2019-01-25  Devin Rousso  <drousso@apple.com>
2552
2553         Web Inspector: provide a way to edit page settings on a remote target
2554         https://bugs.webkit.org/show_bug.cgi?id=193813
2555         <rdar://problem/47359510>
2556
2557         Reviewed by Joseph Pecoraro.
2558
2559         Test: inspector/page/overrideSetting.html
2560
2561         * page/Settings.yaml:
2562         * Scripts/GenerateSettings.rb:
2563         * Scripts/SettingsTemplates/Settings.cpp.erb:
2564         * Scripts/SettingsTemplates/Settings.h.erb:
2565         Add support for an `inspectorOverride` boolean value for each setting that will take
2566         precedence over the actual `Setting`'s value when set.
2567
2568         * inspector/agents/InspectorPageAgent.h:
2569         * inspector/agents/InspectorPageAgent.cpp:
2570         (WebCore::InspectorPageAgent::disable):
2571         (WebCore::InspectorPageAgent::overrideSetting): Added.
2572
2573         * inspector/InspectorFrontendHost.idl:
2574         * inspector/InspectorFrontendHost.h:
2575         * inspector/InspectorFrontendHost.cpp:
2576         (WebCore::InspectorFrontendHost::isRemote const): Added.
2577         * inspector/InspectorFrontendClient.h:
2578         (WebCore::InspectorFrontendClient::isRemote const): Added.
2579         * inspector/InspectorFrontendClientLocal.h:
2580         (WebCore::InspectorFrontendClientLocal::isRemote const): Added.
2581
2582 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2583
2584         Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element
2585         https://bugs.webkit.org/show_bug.cgi?id=193843
2586
2587         Reviewed by Zalan Bujtas.
2588
2589         * dom/Document.cpp:
2590         (WebCore::Document::updateMainArticleElementAfterLayout):
2591
2592         This function currently does a bit of wasted work after every layout, on clients that don't listen to the
2593         "significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply
2594         don't bother keeping the main article element up to date in this scenario by bailing from
2595         FrameView::updateHasReachedSignificantRenderedTextThreshold if the client doesn't care about the significant
2596         rendered text milestone.
2597
2598         * page/FrameView.cpp:
2599         (WebCore::FrameView::updateHasReachedSignificantRenderedTextThreshold):
2600
2601 2019-01-25  Jer Noble  <jer.noble@apple.com>
2602
2603         <video> elements not in the DOM should be allowed to AirPlay
2604         https://bugs.webkit.org/show_bug.cgi?id=193837
2605         <rdar://42559491>
2606
2607         Reviewed by Eric Carlson.
2608
2609         Test: media/airplay-allows-buffering.html
2610
2611         Some websites will switch between <video> elements backed by MSE to one backed by
2612         a media file in order to implement an AirPlay control. But when a <video> element is
2613         removed from the DOM and paused, further buffering is blocked. For some ports (namely
2614         Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for
2615         elements who have been asked to play wirelessly, but whose wireless playback has not
2616         started yet.
2617
2618         * html/MediaElementSession.cpp:
2619         (WebCore::MediaElementSession::dataBufferingPermitted const):
2620         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
2621
2622 2019-01-25  Keith Rollin  <krollin@apple.com>
2623
2624         Update Xcode projects with "Check .xcfilelists" build phase
2625         https://bugs.webkit.org/show_bug.cgi?id=193790
2626         <rdar://problem/47201374>
2627
2628         Reviewed by Alex Christensen.
2629
2630         Support for XCBuild includes specifying inputs and outputs to various
2631         Run Script build phases. These inputs and outputs are specified as
2632         .xcfilelist files. Once created, these .xcfilelist files need to be
2633         kept up-to-date. In order to check that they are up-to-date or not,
2634         add an Xcode build step that invokes an external script that performs
2635         the checking. If the .xcfilelists are found to be out-of-date, update
2636         them, halt the build, and instruct the developer to restart the build
2637         with up-to-date files.
2638
2639         At this time, the checking and regenerating is performed only if the
2640         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
2641         who want to use this facility can set this variable and test out the
2642         checking/regenerating. Once it seems like there are no egregious
2643         issues that upset a developer's workflow, we'll unconditionally enable
2644         this facility.
2645
2646         No new tests since there should be no observable behavior difference.
2647
2648         * Scripts/check-xcfilelists.sh: Added.
2649         * WebCore.xcodeproj/project.pbxproj:
2650
2651 2019-01-25  Joseph Pecoraro  <pecoraro@apple.com>
2652
2653         Web Inspector: Exclude Debugger Threads from CPU Usage values in Web Inspector
2654         https://bugs.webkit.org/show_bug.cgi?id=193796
2655         <rdar://problem/47532910>
2656
2657         Reviewed by Devin Rousso.
2658
2659         * page/ResourceUsageData.h:
2660         * inspector/agents/InspectorCPUProfilerAgent.cpp:
2661         (WebCore::InspectorCPUProfilerAgent::collectSample):
2662         Show the CPU usage without debugger threads in the Web Inspector's timeline.
2663
2664         * page/ResourceUsageThread.h:
2665         * page/cocoa/ResourceUsageThreadCocoa.mm:
2666         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
2667         For OS(DARWIN) ports, when starting to observe resource usage,
2668         we grab the mach_port_t of SamplingProfiler on the main thread
2669         in a thread safe way. For our purposes (Web Inspector timelines),
2670         this will be good enough to identify the SamplingProfiler thread
2671         during timeline recording. The SamplingProfiler thread won't change
2672         during a timeline recording and recording start/stops will never
2673         miss the SamplingProfiler changing.
2674
2675         (WebCore::filterThreads):
2676         (WebCore::threadSendRights):
2677         (WebCore::threadSendRightsExcludingDebuggerThreads):
2678         (WebCore::cpuUsage):
2679         (WebCore::ResourceUsageThread::platformCollectCPUData):
2680         Calculate CPU usage twice, the second time excluding some threads.
2681
2682         * page/linux/ResourceUsageThreadLinux.cpp:
2683         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
2684         (WebCore::ResourceUsageThread::platformCollectCPUData):
2685         Stubs for linux ports.
2686
2687 2019-01-25  Zalan Bujtas  <zalan@apple.com>
2688
2689         Remove FrameView::m_significantRenderedTextMilestonePending
2690         https://bugs.webkit.org/show_bug.cgi?id=193842
2691
2692         Reviewed by Wenson Hsieh.
2693
2694         Currently we keep processing the incoming text content until after the "SignificantRenderedTextMilestone" has been reached.
2695         We can actually stop doing it right when the text content is above the threshold (regardless of whether all the conditions are met for the milestone).
2696         This patch also ensures that we don't update Document::m_mainArticleElement once the threshold is reached.
2697
2698         * page/FrameView.cpp:
2699         (WebCore::FrameView::resetLayoutMilestones):
2700         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
2701         (WebCore::FrameView::hasReachedSignificantRenderedTextThreashold):
2702         (WebCore::FrameView::qualifiesAsSignificantRenderedText const):
2703         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2704         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): Deleted.
2705         * page/FrameView.h:
2706
2707 2019-01-25  Keith Rollin  <krollin@apple.com>
2708
2709         Update Xcode projects with "Apply Configuration to XCFileLists" build target
2710         https://bugs.webkit.org/show_bug.cgi?id=193781
2711         <rdar://problem/47201153>
2712
2713         Reviewed by Alex Christensen.
2714
2715         Part of generating the .xcfilelists used as part of adopting XCBuild
2716         includes running `make DerivedSources.make` from a standalone script.
2717         It’s important for this invocation to have the same environment as
2718         when the actual build invokes `make DerivedSources.make`. If the
2719         environments are different, then the two invocations will provide
2720         different results. In order to get the same environment in the
2721         standalone script, have the script launch xcodebuild targeting the
2722         "Apply Configuration to XCFileLists" build target, which will then
2723         re-invoke our standalone script. The script is now running again, this
2724         time in an environment with all workspace, project, target, xcconfig
2725         and other environment variables established.
2726
2727         The "Apply Configuration to XCFileLists" build target accomplishes
2728         this task via a small embedded shell script that consists only of:
2729
2730             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
2731
2732         The process that invokes "Apply Configuration to XCFileLists" first
2733         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
2734         evaluated and exports it into the shell environment. When xcodebuild
2735         is invoked, it inherits the value of this variable and can `eval` the
2736         contents of that variable. Our external standalone script can then set
2737         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
2738         of command-line parameters needed to restart itself in the appropriate
2739         state.
2740
2741         No new tests since there should be no observable behavior difference.
2742
2743         * WebCore.xcodeproj/project.pbxproj:
2744
2745 2019-01-25  Keith Rollin  <krollin@apple.com>
2746
2747         Update WebKitAdditions.xcconfig with correct order of variable definitions
2748         https://bugs.webkit.org/show_bug.cgi?id=193793
2749         <rdar://problem/47532439>
2750
2751         Reviewed by Alex Christensen.
2752
2753         XCBuild changes the way xcconfig variables are evaluated. In short,
2754         all config file assignments are now considered in part of the
2755         evaluation. When using the new build system and an .xcconfig file
2756         contains multiple assignments of the same build setting:
2757
2758         - Later assignments using $(inherited) will inherit from earlier
2759           assignments in the xcconfig file.
2760         - Later assignments not using $(inherited) will take precedence over
2761           earlier assignments. An assignment to a more general setting will
2762           mask an earlier assignment to a less general setting. For example,
2763           an assignment without a condition ('FOO = bar') will completely mask
2764           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
2765
2766         This affects some of our .xcconfig files, in that sometimes platform-
2767         or sdk-specific definitions appear before the general definitions.
2768         Under the new evaluations rules, the general definitions alway take
2769         effect because they always overwrite the more-specific definitions. The
2770         solution is to swap the order, so that the general definitions are
2771         established first, and then conditionally overwritten by the
2772         more-specific definitions.
2773
2774         No new tests since there should be no observable behavior difference.
2775
2776         * Configurations/Base.xcconfig:
2777         * Configurations/Version.xcconfig:
2778
2779 2019-01-25  Keith Rollin  <krollin@apple.com>
2780
2781         Update existing .xcfilelists
2782         https://bugs.webkit.org/show_bug.cgi?id=193791
2783         <rdar://problem/47201706>
2784
2785         Reviewed by Alex Christensen.
2786
2787         Many .xcfilelist files were added in r238824 in order to support
2788         XCBuild. Update these with recent changes to the set of build files
2789         and with the current generate-xcfilelist script.
2790
2791         No new tests since there should be no observable behavior difference.
2792
2793         * DerivedSources-input.xcfilelist:
2794         * DerivedSources-output.xcfilelist:
2795         * UnifiedSources-input.xcfilelist:
2796         * UnifiedSources-output.xcfilelist:
2797
2798 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
2799
2800         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
2801         https://bugs.webkit.org/show_bug.cgi?id=193297
2802         <rdar://problem/47158841>
2803
2804         Reviewed by Alex Christensen.
2805
2806         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
2807
2808         * Modules/websockets/WebSocket.cpp:
2809         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
2810         * loader/ResourceLoadObserver.cpp:
2811         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
2812         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
2813         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
2814         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
2815         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
2816         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
2817
2818 2019-01-25  Zalan Bujtas  <zalan@apple.com>
2819
2820         Remove FrameView::m_firstVisuallyNonEmptyLayoutCallbackPending
2821         https://bugs.webkit.org/show_bug.cgi?id=193835
2822
2823         Reviewed by Simon Fraser.
2824
2825         Currently updateIsVisuallyNonEmpty() is called from fireLayoutRelatedMilestonesIfNeeded() and from the incrementVisually*() functions.
2826         By calling it from incrementVisually*() and setting the m_isVisuallyNonEmpty flag to true early does not have any impact on when the milestone is fired.
2827         The milestone firing, as part of the post-layout tasks is triggered by a subsequent layout.
2828         However having multiple callers of updateIsVisuallyNonEmpty() requires an extra boolen (m_firstVisuallyNonEmptyLayoutCallbackPending) to maintain.
2829         Also calling updateIsVisuallyNonEmpty() repeatedly could be costly (with the current threshold of 200 characters, I don't think it is though).
2830
2831         This patch removes m_firstVisuallyNonEmptyLayoutCallbackPending and moves the logic from updateIsVisuallyNonEmpty() to fireLayoutRelatedMilestonesIfNeeded().
2832
2833         * page/FrameView.cpp:
2834         (WebCore::FrameView::resetLayoutMilestones):
2835         (WebCore::FrameView::loadProgressingStatusChanged):
2836         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
2837         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2838         (WebCore::FrameView::updateIsVisuallyNonEmpty): Deleted.
2839         * page/FrameView.h:
2840         (WebCore::FrameView::incrementVisuallyNonEmptyPixelCount):
2841
2842 2019-01-25  David Kilzer  <ddkilzer@apple.com>
2843
2844         Move soft-linking of Lookup.framework out of LookupSPI.h
2845         <https://webkit.org/b/193815>
2846
2847         Reviewed by Tim Horton.
2848
2849         * editing/cocoa/DictionaryLookup.mm:
2850         - Remove unused header.
2851
2852         * editing/mac/DictionaryLookupLegacy.mm:
2853         (WebCore::tokenRange):
2854         (WebCore::showPopupOrCreateAnimationController):
2855         (WebCore::DictionaryLookup::hidePopup):
2856         - Move soft-linking to LookupSoftLink.{h,mm}.
2857
2858         * platform/ios/ValidationBubbleIOS.mm:
2859         (WebCore::ValidationBubble::show):
2860         - Update for changes to UIKitSoftLink.{h,mm} now that
2861           UIAccessibilityAnnouncementNotification is using
2862           SOFT_LINK_CONSTANT*().
2863
2864 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2865
2866         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
2867         https://bugs.webkit.org/show_bug.cgi?id=193829
2868
2869         Reviewed by Tim Horton.
2870
2871         No change in behavior.
2872
2873         * page/EventHandler.h:
2874         * page/ios/EventHandlerIOS.mm:
2875         (WebCore::EventHandler::tryToBeginDragAtPoint):
2876         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint): Deleted.
2877         * platform/ios/WebItemProviderPasteboard.mm:
2878         (linkTemporaryItemProviderFilesToDropStagingDirectory):
2879
2880 2019-01-25  Jon Davis  <jond@apple.com>
2881
2882         Updated feature status for several features 
2883         https://bugs.webkit.org/show_bug.cgi?id=193794
2884
2885         Reviewed by Joseph Pecoraro.
2886         
2887         Updated feature status for the following: CSS Font Display,
2888         CSS Text Decoration Level 4, SVG in OpenType Fonts, Web SQL,
2889         File and Directory Entries API, MediaStream Recording API,
2890         Readable Streams, Subresource Integrity, Visual Viewport API,
2891         and Web Audio.
2892
2893         * features.json:
2894
2895 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2896
2897         Need a way for JavaScript (or bundle) code to participate in undo
2898         https://bugs.webkit.org/show_bug.cgi?id=190009
2899         <rdar://problem/44807048>
2900
2901         Reviewed by Ryosuke Niwa.
2902
2903         Finish hooking up `UndoManager::addItems()` to CustomUndoStep.
2904
2905         Tests: editing/undo-manager/undo-manager-add-item-exceptions.html
2906                editing/undo-manager/undo-manager-add-item.html
2907                editing/undo-manager/undo-manager-delete-stale-undo-items.html
2908                editing/undo-manager/undo-manager-item-labels.html
2909                editing/undo-manager/undo-manager-undo-redo-after-garbage-collection.html
2910
2911         * editing/CompositeEditCommand.h:
2912         * editing/CustomUndoStep.cpp:
2913         (WebCore::CustomUndoStep::didRemoveFromUndoManager):
2914
2915         Add a method to invalidate CustomUndoStep. This clears out the pointer to the undo item, and also invalidates
2916         the UndoItem, removing it from its UndoManager.
2917
2918         * editing/CustomUndoStep.h:
2919         * editing/Editor.cpp:
2920         (WebCore::Editor::registerCustomUndoStep):
2921
2922         Add a helper method to register a CustomUndoStep as a platform undoable step.
2923
2924         * editing/Editor.h:
2925         * editing/UndoStep.h:
2926         * page/UndoItem.h:
2927         (WebCore::UndoItem::undoManager const):
2928         * page/UndoManager.cpp:
2929         (WebCore::UndoManager::addItem):
2930
2931         Create a CustomUndoStep with the given UndoItem, and register it with the platform undo manager.
2932
2933         * page/UndoManager.h:
2934         * page/UndoManager.idl:
2935
2936         Mark addItem() as capable of throwing exceptions.
2937
2938 2019-01-25  Zalan Bujtas  <zalan@apple.com>
2939
2940         [LFC][BFC][MarginCollapsing] Add "clear" to static position computation.
2941         https://bugs.webkit.org/show_bug.cgi?id=193824
2942
2943         Reviewed by Antti Koivisto.
2944
2945         When clear property is set and floats are present, we have to estimate and set the box's vertical position during
2946         static positioning to be able to properly layout its subtree.
2947
2948         <div style="float: left; width: 100px; height: 100px;"></div>
2949         <div style="clear: left;">
2950           <div style="float: left; width: 100px; height: 100px;"></div>
2951         </div>
2952
2953         In the above example since the second float's parent clears the first float, the second float is positioned below
2954         the first float. If we didn't push down (clear) the box, the float child would get placed next to the first float.
2955
2956         * layout/blockformatting/BlockFormattingContext.cpp:
2957         (WebCore::Layout::BlockFormattingContext::layout const):
2958         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2959         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2960         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
2961         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
2962         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2963         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
2964         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): Deleted.
2965         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const): Deleted.
2966         * layout/blockformatting/BlockFormattingContext.h:
2967         * layout/blockformatting/BlockMarginCollapse.cpp:
2968         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
2969         * layout/displaytree/DisplayBox.h:
2970
2971 2019-01-25  Zalan Bujtas  <zalan@apple.com>
2972
2973         [LFC][BFC][MarginCollapsing] Move positive/negative margin value updating to a dedicated function
2974         https://bugs.webkit.org/show_bug.cgi?id=193812
2975
2976         Reviewed by Antti Koivisto.
2977
2978         Move update logic to BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues().
2979
2980         * layout/blockformatting/BlockFormattingContext.cpp:
2981         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2982         * layout/blockformatting/BlockFormattingContext.h:
2983         * layout/blockformatting/BlockMarginCollapse.cpp:
2984         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
2985         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
2986         * page/FrameViewLayoutContext.cpp:
2987         (WebCore::layoutUsingFormattingContext):
2988
2989 2019-01-25  Antoine Quint  <graouts@apple.com>
2990
2991         Use ENABLE_POINTER_EVENTS for the touch-action property
2992         https://bugs.webkit.org/show_bug.cgi?id=193819
2993
2994         Reviewed by Antti Koivisto.
2995
2996         Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
2997         Pointer Events specification of which the touch-action property is a part.
2998
2999         * css/CSSComputedStyleDeclaration.cpp:
3000         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3001         * css/CSSPrimitiveValueMappings.h:
3002         * css/CSSProperties.json:
3003         * css/CSSValueKeywords.in:
3004         * css/StyleBuilderConverter.h:
3005         * css/parser/CSSPropertyParser.cpp:
3006         (WebCore::CSSPropertyParser::parseSingleValue):
3007         * dom/Element.cpp:
3008         (WebCore::Element::allowsDoubleTapGesture const):
3009         * platform/TouchAction.h:
3010         * rendering/style/RenderStyle.h:
3011         * rendering/style/StyleRareNonInheritedData.cpp:
3012         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3013         (WebCore::StyleRareNonInheritedData::operator== const):
3014         * rendering/style/StyleRareNonInheritedData.h:
3015
3016 2019-01-24  Zalan Bujtas  <zalan@apple.com>
3017
3018         [LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter
3019         https://bugs.webkit.org/show_bug.cgi?id=193807
3020
3021         Reviewed by Simon Fraser.
3022
3023         Rename updateCollapsedMarginAfter to updateMarginAfterForPreviousSibling and make the margin updating logic more explicit.
3024
3025         * layout/blockformatting/BlockFormattingContext.cpp:
3026         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3027         * layout/blockformatting/BlockFormattingContext.h:
3028         * layout/blockformatting/BlockMarginCollapse.cpp:
3029         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
3030         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter): Deleted.
3031
3032 2019-01-24  Joseph Pecoraro  <pecoraro@apple.com>
3033
3034         Web Inspector: CPU Usage Timeline
3035         https://bugs.webkit.org/show_bug.cgi?id=193730
3036         <rdar://problem/46797201>
3037
3038         Reviewed by Devin Rousso.
3039
3040         Test: inspector/cpu-profiler/tracking.html
3041
3042         * Sources.txt:
3043         * UnifiedSources-input.xcfilelist:
3044         * WebCore.xcodeproj/project.pbxproj:
3045         New files.
3046
3047         * inspector/InspectorController.cpp:
3048         (WebCore::InspectorController::createLazyAgents):
3049         * inspector/InstrumentingAgents.cpp:
3050         (WebCore::InstrumentingAgents::reset):
3051         * inspector/InstrumentingAgents.h:
3052         (WebCore::InstrumentingAgents::inspectorCPUProfilerAgent const):
3053         (WebCore::InstrumentingAgents::setInspectorCPUProfilerAgent):
3054         Create and track the CPUProfilerAgent.
3055
3056         * inspector/agents/InspectorTimelineAgent.cpp:
3057         (WebCore::InspectorTimelineAgent::toggleInstruments):
3058         (WebCore::InspectorTimelineAgent::toggleCPUInstrument):
3059         Handle backend auto-start of the CPU instrument / timeline.
3060
3061         * inspector/agents/InspectorCPUProfilerAgent.h:
3062         * inspector/agents/InspectorCPUProfilerAgent.cpp: Added.
3063         (WebCore::InspectorCPUProfilerAgent::InspectorCPUProfilerAgent):
3064         (WebCore::InspectorCPUProfilerAgent::didCreateFrontendAndBackend):
3065         (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
3066         (WebCore::InspectorCPUProfilerAgent::startTracking):
3067         (WebCore::InspectorCPUProfilerAgent::stopTracking):
3068         (WebCore::InspectorCPUProfilerAgent::collectSample):
3069         CPUProfilerAgent uses the ResourceUsageThread to get CPU data.
3070
3071         * inspector/agents/InspectorTimelineAgent.h:
3072         * inspector/agents/InspectorMemoryAgent.cpp:
3073         (WebCore::InspectorMemoryAgent::startTracking):
3074         (WebCore::InspectorMemoryAgent::collectSample):
3075         Update the MemoryAgent to collect only Memory data and use a more accurate sample timestamp.
3076
3077         * page/ResourceUsageData.h:
3078         * page/ResourceUsageThread.cpp:
3079         (WebCore::ResourceUsageThread::addObserver):
3080         (WebCore::ResourceUsageThread::removeObserver):
3081         (WebCore::ResourceUsageThread::notifyObservers):
3082         (WebCore::ResourceUsageThread::recomputeCollectionMode):
3083         (WebCore::ResourceUsageThread::threadBody):
3084         * page/ResourceUsageThread.h:
3085         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3086         (WebCore::ResourceUsageOverlay::platformInitialize):
3087         * page/cocoa/ResourceUsageThreadCocoa.mm:
3088         (WebCore::ResourceUsageThread::platformCollectCPUData):
3089         (WebCore::ResourceUsageThread::platformCollectMemoryData):
3090         (WebCore::ResourceUsageThread::platformThreadBody): Deleted.
3091         * page/linux/ResourceUsageOverlayLinux.cpp:
3092         (WebCore::ResourceUsageOverlay::platformInitialize):
3093         * page/linux/ResourceUsageThreadLinux.cpp:
3094         (WebCore::ResourceUsageThread::platformCollectCPUData):
3095         (WebCore::ResourceUsageThread::platformCollectMemoryData):
3096         (WebCore::ResourceUsageThread::platformThreadBody):
3097         Give each observer their own collection mode. The ResourceUsageThread
3098         will then collect data that is the union of all of the active observers.
3099         This allows collecting CPU and Memory data separately, reducing the cost
3100         of each when gathered individually.
3101
3102 2019-01-24  Charles Vazac  <cvazac@akamai.com>
3103
3104         Implement PerformanceObserver.supportedEntryTypes
3105         https://bugs.webkit.org/show_bug.cgi?id=193428
3106
3107         PerformanceObserver.supportedEntryTypes should return an array of
3108         entryTypes that can be observed per specification
3109         https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
3110
3111         Reviewed by Joseph Pecoraro.
3112
3113         This is covered by web-platform-tests
3114         LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html.
3115
3116         * page/PerformanceObserver.cpp:
3117         (WebCore::PerformanceObserver::supportedEntryTypes):
3118         * page/PerformanceObserver.h:
3119         * page/PerformanceObserver.idl:
3120
3121 2019-01-24  Truitt Savell  <tsavell@apple.com>
3122
3123         Unreviewed, rolling out r240446.
3124
3125         Casued 5 API failures
3126
3127         Reverted changeset:
3128
3129         "Activate the WebResourceLoadStatisticsStore in the
3130         NetworkProcess and deactivate it in the UIProcess."
3131         https://bugs.webkit.org/show_bug.cgi?id=193297
3132         https://trac.webkit.org/changeset/240446
3133
3134 2019-01-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3135
3136         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
3137         https://bugs.webkit.org/show_bug.cgi?id=193758
3138         <rdar://problem/43614978>
3139
3140         Reviewed by Tim Horton.
3141
3142         CodeMirror's script adds a repeating timer that periodically normalizes the logical selection in the editor
3143         (this is distinct from the actual DOM selection, which is inside a hidden textarea element). This script defines
3144         a helper method to select all the text inside of a text form control, called `selectInput`, which normally
3145         invokes `node.select()`. However, in the case of iOS, the script works around broken `select()` behavior by
3146         setting `selectionStart` and `selectionEnd` to encompass all the content in the form control. When requesting
3147         the desktop version of the site, CodeMirror no longer attempts to apply its iOS workaround.
3148
3149         This iOS-specific behavior was introduced to fix <rdar://problem/4901923>. However, the original bug no longer
3150         reproduces even without this quirk. To fix CodeMirror, we make two adjustments:
3151
3152         1.  Roll out this ancient demo hack, in favor of standardized behavior.
3153         2.  Note that `select()` is also used when focusing an input. However, when focusing an input element on iOS, we
3154             want to match the platform (i.e. UITextField behavior) and move focus to the end of the text field. To
3155             achieve this, we introduce a new helper on HTMLInputElement that is called when setting the default
3156             selection of a text input after focus; on iOS, this helper method moves the selection to the end of the
3157             input, but everywhere else, it selects all the text in the input element.
3158
3159         This causes 6 existing layout tests to begin passing on iOS.
3160
3161         * html/HTMLInputElement.cpp:
3162         (WebCore::HTMLInputElement::updateFocusAppearance):
3163         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
3164         * html/HTMLInputElement.h:
3165         * html/HTMLTextFormControlElement.cpp:
3166         (WebCore::HTMLTextFormControlElement::select):
3167
3168 2019-01-24  Jer Noble  <jer.noble@apple.com>
3169
3170         Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object.
3171         https://bugs.webkit.org/show_bug.cgi?id=193778
3172
3173         Reviewed by Jon Lee.
3174
3175         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3176         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
3177
3178 2019-01-24  Zalan Bujtas  <zalan@apple.com>
3179
3180         DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
3181         https://bugs.webkit.org/show_bug.cgi?id=193741
3182         <rdar://problem/47135030>
3183
3184         Reviewed by Antti Koivisto and Simon Fraser.
3185
3186         fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when
3187             1. the received data is not "contentful" yet
3188             2. and we are expecting some more (loading is not complete yet)
3189             3. but no layout is initiated anymore
3190         nothing triggers the milestone firing.
3191
3192         This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.
3193
3194         * page/FrameView.cpp:
3195         (WebCore::FrameView::FrameView):
3196         (WebCore::FrameView::loadProgressingStatusChanged):
3197
3198 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
3199
3200         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
3201         https://bugs.webkit.org/show_bug.cgi?id=193297
3202         <rdar://problem/47158841>
3203
3204         Reviewed by Alex Christensen.
3205
3206         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
3207
3208         * Modules/websockets/WebSocket.cpp:
3209         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
3210         * loader/ResourceLoadObserver.cpp:
3211         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
3212         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
3213         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
3214         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
3215         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
3216         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
3217
3218 2019-01-24  John Wilander  <wilander@apple.com>
3219
3220         Add Ad Click Attribution as an internal/experimental feature
3221         https://bugs.webkit.org/show_bug.cgi?id=193685
3222         <rdar://problem/47450399>
3223
3224         Reviewed by Brent Fulgham.
3225
3226         Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html
3227
3228         * html/HTMLAnchorElement.h:
3229         * html/HTMLAnchorElement.idl:
3230         * html/HTMLAttributeNames.in:
3231             Addeed two new experimental attributes:
3232             - adcampaignid: Ad campaign ID.
3233             - addestination: Ad link destination site.
3234         * page/RuntimeEnabledFeatures.h:
3235         (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const):
3236         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled):
3237         * page/Settings.yaml:
3238
3239 2019-01-24  Youenn Fablet  <youenn@apple.com>
3240
3241         Use MonotonicTime in WorkerRunLoop
3242         https://bugs.webkit.org/show_bug.cgi?id=193417
3243
3244         Reviewed by Saam Barati.
3245
3246         Condition is based on MonotonicTime so MessageQueue should also be based on MonotonicTime.
3247         Ditto for WorkerRunLoop.
3248         No easy way to test the change which should not be easily observable.
3249
3250         * workers/WorkerRunLoop.cpp:
3251         (WebCore::WorkerRunLoop::runInMode):
3252
3253 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
3254
3255         Move FileSystem to WTF
3256         https://bugs.webkit.org/show_bug.cgi?id=193602
3257
3258         Reviewed by Yusuke Suzuki.
3259
3260         * Modules/encryptedmedia/CDM.cpp:
3261         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
3262         * Modules/entriesapi/DOMFileSystem.cpp:
3263         * Modules/entriesapi/FileSystemEntry.cpp:
3264         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
3265         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3266         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
3267         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3268         * Modules/webdatabase/DatabaseTracker.cpp:
3269         * Modules/webdatabase/OriginLock.cpp:
3270         * Modules/webdatabase/OriginLock.h:
3271         * Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
3272         * PlatformMac.cmake:
3273         * PlatformPlayStation.cmake:
3274         * PlatformWin.cmake:
3275         * Sources.txt:
3276         * SourcesCocoa.txt:
3277         * WebCore.xcodeproj/project.pbxproj:
3278         * bindings/js/GCController.cpp:
3279         * dom/DataTransferItem.cpp:
3280         * editing/cocoa/WebContentReaderCocoa.mm:
3281         * fileapi/File.cpp:
3282         * fileapi/FileCocoa.mm:
3283         * html/FileInputType.cpp:
3284         * html/FileListCreator.cpp:
3285         * loader/appcache/ApplicationCacheHost.cpp:
3286         * loader/appcache/ApplicationCacheStorage.cpp:
3287         * page/Page.cpp:
3288         * page/SecurityOrigin.cpp:
3289         * page/SecurityOriginData.cpp:
3290         * platform/FileHandle.h:
3291         * platform/FileStream.cpp:
3292         * platform/FileStream.h:
3293         * platform/SharedBuffer.h:
3294         * platform/SourcesGLib.txt:
3295         * platform/cocoa/FileMonitorCocoa.mm:
3296         * platform/glib/FileMonitorGLib.cpp:
3297         * platform/glib/SharedBufferGlib.cpp:
3298         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3299         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3300         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
3301         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3302         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3303         * platform/ios/QuickLook.mm:
3304         * platform/ios/WebItemProviderPasteboard.mm:
3305         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3306         * platform/network/BlobDataFileReference.cpp:
3307         * platform/network/BlobRegistryImpl.cpp:
3308         * platform/network/BlobResourceHandle.cpp:
3309         * platform/network/FormData.cpp:
3310         * platform/network/cf/FormDataStreamCFNet.cpp:
3311         * platform/network/cocoa/ResourceRequestCocoa.mm:
3312         * platform/network/curl/CookieJarDB.cpp:
3313         * platform/network/curl/CurlCacheEntry.h:
3314         * platform/network/curl/CurlCacheManager.cpp:
3315         * platform/network/curl/CurlFormDataStream.h:
3316         * platform/network/curl/CurlRequest.h:
3317         * platform/network/curl/NetworkStorageSessionCurl.cpp:
3318         * platform/network/curl/ResourceHandleCurl.cpp:
3319         * platform/network/mac/BlobDataFileReferenceMac.mm:
3320         * platform/network/soup/ResourceHandleSoup.cpp:
3321         * platform/network/soup/SoupNetworkSession.cpp:
3322         * platform/posix/SharedBufferPOSIX.cpp:
3323         * platform/sql/SQLiteFileSystem.cpp:
3324         * platform/text/hyphen/HyphenationLibHyphen.cpp:
3325         * platform/win/SearchPopupMenuDB.cpp:
3326         * rendering/RenderTheme.cpp:
3327         * rendering/RenderThemeGtk.cpp:
3328         * rendering/RenderThemeWin.cpp:
3329         * workers/service/server/RegistrationDatabase.cpp:
3330
3331 2019-01-24  Zalan Bujtas  <zalan@apple.com>
3332
3333         [LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not return computed non-collapsed values.
3334         https://bugs.webkit.org/show_bug.cgi?id=193768
3335
3336         Reviewed by Antti Koivisto.
3337
3338         When it comes to the actual used values it does not really matter, only from correctness point of view.
3339         (This patch also moves some checks to their correct place.)
3340
3341         * layout/blockformatting/BlockMarginCollapse.cpp:
3342         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
3343         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
3344         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
3345         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
3346         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
3347         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
3348
3349 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
3350
3351         Add "frame hosting" nodes to the scrolling tree
3352         https://bugs.webkit.org/show_bug.cgi?id=193753
3353
3354         Reviewed by Antti Koivisto.
3355
3356         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
3357         require the iframe's scrolling node to get reparented in a new ancestor, which requires
3358         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
3359
3360         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
3361         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
3362         to provide a consistent parent node for the subframe's scrolling node.
3363
3364         This patch adds the node types, but does not instantiate them yet.
3365
3366         * Sources.txt:
3367         * WebCore.xcodeproj/project.pbxproj:
3368         * page/scrolling/ScrollingCoordinator.cpp:
3369         (WebCore::operator<<):
3370         * page/scrolling/ScrollingCoordinator.h:
3371         * page/scrolling/ScrollingStateFrameHostingNode.cpp: Added.
3372         (WebCore::ScrollingStateFrameHostingNode::create):
3373         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
3374         (WebCore::ScrollingStateFrameHostingNode::clone):
3375         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
3376         * page/scrolling/ScrollingStateFrameHostingNode.h: Added.
3377         * page/scrolling/ScrollingStateNode.h:
3378         (WebCore::ScrollingStateNode::isFrameHostingNode const):
3379         * page/scrolling/ScrollingStateTree.cpp:
3380         (WebCore::ScrollingStateTree::createNode):
3381         * page/scrolling/ScrollingTreeFrameHostingNode.cpp: Added.
3382         (WebCore::ScrollingTreeFrameHostingNode::create):
3383         (WebCore::ScrollingTreeFrameHostingNode::ScrollingTreeFrameHostingNode):
3384         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
3385         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
3386         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
3387         * page/scrolling/ScrollingTreeFrameHostingNode.h: Added.
3388         * page/scrolling/ScrollingTreeNode.h:
3389         (WebCore::ScrollingTreeNode::isFrameHostingNode const):
3390         * page/scrolling/ios/ScrollingTreeIOS.cpp:
3391         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
3392         * page/scrolling/mac/ScrollingTreeMac.cpp:
3393         (ScrollingTreeMac::createScrollingTreeNode):
3394         * rendering/RenderLayerBacking.cpp:
3395         (WebCore::RenderLayerBacking::~RenderLayerBacking):
3396         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
3397         (WebCore::operator<<):
3398         * rendering/RenderLayerBacking.h:
3399         * rendering/RenderLayerCompositor.cpp:
3400         (WebCore::scrollCoordinationRoleForNodeType):
3401         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
3402         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
3403         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3404         * rendering/RenderLayerCompositor.h:
3405
3406 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
3407
3408         [iOS] Enable media element volume on iPad
3409         https://bugs.webkit.org/show_bug.cgi?id=193745
3410         <rdar://problem/47452297>
3411
3412         Reviewed by Jer Noble.
3413
3414         * html/HTMLMediaElement.cpp:
3415         (WebCore::HTMLMediaElement::setVolume):
3416         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
3417         (WebCore::HTMLMediaElement::updateVolume):
3418
3419         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3420         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
3421
3422 2019-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3423
3424         [GTK][WPE] Support JPEG 2000 images
3425         https://bugs.webkit.org/show_bug.cgi?id=186272
3426
3427         Reviewed by Žan Doberšek.
3428
3429         Add JPEG2000ImageDecoder to support JPEG2000 images using OpenJPEG. For now only SRGB and SYCC color spaces are
3430         supported.
3431
3432         * platform/ImageDecoders.cmake:
3433         * platform/MIMETypeRegistry.cpp:
3434         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
3435         * platform/image-decoders/ScalableImageDecoder.cpp:
3436         (WebCore::ScalableImageDecoder::create):
3437         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: Added.
3438         (WebCore::syccToRGB):
3439         (WebCore::sycc444ToRGB):
3440         (WebCore::sycc422ToRGB):
3441         (WebCore::sycc420ToRGB):
3442         (WebCore::JPEG2000ImageDecoder::JPEG2000ImageDecoder):
3443         (WebCore::JPEG2000ImageDecoder::frameBufferAtIndex):
3444         (WebCore::JPEG2000ImageDecoder::decode):
3445         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.h: Added.
3446
3447 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
3448
3449         Change some RenderLayerCompositor functions to use references
3450         https://bugs.webkit.org/show_bug.cgi?id=193760
3451
3452         Reviewed by Zalan Bujtas.
3453
3454         RenderWidget* -> RenderWidget&
3455
3456         * rendering/RenderLayerBacking.cpp:
3457         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
3458         (WebCore::RenderLayerBacking::updateConfiguration):
3459         * rendering/RenderLayerCompositor.cpp:
3460         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
3461         (WebCore::RenderLayerCompositor::updateBacking):
3462         (WebCore::RenderLayerCompositor::frameContentsCompositor):
3463         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
3464         * rendering/RenderLayerCompositor.h:
3465
3466 2019-01-23  Benjamin Poulain  <benjamin@webkit.org>
3467
3468         <rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
3469         https://bugs.webkit.org/show_bug.cgi?id=193742
3470
3471         Reviewed by Eric Carlson.
3472
3473         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3474         The original bug was fixed, see radar: rdar://problem/27686430
3475
3476 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
3477
3478         Clean up IndexedDB files between tests
3479         https://bugs.webkit.org/show_bug.cgi?id=192796
3480         <rdar://problem/46824999>
3481
3482         Reviewed by Geoffrey Garen.
3483
3484         We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.
3485
3486         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3487         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
3488         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
3489
3490 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
3491
3492         Add CSS Logical spec to features.json
3493         https://bugs.webkit.org/show_bug.cgi?id=193717
3494
3495         Reviewed by Manuel Rego Casasnovas.
3496
3497         * features.json:
3498
3499 2019-01-22  Conrad Shultz  <conrad_shultz@apple.com>
3500
3501         Clean up USE(WEB_THREAD)
3502         https://bugs.webkit.org/show_bug.cgi?id=193698
3503
3504         Rubber-stamped by Tim Horton.
3505
3506         * page/CaptionUserPreferencesMediaAF.cpp:
3507         (WebCore::userCaptionPreferencesChangedNotificationCallback):
3508         * platform/cf/MainThreadSharedTimerCF.cpp:
3509         (WebCore::applicationDidBecomeActive):
3510         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
3511         (WebCore::dispatchToMainThread):
3512         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
3513         (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
3514         * platform/ios/LegacyTileCache.mm:
3515         (WebCore::LegacyTileCache::layoutTiles):
3516         (WebCore::LegacyTileCache::setTilingMode):
3517         * platform/ios/WebCoreMotionManager.mm:
3518         (-[WebCoreMotionManager sendAccelerometerData:]):
3519         (-[WebCoreMotionManager sendMotionData:withHeading:]):
3520         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3521         (VideoFullscreenControllerContext::requestUpdateInlineRect):
3522         (VideoFullscreenControllerContext::requestVideoContentLayer):
3523         (VideoFullscreenControllerContext::returnVideoContentLayer):
3524         (VideoFullscreenControllerContext::didSetupFullscreen):
3525         (VideoFullscreenControllerContext::willExitFullscreen):
3526         (VideoFullscreenControllerContext::didExitFullscreen):
3527         (VideoFullscreenControllerContext::didCleanupFullscreen):
3528         (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
3529         (VideoFullscreenControllerContext::requestFullscreenMode):
3530         (VideoFullscreenControllerContext::setVideoLayerFrame):
3531         (VideoFullscreenControllerContext::setVideoLayerGravity):
3532         (VideoFullscreenControllerContext::fullscreenModeChanged):
3533         (VideoFullscreenControllerContext::play):
3534         (VideoFullscreenControllerContext::pause):
3535         (VideoFullscreenControllerContext::togglePlayState):
3536         (VideoFullscreenControllerContext::toggleMuted):
3537         (VideoFullscreenControllerContext::setMuted):
3538         (VideoFullscreenControllerContext::setVolume):
3539         (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
3540         (VideoFullscreenControllerContext::beginScrubbing):
3541         (VideoFullscreenControllerContext::endScrubbing):
3542         (VideoFullscreenControllerContext::seekToTime):
3543         (VideoFullscreenControllerContext::fastSeek):
3544         (VideoFullscreenControllerContext::beginScanningForward):
3545         (VideoFullscreenControllerContext::beginScanningBackward):
3546         (VideoFullscreenControllerContext::endScanning):
3547         (VideoFullscreenControllerContext::selectAudioMediaOption):
3548         (VideoFullscreenControllerContext::selectLegibleMediaOption):
3549         (VideoFullscreenControllerContext::duration const):
3550         (VideoFullscreenControllerContext::currentTime const):
3551         (VideoFullscreenControllerContext::bufferedTime const):
3552         (VideoFullscreenControllerContext::isPlaying const):
3553         (VideoFullscreenControllerContext::playbackRate const):
3554         (VideoFullscreenControllerContext::seekableRanges const):
3555         (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
3556         (VideoFullscreenControllerContext::liveUpdateInterval const):
3557         (VideoFullscreenControllerContext::canPlayFastReverse const):
3558         (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
3559         (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
3560         (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
3561         (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
3562         (VideoFullscreenControllerContext::externalPlaybackEnabled const):
3563         (VideoFullscreenControllerContext::externalPlaybackTargetType const):
3564         (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
3565         (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
3566         (VideoFullscreenControllerContext::setUpFullscreen):
3567         (VideoFullscreenControllerContext::exitFullscreen):
3568         (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
3569         (-[WebVideoFullscreenController enterFullscreen:mode:]):
3570         (-[WebVideoFullscreenController exitFullscreen]):
3571         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
3572         * platform/ios/wak/WAKWindow.mm:
3573         (-[WAKWindow setVisible:]):
3574         (-[WAKWindow setScreenScale:]):
3575         (-[WAKWindow sendEvent:]):
3576         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
3577         * platform/network/ios/NetworkStateNotifierIOS.mm:
3578         (WebCore::NetworkStateNotifier::startObserving):
3579         * rendering/RenderThemeIOS.mm:
3580         (WebCore::contentSizeCategoryDidChange):
3581
3582 2019-01-23  David Kilzer  <ddkilzer@apple.com>
3583
3584         REGRESSION (r240292): Attempt to fix WinCairo build
3585
3586         * platform/network/curl/CurlResourceHandleDelegate.cpp:
3587         (WebCore::handleCookieHeaders): Remove argument to
3588         NetworkingContext::storageSession().
3589
3590 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3591
3592         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
3593         https://bugs.webkit.org/show_bug.cgi?id=193706
3594         <rdar://problem/44807048>
3595
3596         Reviewed by Ryosuke Niwa.
3597
3598         Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
3599         label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
3600         undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
3601         label simultaneously. There should be no change in behavior.
3602
3603         * editing/CompositeEditCommand.cpp:
3604         (WebCore::EditCommandComposition::label const):
3605         * editing/CompositeEditCommand.h:
3606         * editing/CustomUndoStep.cpp:
3607         (WebCore::CustomUndoStep::label const):
3608         * editing/CustomUndoStep.h:
3609         * editing/EditAction.cpp:
3610         (WebCore::undoRedoLabel):
3611         (WebCore::nameForUndoRedo): Deleted.
3612         * editing/EditAction.h:
3613
3614         Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
3615         WebKitLegacy.
3616
3617         * editing/UndoStep.h:
3618
3619         Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
3620         localized string, CustomUndoStep implements this by returning the undoable action label provided by script.
3621
3622 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3623
3624         [SOUP] Clean up NetworkStorageSession
3625         https://bugs.webkit.org/show_bug.cgi?id=193707
3626
3627         Reviewed by Carlos Garcia Campos.
3628
3629         A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
3630         complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
3631         know the session has always already been created. The soupNetworkSession getter can now
3632         return a reference rather than a pointer, because it will never be NULL except after it has
3633         been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
3634         before process termination after nothing else is using it. Cookie jar syncing can also go
3635         away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
3636         use its cookie jar.
3637
3638         * platform/network/NetworkStorageSession.h:
3639         (WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
3640         * platform/network/soup/DNSResolveQueueSoup.cpp:
3641         (WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
3642         (WebCore::DNSResolveQueueSoup::platformResolve):
3643         (WebCore::DNSResolveQueueSoup::resolve):
3644         * platform/network/soup/NetworkStorageSessionSoup.cpp:
3645         (WebCore::NetworkStorageSession::NetworkStorageSession):
3646         (WebCore::NetworkStorageSession::~NetworkStorageSession):
3647         (WebCore::NetworkStorageSession::soupNetworkSession const):
3648         (WebCore::NetworkStorageSession::clearSoupNetworkSession):
3649         (WebCore::NetworkStorageSession::cookieStorage const):
3650         (WebCore::NetworkStorageSession::setCookieStorage):
3651         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
3652         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
3653         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
3654         (WebCore::SocketStreamHandleImpl::create):
3655
3656 2019-01-23  Zalan Bujtas  <zalan@apple.com>
3657
3658         [LFC][BFC] computeStaticPosition should include estimated computation as well.
3659         https://bugs.webkit.org/show_bug.cgi?id=193719
3660
3661         Reviewed by Antti Koivisto.
3662
3663         Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
3664         It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
3665         the containing block's width).
3666         This is also in preparation for moving 'clear' positioning to computeStaticPosition.
3667
3668         * layout/blockformatting/BlockFormattingContext.cpp:
3669         (WebCore::Layout::BlockFormattingContext::layout const):
3670         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3671         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3672         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
3673         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
3674         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
3675         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
3676         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3677         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3678         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3679         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
3680         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
3681         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
3682         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
3683         * layout/blockformatting/BlockFormattingContext.h:
3684         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3685         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
3686         * layout/blockformatting/BlockMarginCollapse.cpp:
3687         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
3688
3689 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
3690
3691         Compositing updates need to reparent scrolling tree nodes with a changed ancestor
3692         https://bugs.webkit.org/show_bug.cgi?id=193699
3693
3694         Reviewed by Frédéric Wang.
3695
3696         Now that compositing updates are incremental and may not do a full layer walk,
3697         we need to ensure that when a scrolling tree node is removed, we traverse to all
3698         descendant layers whose scrolling tree nodes refer to the removed node as their parent.
3699
3700         To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
3701         ensures that the updateBackingAndHierarchy part of the compositing update traverses
3702         layers with the bit set.
3703
3704         Adjust the compositing logging to make the legend easier to read.
3705
3706         Tests: scrollingcoordinator/reparent-across-compositing-layers.html
3707                scrollingcoordinator/reparent-with-layer-removal.html
3708
3709         * page/scrolling/AsyncScrollingCoordinator.cpp:
3710         (WebCore::AsyncScrollingCoordinator::childrenOfNode const):
3711         * page/scrolling/AsyncScrollingCoordinator.h:
3712         * page/scrolling/ScrollingCoordinator.h:
3713         (WebCore::ScrollingCoordinator::childrenOfNode const):
3714         * rendering/RenderLayer.cpp:
3715         (WebCore::outputPaintOrderTreeLegend):
3716         (WebCore::outputPaintOrderTreeRecursive):
3717         * rendering/RenderLayer.h:
3718         * rendering/RenderLayerCompositor.cpp:
3719         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
3720         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
3721
3722 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
3723
3724         [css-logical] Implement flow-relative inset properties
3725         https://bugs.webkit.org/show_bug.cgi?id=189441
3726
3727         Reviewed by Dean Jackson.
3728
3729         Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
3730         'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
3731         behind the CSSLogicalEnabled runtime flag.
3732
3733         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
3734                webexposed/css-properties-behind-flags.html
3735
3736         * css/CSSComputedStyleDeclaration.cpp:
3737         (WebCore::isLayoutDependent):
3738         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3739         * css/CSSProperties.json:
3740         * css/CSSProperty.cpp:
3741         (WebCore::CSSProperty::resolveDirectionAwareProperty):
3742         (WebCore::CSSProperty::isDirectionAwareProperty):
3743         * css/StyleProperties.cpp:
3744         (WebCore::StyleProperties::getPropertyValue const):
3745         (WebCore::StyleProperties::asText const):
3746         * css/parser/CSSParserFastPaths.cpp:
3747         (WebCore::isSimpleLengthPropertyID):
3748         * css/parser/CSSPropertyParser.cpp:
3749         (WebCore::CSSPropertyParser::parseSingleValue):
3750         (WebCore::CSSPropertyParser::parseShorthand):
3751
3752 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
3753
3754         [css-grid] Properly handle static positions of abspos inside grid items
3755         https://bugs.webkit.org/show_bug.cgi?id=193657
3756
3757         Reviewed by Javier Fernandez.
3758
3759         Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
3760         Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
3761         and only if it's needed (not for abspos descentants in their static position).
3762         Add logicalOffsetForChild that finds the value to be set by the functions above.
3763         Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.
3764
3765         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
3766                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
3767                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
3768                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
3769                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
3770                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
3771                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
3772                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
3773                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
3774                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
3775                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
3776                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
3777                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
3778                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
3779                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
3780                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
3781                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
3782                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
3783                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
3784                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
3785                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
3786                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
3787                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
3788                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
3789                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
3790                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
3791                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
3792                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
3793                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
3794                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
3795                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
3796                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html
3797
3798         * rendering/RenderGrid.cpp:
3799         (WebCore::RenderGrid::layoutGridItems):
3800         (WebCore::RenderGrid::layoutPositionedObject):
3801         (WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
3802         (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
3803         (WebCore::RenderGrid::setLogicalPositionForChild const):
3804         (WebCore::RenderGrid::setLogicalOffsetForChild const):
3805         (WebCore::RenderGrid::logicalOffsetForChild const):
3806         * rendering/RenderGrid.h:
3807
3808 2019-01-23  Rob Buis  <rbuis@igalia.com>
3809
3810         Update MIME type parser
3811         https://bugs.webkit.org/show_bug.cgi?id=180526
3812
3813         Reviewed by Frédéric Wang.
3814
3815         Add an enum to allow two modes of MIME type parsing, one mode
3816         to keep supporting RFC2045 as before, and one mode to support
3817         the updated MIME parser from mimesniff [1]. Mimesniff support
3818         brings the following changes:
3819         - allows parameter names without matching =value.
3820         - skips whitespace after subtype, parameter value and before
3821           parameter name.
3822         - lower cases MIME type and parameter name.
3823         - parameter names parsed before are discarded.
3824
3825         The old mode is still used by CDM.cpp and MIMEHeader.cpp.
3826
3827         [1] https://mimesniff.spec.whatwg.org/
3828
3829         * Modules/encryptedmedia/CDM.cpp:
3830         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
3831         * platform/network/MIMEHeader.cpp:
3832         (WebCore::MIMEHeader::parseHeader):
3833         * platform/network/ParsedContentType.cpp:
3834         (WebCore::DummyParsedContentType::setContentType const):
3835         (WebCore::DummyParsedContentType::setContentTypeParameter const):
3836         (WebCore::isQuotedStringTokenCharacter):
3837         (WebCore::isTokenCharacter):
3838         (WebCore::parseToken):
3839         (WebCore::containsNonTokenCharacters):
3840         (WebCore::parseQuotedString):
3841         (WebCore::isNotForwardSlash):
3842         (WebCore::isNotSemicolon):
3843         (WebCore::isNotSemicolonOrEqualSign):
3844         (WebCore::parseContentType):
3845         (WebCore::isValidContentType):
3846         (WebCore::ParsedContentType::ParsedContentType):
3847         (WebCore::ParsedContentType::setContentType):
3848         (WebCore::isNonTokenCharacter):
3849         (WebCore::isNonQuotedStringTokenCharacter):
3850         (WebCore::ParsedContentType::setContentTypeParameter):
3851         * platform/network/ParsedContentType.h:
3852
3853         Test: web-platform-tests/xhr/overridemimetype-blob.html
3854
3855 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3856
3857         Introduce CustomUndoStep.h and CustomUndoStep.cpp
3858         https://bugs.webkit.org/show_bug.cgi?id=193704
3859         <rdar://problem/44807048>
3860
3861         Reviewed by Ryosuke Niwa.
3862
3863         This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
3864         class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.
3865
3866         No change in behavior.
3867
3868         * Sources.txt:
3869         * WebCore.xcodeproj/project.pbxproj:
3870         * editing/CustomUndoStep.cpp:
3871         (WebCore::CustomUndoStep::CustomUndoStep):
3872
3873         Subclass UndoStep.
3874
3875         (WebCore::CustomUndoStep::unapply):
3876         (WebCore::CustomUndoStep::reapply):
3877
3878         If possible, invoke the UndoItem's undo and redo handlers.
3879
3880         (WebCore::CustomUndoStep::isValid const):
3881         * editing/CustomUndoStep.h:
3882         * editing/EditingStyle.cpp:
3883         * editing/InsertEditableImageCommand.cpp:
3884         (WebCore::InsertEditableImageCommand::doApply):
3885
3886         Unified build fixes.
3887
3888         * page/UndoItem.h:
3889
3890 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
3891
3892         Adding a child to a ScrollingStateNode needs to trigger a tree state commit
3893         https://bugs.webkit.org/show_bug.cgi?id=193682
3894
3895         Reviewed by Zalan Bujtas.
3896
3897         Scrolling tree mutations that re-arrange nodes (e.g. node reordering when z-index changes)
3898         need to trigger scrolling tree updates, and currently do not.
3899
3900         Fix by adding a "ChildNodes" dirty bit to ScrollingStateNode. There isn't any code that consults
3901         this flag when committing the scrolling tree because we always eagerly traverse children, but
3902         we could use it to optimize later. The important part is that we use it to trigger a tree update.
3903         
3904         Can't test via z-reordering until webkit.org/b/192529 is fixed.
3905
3906         Tests: scrollingcoordinator/gain-scrolling-node-parent.html
3907                scrollingcoordinator/lose-scrolling-node-parent.html
3908
3909         * page/scrolling/ScrollingStateNode.cpp:
3910         (WebCore::ScrollingStateNode::appendChild):
3911         (WebCore::ScrollingStateNode::insertChild):
3912         (WebCore::ScrollingStateNode::removeChildAtIndex):
3913         * page/scrolling/ScrollingStateNode.h:
3914         * page/scrolling/ScrollingStateTree.cpp:
3915         (WebCore::ScrollingStateTree::attachNode):
3916
3917 2019-01-22  Devin Rousso  <drousso@apple.com>
3918
3919         Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
3920         https://bugs.webkit.org/show_bug.cgi?id=116191
3921         <rdar://problem/13905910>
3922
3923         Reviewed by Joseph Pecoraro.
3924
3925         Test inspector/timeline/line-column.html
3926
3927         * bindings/js/ScriptController.cpp:
3928         (WebCore::ScriptController::evaluateInWorld):
3929         (WebCore::ScriptController::evaluateModule):
3930
3931         * bindings/js/JSExecStateInstrumentation.h:
3932         (WebCore::JSExecState::instrumentFunctionInternal):
3933
3934         * inspector/InspectorInstrumentation.h:
3935         (WebCore::InspectorInstrumentation::willCallFunction):
3936         (WebCore::InspectorInstrumentation::willEvaluateScript):
3937         * inspector/InspectorInstrumentation.cpp:
3938         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
3939         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
3940
3941         * inspector/agents/InspectorTimelineAgent.h: