b7e8ffabd63906858d7d1bfe17d792080409225e
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-24  Youenn Fablet  <youenn@apple.com>
2
3         Use MonotonicTime in WorkerRunLoop
4         https://bugs.webkit.org/show_bug.cgi?id=193417
5
6         Reviewed by Saam Barati.
7
8         Condition is based on MonotonicTime so MessageQueue should also be based on MonotonicTime.
9         Ditto for WorkerRunLoop.
10         No easy way to test the change which should not be easily observable.
11
12         * workers/WorkerRunLoop.cpp:
13         (WebCore::WorkerRunLoop::runInMode):
14
15 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
16
17         Move FileSystem to WTF
18         https://bugs.webkit.org/show_bug.cgi?id=193602
19
20         Reviewed by Yusuke Suzuki.
21
22         * Modules/encryptedmedia/CDM.cpp:
23         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
24         * Modules/entriesapi/DOMFileSystem.cpp:
25         * Modules/entriesapi/FileSystemEntry.cpp:
26         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
27         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
28         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
29         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
30         * Modules/webdatabase/DatabaseTracker.cpp:
31         * Modules/webdatabase/OriginLock.cpp:
32         * Modules/webdatabase/OriginLock.h:
33         * Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
34         * PlatformMac.cmake:
35         * PlatformPlayStation.cmake:
36         * PlatformWin.cmake:
37         * Sources.txt:
38         * SourcesCocoa.txt:
39         * WebCore.xcodeproj/project.pbxproj:
40         * bindings/js/GCController.cpp:
41         * dom/DataTransferItem.cpp:
42         * editing/cocoa/WebContentReaderCocoa.mm:
43         * fileapi/File.cpp:
44         * fileapi/FileCocoa.mm:
45         * html/FileInputType.cpp:
46         * html/FileListCreator.cpp:
47         * loader/appcache/ApplicationCacheHost.cpp:
48         * loader/appcache/ApplicationCacheStorage.cpp:
49         * page/Page.cpp:
50         * page/SecurityOrigin.cpp:
51         * page/SecurityOriginData.cpp:
52         * platform/FileHandle.h:
53         * platform/FileStream.cpp:
54         * platform/FileStream.h:
55         * platform/SharedBuffer.h:
56         * platform/SourcesGLib.txt:
57         * platform/cocoa/FileMonitorCocoa.mm:
58         * platform/glib/FileMonitorGLib.cpp:
59         * platform/glib/SharedBufferGlib.cpp:
60         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
61         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
62         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
63         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
64         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
65         * platform/ios/QuickLook.mm:
66         * platform/ios/WebItemProviderPasteboard.mm:
67         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
68         * platform/network/BlobDataFileReference.cpp:
69         * platform/network/BlobRegistryImpl.cpp:
70         * platform/network/BlobResourceHandle.cpp:
71         * platform/network/FormData.cpp:
72         * platform/network/cf/FormDataStreamCFNet.cpp:
73         * platform/network/cocoa/ResourceRequestCocoa.mm:
74         * platform/network/curl/CookieJarDB.cpp:
75         * platform/network/curl/CurlCacheEntry.h:
76         * platform/network/curl/CurlCacheManager.cpp:
77         * platform/network/curl/CurlFormDataStream.h:
78         * platform/network/curl/CurlRequest.h:
79         * platform/network/curl/NetworkStorageSessionCurl.cpp:
80         * platform/network/curl/ResourceHandleCurl.cpp:
81         * platform/network/mac/BlobDataFileReferenceMac.mm:
82         * platform/network/soup/ResourceHandleSoup.cpp:
83         * platform/network/soup/SoupNetworkSession.cpp:
84         * platform/posix/SharedBufferPOSIX.cpp:
85         * platform/sql/SQLiteFileSystem.cpp:
86         * platform/text/hyphen/HyphenationLibHyphen.cpp:
87         * platform/win/SearchPopupMenuDB.cpp:
88         * rendering/RenderTheme.cpp:
89         * rendering/RenderThemeGtk.cpp:
90         * rendering/RenderThemeWin.cpp:
91         * workers/service/server/RegistrationDatabase.cpp:
92
93 2019-01-24  Zalan Bujtas  <zalan@apple.com>
94
95         [LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not return computed non-collapsed values.
96         https://bugs.webkit.org/show_bug.cgi?id=193768
97
98         Reviewed by Antti Koivisto.
99
100         When it comes to the actual used values it does not really matter, only from correctness point of view.
101         (This patch also moves some checks to their correct place.)
102
103         * layout/blockformatting/BlockMarginCollapse.cpp:
104         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
105         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
106         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
107         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
108         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
109         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
110
111 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
112
113         Add "frame hosting" nodes to the scrolling tree
114         https://bugs.webkit.org/show_bug.cgi?id=193753
115
116         Reviewed by Antti Koivisto.
117
118         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
119         require the iframe's scrolling node to get reparented in a new ancestor, which requires
120         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
121
122         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
123         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
124         to provide a consistent parent node for the subframe's scrolling node.
125
126         This patch adds the node types, but does not instantiate them yet.
127
128         * Sources.txt:
129         * WebCore.xcodeproj/project.pbxproj:
130         * page/scrolling/ScrollingCoordinator.cpp:
131         (WebCore::operator<<):
132         * page/scrolling/ScrollingCoordinator.h:
133         * page/scrolling/ScrollingStateFrameHostingNode.cpp: Added.
134         (WebCore::ScrollingStateFrameHostingNode::create):
135         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
136         (WebCore::ScrollingStateFrameHostingNode::clone):
137         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
138         * page/scrolling/ScrollingStateFrameHostingNode.h: Added.
139         * page/scrolling/ScrollingStateNode.h:
140         (WebCore::ScrollingStateNode::isFrameHostingNode const):
141         * page/scrolling/ScrollingStateTree.cpp:
142         (WebCore::ScrollingStateTree::createNode):
143         * page/scrolling/ScrollingTreeFrameHostingNode.cpp: Added.
144         (WebCore::ScrollingTreeFrameHostingNode::create):
145         (WebCore::ScrollingTreeFrameHostingNode::ScrollingTreeFrameHostingNode):
146         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
147         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
148         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
149         * page/scrolling/ScrollingTreeFrameHostingNode.h: Added.
150         * page/scrolling/ScrollingTreeNode.h:
151         (WebCore::ScrollingTreeNode::isFrameHostingNode const):
152         * page/scrolling/ios/ScrollingTreeIOS.cpp:
153         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
154         * page/scrolling/mac/ScrollingTreeMac.cpp:
155         (ScrollingTreeMac::createScrollingTreeNode):
156         * rendering/RenderLayerBacking.cpp:
157         (WebCore::RenderLayerBacking::~RenderLayerBacking):
158         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
159         (WebCore::operator<<):
160         * rendering/RenderLayerBacking.h:
161         * rendering/RenderLayerCompositor.cpp:
162         (WebCore::scrollCoordinationRoleForNodeType):
163         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
164         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
165         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
166         * rendering/RenderLayerCompositor.h:
167
168 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
169
170         [iOS] Enable media element volume on iPad
171         https://bugs.webkit.org/show_bug.cgi?id=193745
172         <rdar://problem/47452297>
173
174         Reviewed by Jer Noble.
175
176         * html/HTMLMediaElement.cpp:
177         (WebCore::HTMLMediaElement::setVolume):
178         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
179         (WebCore::HTMLMediaElement::updateVolume):
180
181         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
182         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
183
184 2019-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
185
186         [GTK][WPE] Support JPEG 2000 images
187         https://bugs.webkit.org/show_bug.cgi?id=186272
188
189         Reviewed by Žan Doberšek.
190
191         Add JPEG2000ImageDecoder to support JPEG2000 images using OpenJPEG. For now only SRGB and SYCC color spaces are
192         supported.
193
194         * platform/ImageDecoders.cmake:
195         * platform/MIMETypeRegistry.cpp:
196         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
197         * platform/image-decoders/ScalableImageDecoder.cpp:
198         (WebCore::ScalableImageDecoder::create):
199         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: Added.
200         (WebCore::syccToRGB):
201         (WebCore::sycc444ToRGB):
202         (WebCore::sycc422ToRGB):
203         (WebCore::sycc420ToRGB):
204         (WebCore::JPEG2000ImageDecoder::JPEG2000ImageDecoder):
205         (WebCore::JPEG2000ImageDecoder::frameBufferAtIndex):
206         (WebCore::JPEG2000ImageDecoder::decode):
207         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.h: Added.
208
209 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
210
211         Change some RenderLayerCompositor functions to use references
212         https://bugs.webkit.org/show_bug.cgi?id=193760
213
214         Reviewed by Zalan Bujtas.
215
216         RenderWidget* -> RenderWidget&
217
218         * rendering/RenderLayerBacking.cpp:
219         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
220         (WebCore::RenderLayerBacking::updateConfiguration):
221         * rendering/RenderLayerCompositor.cpp:
222         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
223         (WebCore::RenderLayerCompositor::updateBacking):
224         (WebCore::RenderLayerCompositor::frameContentsCompositor):
225         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
226         * rendering/RenderLayerCompositor.h:
227
228 2019-01-23  Benjamin Poulain  <benjamin@webkit.org>
229
230         <rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
231         https://bugs.webkit.org/show_bug.cgi?id=193742
232
233         Reviewed by Eric Carlson.
234
235         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
236         The original bug was fixed, see radar: rdar://problem/27686430
237
238 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
239
240         Clean up IndexedDB files between tests
241         https://bugs.webkit.org/show_bug.cgi?id=192796
242         <rdar://problem/46824999>
243
244         Reviewed by Geoffrey Garen.
245
246         We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.
247
248         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
249         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
250         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
251
252 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
253
254         Add CSS Logical spec to features.json
255         https://bugs.webkit.org/show_bug.cgi?id=193717
256
257         Reviewed by Manuel Rego Casasnovas.
258
259         * features.json:
260
261 2019-01-22  Conrad Shultz  <conrad_shultz@apple.com>
262
263         Clean up USE(WEB_THREAD)
264         https://bugs.webkit.org/show_bug.cgi?id=193698
265
266         Rubber-stamped by Tim Horton.
267
268         * page/CaptionUserPreferencesMediaAF.cpp:
269         (WebCore::userCaptionPreferencesChangedNotificationCallback):
270         * platform/cf/MainThreadSharedTimerCF.cpp:
271         (WebCore::applicationDidBecomeActive):
272         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
273         (WebCore::dispatchToMainThread):
274         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
275         (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
276         * platform/ios/LegacyTileCache.mm:
277         (WebCore::LegacyTileCache::layoutTiles):
278         (WebCore::LegacyTileCache::setTilingMode):
279         * platform/ios/WebCoreMotionManager.mm:
280         (-[WebCoreMotionManager sendAccelerometerData:]):
281         (-[WebCoreMotionManager sendMotionData:withHeading:]):
282         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
283         (VideoFullscreenControllerContext::requestUpdateInlineRect):
284         (VideoFullscreenControllerContext::requestVideoContentLayer):
285         (VideoFullscreenControllerContext::returnVideoContentLayer):
286         (VideoFullscreenControllerContext::didSetupFullscreen):
287         (VideoFullscreenControllerContext::willExitFullscreen):
288         (VideoFullscreenControllerContext::didExitFullscreen):
289         (VideoFullscreenControllerContext::didCleanupFullscreen):
290         (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
291         (VideoFullscreenControllerContext::requestFullscreenMode):
292         (VideoFullscreenControllerContext::setVideoLayerFrame):
293         (VideoFullscreenControllerContext::setVideoLayerGravity):
294         (VideoFullscreenControllerContext::fullscreenModeChanged):
295         (VideoFullscreenControllerContext::play):
296         (VideoFullscreenControllerContext::pause):
297         (VideoFullscreenControllerContext::togglePlayState):
298         (VideoFullscreenControllerContext::toggleMuted):
299         (VideoFullscreenControllerContext::setMuted):
300         (VideoFullscreenControllerContext::setVolume):
301         (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
302         (VideoFullscreenControllerContext::beginScrubbing):
303         (VideoFullscreenControllerContext::endScrubbing):
304         (VideoFullscreenControllerContext::seekToTime):
305         (VideoFullscreenControllerContext::fastSeek):
306         (VideoFullscreenControllerContext::beginScanningForward):
307         (VideoFullscreenControllerContext::beginScanningBackward):
308         (VideoFullscreenControllerContext::endScanning):
309         (VideoFullscreenControllerContext::selectAudioMediaOption):
310         (VideoFullscreenControllerContext::selectLegibleMediaOption):
311         (VideoFullscreenControllerContext::duration const):
312         (VideoFullscreenControllerContext::currentTime const):
313         (VideoFullscreenControllerContext::bufferedTime const):
314         (VideoFullscreenControllerContext::isPlaying const):
315         (VideoFullscreenControllerContext::playbackRate const):
316         (VideoFullscreenControllerContext::seekableRanges const):
317         (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
318         (VideoFullscreenControllerContext::liveUpdateInterval const):
319         (VideoFullscreenControllerContext::canPlayFastReverse const):
320         (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
321         (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
322         (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
323         (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
324         (VideoFullscreenControllerContext::externalPlaybackEnabled const):
325         (VideoFullscreenControllerContext::externalPlaybackTargetType const):
326         (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
327         (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
328         (VideoFullscreenControllerContext::setUpFullscreen):
329         (VideoFullscreenControllerContext::exitFullscreen):
330         (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
331         (-[WebVideoFullscreenController enterFullscreen:mode:]):
332         (-[WebVideoFullscreenController exitFullscreen]):
333         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
334         * platform/ios/wak/WAKWindow.mm:
335         (-[WAKWindow setVisible:]):
336         (-[WAKWindow setScreenScale:]):
337         (-[WAKWindow sendEvent:]):
338         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
339         * platform/network/ios/NetworkStateNotifierIOS.mm:
340         (WebCore::NetworkStateNotifier::startObserving):
341         * rendering/RenderThemeIOS.mm:
342         (WebCore::contentSizeCategoryDidChange):
343
344 2019-01-23  David Kilzer  <ddkilzer@apple.com>
345
346         REGRESSION (r240292): Attempt to fix WinCairo build
347
348         * platform/network/curl/CurlResourceHandleDelegate.cpp:
349         (WebCore::handleCookieHeaders): Remove argument to
350         NetworkingContext::storageSession().
351
352 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
353
354         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
355         https://bugs.webkit.org/show_bug.cgi?id=193706
356         <rdar://problem/44807048>
357
358         Reviewed by Ryosuke Niwa.
359
360         Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
361         label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
362         undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
363         label simultaneously. There should be no change in behavior.
364
365         * editing/CompositeEditCommand.cpp:
366         (WebCore::EditCommandComposition::label const):
367         * editing/CompositeEditCommand.h:
368         * editing/CustomUndoStep.cpp:
369         (WebCore::CustomUndoStep::label const):
370         * editing/CustomUndoStep.h:
371         * editing/EditAction.cpp:
372         (WebCore::undoRedoLabel):
373         (WebCore::nameForUndoRedo): Deleted.
374         * editing/EditAction.h:
375
376         Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
377         WebKitLegacy.
378
379         * editing/UndoStep.h:
380
381         Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
382         localized string, CustomUndoStep implements this by returning the undoable action label provided by script.
383
384 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
385
386         [SOUP] Clean up NetworkStorageSession
387         https://bugs.webkit.org/show_bug.cgi?id=193707
388
389         Reviewed by Carlos Garcia Campos.
390
391         A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
392         complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
393         know the session has always already been created. The soupNetworkSession getter can now
394         return a reference rather than a pointer, because it will never be NULL except after it has
395         been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
396         before process termination after nothing else is using it. Cookie jar syncing can also go
397         away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
398         use its cookie jar.
399
400         * platform/network/NetworkStorageSession.h:
401         (WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
402         * platform/network/soup/DNSResolveQueueSoup.cpp:
403         (WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
404         (WebCore::DNSResolveQueueSoup::platformResolve):
405         (WebCore::DNSResolveQueueSoup::resolve):
406         * platform/network/soup/NetworkStorageSessionSoup.cpp:
407         (WebCore::NetworkStorageSession::NetworkStorageSession):
408         (WebCore::NetworkStorageSession::~NetworkStorageSession):
409         (WebCore::NetworkStorageSession::soupNetworkSession const):
410         (WebCore::NetworkStorageSession::clearSoupNetworkSession):
411         (WebCore::NetworkStorageSession::cookieStorage const):
412         (WebCore::NetworkStorageSession::setCookieStorage):
413         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
414         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
415         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
416         (WebCore::SocketStreamHandleImpl::create):
417
418 2019-01-23  Zalan Bujtas  <zalan@apple.com>
419
420         [LFC][BFC] computeStaticPosition should include estimated computation as well.
421         https://bugs.webkit.org/show_bug.cgi?id=193719
422
423         Reviewed by Antti Koivisto.
424
425         Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
426         It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
427         the containing block's width).
428         This is also in preparation for moving 'clear' positioning to computeStaticPosition.
429
430         * layout/blockformatting/BlockFormattingContext.cpp:
431         (WebCore::Layout::BlockFormattingContext::layout const):
432         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
433         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
434         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
435         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
436         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
437         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
438         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
439         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
440         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
441         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
442         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
443         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
444         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
445         * layout/blockformatting/BlockFormattingContext.h:
446         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
447         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
448         * layout/blockformatting/BlockMarginCollapse.cpp:
449         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
450
451 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
452
453         Compositing updates need to reparent scrolling tree nodes with a changed ancestor
454         https://bugs.webkit.org/show_bug.cgi?id=193699
455
456         Reviewed by Frédéric Wang.
457
458         Now that compositing updates are incremental and may not do a full layer walk,
459         we need to ensure that when a scrolling tree node is removed, we traverse to all
460         descendant layers whose scrolling tree nodes refer to the removed node as their parent.
461
462         To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
463         ensures that the updateBackingAndHierarchy part of the compositing update traverses
464         layers with the bit set.
465
466         Adjust the compositing logging to make the legend easier to read.
467
468         Tests: scrollingcoordinator/reparent-across-compositing-layers.html
469                scrollingcoordinator/reparent-with-layer-removal.html
470
471         * page/scrolling/AsyncScrollingCoordinator.cpp:
472         (WebCore::AsyncScrollingCoordinator::childrenOfNode const):
473         * page/scrolling/AsyncScrollingCoordinator.h:
474         * page/scrolling/ScrollingCoordinator.h:
475         (WebCore::ScrollingCoordinator::childrenOfNode const):
476         * rendering/RenderLayer.cpp:
477         (WebCore::outputPaintOrderTreeLegend):
478         (WebCore::outputPaintOrderTreeRecursive):
479         * rendering/RenderLayer.h:
480         * rendering/RenderLayerCompositor.cpp:
481         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
482         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
483
484 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
485
486         [css-logical] Implement flow-relative inset properties
487         https://bugs.webkit.org/show_bug.cgi?id=189441
488
489         Reviewed by Dean Jackson.
490
491         Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
492         'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
493         behind the CSSLogicalEnabled runtime flag.
494
495         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
496                webexposed/css-properties-behind-flags.html
497
498         * css/CSSComputedStyleDeclaration.cpp:
499         (WebCore::isLayoutDependent):
500         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
501         * css/CSSProperties.json:
502         * css/CSSProperty.cpp:
503         (WebCore::CSSProperty::resolveDirectionAwareProperty):
504         (WebCore::CSSProperty::isDirectionAwareProperty):
505         * css/StyleProperties.cpp:
506         (WebCore::StyleProperties::getPropertyValue const):
507         (WebCore::StyleProperties::asText const):
508         * css/parser/CSSParserFastPaths.cpp:
509         (WebCore::isSimpleLengthPropertyID):
510         * css/parser/CSSPropertyParser.cpp:
511         (WebCore::CSSPropertyParser::parseSingleValue):
512         (WebCore::CSSPropertyParser::parseShorthand):
513
514 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
515
516         [css-grid] Properly handle static positions of abspos inside grid items
517         https://bugs.webkit.org/show_bug.cgi?id=193657
518
519         Reviewed by Javier Fernandez.
520
521         Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
522         Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
523         and only if it's needed (not for abspos descentants in their static position).
524         Add logicalOffsetForChild that finds the value to be set by the functions above.
525         Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.
526
527         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
528                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
529                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
530                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
531                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
532                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
533                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
534                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
535                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
536                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
537                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
538                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
539                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
540                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
541                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
542                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
543                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
544                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
545                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
546                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
547                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
548                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
549                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
550                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
551                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
552                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
553                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
554                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
555                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
556                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
557                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
558                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html
559
560         * rendering/RenderGrid.cpp:
561         (WebCore::RenderGrid::layoutGridItems):
562         (WebCore::RenderGrid::layoutPositionedObject):
563         (WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
564         (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
565         (WebCore::RenderGrid::setLogicalPositionForChild const):
566         (WebCore::RenderGrid::setLogicalOffsetForChild const):
567         (WebCore::RenderGrid::logicalOffsetForChild const):
568         * rendering/RenderGrid.h:
569
570 2019-01-23  Rob Buis  <rbuis@igalia.com>
571
572         Update MIME type parser
573         https://bugs.webkit.org/show_bug.cgi?id=180526
574
575         Reviewed by Frédéric Wang.
576
577         Add an enum to allow two modes of MIME type parsing, one mode
578         to keep supporting RFC2045 as before, and one mode to support
579         the updated MIME parser from mimesniff [1]. Mimesniff support
580         brings the following changes:
581         - allows parameter names without matching =value.
582         - skips whitespace after subtype, parameter value and before
583           parameter name.
584         - lower cases MIME type and parameter name.
585         - parameter names parsed before are discarded.
586
587         The old mode is still used by CDM.cpp and MIMEHeader.cpp.
588
589         [1] https://mimesniff.spec.whatwg.org/
590
591         * Modules/encryptedmedia/CDM.cpp:
592         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
593         * platform/network/MIMEHeader.cpp:
594         (WebCore::MIMEHeader::parseHeader):
595         * platform/network/ParsedContentType.cpp:
596         (WebCore::DummyParsedContentType::setContentType const):
597         (WebCore::DummyParsedContentType::setContentTypeParameter const):
598         (WebCore::isQuotedStringTokenCharacter):
599         (WebCore::isTokenCharacter):
600         (WebCore::parseToken):
601         (WebCore::containsNonTokenCharacters):
602         (WebCore::parseQuotedString):
603         (WebCore::isNotForwardSlash):
604         (WebCore::isNotSemicolon):
605         (WebCore::isNotSemicolonOrEqualSign):
606         (WebCore::parseContentType):
607         (WebCore::isValidContentType):
608         (WebCore::ParsedContentType::ParsedContentType):
609         (WebCore::ParsedContentType::setContentType):
610         (WebCore::isNonTokenCharacter):
611         (WebCore::isNonQuotedStringTokenCharacter):
612         (WebCore::ParsedContentType::setContentTypeParameter):
613         * platform/network/ParsedContentType.h:
614
615         Test: web-platform-tests/xhr/overridemimetype-blob.html
616
617 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
618
619         Introduce CustomUndoStep.h and CustomUndoStep.cpp
620         https://bugs.webkit.org/show_bug.cgi?id=193704
621         <rdar://problem/44807048>
622
623         Reviewed by Ryosuke Niwa.
624
625         This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
626         class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.
627
628         No change in behavior.
629
630         * Sources.txt:
631         * WebCore.xcodeproj/project.pbxproj:
632         * editing/CustomUndoStep.cpp:
633         (WebCore::CustomUndoStep::CustomUndoStep):
634
635         Subclass UndoStep.
636
637         (WebCore::CustomUndoStep::unapply):
638         (WebCore::CustomUndoStep::reapply):
639
640         If possible, invoke the UndoItem's undo and redo handlers.
641
642         (WebCore::CustomUndoStep::isValid const):
643         * editing/CustomUndoStep.h:
644         * editing/EditingStyle.cpp:
645         * editing/InsertEditableImageCommand.cpp:
646         (WebCore::InsertEditableImageCommand::doApply):
647
648         Unified build fixes.
649
650         * page/UndoItem.h:
651
652 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
653
654         Adding a child to a ScrollingStateNode needs to trigger a tree state commit
655         https://bugs.webkit.org/show_bug.cgi?id=193682
656
657         Reviewed by Zalan Bujtas.
658
659         Scrolling tree mutations that re-arrange nodes (e.g. node reordering when z-index changes)
660         need to trigger scrolling tree updates, and currently do not.
661
662         Fix by adding a "ChildNodes" dirty bit to ScrollingStateNode. There isn't any code that consults
663         this flag when committing the scrolling tree because we always eagerly traverse children, but
664         we could use it to optimize later. The important part is that we use it to trigger a tree update.
665         
666         Can't test via z-reordering until webkit.org/b/192529 is fixed.
667
668         Tests: scrollingcoordinator/gain-scrolling-node-parent.html
669                scrollingcoordinator/lose-scrolling-node-parent.html
670
671         * page/scrolling/ScrollingStateNode.cpp:
672         (WebCore::ScrollingStateNode::appendChild):
673         (WebCore::ScrollingStateNode::insertChild):
674         (WebCore::ScrollingStateNode::removeChildAtIndex):
675         * page/scrolling/ScrollingStateNode.h:
676         * page/scrolling/ScrollingStateTree.cpp:
677         (WebCore::ScrollingStateTree::attachNode):
678
679 2019-01-22  Devin Rousso  <drousso@apple.com>
680
681         Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
682         https://bugs.webkit.org/show_bug.cgi?id=116191
683         <rdar://problem/13905910>
684
685         Reviewed by Joseph Pecoraro.
686
687         Test inspector/timeline/line-column.html
688
689         * bindings/js/ScriptController.cpp:
690         (WebCore::ScriptController::evaluateInWorld):
691         (WebCore::ScriptController::evaluateModule):
692
693         * bindings/js/JSExecStateInstrumentation.h:
694         (WebCore::JSExecState::instrumentFunctionInternal):
695
696         * inspector/InspectorInstrumentation.h:
697         (WebCore::InspectorInstrumentation::willCallFunction):
698         (WebCore::InspectorInstrumentation::willEvaluateScript):
699         * inspector/InspectorInstrumentation.cpp:
700         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
701         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
702
703         * inspector/agents/InspectorTimelineAgent.h:
704         * inspector/agents/InspectorTimelineAgent.cpp:
705         (WebCore::InspectorTimelineAgent::willCallFunction):
706         (WebCore::InspectorTimelineAgent::willEvaluateScript):
707
708         * inspector/TimelineRecordFactory.h:
709         * inspector/TimelineRecordFactory.cpp:
710         (WebCore::TimelineRecordFactory::createFunctionCallData):
711         (WebCore::TimelineRecordFactory::createEvaluateScriptData):
712
713         * bindings/js/ScriptSourceCode.h:
714         (WebCore::ScriptSourceCode::startColumn const): Added.
715
716 2019-01-22  Devin Rousso  <drousso@apple.com>
717
718         Web Inspector: expose Audit and Recording versions to the frontend
719         https://bugs.webkit.org/show_bug.cgi?id=193262
720         <rdar://problem/47130684>
721
722         Reviewed by Joseph Pecoraro.
723
724         Tests: inspector/audit/version.html
725                inspector/recording/version.html
726
727         * inspector/agents/InspectorCanvasAgent.cpp:
728         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
729
730 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
731
732         Add some bindings-related bookkeeping to UndoManager and UndoItem
733         https://bugs.webkit.org/show_bug.cgi?id=193111
734         <rdar://problem/44807048>
735
736         Reviewed by Ryosuke Niwa.
737
738         This patch is work in progress towards supporting `UndoManager.addItem()`. Here, we add helper methods to
739         UndoItem and UndoManager which later patches will exercise, as well as introduce some custom bindings to
740         properly handle the case where UndoItems are given anonymous JavaScript functions (see below for more details).
741
742         No new tests, because there is no script-observable change in behavior yet. When `addItems()` is hooked up, I
743         will write a test to verify that the undo and redo JavaScript functions survive garbage collection.
744
745         * Sources.txt:
746         * WebCore.xcodeproj/project.pbxproj:
747         * bindings/js/JSUndoItemCustom.cpp:
748         (WebCore::JSUndoItem::visitAdditionalChildren):
749
750         Have each JSUndoItem visit its undo and redo callback functions to ensure that the JavaScript wrapper objects
751         for these functions are not garbage collected underneath the item.
752
753         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
754
755         Consider the undo item wrapper reachable from opaque roots if it is associated with its UndoManager's Document.
756         This ensures that if script isn't holding on to a reference to the wrapper (for instance, by calling
757         `UndoManager.addItem(new UndoItem({ ... }))`), we still protect the corresponding JSUndoItem as long as the
758         UndoManager's Document is alive. In the case where the undo item is not associated with a document, either (1)
759         script is keeping a reference to it, in which case it will be trivially reachable, or (2) script won't be able
760         to observe the destruction of the wrapper anyways (e.g. calling `new UndoItem({ ... })` by itself).
761
762         * dom/Document.cpp:
763         (WebCore::Document::prepareForDestruction):
764
765         Invalidate all undo items when the document is about to go away.
766
767         * page/UndoItem.cpp:
768         (WebCore::UndoItem::setUndoManager):
769         (WebCore::UndoItem::invalidate):
770         (WebCore::UndoItem::isValid const):
771
772         Add a few helpers, to be used in a future patch. We consider an UndoItem valid if it has been added to an
773         UndoManager, and is thus associated with a document.
774
775         (WebCore::UndoItem::document const):
776         * page/UndoItem.h:
777         * page/UndoItem.idl:
778         * page/UndoManager.cpp:
779         (WebCore::UndoManager::UndoManager):
780         (WebCore::UndoManager::addItem):
781
782         Have an UndoManager keep its UndoItems alive. These UndoItems remain in this set until either the document will
783         be destroyed, or the corresponding undo action is no longer needed because the platform undo stack has changed
784         (this latter behavior is yet to be implemented).
785
786         (WebCore::UndoManager::removeItem):
787         (WebCore::UndoManager::removeAllItems):
788         * page/UndoManager.h:
789         (WebCore::UndoManager::UndoManager): Deleted.
790         * page/scrolling/ScrollingTreeScrollingNode.cpp:
791
792         Unified build fix.
793
794 2019-01-22  Fujii Hironori  <Hironori.Fujii@sony.com>
795
796         [WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
797         https://bugs.webkit.org/show_bug.cgi?id=193664
798
799         Reviewed by Brent Fulgham.
800
801         WinCairo WebKitTestRunner always crash on openning test cases of
802         HTMLMeterElement.
803
804         If GraphicsContext::getWindowsContext retruned null HDC,
805         LocalWindowsContext shouldn't release the null HDC.
806
807         Covered by existing tests.
808
809         * platform/graphics/win/LocalWindowsContext.h:
810         (WebCore::LocalWindowsContext::~LocalWindowsContext):
811         Release m_hdc only if it isn't null.
812
813 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
814
815         Unreviewed, fix -Wsign-compare warning
816         https://bugs.webkit.org/show_bug.cgi?id=188697
817         <rdar://problem/46105624>
818
819         * css/StyleProperties.cpp:
820         (WebCore::StyleProperties::asText const):
821
822 2019-01-22  Devin Rousso  <drousso@apple.com>
823
824         Web Inspector: Audit: provide a way to get related Accessibility properties for a given node
825         https://bugs.webkit.org/show_bug.cgi?id=193227
826         <rdar://problem/46787862>
827
828         Reviewed by Joseph Pecoraro.
829
830         Test: inspector/audit/run-accessibility.html
831
832         * inspector/InspectorAuditAccessibilityObject.idl:
833         * inspector/InspectorAuditAccessibilityObject.h:
834         * inspector/InspectorAuditAccessibilityObject.cpp:
835         (WebCore::InspectorAuditAccessibilityObject::getComputedProperties): Added.
836
837 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
838
839         Remove an iOS quirk where iframe renderers are identified as "RenderPartObject" in layout test results
840         https://bugs.webkit.org/show_bug.cgi?id=193692
841
842         Reviewed by Zalan Bujtas.
843
844         Remove the iOS-specific renderName() implementation.
845
846         * rendering/RenderIFrame.h:
847
848 2019-01-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
849
850         Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
851         https://bugs.webkit.org/show_bug.cgi?id=193647
852
853         Reviewed by Simon Fraser.
854
855         Changing a style attribute of an SVGELement needs to call invalidateInstances().
856
857         Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg
858
859         * svg/SVGElement.cpp:
860         (WebCore::SVGElement::attributeChanged):
861
862 2019-01-22  Alex Christensen  <achristensen@webkit.org>
863
864         Fix more builds.
865
866         * platform/network/curl/CurlResourceHandleDelegate.cpp:
867         (WebCore::handleCookieHeaders):
868         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
869
870 2019-01-22  Alex Christensen  <achristensen@webkit.org>
871
872         Fix some builds after r240292
873         https://bugs.webkit.org/show_bug.cgi?id=193580
874
875         * platform/network/curl/ResourceHandleCurl.cpp:
876         (WebCore::ResourceHandle::createCurlRequest):
877         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
878         (WebCore::ResourceHandle::receivedCredential):
879         (WebCore::ResourceHandle::getCredential):
880
881 2019-01-22  Alex Christensen  <achristensen@webkit.org>
882
883         Move NetworkStorageSession ownership to NetworkProcess
884         https://bugs.webkit.org/show_bug.cgi?id=193580
885
886         Reviewed by Geoff Garen.
887
888         NetworkStorageSessions used to be owned by a process-global map living in WebCore.
889         This patch moves the ownership to the WebKit/WebKitLegacy layer.
890         In WebKitLegacy they are still owned by a process-global map for compatibility.
891         In WebKit they are owned by a map owned by the NetworkProcess object.
892         There were three non-NetworkProcess uses of NetworkStorageSessions which have been dealt with thusly:
893         1. The WebProcess used to clear credentials from a NetworkStorageSession.  Since this was the only use
894         of a NetworkStorageSession in the WebProcess we can conclude there were no credentials to clear,
895         so this code was removed with no change in behavior.
896         2. The WebProcess used NetworkStorageSessions to get persistent credentials.  This was turned
897         into a static method that does the same thing.  We should audit these calls and decide if we really want them.
898         3. The UIProcess used NetworkStorageSessions in APIHTTPCookieStore to interact with the default cookie
899         storage on Cocoa platforms.  This has been replaced by functions that do the same thing directly.
900
901         * platform/network/CredentialStorage.h:
902         * platform/network/NetworkStorageSession.cpp:
903         (WebCore::NetworkStorageSession::processMayUseCookieAPI):
904         (WebCore::NetworkStorageSession::globalSessionMap): Deleted.
905         (WebCore::NetworkStorageSession::storageSession): Deleted.
906         (WebCore::NetworkStorageSession::destroySession): Deleted.
907         (WebCore::NetworkStorageSession::forEach): Deleted.
908         * platform/network/NetworkStorageSession.h:
909         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
910         (WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier):
911         (WebCore::createCFStorageSessionForIdentifier): Deleted.
912         (WebCore::defaultNetworkStorageSession): Deleted.
913         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
914         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
915         (WebCore::NetworkStorageSession::ensureSession): Deleted.
916         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
917         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
918         * platform/network/cocoa/CookieStorageObserver.h:
919         * platform/network/curl/NetworkStorageSessionCurl.cpp:
920         (WebCore::defaultSession): Deleted.
921         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
922         (WebCore::NetworkStorageSession::ensureSession): Deleted.
923         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
924         * platform/network/soup/NetworkStorageSessionSoup.cpp:
925         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
926         (WebCore::defaultSession): Deleted.
927         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
928         (WebCore::NetworkStorageSession::ensureSession): Deleted.
929         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
930
931 2019-01-22  Devin Rousso  <drousso@apple.com>
932
933         Web Inspector: Audit: provide a way to get related Accessibility nodes for a given node
934         https://bugs.webkit.org/show_bug.cgi?id=193225
935         <rdar://problem/46799956>
936
937         Reviewed by Joseph Pecoraro.
938
939         Test: inspector/audit/run-accessibility.html
940
941         * inspector/InspectorAuditAccessibilityObject.idl:
942         * inspector/InspectorAuditAccessibilityObject.h:
943         * inspector/InspectorAuditAccessibilityObject.cpp:
944         (WebCore::InspectorAuditAccessibilityObject::getActiveDescendant): Added.
945         (WebCore::addChildren): Added.
946         (WebCore::InspectorAuditAccessibilityObject::getChildNodes): Added.
947         (WebCore::InspectorAuditAccessibilityObject::getControlledNodes): Added.
948         (WebCore::InspectorAuditAccessibilityObject::getFlowedNodes): Added.
949         (WebCore::InspectorAuditAccessibilityObject::getMouseEventNode): Added.
950         (WebCore::InspectorAuditAccessibilityObject::getOwnedNodes): Added.
951         (WebCore::InspectorAuditAccessibilityObject::getParentNode): Added.
952         (WebCore::InspectorAuditAccessibilityObject::getSelectedChildNodes): Added.
953
954 2019-01-22  David Kilzer  <ddkilzer@apple.com>
955
956         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
957         <https://webkit.org/b/193654>
958         <rdar://problem/47430290>
959
960         Reviewed by Alex Christensen.
961
962         - Moves QuickLookSoftLink.{h,mm} to PAL.
963         - Adds soft-link to 3 classes to consolidate QuickLook.framework
964           soft-linking.
965         - Updates existing source to work with above changes.
966
967         * SourcesCocoa.txt:
968         * UnifiedSources-input.xcfilelist:
969         * WebCore.xcodeproj/project.pbxproj:
970         - Remove QuickLookSoftLink.{h,mm} due to move to PAL.
971
972         * platform/ios/QuickLook.mm:
973         (WebCore::QLPreviewGetSupportedMIMETypesSet):
974         (WebCore::registerQLPreviewConverterIfNeeded):
975         - Update for QuickLookSoftLink.{h,mm} move to PAL.
976
977         * platform/network/ios/PreviewConverter.mm:
978         (WebCore::optionsWithPassword):
979         (WebCore::PreviewConverter::PreviewConverter):
980         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
981
982         * platform/network/ios/WebCoreURLResponseIOS.mm:
983         (WebCore::adjustMIMETypeIfNecessary):
984         - Update for QuickLookSoftLink.{h,mm} move to PAL.
985
986 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
987
988         Fix the position of layers nested inside of composited overflow-scroll
989         https://bugs.webkit.org/show_bug.cgi?id=193642
990
991         Reviewed by Antti Koivisto and Sam Weinig.
992
993         Remove an iOS #ifdef so that layers inside composited overflow gets the correct
994         positions on macOS too.
995
996         Test: compositing/geometry/fixed-inside-overflow-scroll.html
997
998         * rendering/RenderLayerBacking.cpp:
999         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
1000
1001 2019-01-22  Claudio Saavedra  <csaavedra@igalia.com>
1002
1003         [GTK] Build fix for Ubuntu LTS 16.04
1004         https://bugs.webkit.org/show_bug.cgi?id=193672
1005
1006         Unreviewed build fix.
1007
1008         * html/canvas/CanvasStyle.h: Add default copy constructor for
1009         CMYKAColor struct.
1010
1011 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1012
1013         Leak of NSMutableArray (128 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1014         <https://webkit.org/b/193673>
1015         <rdar://problem/47448241>
1016
1017         Reviewed by Dean Jackson.
1018
1019         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1020         (WebCore::appendArgumentToArray): Use adoptNS() to fix the leak.
1021
1022 2019-01-22  Zalan Bujtas  <zalan@apple.com>
1023
1024         [LFC][Floats] Decouple clearance computation and margin collapsing reset.
1025         https://bugs.webkit.org/show_bug.cgi?id=193670
1026
1027         Reviewed by Antti Koivisto.
1028
1029         Move margin collapsing reset logic from FloatingContext to BlockFormattingContext. It's the BlockFormattingContext's job to do.
1030         This is also in preparation for adding clear to static position.
1031
1032         * layout/FormattingContext.cpp:
1033         (WebCore::Layout::FormattingContext::mapTopToAncestor):
1034         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): Deleted.
1035         * layout/FormattingContext.h:
1036         * layout/blockformatting/BlockFormattingContext.cpp:
1037         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1038         * layout/floats/FloatingContext.cpp:
1039         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1040         * layout/floats/FloatingContext.h:
1041
1042 2019-01-22  Frederic Wang  <fwang@igalia.com>
1043
1044         Minor refactoring of the scrolling code
1045         https://bugs.webkit.org/show_bug.cgi?id=192398
1046
1047         Unreviewed build fix.
1048
1049         * page/scrolling/ScrollingTreeScrollingNode.cpp: Add missing header.
1050
1051 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
1052
1053         [css-logical] Implement flow-relative margin, padding and border shorthands
1054         https://bugs.webkit.org/show_bug.cgi?id=188697
1055
1056         Reviewed by Simon Fraser and Antti Koivisto.
1057
1058         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
1059                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
1060                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
1061                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
1062                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
1063                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
1064                webexposed/css-properties-behind-flags.html
1065
1066         * css/CSSComputedStyleDeclaration.cpp:
1067         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1068         Allow the new properties to serialize their computed value.
1069
1070         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
1071         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
1072         * css/CSSComputedStyleDeclaration.h:
1073         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
1074         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
1075         shorthands.
1076
1077         * css/CSSProperties.json:
1078         Add the new properties behind the CSSLogicalEnabled runtime flag.
1079
1080         * css/CSSStyleDeclaration.cpp:
1081         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
1082         Prevent CSS properties disabled behind a runtime flag from being exposed in
1083         style declarations.
1084
1085         * css/StyleProperties.cpp:
1086         (WebCore::StyleProperties::getPropertyValue const):
1087         Allow the new properties to serialize their specified value.
1088
1089         (WebCore::StyleProperties::get2Values const):
1090         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
1091
1092         (WebCore::StyleProperties::borderPropertyValue const):
1093         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
1094         corresponding to width, style and color.
1095
1096         (WebCore::MutableStyleProperties::setProperty):
1097         Prevent CSS properties disabled behind a runtime flag from being set a value.
1098
1099         (WebCore::StyleProperties::asText const):
1100         Allow the new properties to be serialized in cssText.
1101         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
1102         and serialize the longhands instead. Note that there could be another shorthand
1103         available which is enabled, but a proper solution would require bug 190496.
1104
1105         * css/StyleProperties.h:
1106         Update declarations of borderPropertyValue and get2Values.
1107
1108         * css/makeprop.pl:
1109         (addProperty):
1110         Add isEnabledCSSProperty function for checking that a CSS property is not
1111         disabled behind a runtime flag.
1112
1113         * css/parser/CSSPropertyParser.cpp:
1114         (WebCore::cssPropertyID):
1115         Prevent CSS properties disabled behind a runtime flag from being exposed in
1116         computed styles.
1117
1118         (WebCore::CSSPropertyParser::addProperty):
1119         Prevent CSS properties disabled behind a runtime flag from being set a value.
1120
1121         (WebCore::CSSPropertyParser::consumeBorder):
1122         Change consumeBorder to provide the caller with the parsed values instead of
1123         setting properties. Then the caller can decide to which properties the values
1124         should be set, and whether border-image should be reset or not.
1125
1126         (WebCore::CSSPropertyParser::consume2ValueShorthand):
1127         (WebCore::CSSPropertyParser::consume4ValueShorthand):
1128         Rename consume4Values to consume4ValueShorthand, and add analogous
1129         consume2ValueShorthand for parsing shorthands with two longhands.
1130
1131         (WebCore::CSSPropertyParser::parseShorthand):
1132         Allow the new properties to be parsed.
1133
1134         * css/parser/CSSPropertyParser.h:
1135         Update declarations of consumeBorder, consume2ValueShorthand and
1136         consume4ValueShorthand.
1137
1138         * inspector/agents/InspectorCSSAgent.cpp:
1139         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
1140         Prevent CSS properties disabled behind a runtime flag from being exposed in
1141         the CSS inspector tool.
1142
1143         * page/RuntimeEnabledFeatures.h:
1144         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
1145         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
1146         Add the CSSLogicalEnabled runtime flag.
1147
1148 2019-01-21  Antti Koivisto  <antti@apple.com>
1149
1150         [iOS] Handle hit testing for subframes
1151         https://bugs.webkit.org/show_bug.cgi?id=192303
1152
1153         Reviewed by Frédéric Wang.
1154
1155         Don't set delegatesScrolling bit for subframes on iOS. It is meant for top level application
1156         controlled scrolling. This fixes coordinate conversions for subframes and makes events work.
1157
1158         Test by Frederic Wang.
1159
1160         Test: fast/scrolling/ios/hit-testing-iframe.html
1161
1162         * platform/ScrollView.cpp:
1163         (WebCore::ScrollView::managesScrollbars const):
1164
1165         Add a function that tells if the scrollview should deal with scrollbars at all
1166         This is always false on iOS and not connected to delegatesScrolling bit.
1167
1168         (WebCore::ScrollView::updateScrollbars):
1169         * platform/ScrollView.h:
1170         * rendering/RenderLayerCompositor.cpp:
1171         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
1172
1173 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1174
1175         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
1176         https://bugs.webkit.org/show_bug.cgi?id=193556
1177         <rdar://problem/47368501>
1178
1179         Reviewed by Alex Christensen.
1180
1181         This patch adds a new observer callback used to message the NetworkProcess when
1182         user interaction events are received. This is needed when the ResourceLoadStatistics
1183         data is not being managed by the UIProcess.
1184
1185         Tested by existing ResourceLoadStatistics and storageAccess tests.
1186
1187         * loader/ResourceLoadObserver.cpp:
1188         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
1189         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1190         * loader/ResourceLoadObserver.h:
1191         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1192         (WebCore::NetworkStorageSession::setCookiesFromDOM):
1193
1194 2019-01-21  Zalan Bujtas  <zalan@apple.com>
1195
1196         [LFC][Floats] Take float top position into account when computing containing block height.
1197         https://bugs.webkit.org/show_bug.cgi?id=193655
1198
1199         Reviewed by Antti Koivisto.
1200
1201         When computing the containing block height, we take the first in-flow child's top position and use it as the base position.
1202         However when the first in-flow child clears a previous sibling, its vertical position is not necessarily the correct base for
1203         computing the containing block's height. Let's take the relevant floats into account as well.
1204
1205         Test: fast/block/float/float-first-child-and-clear-sibling.html
1206
1207         * layout/FormattingContextGeometry.cpp:
1208         (WebCore::Layout::contentHeightForFormattingContextRoot):
1209         * layout/floats/FloatingContext.cpp:
1210         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1211         * layout/floats/FloatingState.cpp:
1212         (WebCore::Layout::FloatingState::top const):
1213         * layout/floats/FloatingState.h:
1214
1215 2019-01-21  David Kilzer  <ddkilzer@apple.com>
1216
1217         REGRESSION (r240237): Revert changes to WebCore Xcode project
1218
1219         * WebCore.xcodeproj/project.pbxproj: Revert changes that were
1220         fixed in r240135.  Darin's patch must have been made prior to
1221         r240135.
1222
1223 2019-01-21  David Kilzer  <ddkilzer@apple.com>
1224
1225         REGRESSION (r240201): Add a POINTER_EVENTS feature flag
1226         https://bugs.webkit.org/show_bug.cgi?id=193577
1227         <rdar://problem/47408511>
1228
1229         * dom/ios/PointerEventIOS.cpp: Add ENABLE(POINTER_EVENTS) macro
1230         to fix tvOS & watchOS builds.
1231
1232 2019-01-15  Darin Adler  <darin@apple.com>
1233
1234         Use references rather than pointers for register/unregister functions, and more
1235         https://bugs.webkit.org/show_bug.cgi?id=175028
1236
1237         Reviewed by Daniel Bates.
1238
1239         * Modules/applepay/ApplePaySession.cpp:
1240         (WebCore::ApplePaySession::begin): Pass a reference.
1241         (WebCore::ApplePaySession::completePayment): Ditto.
1242         (WebCore::ApplePaySession::didReachFinalState): Ditto.
1243         * Modules/cache/DOMCache.cpp:
1244         (WebCore::DOMCache::retrieveRecords): Ditto.
1245         (WebCore::DOMCache::batchDeleteOperation): Ditto.
1246         (WebCore::DOMCache::batchPutOperation): Ditto.
1247         * Modules/cache/DOMCacheStorage.cpp:
1248         (WebCore::DOMCacheStorage::match): Ditto.
1249         * Modules/fetch/FetchBodyOwner.cpp:
1250         (WebCore::FetchBodyOwner::loadBlob): Ditto.
1251         (WebCore::FetchBodyOwner::finishBlobLoading): Ditto.
1252         * Modules/fetch/FetchBodySource.cpp:
1253         (WebCore::FetchBodySource::setActive): Ditto.
1254         (WebCore::FetchBodySource::setInactive): Ditto.
1255         * Modules/fetch/FetchResponse.cpp:
1256         (WebCore::FetchResponse::BodyLoader::BodyLoader): Ditto.
1257         (WebCore::FetchResponse::BodyLoader::~BodyLoader): Ditto.
1258         * Modules/mediasource/MediaSource.cpp:
1259         (WebCore::MediaSource::addedToRegistry): Ditto.
1260         (WebCore::MediaSource::removedFromRegistry): Ditto.
1261         * Modules/mediastream/MediaStream.cpp:
1262         (WebCore::MediaStream::~MediaStream): Ditto.
1263         (WebCore::MediaStream::startProducingData): Ditto.
1264         * Modules/mediastream/MediaStreamTrack.cpp:
1265         (WebCore::MediaStreamTrack::MediaStreamTrack): Ditto.
1266         (WebCore::MediaStreamTrack::~MediaStreamTrack): Ditto.
1267         * Modules/mediastream/RTCDataChannel.cpp:
1268         (WebCore::RTCDataChannel::create): Ditto.
1269         (WebCore::RTCDataChannel::close): Ditto.
1270         * Modules/mediastream/RTCPeerConnection.cpp:
1271         (WebCore::RTCPeerConnection::create): Use auto.
1272         * Modules/notifications/Notification.cpp:
1273         (WebCore::Notification::show): Pass a reference.
1274         (WebCore::Notification::finalize): Ditto.
1275         * Modules/webaudio/AudioBasicInspectorNode.cpp:
1276         (WebCore::AudioBasicInspectorNode::updatePullStatus): Ditto.
1277
1278         * Modules/webaudio/AudioContext.cpp:
1279         (WebCore::AudioContext::constructCommon): Ditto.
1280         (WebCore::AudioContext::lazyInitialize): Ditto.
1281         (WebCore::AudioContext::clear): Ditto.
1282         (WebCore::AudioContext::uninitialize): Ditto.
1283         (WebCore::AudioContext::markForDeletion): Take a reference.
1284         (WebCore::AudioContext::addAutomaticPullNode): Ditto.
1285         (WebCore::AudioContext::removeAutomaticPullNode): Ditto.
1286         (WebCore::AudioContext::willBeginPlayback): Pass a reference.
1287         (WebCore::AudioContext::willPausePlayback): Ditto.
1288         * Modules/webaudio/AudioContext.h: Update above functions to take
1289         references rather than pointers.
1290
1291         * Modules/webaudio/AudioNode.cpp:
1292         (WebCore::AudioNode::finishDeref): Pass a reference.
1293         * Modules/websockets/WebSocket.cpp:
1294         (WebCore::WebSocket::connect): Ditto.
1295         (WebCore::WebSocket::stop): Ditto.
1296         (WebCore::WebSocket::didClose): Ditto.
1297
1298         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to update this file.
1299
1300         * bindings/js/JSDOMWindowBase.cpp:
1301         (WebCore::JSDOMWindowBase::moduleLoaderResolve): Update since
1302         moduleLoader is now a reference.
1303         (WebCore::JSDOMWindowBase::moduleLoaderFetch): Ditto.
1304         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate): Ditto.
1305         (WebCore::JSDOMWindowBase::moduleLoaderImportModule): Ditto.
1306         (WebCore::JSDOMWindowBase::moduleLoaderCreateImportMetaProperties): Ditto.
1307
1308         * dom/ActiveDOMObject.h:
1309         (WebCore::ActiveDOMObject::setPendingActivity): Take a reference.
1310         (WebCore::ActiveDOMObject::unsetPendingActivity): Ditto.
1311
1312         * dom/CharacterData.cpp:
1313         (WebCore::CharacterData::setData): Pass a reference.
1314         (WebCore::CharacterData::insertData): Ditto.
1315         (WebCore::CharacterData::deleteData): Ditto.
1316         (WebCore::CharacterData::replaceData): Ditto.
1317
1318         * dom/Document.cpp:
1319         (WebCore::Document::getElementByAccessKey): Pass a reference.
1320         (WebCore::Document::buildAccessKeyMap): Take a reference.
1321         (WebCore::Document::registerForVisibilityStateChangedCallbacks): Ditto.
1322         (WebCore::Document::unregisterForVisibilityStateChangedCallbacks): Ditto.
1323         (WebCore::Document::addAudioProducer): Ditto.
1324         (WebCore::Document::removeAudioProducer): Ditto.
1325         (WebCore::Document::hoveredElementDidDetach): Ditto.
1326         (WebCore::Document::elementInActiveChainDidDetach): Ditto.
1327         (WebCore::Document::attachNodeIterator): Ditto.
1328         (WebCore::Document::detachNodeIterator): Ditto.
1329         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Pass
1330         a reference.
1331         (WebCore::Document::nodeChildrenWillBeRemoved): Ditto.
1332         (WebCore::Document::nodeWillBeRemoved): Ditto.
1333         (WebCore::Document::textInserted): Take a reference.
1334         (WebCore::Document::textRemoved): Ditto.
1335         (WebCore::Document::textNodesMerged): Ditto.
1336         (WebCore::Document::textNodeSplit): Ditto.
1337         (WebCore::Document::takeDOMWindowFrom): Ditto.
1338         (WebCore::Document::registerForDocumentSuspensionCallbacks): Ditto.
1339         (WebCore::Document::unregisterForDocumentSuspensionCallbacks): Ditto.
1340         (WebCore::Document::registerForMediaVolumeCallbacks): Ditto.
1341         (WebCore::Document::unregisterForMediaVolumeCallbacks): Ditto.
1342         (WebCore::Document::registerForPrivateBrowsingStateChangedCallbacks): Ditto.
1343         (WebCore::Document::unregisterForPrivateBrowsingStateChangedCallbacks): Ditto.
1344         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Ditto.
1345         (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
1346         (WebCore::Document::registerForPageScaleFactorChangedCallbacks): Ditto.
1347         (WebCore::Document::unregisterForPageScaleFactorChangedCallbacks): Ditto.
1348         (WebCore::Document::finishedParsing): Use a reference.
1349         (WebCore::Document::attachRange): Take a reference.
1350         (WebCore::Document::detachRange): Ditto.
1351         (WebCore::Document::suspendScheduledTasks): Use a reference.
1352         (WebCore::Document::resumeScheduledTasks): Ditto.
1353         (WebCore::Document::addMediaCanStartListener): Take a reference.
1354         (WebCore::Document::removeMediaCanStartListener): Ditto.
1355         (WebCore::Document::deviceMotionController const): Return a reference.
1356         (WebCore::Document::deviceOrientationController const): Ditto.
1357         (WebCore::Document::simulateDeviceOrientationChange): Use a reference.
1358         (WebCore::Document::fullScreenIsAllowedForElement const): Take a reference.
1359         (WebCore::Document::requestFullScreenForElement): Pass a reference.
1360         (WebCore::Document::webkitExitFullscreen): Ditto.
1361         (WebCore::Document::webkitWillEnterFullScreen): Renamed to remove the
1362         "ForElement" from the function name. Take a reference rather than a pointer.
1363         (WebCore::Document::webkitDidEnterFullScreen): Renamed to remove the
1364         "ForElement" from the function name and removed the unused element argument.
1365         (WebCore::Document::webkitWillExitFullScreen): Ditto.
1366         (WebCore::Document::webkitDidExitFullScreen): Ditto.
1367         (WebCore::Document::pushFullscreenElementStack): Take a reference.
1368         (WebCore::Document::addDocumentToFullScreenChangeEventQueue): Ditto.
1369         (WebCore::DocumentParserYieldToken::DocumentParserYieldToken): Use a reference.
1370         (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken): Ditto.
1371         (WebCore::Document::updateHoverActiveState): Updated name of isInActiveChain.
1372
1373         * dom/Document.h: Updated argument types as described above. Changed a couple
1374         of inline functions to return references.
1375
1376         * dom/DocumentMarkerController.cpp:
1377         (WebCore::DocumentMarkerController::addMarker): Take a reference.
1378         (WebCore::DocumentMarkerController::addMarkerToNode): Ditto.
1379         (WebCore::DocumentMarkerController::addTextMatchMarker): Ditto.
1380         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker): Ditto.
1381         (WebCore::DocumentMarkerController::addDictationResultMarker): Ditto.
1382         (WebCore::DocumentMarkerController::addDraggedContentMarker): Ditto.
1383         (WebCore::DocumentMarkerController::removeMarkers): Ditto.
1384         (WebCore::DocumentMarkerController::copyMarkers): Ditto.
1385         (WebCore::DocumentMarkerController::shiftMarkers): Ditto.
1386         (WebCore::DocumentMarkerController::setMarkersActive): DItto.
1387         * dom/DocumentMarkerController.h: Updated argument types as described above.
1388
1389         * dom/Element.cpp:
1390         (WebCore::Element::~Element): Pass a reference.
1391         (WebCore::Element::isUserActionElementInActiveChain const): Updated name of
1392         isInActiveChain.
1393         (WebCore::Element::hasEquivalentAttributes const): Take a reference.
1394         (WebCore::Element::removedFromAncestor): Pass a reference.
1395         (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer):
1396         Pass a reference and updated name of isInActiveChain.
1397
1398         * dom/Element.h: Renamed inActiveChain to isInActiveChain, updated argument
1399         types to be references, and removed unneeded friend declaration and made
1400         SynchronizationOfLazyAttribute private.
1401
1402         * dom/Node.cpp:
1403         (WebCore::Node::normalize): Pass a reference.
1404         (WebCore::Node::isEqualNode const): Ditto.
1405         * dom/NodeIterator.cpp:
1406         (WebCore::NodeIterator::NodeIterator): Ditto.
1407         (WebCore::NodeIterator::~NodeIterator): Ditto.
1408
1409         * dom/RadioButtonGroups.cpp:
1410         (WebCore::RadioButtonGroup::add): Take a reference.
1411         (WebCore::RadioButtonGroup::updateCheckedState): Ditto.
1412         (WebCore::RadioButtonGroup::remove): Ditto.
1413         (WebCore::RadioButtonGroup::contains const): Ditto.
1414         (WebCore::RadioButtonGroups::addButton): Ditto.
1415         (WebCore::RadioButtonGroups::updateCheckedState): Ditto.
1416         (WebCore::RadioButtonGroups::hasCheckedButton const): Ditto.
1417         (WebCore::RadioButtonGroups::isInRequiredGroup const): Ditto.
1418         (WebCore::RadioButtonGroups::removeButton): Ditto.
1419         * dom/RadioButtonGroups.h: Updated argument types.
1420
1421         * dom/Range.cpp:
1422         (WebCore::Range::Range): Pass a reference.
1423         (WebCore::Range::~Range): Ditto.
1424         (WebCore::Range::setDocument): Ditto.
1425         (WebCore::Range::createContextualFragment): Ditto.
1426         (WebCore::boundaryTextInserted): Ditto.
1427         (WebCore::Range::textInserted): Ditto.
1428         (WebCore::boundaryTextRemoved): Ditto.
1429         (WebCore::Range::textRemoved): Ditto.
1430         (WebCore::boundaryTextNodesSplit): Ditto.
1431         (WebCore::Range::textNodeSplit): Ditto.
1432         * dom/Range.h: Take references instead of pointers.
1433
1434         * dom/ScriptElement.cpp:
1435         (WebCore::ScriptElement::prepareScript): Use reference.
1436
1437         * dom/Text.cpp:
1438         (WebCore::Text::splitText): Pass reference.
1439
1440         * dom/UserActionElementSet.h: Renamed inActiveChain to isInActiveChain to
1441         match the naming scheme of the other similar functions, like isActive.
1442
1443         * editing/AlternativeTextController.cpp:
1444         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
1445         Pass a reference.
1446         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Ditto.
1447         (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto.
1448         (WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto.
1449         (WebCore::AlternativeTextController::markReversed): Ditto.
1450         (WebCore::AlternativeTextController::markCorrection): Ditto.
1451         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto.
1452         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto.
1453         * editing/CompositeEditCommand.cpp:
1454         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Ditto.
1455         * editing/DictationCommand.cpp: Ditto.
1456         * editing/Editing.cpp:
1457         (WebCore::areIdenticalElements): Ditto.
1458         * editing/Editor.cpp:
1459         (WebCore::Editor::ignoreSpelling): Ditto.
1460         (WebCore::Editor::learnSpelling): Ditto.
1461         (WebCore::Editor::advanceToNextMisspelling): Ditto.
1462         (WebCore::Editor::clearMisspellingsAndBadGrammar): Ditto.
1463         (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto.
1464         (WebCore::Editor::markAndReplaceFor): Ditto.
1465         (WebCore::Editor::changeBackToReplacedString): Ditto.
1466         (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto.
1467         (WebCore::Editor::countMatchesForText): Ditto.
1468         (WebCore::Editor::scanRangeForTelephoneNumbers): Ditto.
1469         (WebCore::Editor::editorUIUpdateTimerFired): Ditto.
1470         (WebCore::Editor::handleAcceptedCandidate): Ditto.
1471
1472         * editing/InsertTextCommand.cpp:
1473         (WebCore::InsertTextCommand::doApply): Pass a reference.
1474         * editing/InsertTextCommand.h: Take a reference.
1475
1476         * editing/SpellChecker.cpp:
1477         (WebCore::SpellChecker::didCheckSucceed): Pass a reference.
1478         * editing/SplitTextNodeCommand.cpp:
1479         (WebCore::SplitTextNodeCommand::doApply): Ditto.
1480         (WebCore::SplitTextNodeCommand::doUnapply): Ditto.
1481         * editing/TextCheckingHelper.cpp:
1482         (WebCore::TextCheckingHelper::findFirstMisspelling): Pass a reference.
1483         (WebCore::TextCheckingHelper::findFirstGrammarDetail const): Ditto.
1484         * editing/ios/DictationCommandIOS.cpp:
1485         (WebCore::DictationCommandIOS::doApply): Ditto.
1486         Also added a comment about a possible missing null check; behavior should
1487         be no different than before, but using a reference helps make clear there
1488         was never any null check.
1489         * editing/ios/EditorIOS.mm:
1490         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
1491         * fileapi/FileReader.cpp:
1492         (WebCore::FileReader::readInternal): Ditto.
1493         (WebCore::FileReader::abort): Ditto.
1494         (WebCore::FileReader::didFinishLoading): Ditto.
1495         (WebCore::FileReader::didFail): Ditto.
1496
1497         * html/HTMLAppletElement.cpp: Removed unneeded include of HTMLDocument.h.
1498         There's very little left that is truly specific to HTMLDocument vs. Document.
1499
1500         * html/HTMLDocument.h:
1501         (WebCore::HTMLDocument::create): Take a reference.
1502         (WebCore::HTMLDocument::createSynthesizedDocument): Ditto.
1503
1504         * html/HTMLFormElement.cpp:
1505         (WebCore::HTMLFormElement::~HTMLFormElement): Pass a reference.
1506         (WebCore::HTMLFormElement::parseAttribute): Ditto.
1507         (WebCore::HTMLFormElement::didMoveToNewDocument): Ditto.
1508
1509         * html/HTMLIFrameElement.cpp: Removed unneeded include of HTMLDocument.h.
1510
1511         * html/HTMLInputElement.cpp:
1512         (WebCore::HTMLInputElement::~HTMLInputElement): Pass a reference.
1513         (WebCore::HTMLInputElement::setChecked): Ditto.
1514         (WebCore::HTMLInputElement::registerForSuspensionCallbackIfNeeded): Ditto.
1515         (WebCore::HTMLInputElement::unregisterForSuspensionCallbackIfNeeded): Ditto.
1516         (WebCore::HTMLInputElement::didMoveToNewDocument): Ditto.
1517         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Ditto.
1518         (WebCore::HTMLInputElement::addToRadioButtonGroup): Ditto.
1519         (WebCore::HTMLInputElement::removeFromRadioButtonGroup): Ditto.
1520         * html/HTMLMediaElement.cpp:
1521         (WebCore::HTMLMediaElement::registerWithDocument): Ditto.
1522         (WebCore::HTMLMediaElement::unregisterWithDocument): Ditto.
1523         (WebCore::HTMLMediaElement::selectMediaResource): Ditto.
1524         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
1525         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
1526         (WebCore::HTMLMediaElement::resume): Ditto.
1527         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Ditto.
1528
1529         * html/HTMLNameCollection.cpp: Removed unneeded include of HTMLDocument.h.
1530
1531         * html/HTMLPlugInImageElement.cpp:
1532         (WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement): Pass a reference.
1533         (WebCore::HTMLPlugInImageElement::createElementRenderer): Ditto.
1534         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Ditto.
1535
1536         * html/HTMLSourceElement.cpp: Removed unneeded include of HTMLDocument.h.
1537         * html/HTMLTemplateElement.cpp: Ditto.
1538
1539         * html/RadioInputType.cpp:
1540         (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
1541         Pass a reference.
1542         * loader/DocumentWriter.cpp:
1543         (WebCore::DocumentWriter::begin): Ditto.
1544         * page/DOMWindow.cpp:
1545         (WebCore::DOMWindow::addEventListener): Ditto.
1546         (WebCore::DOMWindow::removeEventListener): Ditto.
1547         (WebCore::DOMWindow::removeAllEventListeners): Ditto.
1548
1549         * page/EventHandler.cpp:
1550         (WebCore::EventHandler::didStartDrag): Use a reference.
1551
1552         * page/EventSource.cpp:
1553         (WebCore::EventSource::create): Pass reference.
1554         (WebCore::EventSource::networkRequestEnded): Ditto.
1555         (WebCore::EventSource::close): Ditto.
1556         (WebCore::EventSource::abortConnectionAttempt): Ditto.
1557
1558         * page/Frame.cpp: Removed unneeded include of HTMLDocument.h.
1559         * page/FrameView.cpp: Ditto.
1560         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): Use reference.
1561
1562         * page/animation/AnimationBase.cpp:
1563         (WebCore::AnimationBase::updateStateMachine): Pass reference.
1564
1565         * page/animation/CSSAnimationController.cpp:
1566         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStyle): Take reference.
1567         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStyle): Ditto.
1568         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse): Ditto.
1569         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse): Ditto.
1570         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved): Ditto.
1571         * page/animation/CSSAnimationControllerPrivate.h: Ditto.
1572
1573         * page/animation/CompositeAnimation.cpp:
1574         (WebCore::CompositeAnimation::clearElement): Pass reference.
1575         (WebCore::CompositeAnimation::updateTransitions): Ditto.
1576         (WebCore::CompositeAnimation::updateKeyframeAnimations): Ditto.
1577         * page/ios/FrameIOS.mm:
1578         (WebCore::Frame::initWithSimpleHTMLDocument): Ditto.
1579
1580         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1581         (WebCore::layerContentsFormat): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END so
1582         I can continue to compile with latest headers.
1583
1584         * rendering/CSSFilter.cpp:
1585         (WebCore::CSSFilter::buildReferenceFilter): Pass reference, small coding style
1586         tweaks as well.
1587
1588         * rendering/svg/RenderSVGResource.cpp:
1589         (WebCore::removeFromCacheAndInvalidateDependencies): Pass reference.
1590         * rendering/svg/RenderSVGResourceContainer.cpp:
1591         (WebCore::RenderSVGResourceContainer::registerResource): Ditto.
1592         * rendering/svg/SVGResources.cpp:
1593         (WebCore::registerPendingResource): Ditto.
1594         * rendering/svg/SVGResourcesCache.cpp:
1595         (WebCore::SVGResourcesCache::resourceDestroyed): Ditto.
1596
1597         * svg/SVGDocumentExtensions.cpp:
1598         (WebCore::SVGDocumentExtensions::addTimeContainer): Take reference.
1599         (WebCore::SVGDocumentExtensions::removeTimeContainer): Ditto.
1600         (WebCore::SVGDocumentExtensions::addResource): Ditto.
1601         (WebCore::SVGDocumentExtensions::addPendingResource): Ditto.
1602         (WebCore::SVGDocumentExtensions::isElementWithPendingResources const): Ditto.
1603         (WebCore::SVGDocumentExtensions::isPendingResource const): Ditto.
1604         (WebCore::SVGDocumentExtensions::clearHasPendingResourcesIfPossible): Ditto.
1605         (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): Ditto.
1606         (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): Ditto.
1607         (WebCore::SVGDocumentExtensions::addElementReferencingTarget): Ditto.
1608         (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): Ditto.
1609         (WebCore::SVGDocumentExtensions::clearTargetDependencies): Ditto.
1610         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Ditto.
1611         (WebCore::SVGDocumentExtensions::registerSVGFontFaceElement): Ditto.
1612         (WebCore::SVGDocumentExtensions::unregisterSVGFontFaceElement): Ditto.
1613         * svg/SVGDocumentExtensions.h: Ditto.
1614
1615         * svg/SVGElement.cpp:
1616         (WebCore::SVGElement::~SVGElement): Pass reference.
1617         (WebCore::SVGElement::removedFromAncestor): Ditto.
1618         (WebCore::SVGElement::buildPendingResourcesIfNeeded): Ditto.
1619         * svg/SVGFEImageElement.cpp:
1620         (WebCore::SVGFEImageElement::clearResourceReferences): Ditto.
1621         (WebCore::SVGFEImageElement::buildPendingResource): Ditto.
1622         * svg/SVGFontFaceElement.cpp:
1623         (WebCore::SVGFontFaceElement::insertedIntoAncestor): Ditto.
1624         (WebCore::SVGFontFaceElement::removedFromAncestor): Ditto.
1625         * svg/SVGMPathElement.cpp:
1626         (WebCore::SVGMPathElement::buildPendingResource): Ditto.
1627         (WebCore::SVGMPathElement::clearResourceReferences): Ditto.
1628         * svg/SVGPathElement.cpp:
1629         (WebCore::SVGPathElement::invalidateMPathDependencies): Ditto.
1630         * svg/SVGSVGElement.cpp:
1631         (WebCore::SVGSVGElement::SVGSVGElement): Ditto.
1632         (WebCore::SVGSVGElement::~SVGSVGElement): Ditto.
1633         (WebCore::SVGSVGElement::didMoveToNewDocument): Ditto.
1634         (WebCore::SVGSVGElement::insertedIntoAncestor): Ditto.
1635         (WebCore::SVGSVGElement::removedFromAncestor): Ditto.
1636         * svg/SVGTRefElement.cpp:
1637         (WebCore::SVGTRefElement::detachTarget): Ditto.
1638         (WebCore::SVGTRefElement::buildPendingResource): Ditto.
1639         * svg/SVGTextPathElement.cpp:
1640         (WebCore::SVGTextPathElement::clearResourceReferences): Ditto.
1641         (WebCore::SVGTextPathElement::buildPendingResource): Ditto.
1642         * svg/SVGUseElement.cpp:
1643         (WebCore::SVGUseElement::updateShadowTree): Ditto.
1644         * svg/animation/SVGSMILElement.cpp:
1645         (WebCore::SVGSMILElement::clearResourceReferences): Ditto.
1646         (WebCore::SVGSMILElement::buildPendingResource): Ditto.
1647         * testing/Internals.cpp:
1648         (WebCore::Internals::addTextMatchMarker): Ditto.
1649         (WebCore::Internals::webkitWillEnterFullScreenForElement): Ditto.
1650         (WebCore::Internals::webkitDidEnterFullScreenForElement): Ditto.
1651         (WebCore::Internals::webkitWillExitFullScreenForElement): Ditto.
1652         (WebCore::Internals::webkitDidExitFullScreenForElement): Ditto.
1653         * workers/Worker.cpp:
1654         (WebCore::Worker::create): Ditto.
1655         (WebCore::Worker::notifyFinished): Ditto.
1656         * workers/service/ServiceWorkerContainer.cpp:
1657         (WebCore::ServiceWorkerContainer::scheduleJob): Ditto.
1658         (WebCore::ServiceWorkerContainer::jobDidFinish): Ditto.
1659         * xml/XMLHttpRequest.cpp:
1660         (WebCore::XMLHttpRequest::prepareToSend): Ditto.
1661         (WebCore::XMLHttpRequest::createRequest): Ditto.
1662         (WebCore::XMLHttpRequest::internalAbort): Ditto.
1663         (WebCore::XMLHttpRequest::networkErrorTimerFired): Ditto.
1664         (WebCore::XMLHttpRequest::didFail): Ditto.
1665         (WebCore::XMLHttpRequest::didFinishLoading): Ditto.
1666
1667         * xml/XPathStep.cpp: Removed unneeded include of HTMLDocument.h.
1668         (WebCore::XPath::nodeMatchesBasicTest): Changed code to call isHTMLDocument
1669         rather than is<HTMLDocument> since this is not a type check for a downcast,
1670         but rather a behavioral difference that does not depend on any of the data
1671         stored in an HTMLDocument or the use of a distinct C++ class for it.
1672
1673         * xml/XSLTProcessor.cpp:
1674         (WebCore::XSLTProcessor::createDocumentFromSource): Pass a reference.
1675
1676 2019-01-21  David Kilzer  <ddkilzer@apple.com>
1677
1678         Switch remaining VideoToolbox soft-linking in WebCore over to VideoToolboxSoftLink.{cpp,h}
1679         <https://webkit.org/b/193645>
1680         <rdar://problem/47421574>
1681
1682         Reviewed by Alex Christensen.
1683
1684         * platform/cocoa/VideoToolboxSoftLink.cpp:
1685         * platform/cocoa/VideoToolboxSoftLink.h:
1686         - Move soft-linking of VTPixelBufferConformer* functions from
1687           PixelBufferConformerCV.cpp to here.
1688         * platform/graphics/cv/PixelBufferConformerCV.cpp:
1689         - Remove local soft-linking of VideoToolbox.framework and switch
1690           to VideoToolboxSoftLink.h.
1691
1692 2019-01-21  Antti Koivisto  <antti@apple.com>
1693
1694         Move delegatesScrolling() tests to lower level conversion function in ScrollView
1695         https://bugs.webkit.org/show_bug.cgi?id=193649
1696
1697         Reviewed by Frédéric Wang.
1698
1699         This reduces places where these tests are needed and helps avoid mistakes.
1700
1701         * dom/Document.cpp:
1702         (WebCore::computeIntersectionState):
1703         * page/FrameView.cpp:
1704         (WebCore::FrameView::convertFromRendererToContainingView const):
1705         (WebCore::FrameView::convertFromContainingViewToRenderer const):
1706         * platform/ScrollView.cpp:
1707         (WebCore::ScrollView::viewToContents const):
1708         (WebCore::ScrollView::contentsToView const):
1709         (WebCore::ScrollView::contentsToContainingViewContents const):
1710         (WebCore::ScrollView::rootViewToContents const):
1711         (WebCore::ScrollView::contentsToRootView const):
1712         (WebCore::ScrollView::windowToContents const):
1713         (WebCore::ScrollView::contentsToWindow const):
1714
1715 2019-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1716
1717         REGRESSION(r239915): about 130 test failures on WPE
1718         https://bugs.webkit.org/show_bug.cgi?id=193395
1719
1720         Reviewed by Žan Doberšek.
1721
1722         Since r239915 we are only overriding the characters with Default_Ignorable unicode property when the font
1723         doesn't support the code point. If the font happens to provide a glyph for the character, it's later ignored by
1724         harfbuzz when shaping, but the simple text code path doesn't ignore them unless there isn't a glyph.
1725
1726         * platform/graphics/WidthIterator.cpp:
1727         (WebCore::WidthIterator::advanceInternal): Always ignore characters with Default_Ignorable unicode property.
1728         (WebCore::characterMustDrawSomething): Moved to CharacterProperties.h and renamed as isDefaultIgnorableCodePoint().
1729         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
1730         (WebCore::GlyphPage::fill): Use isDefaultIgnorableCodePoint().
1731         * platform/text/CharacterProperties.h:
1732         (WebCore::isDefaultIgnorableCodePoint): Return whether the character has Default_Ignorable unicode property.
1733
1734 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
1735
1736         [WHLSL] Implement Metal code generation
1737         https://bugs.webkit.org/show_bug.cgi?id=193531
1738
1739         Reviewed by Dean Jackson.
1740
1741         This implements the majority of the metal code generation piece. There are still a few pieces missing,
1742         that I'll add in follow up patches. There's still enough complexity here that this is worth reviewing
1743         on its own, though.
1744
1745         This patch includes a few pieces:
1746         - Metal typedefs for every WHLSL type. This analysis is actually pretty interesting, because complex
1747               types depend on their inner types, and the inner types need to be emitted first. Therefore,
1748               this patch implements a topological sort when emitting types. Also, WHLSL types need to be de-
1749               duped because array references are implemented in MSL as structs, and if you have two structs
1750               in MSL with the same contents, those two structs are not equal and cannot be assigned to each
1751               other. So, this patch creates a trie to de-dup all the UnnamedTypes, and implements a
1752               dependency graph which includes both nodes in the trie as well as NamedTypes which don't appear
1753               in the trie.
1754         - WHLSL enumeration code generation
1755         - A name mangler, which ensures that no text from the source program is contained within the result
1756               program
1757         - Full support for expressions. An expression like "y = *x + 7;" would be converted to something like
1758               Type1 variable1 = *x;
1759               Type2 variable2 = 7;
1760               Type3 variable3 = variable1 + variable2;
1761               y = variable3;
1762         - Mostly complete support for control flow. This is tricky because of how we transform WHLSL
1763               expressions into C++ statements. Therefore, things like "for ( ; *x + 7; )" is difficult to
1764               compile, because we can't put the "*x + 7" generated statements into the for loop itself.
1765               Instead, we have to emit this code inside the loop, in all the places that would implicitly run
1766               it. This patch doesn't fully handle this, see below. (If MSL supported lambdas, we could put
1767               the statements into a lambda and do something like "for ( ; theLambda(); )" but MSL doesn't
1768               support lambdas.)
1769
1770         Missing pieces:
1771         - Entry point pack / unpack code
1772         - Support for "continue" (See above regarding control flow)
1773         - Knowing whether or not a switch case should end with break or fallthrough
1774         - Trapping
1775         - Zero filling variables
1776         - Code generation for compiler-generated native functions (this patch supports native functions in the
1777               standard library), texture functions, and HLSL's half <-> int functions.
1778
1779         No new tests because it isn't hooked up yet. As soon as we can do entry point packing and unpacking,
1780         I'll start porting the test suite.
1781
1782         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
1783         (WebCore::WHLSL::AST::BuiltInSemantic::targetIndex):
1784         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
1785         (WebCore::WHLSL::AST::Expression::resolvedType):
1786         (WebCore::WHLSL::AST::Expression::type): Deleted.
1787         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
1788         (WebCore::WHLSL::AST::FunctionDeclaration::name):
1789         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
1790         (WebCore::WHLSL::AST::StructureDefinition::find):
1791         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Added.
1792         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
1793         (WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes):
1794         (WebCore::WHLSL::Metal::EntryPointScaffolding::signature):
1795         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpack):
1796         (WebCore::WHLSL::Metal::EntryPointScaffolding::pack):
1797         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
1798         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Added.
1799         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::FunctionDeclarationWriter):
1800         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
1801         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
1802         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::toString):
1803         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
1804         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
1805         (WebCore::WHLSL::Metal::metalFunctions):
1806         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
1807         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h.
1808         (WebCore::WHLSL::Metal::generateMetalCode):
1809         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
1810         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Added.
1811         (WebCore::WHLSL::Metal::getNativeName):
1812         (WebCore::WHLSL::Metal::mapFunctionName):
1813         (WebCore::WHLSL::Metal::convertAddressSpace):
1814         (WebCore::WHLSL::Metal::writeNativeFunction):
1815         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
1816         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: Added.
1817         (WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
1818         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
1819         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
1820         (WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
1821         (WebCore::WHLSL::Metal::BaseTypeNameNode::isReferenceTypeNameNode const):
1822         (WebCore::WHLSL::Metal::BaseTypeNameNode::children):
1823         (WebCore::WHLSL::Metal::BaseTypeNameNode::append):
1824         (WebCore::WHLSL::Metal::BaseTypeNameNode::parent):
1825         (WebCore::WHLSL::Metal::BaseTypeNameNode::mangledName const):
1826         (WebCore::WHLSL::Metal::ArrayTypeNameNode::ArrayTypeNameNode):
1827         (WebCore::WHLSL::Metal::ArrayTypeNameNode::numElements const):
1828         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::ArrayReferenceTypeNameNode):
1829         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::addressSpace const):
1830         (WebCore::WHLSL::Metal::PointerTypeNameNode::PointerTypeNameNode):
1831         (WebCore::WHLSL::Metal::PointerTypeNameNode::addressSpace const):
1832         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::ReferenceTypeNameNode):
1833         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::namedType):
1834         (WebCore::WHLSL::Metal::TypeNamer::TypeNamer):
1835         (WebCore::WHLSL::Metal::TypeNamer::visit):
1836         (WebCore::WHLSL::Metal::findInVector):
1837         (WebCore::WHLSL::Metal::find):
1838         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
1839         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
1840         (WebCore::WHLSL::Metal::TypeNamer::insert):
1841         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
1842         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::toString):
1843         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit):
1844         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
1845         (WebCore::WHLSL::Metal::toString):
1846         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
1847         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
1848         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
1849         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForEnumerationMember):
1850         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForStructureElement):
1851         (WebCore::WHLSL::Metal::TypeNamer::metalTypes):
1852         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h: Added.
1853         (WebCore::WHLSL::Metal::TypeNamer::generateNextTypeName):
1854         (WebCore::WHLSL::Metal::TypeNamer::generateNextStructureElementName):
1855         (WebCore::WHLSL::Metal::TypeNamer::generateNextEnumerationMemberName):
1856         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1857         (WebCore::WHLSL::checkSemantics):
1858         (WebCore::WHLSL::Checker::visit):
1859         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
1860         (WebCore::WHLSL::Gatherer::visit):
1861         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
1862         (WebCore::WHLSL::EntryPointItem::EntryPointItem):
1863         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed.
1864         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
1865         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
1866         (WebCore::WHLSL::checkStatementBehavior):
1867         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
1868         * Sources.txt:
1869         * WebCore.xcodeproj/project.pbxproj:
1870
1871 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
1872
1873         [WHLSL] Add the statement behavior checker
1874         https://bugs.webkit.org/show_bug.cgi?id=193487
1875
1876         Reviewed by Dean Jackson.
1877
1878         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Spec/source/index.rst#typing-statements
1879         into C++. It is meant to replace the ReturnChecker and UnreachableCodeChecker in the reference implementation.
1880
1881         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
1882         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
1883
1884         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed. StatementBehaviorChecker does everything that LoopChecker
1885         does.
1886         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
1887         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
1888         (WebCore::WHLSL::checkStatementBehavior):
1889         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
1890         * Sources.txt:
1891         * WebCore.xcodeproj/project.pbxproj:
1892
1893 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1894
1895         REGRESSION(r240174): Wrong preprocessor guards in RenderImage::paintAreaElementFocusRing
1896         https://bugs.webkit.org/show_bug.cgi?id=193630
1897
1898         Reviewed by Daniel Bates.
1899
1900         r240174 inadvertently disabled this function on non-Apple platforms.
1901
1902         This fixes layout test fast/images/image-map-outline-in-positioned-container.html.
1903
1904         * rendering/RenderImage.cpp:
1905         (WebCore::RenderImage::paintAreaElementFocusRing):
1906
1907 2019-01-20  chris fleizach  <cfleizach@apple.com>
1908
1909         AX: Support returning relative frames for accessibility
1910         https://bugs.webkit.org/show_bug.cgi?id=193414
1911         <rdar://problem/47268501>
1912
1913         Reviewed by Zalan Bujtas.
1914
1915         Create a way for assistive technologies to retrieve a frame in page space that can be transformed to its final screen space by having the AT message the UI process separately.
1916
1917         Consolidate rect/point conversion methods for macOS and iOS.
1918         This is only needed on WebKit2, where we have to reach back across to the hosting process to get the final frame, so we can skip this test on WK1.
1919
1920         Tests: accessibility/mac/relative-frame.html
1921
1922         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1923         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
1924         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
1925         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
1926         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
1927         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
1928         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
1929         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
1930         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
1931         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
1932         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1933         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1934         (convertPathToScreenSpaceFunction):
1935         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
1936         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
1937         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1938         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
1939         (-[WebAccessibilityObjectWrapper position]):
1940         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1941         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
1942
1943 2019-01-20  Simon Fraser  <simon.fraser@apple.com>
1944
1945         On RenderBox, make client sizing be derived from padding box sizing
1946         https://bugs.webkit.org/show_bug.cgi?id=193621
1947
1948         Reviewed by Daniel Bates.
1949
1950         I never liked how clientWidth/Height, an IE-originated term, was used as the basis
1951         for various RenderBox geometry functions.
1952
1953         Fix by adding some functions which return the dimensions of the padding box (which
1954         is the inside of the border and any scrollbar), and define clientWidth/Height in
1955         terms of them.
1956
1957         Also add paddingBoxRectIncludingScrollbar() function that is used by compositing code.
1958
1959         * rendering/RenderBox.cpp:
1960         (WebCore::RenderBox::clientWidth const):
1961         (WebCore::RenderBox::clientHeight const):
1962         * rendering/RenderBox.h:
1963         (WebCore::RenderBox::borderBoxRect const):
1964         (WebCore::RenderBox::computedCSSContentBoxRect const):
1965         (WebCore::RenderBox::contentWidth const):
1966         (WebCore::RenderBox::contentHeight const):
1967         (WebCore::RenderBox::paddingBoxWidth const):
1968         (WebCore::RenderBox::paddingBoxHeight const):
1969         (WebCore::RenderBox::paddingBoxRect const):
1970         (WebCore::RenderBox::paddingBoxRectIncludingScrollbar const):
1971         (WebCore::RenderBox::hasHorizontalOverflow const):
1972         (WebCore::RenderBox::hasVerticalOverflow const):
1973         * rendering/RenderLayerBacking.cpp:
1974         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
1975         (WebCore::RenderLayerBacking::updateGeometry):
1976
1977 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1978
1979         Unreviewed, rolling out r238275.
1980
1981         Regressed css3/shapes/shape-outside/shape-image/shape-
1982         image-025.html
1983
1984         Reverted changeset:
1985
1986         "ScalableImageDecoder: don't forcefully decode image data when
1987         querying frame completeness, duration"
1988         https://bugs.webkit.org/show_bug.cgi?id=191354
1989         https://trac.webkit.org/changeset/238275
1990
1991 2019-01-19  Zalan Bujtas  <zalan@apple.com>
1992
1993         [LFC][BFC] <body>'s overflow property value is propagated to viewport
1994         https://bugs.webkit.org/show_bug.cgi?id=193617
1995
1996         Reviewed by Antti Koivisto.
1997
1998         When the root element is an HTML "HTML" element or an XHTML "html" element, and that element has an HTML "BODY" element
1999         or an XHTML "body" element as a child, user agents must instead apply the 'overflow' property from the first such child element to the viewport,
2000         if the value on the root element is 'visible'. The 'visible' value when used for the viewport must be interpreted as 'auto'.
2001         The element from which the value is propagated must have a used value for 'overflow' of 'visible'.
2002
2003         This also has impact on layout since <body style="overflow: hidden"> would establish a block formatting context.
2004
2005         * layout/layouttree/LayoutBox.cpp:
2006         (WebCore::Layout::Box::isOverflowVisible const):
2007
2008 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2009
2010         Unreviewed, rolling out r240209.
2011
2012         Broke GTK/WPE injected bundle
2013
2014         Reverted changeset:
2015
2016         "AX: Support returning relative frames for accessibility"
2017         https://bugs.webkit.org/show_bug.cgi?id=193414
2018         https://trac.webkit.org/changeset/240209
2019
2020 2019-01-12  Dan Bernstein  <mitz@apple.com>
2021
2022         [Cocoa] Avoid importing directly from subumbrella frameworks
2023         https://bugs.webkit.org/show_bug.cgi?id=186016
2024         <rdar://problem/40591038>
2025
2026         Reviewed by Sam Weinig.
2027
2028         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
2029           OTHER_CPLUSPLUSFLAGS.
2030         * editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
2031         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
2032         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
2033
2034 2019-01-20  chris fleizach  <cfleizach@apple.com>
2035
2036         AX: Support returning relative frames for accessibility
2037         https://bugs.webkit.org/show_bug.cgi?id=193414
2038         <rdar://problem/47268501>
2039
2040         Reviewed by Zalan Bujtas.
2041
2042         Create a way for assistive technologies to retrieve a frame in page space that can be transformed to its final screen space by having the AT message the UI process separately.
2043
2044         Consolidate rect/point conversion methods for macOS and iOS.
2045         This is only needed on WebKit2, where we have to reach back across to the hosting process to get the final frame, so we can skip this test on WK1.
2046
2047         Tests: accessibility/mac/relative-frame.html
2048
2049         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2050         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
2051         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
2052         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
2053         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
2054         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
2055         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
2056         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
2057         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
2058         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
2059         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2060         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2061         (convertPathToScreenSpaceFunction):
2062         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
2063         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
2064         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2065         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
2066         (-[WebAccessibilityObjectWrapper position]):
2067         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2068         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
2069
2070 2019-01-20  Antoine Quint  <graouts@apple.com>
2071
2072         Add a POINTER_EVENTS feature flag
2073         https://bugs.webkit.org/show_bug.cgi?id=193577
2074         <rdar://problem/47408511>
2075
2076         Unreviewed. Also enable Pointer Events for iosmac.
2077
2078         * Configurations/FeatureDefines.xcconfig:
2079
2080 2019-01-19  Zalan Bujtas  <zalan@apple.com>
2081
2082         [LFC][Floats] Ensure that floats in FloatingContext::m_floats are always horizontally ordered.
2083         https://bugs.webkit.org/show_bug.cgi?id=193613
2084
2085         Reviewed by Antti Koivisto.
2086
2087         Float items in m_floats list should stay in horizontal position order (left/right edge).
2088
2089         When adding a new float item to floating state list, we have to ensure that it is definitely the left(right)-most item.
2090         Normally it is, but negative horizontal margins can push the float box beyond another float box.
2091
2092         <div style="float: left; height: 10px; width: 10px;"></div>
2093         <div style="float: left; height: 10px; width: 10px; margin-left: -80px;"></div>
2094
2095         The second float's right edge beyond the first float' left edge. THe second float is not the right(inner)-most float anymore.
2096
2097         Test: fast/block/float/floats-with-negative-horizontal-margin.html
2098
2099         * layout/floats/FloatingContext.cpp:
2100         (WebCore::Layout::areFloatsHorizontallySorted):
2101         (WebCore::Layout::FloatingContext::positionForFloat const):
2102         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
2103         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2104         * layout/floats/FloatingState.cpp:
2105         (WebCore::Layout::FloatingState::append):
2106
2107 2019-01-19  Youenn Fablet  <youenn@apple.com>
2108
2109         getUserMedia with a deviceId exact constraint with an empty string value should succeed
2110         https://bugs.webkit.org/show_bug.cgi?id=193541
2111         <rdar://problem/47357218>
2112
2113         Reviewed by Eric Carlson.
2114
2115         If there is a deviceId constraint, remove any empty string from ideal/exact string list.
2116         This will make the device selection be solely based on other constraints.
2117         An improvement might be for 'exact' constraint to pick the default device.
2118         There is currently no such notion of a default device.
2119         Picking the best fitting device seems a good tradeoff.
2120         Covered by updated test.
2121
2122         * platform/mediastream/MediaConstraints.cpp:
2123         (WebCore::MediaTrackConstraintSetMap::set):
2124         * platform/mediastream/MediaConstraints.h:
2125         (WebCore::StringConstraint::removeEmptyStringConstraint):
2126
2127 2019-01-19  Eric Liang  <ericliang@apple.com>
2128
2129         AXSelected attribute on RadioButton should not be settable.
2130         https://bugs.webkit.org/show_bug.cgi?id=193371
2131
2132         Reviewed by Chris Fleizach.
2133
2134         Test: accessibility/set-selected-editable.html
2135
2136         * accessibility/AccessibilityNodeObject.cpp:
2137         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
2138
2139 2019-01-19  Antoine Quint  <graouts@apple.com>
2140
2141         Add a POINTER_EVENTS feature flag
2142         https://bugs.webkit.org/show_bug.cgi?id=193577
2143
2144         Reviewed by Dean Jackson.
2145
2146         Only expose the PointerEvent interface if the POINTER_EVENTS feature is enabled.
2147
2148         * Configurations/FeatureDefines.xcconfig:
2149         * dom/EventNames.in:
2150         * dom/PointerEvent.cpp:
2151         * dom/PointerEvent.h:
2152         * dom/PointerEvent.idl:
2153
2154 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
2155
2156         iOS: Updating input mode should update the software keyboard
2157         https://bugs.webkit.org/show_bug.cgi?id=193565
2158         <rdar://problem/47376334>
2159
2160         Reviewed by Wenson Hsieh.
2161
2162         Let the chrome client know that the focused element's inputmode had changed.
2163
2164         Test: fast/forms/ios/inputmode-none-removed.html
2165
2166         * html/HTMLElement.cpp:
2167         (WebCore::HTMLElement::parseAttribute):
2168         * page/ChromeClient.h:
2169
2170 2019-01-18  Brian Burg  <bburg@apple.com>
2171
2172         Automation.computeElementLayout should return visual viewport-aware coordinates
2173         https://bugs.webkit.org/show_bug.cgi?id=193598
2174         <rdar://problem/35325644>
2175
2176         Reviewed by Simon Fraser.
2177
2178         * page/FrameView.h: export symbol to be usable from WebKit.
2179         * page/FrameView.cpp:
2180         (WebCore::FrameView::clientToLayoutViewportRect const): Added.
2181         Do the same thing as clientToLayoutViewportPoint with a rect instead.
2182
2183
2184 2019-01-18  Eric Carlson  <eric.carlson@apple.com>
2185
2186         Revert r238815, it broke WK1 video fullscreen on Mac
2187         https://bugs.webkit.org/show_bug.cgi?id=193586
2188         <rdar://problem/47358941>
2189
2190         Reviewed by Jer Noble.
2191
2192         * PlatformMac.cmake:
2193         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2194         (WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
2195
2196 2019-01-18  Devin Rousso  <drousso@apple.com>
2197
2198         Web Inspector: Audit: don't keep the injected sub-objects alive between runs
2199         https://bugs.webkit.org/show_bug.cgi?id=193594
2200         <rdar://problem/47398091>
2201
2202         Reviewed by Joseph Pecoraro.
2203
2204         Rather than save the `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject`
2205         between individual `Audit.setup` invocations, we should only keep them alive so long as the
2206         injected `WebInspectorAudit` object is alive (e.g. from `Audit.setup` to `Audit.teardown`).
2207
2208         This change fixes inspector/audit/run-accessibility.html.
2209
2210         * inspector/agents/page/PageAuditAgent.h:
2211         * inspector/agents/page/PageAuditAgent.cpp:
2212         (WebCore::PageAuditAgent::populateAuditObject):
2213
2214 2019-01-18  Daniel Bates  <dabates@apple.com>
2215
2216         Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
2217         (https://bugs.webkit.org/show_bug.cgi?id=193583)
2218
2219         Substitute ENABLE(FULL_KEYBOARD_ACCESS) for PLATFORM(MAC). On Mac, we always build with
2220         ENABLE(FULL_KEYBOARD_ACCESS) enabled.
2221
2222         * rendering/RenderElement.cpp:
2223         (WebCore::RenderElement::paintFocusRing):
2224
2225 2019-01-18  Daniel Bates  <dabates@apple.com>
2226
2227         Fix some build issues.
2228
2229         Including UIKitSoftLinking.h is not compatible with unified builds.
2230
2231         * SourcesCocoa.txt:
2232         * WebCore.xcodeproj/project.pbxproj:
2233
2234 2019-01-18  Justin Fan  <justin_fan@apple.com>
2235
2236         (WIP) [WebGPU] WebGPUProgrammablePassEncoder::setBindGroup prototype
2237         https://bugs.webkit.org/show_bug.cgi?id=193457
2238         <rdar://problem/47296678>
2239
2240         Reviewed by Dean Jackson.
2241
2242         Enable WebGPU developers to assign buffer bind groups and access them via render pipeline. 
2243
2244         Test: webgpu/buffer-resource-triangles.html
2245
2246         * Modules/webgpu/WebGPUBindGroup.h:
2247         (WebCore::WebGPUBindGroup::bindGroup const): Added getter.
2248         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: 
2249         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Added. Delegates call to GPUProgrammablePassEncoder.
2250         * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Enable setBindGroup.
2251         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: ditto.
2252         * WebCore.xcodeproj/project.pbxproj:
2253         * platform/graphics/gpu/GPUBindGroup.h: 
2254         (WebCore::GPUBindGroup::layout const): Added getter.
2255         (WebCore::GPUBindGroup::bindings const): ditto.
2256         * platform/graphics/gpu/GPUBindGroupLayout.h: Added ArgumentEncoderBuffer struct to retain ptr to both MTLArgumentEncoders and their argument MTLBuffers.
2257         (WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::operator! const):
2258         (WebCore::GPUBindGroupLayout::vertexArguments const): Added. Getter.
2259         (WebCore::GPUBindGroupLayout::fragmentArguments const): ditto.
2260         (WebCore::GPUBindGroupLayout::computeArguments const): ditto.
2261         * platform/graphics/gpu/GPUDevice.cpp: Refactored unnecessary header include.
2262         * platform/graphics/gpu/GPUDevice.h: ditto.
2263         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2264         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer): Added. Delegates to MTLCommandEncoder call.
2265         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer): ditto.
2266         * platform/graphics/gpu/GPURenderPassEncoder.h: 
2267         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2268         (WebCore::tryCreateArgumentEncoderAndBuffer): Replace newEncoder(). Now create an ArgumentEncoderBuffer object from an array of MTLArgumentDescriptors, if able.
2269         (WebCore::GPUBindGroupLayout::tryCreate): Refactor to support ArgumentEncoderBuffers, and allocate MTLBuffers for argument encoders.
2270         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout): Support ArgumentEncoderBuffers.
2271         (WebCore::newEncoder): Deleted.
2272         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
2273         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
2274         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2275         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Set a buffer resource on the MTLArgumentEncoder, and call useResource on the command encoder.
2276         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Parses the bind group to assign each resource on its matching MTLArgumentEncoder.
2277         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: 
2278         (WebCore::GPURenderPassEncoder::useResource): Resolves call from GPUProgrammablePassEncoder to call on MTLRenderCommandEncoder.
2279         (WebCore::GPURenderPassEncoder::setVertexBuffer): ditto.
2280         (WebCore::GPURenderPassEncoder::setFragmentBuffer): ditto.
2281
2282 2019-01-18  Daniel Bates  <dabates@apple.com>
2283
2284         Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
2285         (https://bugs.webkit.org/show_bug.cgi?id=193583)
2286
2287         Only override RenderTheme::platformFocusRingColor() when building with ENABLE(FULL_KEYBOARD_ACCESS)
2288         enabled.
2289
2290         * rendering/RenderThemeIOS.h:
2291         * rendering/RenderThemeIOS.mm:
2292
2293 2019-01-18  Daniel Bates  <dabates@apple.com>
2294
2295         Attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
2296         (https://bugs.webkit.org/show_bug.cgi?id=193583)
2297
2298         Namespace qualify call to getUIColorClass().
2299
2300         * rendering/RenderThemeIOS.mm:
2301         (WebCore::RenderThemeIOS::platformFocusRingColor const):
2302
2303 2019-01-18  Jer Noble  <jer.noble@apple.com>
2304
2305         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2306         https://bugs.webkit.org/show_bug.cgi?id=189553
2307
2308         Reviewed by Tim Horton.
2309
2310         * Configurations/Base.xcconfig:
2311         * Configurations/SDKVariant.xcconfig: Added.
2312         * Configurations/WebCore.xcconfig:
2313
2314 2019-01-18  Daniel Bates  <dabates@apple.com>
2315
2316         CSS auto focus-ring outlines don't render on iOS
2317         https://bugs.webkit.org/show_bug.cgi?id=193583
2318         <rdar://problem/6508697>
2319
2320         Reviewed by Simon Fraser.
2321
2322         Implement support for drawing focus rings on iOS when built with ENABLE(FULL_KEYBOARD_ACCESS)
2323         enabled.
2324
2325         For now the focus ring drawing for iOS is tangled up into the Mac-specific code to draw
2326         animated focus rings. I will fix this in <https://bugs.webkit.org/show_bug.cgi?id=193591>.
2327
2328         * SourcesCocoa.txt: Add file ColorIOS.mm.
2329         * WebCore.xcodeproj/project.pbxproj: Add files ColorIOS.{h, mm}.
2330
2331         * platform/graphics/GraphicsContext.h:
2332         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2333         (WebCore::drawFocusRingAtTime):
2334         (WebCore::GraphicsContext::drawFocusRing):
2335         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
2336         This is always enabled on Mac.
2337         
2338         * platform/ios/ColorIOS.h: Added.
2339         * platform/ios/ColorIOS.mm: Added.
2340         (WebCore::colorFromUIColor): Convert a UIColor to a WebCore::Color.
2341
2342         * rendering/RenderElement.cpp:
2343         (WebCore::RenderElement::paintFocusRing):
2344         * rendering/RenderImage.cpp:
2345         (WebCore::RenderImage::paintAreaElementFocusRing):
2346         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
2347         This is always enabled on Mac.
2348
2349         * rendering/RenderThemeIOS.h:
2350         * rendering/RenderThemeIOS.mm:
2351         (WebCore::RenderThemeIOS::platformFocusRingColor const): Implement this override for iOS.
2352         (WebCore::RenderThemeIOS::supportsFocusRing const): Implement this override for iOS to always
2353         return false - the iOS theme code does not support painting focus rings. By returning false we
2354         will use the platform-independent, non-theme code path to draw focus rings.
2355
2356 2019-01-18  David Kilzer  <ddkilzer@apple.com>
2357
2358         Follow-up: Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
2359         <https://webkit.org/b/193568>
2360         <rdar://problem/47381130>
2361
2362         * editing/cocoa/DictionaryLookup.mm:
2363         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
2364         Fix the build by changing getUIApplicationClass() to
2365         PAL::getUIApplicationClass().
2366
2367 2019-01-18  David Kilzer  <ddkilzer@apple.com>
2368
2369         Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
2370         <https://webkit.org/b/193568>
2371         <rdar://problem/47381130>
2372
2373         Reviewed by Alex Christensen.
2374
2375         This does the following:
2376         - Removes local soft-linking of UIKit.
2377         - Switches to using PAL functions for soft-linking.
2378
2379         * SourcesCocoa.txt: Add 4 source files to UnifiedSources.
2380         * WebCore.xcodeproj/project.pbxproj: Remove 4 sources files
2381         from WebCore target now that they are in UnifiedSources.
2382         * editing/cocoa/DictionaryLookup.mm:
2383         * editing/cocoa/HTMLConverter.mm: Move SPI to UIKitSPI.h. Remove
2384         declarations in public headers.
2385         (_fontForNameAndSize): Change use of getUIFontClass() to
2386         PlatformFontClass.
2387         (HTMLConverter::_processElement): Add cast here since compiler
2388         finds the wrong selector for +clearColor and thinks it returns a
2389         `CIColor *` object.  The same cast already exists in
2390         VideoFullscreenInterfaceAVKit.mm.
2391         * page/cocoa/SettingsBaseCocoa.mm:
2392         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
2393         * platform/audio/ios/MediaSessionManagerIOS.mm:
2394         (-[WebMediaSessionHelper initWithCallback:]):
2395         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2396         (WebCore::exernalDeviceDisplayNameForPlayer):
2397         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2398         (WebCore::showLetterpressedGlyphsWithAdvances):
2399         * platform/ios/DragImageIOS.mm:
2400         (WebCore::scaleDragImage):
2401         (WebCore::createDragImageFromImage):
2402         (WebCore::cascadeForSystemFont):
2403         (WebCore::createDragImageForLink):
2404         (WebCore::createDragImageForSelection):
2405         (WebCore::createDragImageForRange):
2406         (WebCore::createDragImageForColor):
2407         * platform/ios/PlatformPasteboardIOS.mm:
2408         (WebCore::PlatformPasteboard::PlatformPasteboard):
2409         (WebCore::PlatformPasteboard::color):
2410         (WebCore::registerItemToPasteboard):
2411         (WebCore::PlatformPasteboard::setColor):
2412         * platform/ios/ThemeIOS.mm:
2413         (WebCore::ThemeIOS::userPrefersReducedMotion const):
2414         * platform/ios/UserAgentIOS.mm:
2415         (WebCore::isClassic):
2416         (WebCore::isClassicPad):
2417         (WebCore::isClassicPhone):
2418         * platform/ios/ValidationBubbleIOS.mm:
2419         (-[WebValidationBubbleTapRecognizer initWithPopoverController:]):
2420         (WebCore::ValidationBubble::ValidationBubble):
2421         (WebCore::ValidationBubble::show):
2422         (WebCore::fallbackViewController):
2423         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2424         (clearUIColor):
2425         (allocWebAVPictureInPicturePlayerLayerViewInstance):
2426         (WebAVPlayerLayerView_videoView):
2427         (fallbackViewController):
2428         (VideoFullscreenInterfaceAVKit::doSetup):
2429         * platform/ios/WebEvent.mm:
2430         (+[WebEvent modifierFlags]):
2431         * platform/ios/WebItemProviderPasteboard.mm:
2432         (allLoadableClasses):
2433         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2434         (VideoFullscreenControllerContext::setUpFullscreen):
2435         * platform/network/mac/WebCoreURLResponse.mm: Add missing header
2436         after unified sources were updated.
2437         * rendering/RenderThemeIOS.mm:
2438         (WebCore::contentSizeCategoryDidChange):
2439         (WebCore::RenderThemeIOS::RenderThemeIOS):
2440         (WebCore::RenderThemeIOS::contentSizeCategory):
2441         (WebCore::RenderThemeIOS::systemColor const):
2442         (WebCore::attachmentActionColor):
2443         (WebCore::attachmentTitleColor):
2444         (WebCore::attachmentSubtitleColor):
2445         (WebCore::iconForAttachment):
2446         * testing/Internals.mm:
2447         (WebCore::Internals::userPrefersReducedMotion const):
2448
2449 2019-01-18  Antti Koivisto  <antti@apple.com>
2450
2451         Implement asynchronous frame scrolling for iOS
2452         https://bugs.webkit.org/show_bug.cgi?id=193539
2453         <rdar://problem/47379873>
2454
2455         Reviewed by Simon Fraser.
2456
2457         This patch implements UIScrollView based frame scrolling on iOS, enabled by the "Async Frame Scrolling"
2458         internal setting (still off by default).
2459
2460         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2461         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
2462         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2463         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
2464
2465         Export ScrollingTreeFrameScrollingNodeIOS.
2466
2467         * rendering/RenderLayerCompositor.cpp:
2468         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
2469         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
2470         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
2471
2472         If we don't have a separate clip layer, just resize and position the scroll layer.
2473
2474         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
2475         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2476         (WebCore::RenderLayerCompositor::ensureRootLayer):
2477
2478         Use GraphicsLayer::Type::Scrolling as the scroll layer type when async frame scrolling is enabled.
2479         Don't create a separate clip layer since the scroll layer will handle clipping.
2480
2481         * rendering/RenderLayerCompositor.h:
2482
2483 2019-01-18  Ali Juma  <ajuma@chromium.org>
2484
2485         FetchResponse::url should return the empty string for tainted responses
2486         https://bugs.webkit.org/show_bug.cgi?id=193553
2487
2488         Reviewed by Youenn Fablet.
2489
2490         Check whether the response is tainted in FetchResponse::url, to match
2491         the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.
2492
2493         * Modules/fetch/FetchResponse.cpp:
2494         (WebCore::FetchResponse::url const):
2495
2496 2019-01-18  Youenn Fablet  <youenn@apple.com>
2497
2498         A track source should be unmuted whenever reenabled after setDirection changes
2499         https://bugs.webkit.org/show_bug.cgi?id=193554
2500         <rdar://problem/47366196>
2501
2502         Reviewed by Eric Carlson.
2503
2504         Ensure that track gets unmuted after being fired as part of track event.
2505         Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC.
2506         Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track,
2507         some enqueued samples might not be from the right active video track or there might be no active video track.
2508
2509         Test: webrtc/video-setDirection.html
2510
2511         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2512         (WebCore::LibWebRTCMediaEndpoint::fireTrackEvent):
2513         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2514         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2515         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2516         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
2517
2518 2019-01-18  Charlie Turner  <cturner@igalia.com>
2519
2520         [GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via bus messages
2521         https://bugs.webkit.org/show_bug.cgi?id=192229
2522
2523         Reviewed by Xabier Rodriguez-Calvar.
2524
2525         Covered by existing tests.
2526
2527         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2528         (WebCore::parseLicenseFormat): There is a defect in some C++11
2529         compiles where they will copy this return value since the type
2530         doesn't exactly match. Force a move with WTFMove.
2531         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2532         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
2533         Deleted. No longer used by anything.
2534         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto.
2535         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2536         Rename these methods to avoid "namespacing names".
2537         (webkit_media_clear_key_decrypt_class_init):
2538         (finalize):
2539         (handleKeyResponse): This is a temporary fix, we need some more
2540         reorganisation to be full driven by CDMInstance APIs for decryption.
2541         (findAndSetKey):
2542         (decrypt):
2543         (webKitMediaClearKeyDecryptorFinalize): Deleted.
2544         (webKitMediaClearKeyDecryptorHandleKeyResponse): Deleted.
2545         (webKitMediaClearKeyDecryptorFindAndSetKey): Deleted.
2546         (webKitMediaClearKeyDecryptorDecrypt): Deleted.
2547         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Ditto.
2548         (webkit_media_common_encryption_decrypt_class_init):
2549         (finalize):
2550         (transformCaps):
2551         (transformInPlace):
2552         (isCDMInstanceAvailable):
2553         (sinkEventHandler):
2554         (queryHandler):
2555         (changeState):
2556         (setContext):
2557         (webKitMediaCommonEncryptionDecryptorFinalize): Deleted.
2558         (webkitMediaCommonEncryptionDecryptTransformCaps): Deleted.
2559         (webkitMediaCommonEncryptionDecryptTransformInPlace): Deleted.
2560         (webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): Deleted.
2561         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Deleted.
2562         (webkitMediaCommonEncryptionDecryptorQueryHandler): Deleted.
2563         (webKitMediaCommonEncryptionDecryptorChangeState): Deleted.
2564         (webKitMediaCommonEncryptionDecryptorSetContext): Deleted.
2565         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
2566         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2567         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
2568         Deleted. No longer passing key information over bus messages.
2569         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2570
2571 2019-01-18  Zalan Bujtas  <zalan@apple.com>
2572
2573         [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
2574         https://bugs.webkit.org/show_bug.cgi?id=193564
2575
2576         Reviewed by Antti Koivisto.
2577
2578         Float boxes prevent collapsing through.
2579
2580         Test: fast/block/float/float-in-descendant-formatting-context.html
2581
2582         * layout/blockformatting/BlockMarginCollapse.cpp:
2583         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
2584
2585 2019-01-18  Zalan Bujtas  <zalan@apple.com>
2586
2587         [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom.
2588         https://bugs.webkit.org/show_bug.cgi?id=193562
2589
2590         Reviewed by Antti Koivisto.
2591
2592         The current floating context's (float) boxes could belong to descendant formatting contexts.
2593         We need to include them as well when computing height (bottom) (we essentially need to skip ancestor floats only).
2594
2595         <div id=container style="overflow: hidden"><div>foo<div style="float: left">bar</div></div></div>
2596         While computing the height for "container", the float box needs to be taken into account even though
2597         it is part of another (descendant) formatting context (the inline formatting context established by its parent div).
2598
2599         * layout/floats/FloatingState.cpp:
2600         (WebCore::Layout::FloatingState::bottom const):
2601         * layout/floats/FloatingState.h:
2602         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
2603         (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): Deleted.
2604
2605 2019-01-18  Zalan Bujtas  <zalan@apple.com>
2606
2607         [LFC][BFC] Check for inflow children while computing height for block formatting context roots.
2608         https://bugs.webkit.org/show_bug.cgi?id=193555
2609
2610         Reviewed by Antti Koivisto.
2611
2612         This patch also extends areEssentiallyEqual to 0.125px to be able to match (essentially equal) inline runs. 
2613
2614         * layout/FormattingContextGeometry.cpp:
2615         (WebCore::Layout::contentHeightForFormattingContextRoot):
2616         * layout/Verification.cpp:
2617         (WebCore::Layout::areEssentiallyEqual):
2618         * page/FrameViewLayoutContext.cpp:
2619         (WebCore::layoutUsingFormattingContext):
2620
2621 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
2622
2623         [WebAudio] Release the AudioDestination when uninitializing DefaultAudioDestinationNode
2624         https://bugs.webkit.org/show_bug.cgi?id=192590
2625
2626         Reviewed by Philippe Normand.
2627
2628         When we uninitialize DefaultAudioDestinationNode, the AudioDestination is stopped but not destroyed.
2629
2630         On some platforms the resources are allocated and released with the AudioDestination, thus when we uninitialize
2631         DefaultAudioDestinationNode we don't release resources because the AudioDestination is not destroyed.
2632
2633         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
2634         (WebCore::DefaultAudioDestinationNode::uninitialize):
2635
2636 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
2637
2638         [WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
2639         https://bugs.webkit.org/show_bug.cgi?id=192586
2640
2641         Reviewed by Philippe Normand.
2642
2643         When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
2644         the AudioDestinationNode is not destroyed.
2645
2646         In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
2647         is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
2648         the resources leak.
2649
2650         AudioContext::uninitialize() is not called immediately since r94608.
2651         This modification can now be reverted without regression in WebAudio tests.
2652
2653         Test: webaudio/mediaelementaudiosourcenode-gc.html
2654
2655         * Modules/webaudio/AudioContext.cpp:
2656         (WebCore::AudioContext::stop):
2657
2658 2019-01-18  Simon Fraser  <simon.fraser@apple.com>
2659
2660         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed
2661         https://bugs.webkit.org/show_bug.cgi?id=193559
2662
2663         Reviewed by Antti Koivisto.
2664
2665         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() existed for CoordinatedGraphics,
2666         but the code that used it was removed in webkit.org/r229318 so we can remove it and
2667         code that calls it.
2668
2669         * page/scrolling/ScrollingCoordinator.h:
2670         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
2671         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange): Deleted.
2672         * rendering/RenderLayerBacking.cpp:
2673         (WebCore::RenderLayerBacking::updateGeometry):
2674         * rendering/RenderLayerCompositor.cpp:
2675         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2676         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
2677         (WebCore::RenderLayerCompositor::scrollingLayerDidChange): Deleted.
2678         * rendering/RenderLayerCompositor.h:
2679
2680 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2681
2682         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
2683         https://bugs.webkit.org/show_bug.cgi?id=193494
2684         <rdar://problem/46859627>
2685
2686         Reviewed by Simon Fraser and Tim Horton.
2687
2688         When computing the content offset to scroll to when revealing a given rect in content coordinates, we currently
2689         just use the unobscured content rect. As a result, when scrolling to reveal a rect, we'll clamp the final scroll
2690         position such that only content is visible. For example, when asked to reveal the rect `(0, 0, 1, 1)`, we adjust
2691         the scroll position to be the origin.
2692
2693         However, consider the case where a client (e.g. Mail on iOS) has added a content inset to the web view's scroll
2694         view. If we're asked to reveal a rect that is outside the content area but within a content inset, we will still
2695         end up clamping the scroll position to the unobscured rect. This manifests in a bug where selecting text and
2696         autoscrolling in iOS Mail compose while the scroll view is scrolled all the way to the top to reveal the To/Cc/
2697         Subject fields causes the content offset to jump to the origin, rather than staying at (0, -topContentInset).
2698
2699         To fix this, we teach `RenderLayer::scrollRectToVisible` about content insets that are visible. Rather than use
2700         the content rects as-is, expand to encompass visible content insets as well. This ensures that revealing a
2701         position which is already visible won't cause us to scroll away the content inset area and only show the
2702         unobscured rect.
2703
2704         Tests:  editing/selection/ios/autoscroll-with-top-content-inset.html
2705                 fast/scrolling/ios/scroll-into-view-with-top-content-inset.html
2706
2707         * page/FrameView.cpp:
2708         (WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
2709
2710         Introduce a helper method that expands the unobscured content rect to include surrounding content insets.
2711
2712         * page/FrameView.h:
2713         * page/Page.h:
2714         (WebCore::Page::contentInsets const):
2715         (WebCore::Page::setContentInsets):
2716         * rendering/RenderLayer.cpp:
2717         (WebCore::RenderLayer::scrollRectToVisible):
2718         (WebCore::RenderLayer::getRectToExpose const):
2719
2720 2019-01-17  Truitt Savell  <tsavell@apple.com>
2721
2722         Unreviewed, rolling out r240124.
2723
2724         This commit broke an internal build.
2725
2726         Reverted changeset:
2727
2728         "SDK_VARIANT build destinations should be separate from non-
2729         SDK_VARIANT builds"
2730         https://bugs.webkit.org/show_bug.cgi?id=189553
2731         https://trac.webkit.org/changeset/240124
2732
2733 2019-01-17  Devin Rousso  <drousso@apple.com>
2734
2735         Web Inspector: fix Xcode project file list after r239976
2736         https://bugs.webkit.org/show_bug.cgi?id=193474
2737
2738         Reviewed by Timothy Hatcher.
2739
2740         * WebCore.xcodeproj/project.pbxproj:
2741
2742 2019-01-17  Ross Kirsling  <ross.kirsling@sony.com>
2743
2744         Unreviewed WinCairo fix -- hundreds of tests crash after r240031.
2745
2746         * platform/network/curl/ResourceHandleCurl.cpp:
2747         (WebCore::ResourceHandle::createCurlRequest):
2748         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2749         (WebCore::ResourceHandle::receivedCredential):
2750         (WebCore::ResourceHandle::getCredential):
2751
2752 2019-01-17  John Wilander  <wilander@apple.com>
2753
2754         Add infrastructure to enable/disable ITP Debug Mode through Preferences
2755         https://bugs.webkit.org/show_bug.cgi?id=193510
2756         <rdar://problem/47330969>
2757
2758         Reviewed by Dean Jackson.
2759
2760         No new tests. These changes are purely for settings/preferences.
2761
2762         * page/RuntimeEnabledFeatures.h:
2763         (WebCore::RuntimeEnabledFeatures::setItpDebugModeEnabled):
2764         (WebCore::RuntimeEnabledFeatures::itpDebugModeEnabled const):
2765         (WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode): Deleted.
2766         (WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const): Deleted.
2767             Renamed.
2768         * page/Settings.yaml:
2769             Removed since this particular setting should not be persisted for privacy
2770             reasons.
2771
2772 2019-01-17  Jer Noble  <jer.noble@apple.com>
2773
2774         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2775         https://bugs.webkit.org/show_bug.cgi?id=189553
2776
2777         Reviewed by Tim Horton.
2778
2779         * Configurations/Base.xcconfig:
2780         * Configurations/SDKVariant.xcconfig: Added.
2781         * Configurations/WebCore.xcconfig:
2782
2783 2019-01-17  Jer Noble  <jer.noble@apple.com>
2784
2785         MediaPlayerPrivateAVFoundationObjC can return incorrect paused information
2786         https://bugs.webkit.org/show_bug.cgi?id=193499
2787
2788         Reviewed by Eric Carlson.
2789
2790         MediaPlayerPrivateAVFoundation uses rate() as an indicator of whether the player
2791         is paused or not. This is incorrect when playback is stalled waiting for more data.
2792         For MPPAVFObjC, use the timeControlStatus as a more accurate indicator of whether
2793         the player is playing.
2794
2795         Now that we have correct play state information, we can remove the handlePlaybackCommand()
2796         path when playing remotely for a more direct approach of notifying the HTMLMediaElement
2797         that the play state has changed.
2798
2799         Drive-by fix: Before throwing away the AVPlayer, clear its output context. This keeps
2800         remote devices from keeping the AVPlayer alive.
2801
2802         Drive-by fix #2: The NullMediaPlayer should always return "true" for paused(), not "false",
2803         since it can't possibly play anything.
2804
2805         * platform/graphics/MediaPlayer.cpp:
2806         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2807         (WebCore::MediaPlayerPrivateAVFoundation::paused const):
2808         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2809         (WebCore::MediaPlayerPrivateAVFoundation::platformPaused const):
2810         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2811         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2812         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2813         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPaused const):
2814         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
2815
2816 2019-01-17  Jiewen Tan  <jiewen_tan@apple.com>
2817
2818         [Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable
2819         https://bugs.webkit.org/show_bug.cgi?id=193478
2820         <rdar://problem/34368591>
2821
2822         Reviewed by Brent Fulgham.
2823
2824         By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention
2825         as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This
2826         is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only
2827         website that assumes submit buttons are focusable, and will prohibit users from completing immigration
2828         forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to
2829         HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable.
2830
2831         This quirk is for ceac.state.gov specifically, and therefore no tests.
2832
2833         * html/HTMLFormControlElement.cpp:
2834         (WebCore::HTMLFormControlElement::isMouseFocusable const):
2835         (WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const):
2836         * html/HTMLFormControlElement.h:
2837
2838 2019-01-17  Alex Christensen  <achristensen@webkit.org>
2839
2840         Fix WinCairo build after r240117
2841         https://bugs.webkit.org/show_bug.cgi?id=193529
2842
2843         * PlatformWin.cmake:
2844         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2845
2846 2019-01-17  Youenn Fablet  <youenn@apple.com>
2847
2848         Add release logging for incoming and outgoing webrtc audio tracks
2849         https://bugs.webkit.org/show_bug.cgi?id=185545
2850
2851         Reviewed by Eric Carlson.
2852
2853         Add logging of audio tracks. When doing a WebRTC call,
2854         one log line is added each second for each audio track.
2855         Validated that logging is done through manual testing.
2856
2857         Refactored code to use LogHelper and apply it to video sources as well.
2858
2859         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2860         (WebCore::LibWebRTCMediaEndpoint::addTrack):
2861         (WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
2862         (WebCore::sourceFromNewReceiver): Deleted.
2863         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2864         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
2865         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
2866         (WebCore::RealtimeIncomingAudioSource::logChannel const):
2867         (WebCore::RealtimeIncomingAudioSource::logger const):
2868         * platform/mediastream/RealtimeIncomingAudioSource.h:
2869         (WebCore::RealtimeIncomingAudioSource::setLogger):
2870         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2871         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2872         (WebCore::RealtimeIncomingVideoSource::logChannel const):
2873         (WebCore::RealtimeIncomingVideoSource::logger const):
2874         * platform/mediastream/RealtimeIncomingVideoSource.h:
2875         (WebCore::RealtimeIncomingVideoSource::setLogger):
2876         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2877         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
2878         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
2879         (WebCore::RealtimeOutgoingAudioSource::logChannel const):
2880         (WebCore::RealtimeOutgoingAudioSource::logger const):
2881         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2882         (WebCore::RealtimeOutgoingAudioSource::setLogger):
2883         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2884         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
2885         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
2886         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
2887         (WebCore::RealtimeOutgoingVideoSource::logChannel const):
2888         (WebCore::RealtimeOutgoingVideoSource::logger const):
2889         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2890         (WebCore::RealtimeOutgoingVideoSource::setLogger):
2891         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
2892         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
2893         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h:
2894         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2895         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
2896         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
2897         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2898         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
2899         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2900         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
2901         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
2902         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
2903
2904 2019-01-17  Alex Christensen  <achristensen@webkit.org>
2905
2906         Stop using NetworkStorageSession::storageSession in WebCore
2907         https://bugs.webkit.org/show_bug.cgi?id=193529
2908
2909         Reviewed by Tim Horton.
2910
2911         Ownership of the map that NetworkStorageSession::storageSession searches needs to move to the WebKit/WebKitLegacy layer,
2912         so when WebCore used to look in this map it needs to call a client function to ask the layer above it for the storage object.
2913         I've called this client StorageSessionProvider::storageSession.  Right now it just looks in NetworkStorageSession::storageSession,
2914         but this added abstraction makes it possible to move the currently process-global map to be a member of the NetworkProcess object.
2915
2916         * Modules/websockets/WebSocketChannel.cpp:
2917         (WebCore::WebSocketChannel::connect):
2918         * WebCore.xcodeproj/project.pbxproj:
2919         * loader/CookieJar.cpp:
2920         (WebCore::CookieJar::create):
2921         (WebCore::CookieJar::CookieJar):
2922         (WebCore::CookieJar::cookies const):
2923         (WebCore::CookieJar::setCookies):
2924         (WebCore::CookieJar::cookiesEnabled const):
2925         (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
2926         (WebCore::CookieJar::getRawCookies const):
2927         (WebCore::CookieJar::deleteCookie):
2928         * loader/CookieJar.h:
2929         * loader/EmptyClients.cpp:
2930         (WebCore::pageConfigurationWithEmptyClients):
2931         * page/Page.h:
2932         * page/SocketProvider.cpp:
2933         (WebCore::SocketProvider::createSocketStreamHandle):
2934         * page/SocketProvider.h:
2935         * platform/network/NetworkingContext.h:
2936         * platform/network/SocketStreamHandleImpl.cpp:
2937         (WebCore::cookieDataForHandshake):
2938         (WebCore::SocketStreamHandleImpl::platformSendHandshake):
2939         * platform/network/StorageSessionProvider.h: Added.
2940         (WebCore::StorageSessionProvider::~StorageSessionProvider):
2941         * platform/network/cf/SocketStreamHandleImpl.h:
2942         (WebCore::SocketStreamHandleImpl::create):
2943         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2944         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
2945         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
2946         * platform/network/curl/SocketStreamHandleImpl.h:
2947         (WebCore::SocketStreamHandleImpl::create):
2948         * platform/network/soup/SocketStreamHandleImpl.h:
2949         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2950         (WebCore::SocketStreamHandleImpl::create):
2951
2952 2019-01-17  Jon Lee  <jonlee@apple.com>
2953
2954         [EME] Remove Amazon Prime Video from quirks list
2955         https://bugs.webkit.org/show_bug.cgi?id=193514
2956         rdar://problem/47295330
2957
2958         Reviewed by Jer Noble.
2959
2960         * page/Quirks.cpp:
2961         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
2962
2963 2019-01-17  Zalan Bujtas  <zalan@apple.com>
2964
2965         [LFC][BFC] An element with transform is a containing block for positioned descendants.
2966         https://bugs.webkit.org/show_bug.cgi?id=193534
2967
2968         Reviewed by Antti Koivisto.
2969
2970         "For elements whose layout is governed by the CSS box model, any value other than none for the transform
2971         property also causes the element to establish a containing block for all descendants."
2972         https://www.w3.org/TR/css-transforms-1/
2973
2974         * layout/layouttree/LayoutBox.cpp:
2975         (WebCore::Layout::Box::containingBlock const):
2976
2977 2019-01-17  Simon Fraser  <simon.fraser@apple.com>
2978
2979         ScrollingCoordinator: separate updating node geometry from node layers
2980         https://bugs.webkit.org/show_bug.cgi?id=193527
2981
2982         Reviewed by Antti Koivisto.
2983
2984         Updating scrolling tree node layers happens in a different code path from updating geometry;
2985         the former has to be post-flush, when GraphicsLayer has made tiled or structural layers.
2986         Geometry only needs to be updated after layout, and soon we'll do this via compositing updates.
2987         
2988         We can also clean up the ScrollingCoordinator API and have a single function that updates
2989         node layers (handling different node types), and separate functions for pushing viewport-constrained
2990         and scrolling node geometry.
2991
2992         No observable behavior change.
2993
2994         * page/scrolling/AsyncScrollingCoordinator.cpp:
2995         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
2996         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
2997         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry):
2998         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): Deleted.
2999         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Deleted.
3000         (WebCore::AsyncScrollingCoordinator::updateNodeLayer): Deleted.
3001         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
3002         * page/scrolling/AsyncScrollingCoordinator.h:
3003         * page/scrolling/ScrollingCoordinator.h:
3004         (WebCore::ScrollingCoordinator::setNodeLayers):
3005         (WebCore::ScrollingCoordinator::setScrollingNodeGeometry):
3006         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry):
3007         (WebCore::ScrollingCoordinator::updateNodeLayer): Deleted.
3008         (WebCore::ScrollingCoordinator::updateNodeViewportConstraints): Deleted.
3009         (WebCore::ScrollingCoordinator::updateFrameScrollingNode): Deleted.
3010         (WebCore::ScrollingCoordinator::updateOverflowScrollingNode): Deleted.
3011         * rendering/RenderLayerCompositor.cpp:
3012         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
3013         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3014         * rendering/RenderLayerCompositor.h:
3015
3016 2019-01-17  Zalan Bujtas  <zalan@apple.com>
3017
3018         [LFC][BFC][Quirk] Take body padding and border into account when stretching height.
3019         https://bugs.webkit.org/show_bug.cgi?id=193528
3020
3021         Reviewed by Antti Koivisto.
3022
3023         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3024         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
3025         * layout/displaytree/DisplayBox.h:
3026         (WebCore::Display::Box::verticalBorder const):
3027         (WebCore::Display::Box::horizontalBorder const):
3028         (WebCore::Display::Box::verticalPadding const):
3029         (WebCore::Display::Box::horizontalPadding const):
3030         * page/FrameViewLayoutContext.cpp:
3031         (WebCore::layoutUsingFormattingContext):
3032
3033 2019-01-17  Zalan Bujtas  <zalan@apple.com>
3034
3035         [LFC][BFC] For height computation, the bottom edge of the last line box value should not include top border/padding
3036         https://bugs.webkit.org/show_bug.cgi?id=193520
3037
3038         Reviewed by Antti Koivisto.
3039
3040         This is similar to the other "10.6.3" cases. The bottom edge of the last inline box is in the coordinate systyem
3041         of the containing block's border box (and for content height computation it needs to be mapped to the containing block's content box instead).
3042
3043         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3044         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3045
3046 2019-01-16  Simon Fraser  <simon.fraser@apple.com>
3047
3048         Stub out scrolling tree classes for overflow scrolling nodes on macOS
3049         https://bugs.webkit.org/show_bug.cgi?id=193524
3050
3051         Reviewed by Antti Koivisto.
3052
3053         Add an empty implementation of ScrollingTreeOverflowScrollingNodeMac for macOS. Change
3054         ScrollingTreeMac::createScrollingTreeNode() to create these nodes.
3055         
3056         Minor refactor of RenderLayerCompositor::useCoordinatedScrollingForLayer() code to ask
3057         the scrolling coordinator if it can coordinate scrolling for this layer; no behavior
3058         change for existing code paths.
3059
3060         * SourcesCocoa.txt:
3061         * WebCore.xcodeproj/project.pbxproj:
3062         * page/scrolling/ScrollingCoordinator.cpp:
3063         (WebCore::ScrollingCoordinator::coordinatesScrollingForOverflowLayer const):
3064         * page/scrolling/ScrollingCoordinator.h:
3065         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
3066         * page/scrolling/mac/ScrollingTreeMac.cpp:
3067         (ScrollingTreeMac::createScrollingTreeNode):
3068         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
3069         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: Added.
3070         (WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
3071         (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
3072         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac):
3073         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
3074         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
3075         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
3076         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
3077         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
3078         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll):
3079         * rendering/RenderLayer.cpp:
3080         (WebCore::RenderLayer::usesAsyncScrolling const):
3081         * rendering/RenderLayerCompositor.cpp:
3082         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
3083         * rendering/RenderLayerCompositor.h:
3084
3085 2019-01-16  Justin Fan  <justin_fan@apple.com>
3086
3087         [WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
3088         https://bugs.webkit.org/show_bug.cgi?id=193473
3089
3090         Reviewed by Dean Jackson and Myles Maxfield.
3091
3092         Also, switch to using the inputSlot instead of the shaderLocation field, as this seems more correct. 
3093         As of now I cannot determine an analog for WebGPU's shaderLocation in Metal. 
3094
3095         Test: Covered by vertex-buffer-triangle-strip.html. No change in behavior.
3096
3097         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3098         (WebCore::setInputStateForPipelineDescriptor): Use the inputSlot instead of shaderLocation as bufferIndex. 
3099
3100 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
3101
3102         [WHLSL] Add the function stage checker
3103         https://bugs.webkit.org/show_bug.cgi?id=193479
3104
3105         Reviewed by Dean Jackson and Robin Morisset.
3106
3107         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/CheckNativeFuncStages.mjs into C++.
3108
3109         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
3110         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
3111
3112         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
3113         (WebCore::WHLSL::AST::CallExpression::function):
3114         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp: Added.
3115         (WebCore::WHLSL::FunctionStageChecker::FunctionStageChecker):
3116         (WebCore::WHLSL::checkFunctionStages):
3117         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h: Added.
3118         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
3119         (WebCore::WHLSL::Intrinsics::add):
3120         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
3121         (WebCore::WHLSL::Intrinsics::ddx const):
3122         (WebCore::WHLSL::Intrinsics::ddy const):
3123         (WebCore::WHLSL::Intrinsics::allMemoryBarrier const):
3124         (WebCore::WHLSL::Intrinsics::deviceMemoryBarrier const):
3125         (WebCore::WHLSL::Intrinsics::groupMemoryBarrier const):
3126         (WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
3127         * Sources.txt:
3128         * WebCore.xcodeproj/project.pbxproj:
3129
3130 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
3131
3132         [WHLSL] Delete the 'restricted' keyword
3133         https://bugs.webkit.org/show_bug.cgi?id=193469
3134
3135         Reviewed by Dean Jackson and Robin Morisset.
3136
3137         This change mirrors https://github.com/gpuweb/WHLSL/pull/304 in the reference implementation.
3138
3139         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
3140         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
3141
3142         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
3143         (WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
3144         (WebCore::WHLSL::AST::FunctionDefinition::block):
3145         (WebCore::WHLSL::AST::FunctionDefinition::restricted const): Deleted.
3146         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
3147         (WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
3148         (WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const): Deleted.
3149         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3150         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
3151         (WebCore::WHLSL::resolveWithOperatorLength):
3152         (WebCore::WHLSL::resolveWithReferenceComparator):
3153         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
3154         (WebCore::WHLSL::resolveFunctionOverloadImpl):
3155         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
3156         (WebCore::WHLSL::synthesizeArrayOperatorLength):
3157         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
3158         (WebCore::WHLSL::synthesizeConstructors):
3159         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
3160         (WebCore::WHLSL::synthesizeEnumerationFunctions):
3161         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
3162         (WebCore::WHLSL::synthesizeStructureAccessors):
3163
3164 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
3165
3166         [WHLSL] Implement the recursion checker
3167         https://bugs.webkit.org/show_bug.cgi?id=193436
3168
3169         Reviewed by Saam Barati.
3170
3171         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/RecursionChecker.mjs into C++.
3172
3173         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
3174         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
3175
3176         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
3177         (WebCore::WHLSL::AST::CallExpression::function):
3178         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp.
3179         (WebCore::WHLSL::checkRecursion):
3180         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h: Added.
3181         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
3182         * Sources.txt:
3183         * WebCore.xcodeproj/project.pbxproj:
3184
3185 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
3186
3187         [WHLSL] Add the literal type checker
3188         https://bugs.webkit.org/show_bug.cgi?id=193430
3189
3190         Reviewed by Dean Jackson.
3191
3192         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LiteralTypeChecker.mjs into C++.
3193
3194         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
3195         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
3196
3197         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
3198         (WebCore::WHLSL::AST::FloatLiteralType::value const):
3199         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
3200         (WebCore::WHLSL::AST::IntegerLiteralType::value const):
3201         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
3202         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const):
3203         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: Added.
3204         (WebCore::WHLSL::getNativeTypeDeclaration):
3205         (WebCore::WHLSL::LiteralTypeChecker::visit):
3206         (WebCore::WHLSL::checkLiteralTypes):
3207         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
3208         * Sources.txt:
3209         * WebCore.xcodeproj/project.pbxproj:
3210
3211 2019-01-16  Zalan Bujtas  <zalan@apple.com>
3212
3213         [LFC][BFC] Inflow non-replaced used width should not be negative.
3214         https://bugs.webkit.org/show_bug.cgi?id=193495
3215
3216         Reviewed by Antti Koivisto.
3217
3218         min-width (initial value 0) enforces non-negative used width. 
3219
3220         * layout/blockformatting/BlockFormattingContext.cpp:
3221         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3222
3223 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
3224
3225         [WHLSL] Add a handwritten parser
3226         https://bugs.webkit.org/show_bug.cgi?id=192355
3227
3228         Reviewed by Dean Jackson.
3229
3230         The parser is a mechanical representation of WHLSL's ANTLR grammar at
3231         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4. The parser
3232         uses Expected<> to return an appropriate Error string when parsing fails.
3233
3234         This patch doesn't include the AST nodes themselves - those are in
3235         https://bugs.webkit.org/show_bug.cgi?id=192991. I split up the patch to
3236         aid easier reviewing.
3237
3238         No new tests because the parser isn't hooked up yet.
3239
3240         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3241         (WebCore::WHLSL::Parser::Parser):
3242         (WebCore::WHLSL::Parser::parse):
3243         (WebCore::WHLSL::Parser::fail):
3244         (WebCore::WHLSL::Parser::peek):
3245         (WebCore::WHLSL::Parser::tryType):
3246         (WebCore::WHLSL::Parser::tryTypes):
3247         (WebCore::WHLSL::Parser::consumeType):
3248         (WebCore::WHLSL::Parser::consumeTypes):
3249         (WebCore::WHLSL::digitValue):
3250         (WebCore::WHLSL::intLiteralToInt):
3251         (WebCore::WHLSL::uintLiteralToUint):
3252         (WebCore::WHLSL::floatLiteralToFloat):
3253         (WebCore::WHLSL::Parser::consumeIntegralLiteral):
3254         (WebCore::WHLSL::Parser::consumeNonNegativeIntegralLiteral):
3255         (WebCore::WHLSL::recognizeSimpleUnsignedInteger):
3256         (WebCore::WHLSL::Parser::parseConstantExpression):
3257         (WebCore::WHLSL::Parser::parseTypeArgument):
3258         (WebCore::WHLSL::Parser::parseTypeArguments):
3259         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
3260         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
3261         (WebCore::WHLSL::Parser::parseAddressSpaceType):
3262         (WebCore::WHLSL::Parser::parseNonAddressSpaceType):
3263         (WebCore::WHLSL::Parser::parseType):
3264         (WebCore::WHLSL::Parser::parseTypeDefinition):
3265         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
3266         (WebCore::WHLSL::Parser::parseResourceSemantic):
3267         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
3268         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
3269         (WebCore::WHLSL::Parser::parseSemantic):
3270         (WebCore::WHLSL::Parser::parseQualifiers):
3271         (WebCore::WHLSL::Parser::parseStructureElement):
3272         (WebCore::WHLSL::Parser::parseStructureDefinition):
3273         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
3274         (WebCore::WHLSL::Parser::parseEnumerationMember):
3275         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
3276         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
3277         (WebCore::WHLSL::Parser::parseAttributeBlock):
3278         (WebCore::WHLSL::Parser::parseParameter):
3279         (WebCore::WHLSL::Parser::parseParameters):
3280         (WebCore::WHLSL::Parser::parseFunctionDefinition):
3281         (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration):
3282         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
3283         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
3284         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
3285         (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration):
3286         (WebCore::WHLSL::Parser::parseBlock):
3287         (WebCore::WHLSL::Parser::parseBlockBody):
3288         (WebCore::WHLSL::Parser::parseIfStatement):
3289         (WebCore::WHLSL::Parser::parseSwitchStatement):
3290         (WebCore::WHLSL::Parser::parseSwitchCase):
3291         (WebCore::WHLSL::Parser::parseForLoop):
3292         (WebCore::WHLSL::Parser::parseWhileLoop):
3293         (WebCore::WHLSL::Parser::parseDoWhileLoop):
3294         (WebCore::WHLSL::Parser::parseVariableDeclaration):
3295         (WebCore::WHLSL::Parser::parseVariableDeclarations):
3296         (WebCore::WHLSL::Parser::parseStatement):
3297         (WebCore::WHLSL::Parser::parseEffectfulExpression):
3298         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
3299         (WebCore::WHLSL::Parser::parseEffectfulPrefix):
3300         (WebCore::WHLSL::Parser::parseEffectfulSuffix):
3301         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
3302         (WebCore::WHLSL::Parser::parseSuffixOperator):
3303         (WebCore::WHLSL::Parser::parseExpression):
3304         (WebCore::WHLSL::Parser::parseTernaryConditional):
3305         (WebCore::WHLSL::Parser::parseAssignment):
3306         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
3307         (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
3308         (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
3309         (WebCore::WHLSL::Parser::parsePossibleShift):
3310         (WebCore::WHLSL::Parser::parsePossibleAdd):
3311         (WebCore::WHLSL::Parser::parsePossibleMultiply):
3312         (WebCore::WHLSL::Parser::parsePossiblePrefix):
3313         (WebCore::WHLSL::Parser::parsePossibleSuffix):
3314         (WebCore::WHLSL::Parser::parseCallExpression):
3315         (WebCore::WHLSL::Parser::parseTerm):
3316         * Modules/webgpu/WHLSL/WHLSLParser.h:
3317         (WebCore::WHLSL::Parser::Error::Error):
3318         (WebCore::WHLSL::Parser::backtrackingScope):
3319         (WebCore::WHLSL::Parser::SuffixExpression::SuffixExpression):
3320         (WebCore::WHLSL::Parser::SuffixExpression::operator bool const):
3321
3322 2019-01-16  Sihui Liu  <sihui_liu@apple.com>
3323
3324         IndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not empty.
3325         https://bugs.webkit.org/show_bug.cgi?id=193093
3326
3327         Reviewed by Brady Eidson.
3328
3329         performUnconditionalDeleteBackingStore killed the database task queue immediately, but performPrefetchCursor
3330         task may be scheduled behind performUnconditionalDeleteBackingStore on database thread.
3331
3332         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3333         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
3334         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
3335         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
3336
3337 2019-01-16  Alex Christensen  <achristensen@webkit.org>
3338
3339         Internal build fix.
3340
3341         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3342         (WebCore::layerContentsFormat):
3343
3344 2019-01-16  Youenn Fablet  <youenn@apple.com>
3345
3346         ServiceWorkerContainer is leaking due to a ref cycle
3347         https://bugs.webkit.org/show_bug.cgi?id=193462
3348         <rdar://problem/47026303>
3349
3350         Reviewed by Brady Eidson.
3351
3352         ServiceWorkerContainer keeps a reference to its ready promise.
3353         The ready promise keeps a ref to its value which is a ServiceWorkerRegistration.
3354         ServiceWorkerRegistration keeps a ref to ServiceWorkerContainer.
3355
3356         To break the reference cycle, set the ready promise to zero when ServiceWorkerContainer is stopped.
3357
3358         Covered by imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html no longer leaking.
3359
3360         * workers/service/ServiceWorkerContainer.cpp:
3361         (WebCore::ServiceWorkerContainer::stop):
3362
3363 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
3364
3365         Make didCommitChangesForLayer() explicitly about the platform layer changing because of tile/non-tile swapping
3366         https://bugs.webkit.org/show_bug.cgi?id=193290
3367
3368         Reviewed by Tim Horton.
3369
3370         RenderLayerCompositor::didFlushChangesForLayer() triggers updates scrolling tree nodes for
3371         the flushed layer, but it's not clear what has changed at this point.
3372
3373         didCommitChangesForLayer()/didFlushChangesForLayer() were added to explicitly handle the
3374         case where the underlying platform layer for a GraphicsLayer changes because the layer swaps
3375         between tiled and non-tiled, and structural layer changes; we need to push the new layer to
3376         the scrolling tree because it operates on platform layers. So the only work that
3377         didFlushChangesForLayer() should do is to update layers on scrolling tree nodes; it doesn't
3378         need to do any geometry updating. Move towards that goal by renaming this callback to
3379         didChangePlatformLayerForLayer() to make its function more explicit.
3380
3381         * platform/graphics/GraphicsLayerClient.h:
3382         (WebCore::GraphicsLayerClient::didChangePlatformLayerForLayer):
3383         (WebCore::GraphicsLayerClient::didCommitChangesForLayer const): Deleted.
3384         * platform/graphics/ca/GraphicsLayerCA.cpp:
3385         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
3386         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3387         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3388         * platform/graphics/ca/GraphicsLayerCA.h:
3389         * rendering/RenderLayerBacking.cpp:
3390         (WebCore::RenderLayerBacking::didChangePlatformLayerForLayer):
3391         (WebCore::RenderLayerBacking::didCommitChangesForLayer const): Deleted.
3392         * rendering/RenderLayerBacking.h:
3393         * rendering/RenderLayerCompositor.cpp:
3394         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
3395         (WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer):
3396         (WebCore::RenderLayerCompositor::didFlushChangesForLayer): Deleted.
3397         (WebCore::RenderLayerCompositor::didCommitChangesForLayer const): Deleted.
3398         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer): Deleted.
3399         * rendering/RenderLayerCompositor.h:
3400
3401 2019-01-16  Chris Dumez  <cdumez@apple.com>
3402
3403         Regression(PSON) View becomes blank after click a cross-site download link
3404         https://bugs.webkit.org/show_bug.cgi?id=193361
3405         <rdar://problem/47099573>
3406
3407         Reviewed by Geoffrey Garen.
3408
3409         * loader/FrameLoader.cpp:
3410         (WebCore::FrameLoader::commitProvisionalLoad):
3411         When restoring from PageCache, make sure we notify the client that the load was committed
3412         *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
3413         logic in the UIProcess.
3414
3415 2019-01-16  Devin Rousso  <drousso@apple.com>
3416
3417         Web Inspector: extend overlay element bounds lines to the right/below as well
3418         https://bugs.webkit.org/show_bug.cgi?id=193336
3419
3420         Reviewed by Matt Baker.
3421
3422         This patch is purely a visual change for WebInspector, and doesn't affect anything else.
3423
3424         * inspector/InspectorOverlayPage.js:
3425         (_drawBounds):
3426
3427 2019-01-16  Youenn Fablet  <youenn@apple.com>
3428
3429         Prevent WorkerRunLoop::runInMode from spinning in nested cases
3430         https://bugs.webkit.org/show_bug.cgi?id=193359
3431         <rdar://problem/46345353>
3432
3433         Reviewed by Joseph Pecoraro.
3434
3435         Speculative fix for some cases where service worker is spinning and consuming a lot of CPU.
3436         The hypothesis is that:
3437         - Service Worker is checking for its script freshness through WorkerScriptLoader.
3438         This triggers the worker run loop to be nested.
3439         - The run loop timer is active and needs to fire immediately.
3440         The hypothesis is that this happens in some cases like restarting a device after sleep mode.
3441
3442         WorkerRunLoop::runInMode will then compute a 0 timeout value for getting a message.
3443         This will trigger a timeout while waiting for the message queue.
3444         Since the run loop is nested,  the run loop timer will not be able to fire,
3445         and it will keep ask to fire immediately.
3446         runInMode will return timeout as a result and WorkerRunLoop::run will call it immediately.
3447
3448         The fix is to prevent the shared timer to fire only when the run loop is being debugged through the web inspector.
3449         We compute this by checking the run loop mode as debuggerMode().
3450         Did some refactoring by introducing helper routines for running the loop and posting task in debugger mode.
3451
3452         * inspector/WorkerScriptDebugServer.cpp:
3453         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
3454         * workers/WorkerInspectorProxy.cpp:
3455         (WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
3456         (WebCore::WorkerInspectorProxy::connectToWorkerInspectorController):
3457         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
3458         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspectorController):
3459         * workers/WorkerRunLoop.cpp:
3460         (WebCore::ModePredicate::ModePredicate):
3461         (WebCore::WorkerRunLoop::WorkerRunLoop):
3462         (WebCore::debuggerMode):
3463         (WebCore::RunLoopSetup::RunLoopSetup):
3464         (WebCore::RunLoopSetup::~RunLoopSetup):
3465         (WebCore::WorkerRunLoop::run):
3466         (WebCore::WorkerRunLoop::runInDebuggerMode):
3467         (WebCore::WorkerRunLoop::runInMode):
3468         (WebCore::WorkerRunLoop::Task::performTask):
3469         * workers/WorkerRunLoop.h:
3470         (WebCore::WorkerRunLoop::isBeingDebugged const):
3471         * workers/WorkerThread.cpp:
3472         (WebCore::WorkerThread::startRunningDebuggerTasks):
3473         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
3474         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
3475         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
3476         (WebCore::ServiceWorkerInspectorProxy::sendMessageToWorker):
3477
3478 2019-01-16  Sihui Liu  <sihui_liu@apple.com>
3479
3480         IndexedDB: leak WebIDBConnectionToClient for retain cycle
3481         https://bugs.webkit.org/show_bug.cgi?id=193097
3482         <rdar://problem/46899601>
3483
3484         Reviewed by David Kilzer.
3485
3486         Fix API test failure after r239887. After removing the retain cycle, IDBConnectionToClient will no longer live 
3487         forever so make sure it is not destructed before UniqueIDBDatabaseConnection unregisters itself.
3488
3489         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3490         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
3491         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
3492         (WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent):
3493         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
3494         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
3495         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateObjectStore):
3496         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore):
3497         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
3498         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore):
3499         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex):
3500         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex):
3501         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
3502         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
3503
3504 2019-01-16  Antti Koivisto  <antti@apple.com>
3505
3506         Add more assertions to find root cause for release assert hit in StyleResolver
3507         https://bugs.webkit.org/show_bug.cgi?id=193488
3508         <rdar://problem/30983040>
3509
3510         Reviewed by Zalan Bujtas.
3511
3512         * css/StyleResolver.cpp:
3513         (WebCore::StyleResolver::~StyleResolver):
3514
3515         Release assert we are not resolving tree style.
3516
3517         * dom/Document.cpp:
3518         (WebCore::Document::setIsResolvingTreeStyle):
3519         * dom/Document.h:
3520         (WebCore::Document::isResolvingTreeStyle const):
3521         * style/StyleTreeResolver.cpp:
3522         (WebCore::Style::TreeResolver::Scope::Scope):
3523         (WebCore::Style::TreeResolver::Scope::~Scope):
3524
3525         Set isResolvingTreeStyle bit when we have a tree resolver scope.
3526
3527 2019-01-16  Zalan Bujtas  <zalan@apple.com>
3528
3529         [LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
3530         https://bugs.webkit.org/show_bug.cgi?id=193470
3531
3532         Reviewed by Antti Koivisto.
3533
3534         Non-auto vertical margin values (which is mostly the case) should be set as used values.
3535
3536         Test: fast/block/block-only/non-auto-top-bottom-height-with-margins.html
3537
3538         * layout/FormattingContextGeometry.cpp:
3539         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3540
3541 2019-01-16  Alan Kinsley  <zalan@apple.com>
3542
3543         [LFC] Adjust margin box verification.
3544         https://bugs.webkit.org/show_bug.cgi?id=193482
3545
3546         Reviewed by Antti Koivisto.
3547
3548         In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
3549         so let's check the individual margin values instead (and at this point we know that all other boxes match).
3550
3551         Test: fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html
3552
3553         * layout/Verification.cpp:
3554         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3555
3556 2019-01-16  Zan Dobersek  <zdobersek@igalia.com>
3557
3558         [FreeType] Cache the zero-width space glyph in GlyphPage::fill()
3559         https://bugs.webkit.org/show_bug.cgi?id=193485
3560
3561         Reviewed by Carlos Garcia Campos.
3562
3563         In FreeType's implementation of GlyphPage::fill(), we can cache the
3564         zero-width space glyph upon first retrieval through the
3565         FcFreeTypeCharIndex() entrypoint, avoiding any subsequent calls
3566         for other ignorable characters.
3567
3568         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
3569         (WebCore::GlyphPage::fill):
3570
3571 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
3572
3573         [WHLSL] Add the high zombie finder
3574         https://bugs.webkit.org/show_bug.cgi?id=193432
3575
3576         Reviewed by Robin Morisset and Saam Barati.
3577
3578         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/HighZombieFinder.mjs into C++.
3579
3580         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
3581         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
3582
3583         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: Added.
3584         (WebCore::WHLSL::findHighZombies):
3585         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: Added.
3586         * Sources.txt:
3587         * WebCore.xcodeproj/project.pbxproj:
3588
3589 2019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
3590
3591         Unreviewed WinCairo build fix.
3592
3593         * platform/network/curl/ResourceHandleCurl.cpp:
3594         (WebCore::ResourceHandle::createCurlRequest):
3595         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3596         (WebCore::ResourceHandle::receivedCredential):
3597         (WebCore::ResourceHandle::getCredential):
3598
3599 2019-01-15  Alex Christensen  <achristensen@webkit.org>
3600
3601         Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
3602         https://bugs.webkit.org/show_bug.cgi?id=193368
3603
3604         Reviewed by Geoff Garen.
3605
3606         The NetworkStorageSession ownership needs to move to the WebKit/WebKitLegacy layer instead of being a process-global static map.
3607
3608         * loader/EmptyClients.cpp:
3609         * platform/network/CredentialStorage.cpp:
3610         (WebCore::CredentialStorage::defaultCredentialStorage): Deleted.
3611         * platform/network/CredentialStorage.h:
3612         * platform/network/NetworkStorageSession.h:
3613         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3614         (WebCore::NetworkStorageSession::switchToNewTestingSession):
3615         (WebCore::NetworkStorageSession::ensureSession):
3616         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
3617         (WebCore::createPrivateStorageSession):
3618         * platform/network/curl/ResourceHandleCurl.cpp:
3619         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3620         (WebCore::ResourceHandle::receivedCredential):
3621         (WebCore::ResourceHandle::getCredential):
3622
3623 2019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
3624
3625         VisualViewport API should be updated upon opening of keyboard
3626         https://bugs.webkit.org/show_bug.cgi?id=193475
3627
3628         Reviewed by Simon Fraser.
3629
3630         Added a function to update the visual viewport API and schedule a resize event to FrameView.
3631
3632         Test: fast/visual-viewport/ios/resize-event-for-keyboard.html
3633
3634         * page/FrameView.cpp:
3635         (WebCore::FrameView::didUpdateViewportOverrideRects):
3636         * page/FrameView.h:
3637
3638 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
3639
3640         Fix build after r240018
3641         https://bugs.webkit.org/show_bug.cgi?id=193434
3642
3643         Unreviewed.
3644
3645         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
3646         (WebCore::WHLSL::checkLoops):
3647         (WebCore::WHLSL::findHighZombies): Deleted.
3648         * Modules/webgpu/WHLSL/WHLSLLoopChecker.h:
3649
3650 2019-01-15  Megan Gardner  <megan_gardner@apple.com>
3651
3652         Add Reveal support in iOSMac
3653         https://bugs.webkit.org/show_bug.cgi?id=193408
3654         <rdar://problem/47300699>
3655
3656         Reviewed by Tim Horton.
3657
3658         iOSMac and Reveal are currently not testable.
3659
3660         Add support for the reveal SPI specifically for iOSMac.
3661         Show the controller when called, and implement the delegate to 
3662         correctly re-paint the content with the auto-generated highlight from
3663         the reveal framework.
3664
3665         * Configurations/WebCore.xcconfig:
3666         * editing/cocoa/DictionaryLookup.mm:
3667         (-[WebRevealHighlight initWithHighlightRect:view:]):
3668         (-[WebRevealHighlight setImage:]):
3669         (-[WebRevealHighlight highlightRectsForItem:]):
3670         (-[WebRevealHighlight startHighlightingItem:]):
3671         (-[WebRevealHighlight highlightItem:withProgress:]):
3672         (-[WebRevealHighlight completeHighlightingItem:]):
3673         (-[WebRevealHighlight stopHighlightingItem:]):
3674         (-[WebRevealHighlight highlightRangeChangedForItem:]):
3675         (-[WebRevealHighlight highlighting]):
3676         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
3677         (WebCore::showPopupOrCreateAnimationController):
3678         (WebCore::DictionaryLookup::showPopup):
3679         * editing/mac/DictionaryLookup.h:
3680
3681 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
3682
3683         [WHLSL] Add ending namespace comments to make namespace boundaries more clear
3684         https://bugs.webkit.org/show_bug.cgi?id=193471
3685
3686         Reviewed by Saam Barati.
3687
3688         This patch only adds the comments to the files that are too long to fit on a single screen in my editor.
3689
3690         No new tests because there is no behavior change.
3691
3692         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
3693         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3694         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
3695         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
3696         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
3697         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
3698         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
3699         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
3700         * Modules/webgpu/WHLSL/WHLSLLexer.h:
3701         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
3702         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
3703         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
3704         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
3705         * Modules/webgpu/WHLSL/WHLSLParser.h:
3706         * Modules/webgpu/WHLSL/WHLSLProgram.h:
3707         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
3708         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
3709         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
3710         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
3711         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
3712         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
3713         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
3714         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
3715
3716 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
3717
3718         [WHLSL] Implement the loop checker
3719         https://bugs.webkit.org/show_bug.cgi?id=193434
3720
3721         Reviewed by Saam Barati.
3722
3723         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LoopChecker.mjs into C++.
3724
3725         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
3726         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
3727
3728         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Added.
3729         (WebCore::WHLSL::findHighZombies):
3730         * Modules/webgpu/WHLSL/WHLSLLoopChecker.h: Added.
3731         * Sources.txt:
3732         * WebCore.xcodeproj/project.pbxproj:
3733
3734 2019-01-15  Chris Dumez  <cdumez@apple.com>
3735
3736         Unreviewed, rolling out r239993, r239995, r239997, and
3737         r239999.
3738
3739         Caused assertions under
3740         ViewGestureController::disconnectFromProcess()
3741
3742         Reverted changesets:
3743
3744         "Regression(PSON) View becomes blank after click a cross-site
3745         download link"
3746         https://bugs.webkit.org/show_bug.cgi?id=193361
3747         https://trac.webkit.org/changeset/239993
3748
3749         "Unreviewed iOS build fix after r239993."
3750         https://trac.webkit.org/changeset/239995
3751
3752         "Fix iOS build after r239993"
3753         https://bugs.webkit.org/show_bug.cgi?id=193361
3754         https://trac.webkit.org/changeset/239997
3755
3756         "Unreviewed, revert part of r239997 as it is not needed to fix
3757         the build."
3758         https://trac.webkit.org/changeset/239999
3759
3760 2019-01-15  Alex Christensen  <achristensen@webkit.org>
3761
3762         Stop using CookiesStrategy
3763         https://bugs.webkit.org/show_bug.cgi?id=161106
3764
3765         Reviewed by Don Olmstead and Antti Koivisto.
3766
3767         CookiesStrategy is process-global and makes it difficult to switch NetworkStorageSession from having a process-global map.
3768         Instead, use a CookieJar object in the WebProcess.  This has the additional benefit of making it more clear which code
3769         is used in the WebProcess and which code is used in the NetworkProcess.
3770
3771         * Modules/beacon/NavigatorBeacon.cpp:
3772         * Modules/websockets/WebSocketChannel.cpp:
3773         (WebCore::WebSocketChannel::processBuffer):
3774         * Modules/websockets/WebSocketHandshake.cpp:
3775         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
3776         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
3777         * WebCore.xcodeproj/project.pbxproj:
3778         * css/StyleRuleImport.cpp:
3779         (WebCore::StyleRuleImport::requestStyleSheet):
3780         * dom/Document.cpp:
3781         (WebCore::Document::cookie):
3782         (WebCore::Document::setCookie):
3783         * html/HTMLMediaElement.cpp:
3784         (WebCore::HTMLMediaElement::mediaPlayerGetRawCookies const):
3785         * inspector/agents/InspectorPageAgent.cpp:
3786         (WebCore::InspectorPageAgent::getCookies):
3787         (WebCore::InspectorPageAgent::deleteCookie):
3788         * loader/CookieJar.cpp:
3789         (WebCore::CookieJar::shouldIncludeSecureCookies):
3790         (WebCore::CookieJar::sameSiteInfo):
3791         (WebCore::CookieJar::create):
3792         (WebCore::CookieJar::cookies const):
3793         (WebCore::CookieJar::cookieRequestHeaderFieldProxy):
3794         (WebCore::CookieJar::setCookies):
3795         (WebCore::CookieJar::cookiesEnabled const):
3796         (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
3797         (WebCore::CookieJar::getRawCookies const):
3798         (WebCore::CookieJar::deleteCookie):
3799         (WebCore::shouldIncludeSecureCookies): Deleted.
3800         (WebCore::sameSiteInfo): Deleted.
3801         (WebCore::cookies): Deleted.
3802         (WebCore::cookieRequestHeaderFieldProxy): Deleted.
3803         (WebCore::setCookies): Deleted.
3804         (WebCore::cookiesEnabled): Deleted.
3805         (WebCore::cookieRequestHeaderFieldValue): Deleted.
3806         (WebCore::getRawCookies): Deleted.
3807         (WebCore::deleteCookie): Deleted.
3808         * loader/CookieJar.h:
3809         * loader/EmptyClients.cpp:
3810         (WebCore::pageConfigurationWithEmptyClients):
3811         * loader/ImageLoader.cpp:
3812         (WebCore::ImageLoader::updateFromElement):
3813         * loader/cache/CachedApplicationManifest.cpp:
3814         (WebCore::CachedApplicationManifest::CachedApplicationManifest):
3815         * loader/cache/CachedApplicationManifest.h:
3816         * loader/cache/CachedCSSStyleSheet.cpp:
3817         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
3818         * loader/cache/CachedCSSStyleSheet.h:
3819         * loader/cache/CachedFont.cpp:
3820         (WebCore::CachedFont::CachedFont):
3821         * loader/cache/CachedFont.h:
3822         * loader/cache/CachedImage.cpp:
3823         (WebCore::CachedImage::CachedImage):
3824         * loader/cache/CachedImage.h:
3825         * loader/cache/CachedRawResource.cpp:
3826         (WebCore::CachedRawResource::CachedRawResource):
3827         * loader/cache/CachedRawResource.h:
3828         * loader/cache/CachedResource.cpp:
3829         (WebCore::CachedResource::CachedResource):
3830         (WebCore::CachedResource::setResponse):
3831         (WebCore::CachedResource::varyHeaderValuesMatch):
3832         * loader/cache/CachedResource.h:
3833         (WebCore::CachedResource::cookieJar const):
3834         * loader/cache/CachedResourceLoader.cpp:
3835         (WebCore::createResource):
3836         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3837         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
3838         (WebCore::CachedResourceLoader::requestResource):
3839         (WebCore::CachedResourceLoader::revalidateResource):
3840         (WebCore::CachedResourceLoader::loadResource):
3841         * loader/cache/CachedResourceLoader.h:
3842         * loader/cache/CachedSVGDocument.cpp:
3843         (WebCore::CachedSVGDocument::CachedSVGDocument):
3844         * loader/cache/CachedSVGDocument.h:
3845         * loader/cache/CachedSVGFont.cpp:
3846         (WebCore::CachedSVGFont::CachedSVGFont):
3847         * loader/cache/CachedSVGFont.h:
3848         * loader/cache/CachedScript.cpp:
3849         (WebCore::CachedScript::CachedScript):
3850         * loader/cache/CachedScript.h:
3851         * loader/cache/CachedTextTrack.cpp:
3852         (WebCore::CachedTextTrack::CachedTextTrack):
3853         * loader/cache/CachedTextTrack.h:
3854         * loader/cache/CachedXSLStyleSheet.cpp:
3855         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
3856         * loader/cache/CachedXSLStyleSheet.h:
3857         * loader/cache/MemoryCache.cpp:
3858         (WebCore::MemoryCache::addImageToCache):
3859         * loader/cache/MemoryCache.h:
3860         * page/Navigator.cpp:
3861         (WebCore::Navigator::cookieEnabled const):
3862         * page/Page.cpp:
3863         (WebCore::Page::Page):
3864         * page/Page.h:
3865         (WebCore::Page::cookieJar):
3866         * page/PageConfiguration.cpp:
3867         (WebCore::PageConfiguration::PageConfiguration):
3868         * page/PageConfiguration.h:
3869         * platform/CookiesStrategy.h: Removed.
3870         * platform/PlatformStrategies.h:
3871         (WebCore::PlatformStrategies::cookiesStrategy): Deleted.
3872         * platform/network/CacheValidation.cpp:
3873         (WebCore::cookieRequestHeaderFieldValue):
3874         (WebCore::collectVaryingRequestHeaders):
3875         (WebCore::verifyVaryingRequestHeaders):
3876         * platform/network/CacheValidation.h:
3877         * platform/network/CookieRequestHeaderFieldProxy.h:
3878         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
3879         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3880         * platform/network/curl/ResourceHandleCurl.cpp:
3881         * rendering/RenderSnapshottedPlugIn.cpp:
3882         (WebCore::RenderSnapshottedPlugIn::updateSnapshot):
3883         * testing/Internals.cpp:
3884         (WebCore::Internals::getCookies const):
3885
3886 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
3887
3888         Animations should only trigger layer recomposite when necessary
3889         https://bugs.webkit.org/show_bug.cgi?id=193450
3890
3891         Reviewed by Antoine Quint.
3892
3893         Animations only need to trigger compositing updates when their states change in a way
3894         that affects compositing. RenderLayerCompositor::requiresCompositingForAnimation() checks for
3895         running animations of properties that can be accelerated, so this patch fixes the legacy
3896         animation logic to only set 'shouldRecompositeLayer' in TreeResolver::createAnimatedElementUpdate()
3897         when the running state of such an animation changes.
3898
3899         ImplicitAnimation::animate() and KeyframeAnimation::animate() now return OptionSet<AnimateChange>.
3900         This contains information about whether the running state changed, so CompositeAnimation::animate()
3901         asks about whether the running state of an accelerated property changed, and returns this in
3902         the AnimationUpdate result.
3903
3904         * page/animation/AnimationBase.h:
3905         (WebCore::AnimationBase::isPausedState):
3906         (WebCore::AnimationBase::isRunningState):
3907         (WebCore::AnimationBase::inPausedState const):
3908         (WebCore::AnimationBase::inRunningState const):
3909         (WebCore::AnimationBase::isAnimatingProperty const):
3910         * page/animation/CSSAnimationController.h:
3911         * page/animation/CompositeAnimation.cpp:
3912         (WebCore::CompositeAnimation::animate):
3913         * page/animation/ImplicitAnimation.cpp:
3914         (WebCore::ImplicitAnimation::animate):
3915         (WebCore::ImplicitAnimation::affectsAcceleratedProperty const):
3916         * page/animation/ImplicitAnimation.h:
3917         * page/animation/KeyframeAnimation.cpp:
3918         (WebCore::KeyframeAnimation::KeyframeAnimation):
3919         (WebCore::KeyframeAnimation::animate):
3920         (WebCore::KeyframeAnimation::computeStackingContextImpact): Deleted.
3921         * page/animation/KeyframeAnimation.h:
3922         * style/StyleTreeResolver.cpp:
3923         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
3924
3925 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
3926
3927         Clean up code related to the updating of Dashboard and touch event regions
3928         https://bugs.webkit.org/show_bug.cgi?id=193460
3929
3930         Reviewed by Zalan Bujtas.
3931
3932         In preparation for layout testing that can count the number of event region
3933         updates, move the code related to updating "annotated" (Dashboard) regions, and
3934         touch event regions into bottleneck functions in Document.
3935         
3936         Updating these two kinds of regions is generally similar, but there are some code paths
3937         that eagerly update annotated regions.
3938
3939         No behavior change.
3940
3941         * dom/Document.cpp:
3942         (WebCore::Document::updateAnnotatedRegions): Moved from FrameView.
3943         (WebCore::Document::invalidateRenderingDependentRegions):
3944         (WebCore::Document::invalidateScrollbarDependentRegions):
3945         (WebCore::Document::updateZOrderDependentRegions):
3946         * dom/Document.h:
3947         (WebCore::Document::setAnnotatedRegionsDirty):
3948         (WebCore::Document::annotatedRegionsDirty const):
3949         (WebCore::Document::hasAnnotatedRegions const):
3950         * page/FrameView.cpp:
3951         (WebCore::FrameView::didLayout):
3952         (WebCore::FrameView::didPaintContents):
3953         (WebCore::FrameView::updateAnnotatedRegions): Deleted.
3954         * page/FrameView.h:
3955         * rendering/RenderElement.cpp: Drive-by header cleanup.
3956         (WebCore::RenderElement::styleWillChange):
3957         * rendering/RenderLayer.cpp:
3958         (WebCore::RenderLayer::scrollTo):
3959         (WebCore::RenderLayer::setHasHorizontalScrollbar):
3960         (WebCore::RenderLayer::setHasVerticalScrollbar):
3961         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
3962         (WebCore::RenderLayer::calculateClipRects const):
3963         * rendering/RenderListBox.cpp:
3964         (WebCore::RenderLis