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