Source/WebCore:
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-04  Eric Liang  <ericliang@apple.com>
2
3         When performing Increment or Decrement on sliders, check to see if the slider is disabled.
4         https://bugs.webkit.org/show_bug.cgi?id=173497
5
6         Reviewed by Chris Fleizach.
7
8         Test: accessibility/set-value-not-work-for-disabled-sliders.html
9
10         * accessibility/AccessibilityNodeObject.cpp:
11         (WebCore::AccessibilityNodeObject::alterSliderValue):
12
13 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
14
15         IndexedDB: leak WebIDBConnectionToServer in layout tests
16         https://bugs.webkit.org/show_bug.cgi?id=193688
17         <rdar://problem/47353263>
18
19         Reviewed by Geoffrey Garen.
20
21         Let IDBConnectionToServer keep a WeakPtr of IDBConnectionToServerDelegate.
22
23         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
24         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
25         * Modules/indexeddb/client/IDBConnectionToServer.h:
26         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
27
28 2019-02-04  Youenn Fablet  <youenn@apple.com>
29
30         Make sure to remove the device observer in AVVideoCaptureSource
31         https://bugs.webkit.org/show_bug.cgi?id=194181
32         <rdar://problem/47739247>
33
34         Reviewed by Eric Carlson.
35
36         Make sure to remove the device observer when the observer is destroyed.
37         To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor.
38
39         Make also sure the session observer is also removed whenever the session is released by AVVideoCaptureSource.
40
41         Covered by manual test.
42
43        * platform/mediastream/mac/AVVideoCaptureSource.h:
44         * platform/mediastream/mac/AVVideoCaptureSource.mm:
45         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
46         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
47         (WebCore::AVVideoCaptureSource::initializeSession):
48         (WebCore::AVVideoCaptureSource::clearSession):
49         (WebCore::AVVideoCaptureSource::stopProducingData):
50         (WebCore::AVVideoCaptureSource::setupSession):
51
52 2019-02-04  Antoine Quint  <graouts@apple.com>
53
54         Use a dedicated type instead of int32_t for pointer identifiers
55         https://bugs.webkit.org/show_bug.cgi?id=194217
56
57         Reviewed by Antti Koivisto.
58
59         * WebCore.xcodeproj/project.pbxproj:
60         * dom/PointerEvent.h:
61         * dom/PointerID.h: Added.
62         * page/PointerCaptureController.cpp:
63         (WebCore::PointerCaptureController::setPointerCapture):
64         (WebCore::PointerCaptureController::releasePointerCapture):
65         (WebCore::PointerCaptureController::hasPointerCapture):
66         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
67         (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier):
68         (WebCore::PointerCaptureController::cancelPointer):
69         * page/PointerCaptureController.h:
70
71 2019-02-04  Wenson Hsieh  <wenson_hsieh@apple.com>
72
73         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
74         Followup to https://bugs.webkit.org/show_bug.cgi?id=193758
75
76         Reviewed by Daniel Bates.
77
78         Put the iOS-specific behavior behind an EditingBehavior check, rather than a compile-time guard. No change in
79         behavior.
80
81         * editing/EditingBehavior.h:
82         (WebCore::EditingBehavior::shouldMoveSelectionToEndWhenFocusingTextInput const):
83         * html/HTMLInputElement.cpp:
84         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
85
86 2019-02-04  Zalan Bujtas  <zalan@apple.com>
87
88         [LFC][IFC] Make InlineFormattingContext::collectInlineContent non-recursive.
89         https://bugs.webkit.org/show_bug.cgi?id=194210
90
91         Reviewed by Antti Koivisto.
92
93         Use iterative algorithm to collect inline content (and add breaking rules).
94         This is in preparation for fixing the inline preferred width computation.  
95
96         * layout/Verification.cpp:
97         (WebCore::Layout::resolveForRelativePositionIfNeeded):
98         * layout/inlineformatting/InlineFormattingContext.cpp:
99         (WebCore::Layout::addDetachingRules):
100         (WebCore::Layout::createAndAppendInlineItem):
101         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
102         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): Deleted.
103         * layout/inlineformatting/InlineFormattingContext.h:
104
105 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
106
107         Unreviewed, fix unused variable warnings introduced in r240912
108         https://bugs.webkit.org/show_bug.cgi?id=194198
109         <rdar://problem/47776051>
110
111         * page/FrameView.cpp:
112         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
113         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
114
115 2019-02-04  Frederic Wang  <fwang@igalia.com>
116
117         [css-scroll-snap] scroll-snap-align not honored on child with non-visible overflow
118         https://bugs.webkit.org/show_bug.cgi?id=191816
119
120         Reviewed by Wenson Hsieh.
121
122         This patch fixes a bug that prevents children of a scroll container to create snap positions
123         when they have non-visible overflow. This happens because for such a child, the function
124         RenderBox::findEnclosingScrollableContainer() will return the child itself rather than the
125         scroll container. To address that issue, we introduce a new
126         RenderObject::enclosingScrollableContainerForSnapping() helper function that ensures that
127         a real RenderBox ancestor is returned.
128
129         Test: css3/scroll-snap/scroll-snap-children-with-overflow.html
130
131         * page/scrolling/AxisScrollSnapOffsets.cpp:
132         (WebCore::updateSnapOffsetsForScrollableArea): Use enclosingScrollableContainerForSnapping()
133         so that we don't skip children with non-visible overflow.
134         * rendering/RenderLayerModelObject.cpp:
135         (WebCore::RenderLayerModelObject::styleDidChange): Ditto. The new function calls
136         enclosingBox().
137         * rendering/RenderObject.cpp:
138         (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Return
139         the scrollable container of the enclosing box. If it is actually the render object itself
140         then start the search from the parent box instead.
141         * rendering/RenderObject.h: Declare enclosingScrollableContainerForSnapping(). 
142
143 2019-02-04  Antti Koivisto  <antti@apple.com>
144
145         Rename GraphicsLayer and PlatformCALayer scrolling layer type enum values to be less ambiguous
146         https://bugs.webkit.org/show_bug.cgi?id=194215
147
148         Reviewed by Frédéric Wang.
149
150         GraphicsLayer::Type::Scrolling -> GraphicsLayer::Type::ScrollContainer
151         PlatformCALayer::LayerTypeScrollingLayer -> PlatformCALayer::LayerTypeScrollContainerLayer
152
153         * platform/graphics/GraphicsLayer.cpp:
154         (WebCore::GraphicsLayer::supportsLayerType):
155         * platform/graphics/GraphicsLayer.h:
156         * platform/graphics/ca/GraphicsLayerCA.cpp:
157         (WebCore::GraphicsLayer::supportsLayerType):
158         (WebCore::GraphicsLayerCA::initialize):
159         * platform/graphics/ca/PlatformCALayer.cpp:
160         (WebCore::operator<<):
161         * platform/graphics/ca/PlatformCALayer.h:
162         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
163         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
164         (WebCore::PlatformCALayerCocoa::commonInit):
165         * rendering/RenderLayerBacking.cpp:
166         (WebCore::RenderLayerBacking::updateScrollingLayers):
167         * rendering/RenderLayerCompositor.cpp:
168         (WebCore::RenderLayerCompositor::ensureRootLayer):
169
170 2019-02-03  Antti Koivisto  <antti@apple.com>
171
172         [iOS] Tiles not created in large scrollable iframes
173         https://bugs.webkit.org/show_bug.cgi?id=193665
174
175         Reviewed by Simon Fraser.
176
177         We are not syncing scroll position back to the graphics layer tree correctly.
178
179         Test by Frédéric Wang.
180
181         * page/scrolling/AsyncScrollingCoordinator.cpp:
182         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
183         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
184         (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
185
186         Factor setting and syncing scrolling layer positions into a function.
187         Use bounds.origin scrolling mechanic when scrollContainerLayer is present.
188
189         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
190         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
191         (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Deleted.
192         * page/scrolling/AsyncScrollingCoordinator.h:
193         * page/scrolling/ScrollingCoordinator.cpp:
194         (WebCore::ScrollingCoordinator::scrollContainerLayerForFrameView):
195         (WebCore::ScrollingCoordinator::scrolledContentsLayerForFrameView):
196         (WebCore::ScrollingCoordinator::scrollLayerForFrameView): Deleted.
197         * page/scrolling/ScrollingCoordinator.h:
198         * rendering/RenderLayerCompositor.cpp:
199
200         Rename scrollLayer to scrolledContentsLayer according to out preferred naming scheme and use it in that role only.
201         Add scrollContainerLayer as a separate layer. It is only constructed when using async scrolling on iOS.
202
203         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
204         (WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation const):
205         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
206         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
207         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
208         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
209         (WebCore::RenderLayerCompositor::frameViewDidScroll):
210         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
211         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
212         (WebCore::RenderLayerCompositor::updateLayerForHeader):
213         (WebCore::RenderLayerCompositor::updateLayerForFooter):
214         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
215         (WebCore::RenderLayerCompositor::ensureRootLayer):
216         (WebCore::RenderLayerCompositor::destroyRootLayer):
217         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
218         * rendering/RenderLayerCompositor.h:
219
220 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
221
222         Make setNeedsLayout on the root more explicitly about triggering its side-effects
223         https://bugs.webkit.org/show_bug.cgi?id=194198
224
225         Reviewed by Antti Koivisto.
226
227         Calling setNeedsLayout() on the FrameView or RenderView is an odd concept; the render tree
228         generally manages its own dirty state.
229
230         Most callers of setNeedsLayout() on the root are really trying to trigger the side-effects
231         of layout, like compositing updates, which are required when view configuration state, like
232         headers, footers and transparency, change. These dependencies are currently implicit and
233         poorly defined.
234
235         Renaming "setNeedsLayout" on FrameView is a step towards being more explicit about pure
236         rendering updates, vs updates of downstream data strutures like compositing. It's now called
237         setNeedsLayoutAfterViewConfigurationChange(). In addition, expose
238         setNeedsCompositingConfigurationUpdate() and setNeedsCompositingGeometryUpdate() so callers
239         can trigger the appropriate types of compositing updates on the root layer.
240
241         In addition, FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange() schedules a
242         layout. Withtout this, some callers would dirty the RenderView's layout but rely on some
243         other trigger to make the layout happen.
244
245         This cleanup was prompted by noticing that FrameView::setHeaderHeight() dirtied layout
246         but never scheduled it, making banner insertion in MiniBrowser unreliable.
247
248         This patch also removes the aliasing of headerHeight/footerHeight between Page and
249         FrameView. Banners are a property of Page, so FrameView fetches the banner heights
250         from Page.
251
252         * page/FrameView.cpp:
253         (WebCore::FrameView::headerHeight const):
254         (WebCore::FrameView::footerHeight const):
255         (WebCore::FrameView::availableContentSizeChanged):
256         (WebCore::FrameView::setNeedsLayoutAfterViewConfigurationChange):
257         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
258         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
259         (WebCore::FrameView::scheduleSelectionUpdate):
260         (WebCore::FrameView::setTransparent):
261         (WebCore::FrameView::setBaseBackgroundColor):
262         (WebCore::FrameView::setAutoSizeFixedMinimumHeight):
263         (WebCore::FrameView::enableAutoSizeMode):
264         (WebCore::FrameView::setHeaderHeight): Deleted.
265         (WebCore::FrameView::setFooterHeight): Deleted.
266         (WebCore::FrameView::setNeedsLayout): Deleted.
267         * page/FrameView.h:
268         * page/FrameViewLayoutContext.cpp:
269         (WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange):
270         (WebCore::FrameViewLayoutContext::setNeedsLayout): Deleted.
271         * page/FrameViewLayoutContext.h:
272         * page/Page.cpp:
273         (WebCore::Page::setPageScaleFactor):
274         (WebCore::Page::setHeaderHeight):
275         (WebCore::Page::setFooterHeight):
276         (WebCore::Page::addHeaderWithHeight): Deleted.
277         (WebCore::Page::addFooterWithHeight): Deleted.
278         * page/Page.h:
279         * rendering/RenderLayerCompositor.cpp:
280         (WebCore::RenderLayerCompositor::updateBacking):
281         * testing/Internals.cpp:
282         (WebCore::Internals::resetToConsistentState):
283         (WebCore::Internals::setHeaderHeight):
284         (WebCore::Internals::setFooterHeight):
285
286 2019-02-03  John Wilander  <wilander@apple.com>
287
288         Parse and handle Ad Click Attribution attributes in HTMLAnchorElement::handleClick()
289         https://bugs.webkit.org/show_bug.cgi?id=194104
290         <rdar://problem/47649991>
291
292         Reviewed by Chris Dumez, Daniel Bates, and Darin Adler.
293
294         Test: http/tests/adClickAttribution/anchor-tag-attributes-validation.html
295
296         This patch adds parsing and validation of the two new Ad Click Attribution
297         attributes in anchor elements: adcampaignid and addestination. The data is
298         not yet forwarded into the loader.
299
300         * html/HTMLAnchorElement.cpp:
301         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
302         (WebCore::HTMLAnchorElement::handleClick):
303             Now calls HTMLAnchorElement::parseAdClickAttribution().
304         * html/HTMLAnchorElement.h:
305         * loader/AdClickAttribution.h:
306             Made WebCore::AdClickAttribution copyable since it's needed to have it be
307             WTF::Optional. Also made AdClickAttribution::MaxEntropy public. Changed
308             numeric types from unsigned short to uint32_t.
309         (WebCore::AdClickAttribution::Campaign::isValid const):
310         (WebCore::AdClickAttribution::Conversion::isValid const):
311
312 2019-02-03  Ryosuke Niwa  <rniwa@webkit.org>
313
314         Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
315         https://bugs.webkit.org/show_bug.cgi?id=194189
316
317         Reviewed by Geoffrey Garen.
318
319         Introduced PolicyCheckIdentifier to pair each navigation policy check request with a decision,
320         and deployed it in PolicyChecker. The identifier is passed from WebContent process to UI process
321         in WebKit2, and passed it back with the policy decision.
322
323         Because PolicyCheckIdentifier embeds the process identifier from which a navigation policy is checked,
324         we would be able to detect when UI process had sent the decision to a wrong WebContent process.
325
326         This patch also adds release assertions to make sure history().provisionalItem() is set whenever
327         we're requesting a navigation policy check.
328
329         These code changes should either:
330         1. Fix crashes in FrameLoader::continueLoadAfterNavigationPolicy where isBackForwardLoadType would
331            return true yet history().provisionalItem() is null.
332         2. Detect a bug that UI process can send a navigation policy decision to a wrong WebContent process.
333         3. Rule out the possibility that (2) exists.
334
335         * loader/DocumentLoader.cpp:
336         (WebCore::DocumentLoader::willSendRequest):
337         (WebCore::DocumentLoader::responseReceived):
338         * loader/EmptyClients.cpp:
339         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
340         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
341         * loader/EmptyFrameLoaderClient.h:
342         * loader/FrameLoader.cpp:
343         (WebCore::FrameLoader::checkContentPolicy):
344         (WebCore::FrameLoader::loadURL):
345         (WebCore::FrameLoader::load):
346         (WebCore::FrameLoader::loadWithDocumentLoader):
347         (WebCore::FrameLoader::loadPostRequest):
348         * loader/FrameLoader.h:
349         * loader/FrameLoaderClient.h:
350         * loader/FrameLoaderTypes.h:
351         (WebCore::PolicyCheckIdentifier): Added.
352         (WebCore::PolicyCheckIdentifier::operator== const): Added.
353         (WebCore::PolicyCheckIdentifier::PolicyCheckIdentifier): Added.
354         (WebCore::PolicyCheckIdentifier::encode const): Added.
355         (WebCore::PolicyCheckIdentifier::decode): Added.
356         * loader/PolicyChecker.cpp:
357         (WebCore::PolicyCheckIdentifier::generate):
358         (WebCore::PolicyCheckIdentifier::isValidFor): Returns true if the identifer matches. Also release asserts
359         that the process ID is same, and that m_check is always not zero (meaning it's a generated value).
360         The failure of these release assertions would indicate that there is a bug in UI process, which results in
361         a policy decision response being sent to a wrong Web process.
362         (WebCore::PolicyChecker::checkNavigationPolicy): Exit early if isValidFor fails.
363         (WebCore::PolicyChecker::checkNewWindowPolicy):
364
365 2019-02-03  Antti Koivisto  <antti@apple.com>
366
367         Don't include ScrollCoordinator.h from Element.h
368         https://bugs.webkit.org/show_bug.cgi?id=194206
369
370         Reviewed by Daniel Bates.
371
372         * dom/Element.h:
373
374 2019-02-03  Wenson Hsieh  <wenson_hsieh@apple.com>
375
376         Unable to move selection into editable roots with 0 height
377         https://bugs.webkit.org/show_bug.cgi?id=194143
378         <rdar://problem/47767284>
379
380         Reviewed by Ryosuke Niwa.
381
382         Currently, positions inside editable elements of height 0 are not considered to be candidates when
383         canonicalizing a position to its visible counterpart. This prevents us from moving the selection into these
384         editable roots at all. To fix this, we relax this constraint by allowing positions anchored by root editable
385         elements to be candidates.
386
387         Test: editing/selection/insert-text-in-empty-content-editable.html
388
389         * dom/Position.cpp:
390         (WebCore::Position::isCandidate const):
391
392 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
393
394         Tidyup of Pagination and FrameView m_mediaType initialization
395         https://bugs.webkit.org/show_bug.cgi?id=194203
396
397         Reviewed by Darin Adler.
398
399         Fix post-commit feedback on lines around code changed in r240901.
400
401         * page/FrameView.cpp:
402         (WebCore::FrameView::FrameView):
403         * page/FrameView.h:
404         * rendering/Pagination.h:
405         (WebCore::Pagination::operator!= const):
406
407 2019-02-03  Megan Gardner  <megan_gardner@apple.com>
408
409         Turn on Smart Paste
410         https://bugs.webkit.org/show_bug.cgi?id=193786
411
412         Reviewed by Ryosuke Niwa.
413
414         Turned on a modified tests:
415         LayoutTests/editing/pasteboard/smart-paste-001.html
416         LayoutTests/editing/pasteboard/smart-paste-002.html
417         LayoutTests/editing/pasteboard/smart-paste-003.html
418         LayoutTests/editing/pasteboard/smart-paste-004.html
419         LayoutTests/editing/pasteboard/smart-paste-005.html
420         LayoutTests/editing/pasteboard/smart-paste-006.html
421         LayoutTests/editing/pasteboard/smart-paste-007.html
422         LayoutTests/editing/pasteboard/smart-paste-008.html
423
424         * platform/ios/PasteboardIOS.mm:
425         (WebCore::Pasteboard::canSmartReplace):
426         Turn on smart replace.
427
428 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
429
430         Tidy up data memebers of FrameView and related classes to shrink class sizes
431         https://bugs.webkit.org/show_bug.cgi?id=194197
432
433         Reviewed by Zalan Bujtas.
434
435         Make various enums 8-bit. Re-order data members of FrameView, FrameViewLayoutContext, Widget
436         and ScrollView to optimize padding.
437
438         Use more data member initializers.
439
440         This shrinks FrameView from 1168 (144 padding bytes) to 1096 (96 padding bytes).
441
442         * dom/Element.h:
443         * page/FrameView.cpp:
444         (WebCore::FrameView::FrameView):
445         * page/FrameView.h:
446         * page/FrameViewLayoutContext.h:
447         * platform/ScrollTypes.h:
448         * platform/ScrollView.h: Data members should come after member functions.
449         * platform/Widget.h:
450         * rendering/Pagination.h:
451         (WebCore::Pagination::Pagination): Deleted.
452
453 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
454
455         Rename "scrollingLayer" in RenderLayerBacking to "scrollContainerLayer" for clarity
456         https://bugs.webkit.org/show_bug.cgi?id=194194
457
458         Rubber-stampted by Antti Koivisto.
459
460         Our desired terminology is "scrollContainerLayer" for the outer, clipping layer
461         for scrolling, and "scrolledContentsLayer" for the contents that move when you scroll.
462
463         * rendering/RenderLayerBacking.cpp:
464         (WebCore::RenderLayerBacking::updateDebugIndicators):
465         (WebCore::RenderLayerBacking::destroyGraphicsLayers):
466         (WebCore::RenderLayerBacking::updateGeometry):
467         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
468         (WebCore::RenderLayerBacking::updateAfterDescendants):
469         (WebCore::RenderLayerBacking::updateInternalHierarchy):
470         (WebCore::RenderLayerBacking::updateDrawsContent):
471         (WebCore::RenderLayerBacking::updateScrollingLayers):
472         * rendering/RenderLayerBacking.h:
473         * rendering/RenderLayerCompositor.cpp:
474         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
475         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
476         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
477         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
478         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
479         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
480
481 2019-02-02  Justin Fan  <justin_fan@apple.com>
482
483         [Web GPU] Fix GPURenderPassEncoder::setVertexBuffers and allow overlapping indices with GPUBindGroups
484         https://bugs.webkit.org/show_bug.cgi?id=194125
485
486         Reviewed by Myles C. Maxfield.
487
488         GPURenderPassEncoder::setVertexBuffers is now actually written to set all buffers provided. In addition,
489         shift vertex input buffer indices so that any resource bindings can bind vertex buffer resources to the same indices. 
490
491         Existing tests cover setVertexBuffers. Updated buffer-resource-triangles to assign bind groups and vertex buffers to the same index.
492
493         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp: Added.
494         (WebCore::WHLSL::Metal::calculateVertexBufferIndex): Simple shifting function for vertex input buffer indices.
495         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h: Added.
496         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
497         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Limit maximum bind group indices to 0 to 3.
498         * Modules/webgpu/WebGPURenderPassEncoder.cpp: 
499         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Limit vertex input indices to 0 to 15.
500         * Modules/webgpu/WebGPURenderPassEncoder.h: Move IDL/bindings bug note to IDL file.
501         * Modules/webgpu/WebGPURenderPassEncoder.idl: Ditto.
502         * platform/graphics/gpu/GPULimits.h: Added. Home for Web GPU limits constants shared between files.
503         * platform/graphics/gpu/GPURenderPassEncoder.h: Change IDL/bindings bug workaround to unsigned long long to prevent narrowing compared to spec.
504         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
505         (WebCore::GPURenderPassEncoder::setVertexBuffers): Now properly calls Metal's setVertexBuffers. 
506         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
507         (WebCore::setInputStateForPipelineDescriptor): Fix validation checks for vertex attribute numbers and vertex buffer indices. 
508
509         Add symbols to project:
510         * Sources.txt:
511         * WebCore.xcodeproj/project.pbxproj:
512
513 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
514
515         Async overflow scroll is jumpy on macOS if the main thread is busy
516         https://bugs.webkit.org/show_bug.cgi?id=194184
517         <rdar://problem/47758655>
518
519         Reviewed by Antti Koivisto.
520
521         This change extends to macOS some existing overflow-scroll functionality for iOS.
522         When an async scroll is in process in the scroll thread (or UI process), we periodically
523         message back to the web process main thread with scroll position updates. These
524         can trigger post-scroll compositing updates, but we need to ensure that this update
525         doesn't clobber the scroll position of the native layers, which would trigger
526         stutters.
527
528         To do this we have the notion of a scroll position "sync" (ScrollingLayerPositionAction::Sync) which
529         pokes the new value into the GraphicsLayer (hence making visible rect computations work), but doesn't
530         propagate it to the platform layer. This patch wires up syncs for macOS during async overflow scrolling,
531         coming out of AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll().
532
533         In RenderLayerBacking, m_scrollingContentsLayer is renamed to m_scrolledContentsLayer, and I added
534         updateScrollOffset() and setLocationOfScrolledContents() to handle the set vs. sync, and to keep
535         the iOS vs macOS differences in one function. This allows for more code sharing in RenderLayerBacking::updateGeometry().
536
537         There's a confusing bit in the m_childClippingMaskLayer code (trac.webkit.org/178029) where the setOffsetFromRenderer()
538         just looks wrong; it should match m_scrollingLayer. This code is never hit for Cocoa, which never has m_childClippingMaskLayer.
539
540         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
541         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Logging
542         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Logging
543         * rendering/RenderLayer.cpp:
544         (WebCore::RenderLayer::RenderLayer):
545         (WebCore::RenderLayer::scrollTo):
546         * rendering/RenderLayer.h: Rename m_requiresScrollBoundsOriginUpdate to m_requiresScrollPositionReconciliation
547         and make it available on all platforms. Just reorder m_adjustForIOSCaretWhenScrolling to reduce #ifdef nesting confusion.
548         * rendering/RenderLayerBacking.cpp:
549         (WebCore::RenderLayerBacking::updateDebugIndicators):
550         (WebCore::RenderLayerBacking::destroyGraphicsLayers):
551         (WebCore::RenderLayerBacking::updateGeometry):
552         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
553         (WebCore::RenderLayerBacking::updateScrollOffset):
554         (WebCore::RenderLayerBacking::updateDrawsContent):
555         (WebCore::RenderLayerBacking::updateScrollingLayers):
556         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const):
557         (WebCore::RenderLayerBacking::parentForSublayers const):
558         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
559         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
560         (WebCore::RenderLayerBacking::paintContents):
561         (WebCore::RenderLayerBacking::backingStoreMemoryEstimate const):
562         * rendering/RenderLayerBacking.h:
563
564 2019-02-02  Zalan Bujtas  <zalan@apple.com>
565
566         [LFC] Initialize ICB's style with fixed width/height.
567         https://bugs.webkit.org/show_bug.cgi?id=194188
568
569         Reviewed by Antti Koivisto.
570
571         Let's set ICB's logical width/height to Fixed so that it's available when we try to resolve a box's height
572         in FormattingContext::Geometry::computedHeightValue() by using the containing block's height (ICB in this case).
573
574         * layout/LayoutState.cpp:
575         (WebCore::Layout::LayoutState::LayoutState):
576         * layout/LayoutState.h:
577         * layout/layouttree/LayoutTreeBuilder.cpp:
578         (WebCore::Layout::TreeBuilder::createLayoutTree):
579
580 2019-02-02  Zalan Bujtas  <zalan@apple.com>
581
582         [LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
583         https://bugs.webkit.org/show_bug.cgi?id=194185
584
585         Reviewed by Antti Koivisto.
586
587         If none of horizontal values (left, right, width, margin-left/right) are auto, then usedHorizontalMarginValues = computedHorizontalMarginValues.
588
589         Test: fast/block/block-only/absolute-position-left-right-margin.html
590
591         * layout/FormattingContextGeometry.cpp:
592         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
593
594 2018-12-16  Darin Adler  <darin@apple.com>
595
596         Convert additional String::format clients to alternative approaches
597         https://bugs.webkit.org/show_bug.cgi?id=192746
598
599         Reviewed by Alexey Proskuryakov.
600
601         This round of conversions covers less-trivial cases such as floating
602         point numerals and hexadecimal. Not yet taking on pointer serialization
603         ("%p") or padding with spaces of zero digits, so call sites using those
604         have been left untouched.
605
606         In some cases these new idioms are a bit clumsy, and we could follow up
607         with additional convenience functions to make them more elegant.
608
609         * Modules/indexeddb/IDBKeyData.cpp:
610         (WebCore::IDBKeyData::loggingString const): Use more ASCIILiteral and
611         more appendLiteral for efficiency. Use upperNibbleToLowercaseASCIIHexDigit,
612         lowerNibbleToLowercaseASCIIHexDigit, and also makeString and FormattedNumber.
613
614         * css/MediaQueryEvaluator.cpp:
615         (WebCore::aspectRatioValueAsString): Use makeString and FormattedNumber.
616         Doing it this way makes it a little clearer that we have an unpleasant
617         use of fixed 6-digit precision here.
618
619         * html/FTPDirectoryDocument.cpp:
620         (WebCore::processFilesizeString): Use makeString and FormattedNumber.
621         * html/track/VTTCue.cpp:
622         (WebCore::VTTCueBox::applyCSSProperties): Ditto.
623         * page/CaptionUserPreferencesMediaAF.cpp:
624         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const): Ditto.
625         * page/History.cpp:
626         (WebCore::History::stateObjectAdded): Ditto.
627         * page/cocoa/ResourceUsageOverlayCocoa.mm:
628         (WebCore::formatByteNumber): Ditto.
629         (WebCore::gcTimerString): Use String::number.
630         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and FormattedNumber.
631
632         * page/scrolling/AxisScrollSnapOffsets.cpp:
633         (WebCore::snapOffsetsToString): Removed some unnecessary copying in the for loop,
634         use appendLiteral, and use appendFixedWidthNumber.
635         (WebCore::snapOffsetRangesToString): Ditto.
636         (WebCore::snapPortOrAreaToString): Use makeString and FormattedNumber.
637
638         * platform/animation/TimingFunction.cpp:
639         (WebCore::TimingFunction::cssText const): Use makeString.
640
641         * platform/cocoa/KeyEventCocoa.mm:
642         (WebCore::keyIdentifierForCharCode): Use makeString and the ASCIIHexDigit
643         functions.
644         * platform/graphics/Color.cpp:
645         (WebCore::Color::nameForRenderTreeAsText const): Ditto.
646
647         * platform/mock/MockRealtimeVideoSource.cpp:
648         (WebCore::MockRealtimeVideoSource::drawText): Use makeString and FormattedNumber.
649
650         * platform/text/PlatformLocale.cpp:
651         (WebCore::DateTimeStringBuilder::visitField): Use String::numberToStringFixedWidth.
652
653 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
654
655         Remove the unused layerForScrolling()
656         https://bugs.webkit.org/show_bug.cgi?id=194180
657
658         Reviewed by Zalan Bujtas.
659
660         Remove ScrollableArea::layerForScrolling() and derivations. This was unused.
661
662         * page/FrameView.cpp:
663         (WebCore::FrameView::layerForScrolling const): Deleted.
664         * page/FrameView.h:
665         * page/scrolling/ScrollingCoordinator.cpp:
666         (WebCore::ScrollingCoordinator::scrollLayerForScrollableArea): Deleted.
667         * page/scrolling/ScrollingCoordinator.h:
668         * platform/ScrollableArea.h:
669         (WebCore::ScrollableArea::layerForScrolling const): Deleted.
670         * rendering/RenderLayer.cpp:
671         (WebCore::RenderLayer::calculateClipRects const):
672         * rendering/RenderLayer.h:
673
674 2019-02-01  Zalan Bujtas  <zalan@apple.com>
675
676         [LFC] Fix statically positioned replaced out-of-flow horizontal geometry
677         https://bugs.webkit.org/show_bug.cgi?id=194163
678
679         Reviewed by Simon Fraser.
680
681         Fix a typo.
682
683         * layout/FormattingContextGeometry.cpp:
684         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
685
686 2019-02-01  Chris Dumez  <cdumez@apple.com>
687
688         REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
689         https://bugs.webkit.org/show_bug.cgi?id=193740
690         <rdar://problem/47527267>
691
692         Reviewed by Alex Christensen.
693
694         * loader/DocumentLoader.cpp:
695         (WebCore::DocumentLoader::willSendRequest):
696         (WebCore::DocumentLoader::continueAfterContentPolicy):
697         * loader/FrameLoader.cpp:
698         (WebCore::FrameLoader::loadURL):
699         (WebCore::FrameLoader::loadWithDocumentLoader):
700         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
701         * loader/FrameLoader.h:
702         * loader/FrameLoaderTypes.h:
703         * loader/PolicyChecker.cpp:
704         (WebCore::PolicyChecker::checkNavigationPolicy):
705         (WebCore::PolicyChecker::checkNewWindowPolicy):
706         * loader/PolicyChecker.h:
707
708 2019-02-01  Antoine Quint  <graouts@apple.com>
709
710         Dispatch pointercancel events when content is panned or zoomed on iOS
711         https://bugs.webkit.org/show_bug.cgi?id=193962
712         <rdar://problem/47629134>
713
714         Reviewed by Dean Jackson.
715
716         Expose two new methods on PointerCaptureController so that, given a pointer id, it can be established whether this pointer
717         has been cancelled, which is important because a cancelled pointer should no longer dispatch any further pointer events, and
718         to cancel a pointer.
719
720         Tests: pointerevents/ios/touch-action-pointercancel-pan-x.html
721                pointerevents/ios/touch-action-pointercancel-pan-y.html
722                pointerevents/ios/touch-action-pointercancel-pinch-zoom.html
723
724         * WebCore.xcodeproj/project.pbxproj: Make PointerCaptureController.h Private so that it can be imported from WebKit.
725         * dom/PointerEvent.h: Remove an unnecessary #if ENABLE(POINTER_EVENTS) since the entire file is already contained in one.
726         Then we add a new create() method that takes an event type, a pointer id and a pointer type (touch vs. pen) that we use
727         to create pointercancel events in PointerCaptureController::cancelPointer().
728         * page/Page.cpp:
729         (WebCore::Page::Page): Pass the Page as a parameter when creating the PointerCaptureController.
730         * page/PointerCaptureController.cpp:
731         (WebCore::PointerCaptureController::PointerCaptureController): Add a Page reference to the constructor since we'll need
732         the page to access its main frame's EventHandler to perform hit testing in case we do not have a capture target override
733         in cancelPointer().
734         (WebCore::PointerCaptureController::releasePointerCapture): Drive-by, remove the the implicit parameter since on iOS we
735         don't need to differentiate. We'll bring this back for the macOS work.
736         (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): New method we'll use when dispatching pointer
737         events to identify whether a pointer id has already been cancelled which will allow for _not_ dispatching any further
738         pointer events for this pointer id.
739         (WebCore::PointerCaptureController::pointerEventWillBeDispatched): Keep track of the pointer type so we can preserve it
740         when dispatching pointercancel events for a given pointer id.
741         (WebCore::PointerCaptureController::cancelPointer): Dispatch a pointercancel for the provided pointer id, using the capture
742         target override as the event's target, if there is one, and otherwise hit-testing at the provided location to figure out
743         what the target should be.
744         * page/PointerCaptureController.h: Switch the target overrides from Element* to RefPtr<Element> to ensure it may not be
745         deleted while we still need them. Existing code already ensures these get set to nullptr.
746
747 2019-02-01  Jer Noble  <jer.noble@apple.com>
748
749         Make the WebKit default for media source based on the WebCore default.
750         https://bugs.webkit.org/show_bug.cgi?id=194172
751
752         Reviewed by Eric Carlson.
753
754         * page/SettingsBase.h:
755
756 2019-02-01  Joseph Pecoraro  <pecoraro@apple.com>
757
758         Web Inspector: Memory timeline starts from zero when both CPU and Memory timeline are enabled
759         https://bugs.webkit.org/show_bug.cgi?id=194111
760         <rdar://problem/47714555>
761
762         Rubber-stamped by Devin Rousso.
763
764         * page/ResourceUsageThread.cpp:
765         (WebCore::ResourceUsageThread::waitUntilObservers):
766         (WebCore::ResourceUsageThread::threadBody):
767         Wait a short period of time before the first listener registers
768         and we start sampling. This will allow multiple listeners to
769         register, each that wants different data.
770
771 2019-02-01  Antti Koivisto  <antti@apple.com>
772
773         Don't use base layer() as the scroll layer in scrolling tree.
774         https://bugs.webkit.org/show_bug.cgi?id=194160
775
776         Reviewed by Simon Fraser.
777
778         Maintain scrollContainerLayer() and scrolledContentsLayer() separately in ScrollingTreeScrollingNode.
779
780         * page/scrolling/AsyncScrollingCoordinator.cpp:
781         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
782         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
783         * page/scrolling/AsyncScrollingCoordinator.h:
784         * page/scrolling/ScrollingCoordinator.h:
785         (WebCore::ScrollingCoordinator::setNodeLayers):
786
787         Turn the long layer parameter list into a struct.
788
789         * page/scrolling/ScrollingStateNode.cpp:
790         (WebCore::ScrollingStateNode::ScrollingStateNode):
791         (WebCore::ScrollingStateNode::setAllPropertiesChanged):
792         (WebCore::ScrollingStateNode::setLayer):
793         * page/scrolling/ScrollingStateNode.h:
794         * page/scrolling/ScrollingStateScrollingNode.cpp:
795         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
796         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
797         (WebCore::ScrollingStateScrollingNode::setScrollContainerLayer):
798         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
799         * page/scrolling/ScrollingStateScrollingNode.h:
800         (WebCore::ScrollingStateScrollingNode::scrollContainerLayer const):
801         * page/scrolling/ScrollingTree.cpp:
802         (WebCore::ScrollingTree::commitTreeState):
803         * page/scrolling/ScrollingTreeScrollingNode.cpp:
804         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
805         * page/scrolling/ScrollingTreeScrollingNode.h:
806         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const):
807         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const):
808         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
809         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
810         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
811         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition const):
812         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
813         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
814         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
815         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
816         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
817         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
818         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
819         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
820         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const):
821         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
822         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
823         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
824         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
825         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
826         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
827         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
828         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
829         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
830         * rendering/RenderLayerCompositor.cpp:
831         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
832         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
833         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
834         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
835
836 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
837
838         REGRESSION (r240698): fast/scrolling/sticky-to-fixed.html can cause a crash
839         https://bugs.webkit.org/show_bug.cgi?id=194134
840         rdar://problem/47721210
841
842         Reviewed by Daniel Bates.
843
844         fast/scrolling/sticky-to-fixed.html changes the scrolling node type, which causes
845         scrollingCoordinator->insertNode() to return a different ScrollingNodeID to the one
846         passed in. We have to handle this, removing the node for the nodeID and unregistering
847         the layer with the old nodeID.
848
849         * rendering/RenderLayerCompositor.cpp:
850         (WebCore::RenderLayerCompositor::attachScrollingNode):
851
852 2019-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
853
854         REGRESSION(r239915): css3/font-feature-font-face-local.html failing on WPE
855         https://bugs.webkit.org/show_bug.cgi?id=194008
856
857         Reviewed by Žan Doberšek.
858
859         We need to replace control characters with zero width space too.
860
861         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
862         (WebCore::GlyphPage::fill):
863         * platform/text/CharacterProperties.h:
864         (WebCore::isControlCharacter):
865
866 2019-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
867
868         ComplexText: Test fast/text/word-space-nbsp.html fails when using complex text path
869         https://bugs.webkit.org/show_bug.cgi?id=193279
870
871         Reviewed by Michael Catanzaro.
872
873         The fix applied in r135884 to WidthIterator should also be applied to ComplexTextController.
874
875         * platform/graphics/ComplexTextController.cpp:
876         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
877
878 2019-02-01  Zalan Bujtas  <zalan@apple.com>
879
880         [LFC] Adjust replaced element's intrinsic ratio
881         https://bugs.webkit.org/show_bug.cgi?id=194154
882
883         Reviewed by Antti Koivisto.
884
885         Decouple image and iframe replaced types and set intrinsic ratio accordingly.
886
887         * layout/layouttree/LayoutBox.cpp:
888         (WebCore::Layout::Box::Box):
889         * layout/layouttree/LayoutBox.h:
890         (WebCore::Layout::Box::isReplaced const):
891         (WebCore::Layout::Box::isIFrame const):
892         (WebCore::Layout::Box::isImage const):
893         * layout/layouttree/LayoutReplaced.cpp:
894         (WebCore::Layout::Replaced::hasIntrinsicRatio const):
895         (WebCore::Layout::Replaced::intrinsicRatio const):
896         (WebCore::Layout::Replaced::hasAspectRatio const):
897         * layout/layouttree/LayoutReplaced.h:
898         * layout/layouttree/LayoutTreeBuilder.cpp:
899         (WebCore::Layout::TreeBuilder::createSubTree):
900
901 2019-02-01  Zalan Bujtas  <zalan@apple.com>
902
903         [LFC] Set intrinsic size on Layout::Replaced
904         https://bugs.webkit.org/show_bug.cgi?id=194139
905
906         Reviewed by Antti Koivisto.
907
908         Eventually Layout::Replaced will track intrinsic size internally until then let's query the RenderReplaced. 
909
910         * layout/layouttree/LayoutBox.h:
911         (WebCore::Layout::Box::replaced):
912         * layout/layouttree/LayoutReplaced.cpp:
913         (WebCore::Layout::Replaced::hasIntrinsicWidth const):
914         (WebCore::Layout::Replaced::hasIntrinsicHeight const):
915         (WebCore::Layout::Replaced::intrinsicWidth const):
916         (WebCore::Layout::Replaced::intrinsicHeight const):
917         * layout/layouttree/LayoutReplaced.h:
918         (WebCore::Layout::Replaced::setIntrinsicSize):
919         (WebCore::Layout::Replaced::setIntrinsicRatio):
920         * layout/layouttree/LayoutTreeBuilder.cpp:
921         (WebCore::Layout::TreeBuilder::createSubTree):
922         * rendering/RenderReplaced.h:
923
924 2019-02-01  Claudio Saavedra  <csaavedra@igalia.com>
925
926         Race-condition during scrolling thread creation
927         https://bugs.webkit.org/show_bug.cgi?id=194016
928
929         Reviewed by Saam Barati.
930
931         There is a threading issue during the initialization
932         of the scrolling thread caused by createThreadIfNeeded
933         locking only on the creation of the thread but not on
934         the initialization of the main loop, making it possible
935         for a thread to try to spin the main loop before it's
936         created.
937
938         Fix this by unconditionally waiting on the main loop
939         being created. This makes it necessary to always hold
940         the lock, even when the thread is already created.
941
942         * page/scrolling/ScrollingThread.cpp:
943         (WebCore::ScrollingThread::createThreadIfNeeded):
944
945 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
946
947         Use ScrollingNodeID in more places, and improve the name of a ScrollableArea function that returns a ScrollingNodeID
948         https://bugs.webkit.org/show_bug.cgi?id=194126
949
950         Reviewed by Frédéric Wang.
951         
952         Change uint64_t ScrollableArea::scrollLayerID() to ScrollingNodeID ScrollableArea::scrollingNodeID()
953         and fix callers.
954
955         * page/FrameView.cpp:
956         (WebCore::FrameView::scrollingNodeID const):
957         (WebCore::FrameView::scrollLayerID const): Deleted.
958         * page/FrameView.h:
959         * page/scrolling/AsyncScrollingCoordinator.cpp:
960         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
961         (WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
962         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
963         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
964         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
965         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
966         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
967         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
968         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
969         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
970         (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
971         (WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
972         * page/scrolling/ScrollingCoordinatorTypes.h:
973         * platform/ScrollTypes.h:
974         * platform/ScrollableArea.h:
975         (WebCore::ScrollableArea::scrollingNodeID const):
976         (WebCore::ScrollableArea::scrollLayerID const): Deleted.
977         * rendering/RenderLayerCompositor.cpp:
978         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
979         (WebCore::RenderLayerCompositor::detachRootLayer):
980
981 2019-01-31  Myles C. Maxfield  <mmaxfield@apple.com>
982
983         [WHLSL] Expressions can't be copyable
984         https://bugs.webkit.org/show_bug.cgi?id=194116
985
986         Reviewed by Keith Rollin.
987
988         Expressions have UniqueRef members, which can't be copied. Describe this constraint explicitly rather than implicitly.
989
990         No new tests because there is no behavior change.
991
992         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
993         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
994
995 2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
996
997         [Curl] Remove unnecessary member from NetworkStorageSession.
998         https://bugs.webkit.org/show_bug.cgi?id=194137
999
1000         Reviewed by Don Olmstead.
1001
1002         No new tests since there is no behavior change.
1003
1004         * platform/network/NetworkStorageSession.h:
1005         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1006         (WebCore::NetworkStorageSession::NetworkStorageSession):
1007         (WebCore::NetworkStorageSession::context const): Deleted.
1008
1009 2019-01-31  Jer Noble  <jer.noble@apple.com>
1010
1011         NSInvalidArgumentException in [WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]
1012         https://bugs.webkit.org/show_bug.cgi?id=194123
1013         <rdar://problem/47721094>
1014
1015         Reviewed by Eric Carlson.
1016
1017         According to crash logs, AVSampleBufferDisplayLayer.error can go from an NSError* to nil; when such a change is KVO'd,
1018         the NSKeyValueChangeNewKey is a NSNull. Detect this state and bail out early.
1019
1020         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1021         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1022
1023 2019-01-31  Jer Noble  <jer.noble@apple.com>
1024
1025         [Cocoa][EME] AirPlaying a FairPlay-protected HLS stream fails to decrypt
1026         https://bugs.webkit.org/show_bug.cgi?id=194114
1027
1028         Reviewed by Eric Carlson.
1029
1030         The AVAssetResourceLoaderDelegate must explicitly... delegate responsibility for FairPlay key
1031         requests to the AVContentKeySession.
1032
1033         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1034         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1035
1036 2019-01-31  Megan Gardner  <megan_gardner@apple.com>
1037
1038         Don't insert spaces at the beginning of a newline when using smart-copy-paste
1039         https://bugs.webkit.org/show_bug.cgi?id=194070
1040
1041         Reviewed by Tim Horton.
1042
1043         If our inserted content end is at the beginning of a paragraph, do not insert a space.
1044         Also, if our inserted content beginning is at the end of a paragraph, do not insert a space.
1045
1046         Test: editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea.html
1047
1048         * editing/ReplaceSelectionCommand.cpp:
1049         (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
1050
1051 2019-01-31  Justin Fan  <justin_fan@apple.com>
1052
1053         [WebGPU] Build fix: disable MTLCopyAllDevices call on non-Mac platforms
1054         https://bugs.webkit.org/show_bug.cgi?id=194120
1055
1056         Unreviewed build fix. 
1057
1058         No new tests; no change in behavior.
1059
1060         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
1061         (WebCore::GPUDevice::create): Wrap problem code in #if PLATFORM(MAC).
1062
1063 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
1064
1065         Basic scrollability for async overflow scrolling on macOS
1066         https://bugs.webkit.org/show_bug.cgi?id=194093
1067
1068         Reviewed by Antti Koivisto.
1069
1070         Give a ScrollingTreeOverflowScrollingNodeMac a ScrollingTreeScrollingNodeDelegateMac and have it keep track
1071         of its layers so basic scrolling works for async overflow scroll.
1072
1073         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1074         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1075         (WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
1076         (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
1077         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
1078         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
1079         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
1080         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
1081         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
1082         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
1083         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
1084         * rendering/RenderLayerBacking.cpp:
1085         (WebCore::RenderLayerBacking::updateScrollingLayers):
1086
1087 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
1088
1089         Generalize ScrollingTreeScrollingNodeDelegate for use in macOS too, add a macOS subclass for frame/overflow scrolling
1090         https://bugs.webkit.org/show_bug.cgi?id=194080
1091
1092         Reviewed by Antti Koivisto.
1093
1094         To share code between ScrollingTreeFrameScrollingNodeMac and ScrollingTreeOverflowScrollingNodeMac, build ScrollingTreeScrollingNodeDelegate
1095         for macOS too, and add some helper functions to ScrollingTreeScrollingNodeDelegate.
1096
1097         Add a macOS subclass, ScrollingTreeScrollingNodeDelegateMac, which takes over the basic scrolling, rubber-banding
1098         and scroll snapping functionality from ScrollingTreeFrameScrollingNodeMac. The delegate owns the ScrollController and
1099         implements ScrollControllerClient.
1100
1101         ScrollingTreeFrameScrollingNodeMac now owns a ScrollingTreeScrollingNodeDelegateMac. A future patch
1102         will add one to ScrollingTreeOverflowScrollingNodeMac.
1103
1104         No behavior change.
1105
1106         * SourcesCocoa.txt:
1107         * WebCore.xcodeproj/project.pbxproj:
1108         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1109         (WebCore::ScrollingTreeFrameScrollingNode::scrollBy): Deleted.
1110         (WebCore::ScrollingTreeFrameScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
1111         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1112         (WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor const):
1113         * page/scrolling/ScrollingTreeNode.cpp:
1114         (WebCore::ScrollingTreeNode::isRootNode const):
1115         * page/scrolling/ScrollingTreeNode.h:
1116         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1117         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
1118         (WebCore::ScrollingTreeScrollingNode::scrollBy):
1119         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints):
1120         * page/scrolling/ScrollingTreeScrollingNode.h:
1121         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const):
1122         * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp:
1123         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
1124         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const):
1125         (WebCore::ScrollingTreeScrollingNodeDelegate::minimumScrollPosition const):
1126         (WebCore::ScrollingTreeScrollingNodeDelegate::maximumScrollPosition const):
1127         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollableAreaSize const):
1128         (WebCore::ScrollingTreeScrollingNodeDelegate::totalContentsSize const):
1129         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledHorizontalScrollbar const):
1130         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledVerticalScrollbar const):
1131         (WebCore::ScrollingTreeScrollingNodeDelegate::horizontalScrollElasticity const):
1132         (WebCore::ScrollingTreeScrollingNodeDelegate::verticalScrollElasticity const):
1133         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1134         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1135         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
1136         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1137         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1138         (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition const):
1139         (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition const):
1140         (WebCore::newGestureIsStarting): Deleted.
1141         (WebCore::ScrollingTreeFrameScrollingNodeMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
1142         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching): Deleted.
1143         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching): Deleted.
1144         (WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount): Deleted.
1145         (WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection): Deleted.
1146         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally): Deleted.
1147         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically): Deleted.
1148         (WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection): Deleted.
1149         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy): Deleted.
1150         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints): Deleted.
1151         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
1152         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary): Deleted.
1153         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset const): Deleted.
1154         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Deleted.
1155         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor const): Deleted.
1156         (WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Deleted.
1157         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Deleted.
1158         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtent const): Deleted.
1159         (WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize const): Deleted.
1160         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason const): Deleted.
1161         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason const): Deleted.
1162         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h.
1163         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: Added.
1164         (WebCore::ScrollingTreeScrollingNodeDelegateMac::ScrollingTreeScrollingNodeDelegateMac):
1165         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollSnapPoints):
1166         (WebCore::ScrollingTreeScrollingNodeDelegateMac::setActiveScrollSnapIndexForAxis):
1167         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexForAxis const):
1168         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexDidChange const):
1169         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
1170         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isScrollSnapInProgress const):
1171         (WebCore::newGestureIsStarting):
1172         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
1173         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching):
1174         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching):
1175         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
1176         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
1177         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally):
1178         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically):
1179         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection):
1180         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollBy):
1181         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
1182         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer):
1183         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
1184         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
1185         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
1186         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pageScaleFactor const):
1187         (WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer):
1188         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer):
1189         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollExtent const):
1190         (WebCore::ScrollingTreeScrollingNodeDelegateMac::viewportSize const):
1191         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const):
1192         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const):
1193
1194 2019-01-31  Jer Noble  <jer.noble@apple.com>
1195
1196         [Mac] Requesting PiP from two different WebViews gets PiP window "stuck"
1197         https://bugs.webkit.org/show_bug.cgi?id=194099
1198         <rdar://problem/47271323>
1199
1200         Reviewed by Eric Carlson.
1201
1202         When a different client requests the PiP window, the PiP framework will call -pipDidClose: without
1203         first calling -pipActionStop:. This leaves the internal fullscreen state in a confused state where
1204         the WebView will attempt to re-enter PiP once it gets focus, and can lead to a state where the two
1205         WebViews will constantly try to steal PiP from one another, ad infinitum.
1206
1207         When receiving a notification that the PiP window closed when our internal state tells us that the
1208         close was not requested, notify the client that PiP mode was exited, allowing them to set their
1209         expected state to a correct and sane value.
1210
1211         * platform/mac/VideoFullscreenInterfaceMac.mm:
1212         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
1213
1214 2019-01-31  Keith Rollin  <krollin@apple.com>
1215
1216         WebCore::WHLSL::AST::Expression copy constructor needs to be be default, not delete
1217         https://bugs.webkit.org/show_bug.cgi?id=194055
1218         <rdar://problem/47684570>
1219
1220         Reviewed by Myles C. Maxfield.
1221
1222         WebCore::WHLSL::AST::Expression has a deleted copy constructor.
1223         EnumerationMemberLiteral, a subclass, has a default copy constructor.
1224         Some compilers may complain that the latter's c'tor can't access the
1225         former's, because it doesn't exist. Fix this by marking Expression's
1226         c'tor as default.
1227
1228         No new tests since there should be no observable behavior difference.
1229
1230         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
1231
1232 2019-01-31  Alex Christensen  <achristensen@webkit.org>
1233
1234         Revert r238819 which is unneeded and caused a performance regression.
1235         https://bugs.webkit.org/show_bug.cgi?id=192272
1236         <rdar://problem/46664625>
1237
1238         * loader/EmptyFrameLoaderClient.h:
1239         * loader/FrameLoader.cpp:
1240         (WebCore::FrameLoader::prepareForLoadStart):
1241         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1242         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
1243         * loader/FrameLoader.h:
1244         * loader/FrameLoaderClient.h:
1245
1246 2019-01-31  Justin Fan  <justin_fan@apple.com>
1247
1248         [WebGPU] WebGPUAdapterDescriptor -> GPURequestAdapterOptions and take powerPreference into account
1249         https://bugs.webkit.org/show_bug.cgi?id=194068
1250         <rdar://problem/47680215>
1251
1252         Reviewed by Dean Jackson.
1253         
1254         Per the Web GPU IDL, WebGPUAdapterDescriptor is now known as GPURequestAdapterOptions and is optional.
1255         In addition, Web GPU now actually attempts to return an integrated GPU when a low-power adapter is requested.
1256
1257         Test: adapter-options.html
1258
1259         * Modules/webgpu/GPURequestAdapterOptions.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.idl.
1260         * Modules/webgpu/WebGPU.cpp:
1261         (WebCore::WebGPU::requestAdapter const):
1262         * Modules/webgpu/WebGPU.h:
1263         * Modules/webgpu/WebGPU.idl:
1264         * Modules/webgpu/WebGPUAdapter.cpp:
1265         (WebCore::WebGPUAdapter::create):
1266         (WebCore::WebGPUAdapter::WebGPUAdapter):
1267         * Modules/webgpu/WebGPUAdapter.h:
1268         (WebCore::WebGPUAdapter::options const):
1269         * Modules/webgpu/WebGPUDevice.cpp:
1270         (WebCore::WebGPUDevice::create):
1271         * platform/graphics/gpu/GPUDevice.h:
1272         * platform/graphics/gpu/GPURequestAdapterOptions.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.h.
1273         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
1274         (WebCore::GPUDevice::create):
1275
1276 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
1277
1278         Formalize WebKitAdditions mechanism of LoadOptimizer
1279         https://bugs.webkit.org/show_bug.cgi?id=193886
1280         <rdar://problem/47696809>
1281
1282         Reviewed by Brent Fulgham.
1283
1284         Covered by existing tests.
1285
1286         * platform/network/ResourceRequestBase.h:
1287         Export isolatedCopy().
1288
1289 2019-01-31  Jer Noble  <jer.noble@apple.com>
1290
1291         [Cocoa][EME] Modern EME uses a different path for SecureStop data than Legacy EME
1292         https://bugs.webkit.org/show_bug.cgi?id=193988
1293
1294         Reviewed by Jon Lee.
1295
1296         Modern EME is writing SecureStop data as a file at the same path as the
1297         directory used by Legacy EME; meaning, when Modern EME attempts to write
1298         to that file, it will fail because a directory exists at the same path.
1299
1300         Add a migration step to take care of those instances where Modern EME Secure
1301         Stop data was already written to disk, and move that previously written data
1302         to the correct file path.
1303
1304         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1305         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1306         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
1307         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
1308         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
1309         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
1310         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
1311         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
1312
1313 2019-01-31  Antti Koivisto  <antti@apple.com>
1314
1315         Call the frame main contents layer "rootContentsLayer" consistently.
1316         https://bugs.webkit.org/show_bug.cgi?id=194089
1317
1318         Reviewed by Simon Fraser.
1319
1320         This is currently called "rootContentLayer" in the compositor and "scrolledContentsLayer" in the scrolling tree.
1321         We want to reserve term "scrolledContentsLayer" to mean the direct child layer of the  scroll container layer
1322         without any positioning oddities (which this isn't).
1323
1324         * page/scrolling/AsyncScrollingCoordinator.cpp:
1325         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
1326         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1327         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
1328
1329         Set the rootContentsLayer for frame. It is only used by the Mac frame scrolling code.
1330
1331         * page/scrolling/AsyncScrollingCoordinator.h:
1332         * page/scrolling/ScrollingCoordinator.cpp:
1333         (WebCore::ScrollingCoordinator::rootContentsLayerForFrameView):
1334         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView): Deleted.
1335         * page/scrolling/ScrollingCoordinator.h:
1336         (WebCore::ScrollingCoordinator::setNodeLayers):
1337         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1338         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1339         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
1340         (WebCore::ScrollingStateFrameScrollingNode::setRootContentsLayer):
1341         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
1342         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1343
1344         Introduce rootContentLayer for frames only.
1345
1346         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1347         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1348         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1349         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
1350
1351         Switch to using rootContentsLayer.
1352
1353         * rendering/RenderLayerCompositor.cpp:
1354         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1355         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1356         (WebCore::RenderLayerCompositor::updateRootContentLayerClipping):
1357         (WebCore::RenderLayerCompositor::layerTreeAsText):
1358         (WebCore::RenderLayerCompositor::rootGraphicsLayer const):
1359         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1360         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
1361         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
1362         (WebCore::RenderLayerCompositor::updateLayerForHeader):
1363         (WebCore::RenderLayerCompositor::updateLayerForFooter):
1364         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1365         (WebCore::RenderLayerCompositor::ensureRootLayer):
1366         (WebCore::RenderLayerCompositor::destroyRootLayer):
1367         (WebCore::RenderLayerCompositor::attachRootLayer):
1368         (WebCore::RenderLayerCompositor::detachRootLayer):
1369         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
1370         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1371
1372         Pass rootContentsLayer separately for frames only.
1373         Pass null as frame scrolledContentsLayer until these are rearranged (it is not used).
1374
1375         * rendering/RenderLayerCompositor.h:
1376
1377 2019-01-31  Keith Rollin  <krollin@apple.com>
1378
1379         GCGamepad is deprecated
1380         https://bugs.webkit.org/show_bug.cgi?id=194056
1381         <rdar://problem/47685010>
1382
1383         Reviewed by Brady Eidson.
1384
1385         GCGamepad is deprecated, resulting in compiler warnings. Address this
1386         for now by employing ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
1387
1388         No new tests since there should be no observable behavior difference.
1389
1390         * platform/gamepad/cocoa/GameControllerGamepad.mm:
1391         (WebCore::GameControllerGamepad::setupAsGamepad):
1392
1393 2019-01-31  Darin Adler  <darin@apple.com>
1394
1395         Simplify and streamline code that creates an appropriate document based on MIME type
1396         https://bugs.webkit.org/show_bug.cgi?id=193756
1397
1398         Reviewed by Chris Dumez.
1399
1400         * dom/DOMImplementation.cpp:
1401         (WebCore::DOMImplementation::createDocument): Use equalLettersIgnoringASCIICase rather
1402         than == for all the MIME type checks. Use MIMETypeRegistry::isSupportedImageMIMEType
1403         instead of Image::supportsType. Rearranged checks so that all the combinations that
1404         that take precedence over plug-ins are checked first, fixing some unimportant edge
1405         cases where the plug-in database is initialized and doesn't need to be. Straightened
1406         out the logic for various special types so that the checks are more independent from
1407         each other and hence easier to understand.
1408
1409 2019-01-31  Alicia Boya García  <aboya@igalia.com>
1410
1411         [MSE][GStreamer] Unreviewed debug build fix, obsolete assert
1412
1413         Since m_playerPrivate is now a reference, it no longer has a default
1414         cast to bool. But there is also no longer a need to assert it's non
1415         null, so just remove the assert.
1416
1417         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1418         (WebCore::MediaSourceClientGStreamerMSE::append):
1419
1420 2019-01-31  Alicia Boya García  <aboya@igalia.com>
1421
1422         [MSE][GStreamer] Use reference instead of pointer in m_playerPrivate
1423         https://bugs.webkit.org/show_bug.cgi?id=194091
1424
1425         Reviewed by Xabier Rodriguez-Calvar.
1426
1427         Since the pointer is initialized with the class, it's never null and
1428         never changes, it's preferrable to use a reference instead of a
1429         pointer.
1430
1431         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1432         (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
1433         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
1434         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
1435         (WebCore::MediaSourceClientGStreamerMSE::abort):
1436         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
1437         (WebCore::MediaSourceClientGStreamerMSE::append):
1438         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
1439         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
1440         (WebCore::MediaSourceClientGStreamerMSE::flush):
1441         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
1442         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
1443         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
1444         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
1445
1446 2019-01-31  Alexander Mikhaylenko  <exalm7659@gmail.com>
1447
1448         [GTK] Momentum scrolling stops abruptly before websites end
1449         https://bugs.webkit.org/show_bug.cgi?id=193350
1450
1451         Reviewed by Carlos Garcia Campos.
1452
1453         Don't immediately set velocity to 0 when position reaches upper or bottom limit.
1454         Instead, set it to the overshot distance, so that position exactly matches upper
1455         or lower limit on the next frame, and then clamp velocity to 0 using the existing
1456         mechanism.
1457
1458         * platform/ScrollAnimationKinetic.cpp:
1459         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
1460
1461 2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
1462
1463         Unreviewed, fix incorrect string format
1464         https://bugs.webkit.org/show_bug.cgi?id=193907
1465         <rdar://problem/47604080>
1466
1467         * page/scrolling/ScrollingTree.cpp:
1468         (WebCore::ScrollingTree::commitTreeState):
1469
1470 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
1471
1472         [Mac] Implement basic hit testing in the scrolling tree
1473         https://bugs.webkit.org/show_bug.cgi?id=172917
1474         <rdar://problem/34215516>
1475
1476         Reviewed by Antti Koivisto.
1477
1478         First steps to getting hit testing of scrolling nodes in the scrolling tree. Based on patch
1479         by Frédéric Wang.
1480
1481         First we pipe the "async scrolling enabled" setting through to the ScrollingTree via
1482         the root node (like the other settings; weird, but that's how it's done). For now,
1483         we hit test in the scrolling tree if either async overflow or frame scrolling are enabled
1484         (it's hard to deal with one without the other).
1485
1486         Nodes in the scrolling tree implement scrollingNodeForPoint() to implement hit testing.
1487         Two helper functions exist to simplify coordinate conversion: parentToLocalPoint()
1488         and localToContentsPoint(). Child nodes are hit-testing in reverse order to find nodes
1489         hightest in Z first. Only scrolling nodes are returned (not sure if we'll ever need
1490         to hit-test non-scrolling nodes). Nodes use parentRelativeScrollableRect and scroll positions
1491         to do these point mappings.
1492
1493         handleWheelEvent() is changed to return a ScrollingEventResult.
1494
1495         Latching is not correct with this change when async frame scrolling is enabled. That needs
1496         to be fixed separately.
1497
1498         No tests yet; for ease of testing, I'd like to add an Internals API to hit-test the
1499         scrolling tree, rather than doing eventSender stuff everywhere.
1500
1501         * page/scrolling/AsyncScrollingCoordinator.cpp:
1502         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1503         (WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const):
1504         * page/scrolling/AsyncScrollingCoordinator.h:
1505         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1506         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1507         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
1508         (WebCore::ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled):
1509         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1510         * page/scrolling/ScrollingTree.cpp:
1511         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
1512         (WebCore::ScrollingTree::handleWheelEvent):
1513         (WebCore::ScrollingTree::commitTreeState):
1514         (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
1515         * page/scrolling/ScrollingTree.h:
1516         (WebCore::ScrollingTree::asyncFrameOrOverflowScrollingEnabled const):
1517         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1518         (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const):
1519         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1520         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1521         (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const):
1522         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
1523         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1524         * page/scrolling/ScrollingTreeNode.cpp:
1525         (WebCore::ScrollingTreeNode::scrollingNodeForPoint const):
1526         * page/scrolling/ScrollingTreeNode.h:
1527         (WebCore::ScrollingTreeNode::children const):
1528         (WebCore::ScrollingTreeNode::parentToLocalPoint const):
1529         (WebCore::ScrollingTreeNode::localToContentsPoint const):
1530         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1531         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
1532         (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const):
1533         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
1534         (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const):
1535         * page/scrolling/ScrollingTreeScrollingNode.h:
1536         * page/scrolling/ThreadedScrollingTree.cpp:
1537         (WebCore::ThreadedScrollingTree::handleWheelEvent):
1538         * page/scrolling/ThreadedScrollingTree.h:
1539         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
1540         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1541         (WebCore::ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent):
1542         * page/scrolling/ios/ScrollingTreeIOS.h:
1543         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1544         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1545         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1546         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1547
1548 2019-01-31  Alicia Boya García  <aboya@igalia.com>
1549
1550         [MSE][GStreamer] Remove unused GstFlowReturn in AppendPipeline methods
1551         https://bugs.webkit.org/show_bug.cgi?id=194067
1552
1553         Reviewed by Xabier Rodriguez-Calvar.
1554
1555         A couple methods in AppendPipeline were returning GstFlowReturn
1556         despite there being no codepath (sans assertions) where values other
1557         than GST_FLOW_OK are returned.
1558
1559         Therefore, it makes sense to just make these methods return void.
1560
1561         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1562         (WebCore::AppendPipeline::pushNewBuffer):
1563         (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
1564         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1565         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1566         (WebCore::MediaSourceClientGStreamerMSE::append):
1567         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
1568         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
1569         (WebCore::SourceBufferPrivateGStreamer::append):
1570
1571 2019-01-31  Alicia Boya García  <aboya@igalia.com>
1572
1573         [MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE
1574         https://bugs.webkit.org/show_bug.cgi?id=194069
1575
1576         Reviewed by Xabier Rodriguez-Calvar.
1577
1578         m_playerPrivate is non-NULL since MediaSourceClientGStreamerMSE
1579         creation well until its destruction.
1580
1581         The only case that could make a NULL m_playerPrivate is
1582         clearPlayerPrivate() but that method is not used anymore.
1583
1584         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1585         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
1586         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
1587         (WebCore::MediaSourceClientGStreamerMSE::abort):
1588         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
1589         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
1590         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
1591         (WebCore::MediaSourceClientGStreamerMSE::flush):
1592         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
1593         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
1594         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
1595         (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate): Deleted.
1596         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
1597
1598 2019-01-31  Thibault Saunier  <tsaunier@igalia.com>
1599
1600         [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource
1601         https://bugs.webkit.org/show_bug.cgi?id=194087
1602
1603         Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad
1604         meaning that it makes sense that when any of the downstream pad is returning flushing, you should
1605         return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned
1606         *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream
1607         source element task to PAUSED (because downstream returned flushing) on a branch that was not
1608         flushing!
1609
1610         Reviewed by Philippe Normand.
1611
1612         This is a theorical race we can't really cover with tests.
1613
1614         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
1615         (WebCore::webkitMediaStreamSrcChain):
1616
1617 2019-01-31  Zalan Bujtas  <zalan@apple.com>
1618
1619         [LFC] Margin before/after/start/end initial value is 0 and not auto.
1620         https://bugs.webkit.org/show_bug.cgi?id=194090
1621
1622         Reviewed by Antti Koivisto.
1623
1624         Don't treat it like auto.
1625
1626         * layout/FormattingContextGeometry.cpp:
1627         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1628         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1629
1630 2019-01-31  Zalan Bujtas  <zalan@apple.com>
1631
1632         [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently
1633         https://bugs.webkit.org/show_bug.cgi?id=194074
1634
1635         Reviewed by Antti Koivisto.
1636
1637         Check the used margin variables whether we already computed start/end values.
1638
1639         Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html
1640
1641         * layout/FormattingContextGeometry.cpp:
1642         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1643
1644 2019-01-31  Zalan Bujtas  <zalan@apple.com>
1645
1646         [LFC][BFC] Add support for block level replaced box.
1647         https://bugs.webkit.org/show_bug.cgi?id=194071
1648
1649         Reviewed by Antti Koivisto.
1650
1651         * layout/layouttree/LayoutBox.cpp:
1652         (WebCore::Layout::Box::Box):
1653         * layout/layouttree/LayoutBox.h:
1654         * layout/layouttree/LayoutTreeBuilder.cpp:
1655         (WebCore::Layout::TreeBuilder::createSubTree):
1656         (WebCore::Layout::outputLayoutBox):
1657
1658 2019-01-31  Chris Fleizach  <cfleizach@apple.com>
1659
1660         ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
1661         https://bugs.webkit.org/show_bug.cgi?id=189094
1662         <rdar://problem/43853526>
1663
1664         Reviewed by Zalan Bujtas.
1665
1666         Protect against access to objects and cache's that can be removed while an object is still in memory.
1667
1668         Unskipped flaky tests on mac-wk2.
1669
1670         * accessibility/mac/AXObjectCacheMac.mm:
1671         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1672         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1673         (textMarkerForVisiblePosition):
1674         (textMarkerRangeFromVisiblePositions):
1675
1676 2019-01-30  Chris Dumez  <cdumez@apple.com>
1677
1678         Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error
1679         https://bugs.webkit.org/show_bug.cgi?id=194023
1680         <rdar://problem/47417981>
1681
1682         Reviewed by Geoffrey Garen.
1683
1684         The issue was caused by the 'isTopSite' flag not getting properly set on the network request
1685         in case of a cross-site history navigation (with process-swap). As a result, twitter.com was
1686         not getting its same-site lax cookies.
1687
1688         The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were
1689         bypassing this method entirely when continuing a load in a new process after a swap. This was
1690         intentional as the network request is normally already fully populated by the previous process
1691         and we do not want the new process to modify the request in any way (e.g. we would not want to
1692         add a Origin header back after it was removed by the previous process). However, in case of a
1693         History navigation, we do not actually pass a request along from one process to another. Instead,
1694         we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process.
1695         In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though
1696         we are technically continuing a load in a new process.
1697
1698         We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're
1699         continuing a load with a request and not when we're continuing a load with a HistoryItem.
1700
1701         Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php
1702
1703         * loader/FrameLoader.cpp:
1704         (WebCore::FrameLoader::load):
1705         (WebCore::FrameLoader::loadWithDocumentLoader):
1706         (WebCore::FrameLoader::addExtraFieldsToRequest):
1707         (WebCore::FrameLoader::loadDifferentDocumentItem):
1708         * loader/FrameLoader.h:
1709         (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const):
1710
1711 2019-01-30  Justin Fan  <justin_fan@apple.com>
1712
1713         [WebGPU] Support GPUDepthStencilStateDescriptor
1714         https://bugs.webkit.org/show_bug.cgi?id=194048
1715         <rdar://problem/46289645>
1716
1717         Reviewed by Dean Jackson.
1718
1719         Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder.
1720
1721         Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect 
1722         without a depth texture attached.
1723
1724         New interface files added:
1725         * Modules/webgpu/GPUCompareFunction.idl:
1726         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
1727         * platform/graphics/gpu/GPUCompareFunction.h:
1728         * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
1729
1730         Modifications:
1731         * Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline.
1732         (WebCore::WebGPUDevice::createRenderPipeline const):
1733         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor.
1734         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
1735         * platform/graphics/gpu/GPURenderPipeline.h: Ditto.
1736         (WebCore::GPURenderPipeline::depthStencilState const): Getter.
1737         (WebCore::GPURenderPipeline::platformRenderPipeline const):
1738         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState.
1739         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
1740         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState.
1741         (WebCore::GPURenderPassEncoder::setPipeline):
1742         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState.
1743         (WebCore::validateAndConvertDepthCompareFunctionToMtl):
1744         (WebCore::tryCreateMtlDepthStencilState):
1745         (WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create.
1746         (WebCore::GPURenderPipeline::create):
1747         (WebCore::GPURenderPipeline::GPURenderPipeline):
1748
1749         Added symbols for CompareFunction, DepthStencilStateDescriptor to the project:
1750         * CMakeLists.txt:
1751         * DerivedSources.make:
1752         * Sources.txt:
1753         * WebCore.xcodeproj/project.pbxproj:
1754
1755         * Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version.
1756
1757 2019-01-30  Jer Noble  <jer.noble@apple.com>
1758
1759         [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
1760         https://bugs.webkit.org/show_bug.cgi?id=193984
1761
1762         Reviewed by Eric Carlson.
1763
1764         MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The
1765         KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until
1766         after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
1767         completion handler is called.
1768
1769         Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID
1770         changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed.
1771
1772         * Modules/encryptedmedia/MediaKeySession.cpp:
1773         (WebCore::MediaKeySession::sessionIdChanged):
1774         * Modules/encryptedmedia/MediaKeySession.h:
1775         * platform/encryptedmedia/CDMInstanceSession.h:
1776         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1777         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
1778         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
1779
1780 2019-01-30  Keith Rollin  <krollin@apple.com>
1781
1782         FloatWithRect has invalid and inaccessible default constructor
1783         https://bugs.webkit.org/show_bug.cgi?id=194057
1784         <rdar://problem/47685211>
1785
1786         Reviewed by Zalan Bujtas.
1787
1788         FloatWithRect has a default constructor declared as 'default'. This
1789         constructor is invalid because FloatWithRect has a data member that's
1790         a reference that will not get initialized with this constructor. Since
1791         it's invalid, and since it's private and not accessed by anything,
1792         remove this constructor.
1793
1794         No new tests since there should be no observable behavior difference.
1795
1796         * rendering/line/LineLayoutState.h:
1797
1798 2019-01-30  Daniel Bates  <dabates@apple.com>
1799
1800         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
1801         https://bugs.webkit.org/show_bug.cgi?id=192824
1802         <rdar://problem/47100332>
1803
1804         Reviewed by Wenson Hsieh.
1805
1806         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
1807         now that hardware key events to non-editable elements use the same code path as for editable elements. 
1808
1809         * platform/ios/KeyEventIOS.mm:
1810         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
1811         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
1812         (WebCore::isFunctionKey): Ditto.
1813         * platform/ios/WebEvent.mm:
1814         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
1815         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
1816
1817 2019-01-30  Jer Noble  <jer.noble@apple.com>
1818
1819         Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
1820         https://bugs.webkit.org/show_bug.cgi?id=194063
1821
1822         Reviewed by Jon Lee.
1823
1824         * DerivedSources.make:
1825
1826 2019-01-30  Youenn Fablet  <youenn@apple.com>
1827
1828         Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe
1829         https://bugs.webkit.org/show_bug.cgi?id=193747
1830         <rdar://problem/47498196>
1831
1832         Reviewed by Chris Dumez.
1833
1834         Make ServiceWorkerJob be no longer ref counted.
1835         Instead its lifetime is fully controlled by ServiceWorkerContainer.
1836
1837         Make sure that a failing load will remove the job from ServiceWorkerContainer job map.
1838         This allows to ensure that these jobs do not stay forever.
1839         Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful.
1840
1841         Before the patch, unsetPendingActivity was only called for successful jobs finishing.
1842         In case of failing loads, ServiceWorkerContainer would leak.
1843         Make sure that setPendingActivity/unsetPendingActivity is balanced by storing
1844         a pending activity in the job map next to the job.
1845
1846         When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess.
1847         This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone.
1848
1849         Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not.
1850         Update type of exception to be SecurityError when load fails due to AccessControl.
1851
1852         Covered by existing tests.
1853
1854         * workers/service/ServiceWorkerContainer.cpp:
1855         (WebCore::ServiceWorkerContainer::addRegistration):
1856         (WebCore::ServiceWorkerContainer::removeRegistration):
1857         (WebCore::ServiceWorkerContainer::updateRegistration):
1858         (WebCore::ServiceWorkerContainer::scheduleJob):
1859         (WebCore::ServiceWorkerContainer::jobFailedWithException):
1860         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1861         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
1862         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
1863         (WebCore::ServiceWorkerContainer::jobDidFinish):
1864         (WebCore::ServiceWorkerContainer::stop):
1865         (WebCore::ServiceWorkerContainer::job):
1866         * workers/service/ServiceWorkerContainer.h:
1867         * workers/service/ServiceWorkerJob.cpp:
1868         (WebCore::ServiceWorkerJob::failedWithException):
1869         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
1870         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
1871         (WebCore::ServiceWorkerJob::startScriptFetch):
1872         (WebCore::ServiceWorkerJob::didReceiveResponse):
1873         (WebCore::ServiceWorkerJob::notifyFinished):
1874         (WebCore::ServiceWorkerJob::cancelPendingLoad):
1875         * workers/service/ServiceWorkerJob.h:
1876         (WebCore::ServiceWorkerJob::hasPromise const):
1877         (WebCore::ServiceWorkerJob::takePromise):
1878         * workers/service/ServiceWorkerJobClient.h:
1879         * workers/service/server/SWServerJobQueue.cpp:
1880         (WebCore::SWServerJobQueue::scriptFetchFinished):
1881
1882 2019-01-30  Dean Jackson  <dino@apple.com>
1883
1884         PointerEvents - tiltX and tiltY are reversed
1885         https://bugs.webkit.org/show_bug.cgi?id=194032
1886         <rdar://problem/47674184>
1887
1888         Reviewed by Jon Lee.
1889
1890         I got tiltX and tiltY the wrong way around.
1891
1892         * dom/ios/PointerEventIOS.cpp: Flip the values.
1893
1894 2019-01-30  Zalan Bujtas  <zalan@apple.com>
1895
1896         [LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
1897         https://bugs.webkit.org/show_bug.cgi?id=194001
1898
1899         Reviewed by Antti Koivisto.
1900
1901         Skip to the next position manually. This is exactly what we do in simple line layout.
1902
1903         * layout/inlineformatting/InlineRunProvider.cpp:
1904         (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
1905
1906 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
1907
1908         Add some basic geometry information to the scrolling tree
1909         https://bugs.webkit.org/show_bug.cgi?id=194002
1910         rdar://problem/47656294
1911
1912         Reviewed by Antti Koivisto.
1913
1914         To allow hit-testing in the scrolling tree, store a parent-relative scrollable
1915         rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
1916         of the scrollable area, and whose origin is relative to the parent scrolling tree node.
1917         
1918         Frame hosting nodes need this rect because they take care of the geometry offset between
1919         an iframe and its scrolling tree ancestor in the parent document.
1920         
1921         Based on a patch by Frédéric Wang in bug 172917.
1922
1923         * page/scrolling/AsyncScrollingCoordinator.cpp:
1924         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
1925         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
1926         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
1927         (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
1928         (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
1929         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
1930         * page/scrolling/ScrollingStateFrameHostingNode.h:
1931         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1932         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
1933         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
1934         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1935         (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
1936         * rendering/RenderLayer.h:
1937         * rendering/RenderLayerBacking.cpp:
1938         (WebCore::RenderLayerBacking::updateScrollingLayers):
1939         * rendering/RenderLayerCompositor.cpp:
1940         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
1941         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
1942         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
1943         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1944         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
1945         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
1946         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
1947         * rendering/RenderLayerCompositor.h:
1948
1949 2019-01-30  Zalan Bujtas  <zalan@apple.com>
1950
1951         [LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
1952         https://bugs.webkit.org/show_bug.cgi?id=194020
1953
1954         Reviewed by Antti Koivisto.
1955
1956         Check the used margin variables whether we already computed before/after values.
1957
1958         Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html
1959
1960         * layout/FormattingContextGeometry.cpp:
1961         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1962
1963 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
1964
1965         AX: Support color well on iOS
1966         https://bugs.webkit.org/show_bug.cgi?id=194010
1967
1968         Reviewed by Joanmarie Diggs.
1969
1970         Test: accessibility/ios-simulator/color-well.html
1971
1972         Add support for color well on iOS.
1973
1974         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1975         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
1976         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1977         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
1978         (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
1979         * en.lproj/Localizable.strings:
1980         * platform/LocalizedStrings.cpp:
1981         (WebCore::AXColorWellText):
1982         * platform/LocalizedStrings.h:
1983
1984 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
1985
1986         AX: Role=switch not returning correct accessibilityValue
1987         https://bugs.webkit.org/show_bug.cgi?id=194006
1988
1989         Reviewed by Joanmarie Diggs.
1990
1991         Return the toggle state of a role=switch element.        
1992
1993         Test: accessibility/ios-simulator/role-switch.html
1994
1995         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1996         (-[WebAccessibilityObjectWrapper accessibilityValue]):
1997
1998 2019-01-29  Rob Buis  <rbuis@igalia.com>
1999
2000         Align with Fetch on data: URLs
2001         https://bugs.webkit.org/show_bug.cgi?id=182325
2002
2003         Reviewed by Alex Christensen.
2004
2005         Implement most remaining steps for data: URL processing [1].
2006         Serialization is still to be implemented.
2007
2008         To make the code in DataURLDecoder::parseMediaType more efficient,
2009         refactor ParsedContentType so that validation and parsing is done
2010         in one pass.
2011
2012         Test: web-platform-tests/fetch/data-urls/processing.any.js
2013
2014         [1] https://fetch.spec.whatwg.org/#data-urls
2015
2016         * Modules/encryptedmedia/CDM.cpp:
2017         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
2018         * platform/network/DataURLDecoder.cpp:
2019         (WebCore::DataURLDecoder::parseMediaType):
2020         (WebCore::DataURLDecoder::DecodeTask::process):
2021         * platform/network/MIMEHeader.cpp:
2022         (WebCore::MIMEHeader::parseHeader):
2023         * platform/network/ParsedContentType.cpp:
2024         (WebCore::containsNewline):
2025         (WebCore::ParsedContentType::parseContentType):
2026         (WebCore::ParsedContentType::create):
2027         (WebCore::isValidContentType):
2028         (WebCore::ParsedContentType::ParsedContentType):
2029         (WebCore::DummyParsedContentType::setContentType const): Deleted.
2030         (WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted.
2031         (WebCore::parseContentType): Deleted.
2032         * platform/network/ParsedContentType.h:
2033
2034 2019-01-29  Eric Carlson  <eric.carlson@apple.com>
2035
2036         [MSE] add more source buffer logging
2037         https://bugs.webkit.org/show_bug.cgi?id=193995
2038         <rdar://problem/47650399>
2039
2040         Reviewed by Jon Lee.
2041
2042         No new tests, no functional change.
2043
2044         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2045         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
2046         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
2047         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2048         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2049         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
2050         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
2051
2052 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
2053
2054         Add nodes to the scrolling tree in z-index order.
2055         https://bugs.webkit.org/show_bug.cgi?id=192529
2056         <rdar://problem/47402708>
2057
2058         Reviewed by Dean Jackson.
2059
2060         We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places.
2061         This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer
2062         walks to find them.
2063
2064         With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy()
2065         tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index
2066         (which makes it so that the scrolling tree correctly reflects layer z-order).
2067
2068         The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting
2069         nodes in their parent document.
2070
2071         There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking
2072         was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed()
2073         to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator().
2074
2075         updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1,
2076         and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator.
2077
2078         Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html
2079                scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html
2080
2081         * page/scrolling/ScrollingStateTree.cpp:
2082         (WebCore::ScrollingStateTree::insertNode):
2083         * page/scrolling/ScrollingTreeNode.cpp:
2084         (WebCore::ScrollingTreeNode::~ScrollingTreeNode):
2085         * platform/Logging.cpp:
2086         (WebCore::initializeLogChannelsIfNecessary):
2087         * rendering/RenderLayer.cpp:
2088         (WebCore::RenderLayer::setParent):
2089         (WebCore::RenderLayer::calculateClipRects const):
2090         * rendering/RenderLayerBacking.cpp:
2091         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2092         (WebCore::RenderLayerBacking::willBeDestroyed):
2093         (WebCore::RenderLayerBacking::updateGeometry):
2094         (WebCore::RenderLayerBacking::updateBackgroundLayer):
2095         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
2096         * rendering/RenderLayerBacking.h:
2097         * rendering/RenderLayerCompositor.cpp:
2098         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2099         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
2100         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2101         (WebCore::frameHostingNodeForFrame):
2102         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2103         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2104         (WebCore::RenderLayerCompositor::updateBacking):
2105         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
2106         (WebCore::RenderLayerCompositor::setIsInWindow):
2107         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
2108         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
2109         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
2110         (WebCore::RenderLayerCompositor::attachScrollingNode):
2111         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
2112         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
2113         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
2114         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2115         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
2116         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2117         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
2118         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
2119         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
2120         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
2121         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer):
2122         (WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer):
2123         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer):
2124         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted.
2125         (WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op.
2126         (WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted.
2127         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now.
2128         (WebCore::canCoordinateScrollingForLayer): Deleted.
2129         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted.
2130         (WebCore::enclosingScrollingNodeID): Deleted.
2131         (WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted.
2132         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted.
2133         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted.
2134         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted.
2135         * rendering/RenderLayerCompositor.h:
2136
2137 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
2138
2139         Make sure we have a frame before trying to access its loader 
2140         https://bugs.webkit.org/show_bug.cgi?id=193985
2141         <rdar://problem/47618239>
2142
2143         Reviewed by Ryosuke Niwa.
2144
2145         * loader/ResourceLoadObserver.cpp:
2146         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2147
2148 2019-01-29  Andy Estes  <aestes@apple.com>
2149
2150         Try to fix the watchOS build.
2151
2152         * dom/Element.cpp:
2153
2154 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
2155
2156         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
2157         https://bugs.webkit.org/show_bug.cgi?id=193907
2158         rdar://problem/47604080
2159
2160         Reviewed by Frédéric Wang.
2161
2162         Recent scrolling tree changes can trigger unparenting and reparenting of subtrees in the
2163         state tree. If a subframe's state tree nodes are unparented, a scrolling tree commit would
2164         show these as nodes being destroyed, which destroyed the tree nodes. When re-parented, the
2165         commit would re-create the tree node, but the state node would only have a subset of the
2166         change flags set, so the new tree node would fail to get all of the state (for example, it
2167         would be missing layers and scrolling geometry).
2168
2169         Fix by ensuring that when we reparent state node subtrees, we set all the change flags
2170         so that the full set of data is sent to the scrolling tree (the UI process, in the case of iOS WK2).
2171         Annoyingly, virtual setAllPropertiesChanged() functions are needed so each state node subclass can
2172         set the right change flags.
2173
2174         This patch also gets rid of m_nodesRemovedSinceLastCommit in the state tree. We can gain the same
2175         information by using copying all of the nodeIDs in m_nodeMap into a HashSet, and removing nodes
2176         as we encounter them in the tree walk.
2177         
2178         Rename m_latchedNode to m_latchedNodeID in ScrollingTree, since it's a nodeID, not a node pointer.
2179
2180         Test: compositing/geometry/composited-frame-contents.html
2181
2182         * page/scrolling/ScrollingStateFixedNode.cpp:
2183         (WebCore::ScrollingStateFixedNode::setAllPropertiesChanged):
2184         * page/scrolling/ScrollingStateFixedNode.h:
2185         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2186         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
2187         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2188         * page/scrolling/ScrollingStateNode.cpp:
2189         (WebCore::ScrollingStateNode::setPropertyChanged):
2190         (WebCore::ScrollingStateNode::setAllPropertiesChanged):
2191         * page/scrolling/ScrollingStateNode.h:
2192         (WebCore::ScrollingStateNode::setPropertyChangedBit):
2193         * page/scrolling/ScrollingStateScrollingNode.cpp:
2194         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
2195         * page/scrolling/ScrollingStateScrollingNode.h:
2196         * page/scrolling/ScrollingStateStickyNode.cpp:
2197         (WebCore::ScrollingStateStickyNode::setAllPropertiesChanged):
2198         * page/scrolling/ScrollingStateStickyNode.h:
2199         * page/scrolling/ScrollingStateTree.cpp:
2200         (WebCore::ScrollingStateTree::insertNode): Add a RELEASE_ASSERT on the type of the node created
2201         if parentID == 0, since mistakes here can associate a ScrollingNodeType::MainFrame node with some
2202         other nodeID which can result in type confusion later.
2203         (WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
2204         (WebCore::ScrollingStateTree::commit):
2205         (WebCore::ScrollingStateTree::willRemoveNode):
2206         (WebCore::ScrollingStateTree::setRemovedNodes): Deleted.
2207         * page/scrolling/ScrollingStateTree.h:
2208         (WebCore::ScrollingStateTree::removedNodes const): Deleted.
2209         * page/scrolling/ScrollingTree.cpp:
2210         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
2211         (WebCore::ScrollingTree::commitTreeState):
2212         (WebCore::ScrollingTree::updateTreeFromStateNode):
2213         (WebCore::ScrollingTree::latchedNode):
2214         (WebCore::ScrollingTree::setLatchedNode):
2215         (WebCore::ScrollingTree::clearLatchedNode):
2216         (WebCore::ScrollingTree::scrollingTreeAsText):
2217         (WebCore::ScrollingTree::removeDestroyedNodes): Deleted.
2218         * page/scrolling/ScrollingTree.h:
2219         (WebCore::ScrollingTree::hasLatchedNode const):
2220         * rendering/RenderLayerCompositor.cpp:
2221         (WebCore::RenderLayerCompositor::ensureRootLayer): The scroll layer needs a 0,0,0 anchor point so that
2222         setting its position doesn't offset it relative to the center.
2223
2224 2019-01-29  Justin Fan  <justin_fan@apple.com>
2225
2226         [WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor
2227         https://bugs.webkit.org/show_bug.cgi?id=193926
2228         <rdar://problem/47327648>
2229
2230         Reviewed by Myles C. Maxfield.
2231
2232         Update vertex input to properly utilize inputSlot and shaderLocation fields, and add some validation.
2233
2234         Test: webgpu/vertex-buffer-triangle-strip.html
2235
2236         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: 
2237         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
2238         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2239         (WebCore::setInputStateForPipelineDescriptor): Properly retain Metal types.
2240         (WebCore::GPURenderPipeline::create): Provide error logging for MTLRenderPipelineState creation.
2241
2242 2019-01-29  Keith Rollin  <krollin@apple.com>
2243
2244         Add .xcfilelists to Run Script build phases
2245         https://bugs.webkit.org/show_bug.cgi?id=193792
2246         <rdar://problem/47201785>
2247
2248         Reviewed by Alex Christensen.
2249
2250         As part of supporting XCBuild, update the necessary Run Script build
2251         phases in their Xcode projects to refer to their associated
2252         .xcfilelist files.
2253
2254         Note that the addition of these files bumps the Xcode project version
2255         number to something that's Xcode 10 compatible. This change means that
2256         older versions of the Xcode IDE can't read these projects. Nor can it
2257         fully load workspaces that refer to these projects (the updated
2258         projects are shown as non-expandable placeholders). `xcodebuild` can
2259         still build these projects; it's just that the IDE can't open them.
2260
2261         Make special accommodations for incorporating .xcfilelists from
2262         WebKitAdditions.
2263
2264         No new tests since there should be no observable behavior difference.
2265
2266         * Configurations/Base.xcconfig:
2267         * Configurations/DebugRelease.xcconfig:
2268         * WebCore.xcodeproj/project.pbxproj:
2269
2270 2019-01-29  John Wilander  <wilander@apple.com>
2271
2272         Add data abstraction and validation for Ad Click Attribution
2273         https://bugs.webkit.org/show_bug.cgi?id=193916
2274         <rdar://problem/47603481>
2275
2276         Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen.
2277
2278         New API tests added.
2279
2280         Ad click attribution has two steps. First, the storage of an ad
2281         campaign ID for a click that takes the user to a destination
2282         site. Second, a conversion on the destination site that can be
2283         attributed to the ad click.
2284
2285         This patch adds a class that represents a request for ad click
2286         attribution. Validation makes sure that the bits of entropy
2287         reported through this mechanism is limited.
2288
2289         This feature is experimental and off by default.
2290
2291         * Sources.txt:
2292             Added loader/AdClickAttribution.cpp.
2293         * WebCore.xcodeproj/project.pbxproj:
2294         * loader/AdClickAttribution.cpp: Added.
2295         (WebCore::AdClickAttribution::isValid const):
2296         (WebCore::AdClickAttribution::setConversion):
2297         (WebCore::AdClickAttribution::url const):
2298         (WebCore::AdClickAttribution::referrer const):
2299         * loader/AdClickAttribution.h: Added.
2300         (WebCore::AdClickAttribution::Campaign::Campaign):
2301         (WebCore::AdClickAttribution::Campaign::isValid const):
2302         (WebCore::AdClickAttribution::Source::Source):
2303         (WebCore::AdClickAttribution::Destination::Destination):
2304         (WebCore::AdClickAttribution::Priority::Priority):
2305         (WebCore::AdClickAttribution::Conversion::Conversion):
2306         (WebCore::AdClickAttribution::Conversion::isValid const):
2307         (WebCore::AdClickAttribution::AdClickAttribution):
2308         (WebCore::AdClickAttribution::earliestTimeToSend const):
2309         * loader/DocumentLoader.cpp:
2310             Added missing #include "RuntimeEnabledFeatures.h".
2311
2312 2019-01-29  Zalan Bujtas  <zalan@apple.com>
2313
2314         [MathML] Move enum class ScriptType to MathMLScriptsElement.
2315         https://bugs.webkit.org/show_bug.cgi?id=193969
2316
2317         Reviewed by Antti Koivisto.
2318
2319         * mathml/MathMLScriptsElement.cpp:
2320         (WebCore::scriptTypeOf):
2321         * mathml/MathMLScriptsElement.h:
2322         * rendering/mathml/RenderMathMLScripts.cpp:
2323         (WebCore::RenderMathMLScripts::scriptType const):
2324         (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
2325         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
2326         (WebCore::RenderMathMLScripts::verticalMetrics):
2327         (WebCore::RenderMathMLScripts::layoutBlock):
2328         * rendering/mathml/RenderMathMLScripts.h:
2329         * rendering/mathml/RenderMathMLUnderOver.cpp:
2330         (WebCore::RenderMathMLUnderOver::isValid const):
2331         (WebCore::RenderMathMLUnderOver::under const):
2332         (WebCore::RenderMathMLUnderOver::over const):
2333         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths):
2334         (WebCore::RenderMathMLUnderOver::hasAccent const):
2335         (WebCore::RenderMathMLUnderOver::layoutBlock):
2336
2337 2019-01-29  Chris Dumez  <cdumez@apple.com>
2338
2339         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
2340         https://bugs.webkit.org/show_bug.cgi?id=193848
2341
2342         Reviewed by Youenn Fablet.
2343
2344         * dom/Document.cpp:
2345         * dom/MessageChannel.cpp:
2346         (WebCore::MessageChannel::MessageChannel):
2347         * dom/ScriptExecutionContext.cpp:
2348         (WebCore::ScriptExecutionContext::contextIdentifier const):
2349         * history/HistoryItem.cpp:
2350         (WebCore::HistoryItem::HistoryItem):
2351         * loader/DocumentLoader.cpp:
2352         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
2353         * page/DOMWindow.cpp:
2354         (WebCore::DOMWindow::DOMWindow):
2355         * platform/Process.cpp:
2356         (WebCore::Process::identifier):
2357         * workers/service/ServiceWorkerJobData.cpp:
2358         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
2359         * workers/service/server/RegistrationDatabase.cpp:
2360         (WebCore::RegistrationDatabase::importRecords):
2361         * workers/service/server/SWServer.cpp:
2362         (WebCore::SWServer::Connection::Connection):
2363         (WebCore::SWServer::updateWorker):
2364         * workers/service/server/SWServerRegistration.cpp:
2365         (WebCore::generateServiceWorkerRegistrationIdentifier):
2366         * workers/service/server/SWServerToContextConnection.cpp:
2367         (WebCore::generateServerToContextConnectionIdentifier):
2368
2369
2370 2019-01-29  Alex Christensen  <achristensen@webkit.org>
2371
2372         Use lambdas instead of member pointer functions for TransactionOperationImpl
2373         https://bugs.webkit.org/show_bug.cgi?id=193933
2374
2375         Reviewed by Tim Horton.
2376
2377         No change in behavior.  This just makes it easier to add new parameters to these functions in a straightforward manner.
2378
2379         * Modules/indexeddb/IDBObjectStore.cpp:
2380         (WebCore::IDBObjectStore::putOrAdd):
2381         * Modules/indexeddb/IDBTransaction.cpp:
2382         (WebCore::IDBTransaction::internalAbort):
2383         (WebCore::IDBTransaction::commit):
2384         (WebCore::IDBTransaction::createObjectStore):
2385         (WebCore::IDBTransaction::renameObjectStore):
2386         (WebCore::IDBTransaction::createIndex):
2387         (WebCore::IDBTransaction::renameIndex):
2388         (WebCore::IDBTransaction::doRequestOpenCursor):
2389         (WebCore::IDBTransaction::iterateCursor):
2390         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
2391         (WebCore::IDBTransaction::requestGetAllIndexRecords):
2392         (WebCore::IDBTransaction::requestGetRecord):
2393         (WebCore::IDBTransaction::requestIndexRecord):
2394         (WebCore::IDBTransaction::requestCount):
2395         (WebCore::IDBTransaction::requestDeleteRecord):
2396         (WebCore::IDBTransaction::requestClearObjectStore):
2397         (WebCore::IDBTransaction::requestPutOrAdd):
2398         (WebCore::IDBTransaction::deleteObjectStore):
2399         (WebCore::IDBTransaction::deleteIndex):
2400         * Modules/indexeddb/IDBTransaction.h:
2401         * Modules/indexeddb/client/TransactionOperation.h:
2402         (WebCore::IDBClient::TransactionOperation::doComplete):
2403         (WebCore::IDBClient::createTransactionOperation): Deleted.
2404
2405 2019-01-29  Zalan Bujtas  <zalan@apple.com>
2406
2407         [LFC][BFC][MarginCollapsing] Remove incorrect downcast<Container>
2408         https://bugs.webkit.org/show_bug.cgi?id=193964
2409
2410         Reviewed by Antti Koivisto.
2411
2412         * layout/blockformatting/BlockMarginCollapse.cpp:
2413         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
2414
2415 2019-01-29  Zalan Bujtas  <zalan@apple.com>
2416
2417         [LFC][BFC] Do not ignore next sibling box while laying out BFC.
2418         https://bugs.webkit.org/show_bug.cgi?id=193954
2419
2420         Reviewed by Antti Koivisto.
2421
2422         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)
2423         Also inFlowNonReplacedWidthAndMargin() is called through inFlowReplacedWidthAndMargin() to compute margins.
2424
2425         * layout/blockformatting/BlockFormattingContext.cpp:
2426         (WebCore::Layout::BlockFormattingContext::layout const):
2427         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
2428         * layout/blockformatting/BlockFormattingContext.h:
2429         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2430         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2431
2432 2019-01-29  Zalan Bujtas  <zalan@apple.com>
2433
2434         [LFC][BFC][MarginCollapsing] Remove quirk from MarginCollapse::marginsCollapseThrough
2435         https://bugs.webkit.org/show_bug.cgi?id=193948
2436
2437         Reviewed by Antti Koivisto.
2438
2439         This is now implemented in BlockFormattingContext::Quirks::stretchedInFlowHeight().
2440
2441         * layout/blockformatting/BlockMarginCollapse.cpp:
2442         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
2443
2444 2019-01-29  Zalan Bujtas  <zalan@apple.com>
2445
2446         [LFC][BFC][MarginCollapsing] Anonymous block container's margin before does not collapse with previous inflow sibling margin after.
2447         https://bugs.webkit.org/show_bug.cgi?id=193952
2448
2449         Reviewed by Antti Koivisto.
2450
2451         * layout/blockformatting/BlockMarginCollapse.cpp:
2452         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
2453
2454 2019-01-29  Frederic Wang  <fwang@igalia.com>
2455
2456         Allow scrolling tree nodes to exist in a detached state
2457         https://bugs.webkit.org/show_bug.cgi?id=193754
2458
2459         Unreviewed build warning fix.
2460
2461         * page/scrolling/ScrollingStateTree.cpp:
2462         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): Remove
2463         unused variable.
2464
2465 2019-01-28  Ryosuke Niwa  <rniwa@webkit.org>
2466
2467         User agent string override for navigator.userAgent should be site specific quirks
2468         https://bugs.webkit.org/show_bug.cgi?id=193950
2469
2470         Reviewed by Brent Fulgham.
2471
2472         In order to make it possible to toggle the UA string override just for navigator.userAgent via Web Inspector,
2473         we need to put this override behind the site specific quirks. Because WebInspector overrides Page's setting
2474         without updating WKPreferences, there is no way for WKWebView client's to know whether the site specific quirks
2475         had been disabled or not.
2476
2477         * loader/DocumentLoader.h:
2478         (WebCore::DocumentLoader::setCustomJavaScriptUserAgentAsSiteSpecificQuirks):
2479         (WebCore::DocumentLoader::customJavaScriptUserAgentAsSiteSpecificQuirks const):
2480         (WebCore::DocumentLoader::setCustomJavaScriptUserAgent): Deleted.
2481         (WebCore::DocumentLoader::customJavaScriptUserAgent const): Deleted.
2482         * loader/FrameLoader.cpp:
2483         (WebCore::FrameLoader::userAgentForJavaScript const):
2484
2485 2019-01-28  Devin Rousso  <drousso@apple.com>
2486
2487         Web Inspector: provide a way to edit page WebRTC settings on a remote target
2488         https://bugs.webkit.org/show_bug.cgi?id=193863
2489         <rdar://problem/47572764>
2490
2491         Reviewed by Joseph Pecoraro.
2492
2493         Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html
2494               inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
2495
2496         * inspector/agents/InspectorPageAgent.cpp:
2497
2498         * page/Settings.yaml:
2499         * page/SettingsBase.h:
2500         * page/SettingsBase.cpp:
2501         (SettingsBase::iceCandidateFilteringEnabledChanged): Added.
2502         (SettingsBase::mockCaptureDevicesEnabledChanged): Added.
2503         * Scripts/GenerateSettings.rb:
2504         * Scripts/SettingsTemplates/Settings.cpp.erb:
2505         Add page-level settings for WebRTC preferences.
2506
2507         * Modules/mediastream/UserMediaController.cpp:
2508         (WebCore::UserMediaController::canCallGetUserMedia):
2509
2510         * testing/InternalSettings.cpp:
2511         (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
2512
2513         * testing/Internals.h:
2514         * testing/Internals.cpp:
2515         (WebCore::Internals::Internals):
2516         (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
2517         (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added.
2518
2519         * page/DeprecatedGlobalSettings.h:
2520         * page/DeprecatedGlobalSettings.cpp:
2521         (WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted.
2522         (WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted.
2523         (WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted.
2524         (WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted.
2525
2526 2019-01-28  Jer Noble  <jer.noble@apple.com>
2527
2528         webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic.
2529         https://bugs.webkit.org/show_bug.cgi?id=193923
2530         <rdar://problem/45956595>
2531
2532         Reviewed by Eric Carlson.
2533
2534         The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled
2535         and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue
2536         setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop.
2537
2538         * html/HTMLMediaElement.cpp:
2539         (WebCore::HTMLMediaElement::clearMediaPlayer):
2540         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
2541         (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
2542         (WebCore::HTMLMediaElement::dispatchEvent):
2543         * html/HTMLMediaElement.h:
2544
2545 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
2546
2547         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
2548         https://bugs.webkit.org/show_bug.cgi?id=193941
2549
2550         Reviewed by Alex Christensen.
2551
2552         * css/CSSBasicShapes.cpp:
2553         * css/CSSPrimitiveValue.cpp:
2554         * css/parser/CSSParser.cpp:
2555         * css/parser/CSSParserSelector.cpp:
2556         * css/parser/CSSPropertyParser.cpp:
2557         * dom/Document.cpp:
2558         * dom/EventListenerMap.cpp:
2559         * dom/EventTarget.cpp:
2560         * editing/Editor.cpp:
2561         * html/HTMLElement.cpp:
2562         * html/HTMLFontElement.cpp:
2563         * html/parser/HTMLTokenizer.cpp:
2564         * html/track/TrackBase.cpp:
2565         * loader/FTPDirectoryParser.cpp:
2566         * loader/TextResourceDecoder.cpp:
2567         * loader/cache/CachedResource.cpp:
2568         * page/ContextMenuController.cpp:
2569         * page/Navigator.cpp:
2570         * platform/Length.cpp:
2571         * platform/cocoa/KeyEventCocoa.mm:
2572         * platform/graphics/FontCascade.cpp:
2573         * platform/graphics/WidthIterator.cpp:
2574         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2575         * platform/ios/KeyEventIOS.mm:
2576         * platform/mac/KeyEventMac.mm:
2577         * platform/network/HTTPParsers.cpp:
2578         * platform/text/TextCodecUTF8.cpp:
2579         * platform/text/TextEncodingRegistry.cpp:
2580         * platform/win/KeyEventWin.cpp:
2581         * rendering/BidiRun.cpp:
2582         * rendering/FloatingObjects.cpp:
2583         * rendering/RenderBlock.cpp:
2584         * rendering/RenderListMarker.cpp:
2585         * rendering/RenderText.cpp:
2586
2587 2019-01-28  Fujii Hironori  <Hironori.Fujii@sony.com>
2588
2589         [Win] WebCore/platform/Process.h is conflicting with process.h
2590         https://bugs.webkit.org/show_bug.cgi?id=193944
2591
2592         Reviewed by Ross Kirsling.
2593
2594         Windows has process.h. Rename Process.h to ProcessIdentifier.h.
2595
2596         No new tests because there is no behavior change.
2597
2598         * Sources.txt:
2599         * UnifiedSources-input.xcfilelist:
2600         * WebCore.xcodeproj/project.pbxproj:
2601         * dom/MessagePortIdentifier.h:
2602         * dom/messageports/MessagePortChannel.h:
2603         * dom/messageports/MessagePortChannelProvider.h:
2604         * dom/messageports/MessagePortChannelRegistry.h:
2605         * history/BackForwardItemIdentifier.h:
2606         * page/GlobalWindowIdentifier.h:
2607         * platform/ProcessIdentifier.cpp: Renamed from Source/WebCore/platform/Process.cpp.
2608         (WebCore::Process::setIdentifier):
2609         (WebCore::Process::identifier):
2610         * platform/ProcessIdentifier.h: Renamed from Source/WebCore/platform/Process.h.
2611
2612 2019-01-28  Antoine Quint  <graouts@apple.com>
2613
2614         Implement capture for Pointer Events on iOS
2615         https://bugs.webkit.org/show_bug.cgi?id=193917
2616         <rdar://problem/47605689>
2617
2618         Reviewed by Dean Jackson.
2619
2620         We add a new PointerCaptureController object which gets notified upon dispatch of pointer events
2621         to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events,
2622         and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and
2623         releasePointerCapture().
2624
2625         Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
2626                pointerevents/ios/pointer-events-implicit-capture-release-exception.html
2627                pointerevents/ios/pointer-events-implicit-capture-release.html
2628                pointerevents/ios/pointer-events-implicit-capture.html
2629                pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html
2630
2631         * Sources.txt:
2632         * WebCore.xcodeproj/project.pbxproj:
2633         * dom/Element.cpp:
2634         (WebCore::Element::setPointerCapture):
2635         (WebCore::Element::releasePointerCapture):
2636         (WebCore::Element::hasPointerCapture):
2637         * dom/Element.h:
2638         * dom/Element.idl:
2639         * dom/EventNames.h:
2640         * dom/PointerEvent.h:
2641         * page/Page.cpp:
2642         (WebCore::Page::Page):
2643         * page/Page.h:
2644         (WebCore::Page::pointerCaptureController const):
2645         * page/PointerCaptureController.cpp: Added.
2646         (WebCore::PointerCaptureController::PointerCaptureController):
2647         (WebCore::PointerCaptureController::setPointerCapture):
2648         (WebCore::PointerCaptureController::releasePointerCapture):
2649         (WebCore::PointerCaptureController::hasPointerCapture):
2650         (WebCore::PointerCaptureController::pointerLockWasApplied):
2651         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
2652         (WebCore::PointerCaptureController::pointerEventWillBeDispatched):
2653         (WebCore::PointerCaptureController::pointerEventWasDispatched):
2654         (WebCore::PointerCaptureController::processPendingPointerCapture):
2655         * page/PointerCaptureController.h: Added.
2656         * page/PointerLockController.cpp:
2657         (WebCore::PointerLockController::requestPointerLock):
2658         * page/PointerLockController.h:
2659
2660 2019-01-28  Andy Estes  <aestes@apple.com>
2661
2662         [watchOS] Enable Parental Controls content filtering
2663         https://bugs.webkit.org/show_bug.cgi?id=193939
2664         <rdar://problem/46641912>
2665
2666         Reviewed by Ryosuke Niwa.
2667
2668         * Configurations/FeatureDefines.xcconfig:
2669
2670 2019-01-28  Dean Jackson  <dino@apple.com>
2671
2672         Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
2673         https://bugs.webkit.org/show_bug.cgi?id=193945
2674         <rdar://problem/47618922>
2675
2676         Reviewed by Antoine Quint.
2677
2678         Calculate the pressure, tiltX and tiltY values for incoming
2679         Pointer Events, which have values when the PlatformTouchEvent
2680         originated from a stylus.
2681
2682         Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html
2683
2684         * dom/PointerEvent.h: Default to "mouse".
2685         * dom/ios/PointerEventIOS.cpp: Calculate the values.
2686
2687 2019-01-28  Timothy Hatcher  <timothy@apple.com>
2688
2689         Make it easier for non-Apple ports to enable dark mode CSS support.
2690         https://bugs.webkit.org/show_bug.cgi?id=193882
2691
2692         Reviewed by Megan Gardner.
2693
2694         * page/FrameView.cpp:
2695         (WebCore::FrameView::updateBackgroundRecursively): Limit use of system
2696         background color to the Mac platform.
2697         * rendering/RenderTheme.cpp:
2698         (WebCore::RenderTheme::purgeCaches): Purge m_darkColorCache.
2699         (WebCore::RenderTheme::platformColorsDidChange): Reset m_darkColorCache.
2700         (WebCore::RenderTheme::colorCache const): Added m_darkColorCache.
2701         * rendering/RenderTheme.h:
2702         (WebCore::RenderTheme::colorCache const): Deleted.
2703         * rendering/RenderThemeMac.h:
2704         * rendering/RenderThemeMac.mm:
2705         (WebCore::RenderThemeMac::purgeCaches): Removed m_darkColorCache.
2706         (WebCore::RenderThemeMac::platformColorsDidChange): Deleted.
2707         (WebCore::RenderThemeMac::colorCache const): Deleted.
2708
2709 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
2710
2711         svg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree::unparentChildrenAndDestroyNode()
2712         https://bugs.webkit.org/show_bug.cgi?id=193930
2713
2714         Reviewed by Tim Horton.
2715
2716         ScrollingStateTree::unparentChildrenAndDestroyNode() should make a copy of the 'children' vector
2717         before iterating, since iteration mutates the array.
2718
2719         Tested by ASan tests.
2720
2721         * page/scrolling/ScrollingStateNode.h:
2722         (WebCore::ScrollingStateNode::takeChildren):
2723         * page/scrolling/ScrollingStateTree.cpp:
2724         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
2725
2726 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
2727
2728         css3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateNode::ScrollingStateNode
2729         https://bugs.webkit.org/show_bug.cgi?id=193925
2730
2731         Reviewed by Tim Horton.
2732
2733         Some css3/filters/ tests disable accelerated compositing (which is crazy). Make these
2734         tests not crash by ensuring that unparentNode() and unparentChildrenAndDestroyNode() clears the root
2735         node if it's the node being unparented or destroyed.
2736
2737         Tested by existing tests.
2738
2739         * page/scrolling/ScrollingStateTree.cpp:
2740         (WebCore::ScrollingStateTree::unparentNode):
2741         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
2742
2743 2019-01-28  Daniel Bates  <dabates@apple.com>
2744
2745         [iOS] Make Window virtual key code computation match Mac
2746         https://bugs.webkit.org/show_bug.cgi?id=193452
2747
2748         Reviewed by Ryosuke Niwa.
2749
2750         Use the same approach for computing the Windows virtual key code on iOS as we do on Mac for
2751         web compatibility. On Mac, we prefer to compute the  Windows virtual key code from the input
2752         strings of the key event and use the key event's keycode as a last resort.
2753
2754         Test: fast/events/ios/key-events-meta-alt-combinations.html
2755
2756         * platform/ios/PlatformEventFactoryIOS.h:
2757         * platform/ios/PlatformEventFactoryIOS.mm:
2758         (WebCore::isKeypadEvent): Added.
2759         (WebCore::windowsKeyCodeForKeyEvent): Added.
2760         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Modified to call
2761         WebCore::windowsKeyCodeForKeyEvent() to compute the Windows virtual key code.
2762
2763 2019-01-28  Antoine Quint  <graouts@apple.com>
2764
2765         Limit user-agent interactions based on the touch-action property on iOS
2766         https://bugs.webkit.org/show_bug.cgi?id=193447
2767
2768         Unreviewed build fix.
2769
2770         * dom/Element.cpp:
2771         (WebCore::parentCrossingFrameBoundaries):
2772
2773 2019-01-28  Eric Carlson  <eric.carlson@apple.com>
2774
2775         AVStreamSession isn't always available, make a HAVE compile flag for it
2776         https://bugs.webkit.org/show_bug.cgi?id=193889
2777         <rdar://problem/47452863>
2778
2779         Reviewed by Jer Noble.
2780
2781         No new tests, no functional change.
2782
2783         * page/Settings.yaml:
2784         * page/SettingsBase.cpp:
2785         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
2786         * page/SettingsBase.h:
2787         * page/cocoa/SettingsBaseCocoa.mm:
2788         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
2789         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
2790         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
2791         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2792         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2793
2794         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2795         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2796         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging.
2797         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2798
2799         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2800         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2801         
2802         Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC.
2803
2804         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo
2805         -> isEqualToString.
2806         (WebCore::sourceBufferMap):
2807         (WebCore::nextMapID):
2808         (WebCore::bufferWasConsumedCallback):
2809         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2810         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
2811         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
2812         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2813         (WebCore::SourceBufferPrivateAVFObjC::append):
2814         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
2815         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
2816         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2817         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
2818         (-[WebBufferConsumedContext initWithParent:]): Deleted.
2819         (-[WebBufferConsumedContext parent]): Deleted.
2820
2821 2019-01-28  Rob Buis  <rbuis@igalia.com>
2822
2823         Update MIME type parser
2824         https://bugs.webkit.org/show_bug.cgi?id=180526
2825
2826         Reviewed by Frédéric Wang.
2827
2828         I overlooked step 11.9.3 [1], for Mimesniff we should not
2829         bail out on missing subtype, but keep trying. Note
2830         that Rfc2045 does require bailing out, as before.
2831
2832         Test: ParsedContentType unittest
2833
2834         [1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type
2835
2836         * platform/network/ParsedContentType.cpp:
2837         (WebCore::parseToken):
2838         (WebCore::parseContentType):
2839
2840 2019-01-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2841
2842         Unreviewed follow-up to r240557, restore a call to makeString
2843         https://bugs.webkit.org/show_bug.cgi?id=192742
2844         <rdar://problem/46757369>
2845
2846         It works if we add this #include that was missing. I got confused by the error messages and
2847         missed that there were two similarly-named headers.
2848
2849         * rendering/RenderLayerCompositor.cpp:
2850         (WebCore::RenderLayerCompositor::logLayerInfo):
2851
2852 2019-01-28  Oriol Brufau  <obrufau@igalia.com>
2853
2854         [css-logical] Reject unitless length quirk in 'inset' shorthand
2855         https://bugs.webkit.org/show_bug.cgi?id=193773
2856
2857         Reviewed by Manuel Rego Casasnovas.
2858
2859         Even though its longhands ('top', 'right', 'bottom', 'left') accept the
2860         unitless length quirk, the 'inset' shorthand is a new CSS property and
2861         should reject it. This was resolved by the CSS WG in
2862         https://github.com/w3c/csswg-drafts/issues/3525#issuecomment-456902648
2863
2864         Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html
2865                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002.html
2866                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html
2867                imported/w3c/web-platform-tests/quirks/unitless-length/limited-quirks.html
2868                imported/w3c/web-platform-tests/quirks/unitless-length/no-quirks.html
2869                imported/w3c/web-platform-tests/quirks/unitless-length/quirks.html
2870
2871         * css/parser/CSSPropertyParser.cpp:
2872         (WebCore::CSSPropertyParser::parseSingleValue):
2873
2874 2019-01-28  Zalan Bujtas  <zalan@apple.com>
2875
2876         [LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin collapsing
2877         https://bugs.webkit.org/show_bug.cgi?id=193896
2878
2879         Reviewed by Antti Koivisto.
2880
2881         This patch implements quirk margin value collapsing. There are a few "quirk" rules when it comes to margin collapsing.
2882
2883         1. Collapsed quirk margin values are ignored on quirk containers
2884
2885             <body>
2886               <p> p elements have 1em vertical (top/bottom) quirk margin
2887             </body>
2888
2889             In quirk mode, <p> and <body> (quirk container) collapses their vertical margins but <p>'s quirk values(1qem -> 16px) are ignored.
2890             Used vertical margin values on the <body> are top: 8px bottom: 8px.
2891
2892         2. Quirk margin values are turned into non-quirk values when collapsed with non-zero, non-quirk margins.
2893
2894             <body>
2895               <div style="margin-top: 1px">
2896                 <p> p elements have 1em vertical (top/bottom) quirk margin
2897               </div>
2898             </body>
2899
2900             When <p>'s vertical margin collapses with the parent <div>,
2901             - the collapsed before value becomes 16px (max(1qem, 1px)) and this collapsed value is now considered as a non-quirk value
2902             - the collapsed after value stays 1qem quirk value.
2903
2904             When <div> collapses with <body>
2905             - the collapsed before value becomes 16px (max(16px, 8px))
2906             - the <div>'s quirk after value gets ignored and the collapsed after value stays 8px.
2907             Used vertical margin values on the <body> are top: 16px (1em) bottom: 8px.
2908
2909         * layout/MarginTypes.h:
2910         (WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const):
2911         * layout/blockformatting/BlockFormattingContext.h:
2912         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2913         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin):
2914         (WebCore::Layout::hasMarginBeforeQuirkValue): Deleted.
2915         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): Deleted.
2916         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter): Deleted.
2917         * layout/blockformatting/BlockMarginCollapse.cpp:
2918         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
2919         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
2920         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
2921         (WebCore::Layout::computedPositiveAndNegativeMargin):
2922         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
2923         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
2924
2925 2019-01-28  Zalan Bujtas  <zalan@apple.com>
2926
2927         [LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition
2928         https://bugs.webkit.org/show_bug.cgi?id=193872
2929
2930         Reviewed by Antti Koivisto.
2931
2932         This is taken care of by verticalPositionWithMargin() in BlockFormattingContext::computeHeightAndMargin(). 
2933
2934         * layout/blockformatting/BlockFormattingContext.cpp:
2935         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2936
2937 2019-01-28  cathie chen  <cathiechen@igalia.com>
2938
2939         Add missing #include in ScrollingTreeFrameScrollingNode.cpp
2940         https://bugs.webkit.org/show_bug.cgi?id=193905
2941
2942         Reviewed by Frédéric Wang.
2943
2944         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add
2945         #include "ScrollingStateFrameScrollingNode.h"
2946
2947 2019-01-28  Zalan Bujtas  <zalan@apple.com>
2948
2949         [LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
2950         https://bugs.webkit.org/show_bug.cgi?id=193894
2951
2952         Reviewed by Antti Koivisto.
2953
2954         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2955         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
2956
2957 2019-01-28  Antoine Quint  <graouts@apple.com>
2958
2959         Limit user-agent interactions based on the touch-action property on iOS
2960         https://bugs.webkit.org/show_bug.cgi?id=193447
2961         <rdar://problem/47283874>
2962
2963         Reviewed by Antti Koivisto and Simon Fraser.
2964
2965         We now compile a list of elements with a non-auto touch-action property that is updated whenever an element has its style changed
2966         or is removed from its document. When the content of that list changes, we inform the scrolling coordinator such that it can compile
2967         a list of TouchActionData structures which hold the touch-action value, the ID of the nearest scroll node and the Region containing
2968         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
2969         actions for a given element accounts for not only the value specified directly on that element's style, but also in its hierarchy,
2970         crossing any frame boundary towards the top-level document's root node.
2971
2972         Tests: pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
2973                pointerevents/ios/touch-action-none-on-iframe.html
2974                pointerevents/ios/touch-action-none-on-parent.html
2975                pointerevents/ios/touch-action-none.html
2976                pointerevents/ios/touch-action-pan-x-pan-y.html
2977                pointerevents/ios/touch-action-pan-x.html
2978                pointerevents/ios/touch-action-pan-y.html
2979                pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html
2980                pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html
2981
2982         * WebCore.xcodeproj/project.pbxproj: Update how certain headers are exposed such that they can be used from WebKit.
2983         * dom/Document.cpp:
2984         (WebCore::Document::invalidateRenderingDependentRegions):
2985         (WebCore::Document::nodeWillBeRemoved): Ensure a node that is being removed from this document is no longer listed in its
2986         list of elements with a non-auto touch-action property.
2987         (WebCore::Document::absoluteEventRegionForNode):
2988         (WebCore::Document::absoluteRegionForEventTargets):
2989         (WebCore::Document::updateTouchActionElements): Create a list of elements with a non-auto touch-action property if one doesn't
2990         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
2991         of that list changed as a result, the scrolling coordinator is informed.
2992         * dom/Document.h:
2993         (WebCore::Document:: const):
2994         * dom/Element.cpp:
2995         (WebCore::parentCrossingFrameBoundaries):
2996         (WebCore::Element::computedTouchActions const): Provide the list of allowed touch actions accounting for the "touch-action" property
2997         specified on this element and all of its hierarchy, crossing frame boundary.
2998         (WebCore::Element::nearestScrollingNodeIDUsingTouchOverflowScrolling const): Provide the ScrollingNodeID, if any, for the nearest scrolling node
2999         for that element. This will allow the UI process to identify which scroll view's behavior to customize to reflect the element's allowed
3000         touch actions.
3001         * dom/Element.h:
3002         * page/scrolling/ScrollingCoordinator.cpp:
3003         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): Compute the region for all elements with a non-auto touch-action property
3004         throughout the provided frame and all of its subframes.
3005         * page/scrolling/ScrollingCoordinator.h:
3006         (WebCore::ScrollableAreaParameters::operator== const): Deleted.
3007         * page/scrolling/ScrollingCoordinatorTypes.h: Added.
3008         (WebCore::ScrollableAreaParameters::operator== const):
3009         * page/scrolling/ScrollingTree.cpp:
3010         (WebCore::ScrollingTree::touchActionDataAtPoint const): Query the list of TouchActionData objects for a match based on the provided point. Right
3011         now the logic is pretty crude, stopping at the first TouchActionData for which the region contains the provided point, but future patches will
3012         account for overlap and nesting.
3013         * page/scrolling/ScrollingTree.h:
3014         * page/scrolling/ScrollingTreeNode.h:
3015         * platform/EventTrackingRegions.cpp:
3016         (WebCore::operator==):
3017         * platform/EventTrackingRegions.h:
3018         (WebCore::operator!=):
3019         * style/StyleTreeResolver.cpp:
3020         (WebCore::Style::TreeResolver::resolveElement): Update the list of elements with a non-auto touch-action property when an element's style changes.
3021
3022 2019-01-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3023
3024         Unreviewed, fix WPE/GTK debug builds after r240557
3025         https://bugs.webkit.org/show_bug.cgi?id=192742
3026         <rdar://problem/46757369>
3027
3028         Also fix an improper format string that was recently added in a different commit.
3029
3030         * rendering/RenderLayerCompositor.cpp:
3031         (WebCore::RenderLayerCompositor::logLayerInfo):
3032         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
3033
3034 2018-12-15  Darin Adler  <darin@apple.com>
3035
3036         Replace many uses of String::format with more type-safe alternatives
3037         https://bugs.webkit.org/show_bug.cgi?id=192742
3038
3039         Reviewed by Mark Lam.
3040
3041         A while back, String::format was more efficient than string concatenation,
3042         but that is no longer true, and we should prefer String::number, makeString,
3043         or concatenation with the "+" operator to String::format for new code.
3044
3045         This is not as good for programmers who are fond of printf formatting
3046         style, and in some cases it's a little harder to read the strings
3047         interspersed with variables rather than a format string, but it's better
3048         in a few ways:
3049
3050         - more efficient (I didn't measure the difference, but it's definitely
3051           slower to use String::Format which calls vsnprintf twice than to use
3052           the WTF code)
3053         - works in a type-safe way without a need to use a format specifier such
3054           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
3055           subtle differences between platforms
3056         - allows us to use StringView in some cases to sidestep the need to
3057           allocate temporary WTF::String objects
3058         - does not require converting each WTF::String to a C string, allowing
3059           us to remove many cases of ".utf8().data()" and similar expressions,
3060           eliminating the allocation of temporary WTF::CString objects
3061
3062         This patch covers a batch of easiest-to-convert call sites.
3063         Later patches will allow us to deprecate or remove String::format.
3064
3065         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3066         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
3067         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3068         (WebCore::IDBCursorInfo::loggingString const): Ditto.
3069         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
3070         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
3071         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
3072         (WebCore::IDBGetRecordData::loggingString const): Ditto.
3073         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
3074         (WebCore::IDBIndexInfo::loggingString const): Ditto.
3075         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
3076         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
3077         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
3078         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3079         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
3080         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3081         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
3082         * Modules/webdatabase/Database.cpp:
3083         (WebCore::formatErrorMessage): Ditto.
3084         * Modules/webdatabase/SQLError.h:
3085         (WebCore::SQLError::create): Ditto.
3086
3087         * bindings/scripts/CodeGeneratorJS.pm:
3088         (GenerateImplementation): Use makeString.
3089
3090         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3091         * bindings/scripts/test/JS/JSMapLike.cpp:
3092         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3093         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3094         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3095         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3096         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3097         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3098         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3099         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3100         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3101         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3102         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3103         * bindings/scripts/test/JS/JSTestException.cpp:
3104         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3105         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3106         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3107         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3108         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3109         * bindings/scripts/test/JS/JSTestInterface.cpp:
3110         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3111         * bindings/scripts/test/JS/JSTestIterable.cpp:
3112         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3113         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3114         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3115         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3116         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3117         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3118         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3119         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3120         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3121         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3122         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3123         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3124         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3125         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3126         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3127         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3128         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3129         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3130         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3131         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3132         * bindings/scripts/test/JS/JSTestNode.cpp:
3133         * bindings/scripts/test/JS/JSTestObj.cpp:
3134         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3135         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3136         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3137         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3138         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3139         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3140         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
3141         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3142         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3143         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3144         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3145         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3146         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3147         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3148         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3149         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3150         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3151         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3152         Updated expected results.
3153 :
3154         * css/parser/CSSPropertyParserHelpers.cpp:
3155         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
3156         and makeString.
3157
3158         * html/HTMLSelectElement.cpp:
3159         (WebCore::HTMLSelectElement::setLength): Use makeString.
3160         * html/ImageDocument.cpp:
3161         (WebCore::ImageDocument::imageUpdated): Ditto.
3162         * html/parser/XSSAuditor.cpp:
3163         (WebCore::XSSAuditor::init): Ditto.
3164         * inspector/InspectorFrontendClientLocal.cpp:
3165         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
3166         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
3167         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
3168         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
3169         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
3170         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
3171         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
3172         * page/MemoryRelease.cpp:
3173         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
3174
3175         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3176         (WebCore::formatByteNumber): Use String::number.
3177         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
3178
3179         * page/cocoa/ResourceUsageThreadCocoa.mm:
3180         (WebCore::logFootprintComparison): Use makeString.
3181         * platform/animation/TimingFunction.cpp:
3182         (WebCore::TimingFunction::cssText const): Ditto.
3183
3184         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3185         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
3186         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3187         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
3188
3189         * platform/graphics/ca/GraphicsLayerCA.cpp:
3190         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
3191         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
3192         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
3193         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
3194         * platform/mock/MockRealtimeVideoSource.cpp:
3195         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
3196
3197         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
3198
3199         * platform/network/ParsedContentRange.cpp:
3200         (WebCore::ParsedContentRange::headerValue const): Use makeString.
3201
3202         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
3203         compiler conditionals and reorganized the start/stop of namespaces.
3204         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
3205
3206         * platform/sql/SQLiteDatabase.cpp:
3207         (WebCore::unauthorizedSQLFunction): Use makeString.
3208         * rendering/RenderLayerCompositor.cpp:
3209         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
3210         * workers/service/server/RegistrationDatabase.cpp:
3211         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
3212         (WebCore::RegistrationDatabase::importRecords): Ditto.
3213
3214 2019-01-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3215
3216         Remove a couple of PLATFORM defines intended for watchOS
3217         https://bugs.webkit.org/show_bug.cgi?id=193888
3218
3219         Reviewed by Alexey Proskuryakov.
3220
3221         Remove the use of !PLATFORM(WATCH), since this is true on every platform.
3222
3223         * editing/cocoa/DictionaryLookup.mm:
3224
3225 2019-01-27  Jiewen Tan  <jiewen_tan@apple.com>
3226
3227         Use a load optimizer for some sites
3228         https://bugs.webkit.org/show_bug.cgi?id=193881
3229         <rdar://problem/46325455>
3230
3231         Reviewed by Brent Fulgham.
3232
3233         Expose FormData::flatten to be used by the load optimizer.
3234
3235         * WebCore.xcodeproj/project.pbxproj:
3236         * platform/network/FormData.h:
3237
3238 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
3239
3240         Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
3241         https://bugs.webkit.org/show_bug.cgi?id=193879
3242
3243         Reviewed by Antti Koivisto.
3244
3245         Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
3246         This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
3247         makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
3248         updates of the scrolling tree node in an iframe.
3249         
3250         To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
3251         nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
3252         simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
3253         connect GraphicsLayers together.
3254         
3255         RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.
3256
3257         Tested by existing tests.
3258
3259         * page/FrameView.h:
3260         * rendering/RenderLayer.cpp:
3261         (WebCore::outputPaintOrderTreeRecursive):
3262         * rendering/RenderLayerBacking.cpp:
3263         (WebCore::RenderLayerBacking::updateConfiguration):
3264         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
3265         * rendering/RenderLayerCompositor.cpp:
3266         (WebCore::frameContentsRenderView):
3267         (WebCore::RenderLayerCompositor::frameContentsCompositor):
3268         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
3269         (WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
3270         (WebCore::RenderLayerCompositor::detachRootLayer):
3271         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
3272         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
3273         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
3274         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
3275         (WebCore::RenderLayerCompositor::attachScrollingNode):
3276         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
3277         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3278         * rendering/RenderLayerCompositor.h:
3279         * testing/Internals.cpp:
3280         (WebCore::Internals::scrollingStateTreeAsText const):
3281
3282 2019-01-27  Chris Fleizach  <cfleizach@apple.com>
3283
3284         AX: Introduce a static accessibility tree
3285         https://bugs.webkit.org/show_bug.cgi?id=193348
3286         <rdar://problem/47203295>
3287
3288         Reviewed by Ryosuke Niwa.
3289
3290         In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which 
3291         could be accessed on a different thread by assistive technologies.
3292         That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the 
3293         "live" AccessibilityObjects (which interact with both DOM and Render trees).
3294         These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree 
3295         representation and able to be read from anywhere.
3296         Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared 
3297         with AccessibilityObject.
3298         This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization.
3299
3300         * CMakeLists.txt:
3301         * Configurations/FeatureDefines.xcconfig:
3302         * Sources.txt:
3303         * WebCore.xcodeproj/project.pbxproj:
3304         * accessibility/AXObjectCache.cpp:
3305         (WebCore::AXObjectCache::remove):
3306         (WebCore::AXObjectCache::createIsolatedAccessibilityTree):
3307         (WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded):
3308         * accessibility/AXObjectCache.h:
3309         * accessibility/AccessibilityObject.h:
3310         * accessibility/AccessibilityObjectInterface.h: Added.
3311         * accessibility/isolatedtree: Added.
3312         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
3313         (WebCore::AXIsolatedTree::treeCache):
3314         (WebCore::AXIsolatedTree::AXIsolatedTree):
3315         (WebCore::AXIsolatedTree::create):
3316         (WebCore::AXIsolatedTree::treeForID):
3317         (WebCore::AXIsolatedTree::treeForPageID):
3318         (WebCore::AXIsolatedTree::nodeForID const):
3319         (WebCore::AXIsolatedTree::rootNode):
3320         (WebCore::AXIsolatedTree::removeNode):
3321         (WebCore::AXIsolatedTree::appendNodeChanges):
3322         (WebCore::AXIsolatedTree::applyPendingChanges):
3323         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
3324         (WebCore::AXIsolatedTree::treeIdentifier const):
3325         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
3326             To note: we don't mark the attribute map const because even though attributes don't change after initial creation,
3327             we may copy an existing node and replace specific values.
3328         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
3329         (WebCore::AXIsolatedTreeNode::create):
3330         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
3331         (WebCore::AXIsolatedTreeNode::setProperty):
3332         (WebCore::AXIsolatedTreeNode::doubleAttributeValue const):
3333         (WebCore::AXIsolatedTreeNode::unsignedAttributeValue const):
3334         (WebCore::AXIsolatedTreeNode::boolAttributeValue const):
3335         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
3336         (WebCore::AXIsolatedTreeNode::intAttributeValue const):
3337         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
3338         * accessibility/mac/AXObjectCacheMac.mm:
3339         (WebCore::AXObjectCache::associateIsolatedTreeNode):
3340         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
3341         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3342         (-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
3343         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
3344         (-[WebAccessibilityObjectWrapperBase detach]):
3345         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
3346         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
3347         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
3348         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3349         (-[WebAccessibilityObjectWrapper role]):
3350         (-[WebAccessibilityObjectWrapper subrole]):
3351         (-[WebAccessibilityObjectWrapper roleDescription]):
3352         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3353         * dom/Document.cpp:
3354         (WebCore::Document::pageID const):
3355         * dom/Document.h:
3356
3357 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
3358
3359         Allow scrolling tree nodes to exist in a detached state
3360         https://bugs.webkit.org/show_bug.cgi?id=193754
3361
3362         Reviewed by Zalan Bujtas.
3363
3364         One of the (questionable?) design decisions of the scrolling tree is that the tree implementation
3365         is hidden behind the ScrollingCoordinator interface. That interface only allowed nodes to exist
3366         in a connected state; attachToStateTree() required a non-zero parent for any node that was not
3367         the root.
3368
3369         This makes it impossible to coordinate the hookup of the scrolling tree across frame boundaries;
3370         the scrolling tree has to have been fully constructed in ancestor frames before subframe nodes
3371         can be attached. This is a significant difference from compositing, where a subframe can create
3372         GraphicsLayers which don't have to be parented right away, and actually get parented later via
3373         a compositing update in the parent frame.
3374
3375         We want to be able to hook up the scrolling tree via the same code paths as GraphicsLayer
3376         connection (anything else is too confusing). So we need to be able to instantiate scrolling
3377         tree nodes in a disconnected state, and attach them later.
3378