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