1bc8ad19a1b14f1283af8636272f124bea827d36
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-01  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC][Floating] Align new floating with the bottom of the existing floatings.
4         https://bugs.webkit.org/show_bug.cgi?id=188213
5
6         Reviewed by Antti Koivisto.
7
8         When the incoming floating does not fit at all, align its top with the bottom of the existing floatings.
9
10         * layout/FloatingContext.cpp:
11         (WebCore::Layout::FloatingContext::floatingPosition const):
12         (WebCore::Layout::FloatingPair::bottom const):
13
14 2018-08-01  Eric Carlson  <eric.carlson@apple.com>
15
16         Always use MediaPlayback audio category when playing to AppleTV
17         https://bugs.webkit.org/show_bug.cgi?id=188230
18         <rdar://problem/42497809>
19
20         Reviewed by Jer Noble.
21
22         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
23         (PlatformMediaSessionManager::updateSessionState): Check session.isPlayingToWirelessPlaybackTarget().
24
25 2018-08-01  Timothy Hatcher  <timothy@apple.com>
26
27         Hardcode some system colors to avoid fingerprinting exposure.
28         https://bugs.webkit.org/show_bug.cgi?id=188203
29         rdar://problem/42781630
30
31         Reviewed by Tim Horton.
32
33         Passes existing tests with the hardcoded blue system appearance.
34
35         * rendering/RenderTheme.h:
36         * rendering/RenderThemeMac.mm:
37         (WebCore::RenderThemeMac::systemColor const):
38         Adds special handling for some system colors. Fixes -apple-system-selected-text-background
39         to match the real selection color by using blendWithWhite().
40
41 2018-08-01  Eric Carlson  <eric.carlson@apple.com>
42
43         [iOS] Remove the delay before setting audio session category added in r233535
44         https://bugs.webkit.org/show_bug.cgi?id=188225
45
46         Reviewed by Jer Noble.
47
48         * platform/audio/PlatformMediaSessionManager.cpp:
49         (WebCore::PlatformMediaSessionManager::beginInterruption): scheduleUpdateSessionState -> updateSessionState.
50         (WebCore::PlatformMediaSessionManager::addSession): Ditto.
51         (WebCore::PlatformMediaSessionManager::removeSession): Ditto.
52         (WebCore::PlatformMediaSessionManager::sessionStateChanged): Ditto.
53         (WebCore::PlatformMediaSessionManager::sessionCanProduceAudioChanged): Ditto.
54         (WebCore::PlatformMediaSessionManager::updateSessionState): Ditto.
55         (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged): Ditto.
56         (WebCore::PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
57         * platform/audio/PlatformMediaSessionManager.h:
58
59         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
60         (PlatformMediaSessionManager::updateSessionState):
61         (PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
62         * rendering/RenderLayer.cpp:
63         (WebCore::RenderLayer::updateClipRects):
64
65 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
66
67         Add TransformationMatrix::Identity
68         https://bugs.webkit.org/show_bug.cgi?id=188204
69
70         Reviewed by Simon Fraser.
71
72         This patch adds TransformationMatrix::Identity, which is a static const variable holding an identity matrix.
73
74         No behavior change.
75
76         * platform/graphics/GraphicsLayer.cpp:
77         (WebCore::GraphicsLayer::transform const):
78         (WebCore::GraphicsLayer::childrenTransform const):
79         (): Deleted.
80         * platform/graphics/transforms/TransformationMatrix.cpp:
81         * platform/graphics/transforms/TransformationMatrix.h:
82
83 2018-08-01  Thibault Saunier  <tsaunier@igalia.com>
84
85         [GStreamer] Make sure that first buffer running time is 0 in GStreamerMediaStreamSource
86         https://bugs.webkit.org/show_bug.cgi?id=188210
87
88         This is a live source and the first frame is the beginning of the stream,
89         but that doesn't mean that the incoming stream from the camera didn't start
90         before. We need to set a pad offset on each srcpad of the source to compensate
91         for that. This is the exact same logic as in webrtc GStreamerVideo/Enc/Dec/oder.
92
93         Reviewed by Alejandro G. Castro.
94
95         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
96         (WebCore::webkit_media_stream_src_init):
97         (WebCore::webkitMediaStreamSrcPushVideoSample):
98         (WebCore::webkitMediaStreamSrcPushAudioSample):
99
100 2018-08-01  Zan Dobersek  <zdobersek@igalia.com>
101
102         [CoordGraphics] Move CoordinatedBackingStore to WebCore
103         https://bugs.webkit.org/show_bug.cgi?id=188158
104
105         Reviewed by Carlos Garcia Campos.
106
107         Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
108         dependency on anything in the WebKit layer, and it's more suitable to
109         future needs to keep it in the WebCore layer.
110
111         * platform/TextureMapper.cmake:
112         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp.
113         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h.
114         (WebCore::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
115         (WebCore::CoordinatedBackingStore::rect const):
116
117 2018-07-31  Myles C. Maxfield  <mmaxfield@apple.com>
118
119         [WIN] Fix tests for text with initial advances
120         https://bugs.webkit.org/show_bug.cgi?id=188099
121
122         Reviewed by Darin Adler.
123
124         Fixup after r234318.
125
126         Tests: fast/text/complex-first-glyph-with-initial-advance.html
127                fast/text/initial-advance-in-intermediate-run-complex.html
128
129         * platform/graphics/ComplexTextController.cpp:
130         * platform/graphics/FontCascade.cpp:
131         (WebCore::FontCascade::drawGlyphBuffer const):
132
133 2018-07-31  Alex Christensen  <achristensen@webkit.org>
134
135         REGRESSION (r231107): MoviStar+ launches to a blank black screen
136         https://bugs.webkit.org/show_bug.cgi?id=188139
137
138         Reviewed by Brent Fulgham.
139
140         For this app, revert behavior to how it was before r231107 with a linked-on-or-before check.
141         r231107 increased our fetch spec conformance, which we intend to keep.  This makes a low-risk
142         targeted fix that will fix the affected app until they update.  
143
144         I manually verified this fixes the app.
145
146         * loader/DocumentThreadableLoader.cpp:
147         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
148         * platform/RuntimeApplicationChecks.h:
149         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
150         (WebCore::applicationSDKVersionOverride):
151         (WebCore::setApplicationSDKVersion):
152         (WebCore::applicationSDKVersion):
153         (WebCore::IOSApplication::isMoviStarPlus):
154
155 2018-07-31  Myles C. Maxfield  <mmaxfield@apple.com>
156
157         [Cocoa] Addressing post-review comments on r234158
158         https://bugs.webkit.org/show_bug.cgi?id=188202
159
160         Reviewed by Darin Adler.
161
162         * platform/graphics/cocoa/FontCacheCoreText.cpp:
163         (WebCore::FontCache::lastResortFallbackFont):
164
165 2018-07-31  John Wilander  <wilander@apple.com>
166
167         Resource Load Statistics: Remove partitioned cookies for reduced complexity, lower memory footprint, and ability to support more platforms
168         https://bugs.webkit.org/show_bug.cgi?id=188109
169         <rdar://problem/42664391>
170
171         Reviewed by Brent Fulgham, Chris Dumez, and Alex Christensen.
172
173         Tests: http/tests/resourceLoadStatistics/cookie-deletion.html
174                http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html
175                http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-user-interaction.html
176                http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe-pop-window.html
177                http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe.html
178                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html
179                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-but-access-from-wrong-frame.html
180                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
181                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html
182                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe.html
183                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe.html
184
185         This patch removes cookie partitioning which reduces the model to just
186         blocked cookies (in third-party contexts) and first-party cookie access.
187
188         Several of the changes are renaming to reflect that there are no more
189         cookie partitions. However, the compile-time check remains for now since
190         this change is not ready to ship.
191
192         The test cases mentioned about are not new. They are just renamed to
193         reflect the code changes and to shorten their names (as requested by
194         non-Cocoa platforms).
195
196         * loader/ResourceLoadStatistics.cpp:
197         (WebCore::ResourceLoadStatistics::toString const):
198         (WebCore::ResourceLoadStatistics::merge):
199             Removed the use of isMarkedForCookiePartitioning.
200         * loader/ResourceLoadStatistics.h:
201             Removed isMarkedForCookiePartitioning.
202         * platform/network/NetworkStorageSession.h:
203         * platform/network/ResourceHandle.h:
204             Renamed applySniffingPoliciesAndStoragePartitionIfNeeded() to
205             applySniffingPoliciesIfNeeded().
206         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
207         (WebCore::getPartitioningDomain):
208         (WebCore::NetworkStorageSession::shouldBlockCookies const):
209             Now takes a frame ID and a page ID to be able to support
210             the Storage Access API. This was previously handled by
211             shouldPartitionCookies() which is now deleted.
212         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
213             Renamed from setPrevalentDomainsToPartitionOrBlockCookies().
214         (WebCore::NetworkStorageSession::removePrevalentDomains):
215             No longer needs to clear the member variable for partitioned cookie domains.
216         (WebCore::NetworkStorageSession::setCookieStoragePartitioningEnabled): Deleted.
217         (WebCore::NetworkStorageSession::cookieStoragePartition const): Deleted.
218         (WebCore::NetworkStorageSession::shouldPartitionCookies const): Deleted.
219         (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies): Deleted.
220             Renamed to setPrevalentDomainsToBlockCookiesFor().
221         * platform/network/mac/CookieJarMac.mm:
222         (WebCore::cookiesForURL):
223             Now calls session.shouldBlockCookies() instead of the
224             wrapper cookiesAreBlockedForURL().
225         (WebCore::setCookiesFromDOM):
226             No longer checks for partition.
227         (WebCore::applyPartitionToCookies): Deleted.
228         (WebCore::cookiesAreBlockedForURL): Deleted.
229             This was just a wrapper for session.shouldBlockCookies().
230         (WebCore::cookiesInPartitionForURL): Deleted.
231         * platform/network/mac/ResourceHandleMac.mm:
232         (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
233             Renamed from applySniffingPoliciesAndStoragePartitionIfNeeded().
234         (WebCore::ResourceHandle::createNSURLConnection):
235             Consequence of function name change.
236         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Deleted.
237             Renamed to applySniffingPoliciesIfNeeded().
238
239 2018-07-31  Wenson Hsieh  <wenson_hsieh@apple.com>
240
241         [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in
242         https://bugs.webkit.org/show_bug.cgi?id=188107
243         <rdar://problem/42354250>
244
245         Reviewed by Tim Horton.
246
247         After r232040, the synthetic click gesture recognizer was enabled when tapping inside of the focused element,
248         which allows the page to handle click events inside editable content. However, this means that codepaths in
249         EventHandler that are responsible for changing selection due to default click event behaviors on macOS are now
250         active on iOS; this conflicts with selection changes due to text interaction gestures, which are the existing
251         mechanism for modifying the selection on iOS.
252
253         To address this, we defer selection changes when clicking to text interaction gestures on iOS by tweaking the
254         default behavior of a click on iOS to /not/ change selection when moving within the same editable root. This is
255         similar to r233311, but in a different codepath that specifically handles selection changes when clicking on
256         content that is already selected.
257
258         Test: fast/forms/ios/click-should-not-suppress-misspelling.html
259
260         * page/EventHandler.cpp:
261         (WebCore::EventHandler::handleMouseReleaseEvent):
262
263 2018-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
264
265         Clean up TransformationMatrix implementation
266         https://bugs.webkit.org/show_bug.cgi?id=188197
267
268         Reviewed by Simon Fraser.
269
270         We perform cleaning up of TransformationMatrix.
271
272         1. We drop user-defined operator= and copy constructor. Default ones works well for TransformationMatrix.
273         2. Remove unused setMatrix. We explicitly use memcpy in TransformationMatrix.cpp (only one place).
274         3. Use memcmp for implementing operator==.
275
276         In (2) and (3), we use `memcpy(&matrix[0][0], &tmp[0][0], sizeof(Matrix4))` instead of `memcpy(matrix, tmp, sizeof(Matrix4))`,
277         since they both are non nullptr and the former is easier to understand.
278
279         * platform/graphics/transforms/TransformationMatrix.cpp:
280         (WebCore::TransformationMatrix::multiply):
281         * platform/graphics/transforms/TransformationMatrix.h:
282         (WebCore::TransformationMatrix::setMatrix):
283         (WebCore::TransformationMatrix::operator== const):
284         (WebCore::TransformationMatrix::operator =): Deleted.
285
286 2018-07-31  Timothy Hatcher  <timothy@apple.com>
287
288         Don't call RenderTheme::platformColorsDidChange() during printing.
289         https://bugs.webkit.org/show_bug.cgi?id=188181
290         rdar://problem/42360070
291
292         Reviewed by Tim Horton.
293
294         * inspector/agents/InspectorPageAgent.cpp:
295         (WebCore::InspectorPageAgent::setEmulatedMedia): Call m_page.updateStyleAfterChangeInEnvironment()
296         instead of going to styleStope() and remove call to RenderTheme::platformColorsDidChange().
297         * page/FrameView.cpp:
298         (WebCore::FrameView::adjustMediaTypeForPrinting): Remove call RenderTheme::platformColorsDidChange().
299
300 2018-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
301
302         Use static const global variable for TransformationMatrix instead of NeverDestroyed
303         https://bugs.webkit.org/show_bug.cgi?id=188195
304
305         Reviewed by Darin Adler.
306
307         Since TransformationMatrix does not have a non-trivial destructor, we can put it
308         as static const global variable if its constructor is constexpr. This patch makes
309         some of constructors constexpr and makes identityTransform static const global variable
310         instead of NeverDestroyed<> + static function. This removes unnecessary static function
311         and lazy initialization.
312
313         No behavior change.
314
315         * platform/graphics/GraphicsLayer.cpp:
316         (WebCore::GraphicsLayer::transform const):
317         (WebCore::GraphicsLayer::childrenTransform const):
318         (WebCore::identityTransform): Deleted.
319         * platform/graphics/transforms/TransformationMatrix.h:
320         (WebCore::TransformationMatrix::TransformationMatrix):
321
322 2018-07-31  Zalan Bujtas  <zalan@apple.com>
323
324         [LFC][Floating] Add basic left/right floating positioning.
325         https://bugs.webkit.org/show_bug.cgi?id=188148
326
327         Reviewed by Antti Koivisto.
328
329         This patch implements simple floating positioning.
330         (Floatings with different containing blocks do not work yet.)
331
332         * layout/FloatingContext.cpp:
333         (WebCore::Layout::FloatingPair::isEmpty const):
334         (WebCore::Layout::Iterator::current const):
335         (WebCore::Layout::Iterator::verticalPosition const):
336         (WebCore::Layout::FloatingContext::FloatingContext):
337         (WebCore::Layout::FloatingContext::computePosition const):
338         (WebCore::Layout::FloatingContext::floatingPosition const):
339         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
340         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
341         (WebCore::Layout::FloatingContext::alignWithFloatings const):
342         (WebCore::Layout::floatingDisplayBox):
343         (WebCore::Layout::FloatingPair::FloatingPair):
344         (WebCore::Layout::FloatingPair::left const):
345         (WebCore::Layout::FloatingPair::right const):
346         (WebCore::Layout::FloatingPair::intersects const):
347         (WebCore::Layout::Iterator::Iterator):
348         (WebCore::Layout::Iterator::operator++):
349         (WebCore::Layout::Iterator::set):
350         (WebCore::Layout::FloatingContext::computePosition): Deleted.
351         * layout/FloatingContext.h:
352         * layout/FloatingState.cpp:
353         (WebCore::Layout::FloatingState::append):
354         * layout/FloatingState.h:
355         (WebCore::Layout::FloatingState::floatings const):
356         (WebCore::Layout::FloatingState::last const):
357         * layout/blockformatting/BlockFormattingContext.cpp:
358         (WebCore::Layout::BlockFormattingContext::layout const):
359         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
360         * layout/displaytree/DisplayBox.cpp:
361         (WebCore::Display::Box::Rect::Rect):
362         * layout/displaytree/DisplayBox.h:
363         (WebCore::Display::Box::Rect::intersects const):
364         (WebCore::Display::Box::rect const):
365
366 2018-07-31  Rob Buis  <rbuis@igalia.com>
367
368         Remove ResourceResponse::cacheBodyKey API
369         https://bugs.webkit.org/show_bug.cgi?id=188192
370
371         Reviewed by Frédéric Wang.
372
373         Removed unused API.
374
375         No new tests needed since this API is not used.
376
377         * platform/network/ResourceResponseBase.h:
378         (WebCore::ResourceResponseBase::encode const):
379         (WebCore::ResourceResponseBase::decode):
380         (WebCore::ResourceResponseBase::cacheBodyKey const): Deleted.
381         (WebCore::ResourceResponseBase::setCacheBodyKey): Deleted.
382
383 2018-07-30  Simon Fraser  <simon.fraser@apple.com>
384
385         Shrink GraphicsLayerCA
386         https://bugs.webkit.org/show_bug.cgi?id=188141
387
388         Reviewed by Zalan Bujtas.
389         
390         Shrink GraphicsLayerCA from 1040 to 880 bytes by:
391         * moving all the clone-related stuff into the lazily-allocated m_layerClones
392         * moving all the animation-related stuff into the lazily-allocated m_animations
393         * making enums be 8-bit
394         * re-ordering data members
395
396         * page/cocoa/ResourceUsageOverlayCocoa.mm:
397         (WebCore::ResourceUsageOverlay::platformInitialize):
398         * platform/graphics/GraphicsLayer.cpp:
399         (WebCore::GraphicsLayer::GraphicsLayer):
400         (WebCore::operator<<):
401         * platform/graphics/GraphicsLayer.h:
402         * platform/graphics/GraphicsLayerClient.h:
403         * platform/graphics/WindRule.h:
404         * platform/graphics/ca/GraphicsLayerCA.cpp:
405         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
406         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
407         (WebCore::GraphicsLayerCA::addProcessingActionForAnimation):
408         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
409         (WebCore::GraphicsLayerCA::setContentsToImage):
410         (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
411         (WebCore::GraphicsLayerCA::contentsLayerForMedia const):
412         (WebCore::GraphicsLayerCA::layerDidDisplay):
413         (WebCore::layerTypeForCustomBackdropAppearance):
414         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
415         (WebCore::GraphicsLayerCA::updateGeometry):
416         (WebCore::GraphicsLayerCA::updateMasksToBounds):
417         (WebCore::GraphicsLayerCA::updateContentsVisibility):
418         (WebCore::GraphicsLayerCA::updateContentsOpaque):
419         (WebCore::GraphicsLayerCA::updateBackfaceVisibility):
420         (WebCore::GraphicsLayerCA::updateFilters):
421         (WebCore::GraphicsLayerCA::updateBackdropFilters):
422         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
423         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
424         (WebCore::GraphicsLayerCA::updateDrawsContent):
425         (WebCore::GraphicsLayerCA::updateCoverage):
426         (WebCore::GraphicsLayerCA::updateDebugIndicators):
427         (WebCore::GraphicsLayerCA::updateContentsImage):
428         (WebCore::GraphicsLayerCA::updateContentsPlatformLayer):
429         (WebCore::GraphicsLayerCA::updateContentsColorLayer):
430         (WebCore::GraphicsLayerCA::updateContentsRects):
431         (WebCore::GraphicsLayerCA::updateMasksToBoundsRect):
432         (WebCore::GraphicsLayerCA::updateMaskLayer):
433         (WebCore::GraphicsLayerCA::updateAnimations):
434         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
435         (WebCore::GraphicsLayerCA::ensureLayerAnimations):
436         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
437         * platform/graphics/ca/GraphicsLayerCA.h:
438         (WebCore::GraphicsLayerCA::animationIsRunning const):
439         (WebCore::GraphicsLayerCA::primaryLayerClones const): Deleted.
440         * platform/graphics/ca/PlatformCALayerClient.h:
441         (WebCore::PlatformCALayerClient::platformCALayerContentsOrientation const):
442         * platform/graphics/ca/TileCoverageMap.h:
443         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
444         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
445         (PlatformCALayerCocoa::PlatformCALayerCocoa):
446         (PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const):
447         (PlatformCALayerCocoa::updateCustomAppearance):
448         (PlatformCALayer::drawLayerContents):
449         * rendering/RenderLayerBacking.cpp:
450         (WebCore::RenderLayerBacking::updateCustomAppearance):
451         (WebCore::RenderLayerBacking::updateConfiguration):
452         * rendering/RenderLayerCompositor.cpp:
453         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
454         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
455
456 2018-07-30  Justin Fan  <justin_fan@apple.com>
457
458         [WebGL2] Support compilation of GLSL ES version 300 shaders
459         https://bugs.webkit.org/show_bug.cgi?id=187982
460         <rdar://problem/42564229>
461
462         Reviewed by Dean Jackson.
463
464         Test: fast/canvas/webgl/webgl2-glsl3-compile.html
465
466         * html/canvas/WebGLRenderingContextBase.cpp:
467         (WebCore::WebGLRenderingContextBase::create): Rename 'useGLES3' to 'isWebGL2' (everywhere) to make more sense.
468         * platform/graphics/GraphicsContext3DAttributes.h: Rename 'useGLES3' to 'isWebGL2'.
469         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
470         (WebCore::setPixelFormat): Back WebGL2 contexts with OpenGL 4 for full OpenGL ES 3 support. 
471         (WebCore::GraphicsContext3D::GraphicsContext3D): Request correct GLSL output version and WebGL 2 for ANGLE shader compilation.
472         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
473         (WebCore::GraphicsContext3D::checkVaryingsPacking const): MAX_VARYING_FLOATS is deprecated in OpenGL 3+.
474         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Rename 'useGLES3' to 'isWebGL2'.
475         (WebCore::GraphicsContext3D::create):
476         (WebCore::GraphicsContext3D::GraphicsContext3D):
477
478 2018-07-30  Justin Fan  <justin_fan@apple.com>
479
480         Match GraphicsContext3D with correct virtual screen using registryID
481         https://bugs.webkit.org/show_bug.cgi?id=188072
482         <rdar://problem/42634940>
483
484         Reviewed by Dean Jackson.
485
486         Follow up to https://bugs.webkit.org/show_bug.cgi?id=187750. Rather than matching rendererIDs, 
487         which can vary between processes, match GPU to display using registryID that is unique to a GPU, 
488         which was added to CGL in MacOS 10.13. 
489
490         No new tests. Manually tested on MacBookPro13,3 and iMacPro1,1 with Apple DisplayPort Cinema Display
491         and RX 580 external GPU. 
492
493         * platform/PlatformScreen.h:
494         * platform/ScreenProperties.h:
495         (WebCore::ScreenData::encode const):
496         (WebCore::ScreenData::decode):
497         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
498         (WebCore::setGPUByRegistryID):
499         (WebCore::setGPUByDisplayMask):
500         (WebCore::GraphicsContext3D::GraphicsContext3D):
501         (WebCore::GraphicsContext3D::screenDidChange):
502         (WebCore::identifyAndSetCurrentGPU): Deleted.
503         * platform/mac/PlatformScreenMac.mm:
504         (WebCore::collectScreenProperties):
505         (WebCore::primaryRegistryID):
506         (WebCore::registryIDForDisplay):
507         (WebCore::registryIDForDisplayMask):
508         (WebCore::rendererIDForDisplayMask): Deleted.
509         (WebCore::rendererIDForDisplay): Deleted.
510         (WebCore::primaryRendererID): Deleted.
511
512 2018-07-30  Rob Buis  <rbuis@igalia.com>
513
514         Merge PlatformCookieJar functions into NetworkStorageSession
515         https://bugs.webkit.org/show_bug.cgi?id=188137
516
517         Reviewed by Alex Christensen.
518
519         No new tests -- no change in WebKit functionality.
520
521         * PlatformMac.cmake: Remove CookieJarMac.mm reference
522         * SourcesCocoa.txt: Remove CookieJarMac.mm reference
523         * WebCore.xcodeproj/project.pbxproj:
524         * loader/CookieJar.cpp: Remove PlatformCookieJar.h reference.
525         * platform/Curl.cmake: Remove CookieJarCurl.cpp reference.
526         * platform/SourcesSoup.txt: Remove CookieJarSoup.cpp reference.
527         * platform/network/CacheValidation.cpp: Adapt callsites to use
528         NetworkStorageSession instead of CookieJar functions.
529
530         (WebCore::headerValueForVary):
531         * platform/network/NetworkStorageSession.h: Add PlatformCookieJar
532         functions.
533
534         * platform/network/PlatformCookieJar.h: Removed.
535         * platform/network/SocketStreamHandleImpl.cpp: Adapt callsites to
536         use NetworkStorageSession instead of CookieJar functions.
537         (WebCore::cookieDataForHandshake):
538         * platform/network/cf/CookieJarCFNet.cpp: Removed.
539         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Move functions
540         from CookieJarCFNet.cpp.
541         (WebCore::cookieDomain):
542         (WebCore::canonicalCookieTime):
543         (WebCore::cookieCreatedTime):
544         (WebCore::cookieExpirationTime):
545         (WebCore::cookieName):
546         (WebCore::cookiePath):
547         (WebCore::cookieValue):
548         (WebCore::filterCookies):
549         (WebCore::copyCookiesForURLWithFirstPartyURL):
550         (WebCore::createCookies):
551         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
552         (WebCore::containsSecureCookies):
553         (WebCore::NetworkStorageSession::cookiesForDOM const):
554         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
555         (WebCore::NetworkStorageSession::cookiesEnabled const):
556         (WebCore::NetworkStorageSession::getRawCookies const):
557         (WebCore::NetworkStorageSession::deleteCookie const):
558         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
559         (WebCore::NetworkStorageSession::deleteAllCookies):
560         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
561         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
562         * platform/network/cocoa/NetworkStorageSessionCocoa.mm: Move functions
563         from CookieJarMac.mm.
564         (WebCore::httpCookies):
565         (WebCore::deleteHTTPCookie):
566         (WebCore::policyProperties):
567         (WebCore::cookiesForURL):
568         (WebCore::setHTTPCookiesForURL):
569         (WebCore::httpCookiesForURL):
570         (WebCore::filterCookies):
571         (WebCore::applyPartitionToCookies):
572         (WebCore::cookiesAreBlockedForURL):
573         (WebCore::cookiesInPartitionForURL):
574         (WebCore::cookiesForSession):
575         (WebCore::deleteAllHTTPCookies):
576         (WebCore::NetworkStorageSession::cookiesForDOM const):
577         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
578         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
579         (WebCore::httpCookieAcceptPolicy):
580         (WebCore::NetworkStorageSession::cookiesEnabled const):
581         (WebCore::NetworkStorageSession::getRawCookies const):
582         (WebCore::NetworkStorageSession::deleteCookie const):
583         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
584         (WebCore::NetworkStorageSession::deleteAllCookies):
585         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
586         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
587         * platform/network/curl/CookieJarCurl.cpp: Removed.
588         * platform/network/curl/CookieJarCurl.h:
589         * platform/network/curl/NetworkStorageSessionCurl.cpp: Merge functions
590         from CookieJarCurl.cpp.
591         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
592         (WebCore::NetworkStorageSession::cookiesEnabled const):
593         (WebCore::NetworkStorageSession::cookiesForDOM const):
594         (WebCore::NetworkStorageSession::deleteCookie const):
595         (WebCore::NetworkStorageSession::deleteAllCookies):
596         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
597         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
598         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
599         (WebCore::NetworkStorageSession::getRawCookies const):
600         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
601         * platform/network/mac/CookieJarMac.mm: Removed.
602         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
603         * platform/network/soup/CookieJarSoup.cpp: Removed.
604         * platform/network/soup/NetworkStorageSessionSoup.cpp: Merge functions
605         from CookieJarSoup.cpp.
606         (WebCore::NetworkStorageSession::cookiesEnabled const):
607         (WebCore::httpOnlyCookieExists):
608         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
609         (WebCore::NetworkStorageSession::deleteCookie const):
610         (WebCore::NetworkStorageSession::deleteAllCookies):
611         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
612         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
613         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
614         (WebCore::NetworkStorageSession::getRawCookies const):
615         (WebCore::cookiesForSession):
616         (WebCore::NetworkStorageSession::cookiesForDOM const):
617         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
618
619 2018-07-30  Chris Dumez  <cdumez@apple.com>
620
621         Nullptr crash accessing Document in GenericEventQueue::dispatchOneEvent()
622         https://bugs.webkit.org/show_bug.cgi?id=187284
623
624         Unreviewed, roll r233496 and r233571 now that all known issues have been fixed via
625         dependency bugs.
626
627         Test: media/track/video-track-addition-and-frame-removal.html
628
629         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
630         (WebCore::WebKitMediaKeySession::suspend):
631         (WebCore::WebKitMediaKeySession::resume):
632         (WebCore::WebKitMediaKeySession::stop):
633         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
634         * Modules/mediasource/MediaSource.cpp:
635         (WebCore::MediaSource::removeSourceBuffer):
636         (WebCore::MediaSource::suspend):
637         (WebCore::MediaSource::resume):
638         * Modules/mediasource/MediaSource.h:
639         * Modules/mediasource/SourceBuffer.cpp:
640         (WebCore::SourceBuffer::suspend):
641         (WebCore::SourceBuffer::resume):
642         (WebCore::SourceBuffer::stop):
643         * Modules/mediasource/SourceBuffer.h:
644         * Modules/mediasource/SourceBufferList.cpp:
645         (WebCore::SourceBufferList::SourceBufferList):
646         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
647         (WebCore::SourceBufferList::suspend):
648         (WebCore::SourceBufferList::resume):
649         (WebCore::SourceBufferList::stop):
650         (WebCore::SourceBufferList::activeDOMObjectName const):
651         * Modules/mediasource/SourceBufferList.h:
652         * Modules/mediasource/SourceBufferList.idl:
653         * dom/Document.h:
654         (WebCore::Document::hasBrowsingContext const):
655         * dom/GenericEventQueue.cpp:
656         (WebCore::GenericEventQueue::dispatchOneEvent):
657         * html/HTMLMediaElement.cpp:
658         (WebCore::HTMLMediaElement::prepareForLoad):
659         (WebCore::HTMLMediaElement::selectMediaResource):
660         (WebCore::HTMLMediaElement::prepareToPlay):
661         (WebCore::HTMLMediaElement::playInternal):
662         (WebCore::HTMLMediaElement::pauseInternal):
663         (WebCore::HTMLMediaElement::sourceWasAdded):
664         * html/track/AudioTrackList.cpp:
665         (AudioTrackList::activeDOMObjectName const):
666         * html/track/AudioTrackList.h:
667         * html/track/AudioTrackList.idl:
668         * html/track/TextTrackList.cpp:
669         (TextTrackList::activeDOMObjectName const):
670         * html/track/TextTrackList.h:
671         * html/track/TextTrackList.idl:
672         * html/track/TrackListBase.cpp:
673         (WebCore::TrackListBase::TrackListBase):
674         (WebCore::TrackListBase::canSuspendForDocumentSuspension const):
675         (WebCore::TrackListBase::suspend):
676         (WebCore::TrackListBase::resume):
677         (WebCore::TrackListBase::stop):
678         * html/track/TrackListBase.h:
679         * html/track/VideoTrackList.cpp:
680         (VideoTrackList::activeDOMObjectName const):
681         * html/track/VideoTrackList.h:
682         * html/track/VideoTrackList.idl:
683
684 2018-07-30  Chris Dumez  <cdumez@apple.com>
685
686         Unreviewed internal build fix after r234347.
687
688         * html/StepRange.cpp:
689         (WebCore::StepRange::StepRange):
690
691 2018-07-29  Simon Fraser  <simon.fraser@apple.com>
692
693         Shrink GraphicsLayer by making m_transform and m_childrenTransform be unique_ptrs
694         https://bugs.webkit.org/show_bug.cgi?id=188143
695
696         Reviewed by Zalan Bujtas.
697
698         m_transform and m_childrenTransform are usually identity; save space by making
699         these unique_ptrs. The getters still return references by returning a reference
700         to a NeverDestroyed<TransformationMatrix> if necessary.
701         
702         Shrinks GraphicsLayerCA from 840 to 640 bytes.
703
704         * platform/graphics/GraphicsLayer.cpp:
705         (WebCore::identityTransform):
706         (WebCore::GraphicsLayer::transform const):
707         (WebCore::GraphicsLayer::setTransform):
708         (WebCore::GraphicsLayer::childrenTransform const):
709         (WebCore::GraphicsLayer::setChildrenTransform):
710         (WebCore::GraphicsLayer::dumpProperties const):
711         * platform/graphics/GraphicsLayer.h:
712         (WebCore::GraphicsLayer::hasNonIdentityTransform const):
713         (WebCore::GraphicsLayer::hasNonIdentityChildrenTransform const):
714         (WebCore::GraphicsLayer::transform const): Deleted.
715         (WebCore::GraphicsLayer::setTransform): Deleted.
716         (WebCore::GraphicsLayer::childrenTransform const): Deleted.
717         (WebCore::GraphicsLayer::setChildrenTransform): Deleted.
718         (WebCore::GraphicsLayer::hasFlattenedPerspectiveTransform): Deleted. It was unused.
719         * platform/graphics/ca/GraphicsLayerCA.cpp:
720         (WebCore::GraphicsLayerCA::setTransform):
721         (WebCore::GraphicsLayerCA::setChildrenTransform):
722         (WebCore::GraphicsLayerCA::layerTransform const):
723         (WebCore::GraphicsLayerCA::updateTransform):
724         (WebCore::GraphicsLayerCA::updateChildrenTransform):
725         (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer):
726
727 2018-07-30  Thibault Saunier  <tsaunier@igalia.com>
728
729         [GStreamer] Make codecparsers optionnal
730         https://bugs.webkit.org/show_bug.cgi?id=188010
731
732         And avoid building libWebRTC if it won't be used. While there is no other
733         WebRTC backend, it makes no sense to expose an option.
734
735         Error out when WEBRTC or MEDIA_STREAM is enabled but GStreamer < 1.10
736
737         Reviewed by Alejandro G. Castro.
738
739         * platform/GStreamer.cmake:
740
741 2018-07-28  Darin Adler  <darin@apple.com>
742
743         [Cocoa] Update more WebCore Objective-C code to be ARC compatible
744         https://bugs.webkit.org/show_bug.cgi?id=188140
745
746         Reviewed by Sam Weinig.
747
748         This make sure we don't put any Objective-C objects into HashMap/Set
749         data structures, which doesn't work under ARC at this time. We could
750         fix that some day, but it's pretty simple to change code not to rely
751         on it, for now, and not as simple to support it in HashMap/Set.
752
753         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
754         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
755         Use CFRetain/CFAutorelease instead of retain/autorelease.
756
757         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
758         (createAccessibilityRoleMap): Use CFStringRef in a HashMap rather than
759         NSString * for string constants.
760         (roleValueToNSString): Updated for above change.
761
762         * bridge/objc/WebScriptObject.mm:
763         (-[WebScriptObject stringRepresentation]): Updated since objectValue
764         is now CFTypeRef rather than NSObject *.
765
766         * bridge/objc/objc_instance.mm:
767         (ObjcInstance::create): Use CFTypeRef instead of id for the key types
768         in a HashMap.
769         (ObjcInstance::~ObjcInstance): Updated for the above change.
770         (ObjcInstance::invokeObjcMethod): Updated since objectValue is now
771         CFTypeRef.
772         (ObjcInstance::invokeDefaultMethod): Ditto.
773         (ObjcInstance::setValueOfUndefinedField): Ditto.
774         * bridge/objc/objc_runtime.mm:
775         (JSC::Bindings::ObjcArray::setValueAt const): Ditto.
776
777         * bridge/objc/objc_utility.h: Use #pragma once. Use CFTypeRef instead
778         of NSObject * for objectValue, since it's in a union and ARC does not
779         support strong Objective-C object pointers in a union.
780
781         * bridge/objc/objc_utility.mm:
782         (JSC::Bindings::convertValueToObjcValue): Updated since objectValue is
783         now CFTypeRef.
784
785         * editing/cocoa/HTMLConverter.mm:
786         (HTMLConverter::_processElement): Use CFTypeRef rather than NSTextTable
787         for a HashMap.
788         (HTMLConverter::_exitElement): Ditto.
789
790         * editing/cocoa/WebContentReaderCocoa.mm:
791         (WebCore::attributesForAttributedStringConversion): Use CFRetain rather
792         than -[NSObject retain] in a workaround for an overrelease.
793
794         * editing/mac/DictionaryLookup.h: Removed code to make this usable from
795         non-Objective-C source files. Use tuples rather than out arguments
796         for the results of the various functions.
797
798         * editing/mac/DictionaryLookup.mm:
799         (WebCore::DictionaryLookup::rangeForSelection): Return a tuple rather
800         than using an out argument for options.
801         (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto.
802         (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.
803         (WebCore::showPopupOrCreateAnimationController): Removed use of typedef
804         PlatformAnimationController.
805         (WebCore::DictionaryLookup::animationControllerForPopup): Ditto.
806
807         * html/HTMLMediaElement.h: Put the videoFullscreenLayer function inside
808         an __OBJC__ ifdef since we can't do the type conversion without the
809         full Objective-C type.
810
811         * page/mac/EventHandlerMac.mm:
812         (WebCore::selfRetainingNSScrollViewScrollWheel): Use CFRetain/CFRelease
813         instead of retain/release.
814         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
815         Updated to use tuple return value from DictionaryLookup.
816
817         * page/scrolling/ScrollingStateNode.h: Replaced direct use of PlatformLayer*
818         in a union with use of a "typless" void* pointer and added helper functions
819         to convert in both directions.
820         * page/scrolling/cocoa/ScrollingStateNode.mm:
821         (WebCore::LayerRepresentation::retainPlatformLayer): Use CFRetain instead
822         of retain.
823         (WebCore::LayerRepresentation::releasePlatformLayer): Use CFRelease instead
824         of release.
825         (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
826         (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
827         * page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp:
828         (WebCore::LayerRepresentation::retainPlatformLayer): Updated argument type.
829         (WebCore::LayerRepresentation::releasePlatformLayer): Ditto.
830         (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
831         (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
832
833         * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Use CFTypeRef
834         instad of GCController * for key type of HashMap.
835         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
836         (WebCore::GameControllerGamepadProvider::controllerDidConnect): Updated
837         for the above change.
838         (WebCore::GameControllerGamepadProvider::controllerDidDisconnect): Ditto.
839
840         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
841         Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
842         strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
843         types under ARC.
844         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const): Added checks
845         for the constants.
846         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const): Ditto.
847         (WebCore::AVTrackPrivateAVFObjCImpl::label const): Ditto.
848
849         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
850         Use #pragma once and use CFTypeRef instead of AVMediaSelectionOption *
851         in the key to a HashMap.
852         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
853         (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Updated for
854         the above change.
855
856         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
857         Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
858         strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
859         types under ARC.
860         (WebCore::customSchemeURL): Removed unnecessary use of
861         NeverDestroyed<RetainPtr>. Can just use a straight pointer without calling
862         release, and that works with or without ARC.
863         (WebCore::imageDecoderAssetOptions): Ditto. Here, had to add a retain,
864         which we'll remove when we turn on ARC. Added canLoad checks, needed
865         because of SOFT_LINK_CONSTANT_MAY_FAIL.
866         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack): Added canLoad check,
867         needed because of SOFT_LINK_CONSTANT_MAY_FAIL.
868
869         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
870         Use CFTypeRef instead of AVAssetResourceLoadingRequest in HashMap.
871         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
872         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
873         Updated for above.
874         (WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Ditto.
875         (WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Ditto.
876
877         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
878         Use CFTypeRef instead of AVSampleBufferAudioRenderer in HashMap.
879         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
880         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): Updated for above.
881         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): Ditto.
882         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): Ditto.
883         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): Ditto.
884         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Ditto.
885         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): Ditto.
886
887         * platform/graphics/metal/GPUDrawableMetal.mm: Updated include; under ARC, it's
888         not safe to call a method on a class without seeing its interface.
889
890         * platform/mac/VideoFullscreenInterfaceMac.mm: Added an explicit
891         __unsafe_unretained for a delegate. Could consider moving to weak, but for now
892         this preserves the current behavior and compiles under ARC.
893
894         * platform/mac/WebCoreFullScreenPlaceholderView.h: Use strong for the contents,
895         weak for the target, and changed the action to be hard-coded instead of an
896         arbitrary selector. If we find we need the flexibility again later, we can do
897         it with a block, which is more ARC-friendly than calling an arbitrary selector.
898         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
899         (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Call function directly
900         instead of taking advantage of "using".
901         (-[WebCoreFullScreenPlaceholderView mouseDown:]): Call cancelOperation: on the
902         target rather than performing an arbitrary selector.
903
904         * platform/mac/WebCoreObjCExtras.mm:
905         (WebCoreObjCScheduleDeallocateOnMainThread): Use sel_registerName instead of
906         @selector, since @selector is not supported under ARC.
907
908         * platform/network/ResourceHandle.h: Use a return value rather than using an
909         inout argument in applySniffingPoliciesAndStoragePartitionIfNeeded.
910
911         * platform/network/cocoa/CookieStorageObserver.mm:
912         (WebCore::CookieStorageObserver::startObserving): Removed unnecessary
913         assertion of repondsToSelector since we are about to dispatch it immediately
914         after. Call the selector in the conventional way instead of using performSelector.
915
916         * platform/network/cocoa/WebCoreNSURLSession.h: Use #pragma once and use
917         CFTypeRef instead of an Objective-C type. Also use an explicit __unsafe_unretained
918         for the session in the data task.
919         * platform/network/cocoa/WebCoreNSURLSession.mm:
920         (-[WebCoreNSURLSession dealloc]): Updated for the above.
921         (-[WebCoreNSURLSession taskCompleted:]): Ditto.
922         (-[WebCoreNSURLSession invalidateAndCancel]): Ditto.
923         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Ditto.
924         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
925         (-[WebCoreNSURLSession dataTaskWithRequest:]): Ditto.
926         (-[WebCoreNSURLSession dataTaskWithURL:]): Ditto.
927
928         * platform/network/mac/ResourceHandleMac.mm:
929         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded):
930         Use a return value instead of an inout argument. Also use bridging casts.
931         (WebCore::ResourceHandle::createNSURLConnection): Updated for the change above.
932         Also use a bridging cast.
933         (WebCore::ResourceHandle::schedule): Use a bridging cast.
934         (WebCore::ResourceHandle::unschedule): Ditto.
935
936         * platform/network/mac/WebCoreURLResponse.mm:
937         (WebCore::adjustMIMETypeIfNecessary): Use a bridging cast.
938
939         * testing/Internals.cpp:
940         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Moved the macOS
941         version of this function out of this file ...
942         * testing/Internals.mm:
943         (WebCore::Internals::rangeForDictionaryLookupAtLocation): ... to here.
944
945 2018-07-29  Yusuke Suzuki  <utatane.tea@gmail.com>
946
947         Use static global variables instead of static NeverDestroyed inside function if possible
948         https://bugs.webkit.org/show_bug.cgi?id=188146
949
950         Reviewed by Darin Adler.
951
952         This patch leverages constexpr constructors / trivial destructors more to remove unnecessary `static NeverDestroyed`
953         inside a function. It simplifies the code, removes the unnecessary function, and ensures the initialization at
954         a program loader phase.
955
956         We make StepRange::StepDescription constructor constexpr to remove bunch of `static NeverDestroyed<const StepRange::StepDescription>`.
957         And we use `static Lock` since WTF::Lock has constexpr constructor.
958
959         No behavior change.
960
961         * dom/MessagePort.cpp:
962         (WebCore::MessagePort::deref const):
963         (WebCore::MessagePort::isExistingMessagePortLocallyReachable):
964         (WebCore::MessagePort::notifyMessageAvailable):
965         (WebCore::MessagePort::MessagePort):
966         (WebCore::MessagePort::~MessagePort):
967         (WebCore::allMessagePortsLock): Deleted.
968         * dom/ScriptExecutionContext.cpp:
969         (WebCore::ScriptExecutionContext::contextIdentifier const):
970         (WebCore::ScriptExecutionContext::removeFromContextsMap):
971         (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
972         (WebCore::ScriptExecutionContext::postTaskTo):
973         (WebCore::allScriptExecutionContextsMapLock): Deleted.
974         * html/DateInputType.cpp:
975         (WebCore::DateInputType::createStepRange const):
976         * html/DateTimeInputType.cpp:
977         (WebCore::DateTimeInputType::createStepRange const):
978         * html/DateTimeLocalInputType.cpp:
979         (WebCore::DateTimeLocalInputType::createStepRange const):
980         * html/MonthInputType.cpp:
981         (WebCore::MonthInputType::createStepRange const):
982         * html/RangeInputType.cpp:
983         (WebCore::RangeInputType::createStepRange const):
984         * html/StepRange.h:
985         (WebCore::StepRange::StepDescription::StepDescription):
986         * html/TimeInputType.cpp:
987         (WebCore::TimeInputType::createStepRange const):
988         * html/WeekInputType.cpp:
989         (WebCore::WeekInputType::createStepRange const):
990         * page/SecurityPolicy.cpp:
991         (WebCore::originAccessMap):
992         (WebCore::SecurityPolicy::isAccessWhiteListed):
993         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
994         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
995         (WebCore::SecurityPolicy::resetOriginAccessWhitelists):
996         (WebCore::originAccessMapLock): Deleted.
997         * platform/SchemeRegistry.cpp:
998         (WebCore::allBuiltinSchemes):
999         (WebCore::builtinLocalURLSchemes):
1000         (WebCore::localURLSchemes):
1001         (WebCore::displayIsolatedURLSchemes):
1002         (WebCore::builtinSecureSchemes):
1003         (WebCore::secureSchemes):
1004         (WebCore::builtinSchemesWithUniqueOrigins):
1005         (WebCore::schemesWithUniqueOrigins):
1006         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
1007         (WebCore::canDisplayOnlyIfCanRequestSchemes):
1008         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
1009         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
1010         (WebCore::ContentSecurityPolicyBypassingSchemes):
1011         (WebCore::cachePartitioningSchemes):
1012         (WebCore::serviceWorkerSchemes):
1013         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
1014         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
1015         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
1016         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
1017         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
1018         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
1019         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
1020         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
1021         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
1022         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
1023         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
1024         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
1025         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
1026         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
1027         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
1028         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
1029         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
1030         (WebCore::schemeRegistryLock): Deleted.
1031
1032 2018-07-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1033
1034         [Curl] Fix the bug when client reject the redirect on WebKitLegacy.
1035         https://bugs.webkit.org/show_bug.cgi?id=188130
1036
1037         Reviewed by Darin Adler.
1038
1039         ResourceHandle for Curl port has a bug when a client returns en empty request which
1040         indicates the redirecti is rejected by the client. It should be quit the task immediately,
1041         but it kept doing the job. Fixed.
1042         NetworkDataTask implementation did the right thing and there's no bug for them. 
1043
1044         Test: http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt
1045
1046         * platform/network/curl/ResourceHandleCurl.cpp:
1047         (WebCore::ResourceHandle::continueAfterWillSendRequest):
1048
1049 2018-07-28  Simon Fraser  <simon.fraser@apple.com>
1050
1051         Reset CompositingPolicyOverride between tests
1052         https://bugs.webkit.org/show_bug.cgi?id=188138
1053
1054         Reviewed by Zalan Bujtas.
1055
1056         WK1 tests were failing after r234330 because the compositing policy override optional
1057         was left set on the Page (WK1 has injected bundle SPI to clear it). Fix by having 
1058         Internals::resetToConsistentState clear this state.
1059
1060         * testing/Internals.cpp:
1061         (WebCore::Internals::resetToConsistentState):
1062
1063 2018-07-24  Simon Fraser  <simon.fraser@apple.com>
1064
1065         Animation stops with object-fit:contain on an animated 2d canvas
1066         https://bugs.webkit.org/show_bug.cgi?id=187840
1067
1068         Reviewed by Zalan Bujtas.
1069         
1070         If a canvas has object-fit: cover or contain, repaints need to mapped through
1071         the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
1072         
1073         Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
1074         all but RenderVideo just pass the RenderReplaced's intrinsicSize.
1075
1076         Test: fast/repaint/canvas-object-fit.html
1077
1078         * html/HTMLCanvasElement.cpp:
1079         (WebCore::HTMLCanvasElement::didDraw):
1080         * rendering/RenderHTMLCanvas.cpp:
1081         (WebCore::RenderHTMLCanvas::paintReplaced):
1082         * rendering/RenderImage.cpp:
1083         (WebCore::RenderImage::updateInnerContentRect):
1084         (WebCore::RenderImage::paintReplaced):
1085         * rendering/RenderLayerBacking.cpp:
1086         (WebCore::RenderLayerBacking::contentsBox const):
1087         * rendering/RenderReplaced.h:
1088         (WebCore::RenderReplaced::replacedContentRect const):
1089         * rendering/shapes/ShapeOutsideInfo.cpp:
1090         (WebCore::ShapeOutsideInfo::createShapeForImage const):
1091
1092 2018-07-27  Simon Fraser  <simon.fraser@apple.com>
1093
1094         Adjust the color matrix for the inverse apple-invert-lightness() transformation
1095         https://bugs.webkit.org/show_bug.cgi?id=188131
1096         rdar://problem/42673070
1097
1098         Reviewed by Zalan Bujtas.
1099
1100         Use the correct inverse matrix values.
1101
1102         Test: editing/style/inverse-color-filter.html
1103
1104         * platform/graphics/filters/FilterOperation.cpp:
1105         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
1106
1107 2018-07-27  Eric Carlson  <eric.carlson@apple.com>
1108
1109         [iOS] Don't deactivate audio session
1110         https://bugs.webkit.org/show_bug.cgi?id=188127
1111         <rdar://problem/42544143>
1112
1113         Reviewed by Jon Lee.
1114         
1115         r233435 includes a change that deactivates the shared audio session when there are no more
1116         active media sessions. This is a good in WK2 because it allows other applications to resume
1117         playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
1118         app may also be playing audio.
1119
1120         * platform/audio/PlatformMediaSessionManager.cpp:
1121         (WebCore::PlatformMediaSessionManager::removeSession): Don't deactivate the audio session.
1122
1123 2018-07-27  Chris Dumez  <cdumez@apple.com>
1124
1125         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable()
1126         https://bugs.webkit.org/show_bug.cgi?id=188097
1127         <rdar://problem/42558823>
1128
1129         Reviewed by Eric Carlson.
1130
1131         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable(). RealtimeMediaSource::audioSamplesAvailable()
1132         is called on a background thread but iterates over observers that may get destroyed concurrently on the main thread.
1133
1134         To address the issue:
1135         - Introduce a Lock to protect m_observer accesses
1136         - Copy observers to a Vector before iterating over them
1137
1138         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1139         (WebCore::MediaStreamTrackPrivate::forEachObserver const):
1140         (WebCore::MediaStreamTrackPrivate::addObserver):
1141         (WebCore::MediaStreamTrackPrivate::removeObserver):
1142         (WebCore::MediaStreamTrackPrivate::setEnabled):
1143         (WebCore::MediaStreamTrackPrivate::endTrack):
1144         (WebCore::MediaStreamTrackPrivate::sourceStarted):
1145         (WebCore::MediaStreamTrackPrivate::sourceStopped):
1146         (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
1147         (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
1148         (WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
1149         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
1150         (WebCore::MediaStreamTrackPrivate::updateReadyState):
1151         * platform/mediastream/MediaStreamTrackPrivate.h:
1152         (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated):
1153         (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
1154         * platform/mediastream/RealtimeMediaSource.cpp:
1155         (WebCore::RealtimeMediaSource::addObserver):
1156         (WebCore::RealtimeMediaSource::removeObserver):
1157         (WebCore::RealtimeMediaSource::forEachObserver const):
1158         (WebCore::RealtimeMediaSource::notifyMutedObservers const):
1159         (WebCore::RealtimeMediaSource::settingsDidChange):
1160         (WebCore::RealtimeMediaSource::videoSampleAvailable):
1161         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
1162         (WebCore::RealtimeMediaSource::start):
1163         (WebCore::RealtimeMediaSource::requestStop):
1164         (WebCore::RealtimeMediaSource::captureFailed):
1165         * platform/mediastream/RealtimeMediaSource.h:
1166         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1167         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1168         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1169         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1170
1171 2018-07-27  Alex Christensen  <achristensen@webkit.org>
1172
1173         Don't include WebPageProxy.h just for UndoOrRedo
1174         https://bugs.webkit.org/show_bug.cgi?id=188086
1175
1176         Reviewed by Saam Barati.
1177
1178         * platform/DragItem.h:
1179
1180 2018-07-27  Alex Christensen  <achristensen@webkit.org>
1181
1182         Make CompletionHandler more const correct
1183         https://bugs.webkit.org/show_bug.cgi?id=186543
1184
1185         Reviewed by Saam Barati.
1186
1187         * dom/messageports/MessagePortChannel.cpp:
1188         (WebCore::MessagePortChannel::checkRemotePortForActivity):
1189         * dom/messageports/MessagePortChannelProviderImpl.cpp:
1190         (WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
1191         * loader/DocumentLoader.cpp:
1192         (WebCore::DocumentLoader::responseReceived):
1193         * loader/FrameLoader.cpp:
1194         (WebCore::FrameLoader::loadURL):
1195         (WebCore::FrameLoader::loadWithDocumentLoader):
1196         (WebCore::FrameLoader::loadPostRequest):
1197         * platform/network/cocoa/WebCoreNSURLSession.mm:
1198         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
1199         * workers/service/server/RegistrationDatabase.cpp:
1200         (WebCore::RegistrationDatabase::pushChanges):
1201         (WebCore::RegistrationDatabase::clearAll):
1202         * workers/service/server/SWServer.cpp:
1203         (WebCore::SWServer::matchAll):
1204         * workers/service/server/SWServer.h:
1205         * workers/service/server/SWServerWorker.cpp:
1206         (WebCore::SWServerWorker::matchAll):
1207         * workers/service/server/SWServerWorker.h:
1208
1209 2018-07-27  Simon Fraser  <simon.fraser@apple.com>
1210
1211         Be more conservative with compositing layer creation when memory is low
1212         https://bugs.webkit.org/show_bug.cgi?id=187866
1213         rdar://problem/42366345
1214
1215         Reviewed by Zalan Bujtas.
1216         
1217         When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
1218         compositing layers. We avoid compositing for these situations:
1219         1. Layers with 3D transforms which are affine (like translateZ(0)).
1220         2. Layers with will-change
1221         3. Layers for canvases (other than WebGL/WebGPU)
1222         
1223         We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
1224         falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
1225         Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
1226         
1227         Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
1228         flakily falling into a different mode, and so that we can impose the conservative
1229         mode for testing.
1230
1231         Test: compositing/layer-creation/compositing-policy.html
1232
1233         * page/Page.h:
1234         (WebCore::Page::compositingPolicyOverride const):
1235         (WebCore::Page::setCompositingPolicyOverride):
1236         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1237         (WebCore::Matrix3DTransformOperation::isRepresentableIn2D const):
1238         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1239         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1240         * platform/graphics/transforms/RotateTransformOperation.h:
1241         * platform/graphics/transforms/ScaleTransformOperation.h:
1242         * platform/graphics/transforms/TransformOperation.h:
1243         (WebCore::TransformOperation::isRepresentableIn2D const):
1244         * platform/graphics/transforms/TransformOperations.h:
1245         (WebCore::TransformOperations::has3DOperation const):
1246         (WebCore::TransformOperations::isRepresentableIn2D const):
1247         * platform/graphics/transforms/TranslateTransformOperation.h:
1248         * rendering/RenderLayerBacking.cpp:
1249         (WebCore::RenderLayerBacking::updateGeometry):
1250         * rendering/RenderLayerCompositor.cpp:
1251         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
1252         (WebCore::RenderLayerCompositor::updateCompositingPolicy):
1253         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1254         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
1255         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
1256         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
1257         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
1258         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
1259         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
1260         (WebCore::operator<<):
1261         * rendering/RenderLayerCompositor.h:
1262         * testing/Internals.cpp:
1263         (WebCore::Internals::setCompositingPolicyOverride):
1264         (WebCore::Internals::compositingPolicyOverride const):
1265         * testing/Internals.h:
1266         * testing/Internals.idl:
1267
1268 2018-07-27  Zalan Bujtas  <zalan@apple.com>
1269
1270         [WK1] ASSERTION FAILED: renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint()) in WebCore::RenderLayer::updateLayerPositionsAfterScroll
1271         https://bugs.webkit.org/show_bug.cgi?id=188122
1272         <rdar://problem/42584790>
1273
1274         Reviewed by Simon Fraser.
1275
1276         When ScrollView's m_paintsEntireContents flag flips due to layer backing changes, the repaint area transitions from
1277         visual to layout overflow. When this happens the cached repaint rects become invalid and they need to be recomputed.
1278         Currently there's no mechanism to trigger repaint cache invalidation from ScrollView.
1279         Skip assertion for now on WK1 (see webkit.org/b/188121)
1280
1281         * rendering/RenderLayer.cpp:
1282         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
1283
1284 2018-07-27  Myles C. Maxfield  <mmaxfield@apple.com>
1285
1286         [WIN] Crash when trying to access store pages
1287         https://bugs.webkit.org/show_bug.cgi?id=188032
1288         <rdar://problem/42467016>
1289
1290         Reviewed by Brent Fulgham.
1291
1292         The Windows implementation of GlyphBuffer has an additional member, m_offsets, which represents
1293         an additional offset to the position to paint each glyph. It also has two add() functions, one
1294         which appends to this vector, and one which doesn't. The one that doesn't append to the vector
1295         should never be called on Windows (because Windows requires this vector to be full).
1296
1297         There were two situations where it was getting called:
1298         1) Inside ComplexTextController
1299         2) Inside display list playback
1300
1301         Windows shouldn't be using ComplexTextController because the Windows implementation of this 
1302         class isn't ready yet; instead it should be using UniscribeController. The display list playback
1303         code should be used on Windows.
1304
1305         Rather than fix the function to append an offset, we actually don't need the m_offsets vector
1306         in the first place. Instead, we can do it the same way that the Cocoa ports do it, which is to
1307         bake the offsets into the glyph advances. This is possible because the GlyphBuffer doesn't need
1308         to distinguish between layout advances and paint advances, so we can bake them together and
1309         just put paint advances in the GlyphBuffer. This should be a small (probably within-the-noise)
1310         performance and memory improvement.
1311
1312         * platform/graphics/ComplexTextController.cpp:
1313         (WebCore::ComplexTextController::ComplexTextController): Make sure that ComplexTextController
1314         isn't used on Windows.
1315         * platform/graphics/FontCascade.cpp:
1316         (WebCore::FontCascade::widthOfTextRange const): Switch from ComplexTextController to
1317         UniscribeController on Windows.
1318         (WebCore::FontCascade::drawGlyphBuffer const): After deleting the m_offsets vector, there's
1319         no reason to consult it when drawing.
1320         * platform/graphics/GlyphBuffer.h: Remove m_offsets
1321         (WebCore::GlyphBuffer::clear):
1322         (WebCore::GlyphBuffer::advanceAt const):
1323         (WebCore::GlyphBuffer::add):
1324         (WebCore::GlyphBuffer::expandLastAdvance):
1325         (WebCore::GlyphBuffer::shrink):
1326         (WebCore::GlyphBuffer::swap):
1327         (WebCore::GlyphBuffer::offsetAt const): Deleted.
1328         * platform/graphics/win/FontCGWin.cpp:
1329         (WebCore::FontCascade::drawGlyphs): After deleting the m_offsets vector, there's no reason
1330         to consult it when drawing.
1331         * platform/graphics/win/FontCascadeDirect2D.cpp:
1332         (WebCore::FontCascade::drawGlyphs): Ditto.
1333         * platform/graphics/win/UniscribeController.cpp:
1334         (WebCore::UniscribeController::shapeAndPlaceItem): Bake in the offsets into the glyph advances.
1335
1336 2018-07-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1337
1338         [Curl] Crash on synchronous request via ResourceHandle.
1339         https://bugs.webkit.org/show_bug.cgi?id=188033
1340
1341         Reviewed by Alex Christensen.
1342
1343         The timing of instantiation of delegate was wrong. Move it inside `delegate` getter().
1344         This bug was introduced at r228577.
1345
1346         Test: http/tests/xmlhttprequest/simple-sync.html
1347
1348         * platform/network/curl/ResourceHandleCurl.cpp:
1349         (WebCore::ResourceHandle::start):
1350         (WebCore::ResourceHandle::delegate):
1351
1352 2018-07-03  David Fenton  <david_fenton@apple.com>
1353
1354         Unreviewed, rolling out r233461.
1355
1356         assertions triggered on ios11 Debug wk2
1357
1358         Reverted changeset:
1359
1360         "[iOS] Add assert to catch improper use of WebCore::Timer in
1361         UI Process"
1362         https://bugs.webkit.org/show_bug.cgi?id=185330
1363         https://trac.webkit.org/changeset/233461
1364
1365 2018-07-27  Chris Dumez  <cdumez@apple.com>
1366
1367         [Media] Avoid unnecessarily constructing *TrackList objects
1368         https://bugs.webkit.org/show_bug.cgi?id=188094
1369
1370         Reviewed by Eric Carlson.
1371
1372         Avoid unnecessarily constructing *TrackList objects as this is preventing us from making them
1373         ActiveDOMObjects.
1374
1375         * Modules/mediasource/MediaSource.cpp:
1376         (WebCore::MediaSource::removeSourceBuffer):
1377         * Modules/mediasource/SourceBuffer.cpp:
1378         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
1379         * html/HTMLMediaElement.cpp:
1380         (WebCore::HTMLMediaElement::addAudioTrack):
1381         (WebCore::HTMLMediaElement::addTextTrack):
1382         (WebCore::HTMLMediaElement::addVideoTrack):
1383         (WebCore::HTMLMediaElement::ensureAudioTracks):
1384         (WebCore::HTMLMediaElement::ensureTextTracks):
1385         (WebCore::HTMLMediaElement::ensureVideoTracks):
1386         (WebCore::HTMLMediaElement::setSelectedTextTrack):
1387         (WebCore::HTMLMediaElement::audioTracks): Deleted.
1388         (WebCore::HTMLMediaElement::textTracks): Deleted.
1389         (WebCore::HTMLMediaElement::videoTracks): Deleted.
1390         * html/HTMLMediaElement.h:
1391         (WebCore::HTMLMediaElement::audioTracks const):
1392         (WebCore::HTMLMediaElement::textTracks const):
1393         (WebCore::HTMLMediaElement::videoTracks const):
1394         * html/HTMLMediaElement.idl:
1395         * html/shadow/MediaControlElements.cpp:
1396         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
1397         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
1398         (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
1399         * html/track/TextTrack.cpp:
1400         (WebCore::TextTrack::setKind):
1401         (WebCore::TextTrack::trackIndex):
1402         (WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
1403         (WebCore::TextTrack::setLanguage):
1404         * html/track/VideoTrack.cpp:
1405         (WebCore::VideoTrack::setKind):
1406         (WebCore::VideoTrack::setLanguage):
1407         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1408         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
1409         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
1410
1411 2018-07-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1412
1413         [Curl] Set correct source info to ResourceResponse.
1414         https://bugs.webkit.org/show_bug.cgi?id=188069
1415
1416         Reviewed by Fujii Hironori.
1417
1418         ResourceResponseBase::Source::Network must be set by each ports. Curl port
1419         didn't set this.
1420
1421         Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
1422
1423         * platform/network/curl/ResourceResponseCurl.cpp:
1424         (WebCore::ResourceResponse::ResourceResponse):
1425
1426 2018-07-26  Andy VanWagoner  <andy@vanwagoner.family>
1427
1428         [INTL] Remove INTL sub-feature compile flags
1429         https://bugs.webkit.org/show_bug.cgi?id=188081
1430
1431         Reviewed by Michael Catanzaro.
1432
1433         Compile time feature flags for INTL sub features were removed, and are covered by existing tests.
1434
1435         * Configurations/FeatureDefines.xcconfig:
1436
1437 2018-07-26  Zalan Bujtas  <zalan@apple.com>
1438
1439         [Fullscreen] Do not create composited layers for renderers unless they are part of the fullscreen subtree.
1440         https://bugs.webkit.org/show_bug.cgi?id=188087
1441         <rdar://problem/42632124>
1442
1443         Reviewed by Simon Fraser.
1444
1445         Sibling composited layers prevent battery lifetime optimizations when in fullscreen.
1446
1447         Test: compositing/no-compositing-when-fulll-screen-is-present.html
1448
1449         * rendering/RenderLayer.cpp:
1450         (WebCore::RenderLayer::isDescendantOf const):
1451         * rendering/RenderLayer.h:
1452         * rendering/RenderLayerCompositor.cpp:
1453         (WebCore::isDescendantOfFullScreenLayer):
1454         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
1455         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
1456
1457 2018-07-26  Ryan Haddad  <ryanhaddad@apple.com>
1458
1459         Unreviewed, rolling out r234281.
1460
1461         Broke internal builds.
1462
1463         Reverted changeset:
1464
1465         "[Datalist] Add button to TextFieldInputs with a datalist"
1466         https://bugs.webkit.org/show_bug.cgi?id=187741
1467         https://trac.webkit.org/changeset/234281
1468
1469 2018-07-26  Aditya Keerthi  <akeerthi@apple.com>
1470
1471         [Datalist] Add button to TextFieldInputs with a datalist
1472         https://bugs.webkit.org/show_bug.cgi?id=187741
1473
1474         Reviewed by Tim Horton.
1475
1476         TextFieldInputs that have an associated datalist element should be drawn as
1477         combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
1478         is not height-resizable. Furthermore, the input should also be able to contain
1479         additional elements, such as the stepper for type=number and the cancel button
1480         for type=search. For these reasons, we draw a button at the end of the input,
1481         mimicking appearance of a combo box.
1482
1483         The list-button -webkit-appearance value was added to display the new button.
1484
1485         Tests: fast/forms/datalist/datalist-searchinput-appearance.html
1486                fast/forms/datalist/datalist-textinput-appearance.html
1487
1488         * Resources/ListButtonArrow.png: Added.
1489         * Resources/ListButtonArrow@2x.png: Added.
1490         * WebCore.xcodeproj/project.pbxproj:
1491         * css/CSSPrimitiveValueMappings.h:
1492         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1493         * css/CSSProperties.json:
1494         * css/CSSValueKeywords.in:
1495         * css/html.css:
1496         (input::-webkit-list-button):
1497         * html/HTMLInputElement.cpp:
1498         (WebCore::HTMLInputElement::dataListButtonElement const):
1499         (WebCore::HTMLInputElement::isShowingList const):
1500         * html/HTMLInputElement.h:
1501         * html/InputType.h:
1502         (WebCore::InputType::dataListButtonElement const):
1503         (WebCore::InputType::isShowingList const):
1504         * html/TextFieldInputType.cpp:
1505         (WebCore::TextFieldInputType::needsContainer const):
1506         (WebCore::TextFieldInputType::createShadowSubtree):
1507         (WebCore::TextFieldInputType::destroyShadowSubtree):
1508         (WebCore::TextFieldInputType::listAttributeTargetChanged):
1509         (WebCore::TextFieldInputType::dataListButtonElement const):
1510         (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
1511         (WebCore::TextFieldInputType::didCloseSuggestions):
1512         (WebCore::TextFieldInputType::isShowingList const):
1513         * html/TextFieldInputType.h:
1514         * html/shadow/DataListButtonElement.cpp: Added.
1515         (WebCore::DataListButtonElement::create):
1516         (WebCore::DataListButtonElement::DataListButtonElement):
1517         (WebCore::DataListButtonElement::~DataListButtonElement):
1518         (WebCore::DataListButtonElement::defaultEventHandler):
1519         * html/shadow/DataListButtonElement.h: Added.
1520         * platform/ThemeTypes.h:
1521         * rendering/RenderTheme.cpp:
1522         (WebCore::RenderTheme::adjustStyle):
1523         (WebCore::RenderTheme::adjustListButtonStyle const):
1524         * rendering/RenderTheme.h:
1525         * rendering/RenderThemeMac.h:
1526         * rendering/RenderThemeMac.mm:
1527         (-[WebListButtonCell drawWithFrame:inView:]):
1528         (WebCore::RenderThemeMac::paintListButtonForInput):
1529         (WebCore::RenderThemeMac::adjustListButtonStyle const):
1530         (WebCore::RenderThemeMac::paintTextField):
1531         (WebCore::RenderThemeMac::paintSearchField):
1532         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1533         (WebCore::RenderThemeMac::listButton const):
1534
1535 2018-07-26  Antoine Quint  <graouts@apple.com>
1536
1537         [Web Animations] Accelerated animations don't respect a positive delay value
1538         https://bugs.webkit.org/show_bug.cgi?id=186930
1539         <rdar://problem/41393393>
1540
1541         Reviewed by Dean Jackson.
1542
1543         Test: webanimations/accelerated-animation-with-delay.html
1544
1545         We would mistakenly clear the list of pending accelerated actions in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
1546         even if we failed to proceed because of the target element's renderer not being composited yet. Now, we clear the list after
1547         we've established we can apply them, and if we can't we inform the animation with a call to acceleratedStateDidChange() which
1548         will in turn call into the document timeline so that we may consider these animations on the next tick.
1549
1550         For this to work correctly we must make a change to DocumentTimeline::applyPendingAcceleratedAnimations() which only cleared
1551         its list of pending accelerated animations _after_ iterating through them, which would be problematic since we would now add
1552         animations to this list. That list is now copied and cleared prior to iterating through its members.
1553
1554         We also fix the naming of the m_pendingAcceleratedActions copy in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
1555         to have a more similar name.
1556
1557         * animation/DocumentTimeline.cpp:
1558         (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
1559         * animation/KeyframeEffectReadOnly.cpp:
1560         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
1561
1562 2018-07-26  Ross Kirsling  <ross.kirsling@sony.com>
1563
1564         String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
1565         https://bugs.webkit.org/show_bug.cgi?id=187963
1566
1567         Reviewed by Alex Christensen.
1568
1569         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1570         (WebCore::convert):
1571         * Modules/cache/DOMCache.cpp:
1572         (WebCore::hasResponseVaryStarHeaderValue):
1573         * Modules/cache/DOMCacheEngine.cpp:
1574         (WebCore::DOMCacheEngine::queryCacheMatch):
1575         * Modules/mediastream/PeerConnectionBackend.cpp:
1576         (WebCore::filterICECandidate):
1577         (WebCore::PeerConnectionBackend::filterSDP const):
1578         * Modules/websockets/WebSocketHandshake.cpp:
1579         (WebCore::WebSocketHandshake::checkResponseHeaders):
1580         * accessibility/AccessibilityObject.h:
1581         (WebCore::AccessibilityObject::determineARIADropEffects):
1582         * accessibility/AccessibilityRenderObject.cpp:
1583         (WebCore::AccessibilityRenderObject::determineARIADropEffects):
1584         * accessibility/AccessibilityRenderObject.h:
1585         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1586         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1587         * editing/cocoa/DataDetection.mm:
1588         (WebCore::DataDetection::shouldCancelDefaultAction):
1589         * editing/markup.cpp:
1590         (WebCore::fillContainerFromString):
1591         (WebCore::createFragmentFromText):
1592         * html/EmailInputType.cpp:
1593         (WebCore::EmailInputType::typeMismatchFor const):
1594         (WebCore::EmailInputType::sanitizeValue const):
1595         * html/HTMLInputElement.cpp:
1596         (WebCore::parseAcceptAttribute):
1597         * html/ValidationMessage.cpp:
1598         (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
1599         * html/canvas/WebGLRenderingContextBase.cpp:
1600         (WebCore::WebGLRenderingContextBase::compileShader):
1601         * inspector/agents/InspectorDOMAgent.cpp:
1602         (WebCore::InspectorDOMAgent::nodeForPath):
1603         * loader/FormSubmission.cpp:
1604         (WebCore::encodingFromAcceptCharset):
1605         * loader/ResourceTiming.cpp:
1606         (WebCore::passesTimingAllowCheck):
1607         * page/WindowFeatures.cpp:
1608         (WebCore::parseDisabledAdaptations):
1609         (WebCore::parseDialogFeaturesMap):
1610         * platform/URL.cpp:
1611         (WebCore::isIPv4Address):
1612         (WebCore::isIPv6Address):
1613         * platform/graphics/GLContext.cpp:
1614         (WebCore::GLContext::version):
1615         * platform/graphics/freetype/FontCacheFreeType.cpp:
1616         (WebCore::patternToFamilies):
1617         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1618         (WebCore::extractGStreamerOptionsFromCommandLine):
1619         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1620         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
1621         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
1622         * platform/gtk/PasteboardHelper.cpp:
1623         (WebCore::PasteboardHelper::fillSelectionData):
1624         * platform/gtk/SelectionData.cpp:
1625         (WebCore::SelectionData::setURIList):
1626         * platform/network/CacheValidation.cpp:
1627         (WebCore::collectVaryingRequestHeaders):
1628         * platform/network/HTTPParsers.cpp:
1629         (WebCore::filenameFromHTTPContentDisposition):
1630         (WebCore::parseXFrameOptionsHeader):
1631         (WebCore::parseAccessControlExposeHeadersAllowList):
1632         * platform/network/curl/CookieUtil.cpp:
1633         (WebCore::CookieUtil::parseCookieHeader):
1634         * platform/network/curl/CurlCacheEntry.cpp:
1635         (WebCore::CurlCacheEntry::loadResponseHeaders):
1636         * platform/network/curl/CurlCacheManager.cpp:
1637         (WebCore::CurlCacheManager::loadIndex):
1638         * platform/network/soup/CookieJarSoup.cpp:
1639         (WebCore::setCookiesFromDOM):
1640         * svg/SVGAnimationElement.cpp:
1641         (WebCore::SVGAnimationElement::parseAttribute):
1642         * svg/SVGToOTFFontConversion.cpp:
1643         (WebCore::SVGToOTFFontConverter::appendOS2Table):
1644         * svg/animation/SVGSMILElement.cpp:
1645         (WebCore::SVGSMILElement::parseBeginOrEnd):
1646         * testing/MockCDMFactory.cpp:
1647         (WebCore::MockCDM::sanitizeResponse const):
1648         (WebCore::MockCDMInstance::updateLicense):
1649         Update split/splitAllowingEmptyEntries usage.
1650
1651 2018-07-26  Nan Wang  <n_wang@apple.com>
1652
1653         AX: nothing returned for various previous text marker APIs from one div/p node to another
1654         https://bugs.webkit.org/show_bug.cgi?id=188071
1655
1656         Reviewed by Chris Fleizach.
1657
1658         TextIterator is emitting an extra '\n' at the end of the <p> node and there's no
1659         corresponding text node in the DOM tree, so we are not able to handle that for 
1660         text markers. Fixed it by ignoring the extra '\n' and anchor the text marker to 
1661         the previous child text node.
1662
1663         Test: accessibility/mac/text-marker-p-tags.html
1664
1665         * accessibility/AXObjectCache.cpp:
1666         (WebCore::AXObjectCache::traverseToOffsetInRange):
1667
1668 2018-07-26  Commit Queue  <commit-queue@webkit.org>
1669
1670         Unreviewed, rolling out r234181 and r234189.
1671         https://bugs.webkit.org/show_bug.cgi?id=188075
1672
1673         These are not needed right now (Requested by thorton on
1674         #webkit).
1675
1676         Reverted changesets:
1677
1678         "Enable Web Content Filtering on watchOS"
1679         https://bugs.webkit.org/show_bug.cgi?id=187979
1680         https://trac.webkit.org/changeset/234181
1681
1682         "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
1683         https://bugs.webkit.org/show_bug.cgi?id=187985
1684         https://trac.webkit.org/changeset/234189
1685
1686 2018-07-26  Timothy Hatcher  <timothy@apple.com>
1687
1688         Use the Page's appearance when converting pasteboard attributed strings.
1689         https://bugs.webkit.org/show_bug.cgi?id=188067
1690         rdar://problem/42632246
1691
1692         Reviewed by Wenson Hsieh.
1693
1694         * editing/cocoa/WebContentReaderCocoa.mm:
1695         (WebCore::createFragment): Create a LocalDefaultSystemAppearance based on the Page.
1696
1697 2018-07-26  Eric Carlson  <eric.carlson@apple.com>
1698
1699         Switching tabs should not close PiP window
1700         https://bugs.webkit.org/show_bug.cgi?id=188054
1701         <rdar://problem/41212379>
1702
1703         Reviewed by Jon Lee.
1704
1705         No new tests, fixes an existing test.
1706         
1707         Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
1708         In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
1709         selectors to close the PiP window. requestHideAndExitFullscreen is also called from 
1710         WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
1711         tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
1712         a new method that is only used by the delegate to exit PiP.
1713
1714         * platform/mac/VideoFullscreenInterfaceMac.h:
1715         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
1716         do-nothing method.
1717         * platform/mac/VideoFullscreenInterfaceMac.mm:
1718         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
1719         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
1720         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
1721         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
1722
1723 2018-07-04  Darin Adler  <darin@apple.com>
1724
1725         Improve WebGPU implementation, including using Metal Objective-C protocols more simply and correctly
1726         https://bugs.webkit.org/show_bug.cgi?id=187333
1727
1728         Reviewed by Sam Weinig.
1729
1730         - Used a new OBJC_PROTOCOL macro to handle things in the Metal API that are protocols.
1731           The code previously had used OBJC_CLASS, but that created unrelated classes.
1732           Fixing this allows removing many typecasts that were in the existing code, makes it
1733           ARC-compatible, and also allowed the compiler to detect a couple mistakes where we
1734           were calling methods that don't exist.
1735
1736         - Eliminated use of separate heap-allocated, reference-counted objects to
1737           hold pointers to Metal objects.
1738
1739         - Reduced the use of the WebGPU wrappers to pass around arguments inside the code.
1740           They are now used only as part of the DOM binding; the inner GPU objects are used
1741           whenever possible. This cuts down the number of separate functions needed a bit,
1742           since we don't always need accessors for the things inside the wrappers.
1743
1744         - Used references rather than pointers in many cases.
1745
1746         - Took out three kinds of null checks: 1) Unneeded ones since Objective-C has the
1747           "do nothing and return 0" behavior for methods without return values and that return
1748           integer scalars. 2) Checks that aren't needed because the code has clear, invariant
1749           guarantees that the pointer won't be null. 3) The simplest variant of (2), checks
1750           that can be obviated by using reference types instead of pointer types.
1751
1752         - For Metal-specific functions and data members, used the function name metal() and
1753           the data member name m_metal rather than longer wordier names with the word "platform"
1754           in them. We could use "platform" if these objects were platform-specific objects used
1755           in a cross-platform way that needed a common name. But in this case it's clearer to
1756           call them "metal" since we are dropping down to the metal with Metal API, and
1757           shared platform-independent code will not be accessing these.
1758
1759         - Fixed the common mistake of using "unsigned long" in our C++ code to match IDL.
1760           The "unsigned long" type in IDL correponds to the "unsigned" type in WebKit code.
1761
1762         - Used "const" more in the GPU functions that are wrappers around Metal objects to
1763           reflect the fact that these have semantics of smart pointers; most operations can be
1764           done without changing which object is pointed to. This allows us to use const
1765           references to pass things around without reference count churn.
1766
1767         - Reduced includes.
1768
1769         - Added "explicit" keywords where appropriate.
1770
1771         - Removed unused functions. In particular, removed non-Metal stub versions of the
1772           functions in the GPU classes: the right way to start a new port is to clone the
1773           Metal-specific files and turn the into stubs if needed, it does not make it
1774           significantly more convenient to have stubs in the platform independent files,
1775           especially ones that are not compiled for any platform.
1776
1777         - Removed most the WEBCORE_EXPORT in the GPU headers; left only what's needed to
1778           support testing with TestWebKitAPI.
1779
1780         - Fixed two storage leaks in GPUDevice by adding missing adoptNS.
1781
1782         * PlatformMac.cmake: Moved files from platform/graphics/cocoa to platform/graphics/metal.
1783         * SourcesCocoa.txt: Ditto.
1784         * WebCore.xcodeproj/project.pbxproj: Ditto. Fixed paths on some files and groups/directories.
1785         Made the platform files that abstract GPU all be "project" visible, not "private", since
1786         they don't need to be visible outside WebCore. Removed reference to FontSelectionKeywordValues.h,
1787         which does not seem to be a source file, a derived source file, or mentioned in any change log.
1788
1789         * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
1790         (WebCore::toJSNewlyCreated): Create the correct wrapper for a
1791         WebGPURenderPassDepthAttachmentDescriptor. The old code would instead
1792         create a WebGPURenderPassAttachmentDescriptor wrapper, which can't be
1793         used to access the clearDepth attribute.
1794
1795         * html/canvas/WebGPUBuffer.cpp:
1796         (WebCore::WebGPUBuffer::create): Use more references rather than pointers for things
1797         that are never null. Added comment about possibly returning null on failure in future.
1798         (WebCore::WebGPUBuffer::WebGPUBuffer): Updated to store the GPUBuffer inside the class
1799         instead of in a separate reference counted object.
1800         * html/canvas/WebGPUBuffer.h: Ditto.
1801
1802         * html/canvas/WebGPUCommandBuffer.cpp:
1803         (WebCore::WebGPUCommandBuffer::create): Use references and lower level types.
1804         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): Store the GPUCommandBuffer
1805         inside the class.
1806         (WebCore::WebGPUCommandBuffer::commit): Removed unneeded null checks.
1807         (WebCore::WebGPUCommandBuffer::presentDrawable): Ditto.
1808         (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
1809         Removed unneeded local variable.
1810         (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): Ditto.
1811         (WebCore::WebGPUCommandBuffer::completed): Store the DOMPromiseProxy in this
1812         class, not in GPUCommandBuffer.
1813         * html/canvas/WebGPUCommandBuffer.h: Ditto.
1814
1815         * html/canvas/WebGPUCommandQueue.cpp:
1816         (WebCore::WebGPUCommandQueue::create): Use references and lower level types.
1817         (WebCore::WebGPUCommandQueue::WebGPUCommandQueue): Store the GPUCommandQueue
1818         inside the class.
1819         (WebCore::WebGPUCommandQueue::createCommandBuffer): Ditto.
1820         * html/canvas/WebGPUCommandQueue.h: Ditto.
1821         * html/canvas/WebGPUCommandQueue.idl: The return value of createCommandBuffer
1822         is no longer nullable.
1823
1824         * html/canvas/WebGPUComputeCommandEncoder.cpp:
1825         (WebCore::WebGPUComputeCommandEncoder::create): More of the same.
1826         (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): Ditto.
1827         (WebCore::WebGPUComputeCommandEncoder::setComputePipelineState): Ditto.
1828         (WebCore::WebGPUComputeCommandEncoder::setBuffer): Ditto.
1829         (WebCore::WebGPUComputeCommandEncoder::dispatch): Ditto.
1830         (WebCore::WebGPUComputeCommandEncoder::endEncoding): Ditto.
1831         * html/canvas/WebGPUComputeCommandEncoder.h: Ditto.
1832
1833         * html/canvas/WebGPUComputePipelineState.cpp:
1834         (WebCore::WebGPUComputePipelineState::create): More of the same.
1835         (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): Ditto.
1836         * html/canvas/WebGPUComputePipelineState.h: Ditto.
1837
1838         * html/canvas/WebGPUDepthStencilDescriptor.cpp:
1839         (WebCore::WebGPUDepthStencilDescriptor::create): More of the same.
1840         (WebCore::WebGPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
1841         (WebCore::WebGPUDepthStencilDescriptor::setDepthWriteEnabled): Ditto.
1842         (WebCore::WebGPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
1843         (WebCore::WebGPUDepthStencilDescriptor::setDepthCompareFunction): Ditto.
1844         * html/canvas/WebGPUDepthStencilDescriptor.h: Ditto. Also fixed a bug
1845         where m_depthCompareFunction was uninitialized in newly created objects.
1846
1847         * html/canvas/WebGPUDepthStencilState.cpp:
1848         (WebCore::WebGPUDepthStencilState::create): More of the same.
1849         (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState): Ditto.
1850         (WebCore::WebGPUDepthStencilState::label const): Ditto.
1851         (WebCore::WebGPUDepthStencilState::setLabel): Ditto.
1852         * html/canvas/WebGPUDepthStencilState.h: Ditto.
1853
1854         * html/canvas/WebGPUDrawable.cpp:
1855         (WebCore::WebGPUDrawable::create): More of the same.
1856         (WebCore::WebGPUDrawable::WebGPUDrawable): Ditto.
1857         * html/canvas/WebGPUDrawable.h: Ditto.
1858
1859         * html/canvas/WebGPUEnums.cpp: Removed some stray const.
1860         * html/canvas/WebGPUEnums.h: Ditto.
1861
1862         * html/canvas/WebGPUFunction.cpp:
1863         (WebCore::WebGPUFunction::create): More of the same.
1864         (WebCore::WebGPUFunction::WebGPUFunction): Ditto.
1865         * html/canvas/WebGPUFunction.h: Ditto.
1866
1867         * html/canvas/WebGPULibrary.cpp:
1868         (WebCore::WebGPULibrary::create): More of the same.
1869         (WebCore::WebGPULibrary::WebGPULibrary): Ditto.
1870         (WebCore::WebGPULibrary::functionNames const): Ditto.
1871         (WebCore::WebGPULibrary::functionWithName const): Ditto.
1872         * html/canvas/WebGPULibrary.h: Ditto.
1873
1874         * html/canvas/WebGPUObject.cpp:
1875         (WebCore::WebGPUObject::WebGPUObject):
1876         (WebCore::WebGPUObject::deleteObject): Deleted this unused function.
1877         We can bring it back later if we find we need it the way we did with the
1878         WebGL implementation, but currently it's a never-called stub. Also
1879         deleted the isDeleted and m_deleted for the same reason.
1880         * html/canvas/WebGPUObject.h: Ditto.
1881
1882         * html/canvas/WebGPURenderCommandEncoder.cpp:
1883         (WebCore::WebGPURenderCommandEncoder::create): More of the same.
1884         (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder): Ditto.
1885         (WebCore::WebGPURenderCommandEncoder::setRenderPipelineState): Ditto.
1886         (WebCore::WebGPURenderCommandEncoder::setDepthStencilState): Ditto.
1887         (WebCore::WebGPURenderCommandEncoder::setVertexBuffer): Ditto.
1888         (WebCore::WebGPURenderCommandEncoder::setFragmentBuffer): Ditto.
1889         (WebCore::WebGPURenderCommandEncoder::drawPrimitives): Ditto.
1890         (WebCore::WebGPURenderCommandEncoder::endEncoding): Ditto.
1891         * html/canvas/WebGPURenderCommandEncoder.h: Ditto.
1892
1893         * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
1894         (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
1895         More of the same.
1896         (WebCore::WebGPURenderPassAttachmentDescriptor::loadAction const): Ditto.
1897         (WebCore::WebGPURenderPassAttachmentDescriptor::setLoadAction): Ditto.
1898         (WebCore::WebGPURenderPassAttachmentDescriptor::storeAction const): Ditto.
1899         (WebCore::WebGPURenderPassAttachmentDescriptor::setStoreAction): Ditto.
1900         (WebCore::WebGPURenderPassAttachmentDescriptor::texture const): Ditto.
1901         (WebCore::WebGPURenderPassAttachmentDescriptor::setTexture): Ditto.
1902         * html/canvas/WebGPURenderPassAttachmentDescriptor.h: Ditto.
1903
1904         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
1905         (WebCore::WebGPURenderPassColorAttachmentDescriptor::create): More of the same.
1906         (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor): Ditto.
1907         (WebCore::WebGPURenderPassColorAttachmentDescriptor::descriptor const): Ditto.
1908         (WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
1909         (WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor): Ditto.
1910         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h: Ditto.
1911
1912         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
1913         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create): More of the same.
1914         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor): Ditto.
1915         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
1916         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth): Ditto.
1917         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::descriptor const): Ditto.
1918         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h: Ditto.
1919
1920         * html/canvas/WebGPURenderPassDescriptor.cpp:
1921         (WebCore::WebGPURenderPassDescriptor::create): More of the same.
1922         (WebCore::WebGPURenderPassDescriptor::depthAttachment): Ditto.
1923         (WebCore::WebGPURenderPassDescriptor::colorAttachments): Ditto.
1924         * html/canvas/WebGPURenderPassDescriptor.h: Ditto.
1925
1926         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
1927         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create): More of the same.
1928         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor): Ditto.
1929         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
1930         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::setPixelFormat): Ditto.
1931         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h: Ditto.
1932
1933         * html/canvas/WebGPURenderPipelineDescriptor.cpp:
1934         (WebCore::WebGPURenderPipelineDescriptor::create): More of the same.
1935         (WebCore::WebGPURenderPipelineDescriptor::vertexFunction const): Ditto.
1936         (WebCore::WebGPURenderPipelineDescriptor::setVertexFunction): Ditto.
1937         (WebCore::WebGPURenderPipelineDescriptor::fragmentFunction const): Ditto.
1938         (WebCore::WebGPURenderPipelineDescriptor::setFragmentFunction): Ditto.
1939         (WebCore::WebGPURenderPipelineDescriptor::colorAttachments): Ditto.
1940         (WebCore::WebGPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
1941         (WebCore::WebGPURenderPipelineDescriptor::setDepthAttachmentPixelFormat): Ditto.
1942         (WebCore::WebGPURenderPipelineDescriptor::reset): Ditto.
1943         * html/canvas/WebGPURenderPipelineDescriptor.h: Ditto.
1944
1945         * html/canvas/WebGPURenderPipelineState.cpp:
1946         (WebCore::WebGPURenderPipelineState::create): More of the same.
1947         (WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState): Ditto.
1948         (WebCore::WebGPURenderPipelineState::label const): Ditto.
1949         (WebCore::WebGPURenderPipelineState::setLabel): Ditto.
1950         * html/canvas/WebGPURenderPipelineState.h: Ditto.
1951
1952         * html/canvas/WebGPURenderingContext.cpp:
1953         (WebCore::WebGPURenderingContext::create): More of the same.
1954         (WebCore::WebGPURenderingContext::WebGPURenderingContext): Ditto.
1955         (WebCore::WebGPURenderingContext::initializeNewContext): Ditto.
1956         (WebCore::WebGPURenderingContext::platformLayer const): Ditto.
1957         (WebCore::WebGPURenderingContext::markLayerComposited): Ditto.
1958         (WebCore::WebGPURenderingContext::reshape): Ditto.
1959         (WebCore::WebGPURenderingContext::createLibrary): Ditto.
1960         (WebCore::WebGPURenderingContext::createRenderPipelineState): Ditto.
1961         (WebCore::WebGPURenderingContext::createDepthStencilState): Ditto.
1962         (WebCore::WebGPURenderingContext::createComputePipelineState): Ditto.
1963         (WebCore::WebGPURenderingContext::createCommandQueue): Ditto.
1964         (WebCore::WebGPURenderingContext::nextDrawable): Ditto.
1965         (WebCore::WebGPURenderingContext::createBuffer): Ditto.
1966         (WebCore::WebGPURenderingContext::createTexture): Ditto.
1967         * html/canvas/WebGPURenderingContext.h: Made many functions final and
1968         private.
1969         * html/canvas/WebGPURenderingContext.idl: The return value of most of
1970         the create functions are no longer nullable.
1971
1972         * html/canvas/WebGPUSize.h: Use "unsigned" instead of "unsigned long".
1973
1974         * html/canvas/WebGPUTexture.cpp:
1975         (WebCore::WebGPUTexture::createFromDrawableTexture): More of the same.
1976         (WebCore::WebGPUTexture::create): Ditto.
1977         (WebCore::WebGPUTexture::WebGPUTexture): Ditto.
1978         * html/canvas/WebGPUTexture.h: Ditto.
1979
1980         * html/canvas/WebGPUTextureDescriptor.cpp:
1981         (WebCore::WebGPUTextureDescriptor::create): More of the same.
1982         (WebCore::WebGPUTextureDescriptor::WebGPUTextureDescriptor): Ditto.
1983         (WebCore::WebGPUTextureDescriptor::width const): Ditto.
1984         (WebCore::WebGPUTextureDescriptor::setWidth): Ditto.
1985         (WebCore::WebGPUTextureDescriptor::height const): Ditto.
1986         (WebCore::WebGPUTextureDescriptor::setHeight): Ditto.
1987         (WebCore::WebGPUTextureDescriptor::sampleCount const): Ditto.
1988         (WebCore::WebGPUTextureDescriptor::setSampleCount): Ditto.
1989         (WebCore::WebGPUTextureDescriptor::textureType const): Ditto.
1990         (WebCore::WebGPUTextureDescriptor::setTextureType): Ditto.
1991         (WebCore::WebGPUTextureDescriptor::storageMode const): Ditto.
1992         (WebCore::WebGPUTextureDescriptor::setStorageMode): Ditto.
1993         (WebCore::WebGPUTextureDescriptor::usage const): Ditto.
1994         (WebCore::WebGPUTextureDescriptor::setUsage): Ditto.
1995         * html/canvas/WebGPUTextureDescriptor.h: Ditto.
1996
1997         * platform/graphics/metal/GPUBufferMetal.mm: Moved from "cocoa" directory.
1998         (WebCore::GPUBuffer::GPUBuffer): Simplify code using references and the
1999         "metal" naming.
2000
2001         * platform/graphics/metal/GPUCommandBufferMetal.mm:
2002         (WebCore::GPUCommandBuffer::GPUCommandBuffer): Take a function to be called as the
2003         completed handler and set it up.
2004         (WebCore::GPUCommandBuffer::presentDrawable const): Ditto.
2005         (WebCore::GPUCommandBuffer::commit const): Ditto.
2006         (WebCore::GPUCommandBuffer::addCompletedHandler): Deleted.
2007
2008         * platform/graphics/metal/GPUCommandQueueMetal.mm:
2009         (WebCore::GPUCommandQueue::GPUCommandQueue): Ditto. Also rewrote label handling a bit.
2010         (WebCore::GPUCommandQueue::label const): Ditto.
2011         (WebCore::GPUCommandQueue::setLabel const): Ditto.
2012
2013         * platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
2014         (WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder): Ditto.
2015         (WebCore::GPUComputeCommandEncoder::setComputePipelineState const): Ditto.
2016         (WebCore::GPUComputeCommandEncoder::setBuffer const): Ditto.
2017         (WebCore::GPUComputeCommandEncoder::dispatch const): Ditto.
2018         (WebCore::GPUComputeCommandEncoder::endEncoding const): Ditto.
2019
2020         * platform/graphics/metal/GPUComputePipelineStateMetal.mm:
2021         (WebCore::GPUComputePipelineState::GPUComputePipelineState): Ditto.
2022
2023         * platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
2024         (WebCore::GPUDepthStencilDescriptor::GPUDepthStencilDescriptor): Ditto.
2025         (WebCore::GPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
2026         (WebCore::GPUDepthStencilDescriptor::setDepthWriteEnabled const): Ditto.
2027         (WebCore::GPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
2028         (WebCore::GPUDepthStencilDescriptor::setDepthCompareFunction const): Ditto.
2029
2030         * platform/graphics/metal/GPUDepthStencilStateMetal.mm:
2031         (WebCore::GPUDepthStencilState::GPUDepthStencilState): Ditto.
2032         (WebCore::GPUDepthStencilState::label const): Ditto.
2033         (WebCore::GPUDepthStencilState::setLabel const): Ditto. This is one of the
2034         functions that was calling a method that does not exist. Added a comment.
2035
2036         * platform/graphics/metal/GPUDeviceMetal.mm:
2037         (WebCore::GPUDevice::GPUDevice): Ditto. Also fixed two storage leaks where
2038         we neglected to do adoptNS on the result of MTLCreateSystemDefaultDevice and
2039         on the result of -[[WebGPULayer alloc] initWithGPUDevice:].
2040         (WebCore::GPUDevice::reshape const): Ditto.
2041         (WebCore::GPUDevice::platformLayer const): Ditto.
2042         (WebCore::GPUDevice::operator! const): Ditto.
2043
2044         * platform/graphics/metal/GPUDrawableMetal.mm:
2045         (WebCore::GPUDrawable::GPUDrawable): Ditto.
2046         (WebCore::GPUDrawable::release): Ditto.
2047         (WebCore::GPUDrawable::metal const): Ditto.
2048         (WebCore::GPUDrawable::texture const): Ditto.
2049
2050         * platform/graphics/metal/GPUFunctionMetal.mm:
2051         (WebCore::GPUFunction::GPUFunction): Ditto.
2052         (WebCore::GPUFunction::name const): Ditto.
2053         (WebCore::GPUFunction::metal const): Ditto.
2054         (WebCore::GPUFunction::operator! const): Ditto.
2055
2056         * platform/graphics/metal/GPULibraryMetal.mm:
2057         (WebCore::GPULibrary::GPULibrary): Ditto.
2058         (WebCore::GPULibrary::label const): Ditto.
2059         (WebCore::GPULibrary::setLabel const): Ditto.
2060         (WebCore::GPULibrary::functionNames const): Ditto.
2061         (WebCore::GPULibrary::metal const): Ditto.
2062
2063         * platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
2064         (WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder): Ditto.
2065         (WebCore::GPURenderCommandEncoder::setRenderPipelineState const): Ditto.
2066         (WebCore::GPURenderCommandEncoder::setDepthStencilState const): Ditto.
2067         (WebCore::GPURenderCommandEncoder::setVertexBuffer const): Ditto.
2068         (WebCore::GPURenderCommandEncoder::setFragmentBuffer const): Ditto.
2069         (WebCore::GPURenderCommandEncoder::drawPrimitives const): Ditto.
2070         (WebCore::GPURenderCommandEncoder::endEncoding const): Ditto.
2071
2072         * platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
2073         (WebCore::GPURenderPassAttachmentDescriptor::GPURenderPassAttachmentDescriptor): Ditto.
2074         (WebCore::GPURenderPassAttachmentDescriptor::loadAction const): Ditto.
2075         (WebCore::GPURenderPassAttachmentDescriptor::setLoadAction const): Ditto.
2076         (WebCore::GPURenderPassAttachmentDescriptor::storeAction const): Ditto.
2077         (WebCore::GPURenderPassAttachmentDescriptor::setStoreAction const): Ditto.
2078         (WebCore::GPURenderPassAttachmentDescriptor::setTexture const): Ditto.
2079
2080         * platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
2081         (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor): Ditto.
2082         (WebCore::GPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
2083         (WebCore::GPURenderPassColorAttachmentDescriptor::setClearColor const): Ditto.
2084         (WebCore::GPURenderPassColorAttachmentDescriptor::metal const): Ditto.
2085
2086         * platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
2087         (WebCore::GPURenderPassDepthAttachmentDescriptor::GPURenderPassDepthAttachmentDescriptor): Ditto.
2088         (WebCore::GPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
2089         (WebCore::GPURenderPassDepthAttachmentDescriptor::setClearDepth const): Ditto.
2090         (WebCore::GPURenderPassDepthAttachmentDescriptor::metal const): Ditto.
2091
2092         * platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
2093         (WebCore::GPURenderPassDescriptor::GPURenderPassDescriptor): Ditto.
2094         (WebCore::GPURenderPassDescriptor::colorAttachments const): Ditto.
2095         (WebCore::GPURenderPassDescriptor::depthAttachment const): Ditto.
2096         (WebCore::GPURenderPassDescriptor::metal const): Ditto.
2097
2098         * platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
2099         (WebCore::GPURenderPipelineColorAttachmentDescriptor::GPURenderPipelineColorAttachmentDescriptor): Ditto.
2100         (WebCore::GPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
2101         (WebCore::GPURenderPipelineColorAttachmentDescriptor::setPixelFormat const): Ditto.
2102         (WebCore::GPURenderPipelineColorAttachmentDescriptor::metal const): Ditto.
2103
2104         * platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
2105         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Ditto.
2106         (WebCore::GPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
2107         (WebCore::GPURenderPipelineDescriptor::setDepthAttachmentPixelFormat const): Ditto.
2108         (WebCore::GPURenderPipelineDescriptor::setVertexFunction const): Ditto.
2109         (WebCore::GPURenderPipelineDescriptor::setFragmentFunction const): Ditto.
2110         (WebCore::GPURenderPipelineDescriptor::colorAttachments const): Ditto.
2111         (WebCore::GPURenderPipelineDescriptor::reset const): Ditto.
2112         (WebCore::GPURenderPipelineDescriptor::metal const): Ditto.
2113
2114         * platform/graphics/metal/GPURenderPipelineStateMetal.mm:
2115         (WebCore::GPURenderPipelineState::GPURenderPipelineState): Ditto.
2116         (WebCore::GPURenderPipelineState::label const): Ditto.
2117         (WebCore::GPURenderPipelineState::setLabel const): Ditto. This is one of the
2118         functions that was calling a method that does not exist. Added a comment.
2119         (WebCore::GPURenderPipelineState::metal const): Ditto.
2120
2121         * platform/graphics/metal/GPUTextureDescriptorMetal.mm:
2122         (WebCore::GPUTextureDescriptor::GPUTextureDescriptor): Ditto.
2123         (WebCore::GPUTextureDescriptor::width const): Ditto.
2124         (WebCore::GPUTextureDescriptor::setWidth const): Ditto.
2125         (WebCore::GPUTextureDescriptor::height const): Ditto.
2126         (WebCore::GPUTextureDescriptor::setHeight const): Ditto.
2127         (WebCore::GPUTextureDescriptor::sampleCount const): Ditto.
2128         (WebCore::GPUTextureDescriptor::setSampleCount const): Ditto.
2129         (WebCore::GPUTextureDescriptor::textureType const): Ditto.
2130         (WebCore::GPUTextureDescriptor::setTextureType const): Ditto.
2131         (WebCore::GPUTextureDescriptor::storageMode const): Ditto.
2132         (WebCore::GPUTextureDescriptor::setStorageMode const): Ditto.
2133         (WebCore::GPUTextureDescriptor::usage const): Ditto.
2134         (WebCore::GPUTextureDescriptor::setUsage const): Ditto.
2135         (WebCore::GPUTextureDescriptor::metal const): Ditto.
2136
2137         * platform/graphics/metal/GPUTextureMetal.mm:
2138         (WebCore::GPUTexture::GPUTexture): Ditto.
2139         (WebCore::GPUTexture::width const): Ditto.
2140         (WebCore::GPUTexture::height const): Ditto.
2141         (WebCore::GPUTexture::metal const): Ditto.
2142
2143         * platform/graphics/gpu/GPUBuffer.cpp: Removed unused stubs.
2144         (WebCore::GPUBuffer::length const): Moved this function here since it has
2145         a useful platform-independent implementation.
2146
2147         * platform/graphics/gpu/GPUBuffer.h: Use OBJC_PROTOCOL for MTLBuffer.
2148         Did the other thigs mentioned above: USE(METAL), remove WEBCORE_EXPORT,
2149         no longer be RefCounted, etc.
2150
2151         * platform/graphics/gpu/GPUCommandBuffer.cpp: Ditto.
2152         * platform/graphics/gpu/GPUCommandBuffer.h: Ditto. Use OBJC_PROTOCOL
2153         for MTLCommandBuffer.
2154
2155         * platform/graphics/gpu/GPUCommandQueue.cpp: Ditto.
2156         * platform/graphics/gpu/GPUCommandQueue.h: Ditto. Use OBJC_PROTOCOL for
2157         MTLCommandQueue.
2158
2159         * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Ditto.
2160         * platform/graphics/gpu/GPUComputeCommandEncoder.h: Ditto. Use OBJC_PROTOCOL for
2161         MTLComputeCommandEncoder.
2162
2163         * platform/graphics/gpu/GPUComputePipelineState.cpp: Ditto.
2164         * platform/graphics/gpu/GPUComputePipelineState.h: Ditto. Use OBJC_PROTOCOL for
2165         MTLComputePipelineState.
2166
2167         * platform/graphics/gpu/GPUDepthStencilDescriptor.cpp: Ditto.
2168         * platform/graphics/gpu/GPUDepthStencilDescriptor.h: Ditto.
2169
2170         * platform/graphics/gpu/GPUDepthStencilState.cpp: Ditto.
2171         * platform/graphics/gpu/GPUDepthStencilState.h: Ditto. Use OBJC_PROTOCOL for
2172         MTLDepthStencilState.
2173
2174         * platform/graphics/gpu/GPUDevice.cpp: Ditto.
2175         * platform/graphics/gpu/GPUDevice.h: Ditto. Use OBJC_PROTOCOL for MTLDevice.
2176
2177         * platform/graphics/gpu/GPUDrawable.cpp: Ditto.
2178         * platform/graphics/gpu/GPUDrawable.h: Ditto. Use OBJC_PROTOCOL for
2179         MTLDrawable and MTLTexture.
2180
2181         * platform/graphics/gpu/GPUEnums.h: Tweaked formatting.
2182
2183         * platform/graphics/gpu/GPUFunction.cpp: Ditto.
2184         * platform/graphics/gpu/GPUFunction.h: Ditto. Use OBJC_PROTOCOL for
2185         MTLFunction.
2186
2187         * platform/graphics/gpu/GPULibrary.cpp: Ditto.
2188         * platform/graphics/gpu/GPULibrary.h: Ditto. Use OBJC_PROTOCOL for
2189         MTLLibrary.
2190
2191         * platform/graphics/gpu/GPURenderCommandEncoder.cpp: Ditto.
2192         * platform/graphics/gpu/GPURenderCommandEncoder.h: Ditto.
2193         Use OBJC_PROTOCOL for MTLRenderCommandEncoder.
2194
2195         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp: Ditto.
2196         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h: Ditto.
2197
2198         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp: Ditto.
2199         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Ditto.
2200
2201         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp: Ditto.
2202         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h: Ditto.
2203
2204         * platform/graphics/gpu/GPURenderPassDescriptor.cpp: Ditto.
2205         * platform/graphics/gpu/GPURenderPassDescriptor.h: Ditto.
2206
2207         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp: Ditto.
2208         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h: Ditto.
2209
2210         * platform/graphics/gpu/GPURenderPipelineDescriptor.cpp: Ditto.
2211         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Ditto.
2212
2213         * platform/graphics/gpu/GPURenderPipelineState.cpp: Ditto.
2214         * platform/graphics/gpu/GPURenderPipelineState.h: Ditto. Use OBJC_PROTOCOL
2215         for MTLRenderPipelineState.
2216
2217         * platform/graphics/gpu/GPUSize.h: Use "unsigned" instead of "unsigned long".
2218
2219         * platform/graphics/gpu/GPUTexture.cpp: Ditto.
2220         * platform/graphics/gpu/GPUTexture.h: Ditto. Use OBJC_PROTOCOL for
2221         MTLTexture.
2222
2223         * platform/graphics/gpu/GPUTextureDescriptor.cpp: Ditto.
2224         * platform/graphics/gpu/GPUTextureDescriptor.h: Ditto.
2225
2226 2018-07-26  Zalan Bujtas  <zalan@apple.com>
2227
2228         [LFC][Floating] Add skeleton for basic positioning.
2229         https://bugs.webkit.org/show_bug.cgi?id=187974
2230
2231         Reviewed by Antti Koivisto.
2232
2233         Add floating boxes to an empty floating context.
2234
2235         * layout/FloatingContext.cpp:
2236         (WebCore::Layout::FloatingContext::FloatingContext):
2237         (WebCore::Layout::FloatingContext::computePosition):
2238         * layout/FloatingContext.h:
2239         (WebCore::Layout::FloatingContext::floatingState const):
2240         (WebCore::Layout::FloatingContext::layoutContext const):
2241         * layout/FloatingState.cpp:
2242         (WebCore::Layout::FloatingState::FloatingState):
2243         (WebCore::Layout::FloatingState::append):
2244         * layout/FloatingState.h:
2245         (WebCore::Layout::FloatingState::create):
2246         (WebCore::Layout::FloatingState::isEmpty const):
2247         (WebCore::Layout::FloatingState::layoutContext const):
2248         * layout/FormattingState.h:
2249         * layout/LayoutContext.cpp:
2250         (WebCore::Layout::LayoutContext::establishedFormattingState):
2251         * layout/LayoutContext.h:
2252         * layout/blockformatting/BlockFormattingContext.cpp:
2253         (WebCore::Layout::BlockFormattingContext::layout const):
2254         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2255         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2256         * layout/blockformatting/BlockFormattingContext.h:
2257         * layout/blockformatting/BlockInvalidation.cpp:
2258         (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
2259         * layout/layouttree/LayoutBox.cpp:
2260         (WebCore::Layout::Box::isLeftFloatingPositioned const):
2261         (WebCore::Layout::Box::isRightFloatingPositioned const):
2262         * layout/layouttree/LayoutBox.h:
2263
2264 2018-07-26  Zalan Bujtas  <zalan@apple.com>
2265
2266         [LFC][BFC] Do not try to access containing block's height during descendant height computation
2267         https://bugs.webkit.org/show_bug.cgi?id=187970
2268
2269         Reviewed by Antti Koivisto.
2270
2271         Mostly becasue in BFC, we compute the descendents' height first so the containing block's height is probably not computed yet.
2272
2273         * layout/FormattingContextGeometry.cpp:
2274         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
2275         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2276         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2277
2278 2018-07-26  Frederic Wang  <fwang@igalia.com>
2279
2280         Unreviewed, add bug references into FIXME comments for CSSOM View API
2281
2282         * dom/Element.idl:
2283         * page/ScrollToOptions.idl:
2284
2285 2018-07-26  Zalan Bujtas  <zalan@apple.com>
2286
2287         [LFC][BFC] assert-not-implemented-yet on inflow non-replaced height when style is not fixed/auto.
2288         https://bugs.webkit.org/show_bug.cgi?id=187969
2289
2290         Reviewed by Antti Koivisto.
2291
2292         Assert on unsupported height types when computing inflow non-replaced height.
2293
2294         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2295         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2296
2297 2018-07-26  Antoine Quint  <graouts@apple.com>
2298
2299         [Web Animations] REGRESSION: transition added immediately after element creation doesn't work
2300         https://bugs.webkit.org/show_bug.cgi?id=187942
2301
2302         Reviewed by Dean Jackson.
2303
2304         Tests: webanimations/accelerated-transition-by-removing-property.html
2305                webanimations/partly-accelerated-transition-by-removing-property.html
2306
2307         The Style::TreeResolver::createAnimatedElementUpdate() function expected a flag to be set that indicates that
2308         running animations on an element should yield a change in composited state for that element's layer. We did not
2309         have code accounting for this flag in the Web Animations engine. We now have a resolveAnimationsForElement()
2310         method on DocumentTimeline which looks at all animations resolved on the element and see if all of them are
2311         running accelerated and whether at least one of them is pending. In that case, we set the shouldRecompositeLayer
2312         flag in createAnimatedElementUpdate() to true which guarantees the element's layer will have a backing when
2313         we attempt to start the animation in KeyframeEffectReadOnly::applyPendingAcceleratedActions() where we would
2314         have previously failed to have layer-backed renderer to perform an accelerated animation on (under certain
2315         circumstances, see test).
2316
2317         * animation/DocumentTimeline.cpp:
2318         (WebCore::DocumentTimeline::resolveAnimationsForElement):
2319         * animation/DocumentTimeline.h:
2320         * animation/KeyframeEffectReadOnly.h:
2321         (WebCore::KeyframeEffectReadOnly::hasPendingAcceleratedAction const):
2322         * style/StyleTreeResolver.cpp:
2323         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2324
2325 2018-07-25  Chris Dumez  <cdumez@apple.com>
2326
2327         Allow ActiveDOMObject's canSuspend / suspend / resume overrides to destroy ActiveDOMObjects
2328         https://bugs.webkit.org/show_bug.cgi?id=188025
2329
2330         Reviewed by Alex Christensen.
2331
2332         Apply the same logic as in ScriptExecutionContext::stopActiveDOMObjects() to support destruction of
2333         ActiveDOMObjects while we're calling ActiveDOMObject's canSuspend / suspend / resume overrides.
2334
2335         We copy m_activeDOMObjects into a Vector and iterate over the copy instead of m_activeDOMObjects.
2336         Since ActiveDOMObject is not RefCounted or CanMakeWeakPtr, we verify that the raw pointer is still
2337         valid by checking if m_activeDOMObjects still contains it, as we iterate. This is safe as the
2338         ActiveDOMObject destructor removes the object from ScriptExecutionContext::m_activeDOMObjects.
2339         New ActiveDOMObjects with the same pointer value cannot be created while we iterate as we already
2340         prevent the construction of new ActiveDOMObjects while we iterate via RELEASE_ASSERT().
2341
2342         * dom/ScriptExecutionContext.cpp:
2343         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
2344         (WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
2345         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
2346         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
2347         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
2348         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
2349         * dom/ScriptExecutionContext.h:
2350
2351 2018-07-25  Justin Fan  <justin_fan@apple.com>
2352
2353         Systems with no NSScreens hitting assertion in rendererIDForDisplay when creating WebGL context
2354         https://bugs.webkit.org/show_bug.cgi?id=188023
2355         <rdar://problem/42476622>
2356
2357         Reviewed by Simon Fraser.
2358
2359         On systems with no NSScreens, PlatformScreenMac's screenData map is not populated; rendererIDForDisplay
2360         will thus hit an assertion rather than returning 0. Removing the assertion for now. 
2361
2362         Covered by existing tests.
2363
2364         * platform/mac/PlatformScreenMac.mm:
2365         (WebCore::rendererIDForDisplay):
2366
2367 2018-07-25  Zalan Bujtas  <zalan@apple.com>
2368
2369         Build fix after r234215. Unreviewed.
2370
2371         * rendering/RenderTheme.cpp:
2372
2373 2018-07-25  Zalan Bujtas  <zalan@apple.com>
2374
2375         REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
2376         https://bugs.webkit.org/show_bug.cgi?id=188018
2377         <rdar://problem/42517520>
2378
2379         Reviewed by Dean Jackson.
2380
2381         Manual rollout of r227577.
2382
2383         Test: fast/overflow/line-clamp-with-text-shadow.html
2384
2385         * Sources.txt:
2386         * WebCore.xcodeproj/project.pbxproj:
2387         * css/CSSComputedStyleDeclaration.cpp:
2388         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2389         * css/CSSProperties.json:
2390         * css/StyleBuilderCustom.h:
2391         (WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
2392         * css/parser/CSSParserContext.cpp:
2393         (WebCore::CSSParserContext::CSSParserContext):
2394         * css/parser/CSSParserContext.h:
2395         (WebCore::CSSParserContextHash::hash):
2396         * css/parser/CSSPropertyParser.cpp:
2397         (WebCore::CSSPropertyParser::parseSingleValue):
2398         (WebCore::consumeLinesClamp): Deleted.
2399         * page/Settings.yaml:
2400         * rendering/RenderBlockFlow.cpp:
2401         (WebCore::RenderBlockFlow::willCreateColumns const):
2402         (WebCore::getHeightForLineCount):
2403         (WebCore::RenderBlockFlow::heightForLineCount):
2404         (WebCore::RenderBlockFlow::layoutExcludedChildren):
2405         (WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
2406         (WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
2407         * rendering/RenderBlockFlow.h:
2408         * rendering/RenderDeprecatedFlexibleBox.cpp:
2409         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2410         * rendering/RenderFragmentContainer.cpp:
2411         (WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
2412         * rendering/RenderFragmentContainer.h:
2413         * rendering/RenderFragmentedFlow.cpp:
2414         (WebCore::RenderFragmentedFlow::validateFragments):
2415         (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
2416         (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
2417         * rendering/RenderFragmentedFlow.h:
2418         * rendering/RenderLinesClampFlow.cpp: Removed.
2419         * rendering/RenderLinesClampFlow.h: Removed.
2420         * rendering/RenderLinesClampSet.cpp: Removed.
2421         * rendering/RenderLinesClampSet.h: Removed.
2422         * rendering/RenderMultiColumnFlow.cpp:
2423         (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
2424         (WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
2425         * rendering/RenderMultiColumnFlow.h:
2426         (WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
2427         (WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
2428         (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
2429         (WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
2430         (WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
2431         (WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
2432         (WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
2433         (WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
2434         (WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
2435         (WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
2436         (WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
2437         (WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
2438         (WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
2439         (WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
2440         (WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
2441         (WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
2442         (WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
2443         (WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
2444         * rendering/RenderMultiColumnSet.cpp:
2445         (WebCore::RenderMultiColumnSet::collectLayerFragments):
2446         (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
2447         * rendering/RenderMultiColumnSet.h:
2448         (WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
2449         (WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
2450         (WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
2451         (WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
2452         (WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
2453         (WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
2454         (WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
2455         (WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
2456         (WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
2457         (WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
2458         (WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
2459         (WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
2460         (WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
2461         (WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
2462         (WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
2463         (WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
2464         (WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
2465         (WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
2466         (WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
2467         (WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
2468         (WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
2469         * rendering/RenderObject.h:
2470         (WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
2471         (WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
2472         * rendering/style/LineClampValue.h:
2473         (WebCore::LinesClampValue::LinesClampValue): Deleted.
2474         (WebCore::LinesClampValue::isNone const): Deleted.
2475         (WebCore::LinesClampValue::operator== const): Deleted.
2476         (WebCore::LinesClampValue::operator!= const): Deleted.
2477         (WebCore::LinesClampValue::start const): Deleted.
2478         (WebCore::LinesClampValue::end const): Deleted.
2479         (WebCore::LinesClampValue::center const): Deleted.
2480         * rendering/style/RenderStyle.h:
2481         (WebCore::RenderStyle::lineClamp const):
2482         (WebCore::RenderStyle::setLineClamp):
2483         (WebCore::RenderStyle::initialLineClamp):
2484         (WebCore::RenderStyle::hasInlineColumnAxis const):
2485         (WebCore::RenderStyle::linesClamp const): Deleted.
2486         (WebCore::RenderStyle::hasLinesClamp const): Deleted.
2487         (WebCore::RenderStyle::setLinesClamp): Deleted.
2488         (WebCore::RenderStyle::initialLinesClamp): Deleted.
2489         * rendering/style/StyleRareNonInheritedData.cpp:
2490         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2491         (WebCore::StyleRareNonInheritedData::operator== const):
2492         * rendering/style/StyleRareNonInheritedData.h:
2493         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2494         (WebCore::isValidColumnSpanner):
2495         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
2496         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
2497
2498 2018-07-25  Chris Dumez  <cdumez@apple.com>
2499
2500         navigator.userAgent may return outdated value after webView.customUserAgent is set
2501         https://bugs.webkit.org/show_bug.cgi?id=188009
2502         <rdar://problem/42566456>
2503
2504         Reviewed by Alex Christensen.
2505
2506         Invalidate the navigator.userAgent cache whenever the user agent gets changed to avoid exposing
2507         outdated values to JavaScript.
2508
2509         * page/Navigator.cpp:
2510         (WebCore::Navigator::userAgentChanged):
2511         * page/Navigator.h:
2512         * page/NavigatorID.idl:
2513         * page/Page.cpp:
2514         (WebCore::Page::userAgentChanged):
2515         * page/Page.h:
2516
2517 2018-07-25  David Fenton  <david_fenton@apple.com>
2518
2519         Unreviewed, rolling out r234187.
2520
2521         the layout test added with this change is flaky on the bots
2522
2523         Reverted changeset:
2524
2525         "Animation stops with object-fit:contain on an animated 2d
2526         canvas"
2527         https://bugs.webkit.org/show_bug.cgi?id=187840
2528         https://trac.webkit.org/changeset/234187
2529
2530 2018-07-25  Chris Dumez  <cdumez@apple.com>
2531
2532         Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT
2533         https://bugs.webkit.org/show_bug.cgi?id=187978
2534
2535         Reviewed by Eric Carlson.
2536
2537         Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT.
2538         If code does this, this leads to hard to investigate crashes such as rdar://problem/42160890. With a
2539         release assertion, we would find the culprits right away. The assertion guarding against addition of
2540         ActiveDOMObjects while we iterate is already a RELEASE_ASSERT.
2541
2542         * dom/ScriptExecutionContext.cpp:
2543         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
2544         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
2545         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
2546         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
2547         * dom/ScriptExecutionContext.h:
2548
2549 2018-07-24  Chris Dumez  <cdumez@apple.com>
2550
2551         REGRESSION (r219757): Accessing response getter of XHR instance from IFRAME sets constructor to Object from the IFRAME
2552         https://bugs.webkit.org/show_bug.cgi?id=187411
2553         <rdar://problem/41920593>
2554
2555         Reviewed by Sam Weinig.
2556
2557         Update JSXMLHttpRequest::response() to use the XMLHttpRequest's global object exec when constructing a JSONObject
2558         for the response instead of the caller's exec.
2559
2560         Test: http/tests/xmlhttprequest/xhr-response-constructor-subframe.html
2561
2562         * bindings/js/JSXMLHttpRequestCustom.cpp:
2563         (WebCore::JSXMLHttpRequest::response const):
2564
2565 2018-07-24  Simon Fraser  <simon.fraser@apple.com>
2566
2567         Animation stops with object-fit:contain on an animated 2d canvas
2568         https://bugs.webkit.org/show_bug.cgi?id=187840
2569
2570         Reviewed by Zalan Bujtas.
2571         
2572         If a canvas has object-fit: cover or contain, repaints need to mapped through
2573         the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
2574         
2575         Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
2576         all but RenderVideo just pass the RenderReplaced's intrinsicSize.
2577
2578         Test: fast/repaint/canvas-object-fit.html
2579
2580         * html/HTMLCanvasElement.cpp:
2581         (WebCore::HTMLCanvasElement::didDraw):
2582         * rendering/RenderHTMLCanvas.cpp:
2583         (WebCore::RenderHTMLCanvas::paintReplaced):
2584         * rendering/RenderImage.cpp:
2585         (WebCore::RenderImage::updateInnerContentRect):
2586         (WebCore::RenderImage::paintReplaced):
2587         * rendering/RenderLayerBacking.cpp:
2588         (WebCore::RenderLayerBacking::contentsBox const):
2589         * rendering/RenderReplaced.h:
2590         (WebCore::RenderReplaced::replacedContentRect const):
2591         * rendering/shapes/ShapeOutsideInfo.cpp:
2592         (WebCore::ShapeOutsideInfo::createShapeForImage const):
2593
2594 2018-07-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2595
2596         [Curl] Add support for wss:// websockets
2597         https://bugs.webkit.org/show_bug.cgi?id=172630
2598
2599         Reviewed by Fujii Hironori.
2600
2601         To support secure WebSocket connection, it is almost rewritten by using existing
2602         backend for CurlHandle to handle TLS connection and proxy support.
2603
2604         Test: http/tests/websocket/tests/hybi/simple-wss.html
2605
2606         * platform/network/curl/CurlContext.cpp:
2607         (WebCore::CurlSocketHandle::CurlSocketHandle):
2608         (WebCore::CurlSocketHandle::connect):
2609         (WebCore::CurlSocketHandle::send):
2610         (WebCore::CurlSocketHandle::receive):
2611         (WebCore::CurlSocketHandle::wait):
2612         * platform/network/curl/CurlContext.h:
2613         * platform/network/curl/SocketStreamHandleImpl.h:
2614         (WebCore::SocketStreamHandleImpl::SocketData::SocketData): Deleted.
2615         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2616         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
2617         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
2618         (WebCore::SocketStreamHandleImpl::platformSendInternal):
2619         (WebCore::SocketStreamHandleImpl::platformClose):
2620         (WebCore::SocketStreamHandleImpl::threadEntryPoint):
2621         (WebCore::SocketStreamHandleImpl::handleError):
2622         (WebCore::SocketStreamHandleImpl::stopThread):
2623         (WebCore::createCopy): Deleted.
2624         (WebCore::SocketStreamHandleImpl::readData): Deleted.
2625         (WebCore::SocketStreamHandleImpl::sendData): Deleted.
2626         (WebCore::SocketStreamHandleImpl::waitForAvailableData): Deleted.
2627         (WebCore::SocketStreamHandleImpl::startThread): Deleted.
2628         (WebCore::SocketStreamHandleImpl::didReceiveData): Deleted.
2629         (WebCore::SocketStreamHandleImpl::didOpenSocket): Deleted.
2630
2631 2018-07-24  Tim Horton  <timothy_horton@apple.com>
2632
2633         Enable Web Content Filtering on watchOS
2634         https://bugs.webkit.org/show_bug.cgi?id=187979
2635         <rdar://problem/42559346>
2636
2637         Reviewed by Wenson Hsieh.
2638
2639         * Configurations/FeatureDefines.xcconfig:
2640
2641 2018-07-24  Chris Dumez  <cdumez@apple.com>
2642
2643         Unreviewed, rolling out r233496 and r233571.
2644
2645         Likely cause of <rdar://problem/42160890> and
2646         <rdar://problem/42329658> as ActiveDOMObjects can now be
2647         constructed / destroyed while we are iterating over them.
2648
2649         Reverted changesets:
2650
2651         "Nullptr crash accessing Document in
2652         GenericEventQueue::dispatchOneEvent()"
2653         https://bugs.webkit.org/show_bug.cgi?id=187284
2654         https://trac.webkit.org/changeset/233496
2655
2656         "REGRESSION(r233496): macOS Sierra hits debug assertions in
2657         TrackListBase::suspend"
2658         https://bugs.webkit.org/show_bug.cgi?id=187378
2659         https://trac.webkit.org/changeset/233571
2660
2661 2018-07-24  Aditya Keerthi  <akeerthi@apple.com>
2662
2663         [Datalist][macOS] Display suggestions for input[type=color]
2664         https://bugs.webkit.org/show_bug.cgi?id=187794
2665
2666         Reviewed by Tim Horton.
2667
2668         * html/ColorInputType.cpp:
2669         (WebCore::ColorInputType::shouldRespectListAttribute):
2670
2671 2018-07-24  Ryan Haddad  <ryanhaddad@apple.com>
2672
2673         Unreviewed, rolling out r234121.
2674
2675         Caused perf test failures.
2676
2677         Reverted changeset:
2678
2679         "We should cache the compiled sandbox profile in a data vault"
2680         https://bugs.webkit.org/show_bug.cgi?id=184991
2681         https://trac.webkit.org/changeset/234121
2682
2683 2018-07-24  Antoine Quint  <graouts@apple.com>
2684
2685         [Web Animations] Add an ASSERT() to check the contract that a CSSTransition has a valid effect in setTimingProperties()
2686         https://bugs.webkit.org/show_bug.cgi?id=187954
2687
2688         Reviewed by Dean Jackson.
2689
2690         * animation/CSSTransition.cpp:
2691         (WebCore::CSSTransition::setTimingProperties):
2692
2693 2018-07-24  Antoine Quint  <graouts@apple.com>
2694
2695         [Web Animations] Crash when setting an animation style on an existing animation that had its effect set to null
2696         https://bugs.webkit.org/show_bug.cgi?id=187953
2697
2698         Reviewed by Dean Jackson.
2699
2700         Test: webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect.html
2701
2702         Ensure that we have a valid effect before proceeding to update its timing. 
2703
2704         * animation/CSSAnimation.cpp:
2705         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
2706
2707 2018-07-24  Eric Carlson  <eric.carlson@apple.com>
2708
2709         [MediaStream] Restructure getDisplayMedia classes
2710         https://bugs.webkit.org/show_bug.cgi?id=187905
2711         <rdar://problem/42500215>
2712
2713         Unreviewed build fix.
2714
2715         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: 
2716
2717 2018-07-24  Antoine Quint  <graouts@apple.com>
2718
2719         [Web Animations] Crash when setting "animation: none" after clearing an animation's effect
2720         https://bugs.webkit.org/show_bug.cgi?id=187952
2721
2722         Reviewed by Dean Jackson.
2723
2724         Test: webanimations/setting-css-animation-none-after-clearing-effect.html
2725
2726         We need to ensure that the animation we're trying to remove has not had its effect cleared via the
2727         Web Animations API since its creation before trying to check its phase.
2728
2729         * animation/AnimationTimeline.cpp:
2730         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
2731
2732 2018-07-24  Antoine Quint  <graouts@apple.com>
2733
2734         [Web Animations] Crash accessing CSSAnimation::bindingsCurrentTime when effect has been set to null
2735         https://bugs.webkit.org/show_bug.cgi?id=187950
2736         <rdar://problem/42515747>
2737
2738         Reviewed by Dean Jackson.
2739
2740         Test: webanimations/accessing-current-time-after-clearing-css-animation-effect.html
2741
2742         While a CSSAnimation has an effect created for it by the implementation, the developer may yet manipulate
2743         its effect via the Web Animations API and set it to null. As such, we must not assume it's always non-null.
2744
2745         * animation/CSSAnimation.cpp:
2746         (WebCore::CSSAnimation::bindingsCurrentTime const):
2747
2748 2018-07-24  Zalan Bujtas  <zalan@apple.com>
2749
2750         [LFC][IFC] BlockContainer::establishesInlineFormattingContext should only check the first inflow child.
2751         https://bugs.webkit.org/show_bug.cgi?id=187965
2752
2753         Reviewed by Antti Koivisto.
2754
2755         * layout/layouttree/LayoutBlockContainer.cpp:
2756         (WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
2757
2758 2018-07-24  Myles C. Maxfield  <mmaxfield@apple.com>
2759
2760         [Cocoa] Stop crashing in lastResortFallbackFont()
2761         https://bugs.webkit.org/show_bug.cgi?id=187936
2762
2763         Reviewed by Jon Lee.
2764
2765         CoreText can get into a state where both Times and Lucida Grande are inaccessible.
2766         Instead of crashing, we should use the real LastResort, which is backed by a section
2767         in the .rodata of the CoreText dylib, and as such should always exist.
2768
2769         * platform/graphics/FontCache.cpp:
2770         (WebCore::FontCache::fontForFamily):
2771         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2772         (WebCore::FontCache::lastResortFallbackFont):
2773
2774 2018-07-24  Daniel Bates  <dabates@apple.com>
2775
2776         Cannot view PDF's on my.gov.au: "Refused to load https://my.gov.au/attachment/viewAttachment because it
2777         appears in neither the object-src directive nor the default-src directive of the Content Security Policy"
2778         https://bugs.webkit.org/show_bug.cgi?id=187870
2779         <rdar://problem/41190880>
2780
2781         Reviewed by Dean Jackson.
2782
2783         Fixes an issue where opening attachments on my.gov.au would show a "Blocked Plug-in" message.
2784
2785         Opening an attachment on my.gov.au opens a same-origin plugin document in a child window. Currently
2786         same-origin plugin documents inherit their CSP policy from their opener. If the opener's CSP policy
2787         disallows embedding plugins then the plugin document would be blocked from loading a plugin. For now
2788         we relax the inheritance model such that we only inherit the plugin-types and report-uri directives
2789         from the opener.
2790
2791         Developers that want to block plugin content from being loaded in a same-origin child window must now
2792         serve such plugin content with a CSP policy that includes "object-src 'none'". This matches the behavior
2793         described in the second Note in section object-src of the CSP 3 spec: <https://w3c.github.io/webappsec-csp/#directive-object-src>
2794         (Editor's Draft, 10 July 2018). It also makes the behavior in WebKit more closely aligned with the
2795         behavior of Chrome and Firefox.
2796
2797         Tests: http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html
2798                http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php
2799                http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html
2800
2801         * dom/Document.cpp:
2802         (WebCore::Document::initContentSecurityPolicy): For plugin documents that have an opener call ContentSecurityPolicy::createPolicyForPluginDocumentFrom()
2803         to only inherit the plugin-types and report-uri directives from its opener's CSP policy. Otherwise, call ContentSecurityPolicy::copyStateFrom()
2804         to inherit all directives from the owner frame as we do now.
2805         * page/csp/ContentSecurityPolicy.cpp:
2806         (WebCore::ContentSecurityPolicy::createPolicyForPluginDocumentFrom): Create a new policy from the specified policy
2807         inheriting only the plugin-types and report-uri directives.
2808         * page/csp/ContentSecurityPolicy.h: Define a new PolicyFrom enumerator, InheritedForPluginDocument, for plugin documents
2809         loaded in a child window.
2810         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2811         (WebCore::ContentSecurityPolicyDirectiveList::parse): When policyFrom is InheritedForPluginDocument then only
2812         recognize the plugin-types and report-uri directives when parsing the policy.
2813
2814 2018-07-24  Daniel Bates  <dabates@apple.com>
2815
2816         Rename Document::firstPartyForSameSiteCookies() to siteForCookies()
2817         https://bugs.webkit.org/show_bug.cgi?id=187892
2818
2819         Reviewed by Dean Jackson.
2820
2821         Standardize on the spec. language "site for cookies" for the names of the setter and getter
2822         on Document. The latest description of Same-Site cookies is in <https://httpwg.org/http-extensions/rfc6265bis.html>.
2823
2824         No functionality changed. So, no new tests.
2825
2826         * dom/Document.h:
2827         (WebCore::Document::siteForCookies const):
2828         (WebCore::Document::setSiteForCookies):
2829         (WebCore::Document::firstPartyForSameSiteCookies const): Deleted.
2830         (WebCore::Document::setFirstPartyForSameSiteCookies): Deleted.
2831         * loader/FrameLoader.cpp:
2832         (WebCore::FrameLoader::setFirstPartyForCookies):
2833         (WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded):
2834         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2835         (WebCore::createPageForServiceWorker):
2836         * xml/XSLTProcessor.cpp:
2837         (WebCore::XSLTProcessor::createDocumentFromSource):
2838
2839 2018-07-24  Ross Kirsling  <ross.kirsling@sony.com>
2840
2841         WebCore::URL::hostIsIPAddress needs a Windows implementation
2842         https://bugs.webkit.org/show_bug.cgi?id=187859
2843
2844         Reviewed by Fujii Hironori.
2845
2846         * platform/URL.cpp:
2847         (WebCore::isIPv4Address): Added.
2848         (WebCore::isIPv6Address): Added.
2849         (WebCore::URL::hostIsIPAddress):
2850         Turn this stub into a platform-agnostic default implementation.
2851
2852 2018-07-24  Eric Carlson  <eric.carlson@apple.com>
2853
2854         [MediaStream] Restructure getDisplayMedia classes
2855         https://bugs.webkit.org/show_bug.cgi?id=187905
2856
2857         Reviewed by Dean Jackson.
2858
2859         No new tests, no functional changes.
2860
2861         * platform/mediastream/CaptureDeviceManager.h:
2862         (WebCore::CaptureDeviceManager::refreshCaptureDevices): Deleted, no need for it to be a 
2863         virtual method.
2864         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2865
2866         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: refreshCaptureDevices is
2867         no longer virtual.
2868
2869         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
2870         (WebCore::DisplayCaptureManagerCocoa::captureDevices):
2871         (WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices): Moved functionality 
2872         to ScreenDisplayCaptureSourceMac.
2873         (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Ditto.
2874         (WebCore::displayReconfigurationCallBack): Deleted, moved to ScreenDisplayCaptureSourceMac.
2875         (WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Deleted.
2876         (WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Deleted.
2877         * platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
2878
2879         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2880         (WebCore::roundUpToMacroblockMultiple): Moved from ScreenDisplayCaptureSourceMac.
2881         (WebCore::DisplayCaptureSourceCocoa::applySize): Ditto.
2882         (WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Ditto.
2883         (WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Ditto.
2884         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
2885
2886         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2887         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2888         (WebCore::updateDisplayID):
2889         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Fix log message.
2890         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
2891         (WebCore::ScreenDisplayCaptureSourceMac::applySize): Update for base class changes.
2892         (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Ditto.
2893         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
2894         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID): Moved from
2895         DisplayCaptureManagerCocoa.
2896         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices): Ditto.
2897         (WebCore::roundUpToMacroblockMultiple): Moved to DisplayCaptureSourceCocoa.
2898         (WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID): Ditto.
2899         (WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer): Ditto.
2900         (WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface): Ditto.
2901
2902 2018-07-24  Zalan Bujtas  <zalan@apple.com>
2903
2904         [LFC] Move geometry data structures to a dedicated file
2905         https://bugs.webkit.org/show_bug.cgi?id=187939
2906
2907         Reviewed by Antti Koivisto.
2908
2909         * WebCore.xcodeproj/project.pbxproj:
2910         * layout/FormattingContext.h:
2911         (WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const): Deleted.
2912         * layout/FormattingContextGeometry.cpp:
2913         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2914         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2915         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2916         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2917         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
2918         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2919         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
2920         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2921         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
2922         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
2923         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2924         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
2925         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2926         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2927         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
2928         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
2929         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
2930         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
2931         * layout/blockformatting/BlockFormattingContext.h:
2932         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2933         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2934         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2935         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2936         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
2937         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2938         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2939         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2940         * layout/displaytree/DisplayBox.h:
2941         (WebCore::Display::Box::setHorizontalMargin):
2942         (WebCore::Display::Box::setVerticalMargin):
2943         (WebCore::Display::Box::setVerticalNonCollapsedMargin):
2944         (WebCore::Display::Box::setBorder):
2945         (WebCore::Display::Box::setPadding):
2946
2947 2018-07-24  Thibault Saunier  <tsaunier@igalia.com>
2948
2949         [GStreamer] Implement bitrate modulation support in GStreamer based libwebrtc Encoders
2950         https://bugs.webkit.org/show_bug.cgi?id=187643
2951
2952         Reviewed by Philippe Normand.
2953
2954         Problem being that we do not have a proper unified encoder API in GStreamer, some work
2955         started at https://bugzilla.gnome.org/show_bug.cgi?id=796716 but it is quite controversial
2956         and meanwhile we should just move forward working around that limitation.
2957
2958         Source/WebCore:
2959         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2960         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
2961         (WebCore::GStreamerVideoEncoder::InitEncode):
2962         (WebCore::GStreamerVideoEncoder::getBitrateSetter):
2963         (WebCore::GStreamerVideoEncoder::createEncoder):
2964         (WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
2965         (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
2966         (WebCore::GStreamerVideoEncoder::CreateEncoder): Deleted.
2967
2968 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
2969
2970         REGRESSION(r234055): inverted return values in MediaPlayer::wouldTaintOrigin()
2971         https://bugs.webkit.org/show_bug.cgi?id=187944
2972
2973         Reviewed by Carlos Garcia Campos.
2974
2975         The MediaPlayer::wouldTaintOrigin(), as introduced in r234055, should
2976         return false when the URL protocol is `data:`, and should return true
2977         when the given SecurityOrigin cannot access the media URL.
2978
2979         This matches behavior of CanvasRenderingContext::wouldTaintOrigin()
2980         which the new method falls back to when the MediaPlayerPrivate
2981         implementation doesn't or can't determine the would-taint result.
2982
2983         This fixes a bunch of failing and timing-out WebGL test cases on ports
2984         using GStreamer (on which the MediaPlayerPrivate derivate doesn't
2985         implement the wouldTaintOrigin() method).
2986
2987         * platform/graphics/MediaPlayer.cpp:
2988         (WebCore::MediaPlayer::wouldTaintOrigin const):
2989
2990 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
2991
2992         [TextureMapper] Separate repaint counter state from debug visuals
2993         https://bugs.webkit.org/show_bug.cgi?id=187946
2994
2995         Reviewed by Carlos Garcia Campos.
2996
2997         Instead of managing the repaint counter visibility along with the
2998         debug border visuals, do that together with the repaint count value.
2999
3000         TextureMapperLayer::setRepaintCount() is renamed to setRepaintCounter()
3001         and now also sets the repaint counter visibility state instead of the
3002         setDebugVisuals() method.
3003
3004         GraphicsLayerTextureMapper implementation is adjusted appropriately.
3005         The unused setRepaintCount() method is also removed.
3006
3007         CoordinatedGraphicsLayerState now holds repaint counter state (both
3008         visibility and count value) in a struct that's separate from debug
3009         border state. CoordinatedGraphicsLayer implementation now updates
3010         that state accordingly.
3011
3012         No new tests -- no change in behavior.
3013
3014         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3015         (WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter):
3016         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
3017         (WebCore::GraphicsLayerTextureMapper::setRepaintCount): Deleted.
3018         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3019         * platform/graphics/texmap/TextureMapperLayer.cpp:
3020         (WebCore::TextureMapperLayer::setDebugVisuals):
3021         (WebCore::TextureMapperLayer::setRepaintCounter):
3022         (WebCore::TextureMapperLayer::setRepaintCount): Deleted.
3023         * platform/graphics/texmap/TextureMapperLayer.h:
3024         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3025         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
3026         (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
3027         (WebCore::CoordinatedGraphicsLayer::syncLayerState):
3028         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3029         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
3030         (WebCore::DebugVisuals::DebugVisuals): Deleted.
3031
3032 2018-07-24  Thibault Saunier  <tsaunier@igalia.com>
3033
3034         [WPE][GTK] Implement PeerConnection API on top of libwebrtc
3035         https://bugs.webkit.org/show_bug.cgi?id=186932
3036
3037         Reviewed by Philippe Normand.
3038
3039         Enabled many webrtc tests.
3040
3041         * platform/GStreamer.cmake: Build new files
3042         * platform/graphics/gstreamer/GStreamerCommon.cpp: Fix minor style issues
3043         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Add a way to give precise name to pipelines
3044         and give useful names to pipelines with sources comming from a PeerConnection
3045         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
3046         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: Added. Implement a subclass of webrtc::VideoFrame
3047         to represent a kNative GStreamer video frame.
3048         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: Added. Ditto.
3049         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: Handle incoming audio samples from libwebrtc.
3050         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h: Ditto.
3051         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp: Handle incoming video frames from libwebrtc.
3052         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h: Ditto.
3053         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: Handle passing locally captured audio sample to libwebrtc.
3054         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: Ditto.
3055         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: Handle passing locally captured vidoe frames to libwebrtc.
3056         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Added. Implement a video decoder factory and LibWebRTC Video decoders based on GStreamer.
3057         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.h: Added. Ditto.
3058         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Added. Implement a video encoder factory and LibWebRTC H264/VP8 Video encoders based on GStreamer.
3059         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Added. Ditto.
3060         * platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Add information about signness of the LibWebRTC audio format.
3061         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Add support for newly added Encoder/Decoder factories.
3062         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Ditto.
3063
3064 2018-07-24  Dirk Schulze  <krit@webkit.org>
3065
3066         [css-masking] Black backdrop on -webkit-clip-path on SVG root
3067         https://bugs.webkit.org/show_bug.cgi?id=187880
3068
3069         Reviewed by Simon Fraser.
3070
3071         For SVG document root elements, we currently clip twice:
3072         In RenderLayer and SVGRenderSupport.
3073         Avoid clipping in RenderLayer which currently clips before we established a
3074         backdrop for an SVG document.
3075
3076         Tests: svg/clip-path/clip-path-on-svg-005-expected.svg
3077                svg/clip-path/clip-path-on-svg-005.svg
3078
3079         * rendering/RenderLayer.cpp:
3080         (WebCore::RenderLayer::setupClipPath): Skip actual clipping.
3081
3082 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
3083
3084         [Nicosia] Add TextureMapperAnimations member to CompositingLayer::LayerState
3085         https://bugs.webkit.org/show_bug.cgi?id=187941
3086
3087         Reviewed by Carlos Garcia Campos.
3088
3089         Nicosia::CompositingLayer::LayerState gains a TextureMapperAnimations
3090         member that will be assigned a list of all active animations during each
3091         layer flush. Despite the name, TextureMapperAnimations doesn't depend on
3092         any other TextureMapper class. It might be renamed and moved in the
3093         future, but for now it's used as-is.
3094
3095         In CoordinatedGraphicsLayer, the syncAnimations() method now flips on
3096         the animationsChanged flag in the LayerState::Delta struct. This causes
3097         all the active animations to be copied over into the layer state in
3098         flushCompositingStateForThisLayerOnly().
3099
3100         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
3101         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3102         (WebCore::CoordinatedGraphicsLayer::syncAnimations):
3103         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3104
3105 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
3106
3107         [Nicosia] Add FilterOperations member to CompositionLayer::LayerState
3108         https://bugs.webkit.org/show_bug.cgi?id=187901
3109
3110         Reviewed by Carlos Garcia Campos.
3111
3112         Nicosia::CompositionLayer::LayerState gains a FilterOperations member
3113         that can be assigned the list of filter operations for a given layer.
3114         The corresponding filtersChanged boolean is added to LayerState::Delta.
3115
3116         CoordinatedGraphicsLayer::syncFilters() flips on that delta member,
3117         which in turn causes the FilterOperations value to be updated during
3118         the layer flush, in flushCompositingStateForThisLayerOnly().
3119
3120         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
3121         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3122         (WebCore::CoordinatedGraphicsLayer::syncFilters):
3123         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3124
3125 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
3126
3127         [CoordGraphics] Use adjusted position, anchor point, size values for Nicosia::CompositionLayer state
3128         https://bugs.webkit.org/show_bug.cgi?id=187899
3129
3130         Reviewed by Carlos Garcia Campos.
3131
3132         As is done for the CoordinatedGraphicsLayerState, the scale-adjusted
3133         position, anchor point and size values should be used when updating the
3134         corresponding Nicosia::CompositionLayer::LayerState members.
3135
3136         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3137         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3138
3139 2018-07-23  Manuel Rego Casasnovas  <rego@igalia.com>
3140
3141         [css-grid] Add support for calc() in gutter properties
3142         https://bugs.webkit.org/show_bug.cgi?id=187902
3143
3144         Reviewed by Simon Fraser.
3145
3146         The parsing was already accepting calc() in grid row and column gaps,
3147         however the code was not taking that into account properly.
3148         If the calc() had a percentage it was ignored and that's wrong.
3149
3150         The fix is just a change in the ceck at RenderGrid::availableSpaceForGutters().
3151
3152         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002-rtl.html
3153                imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002.html
3154                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-011.html
3155                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-012.html
3156
3157         * rendering/RenderGrid.cpp:
3158         (WebCore::RenderGrid::availableSpaceForGutters const):
3159
3160 2018-07-23  Aditya Keerthi  <akeerthi@apple.com>
3161
3162         Remove extraneous #endif in html.css
3163         https://bugs.webkit.org/show_bug.cgi?id=187934
3164
3165         Reviewed by Tim Horton.
3166
3167         * css/html.css: Remove extraneous #endif.
3168
3169 2018-07-23  Sihui Liu  <sihui_liu@apple.com>
3170
3171         CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
3172         https://bugs.webkit.org/show_bug.cgi?id=187927
3173
3174         Reviewed by Chris Dumez.
3175
3176         IDBKeyData is valid only when each key of it is valid.
3177
3178         Test: LayoutTests/storage/indexeddb/index-multientry.html
3179
3180         * Modules/indexeddb/IDBKeyData.cpp:
3181         (WebCore::IDBKeyData::isValid const):
3182         * Modules/indexeddb/IDBKeyData.h:
3183         (WebCore::IDBKeyData::isValid const): Deleted.
3184
3185 2018-07-23  Ben Richards  <benton_richards@apple.com>
3186
3187         We should cache the compiled sandbox profile in a data vault
3188         https://bugs.webkit.org/show_bug.cgi?id=184991
3189
3190         Reviewed by Ryosuke Niwa.
3191
3192         Added functionality to FileHandle so that it can lock a file while open.
3193         Added a function to FileSystem to delete non empty directories.
3194
3195         * platform/FileHandle.cpp:
3196         (WebCore::FileHandle::FileHandle):
3197         (WebCore::FileHandle::open):
3198         (WebCore::FileHandle::close):
3199         * platform/FileHandle.h:
3200         * platform/FileSystem.h:
3201         * platform/cocoa/FileSystemCocoa.mm:
3202         (WebCore::FileSystem::deleteNonEmptyDirectory):
3203
3204 2018-07-23  Justin Fan  <justin_fan@apple.com>
3205
3206         [macOS] Ensure that WebGL contexts are always set to an accelerated virtual screen
3207         https://bugs.webkit.org/show_bug.cgi?id=187923
3208
3209         Reviewed by Dean Jackson.
3210
3211         On eGPU displays, it is possible that CGL does not match the preferred renderer. 
3212         In this case, and when the web process is blocked from accessing the window server, 
3213         3D contexts *may* default to the software renderer. Ensure that even if this occurs,
3214         we set the context to use a hardware-accelerated renderer/virtual screen.
3215
3216         No new tests. Existing behavior covered by existing tests.
3217         Requires multiple screens, at least one attached to an eGPU, to stress. 
3218
3219         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3220         (WebCore::identifyAndSetCurrentGPU):
3221
3222 2018-07-23  Sam Weinig  <sam@webkit.org>
3223
3224         Convert some obvious never-null pointers to references in the editing code
3225         https://bugs.webkit.org/show_bug.cgi?id=187914
3226
3227         Reviewed by Dean Jackson.
3228
3229         Fixup trivial cases of never-null pointers that really should be references.
3230
3231         * editing/ApplyStyleCommand.cpp:
3232         (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
3233         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
3234         (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
3235         (WebCore::ApplyStyleCommand::removeCSSStyle):
3236         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
3237         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
3238         * editing/EditingStyle.cpp:
3239         (WebCore::EditingStyle::overrideWithStyle):
3240         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
3241         (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement const):
3242         (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes const):
3243         (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes const):
3244         (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
3245         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
3246         (WebCore::EditingStyle::mergeInlineStyleOfElement):
3247         (WebCore::EditingStyle::wrappingStyleForSerialization):
3248         (WebCore::EditingStyle::legacyFontSize const):
3249         (WebCore::StyleChange::StyleChange):
3250         (WebCore::StyleChange::extractTextStyles):
3251         (WebCore::legacyFontSizeFromCSSValue):
3252         * editing/EditingStyle.h:
3253         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
3254         * editing/Editor.cpp:
3255         (WebCore::Editor::selectionStartCSSPropertyValue):
3256         * editing/ReplaceSelectionCommand.cpp:
3257         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
3258         (WebCore::isInlineNodeWithStyle):
3259         * editing/markup.cpp:
3260         (WebCore::StyledMarkupAccumulator::appendElement):
3261         (WebCore::StyledMarkupAccumulator::serializeNodes):
3262
3263 2018-07-23  Per Arne Vollan  <pvollan@apple.com>
3264
3265         WebCore::primaryScreenDisplayID() always return 0
3266         https://bugs.webkit.org/show_bug.cgi?id=187922
3267         <rdar://problem/42286933>
3268
3269         Reviewed by Geoffrey Garen.
3270
3271         This function should return a valid display ID.
3272
3273         No new tests. Testing this requires a dual monitor setup.
3274
3275         * platform/mac/PlatformScreenMac.mm:
3276         (WebCore::primaryScreenDisplayID):
3277
3278 2018-07-23  Nan Wang  <n_wang@apple.com>
3279
3280         AX: Press tab to highlight items on a webpage is not working with voiceover enabled
3281         https://bugs.webkit.org/show_bug.cgi?id=187824
3282
3283         Reviewed by Zalan Bujtas.
3284
3285         We are deferring posting focused element change notification when the document needs a
3286         style recalculation. However, we only perform the cache update after a layout is completed.
3287         Added a timer to perform the cache update in the next runloop when non-layout type of mutation
3288         happens.
3289         
3290         Test: accessibility/mac/tab-focus-post-notification.html
3291
3292         * accessibility/AXObjectCache.cpp:
3293         (WebCore::AXObjectCache::AXObjectCache):
3294         (WebCore::AXObjectCache::~AXObjectCache):
3295         (WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
3296         (WebCore::AXObjectCache::performCacheUpdateTimerFired):
3297         * accessibility/AXObjectCache.h:
3298         (WebCore::AXObjectCache::AXObjectCache):
3299         (WebCore::AXObjectCache::performCacheUpdateTimerFired):
3300
3301 2018-07-23  Chris Dumez  <cdumez@apple.com>
3302
3303         WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
3304         https://bugs.webkit.org/show_bug.cgi?id=187910
3305         <rdar://problem/42356526>
3306
3307         Reviewed by Brent Fulgham.
3308
3309         Add internals API that causes the ResourceLoadObserver to notify its observer, and avoid waiting
3310         for the 5 second delay.
3311
3312         * testing/Internals.cpp:
3313         (WebCore::Internals::notifyResourceLoadObserver):
3314         * testing/Internals.h:
3315         * testing/Internals.idl:
3316
3317 2018-07-23  Zalan Bujtas  <zalan@apple.com>
3318
3319         [LCF][IFC] Add support for hyphenation.
3320         https://bugs.webkit.org/show_bug.cgi?id=187913
3321
3322         Reviewed by Antti Koivisto.
3323
3324         Move the hyphenation logic over from SimpleLineLayout::TextFragmentIterator.
3325
3326         * layout/inlineformatting/textlayout/Runs.h:
3327         (WebCore::Layout::TextRun::hasHyphen const):
3328         (WebCore::Layout::LayoutRun::setHasHyphen):
3329         (WebCore::Layout::LayoutRun::hasHyphen const):
3330         (WebCore::Layout::LayoutRun::LayoutRun):
3331         (WebCore::Layout::TextRun::createNonWhitespaceRunWithHyphen):
3332         (WebCore::Layout::TextRun::TextRun):
3333         * layout/inlineformatting/textlayout/TextContentProvider.cpp:
3334         (WebCore::Layout::TextContentProvider::findTextItemSlow const):
3335         (WebCore::Layout::TextContentProvider::width const):
3336         (WebCore::Layout::TextContentProvider::hyphenPositionBefore const):
3337         * layout/inlineformatting/textlayout/TextContentProvider.h:
3338         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
3339         (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
3340         (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
3341         (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
3342         (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
3343         (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
3344         (WebCore::Layout::SimpleLineBreaker::Line::append):
3345         (WebCore::Layout::SimpleLineBreaker::Line::reset):
3346         (WebCore::Layout::SimpleLineBreaker::Style::Style):
3347         (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
3348         (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
3349         (WebCore::Layout::SimpleLineBreaker::hyphenPositionBefore const):
3350         (WebCore::Layout::SimpleLineBreaker::adjustSplitPositionWithHyphenation const):
3351         (WebCore::Layout::SimpleLineBreaker::split const):
3352         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
3353
3354 2018-07-23  Antoine Quint  <graouts@apple.com>
3355
3356         [Web Animations] Querying the current time of a finished CSSAnimation after removing its target leads to a crash
3357         https://bugs.webkit.org/show_bug.cgi?id=187906
3358
3359         Reviewed by Dean Jackson.
3360
3361         Test: webanimations/accessing-current-time-after-finished-css-animation-target-removal.html
3362
3363         Because we carelessly look at a CSSAnimation's effect's timing in DeclarativeAnimation::bindingsCurrentTime
3364         without checking that the effect is non-null, we can crash in the case where the animation is finished and
3365         its target element has been removed, which caused the effect to be set to null.
3366
3367         We do not actually fix the lack of a null check, which will be the scope of a different patch, but instead
3368         ensure that we do _not_ set the animation's effect to null when its target is removed, which used to be
3369         performed via a call to WebAnimation::remove(). Instead, we introduce AnimationTimeline::elementWasRemoved()
3370         which notifies the timeline of an element being removed such that we may stop referencing any animation
3371         targeting this element from the various data structures holding strong references to the animation in question,
3372         and we then cancel the animation silently, which is a new option that ensures promises aren't resolved or
3373         rejected as a result.
3374
3375         Finally, the WebAnimation and AnimationEffectReadOnly classes established a ref-cycle as WebAnimation has
3376         `RefPtr<AnimationEffectReadOnly> m_effect` and AnimationEffectReadOnly has `RefPtr<WebAnimation> m_animation`.
3377         While it is correct that WebAnimation owns its effect, which is established by the DOM API, the
3378         reverse is not correct since we only hold the reverse internally for the benefit of our implementation.
3379         As such, we change AnimationEffectReadOnly's m_animation to be a WeakPtr<WebAnimation>. This means not
3380         calling WebAnimation::remove() and simply removing the animation from the animation maps on the timeline
3381         is sufficient to guarantee that the document timeline will not leak (and with it the document).
3382
3383         * animation/AnimationEffectReadOnly.h:
3384         (WebCore::AnimationEffectReadOnly::setAnimation):
3385         * animation/AnimationTimeline.cpp:
3386         (WebCore::AnimationTimeline::elementWasRemoved):
3387         * animation/AnimationTimeline.h:
3388         * animation/WebAnimation.cpp:
3389         (WebCore::WebAnimation::cancel):
3390         (WebCore::WebAnimation::resetPendingTasks):
3391         * animation/WebAnimation.h:
3392         * dom/Element.cpp:
3393         (WebCore::Element::removedFromAncestor):
3394         * rendering/updating/RenderTreeUpdater.cpp:
3395         (WebCore::RenderTreeUpdater::tearDownRenderers):
3396
3397 2018-07-23  Aditya Keerthi  <akeerthi@apple.com>
3398
3399         [iOS] Add support for input[type=color]
3400         https://bugs.webkit.org/show_bug.cgi?id=187871
3401
3402         Reviewed by Tim Horton.
3403
3404         * css/html.css: Remove unwanted styling for color inputs with a list attribute.
3405         * html/ColorInputType.cpp: Make the element focusable.
3406         (WebCore::ColorInputType::isMouseFocusable const):
3407         (WebCore::ColorInputType::isKeyboardFocusable const):
3408         * html/ColorInputType.h:
3409         * html/HTMLInputElement.h: Expose isColorControl() to WebKit.
3410         * page/Chrome.cpp:
3411         (WebCore::Chrome::createColorChooser):
3412
3413 2018-07-22  Dean Jackson  <dino@apple.com>
3414
3415         fullscreen env() variables should have initial values
3416         https://bugs.webkit.org/show_bug.cgi?id=187897
3417         <rdar://problem/42485682>
3418
3419         Reviewed by Sam Weinig.
3420
3421         The env() values for fullscreen properties need to be
3422         initialized, rather than wait for values to be set from WebKit.
3423         Without this, feature detection doesn't work, and properties
3424         won't parse correctly.
3425
3426         Test: fullscreen/fullscreen-env-initial.html
3427
3428         * dom/ConstantPropertyMap.cpp:
3429         (WebCore::ConstantPropertyMap::buildValues): Initialize the fullscreen values.
3430         (WebCore::ConstantPropertyMap::updateConstantsForFullscreen): Renamed function, because it
3431         also updates the duration value.
3432         (WebCore::ConstantPropertyMap::didChangeFullscreenInsets): Call new name.
3433         (WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets): Deleted.
3434         * dom/ConstantPropertyMap.h:
3435         * page/Page.cpp:
3436         (WebCore::Page::setFullscreenAutoHideDuration): Don't change the value if it doesn't need it.
3437         * page/Page.h: Add accessor for fullscreenAutoHideDuration. Also add a member variable.
3438         (WebCore::Page::fullscreenAutoHideDuration const):
3439
3440 2018-07-22  Zalan Bujtas  <zalan@apple.com>
3441
3442         [LFC][IFC] Add center/right/justify line alignment support.
3443         https://bugs.webkit.org/show_bug.cgi?id=187890
3444
3445         Reviewed by Antti Koivisto.
3446
3447         Move over some more code from simple line layout.
3448         (though text-align: justify is more preformant as now expansion opportunities are added as we process the text runs
3449         -as opposed to iterting through the runs again when we reach the end of the line.) 
3450
3451         * layout/inlineformatting/textlayout/Runs.h:
3452         (WebCore::Layout::LayoutRun::setLeft):
3453         (WebCore::Layout::LayoutRun::setExpansion):
3454         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
3455         (WebCore::Layout::SimpleLineBreaker::Line::Line):
3456         (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
3457         (WebCore::Layout::SimpleLineBreaker::Line::adjustedLeftForTextAlign const):
3458         (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
3459         (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
3460         (WebCore::Layout::expansionOpportunity):
3461         (WebCore::Layout::expansionBehavior):
3462         (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
3463         (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
3464         (WebCore::Layout::SimpleLineBreaker::Line::append):
3465         (WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
3466         (WebCore::Layout::SimpleLineBreaker::Line::reset):
3467         (WebCore::Layout::SimpleLineBreaker::Style::Style):
3468         (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
3469         (WebCore::Layout::SimpleLineBreaker::handleLineStart):
3470         (WebCore::Layout::isTextAlignRight):
3471         (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
3472         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
3473         (WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
3474         (WebCore::Layout::SimpleLineBreaker::Line::setCollapseWhitespace):
3475
3476 2018-07-21  Zalan Bujtas  <zalan@apple.com>
3477
3478         [LFC][IFC] Add verification for inline text runs.
3479         https://bugs.webkit.org/show_bug.cgi?id=187879
3480
3481         Reviewed by Antti Koivisto.
3482
3483         * layout/Verification.cpp:
3484         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
3485         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
3486         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3487         (WebCore::Layout::verifyAndOutputSubtree):
3488         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded): Deleted.
3489         * layout/inlineformatting/InlineFormattingContext.cpp:
3490         (WebCore::Layout::InlineFormattingContext::layout const):
3491         * layout/inlineformatting/InlineFormattingState.h:
3492         (WebCore::Layout::InlineFormattingState::addLayoutRuns):
3493         (WebCore::Layout::InlineFormattingState::layoutRuns const):
3494         * layout/layouttree/LayoutTreeBuilder.cpp:
3495         (WebCore::Layout::outputLayoutBox):
3496         (WebCore::Layout::outputLayoutTree):
3497         (WebCore::Layout::TreeBuilder::showLayoutTree):
3498
3499 2018-07-21  Zalan Bujtas  <zalan@apple.com>
3500
3501         [LFC] Do not use virtual methods to construct floating/formatting states.
3502         https://bugs.webkit.org/show_bug.cgi?id=187875
3503
3504         Reviewed by Antti Koivisto.
3505
3506         LayoutContext::establishedFormattingState() does not require FormattingContext anymore only the root of the context.
3507
3508         * layout/FormattingContext.cpp:
3509         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3510         * layout/FormattingContext.h:
3511         * layout/LayoutContext.cpp:
3512         (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
3513         (WebCore::Layout::LayoutContext::formattingStateForBox const):
3514         (WebCore::Layout::LayoutContext::establishedFormattingState):
3515         * layout/LayoutContext.h:
3516         * layout/blockformatting/BlockFormattingContext.cpp:
3517         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3518         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
3519         (WebCore::Layout::BlockFormattingContext::createFormattingState const): Deleted.
3520         (WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const): Deleted.
3521         * layout/blockformatting/BlockFormattingContext.h:
3522         * layout/inlineformatting/InlineFormattingContext.cpp:
3523         (WebCore::Layout::InlineFormattingContext::createFormattingState const): Deleted.
3524         (WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const): Deleted.
3525         * layout/inlineformatting/InlineFormattingContext.h:
3526
3527 2018-07-21  Zalan Bujtas  <zalan@apple.com>
3528
3529         [LFC][BFC] Do not collapse top/bottom margin with first/last inflow child from a non-block formatting context.
3530         https://bugs.webkit.org/show_bug.cgi?id=187867
3531
3532         Reviewed by Antti Koivisto.
3533
3534         The box's top/bottom margin never collapses with a non-block inflow child.
3535
3536         * layout/blockformatting/BlockMarginCollapse.cpp:
3537         (WebCore::Layout::isMarginTopCollapsedWithSibling):
3538         (WebCore::Layout::isMarginBottomCollapsedWithSibling):
3539         (WebCore::Layout::isMarginTopCollapsedWithParent):
3540         (WebCore::Layout::isMarginBottomCollapsedThrough):
3541         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
3542         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop):
3543         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop):
3544         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom):
3545         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
3546         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
3547         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
3548         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
3549         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
3550         * layout/layouttree/LayoutBox.cpp:
3551         (WebCore::Layout::Box::establishesBlockFormattingContextOnly const): <div style="overflow: hidden">foobar</div> establishes both inline and block formatting context (inline wins though).
3552         * layout/layouttree/LayoutBox.h: establishesBlockFormattingContext() does not need to be virtual since we can determine it by looking at the box's style. -while in case
3553         of inline formatting context, it is about the content.
3554
3555 2018-07-20  Jer Noble  <jer.noble@apple.com>
3556
3557         REGRESSION (r233974): Cannot close pip'd video; pops back into PiP.
3558         https://bugs.webkit.org/show_bug.cgi?id=187873
3559
3560         Reviewed by Jon Lee.
3561
3562         When the PIP machinery on Mac wants to close the PIP window (due to the close button being clicked), it does
3563         not consult our -shouldClosePiP handler; it just tells us that we're going to close. So we never setup the 
3564         necessary state on the WebProcess side and still think that our "targetIsFullscreen". When we get the "stop"
3565         action, just request exit fullscreen, but set up the _pipState to think we're already exiting (because we are).
3566
3567         * platform/mac/VideoFullscreenInterfaceMac.mm:
3568         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
3569
3570 2018-07-20  Justin Fan  <justin_fan@apple.com>
3571
3572         Safari WebGL does not consistently provide correct GPU context on eGPU systems
3573         https://bugs.webkit.org/show_bug.cgi?id=187750
3574         <rdar://problem/39531436>
3575
3576         Reviewed by Dean Jackson.
3577
3578         Move GraphicsContext3DManager into its own class, and notify it when page/Chrome receives a 
3579         windowScreenDidChange message. Add a private data struct to track which hostWindow created each context.
3580         Upon notification, Manager updates the contexts that match the hostWindow with the
3581         provided displayID. Each context matches displayID to rendererID (set during process creation 
3582         if window server is blocked), which is matched to a virtual screen, and updates its GPU accordingly.
3583
3584         No new tests. This requires multiple GPUs or eGPUs, each with attached display(s), to test.
3585
3586         * WebCore.xcodeproj/project.pbxproj:
3587         * page/Chrome.cpp:
3588         (WebCore::Chrome::windowScreenDidChange): Now calls GraphicsContext3DManager::screenDidChange().
3589         * platform/PlatformScreen.h:
3590         * platform/ScreenProperties.h: Add rendererID to struct.
3591         (WebCore::ScreenData::encode const):
3592         (WebCore::ScreenData::decode):
3593         * platform/graphics/GraphicsContext3D.h:
3594         * platform/graphics/GraphicsContext3DManager.cpp: Added (copied out of GraphicsContext3DCocoa.mm).
3595         (WebCore::attachToAppleGraphicsControl):
3596         (WebCore::hasMuxCapability):
3597         (WebCore::hasMuxableGPU):
3598         (WebCore::GraphicsContext3DManager::sharedManager):
3599         (WebCore::displayWasReconfigured):
3600         (WebCore::GraphicsContext3DManager::updateAllContexts):
3601         (WebCore::GraphicsContext3DManager::screenDidChange):
3602         (WebCore::GraphicsContext3DManager::addContext):
3603         (WebCore::GraphicsContext3DManager::removeContext):
3604         (WebCore::GraphicsContext3DManager::hostWindowForContext const):
3605         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
3606         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
3607         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
3608         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
3609         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
3610         * platform/graphics/GraphicsContext3DManager.h: Added (copied out of GraphicsContext3DCocoa.mm).
3611         (WebCore::GraphicsContext3DManager::hasTooManyContexts const):
3612         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager):
3613         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3614         (WebCore::GraphicsContext3D::create):
3615         (WebCore::GraphicsContext3D::createShared):
3616         (WebCore::identifyAndSetCurrentGPU): Now matches rendererIDs to determine virtual screen. 
3617         (WebCore::GraphicsContext3D::GraphicsContext3D):
3618         (WebCore::GraphicsContext3D::~GraphicsContext3D):
3619         (WebCore::GraphicsContext3D::setContextVisibility):
3620         (WebCore::GraphicsContext3D::simulateContextChanged):
3621         (WebCore::GraphicsContext3D::screenDidChange):
3622         (WebCore::attachToAppleGraphicsControl): Deleted.
3623         (WebCore::hasMuxCapability): Deleted.
3624         (WebCore::hasMuxableGPU): Deleted.
3625         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Deleted.
3626         (WebCore::GraphicsContext3DManager::hasTooManyContexts const): Deleted.
3627         (WebCore::manager): Deleted.
3628         (WebCore::displayWasReconfigured): Deleted.
3629         (WebCore::GraphicsContext3DManager::updateAllContexts): Deleted.
3630         (WebCore::GraphicsContext3DManager::addContext): Deleted.
3631         (WebCore::GraphicsContext3DManager::removeContext): Deleted.
3632         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance): Deleted.
3633         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance): Deleted.
3634         (WebCore::GraphicsContext3DManager::updateHighPerformanceState): Deleted.
3635         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Deleted.
3636         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Deleted.
3637         * platform/mac/PlatformScreenMac.mm: Provide a display's rendererID.
3638         (WebCore::rendererIDForDisplayMask):
3639         (WebCore::collectScreenProperties):
3640         (WebCore::rendererIDForDisplay):
3641         (WebCore::primaryRendererID):
3642
3643 2018-07-19  Simon Fraser  <simon.fraser@apple.com>
3644
3645         Remove completed animations from GraphicsLayer, thus avoiding excessive backing store allocation
3646         https://bugs.webkit.org/show_bug.cgi?id=187844
3647         rdar://problem/40387294
3648
3649         Reviewed by Dean Jackson.
3650         
3651         A keyframe animation which animates 3D transforms, and is fill-forwards, currently
3652         leaves the GraphicsLayer in a state where it has a "running" animation. However, the
3653         logic that computes animation extent in RenderLayerBacking::updateGeometry() only does
3654         so for running or paused animations. GraphicsLayer then thinks that it has an active
3655         transform animation with unknown extent, and refuses to detach its backing store.
3656         
3657         This triggers excessive layer creation on some sites (e.g. https://www.kqed.org).
3658         
3659         Fix by always removing animations from the GraphicsLayer when they finish, whether
3660         or not they fill forwards. This is done by having KeyframeAnimation::onAnimationEnd()
3661         always call endAnimation().
3662         
3663         This change only fixes the non-Web Animation code path. webkit.org/b/187845 exists
3664         to fix the other code path.
3665         
3666         Also improve some logging that would have revealed this problem sooner.
3667
3668         Test: compositing/backing/backing-store-attachment-fill-forwards-animation.html
3669
3670         * page/animation/AnimationBase.h:
3671         (WebCore::AnimationBase::endAnimation):
3672         * page/animation/ImplicitAnimation.cpp:
3673         (WebCore::ImplicitAnimation::endAnimation):
3674         * page/animation/ImplicitAnimation.h:
3675         * page/animation/KeyframeAnimation.cpp:
3676         (WebCore::KeyframeAnimation::endAnimation):
3677         (WebCore::KeyframeAnimation::onAnimationEnd):
3678         * page/animation/KeyframeAnimation.h:
3679         * platform/graphics/ca/GraphicsLayerCA.cpp:
3680         (WebCore::GraphicsLayerCA::addAnimation):
3681         (WebCore::GraphicsLayerCA::updateCoverage):
3682
3683 2018-07-20  Ryosuke Niwa  <rniwa@apple.com>
3684
3685         Picking a color from the color panel for typing attributes needs to inverse transform through color-filter
3686         https://bugs.webkit.org/show_bug.cgi?id=187846
3687
3688         Reviewed by Simon Fraser.
3689
3690         This patch refines the color inversion for editing introduced in r234005 so that font panels and WebKit embedders
3691         can get and set inverted colors using attributed strings for a selected text in an editable region.
3692
3693         More specifically, when font panels or WebKit embedders set a font color or a background color via WebView's
3694         _applyStyleToSelection and _applyEditingStyleToSelection, WebKit would automatically invert the color before inserting
3695         into DOM so that the color visible to the user matches that's given to WebKit. Conversely,
3696         [WebView attributedSubstringFromRange:nsRange] now return the color visible to the user, i.e. the color after
3697         the color filter had been applied, so that some WebKit embedders can present the visually identical color to the user.
3698
3699         Because DOM never sees the color filter's effect in the computed style, etc... this patch reverts the change made to
3700         StyleChange in r234005 to avoid inverting the color passed to execCommand. This makes editing apps which is unaware
3701         of the dark mode or -apple-color-filter continue to function (because the color picker implemented in DOM will be
3702         applied of the same color filter before being presented to the user).
3703
3704         Finally, this patch introduces a testing hook in applyCommandToFrame so that executing foreColor or backColor with
3705         the soruce of CommandFromMenuOrKeyBinding would trigger the same code path as the one taken by Objective-C 
3706
3707         Tests: editing/execCommand/set-backColor-with-color-filter-from-scripts.html
3708                editing/execCommand/set-foreColor-with-color-filter-from-scripts.html
3709                editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html
3710                editing/style/set-backColor-with-color-filter.html
3711                editing/style/set-foreColor-with-color-filter.html
3712
3713         * editing/EditingStyle.cpp:
3714         (WebCore::EditingStyle::inverseTransformColorIfNeeded): Added.
3715         (WebCore::StyleChange::StyleChange): Revert the change made in r234005 since this code is also used by execCommand
3716         which is not desirable, and won't work for background color.
3717         (WebCore::StyleChange::extractTextStyles): Ditto.
3718         * editing/EditingStyle.h:
3719         * editing/Editor.cpp:
3720         (WebCore::Editor::applyStyle):
3721         (WebCore::Editor::applyStyleToSelection): Call EditingStyle::inverseTransformColorIfNeeded when ColorFilterMode is
3722         set to InvertColor.
3723         * editing/Editor.h:
3724         * editing/EditorCommand.cpp:
3725         (WebCore::applyCommandToFrame): Added the aforementioned testing hook.
3726         * editing/cocoa/HTMLConverter.mm:
3727         (WebCore::editingAttributedStringFromRange): Take the color filtr into account. Some WebKit embedders use this
3728         function to compute the font color in the selected text. Note that this function is mostly used for input methods
3729         so the color doesn't really matter, and its implementation is distinct from that of HTMLConverter.
3730
3731 2018-07-19  Jer Noble  <jer.noble@apple.com>
3732
3733         HLS resources with remote subresources will not taint canvasses.
3734         https://bugs.webkit.org/show_bug.cgi?id=187731
3735         <rdar://problem/42290703>
3736
3737         Reviewed by Brady Eidson.
3738
3739         Test: http/tests/security/canvas-remote-read-remote-video-hls.html
3740
3741         Most media sources are single-resource; they are accessed from a single origin. HLS manifests can contain many
3742         subresources from arbitrary origins, and canvases should be tainted when painted from media elements whose
3743         subresources were retrieved from tainting origins.
3744
3745         Add a new method to HTMLMediaElement, wouldTaintOrigin(), taking a SecurityOrigin, and returning whether the
3746         media element would taint that origin. This gets piped all the way down to MediaPlayerPrivateAVFoundationObjC
3747         which uses WebCoreNSURLSession to track all the origins of all the responses which resulted from the media
3748         element's load.
3749
3750         Drive-by fix: also fix this issue for media elements which render to an AudioContext.
3751
3752         Drive-by fix #2: CanvasRenderingContext2DBase::createPattern() needs to check the return value of
3753         ImageBuffer::create() before using it.
3754
3755         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
3756         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
3757         * html/HTMLMediaElement.cpp:
3758         (WebCore::HTMLMediaElement::didAttachRenderers):
3759         (WebCore::HTMLMediaElement::didDetachRenderers):
3760         (WebCore::HTMLMediaElement::scheduleUpdateShouldAutoplay):
3761         * html/HTMLMediaElement.h:
3762         (WebCore::HTMLMediaElement::wouldTaintOrigin const):
3763         * html/canvas/CanvasRenderingContext.cpp:
3764         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
3765         * html/canvas/CanvasRenderingContext2DBase.cpp:
3766         (WebCore::CanvasRenderingContext2DBase::createPattern):
3767         * platform/graphics/MediaPlayer.cpp:
3768         (WebCore::MediaPlayer::wouldTaintOrigin const):
3769         * platform/graphics/MediaPlayer.h:
3770         * platform/graphics/MediaPlayerPrivate.h:
3771         (WebCore::MediaPlayerPrivateInterface::hasSingleSecurityOrigin const):
3772         (WebCore::MediaPlayerPrivateInterface::wouldTaintOrigin const):
3773         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3774         (WebCore::CDMSessionAVContentKeySession::update):
3775         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3776         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3777         (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
3778         * platform/network/cocoa/WebCoreNSURLSession.h:
3779         * platform/network/cocoa/WebCoreNSURLSession.mm:
3780         (-[WebCoreNSURLSession task:didReceiveResponseFromOrigin:]):
3781         (-[WebCoreNSURLSession wouldTaintOrigin:]):
3782         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
3783
3784 2018-07-20  Zalan Bujtas  <zalan@apple.com>
3785
3786         Update FrameView::paintContents to use release logging.
3787         https://bugs.webkit.org/show_bug.cgi?id=187854
3788         <rdar://problem/42432371>
3789
3790         Reviewed by Simon Fraser.
3791
3792         Adding release logging helps identifying blank content cases. 
3793
3794         * page/FrameView.cpp:
3795         (WebCore::FrameView::paintContents):
3796
3797 2018-07-20  Jer Noble  <jer.noble@apple.com>
3798
3799         First Auto-PiP from Fullscreen too small & animation blocks
3800         https://bugs.webkit.org/show_bug.cgi?id=187745
3801         <rdar://problem/42316583>
3802
3803         Reviewed by Jon Lee.
3804
3805         1) When Auto-PiPing, we don't have the luxury of setting up the fullscreen state
3806         ahead of time; we get notified that PiP has already started. The area of the code
3807         which does this just-in-time setup needs to set the video layer's frame so that the
3808         transform within the PiP window is correct.
3809
3810         2) We generate a placeholder image when going into fullscreen, but we need to do
3811         so synchronously. Create the AVPlayerItemVideoOutput up front at AVPlayerItem creation
3812         time wherever AVPIVO is available.
3813
3814         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3815         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
3816         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3817         (VideoFullscreenInterfaceAVKit::doSetup):
3818
3819 2018-07-20  Antoine Quint  <graouts@apple.com>
3820
3821         DeclarativeAnimation should suspend, resume, & stop m_eventQueue
3822         https://bugs.webkit.org/show_bug.cgi?id=187216
3823         <rdar://problem/41669739>
3824
3825         Reviewed by Ryosuke Niwa.
3826
3827         Suspend, resume and close the GenericEventQueue for DeclarativeAnimation as instructed through the DOMActiveObject protocol.
3828
3829         * animation/DeclarativeAnimation.cpp:
3830         (WebCore::DeclarativeAnimation::stop):
3831         (WebCore::DeclarativeAnimation::suspend):
3832         (WebCore::DeclarativeAnimation::resume):
3833         * animation/DeclarativeAnimation.h:
3834         * animation/WebAnimation.h:
3835
3836 2018-07-20  Zalan Bujtas  <zalan@apple.com>
3837
3838         [LFC][Inline formatting context] Add basic text content handling.
3839         https://bugs.webkit.org/show_bug.cgi?id=187860
3840
3841         Reviewed by Antti Koivisto.
3842
3843         InlineFormattingContext::layout() walks through the formatting root's descendant list in a post-order fashion and
3844         feeds the TextContentProvider.
3845         Eventually this would turn into a more generic loop where we stop and process the text content when finding a non-text content box (float, inline-box etc), but right now
3846         this is about text content only.
3847
3848         * layout/displaytree/DisplayBox.h:
3849         (WebCore::Display::Box::contentBoxBottom const):
3850         (WebCore::Display::Box::contentBoxRight const):
3851         * layout/inlineformatting/InlineFormattingContext.cpp:
3852         (WebCore::Layout::InlineFormattingContext::layout const):
3853         * layout/inlineformatting/textlayout/TextContentProvider.cpp:
3854         (WebCore::Layout::TextContentProvider::textRuns): Add a helper function to support the case when all we need is just the run list in one go.
3855         * layout/inlineformatting/textlayout/TextContentProvider.h:
3856         * layout/layouttree/LayoutBox.cpp:
3857         (WebCore::Layout::Box::isDescendantOf const):
3858         * layout/layouttree/LayoutBox.h:
3859         * layout/layouttree/LayoutInlineBox.h:
3860         (WebCore::Layout::InlineBox::textContent const):
3861
3862 2018-07-20  Youenn Fablet  <youenn@apple.com>
3863
3864         FetchResponse should close its stream when loading finishes
3865         https://bugs.webkit.org/show_bug.cgi?id=187790
3866
3867         Reviewed by Chris Dumez.
3868
3869         It simplifies for a FetchResponse to push all its data into its stream if already created at end of load time.
3870         Did some refactoring in FetchBodyOwner to have a cleaner relationship with the stream source.
3871         Did a minor refactoring to expose the error description when loading fails as part of the rejected promise.
3872         This is consistent to errors sent back through callbacks.
3873
3874         Covered by existing tests.
3875
3876         * Modules/fetch/FetchBodyOwner.cpp:
3877         (WebCore::FetchBodyOwner::~FetchBodyOwner):
3878         * Modules/fetch/FetchBodyOwner.h:
3879         * Modules/fetch/FetchBodySource.cpp:
3880         (WebCore::FetchBodySource::FetchBodySource):
3881         (WebCore::FetchBodySource::setActive):
3882         (WebCore::FetchBodySource::setInactive):
3883         (WebCore::FetchBodySource::doStart):
3884         (WebCore::FetchBodySource::doPull):
3885         (WebCore::FetchBodySource::doCancel):
3886         (WebCore::FetchBodySource::cleanBodyOwner):
3887         * Modules/fetch/FetchBodySource.h:
3888         * Modules/fetch/FetchResponse.cpp:
3889         (WebCore::FetchResponse::BodyLoader::didSucceed):
3890         (WebCore::FetchResponse::BodyLoader::didFail):
3891
3892 2018-07-20  Jer Noble  <jer.noble@apple.com>
3893
3894         REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
3895         https://bugs.webkit.org/show_bug.cgi?id=187814
3896         <rdar://problem/42391869>
3897
3898         Reviewed by Eric Carlson.
3899
3900         After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
3901         VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
3902         assertion no longer holds true.
3903
3904         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3905         (-[WebAVPlayerLayer layoutSublayers]):
3906         (-[WebAVPlayerLayer resolveBounds]):
3907         (-[WebAVPlayerLayer setVideoGravity:]):
3908
3909 2018-07-19  Antoine Quint  <graouts@apple.com>
3910
3911         Flaky crash in AnimationTimeline::cancelOrRemoveDeclarativeAnimation
3912         https://bugs.webkit.org/show_bug.cgi?id=187530
3913         <rdar://problem/42095186>
3914
3915         Reviewed by Dean Jackson.
3916
3917         We would crash in cancelOrRemoveDeclarativeAnimation() because updateCSSAnimationsForElement() would pass
3918         nullptr values due to the return value of cssAnimationsByName.take(nameOfAnimationToRemove). This is because