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