Implement DOMMatrixReadOnly.transformPoint()
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-06-04  Chris Dumez  <cdumez@apple.com>
2
3         Implement DOMMatrixReadOnly.transformPoint()
4         https://bugs.webkit.org/show_bug.cgi?id=172900
5
6         Reviewed by Simon Fraser.
7
8         Implement DOMMatrixReadOnly.transformPoint():
9         - https://drafts.fxtf.org/geometry/#dommatrixreadonly
10         - https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-transformpoint
11
12         Test: imported/blink/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html
13
14         * css/DOMMatrixReadOnly.cpp:
15         (WebCore::DOMMatrixReadOnly::transformPoint):
16         * css/DOMMatrixReadOnly.h:
17         * css/DOMMatrixReadOnly.idl:
18
19 2017-06-04  Zan Dobersek  <zdobersek@igalia.com>
20
21         [GCrypt] Improve comments in AES, PBKDF2, RSA-SSA algorithm implementations
22         https://bugs.webkit.org/show_bug.cgi?id=172894
23
24         Reviewed by Michael Catanzaro.
25
26         Add or improve code comments in libgcrypt implementations for the AES_CBC,
27         AES_GCM, AES_KW, PBKDF2 and RSA-SSA algorithms.
28
29         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Add generic comments that
30         describe each operation that's performed.
31         (WebCore::gcryptEncrypt):
32         (WebCore::gcryptDecrypt):
33         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Ditto.
34         (WebCore::gcryptEncrypt):
35         (WebCore::gcryptDecrypt):
36         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Ditto.
37         (WebCore::gcryptWrapKey):
38         (WebCore::gcryptUnwrapKey):
39         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Ditto.
40         (WebCore::gcryptDeriveBits):
41         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
42         (WebCore::gcryptVerify): Align the verification results comment with the
43         one that's used in the ECDSA implementation.
44
45 2017-06-03  Chris Dumez  <cdumez@apple.com>
46
47         Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
48         https://bugs.webkit.org/show_bug.cgi?id=172898
49
50         Reviewed by Sam Weinig.
51
52         Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
53         as per:
54         - https://drafts.fxtf.org/geometry/#dommatrixreadonly
55
56         Test: http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html
57
58         * css/DOMMatrix.cpp:
59         (WebCore::DOMMatrix::fromFloat32Array):
60         (WebCore::DOMMatrix::fromFloat64Array):
61         * css/DOMMatrix.h:
62         * css/DOMMatrix.idl:
63         * css/DOMMatrixReadOnly.cpp:
64         (WebCore::DOMMatrixReadOnly::fromFloat32Array):
65         (WebCore::DOMMatrixReadOnly::fromFloat64Array):
66         (WebCore::DOMMatrixReadOnly::toFloat32Array):
67         (WebCore::DOMMatrixReadOnly::toFloat64Array):
68         * css/DOMMatrixReadOnly.h:
69         * css/DOMMatrixReadOnly.idl:
70
71 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
72
73         Implement DOMPointReadOnly.matrixTransform()
74         https://bugs.webkit.org/show_bug.cgi?id=172896
75
76         Reviewed by Chris Dumez.
77
78         DOMPointReadOnly.matrixTransform() creates the matrix or throws, then uses
79         a new function in TransformationMatrix to map x,y,z,w through the matrix.
80
81         Test: http/wpt/geometry/DOMPoint-003.html
82
83         * CMakeLists.txt:
84         * WebCore.xcodeproj/project.pbxproj:
85         * css/DOMMatrixReadOnly.h:
86         (WebCore::DOMMatrixReadOnly::transformationMatrix):
87         * dom/DOMPointReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.idl.
88         (WebCore::DOMPointReadOnly::matrixTransform):
89         * dom/DOMPointReadOnly.h:
90         * dom/DOMPointReadOnly.idl:
91         * platform/graphics/transforms/TransformationMatrix.cpp:
92         (WebCore::TransformationMatrix::map4ComponentPoint):
93         * platform/graphics/transforms/TransformationMatrix.h:
94
95 2017-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
96
97         Cleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
98         https://bugs.webkit.org/show_bug.cgi?id=172886
99
100         Reviewed by Simon Fraser.
101
102         The number of arguments is getting out of control.
103
104         No new tests because there is no behavior change.
105
106         * platform/graphics/FontCache.h:
107         * platform/graphics/cocoa/FontCacheCoreText.cpp:
108         (WebCore::preparePlatformFont):
109         (WebCore::fontWithFamily):
110         (WebCore::FontCache::createFontPlatformData):
111         (WebCore::FontCache::systemFallbackForCharacters):
112         * platform/graphics/mac/FontCacheMac.mm:
113         (WebCore::platformFontWithFamilySpecialCase):
114         * platform/graphics/mac/FontCustomPlatformData.cpp:
115         (WebCore::FontCustomPlatformData::fontPlatformData):
116         * platform/spi/cocoa/CoreTextSPI.h:
117
118 2017-06-03  Yusuke Suzuki  <utatane.tea@gmail.com>
119
120         Script modules should be able to import data urls
121         https://bugs.webkit.org/show_bug.cgi?id=171594
122
123         Reviewed by Youenn Fablet.
124
125         Tests: js/dom/classic-script-with-data-url.html
126                js/dom/modules/module-script-with-data-url.html
127
128         Script tag resources should have SameOriginDataURLFlag::Set to load data URLs
129         since script tags should treat data URLs as same origin.
130
131         * bindings/js/CachedScriptFetcher.cpp:
132         (WebCore::CachedScriptFetcher::requestScriptWithCache):
133
134 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
135
136         Sort the project file.
137
138         * WebCore.xcodeproj/project.pbxproj:
139
140 2017-06-03  Zan Dobersek  <zdobersek@igalia.com>
141
142         [GCrypt] Gather SUBTLE_CRYPTO utility functions in a single header
143         https://bugs.webkit.org/show_bug.cgi?id=172870
144
145         Reviewed by Jiewen Tan.
146
147         Gather the helper functions used across different source files
148         for libgcrypt-backed SUBTLE_CRYPTO implementations in a single
149         header file.
150
151         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
152         (WebCore::hashCryptoDigestAlgorithm): Deleted.
153         (WebCore::hashAlgorithmName): Deleted.
154         (WebCore::mpiData): Deleted.
155         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
156         (WebCore::gcryptDeriveBits):
157         (WebCore::macAlgorithmForHashFunction): Deleted.
158         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
159         (WebCore::gcryptDeriveBits):
160         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
161         (WebCore::mpiData): Deleted.
162         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
163         (WebCore::hashCryptoDigestAlgorithm): Deleted.
164         (WebCore::hashAlgorithmName): Deleted.
165         (WebCore::mpiData): Deleted.
166         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
167         (WebCore::hashAlgorithmName): Deleted.
168         (WebCore::mpiData): Deleted.
169         * crypto/gcrypt/GCryptUtilities.h: Added.
170         (WebCore::hashAlgorithmName):
171         (WebCore::hmacAlgorithm):
172         (WebCore::digestAlgorithm):
173         (WebCore::hashCryptoDigestAlgorithm):
174         (WebCore::mpiData):
175
176 2017-06-03  Zan Dobersek  <zdobersek@igalia.com>
177
178         [GCrypt] Fix PK verification for ECDSA
179         https://bugs.webkit.org/show_bug.cgi?id=172857
180
181         Reviewed by Michael Catanzaro.
182
183         No new tests -- covered by existing tests.
184
185         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
186         (WebCore::gcryptVerify): Return `true` if the verification succeeded or `false`
187         in any other case, avoiding spilling information about the exact cause of
188         verification failure.
189
190 2017-06-02  Zalan Bujtas  <zalan@apple.com>
191
192         Cleanup FrameView::autoSizeIfEnabled.
193         https://bugs.webkit.org/show_bug.cgi?id=172889
194         <rdar://problem/32550783>
195
196         Reviewed by Tim Horton.
197
198         This patch ensures that we always have a clean tree (and a valid and current document size) when
199         setting m_autoSizeContentSize. 
200
201         * page/FrameView.cpp:
202         (WebCore::FrameView::autoSizeIfEnabled):
203
204 2017-06-02  Wenson Hsieh  <wenson_hsieh@apple.com>
205
206         REGRESSION(r216212): RenderReplaced::paint() should not save and restore the context unless it has to
207         https://bugs.webkit.org/show_bug.cgi?id=172883
208         <rdar://problem/32548614>
209
210         Reviewed by Tim Horton.
211
212         After implementing dragged content fading, RenderReplace::paint is now always guarded by unnecessary calls to
213         GraphicsContext::save and GraphicsContext::restore, even when there is no dragged content being rendered. To
214         address this, we initialize our GraphicsContextStateSaver with saveAndRestore = false, indicating that we don't
215         want to immediately try and save the context.
216
217         If we are in a dragged content range, we will then call GraphicsContextStateSaver::save, which saves the
218         graphics context and also causes the GraphicsContextStateSaver to eventually try and restore() when it is
219         destroyed. Otherwise, in the common codepath where the renderer is not in a dragged content range, the
220         constructor and destructor of GraphicsContextStateSaver will be no-ops with respect to saving and restoring the
221         graphics context.
222
223         * rendering/RenderReplaced.cpp:
224         (WebCore::RenderReplaced::paint):
225
226 2017-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
227
228         REGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
229         https://bugs.webkit.org/show_bug.cgi?id=172737
230
231         Reviewed by Simon Fraser.
232
233         Revert the part of r213464 which changed how we calculate the weights of system fonts.
234
235         Add an InternalSetting to trigger our mock of the accessbility "Bold Text" setting. We can't
236         use the real setting, so instead we just ask for bold fonts instead of regular fonts when this
237         setting is true.
238
239         Tests: fast/text/accessibility-bold-system-font.html
240                fast/text/accessibility-bold-system-font-2.html
241
242         * platform/graphics/FontCache.h:
243         (WebCore::FontCache::shouldMockBoldSystemFontForAccessibility):
244         (WebCore::FontCache::setShouldMockBoldSystemFontForAccessibility):
245         * platform/graphics/ios/FontCacheIOS.mm:
246         (WebCore::platformFontWithFamilySpecialCase):
247         * rendering/RenderTheme.h:
248         (WebCore::RenderTheme::shouldMockBoldSystemFontForAccessibility):
249         (WebCore::RenderTheme::setShouldMockBoldSystemFontForAccessibility):
250         * rendering/RenderThemeIOS.h:
251         * rendering/RenderThemeIOS.mm:
252         (WebCore::cssWeightOfSystemFont):
253         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
254         * testing/InternalSettings.cpp:
255         (WebCore::InternalSettings::Backup::Backup):
256         (WebCore::InternalSettings::Backup::restoreTo):
257         (WebCore::InternalSettings::setShouldMockBoldSystemFontForAccessibility):
258         * testing/InternalSettings.h:
259         * testing/InternalSettings.idl:
260
261 2017-06-02  Brady Eidson  <beidson@apple.com>
262
263         Prevent scheme handlers from handling all built-in URL schemes.
264         <rdar://problem/32404790> and https://bugs.webkit.org/show_bug.cgi?id=172869
265
266         Reviewed by Andy Estes.
267
268         Covered by API test.
269
270         This patch refactors SchemeRegistry to keep a base, constant set of each of the special
271         URL schemes that WebKit knows about by default.
272         
273         It then exposes that list through a new method to support WK2 API.
274
275         * platform/SchemeRegistry.cpp:
276         (WebCore::allBuiltinSchemes):
277         (WebCore::builtinLocalURLSchemes):
278         (WebCore::localURLSchemes):
279         (WebCore::builtinSecureSchemes):
280         (WebCore::secureSchemes):
281         (WebCore::builtinSchemesWithUniqueOrigins):
282         (WebCore::schemesWithUniqueOrigins):
283         (WebCore::builtinEmptyDocumentSchemes):
284         (WebCore::emptyDocumentSchemes):
285         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
286         (WebCore::canDisplayOnlyIfCanRequestSchemes):
287         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
288         (WebCore::builtinCORSEnabledSchemes):
289         (WebCore::CORSEnabledSchemes):
290         (WebCore::SchemeRegistry::isBuiltinScheme):
291         * platform/SchemeRegistry.h:
292
293 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
294
295         All scroll peformance logging should happen in the UI process
296         https://bugs.webkit.org/show_bug.cgi?id=172874
297         rdar://problem/24474830
298
299         Reviewed by Tim Horton.
300
301         Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
302         so we have to log from the UI process.
303
304         Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
305         WebPageProxy, which prints them with the same format they had before. Some plumbing through
306         PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
307         through to something that can get to Page.
308
309         * WebCore.xcodeproj/project.pbxproj:
310         * page/Page.cpp:
311         (WebCore::Page::Page):
312         (WebCore::Page::~Page):
313         * page/Page.h:
314         (WebCore::Page::performanceLoggingClient):
315         * page/PageConfiguration.cpp:
316         * page/PageConfiguration.h:
317         * page/PerformanceLoggingClient.cpp: Added.
318         (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
319         * page/PerformanceLoggingClient.h: Added.
320         (WebCore::PerformanceLoggingClient::~PerformanceLoggingClient):
321         * page/scrolling/AsyncScrollingCoordinator.cpp:
322         (WebCore::AsyncScrollingCoordinator::reportExposedUnfilledArea):
323         (WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
324         * page/scrolling/AsyncScrollingCoordinator.h:
325         * page/scrolling/ScrollingTree.h:
326         (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
327         (WebCore::ScrollingTree::reportExposedUnfilledArea):
328         * page/scrolling/ThreadedScrollingTree.cpp:
329         (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
330         (WebCore::ThreadedScrollingTree::reportExposedUnfilledArea):
331         * page/scrolling/ThreadedScrollingTree.h:
332         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
333         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
334         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
335         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
336         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea):
337         (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea): Deleted.
338         (WebCore::logThreadedScrollingMode): Deleted.
339         * platform/graphics/GraphicsLayerClient.h:
340         (WebCore::GraphicsLayerClient::logFilledVisibleFreshTile):
341         * platform/graphics/ca/GraphicsLayerCA.cpp:
342         (WebCore::GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile):
343         * platform/graphics/ca/GraphicsLayerCA.h:
344         * platform/graphics/ca/PlatformCALayerClient.h:
345         (WebCore::PlatformCALayerClient::platformCALayerLogFilledVisibleFreshTile):
346         * platform/graphics/ca/TileController.cpp:
347         (WebCore::TileController::logFilledVisibleFreshTile):
348         * platform/graphics/ca/TileController.h:
349         * platform/graphics/ca/TileGrid.cpp:
350         (WebCore::TileGrid::platformCALayerPaintContents):
351         * platform/graphics/ca/TileGrid.h:
352         * rendering/RenderLayerBacking.cpp:
353         (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
354         * rendering/RenderLayerBacking.h:
355
356 2017-06-02  Eric Carlson  <eric.carlson@apple.com>
357
358         [MediaStream iOS] Cleanup video muting/unmuting when tab visibility changes
359         https://bugs.webkit.org/show_bug.cgi?id=172858
360
361         Reviewed by Youenn Fablet.
362
363         Test: platform/ios/mediastream/video-muted-in-background-tab.html
364
365         * dom/Document.cpp:
366         (WebCore::Document::visibilityStateChanged): Call notifyMediaCaptureOfVisibilityChanged.
367         (WebCore::Document::notifyMediaCaptureOfVisibilityChanged): Renamed from notifyVisibilityChangedToMediaCapture.
368         Set m_videoCaptureMutedForVisibilityChange when capture is muted because the document is hidden,
369         and clear it when visibility changes when capture is disabled. Don't unmute when the document
370         becomes visible unless this m_videoCaptureMutedForVisibilityChange is still true.
371         (WebCore::Document::notifyVisibilityChangedToMediaCapture): Deleted.
372         * dom/Document.h:
373
374         * platform/mediastream/RealtimeMediaSource.h:
375         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
376         (WebCore::RealtimeMediaSourceCenter::setVideoCaptureMutedForPageVisibility): Renamed from
377         setVisibility.
378         (WebCore::RealtimeMediaSourceCenter::setVisibility): Deleted.
379         * platform/mediastream/RealtimeMediaSourceCenter.h:
380
381         * platform/mediastream/mac/AVVideoCaptureSource.mm:
382         (WebCore::AVVideoCaptureSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
383         (WebCore::AVVideoCaptureSourceFactory::setVisibility): Deleted.
384
385         * platform/mock/MockRealtimeVideoSource.cpp:
386         (WebCore::MockRealtimeVideoSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
387         (WebCore::MockRealtimeVideoSourceFactory::setVisibility): Deleted.
388
389 2017-06-02  Frederic Wang  <fwang@igalia.com>
390
391         [Mac] Include frames in the scrolling tree when ScrollingTreeIncludesFrames=true
392         https://bugs.webkit.org/show_bug.cgi?id=172825
393
394         Reviewed by Simon Fraser.
395
396         This commit generalizes RenderLayerCompositor/ScrollingCoordinator so that it handles the
397         case of non-main frames. When ScrollingTreeIncludesFrames=true, all the frames will appear
398         in the scrolling tree on Mac WK2.
399
400         Test: fast/scrolling/scrolling-tree-includes-frame.html
401
402         * page/scrolling/ScrollingCoordinator.cpp:
403         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Do not to restrict to the
404         main frame.
405         * rendering/RenderLayerCompositor.cpp:
406         (WebCore::RenderLayerCompositor::updateBacking): Do not to restrict to the main frame.
407         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer): Make this function a class
408         member so it can call hasCoordinatedScrolling and no longer needs a RenderView parameter.
409         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Do not to restrict to the
410         main frame.
411         * rendering/RenderLayerCompositor.h: Introduce useCoordinatedScrollingForLayer.
412
413 2017-06-02  Don Olmstead  <don.olmstead@am.sony.com>
414
415         [WebCore] DragImageRef should correspond to USE(CAIRO)
416         https://bugs.webkit.org/show_bug.cgi?id=172863
417
418         Reviewed by Carlos Alberto Lopez Perez.
419
420         No new tests. No change in behavior.
421
422         * platform/DragImage.h:
423
424 2017-06-02  Frederic Wang  <fwang@igalia.com>
425
426         [Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true
427         https://bugs.webkit.org/show_bug.cgi?id=172851
428
429         Reviewed by Simon Fraser.
430
431         When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require
432         special composited layer. This commit enables that on mac but only when
433         ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged.
434
435         Test: compositing/iframes/compositing-for-scrollable-iframe.html
436
437         * rendering/RenderLayerCompositor.cpp:
438         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not enable frame
439         compositing when ScrollingTreeIncludesFrames=false.
440         Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger.
441         * page/ChromeClient.h: Rename ScrollableInnerFrameTrigger.
442
443 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
444
445         Get <chrono> out of StdLibExtras.h
446         https://bugs.webkit.org/show_bug.cgi?id=172744
447
448         Reviewed by Zalan Bujtas.
449
450         Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
451
452         * fileapi/FileReader.cpp:
453         * inspector/InspectorOverlay.cpp:
454         * loader/CrossOriginPreflightResultCache.cpp:
455         * loader/cache/CachedResource.cpp:
456         (WebCore::CachedResource::freshnessLifetime):
457         * page/ResourceUsageThread.cpp:
458         (WebCore::ResourceUsageThread::threadBody):
459         * page/cocoa/MemoryReleaseCocoa.mm:
460         (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
461         * platform/network/CacheValidation.cpp:
462         (WebCore::computeFreshnessLifetimeForHTTPFamily):
463         * platform/network/CacheValidation.h:
464
465 2017-06-02  Andy Estes  <aestes@apple.com>
466
467         [Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest
468         https://bugs.webkit.org/show_bug.cgi?id=172832
469         <rdar://problem/30735544>
470
471         Reviewed by Alex Christensen.
472
473         Test: http/tests/ssl/applepay/ApplePaySessionV3.html
474
475         * Modules/applepay/ApplePayPaymentRequest.h:
476         * Modules/applepay/ApplePayPaymentRequest.idl:
477         * Modules/applepay/ApplePaySession.cpp:
478         (WebCore::convertAndValidate):
479         * Modules/applepay/PaymentRequest.h:
480         (WebCore::PaymentRequest::supportedCountries):
481         (WebCore::PaymentRequest::setSupportedCountries):
482         * Modules/applepay/PaymentRequestValidator.cpp:
483         (WebCore::PaymentRequestValidator::validate):
484         * platform/spi/cocoa/PassKitSPI.h:
485
486 2017-06-02  Devin Rousso  <drousso@apple.com>
487
488         Web Inspector: Should see active Web Sockets when opening Web Inspector
489         https://bugs.webkit.org/show_bug.cgi?id=172312
490
491         Reviewed by Joseph Pecoraro.
492
493         Test: http/tests/websocket/tests/hybi/inspector/before-load.html
494
495         * Modules/websockets/WebSocket.h:
496         * Modules/websockets/WebSocket.cpp:
497         (WebCore::WebSocket::WebSocket):
498         (WebCore::WebSocket::~WebSocket):
499         (WebCore::WebSocket::allActiveWebSockets):
500         (WebCore::WebSocket::allActiveWebSocketsMutex):
501         (WebCore::WebSocket::channel):
502         (WebCore::WebSocket::eventTargetInterface):
503         Add a static set of all WebSocket objects and provide getters to access web socket metadata.
504
505         * Modules/websockets/ThreadableWebSocketChannel.h:
506         (WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
507         * Modules/websockets/WebSocketChannel.h:
508         * Modules/websockets/WebSocketChannel.cpp:
509         (WebCore::WebSocketChannel::isWebSocketChannel):
510         (WebCore::WebSocketChannel::identifier):
511         (WebCore::WebSocketChannel::clientHandshakeRequest):
512         (WebCore::WebSocketChannel::serverHandshakeResponse):
513         (WebCore::WebSocketChannel::handshakeMode):
514         (WebCore::WebSocketChannel::isType):
515         Provide getters to access web socket metadata.
516
517         * inspector/InspectorNetworkAgent.cpp:
518         (WebCore::InspectorNetworkAgent::enable):
519         Loops over the static set of all WebSocket objects and sends events for each to the frontend.
520
521 2017-06-02  Chris Dumez  <cdumez@apple.com>
522
523         Unreviewed, fix linking errors on iOS after r217712.
524
525         * platform/OrientationNotifer.h:
526         (WebCore::OrientationNotifier::Observer::setNotifier):
527
528 2017-06-02  Chris Dumez  <cdumez@apple.com>
529
530         Crash under OrientationNotifier::Observer::setNotifier()
531         https://bugs.webkit.org/show_bug.cgi?id=172847
532         <rdar://problem/32519127>
533
534         Reviewed by Youenn Fablet.
535
536         Update OrientationNotifier::Observer::setNotifier() to unregister itself from
537         its current notifier if it already has one. This is needed because
538         Internals::setCameraMediaStreamTrackOrientation() may be used to override the
539         notifier of an observer. If we override the notifier without unregistering
540         the observer from its previous notifier, then the previous notifier will not
541         get notified when the observer gets destroyed.
542
543         No new tests, already covered by webrtc/video-rotation.html that is currently
544         failing on some bots.
545
546         * platform/OrientationNotifer.h:
547         (WebCore::OrientationNotifier::Observer::setNotifier):
548
549 2017-06-02  Javier Fernandez  <jfernandez@igalia.com>
550
551         [css-grid] Logical margin incorrectly applied during the tracks sizing algorithm of auto tracks
552         https://bugs.webkit.org/show_bug.cgi?id=172836
553
554         Reviewed by Manuel Rego Casasnovas.
555
556         When computing min-content and max-content of the content-sized tracks
557         we are using the marginIntrinsicLogicalWidthForChild function, which
558         uses the grid's writing-mode to determine wether to use the child's
559         margin width or height. This is not correct when the grid item is
560         orthogonal.
561
562         This patch changes how we compute the tracks width so we use always
563         the item's marginLogicalWidth, which depends only on its own writing
564         mode.
565
566         Test: fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html
567
568         * rendering/GridTrackSizingAlgorithm.cpp:
569         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
570         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
571
572 2017-06-02  Emilio Cobos Álvarez  <ecobos@igalia.com>
573
574         Invalidate the shadow subtree style when slotted pseudo rules are present.
575         https://bugs.webkit.org/show_bug.cgi?id=172822
576
577         Reviewed by Antti Koivisto.
578
579         No new tests, this is tested by
580         fast/shadow-dom/css-scoping-slot-with-id.html, once we don't force an
581         Inherit style change for slots. I could add some more tests for stuff
582         with descendant combinators and similar I guess, though.
583
584         * style/AttributeChangeInvalidation.cpp:
585         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
586         * style/ClassChangeInvalidation.cpp:
587         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
588         * style/IdChangeInvalidation.cpp:
589         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
590
591 2017-06-02  Miguel Gomez  <magomez@igalia.com>
592
593         [GTK+][WPE] Allow TextureMapperShaderProgram to perform colorspace conversions with the source texture pixels
594         https://bugs.webkit.org/show_bug.cgi?id=172749
595
596         Reviewed by Žan Doberšek.
597
598         Currently TextureMapperGL is only able to paint properly textures that are in RGBA format. There are
599         situations where we will want it to be able to handle other formats (for example BGRA for gstreamer-gl).
600         To make this possible without having to perform the color conversion in the CPU, we add a new color
601         conversion matrix to TextureMapperShaderProgram. This matrix will perform the color space conversion
602         in the GPU, just after sampling the source texture.
603
604         Also, add a new flag to TextureMapperGL to indicate that a color conversion is required to handle a
605         texture. This flag will be set to the TextureMapperPlatformLayerBuffers as required, and TextureMapperGL
606         will set the appropriate color space matrix to the shader. Initially only the flag for BGRA->RGBA conversion
607         is defined, but support for new transformations can be added as needed.
608
609         VideoTextureCopierGStreamer also uses the TextureMapperShaderProgram to perform texture sampling, but for
610         the moment it just sets an identity matrix because when using gstreamer-gl, the format of the video frames
611         is RGBA. This will be changed soon to use BGRA.
612
613         No new tests.
614
615         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
616         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
617         * platform/graphics/texmap/TextureMapperGL.cpp:
618         (WebCore::colorSpaceMatrixForFlags):
619         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
620         * platform/graphics/texmap/TextureMapperGL.h:
621         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
622         * platform/graphics/texmap/TextureMapperShaderProgram.h:
623
624 2017-06-02  Javier Fernandez  <jfernandez@igalia.com>
625
626         [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track
627         https://bugs.webkit.org/show_bug.cgi?id=172590
628
629         Reviewed by Sergio Villar Senin.
630
631         We need to consider orthogonality when using the item's logical margin to
632         compute the available space for stretching.
633
634         The issue this patch fixes is only reproducible when the grid layout logic
635         is executed several times, since probably the item doesn't need to be
636         laid out again. In such cases, we just get the cached logical margins
637         but we were not taking orthogonality into account.
638
639         Test: fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts.html
640
641         * rendering/RenderGrid.cpp:
642         (WebCore::RenderGrid::layoutBlock):
643         (WebCore::RenderGrid::marginLogicalSizeForChild):
644         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
645         * rendering/RenderGrid.h:
646
647 2017-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
648
649         [GTK] Cache RenderThemeGadget hierarchies for rendering themed elements with GTK+ 3.20+
650         https://bugs.webkit.org/show_bug.cgi?id=162673
651
652         Reviewed by Michael Catanzaro.
653
654         Because of the way the new theming system works in GTK+ >= 3.20 we are currently creating a gadget hierarchy
655         every time we need to render a styled element or get layout information about it. That's happening on every
656         repaint, and it's specially problematic for overlay scrollbar indicators that fade in/out when shown/hidden. We
657         need to cache the gadgets and simply apply the state before every paint or layout query. When using GtkWidgetPath,
658         calling gtk_style_context_save() breaks the gadget hierarchy, and style classes need to be set when building the
659         GtkWidgetPath. That means we can't cache RenderThemeGadgets, call save, apply style classes and state, and then
660         call restore. We need to cache gadget hierarchies with fixed style classes. Fortunately, setting the state does
661         work, so we don't need to also cache a different hierarchy for every possible state. For example, for the
662         particular case of scrollbars we would cache VerticalScrollbarRight, VerticalScrollbarLeft, HorizontalScrollbar,
663         VerticalScrollIndicatorRight, VerticalScrollIndicatorLeft and HorizontalScrollIndicator. In practice, we will
664         only have 4 of those at the same time in the cache.
665         This patch adds RenderThemeWidget to represent a hierarchy of gadgets with fixed style classes that can be
666         cached and reused to render or query style of those "widgets". It also simplifies the RenderThemeGtk and
667         ScrollbarThemeGtk code by removing a lot of duplicated code to build the gadget hierarchies.
668
669         * PlatformGTK.cmake:
670         * platform/gtk/RenderThemeGadget.cpp:
671         (WebCore::createStyleContext):
672         (WebCore::appendElementToPath):
673         (WebCore::RenderThemeGadget::state):
674         (WebCore::RenderThemeGadget::setState):
675         * platform/gtk/RenderThemeGadget.h:
676         * platform/gtk/RenderThemeWidget.cpp: Added.
677         (WebCore::widgetMap):
678         (WebCore::RenderThemeWidget::getOrCreate):
679         (WebCore::RenderThemeWidget::clearCache):
680         (WebCore::RenderThemeWidget::~RenderThemeWidget):
681         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
682         (WebCore::RenderThemeScrollbar::stepper):
683         (WebCore::RenderThemeToggleButton::RenderThemeToggleButton):
684         (WebCore::RenderThemeButton::RenderThemeButton):
685         (WebCore::RenderThemeComboBox::RenderThemeComboBox):
686         (WebCore::RenderThemeEntry::RenderThemeEntry):
687         (WebCore::RenderThemeSearchEntry::RenderThemeSearchEntry):
688         (WebCore::RenderThemeSpinButton::RenderThemeSpinButton):
689         (WebCore::RenderThemeSlider::RenderThemeSlider):
690         (WebCore::RenderThemeProgressBar::RenderThemeProgressBar):
691         (WebCore::RenderThemeListView::RenderThemeListView):
692         (WebCore::RenderThemeIcon::RenderThemeIcon):
693         * platform/gtk/RenderThemeWidget.h: Added.
694         (WebCore::RenderThemeEntry::entry):
695         (WebCore::RenderThemeEntry::selection):
696         * platform/gtk/ScrollbarThemeGtk.cpp:
697         (WebCore::ScrollbarThemeGtk::themeChanged):
698         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
699         (WebCore::widgetTypeForScrollbar):
700         (WebCore::contentsRectangle):
701         (WebCore::ScrollbarThemeGtk::trackRect):
702         (WebCore::ScrollbarThemeGtk::backButtonRect):
703         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
704         (WebCore::ScrollbarThemeGtk::paint):
705         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
706         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
707         * rendering/RenderThemeGtk.cpp:
708         (WebCore::createStyleContext):
709         (WebCore::setToggleSize):
710         (WebCore::paintToggle):
711         (WebCore::RenderThemeGtk::paintButton):
712         (WebCore::menuListColor):
713         (WebCore::RenderThemeGtk::popupInternalPaddingBox):
714         (WebCore::RenderThemeGtk::paintMenuList):
715         (WebCore::RenderThemeGtk::adjustTextFieldStyle):
716         (WebCore::RenderThemeGtk::paintTextField):
717         (WebCore::adjustSearchFieldIconStyle):
718         (WebCore::paintSearchFieldIcon):
719         (WebCore::RenderThemeGtk::paintSliderTrack):
720         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
721         (WebCore::RenderThemeGtk::paintSliderThumb):
722         (WebCore::RenderThemeGtk::progressBarRectForBounds):
723         (WebCore::RenderThemeGtk::paintProgressBar):
724         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
725         (WebCore::RenderThemeGtk::paintInnerSpinButton):
726         (WebCore::styleColor):
727         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
728         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
729         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
730         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
731         (WebCore::RenderThemeGtk::paintMediaButton):
732
733 2017-06-01  Andreas Kling  <akling@apple.com>
734
735         [Mac] Remove backing store for layers that are outside the viewport
736         https://bugs.webkit.org/show_bug.cgi?id=170082
737         <rdar://problem/31245009>
738
739         Reviewed by Simon Fraser.
740
741         Implement the backingStoreAttached flag in PlatformCALayerCocoa. This means that
742         compositing layers outside the tiling coverage rect will no longer have backing
743         stores, saving large amounts of memory.
744
745         Also added a canDetachBackingStore flag that is set to false for scroll control
746         layers, to avoid complicating coverage rect computations.
747
748         Test: compositing/backing-store-attachment-1.html
749
750         * page/Frame.h:
751         * platform/graphics/GraphicsLayer.cpp:
752         (WebCore::GraphicsLayer::GraphicsLayer):
753         (WebCore::GraphicsLayer::dumpProperties):
754         * platform/graphics/GraphicsLayer.h:
755         (WebCore::GraphicsLayer::backingStoreAttached):
756         (WebCore::GraphicsLayer::setCanDetachBackingStore):
757         (WebCore::GraphicsLayer::canDetachBackingStore):
758         * platform/graphics/GraphicsLayerClient.h:
759         * platform/graphics/ca/GraphicsLayerCA.cpp:
760         (WebCore::GraphicsLayerCA::backingStoreAttached):
761         (WebCore::GraphicsLayerCA::setNeedsDisplay):
762         (WebCore::GraphicsLayerCA::updateCoverage):
763         * platform/graphics/ca/GraphicsLayerCA.h:
764         * platform/graphics/ca/PlatformCALayer.h:
765         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
766         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
767         (PlatformCALayerCocoa::setBackingStoreAttached):
768         (PlatformCALayerCocoa::backingStoreAttached):
769         * rendering/RenderLayerBacking.cpp:
770         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
771         * rendering/RenderLayerCompositor.cpp:
772         (WebCore::RenderLayerCompositor::layerTreeAsText):
773         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
774         * testing/Internals.cpp:
775         (WebCore::toLayerTreeFlags):
776         * testing/Internals.h:
777         * testing/Internals.idl:
778
779 2017-06-01  Ryan Haddad  <ryanhaddad@apple.com>
780
781         Unreviewed, rolling out r217691.
782
783         This change broke the Windows build.
784
785         Reverted changeset:
786
787         "Web Inspector: Should see active Web Sockets when opening Web
788         Inspector"
789         https://bugs.webkit.org/show_bug.cgi?id=172312
790         http://trac.webkit.org/changeset/217691
791
792 2017-06-01  Joseph Pecoraro  <pecoraro@apple.com>
793
794         Unreviewed Windows build fix after r217691.
795
796         * Modules/websockets/WebSocketChannel.cpp:
797         (WebCore::WebSocketChannel::sendFrame):
798         * Modules/websockets/WebSocketChannel.h:
799         Disambiguate the Function being used.
800
801 2017-06-01  Youenn Fablet  <youenn@apple.com>
802
803         LibWebRTC might crash with frames having a null width or height
804         https://bugs.webkit.org/show_bug.cgi?id=172842
805         <rdar://problem/32514813>
806
807         Reviewed by Jon Lee.
808
809         Do not send black frames in case the video width or height is zero.
810         Also ensure that even if a null buffer is returned by the pool, no crash might actually happen.
811
812         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
813         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
814         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
815
816 2017-06-01  Devin Rousso  <drousso@apple.com>
817
818         Web Inspector: Should see active Web Sockets when opening Web Inspector
819         https://bugs.webkit.org/show_bug.cgi?id=172312
820
821         Reviewed by Joseph Pecoraro.
822
823         Test: http/tests/websocket/tests/hybi/inspector/before-load.html
824
825         * Modules/websockets/WebSocket.h:
826         * Modules/websockets/WebSocket.cpp:
827         (WebCore::WebSocket::WebSocket):
828         (WebCore::WebSocket::~WebSocket):
829         (WebCore::WebSocket::allActiveWebSockets):
830         (WebCore::WebSocket::allActiveWebSocketsMutex):
831         (WebCore::WebSocket::channel):
832         (WebCore::WebSocket::eventTargetInterface):
833         Add a static set of all WebSocket objects and provide getters to access web socket metadata.
834
835         * Modules/websockets/ThreadableWebSocketChannel.h:
836         (WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
837         * Modules/websockets/WebSocketChannel.h:
838         * Modules/websockets/WebSocketChannel.cpp:
839         (WebCore::WebSocketChannel::isWebSocketChannel):
840         (WebCore::WebSocketChannel::identifier):
841         (WebCore::WebSocketChannel::clientHandshakeRequest):
842         (WebCore::WebSocketChannel::serverHandshakeResponse):
843         (WebCore::WebSocketChannel::handshakeMode):
844         (WebCore::WebSocketChannel::isType):
845         Provide getters to access web socket metadata.
846
847         * inspector/InspectorNetworkAgent.cpp:
848         (WebCore::InspectorNetworkAgent::enable):
849         Loops over the static set of all WebSocket objects and sends events for each to the frontend.
850
851 2017-06-01  Simon Fraser  <simon.fraser@apple.com>
852
853         REGRESSION (r217296): Dragging a video only shows controls during drag event
854         https://bugs.webkit.org/show_bug.cgi?id=172837
855         rdar://problem/32434661
856
857         Reviewed by Zalan Bujtas.
858
859         r217296 changed RenderVideo::paintReplaced() from checking paintBehavior() flags on the FrameView
860         to paintInfo.paintBehavior flags. However, RenderLayer was stripping the PaintBehaviorFlattenCompositingLayers
861         flag from the paintInfo.paintBehavior flags, so fix that.
862
863         Not easily testable.
864
865         * rendering/RenderLayer.cpp:
866         (WebCore::RenderLayer::paintLayerContents):
867
868 2017-06-01  Simon Fraser  <simon.fraser@apple.com>
869
870         Remove the redundant selectionOnly argument from RenderLayer::paintForegroundForFragments()
871         https://bugs.webkit.org/show_bug.cgi?id=172835
872
873         Reviewed by Zalan Bujtas.
874
875         The 'selectionOnly' state is already encoded in localPaintingInfo.paintBehavior so there's
876         no need to pass it separately.
877
878         * rendering/RenderLayer.cpp:
879         (WebCore::RenderLayer::paintLayerContents):
880         (WebCore::RenderLayer::paintForegroundForFragments):
881         * rendering/RenderLayer.h:
882
883 2017-06-01  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
884
885         Fix compilation errors in LocalizedStrings.cpp on platform not USE(CF) nor USE(GLIB)
886         https://bugs.webkit.org/show_bug.cgi?id=172796
887
888         Reviewed by Alex Christensen.
889
890         No new tests needed. Fixing compilation errors.
891
892         * platform/LocalizedStrings.cpp:
893         (WebCore::contextMenuItemTagLookUpInDictionary):
894         (WebCore::imageTitle):
895         (WebCore::validationMessageRangeUnderflowText):
896         (WebCore::validationMessageRangeOverflowText):
897
898 2017-06-01  Chris Dumez  <cdumez@apple.com>
899
900         Unreviewed, rolling out r217647.
901
902         No longer needed after r217682
903
904         Reverted changeset:
905
906         "Avoid iterator invalidation bug in
907         WebCore::defaultPortForProtocol"
908         https://bugs.webkit.org/show_bug.cgi?id=172786
909         http://trac.webkit.org/changeset/217647
910
911 2017-06-01  Chris Dumez  <cdumez@apple.com>
912
913         Make WebCore::defaultPortForProtocol() thread-safe
914         https://bugs.webkit.org/show_bug.cgi?id=172797
915
916         Reviewed by Brent Fulgham.
917
918         Make WebCore::defaultPortForProtocol() thread-safe since it is called from the SecurityOrigin
919         constructor and SecurityOrigin objects are constructed from various threads.
920
921         This should not regress the non-testing code paths since we only pay locking costs if
922         a default port override has been set by the tests.
923
924         * platform/URL.cpp:
925         (WebCore::defaultPortForProtocolMapLock):
926         (WebCore::defaultPortForProtocolMapForTesting):
927         (WebCore::ensureDefaultPortForProtocolMapForTesting):
928         (WebCore::registerDefaultPortForProtocolForTesting):
929         (WebCore::clearDefaultPortForProtocolMapForTesting):
930         (WebCore::defaultPortForProtocol):
931
932 2017-06-01  Andy Estes  <aestes@apple.com>
933
934         REGRESSION (r217626): ENABLE_APPLE_PAY_SESSION_V3 was disabled by mistake
935         https://bugs.webkit.org/show_bug.cgi?id=172828
936
937         Reviewed by Beth Dakin.
938
939         * Configurations/FeatureDefines.xcconfig:
940
941 2017-06-01  Frederic Wang  <fwang@igalia.com>
942
943         ScrollingCoordinator::updateSynchronousScrollingReasons should consider non-main frames
944         https://bugs.webkit.org/show_bug.cgi?id=172806
945
946         Reviewed by Simon Fraser.
947
948         Currently, the scrolling coordinator does not manage scrolling of frames other than the main
949         one (bugs 171667 and 149264) and so ScrollingCoordinator::updateSynchronousScrollingReasons
950         is only relevant for the main frame. This commit refactors a bit ScrollingCoordinator so that
951         updateSynchronousScrollingReasons is considered for all the frames whose scrolling is
952         coordinated by the ScrollingCoordinator so non-main frames will be considered in the future.
953
954         No new tests, behavior is unchanged for now.
955
956         * page/scrolling/ScrollingCoordinator.cpp:
957         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): Add an ASSERT to ensure
958         that this function is only called for frame whose scrolling is coordinated by this class.
959         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames): Introduce a
960         new function to update synchronous scrolling for subframes whose scrolling is coordinated by
961         this class.
962         (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates): Update
963         synchronous scrolling reason for non-main frames too.
964         (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Update synchronous scrolling
965         reason for non-main frames too.
966         * page/scrolling/ScrollingCoordinator.h: Define updateSynchronousScrollingReasonsForAllFrames
967
968 2017-06-01  Andy Estes  <aestes@apple.com>
969
970         [Cocoa] Upstream support for JCB as a supported payment network
971         https://bugs.webkit.org/show_bug.cgi?id=172819
972
973         Reviewed by Tim Horton.
974
975         * Modules/applepay/PaymentRequest.cpp:
976         (WebCore::PaymentRequest::isValidSupportedNetwork):
977         (WebCore::isAdditionalValidSupportedNetwork): Deleted.
978
979 2017-06-01  Chris Dumez  <cdumez@apple.com>
980
981         Unreviewed, rolling out r217660.
982
983         This should not have landed given that the new assertion is
984         hit on debug EWS bots
985
986         Reverted changeset:
987
988         "Make sure we don't access WebCore::defaultPortForProtocol
989         from non-main thread"
990         https://bugs.webkit.org/show_bug.cgi?id=172797
991         http://trac.webkit.org/changeset/217660
992
993 2017-06-01  Brent Fulgham  <bfulgham@apple.com>
994
995         Make sure we don't access WebCore::defaultPortForProtocol from non-main thread
996         https://bugs.webkit.org/show_bug.cgi?id=172797
997
998         Reviewed by Alex Christensen.
999
1000         * platform/URL.cpp:
1001         (WebCore::defaultPortForProtocol): Add an assertion to make sure we don't access the
1002         DefaultPortForProtocolMapForTesting from multiple threads.
1003
1004 2017-06-01  Konstantin Tokarev  <annulen@yandex.ru>
1005
1006         Get rid of more HIGH_DPI_CANVAS leftovers
1007         https://bugs.webkit.org/show_bug.cgi?id=172751
1008
1009         Reviewed by Simon Fraser.
1010
1011         Get rid of HTMLCanvasElement::convertLogicalToDevice() and
1012         HTMLCanvasElement::convertDeviceToLogical() that are no longer needed,
1013         as canvas doesn't use device scale factor anymore.
1014
1015         No new tests needed.
1016
1017         * html/HTMLCanvasElement.cpp:
1018         (WebCore::HTMLCanvasElement::createImageBuffer): Use integer width()
1019         and height() instead of floating-point temporary deviceSize variable.
1020         (WebCore::HTMLCanvasElement::baseTransform): Return unmodified
1021         baseTransform of underlying ImageBuffer.
1022         * html/HTMLCanvasElement.h: Removed declarations of unused methods.
1023
1024 2017-05-31  Brent Fulgham  <bfulgham@apple.com>
1025
1026         Avoid iterator invalidation bug in WebCore::defaultPortForProtocol
1027         https://bugs.webkit.org/show_bug.cgi?id=172786
1028         <rdar://problem/32499586>
1029
1030         Reviewed by Chris Dumez.
1031
1032         Create the SecurityOrigin objects on the main thread (rather than the worker queues)
1033         since defaultPortForProtocol is not threadsafe.
1034
1035         * loader/ResourceLoadObserver.cpp:
1036         (WebCore::ResourceLoadObserver::logFrameNavigation):
1037         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1038         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1039
1040 2017-05-31  Mark Lam  <mark.lam@apple.com>
1041
1042         Remove overrides of visitChildren() that do not add any functionality.
1043         https://bugs.webkit.org/show_bug.cgi?id=172789
1044         <rdar://problem/32500865>
1045
1046         Reviewed by Andreas Kling.
1047
1048         No new tests needed.  Just deleting unneeded code.
1049
1050         * bindings/js/JSDOMWindowBase.cpp:
1051         (WebCore::JSDOMWindowBase::visitChildren): Deleted.
1052         * bindings/js/JSDOMWindowBase.h:
1053
1054 2017-05-31  Don Olmstead  <don.olmstead@am.sony.com>
1055
1056         [WebCore] Update AXObjectCache::startOrEndCharacterOffsetForRange signature for !HAVE(ACCESSIBILITY)
1057         https://bugs.webkit.org/show_bug.cgi?id=172769
1058
1059         Reviewed by Yusuke Suzuki.
1060
1061         No new tests. No change in behavior.
1062
1063         * accessibility/AXObjectCache.h:
1064         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
1065         * platform/Curl.cmake: Added.
1066
1067 2017-05-31  Mark Lam  <mark.lam@apple.com>
1068
1069         CodeGeneratorJS's InstanceNeedsVisitChildren should not return true just because a class is / extends EventTarget.
1070         https://bugs.webkit.org/show_bug.cgi?id=172782
1071         <rdar://problem/32498266>
1072
1073         Reviewed by Chris Dumez.
1074
1075         No new tests needed.  This change is covered by existing binding tests.
1076
1077         InstanceNeedsVisitChildren should also not check the IsJSBuiltinConstructor
1078         condition, which is not used to emit any additional code in the visitChildren
1079         override.
1080
1081         The other conditions for generating visitChildren() are adequate if the class
1082         needs to override visitChildren.  Currently, we're generating some visitChildren()
1083         methods that only call its Base::visitChildren().  Removing the "is / extends
1084         EventTarget" conditions removes those unneeded visitChildren overrides.
1085
1086         * bindings/scripts/CodeGeneratorJS.pm:
1087         (InstanceNeedsVisitChildren):
1088         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1089         (WebCore::JSTestClassWithJSBuiltinConstructor::visitChildren): Deleted.
1090         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
1091         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1092         (WebCore::JSTestDOMJIT::visitChildren): Deleted.
1093         * bindings/scripts/test/JS/JSTestDOMJIT.h:
1094         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1095         (WebCore::JSTestEventTarget::visitChildren): Deleted.
1096         * bindings/scripts/test/JS/JSTestEventTarget.h:
1097         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1098         (WebCore::JSTestJSBuiltinConstructor::visitChildren): Deleted.
1099         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
1100         * bindings/scripts/test/JS/JSTestNode.cpp:
1101         (WebCore::JSTestNode::visitChildren): Deleted.
1102         * bindings/scripts/test/JS/JSTestNode.h:
1103
1104 2017-05-31  Chris Dumez  <cdumez@apple.com>
1105
1106         Make QualifiedName cache per thread
1107         https://bugs.webkit.org/show_bug.cgi?id=172778
1108         <rdar://problem/32490942>
1109
1110         Reviewed by Geoffrey Garen.
1111
1112         Make QualifiedName cache per thread since it is currently used from multiple threads,
1113         in an unsafe fashion. We started using QualifiedName objects in background threads
1114         after r190602 which started using a CSSSelectorParser in the ContentExtensionParser.
1115
1116         * WebCore.xcodeproj/project.pbxproj:
1117         * dom/QualifiedName.cpp:
1118         (WebCore::QualifiedName::QualifiedName):
1119         (WebCore::QualifiedName::QualifiedNameImpl::~QualifiedNameImpl):
1120         * dom/QualifiedNameCache.cpp: Added.
1121         (WebCore::QNameComponentsTranslator::hash):
1122         (WebCore::QNameComponentsTranslator::equal):
1123         (WebCore::QNameComponentsTranslator::translate):
1124         (WebCore::QualifiedNameCache::getOrCreate):
1125         (WebCore::QualifiedNameCache::remove):
1126         * dom/QualifiedNameCache.h: Added.
1127         * platform/ThreadGlobalData.cpp:
1128         (WebCore::ThreadGlobalData::ThreadGlobalData):
1129         (WebCore::ThreadGlobalData::destroy):
1130         * platform/ThreadGlobalData.h:
1131         (WebCore::ThreadGlobalData::qualifiedNameCache):
1132
1133 2017-05-31  Andy Estes  <aestes@apple.com>
1134
1135         Rename ENABLE_APPLE_PAY_DELEGATE to ENABLE_APPLE_PAY_SESSION_V3 and bump the supported version number
1136         https://bugs.webkit.org/show_bug.cgi?id=172366
1137
1138         Reviewed by Daniel Bates.
1139
1140         * Configurations/FeatureDefines.xcconfig:
1141         * Modules/applepay/ApplePayError.idl:
1142         * Modules/applepay/ApplePayPaymentAuthorizationResult.idl:
1143         * Modules/applepay/ApplePayPaymentMethodUpdate.idl:
1144         * Modules/applepay/ApplePaySession.idl:
1145         * Modules/applepay/ApplePayShippingContactUpdate.idl:
1146         * Modules/applepay/ApplePayShippingMethodUpdate.idl:
1147
1148 2017-05-31  Youenn Fablet  <youenn@apple.com>
1149
1150         PeerConnection should respect tracks that are muted at the time they are added
1151         https://bugs.webkit.org/show_bug.cgi?id=172771
1152
1153         Reviewed by Eric Carlson.
1154
1155         Tests: webrtc/peer-connection-audio-unmute.html
1156                webrtc/video-unmute.html
1157
1158         Making sure that muted/enabled state of sources are correctly handled at creation time of the outgoing webrtc sources.
1159         This should trigger silent audio and black frames.
1160
1161         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1162         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
1163         (WebCore::RealtimeOutgoingAudioSource::setSource):
1164         (WebCore::RealtimeOutgoingAudioSource::initializeConverter):
1165         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1166         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1167         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
1168         (WebCore::RealtimeOutgoingVideoSource::setSource):
1169         (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
1170         (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
1171         (WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
1172         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
1173         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
1174         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
1175         (WebCore::RealtimeOutgoingVideoSource::setSizeFromSource): Deleted.
1176         (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames): Deleted.
1177         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
1178
1179 2017-05-31  Antti Koivisto  <antti@apple.com>
1180
1181         CrashTracer: Regression : com.apple.WebKit.WebContent at STP responsible :: com.apple.WebCore: WebCore::SharedBuffer::data const + 11
1182         https://bugs.webkit.org/show_bug.cgi?id=172747
1183         <rdar://problem/32275314>
1184
1185         Reviewed by Andreas Kling.
1186
1187         Test: http/tests/subresource-integrity/empty-stylesheet-integrity-crash.html
1188
1189         * loader/SubresourceIntegrity.cpp:
1190         (WebCore::matchIntegrityMetadata):
1191
1192             If the resource body is empty CachedResource::resourceBuffer() may be null.
1193
1194 2017-05-31  Frederic Wang  <fwang@igalia.com>
1195
1196         ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits is wrongly set
1197         https://bugs.webkit.org/show_bug.cgi?id=172349
1198
1199         Reviewed by Simon Fraser.
1200
1201         ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits was introduced in
1202         r133022 so that ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode
1203         know the number of bits use for properties in their parent class.
1204
1205         In r172649, r210560, r185762 and r183702 new properties were added to
1206         ScrollingStateScrollingNode but NumScrollingStateNodeBits was not increased accordingly. This
1207         means that there are potential conflicts between these new properties and those of derived
1208         classes ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode. It is not
1209         clear how to write a test case reproducing such conflict, though.
1210
1211         No new tests, this is a coding mistake but its effect is unclear.
1212
1213         * page/scrolling/ScrollingStateNode.cpp:
1214         (WebCore::ScrollingStateNode::setPropertyChanged): Use hasChangedProperty and cast to
1215         64-bits integer before shifting.
1216         * page/scrolling/ScrollingStateNode.h: Add a comment to make clear NumStateNodeBits must
1217         remain at the last position. Ensure we have enough bits available.
1218         (WebCore::ScrollingStateNode::hasChangedProperty): Cast to 64-bits integer before shifting.
1219         * page/scrolling/ScrollingStateScrollingNode.h: Fix position of NumScrollingStateNodeBits and
1220         also add a similar comment.
1221
1222 2017-05-31  Matt Lewis  <jlewis3@apple.com>
1223
1224         Unreviewed, rolling out r217603.
1225
1226         This patch broke the internal builds.
1227
1228         Reverted changeset:
1229
1230         "Get <chrono> out of StdLibExtras.h"
1231         https://bugs.webkit.org/show_bug.cgi?id=172744
1232         http://trac.webkit.org/changeset/217603
1233
1234 2017-05-31  Simon Fraser  <simon.fraser@apple.com>
1235
1236         Get <chrono> out of StdLibExtras.h
1237         https://bugs.webkit.org/show_bug.cgi?id=172744
1238
1239         Reviewed by Saam Barati.
1240
1241         Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
1242
1243         * fileapi/FileReader.cpp:
1244         * inspector/InspectorOverlay.cpp:
1245         * loader/CrossOriginPreflightResultCache.cpp:
1246         * loader/cache/CachedResource.cpp:
1247         (WebCore::CachedResource::freshnessLifetime):
1248         * page/ResourceUsageThread.cpp:
1249         (WebCore::ResourceUsageThread::threadBody):
1250         * page/cocoa/MemoryReleaseCocoa.mm:
1251         (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
1252         * platform/network/CacheValidation.cpp:
1253         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1254         * platform/network/CacheValidation.h:
1255
1256 2017-05-31  Emilio Cobos Álvarez  <ecobos@igalia.com>
1257
1258         Use the rare data's RenderStyle for display: contents.
1259         https://bugs.webkit.org/show_bug.cgi?id=172721
1260
1261         Reviewed by Antti Koivisto.
1262
1263         No new tests, no behavior change.
1264
1265         * dom/Element.cpp:
1266         (WebCore::Element::hasDisplayContents):
1267         (WebCore::Element::storeDisplayContentsStyle):
1268         * dom/Element.h:
1269         * dom/ElementRareData.h:
1270         (WebCore::ElementRareData::ElementRareData):
1271         * style/RenderTreeUpdater.cpp:
1272         (WebCore::RenderTreeUpdater::updateElementRenderer):
1273         * style/StyleTreeResolver.cpp:
1274         (WebCore::Style::TreeResolver::resolveComposedTree):
1275
1276 2017-05-31  Per Arne Vollan  <pvollan@apple.com>
1277
1278         LayoutTest media/video-orientation.html is failing
1279         https://bugs.webkit.org/show_bug.cgi?id=172648
1280         <rdar://problem/31322425>
1281
1282         Reviewed by Eric Carlson.
1283
1284         For videos with rotation tag set, the transform AVAssetTrack.preferredTransform applied to
1285         AVAssetTrack.naturalSize might return a CGSize instance with negative width or height.
1286
1287         Covered by existing tests.
1288
1289         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1290         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1291
1292 2017-05-30  Frederic Wang  <fwang@igalia.com>
1293
1294         Include ScrollingTreeScrollingNode properties in ScrollingTreeFrameScrollingNode::dumpProperties
1295         https://bugs.webkit.org/show_bug.cgi?id=172287
1296
1297         Reviewed by Simon Fraser.
1298
1299         No new tests, only changes in dumped tree.
1300
1301         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1302         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties): Print properties of the parent class.
1303
1304 2017-05-30  Sam Weinig  <sam@webkit.org>
1305
1306         Update test result after r217585.
1307
1308         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1309         (WebCore::JSTestNamedDeleterWithIndexedGetter::deleteProperty):
1310         (WebCore::JSTestNamedDeleterWithIndexedGetter::deletePropertyByIndex):
1311
1312 2017-05-30  Dan Bernstein  <mitz@apple.com>
1313
1314         Fixed the build after r217588.
1315
1316         * page/FrameView.h: Stopped exporting a function defined inline.
1317
1318 2017-05-30  Zalan Bujtas  <zalan@apple.com>
1319
1320         ASSERTION FAILED: m_layoutPhase == InPostLayerPositionsUpdatedAfterLayout || m_layoutPhase == OutsideLayout
1321         https://bugs.webkit.org/show_bug.cgi?id=171501
1322         <rdar://problem/31977453>
1323
1324         Reviewed by Simon Fraser.
1325
1326         We should be able to paint as long as the tree is clean and we are in paintable state.
1327
1328         * page/FrameView.cpp:
1329         (WebCore::FrameView::paintContents):
1330
1331 2017-05-30  Sam Weinig  <sam@webkit.org>
1332
1333         Revert accidentally checked in change.
1334
1335         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
1336         * crypto/mac/CryptoDigestAlgorithm.h:
1337
1338 2017-05-30  Sam Weinig  <sam@webkit.org>
1339
1340         [WebIDL] Generate named property deleters
1341         https://bugs.webkit.org/show_bug.cgi?id=172688
1342
1343         Reviewed by Chris Dumez.
1344
1345         Test: js/dom/named-property-deleter.html
1346
1347         * WebCore.xcodeproj/project.pbxproj:
1348         Add new file, JSDOMAbstractOperations.h
1349
1350         * bindings/js/JSDOMAbstractOperations.h: Added.
1351         (WebCore::isVisibleNamedProperty):
1352         Add an implementation of the abstract operation WebIDL calls the 'named property visibility algorithm'.
1353         It is used by many WebIDL algorithms, but currently I am only using this implementation for deleters.
1354         In the future, we should try and move the other property access generators to use it as well.
1355
1356         * bindings/js/JSDOMStringMapCustom.cpp:
1357         (WebCore::JSDOMStringMap::deleteProperty): Deleted.
1358         (WebCore::JSDOMStringMap::deletePropertyByIndex): Deleted.
1359         * bindings/js/JSStorageCustom.cpp:
1360         (WebCore::JSStorage::deleteProperty): Deleted.
1361         (WebCore::JSStorage::deletePropertyByIndex): Deleted.
1362         Remove now generated deleteProperty and deletePropertyByIndex implementations.
1363
1364         * bindings/scripts/CodeGeneratorJS.pm:
1365         (GenerateDeletePropertyCommon):
1366         (GenerateDeletePropertyDefinition):
1367         (GenerateDeletePropertyByIndexDefinition):
1368         (GenerateNamedDeleterDefinition):
1369         Added generation for named deleters. We generate both deleteProperty and deletePropertyByIndex.
1370
1371         (InstanceOverridesDelete):
1372         Add predicate for whether the header should declare deleteProperty and deletePropertyByIndex.
1373
1374         (GenerateHeader):
1375         Move property access hook declarations closer to each other. Use new InstanceOverridesDelete
1376         predicate for deleteProperty and deletePropertyByIndex.
1377  
1378         (GenerateImplementation):
1379         Add call to generate named deleter if one exists.
1380
1381         (GenerateConstructorHelperMethods):
1382         Remove an old FIXME that that was no longer true, there are no more interfaces that inherit from
1383         an interface with [NoInterfaceObject].
1384
1385         * dom/DOMStringMap.idl:
1386         Removes CustomDeleteProperty and sorts extended attributes.
1387
1388         * dom/DatasetDOMStringMap.h:
1389         * dom/DatasetDOMStringMap.cpp:
1390         (WebCore::DatasetDOMStringMap::isSupportedPropertyName):
1391         Added. This is a bindings support function (much like supportedPropertyNames()) that is
1392         used JSDOMAbstractOperations.h's isVisibleNamedProperty.
1393
1394         (WebCore::DatasetDOMStringMap::supportedPropertyNames):
1395         Convert to an early return.
1396
1397         (WebCore::DatasetDOMStringMap::deleteNamedProperty):
1398         (WebCore::DatasetDOMStringMap::deleteItem): Deleted.
1399         Renamed deleteItem to deleteNamedProperty, which is the name the bindings use for deleter
1400         operations without an identifier.
1401
1402         * page/DOMWindow.cpp:
1403         (WebCore::DOMWindow::sessionStorage):
1404         Fix incorrect indentation that bothered me.
1405
1406         * storage/Storage.cpp:
1407         * storage/Storage.h:
1408         - Remove isDisabledByPrivateBrowsing(), which had no definition.
1409         - Add isSupportedPropertyName(), which the deleter code (via the isVisibleNamedProperty algorithm)
1410           needs.
1411         
1412         * storage/Storage.idl:
1413         Removes CustomDeleteProperty, sorts the extended attributes, adds 'deleter' special 
1414         to the removeItem operation and adds a commented out 'setter' special to the 'setItem'
1415         operation.
1416
1417         * bindings/scripts/test/JS/JSTestObj.h:
1418         Update result for declarations moving around.
1419
1420         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: Added.
1421         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: Added.
1422         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: Added.
1423         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: Added.
1424         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: Added.
1425         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: Added.
1426         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: Added.
1427         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: Added.
1428         * bindings/scripts/test/TestNamedDeleterNoIdentifier.idl: Added.
1429         * bindings/scripts/test/TestNamedDeleterThrowingException.idl: Added.
1430         * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl: Added.
1431         * bindings/scripts/test/TestNamedDeleterWithIndexedGetter.idl: Added.
1432         Add new tests for named deleters.
1433
1434 2017-05-30  Joseph Pecoraro  <pecoraro@apple.com>
1435
1436         Web Inspector: images dragged from Inspector to Desktop are named "Unknown.png"
1437         https://bugs.webkit.org/show_bug.cgi?id=141515
1438         <rdar://problem/9251308>
1439
1440         Reviewed by Wenson Hsieh.
1441
1442         * html/HTMLAttributeNames.in:
1443
1444 2017-05-30  Youenn Fablet  <youenn@apple.com>
1445
1446         Add support for Certificate and IceCandidatePair stats
1447         https://bugs.webkit.org/show_bug.cgi?id=172734
1448
1449         Reviewed by Geoff Garen.
1450
1451         Covered by updated test.
1452
1453         Adding support for these two stats in the IDL and in the libwebrtc binding code.
1454
1455         * Modules/mediastream/RTCStatsReport.h:
1456         (WebCore::RTCStatsReport::IceCandidatePairStats::IceCandidatePairStats):
1457         (WebCore::RTCStatsReport::CertificateStats::CertificateStats):
1458         * Modules/mediastream/RTCStatsReport.idl:
1459         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1460         (WebCore::iceCandidatePairState):
1461         (WebCore::fillRTCIceCandidatePairStats):
1462         (WebCore::fillRTCCertificateStats):
1463         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
1464
1465 2017-05-30  Jiewen Tan  <jiewen_tan@apple.com>
1466
1467         Unreviewed, add some comments to HKDF/PBKDF2 Mac implementations
1468
1469         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
1470         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
1471         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
1472         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
1473
1474 2017-05-30  Jeremy Jones  <jeremyj@apple.com>
1475
1476         m_resourceSelectionTaskQueue tasks should be cleared when player is destroyed to prevent invalid state.
1477         https://bugs.webkit.org/show_bug.cgi?id=172726
1478         rdar://problem/30867764
1479
1480         Reviewed by Eric Carlson.
1481
1482         I haven't found a reproducible way to make a test case for this race condition.
1483
1484         If m_player is cleared while there is an outstanding task in m_resourceSelectionTaskQueue,
1485         that task may assume m_player is not null and crash. It is better to cancel that task than
1486         to perform it part way with null checks.
1487
1488         * html/HTMLMediaElement.cpp:
1489         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1490         (WebCore::HTMLMediaElement::clearMediaPlayer):
1491
1492 2017-05-30  Ryosuke Niwa  <rniwa@webkit.org>
1493
1494         Only include DataDetectorsUI headers in iOS
1495         https://bugs.webkit.org/show_bug.cgi?id=172633
1496
1497         Reviewed by David Kilzer.
1498
1499         Enable data detectors only on iOS and not other variants of iOS.
1500
1501         * editing/cocoa/DataDetection.h:
1502         * editing/cocoa/DataDetection.mm:
1503         * page/DragController.cpp:
1504         (WebCore::isDraggableLink):
1505         * platform/cocoa/DataDetectorsCoreSoftLink.h:
1506         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
1507         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
1508         * platform/spi/ios/DataDetectorsUISPI.h:
1509         * platform/spi/mac/DataDetectorsSPI.h:
1510
1511 2017-05-30  Chris Dumez  <cdumez@apple.com>
1512
1513         REGRESSION(r215946): Can't reference a table cell in Google spreadsheet
1514         https://bugs.webkit.org/show_bug.cgi?id=172703
1515         <rdar://problem/32458086>
1516
1517         Reviewed by Ryosuke Niwa.
1518
1519         We updated getClientRects() to return an array of DOMRect objects instead of
1520         a ClientRectList type, to match the latest specification. As it turns out, this
1521         is not Web-compatible as some content (as Google Spreadsheet) relies on the
1522         return type having an item() operation.
1523
1524         This patch re-introduces a DOMRectList type, with an item() operation. The
1525         DOMRectList name is currently not exposed to the Web as we do not know what's
1526         going to get specified yet (https://github.com/w3c/csswg-drafts/issues/1479).
1527
1528         No new tests, updated existing tests.
1529
1530         * CMakeLists.txt:
1531         * DerivedSources.make:
1532         * WebCore.xcodeproj/project.pbxproj:
1533         * dom/DOMRect.h:
1534         * dom/DOMRectList.cpp: Copied from Source/WebCore/dom/DOMRect.cpp.
1535         (WebCore::DOMRectList::DOMRectList):
1536         (WebCore::DOMRectList::~DOMRectList):
1537         * dom/DOMRectList.h: Copied from Source/WebCore/dom/DOMRect.cpp.
1538         (WebCore::DOMRectList::create):
1539         (WebCore::DOMRectList::length):
1540         (WebCore::DOMRectList::item):
1541         * dom/DOMRectList.idl: Renamed from Source/WebCore/dom/DOMRect.cpp.
1542         * dom/Element.cpp:
1543         (WebCore::Element::getClientRects):
1544         * dom/Element.h:
1545         * dom/Element.idl:
1546         * dom/Range.cpp:
1547         (WebCore::Range::getClientRects):
1548         * dom/Range.h:
1549         * dom/Range.idl:
1550         * page/Page.cpp:
1551         (WebCore::Page::nonFastScrollableRects):
1552         (WebCore::Page::touchEventRectsForEvent):
1553         (WebCore::Page::passiveTouchEventListenerRects):
1554         * page/Page.h:
1555         * testing/Internals.cpp:
1556         (WebCore::Internals::inspectorHighlightRects):
1557         (WebCore::Internals::touchEventRectsForEvent):
1558         (WebCore::Internals::passiveTouchEventListenerRects):
1559         (WebCore::Internals::nonFastScrollableRects):
1560         * testing/Internals.h:
1561         * testing/Internals.idl:
1562
1563 2017-05-30  Ali Juma  <ajuma@chromium.org>
1564
1565         [CredentialManagement] Incorporate IDL updates from latest spec
1566         https://bugs.webkit.org/show_bug.cgi?id=172011
1567
1568         Reviewed by Daniel Bates.
1569
1570         This patch adds IDL definitions for the CredentialsContainer, CredentialsUserData and
1571         FederatedCredentials interfaces, the NavigatorCredentials partial interface, and the
1572         CredentialCreationOptions, CredentialRequestOptions, FederatedCredentialRequestOptions,
1573         and PasswordCredentialData dictionaries. It also deletes IDL definitions for the
1574         SiteBoundCredential interface and the SiteBoundCredentialData dictionary.
1575
1576         Test: credentials/idlharness.html
1577
1578         * CMakeLists.txt:
1579         * DerivedSources.make:
1580         * Modules/credentials/BasicCredential.idl:
1581         * Modules/credentials/CredentialCreationOptions.h: Copied from Source/WebCore/Modules/credentials/PasswordCredential.cpp.
1582         * Modules/credentials/CredentialCreationOptions.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1583         * Modules/credentials/CredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1584         * Modules/credentials/CredentialRequestOptions.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1585         * Modules/credentials/CredentialUserData.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1586         (WebCore::CredentialUserData::~CredentialUserData):
1587         * Modules/credentials/CredentialUserData.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.idl.
1588         * Modules/credentials/CredentialsContainer.cpp: Copied from Source/WebCore/Modules/credentials/PasswordCredential.cpp.
1589         (WebCore::CredentialsContainer::get):
1590         (WebCore::CredentialsContainer::store):
1591         (WebCore::CredentialsContainer::isCreate):
1592         (WebCore::CredentialsContainer::preventSilentAccess):
1593         * Modules/credentials/CredentialsContainer.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.h.
1594         (WebCore::CredentialsContainer::create):
1595         (WebCore::CredentialsContainer::CredentialsContainer):
1596         * Modules/credentials/CredentialsContainer.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.idl.
1597         * Modules/credentials/FederatedCredential.cpp: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.cpp.
1598         (WebCore::FederatedCredential::FederatedCredential):
1599         (WebCore::FederatedCredential::~FederatedCredential):
1600         * Modules/credentials/FederatedCredential.h: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredential.h.
1601         (WebCore::FederatedCredential::create):
1602         (WebCore::FederatedCredential::provider):
1603         (WebCore::FederatedCredential::protocol):
1604         * Modules/credentials/FederatedCredential.idl: Copied from Source/WebCore/Modules/credentials/BasicCredential.idl.
1605         * Modules/credentials/FederatedCredentialInit.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1606         * Modules/credentials/FederatedCredentialInit.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.idl.
1607         * Modules/credentials/FederatedCredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1608         * Modules/credentials/FederatedCredentialRequestOptions.idl: Added.
1609         * Modules/credentials/NavigatorCredentials.cpp: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredential.cpp.
1610         (WebCore::NavigatorCredentials::NavigatorCredentials):
1611         (WebCore::NavigatorCredentials::~NavigatorCredentials):
1612         (WebCore::NavigatorCredentials::supplementName):
1613         (WebCore::NavigatorCredentials::credentials):
1614         (WebCore::NavigatorCredentials::from):
1615         * Modules/credentials/NavigatorCredentials.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1616         * Modules/credentials/NavigatorCredentials.idl: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredential.idl.
1617         * Modules/credentials/PasswordCredential.cpp:
1618         (WebCore::PasswordCredential::PasswordCredential):
1619         (WebCore::PasswordCredential::~PasswordCredential):
1620         * Modules/credentials/PasswordCredential.h:
1621         (WebCore::PasswordCredential::create):
1622         (WebCore::PasswordCredential::password):
1623         (WebCore::PasswordCredential::setIdName): Deleted.
1624         (WebCore::PasswordCredential::idName): Deleted.
1625         (WebCore::PasswordCredential::setPasswordName): Deleted.
1626         (WebCore::PasswordCredential::passwordName): Deleted.
1627         (WebCore::PasswordCredential::setAdditionalData): Deleted.
1628         (WebCore::PasswordCredential::additionalData): Deleted.
1629         * Modules/credentials/PasswordCredential.idl:
1630         * Modules/credentials/PasswordCredentialData.h: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1631         * Modules/credentials/PasswordCredentialData.idl: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredentialData.idl.
1632         * WebCore.xcodeproj/project.pbxproj:
1633
1634 2017-05-30  Alex Christensen  <achristensen@webkit.org>
1635
1636         Update libwebrtc configuration
1637         https://bugs.webkit.org/show_bug.cgi?id=172727
1638
1639         Reviewed by Geoffrey Garen.
1640
1641         * Configurations/FeatureDefines.xcconfig:
1642
1643 2017-05-30  Mark Lam  <mark.lam@apple.com>
1644
1645         convertEnumerationToJS() should not stash ASCIILiteral strings in NeverDestroyed arrays.
1646         https://bugs.webkit.org/show_bug.cgi?id=172724
1647         <rdar://problem/31193201>
1648
1649         Reviewed by Chris Dumez.
1650
1651         Use MAKE_STATIC_STRING_IMPL instead, which is guaranteed to be thread-safe and
1652         satisfies the promise of immortality promised by NeverDestroyed (while ASCIILiteral
1653         does not always satisfy this promise).
1654
1655         Also converted the ASSERT in convertEnumerationToJS() to a RELEASE_ASSERT as a
1656         debugging aid to check if it is ever passed an invalid enumerationValue.
1657
1658         No new tests because this is a speculative fix for an issue observed in the wild
1659         whose root cause is not known yet.  This patch also adds a release assert to
1660         gather more info about the nature of the issue.
1661
1662         * bindings/scripts/CodeGeneratorJS.pm:
1663         (GenerateEnumerationImplementationContent):
1664
1665         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1666         (WebCore::convertEnumerationToJS):
1667         * bindings/scripts/test/JS/JSTestObj.cpp:
1668         (WebCore::convertEnumerationToJS):
1669         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1670         (WebCore::convertEnumerationToJS):
1671         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
1672         (WebCore::convertEnumerationToJS):
1673         - re-baselined these test results.
1674
1675 2017-05-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1676
1677         REGRESSION(r216882): No image decoding is needed if the BitmapImage is created with a NativeImage
1678         https://bugs.webkit.org/show_bug.cgi?id=172670
1679
1680         Reviewed by Tim Horton.
1681
1682         Test: fast/images/large-image-webkit-canvas.html
1683
1684         Check whether the BitmapImage has created an ImageDecoder before trying 
1685         to decode its image frame.
1686
1687         * platform/graphics/ImageSource.cpp:
1688         (WebCore::ImageSource::shouldUseAsyncDecoding):
1689
1690 2017-05-30  Youenn Fablet  <youenn@apple.com>
1691
1692         RealtimeOutgoingVideoSource should not rotate muted frames
1693         https://bugs.webkit.org/show_bug.cgi?id=172659
1694
1695         Reviewed by Eric Carlson.
1696
1697         Test: webrtc/video-rotation.html
1698
1699         When sending black frames, it is unnecessary to rotate frames.
1700         Instead, it is better to create frame with the expected width and height.
1701         Making sure libwebrtc rotated images are not null, as only YUV rotation is supported.
1702
1703         Adding internals API to test part of that code path.
1704         Full coverage should be added when mock source is producing YUV images.
1705
1706         * Modules/mediastream/PeerConnectionBackend.h:
1707         (WebCore::PeerConnectionBackend::applyRotationForOutgoingVideoSources):
1708         * Modules/mediastream/RTCPeerConnection.h:
1709         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1710         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
1711         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1712         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1713         (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames):
1714         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
1715         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
1716         * testing/Internals.cpp:
1717         (WebCore::Internals::Internals):
1718         (WebCore::Internals::applyRotationForOutgoingVideoSources):
1719         (WebCore::Internals::setCameraMediaStreamTrackOrientation):
1720         * testing/Internals.h:
1721         * testing/Internals.idl:
1722
1723 2017-05-30  Brent Fulgham  <bfulgham@apple.com>
1724
1725         Unreviewed typo correction.
1726
1727         * loader/ResourceLoadObserver.cpp:
1728         (WebCore::ResourceLoadObserver::logFrameNavigation): I used an extra colon in my comment.
1729
1730 2017-05-30  Brent Fulgham  <bfulgham@apple.com>
1731
1732         REGRESSION(r217515): Correct iterator invalidation bug (AGAIN)
1733         https://bugs.webkit.org/show_bug.cgi?id=172722
1734         <rdar://problem/32462876>
1735
1736         Reviewed by Zalan Bujtas.
1737
1738         Over-enthusiastic clean-up during r217515 re-introduced a bug caused by holding a reference
1739         to an iterator that gets invalidated while handling the frame navigation. This patch returns
1740         to the copy/set behavior used prior to r217515. 
1741
1742         * loader/ResourceLoadObserver.cpp:
1743         (WebCore::ResourceLoadObserver::logFrameNavigation): Make a copy of the returned value, since
1744         the iterator will be invalidated during the function call. Then set the copy back in the data
1745         store with the updated counts.
1746
1747 2017-05-30  Fujii Hironori  <Hironori.Fujii@sony.com>
1748
1749         [WinCairo] TestWebKitAPI: SHOULD NEVER BE REACHED in WebCore::cairoSurfaceSize
1750         https://bugs.webkit.org/show_bug.cgi?id=172699
1751
1752         Reviewed by Brent Fulgham.
1753
1754         Tests: WebCore.BitmapImageEmptyFrameTest in TestWebKitAPI
1755
1756         * platform/graphics/cairo/CairoUtilities.cpp:
1757         (WebCore::cairoSurfaceSize): Added a case for win32 surface type.
1758
1759 2017-05-30  Miguel Gomez  <magomez@igalia.com>
1760
1761         [GTK][WPE][GSTREAMER_GL] Do not use cairo to copy video textures to an accelerated canvas
1762         https://bugs.webkit.org/show_bug.cgi?id=172542
1763
1764         Reviewed by Žan Doberšek.
1765
1766         When drawing gstreamer-gl video frames into an accelerated canvas, we are currently using cairo to copy
1767         the video textures into a new texture that will be painted into de destination canvas. While this eases
1768         the code, it doesn't allow us to control the copy process. This is a problem because in order to use
1769         gstreamer-gl properly, we will need to perform colorspace transformations during the copy. So, remove
1770         this cairo copy and use VideoTextureCopierGStreamer instead.
1771
1772         The usage of VideoTextureCopierGStreamer is pretty much the same than in the webgl case, except that
1773         no destination texture is provided. For that case, add a custom texture to hold the result that can
1774         be requested after the copy.
1775
1776         Covered by existent tests.
1777
1778         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1779         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
1780         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
1781         (WebCore::MediaPlayerPrivateGStreamerBase::prepareContextForCairoPaint): Deleted.
1782         (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
1783         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1784         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
1785         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
1786         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
1787         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
1788         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
1789         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
1790         (WebCore::VideoTextureCopierGStreamer::resultTexture):
1791
1792 2017-05-29  Antti Koivisto  <antti@apple.com>
1793
1794         Crash on display-contents-replaced-001.html
1795         https://bugs.webkit.org/show_bug.cgi?id=172596
1796
1797         Reviewed by Andreas Kling.
1798
1799         This is crashing because some code can't handle display:contents on form controls. Turns
1800         out the draft specification tell us to disable it for them in any case.
1801
1802         See https://drafts.csswg.org/css-display-3/#unbox
1803
1804         * css/StyleResolver.cpp:
1805         (WebCore::hasEffectiveDisplayNoneForDisplayContents):
1806
1807             For certain HTML elements (replaced elements, form controls) display:contents should
1808             behave like display:none.
1809             Also disable it for SVG and MathML elements.
1810
1811         (WebCore::StyleResolver::adjustRenderStyle):
1812
1813             Also compute to display:none when there is no associated element (pseudos etc).
1814
1815 2017-05-30  Zan Dobersek  <zdobersek@igalia.com>
1816
1817         [GCrypt] RSA-OAEP support
1818         https://bugs.webkit.org/show_bug.cgi?id=171222
1819
1820         Reviewed by Michael Catanzaro.
1821
1822         Add RSA-OAEP support for configurations that use libgcrypt.
1823
1824         The encryption operation embeds the plain-text data into a data s-expression,
1825         specifying OAEP as the padding method of choice and also adding information
1826         about the hash algorithm and any label data. This is then passed to the
1827         gcry_pk_encrypt() call together with the provided key, returning the enc-val
1828         s-expression containing the resulting cipher text. That's retrieved from the
1829         relevant MPI and returned to the caller.
1830
1831         The decryption operation embeds the cipher-text data into an enc-val
1832         s-expression, again specifying the hash algorithm and also filling in any
1833         label data. This is then passed, along with the key, to the gcry_pk_decrypt()
1834         call. The returned data s-expression contains the decrypted plain-text data
1835         inside the 'value' MPI, from which this data is extracted and returned to the
1836         caller.
1837
1838         No new tests -- the revelant tests are passing and are unskipped, apart from
1839         the ones using PKSC#8 and SPKI formats.
1840
1841         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
1842         (WebCore::hashAlgorithmName):
1843         (WebCore::mpiData):
1844         (WebCore::gcryptEncrypt):
1845         (WebCore::gcryptDecrypt):
1846         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
1847         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
1848
1849 2017-05-30  Zan Dobersek  <zdobersek@igalia.com>
1850
1851         Unreviewed follow-up to r217546. Address some review comments that I forgot about.
1852
1853         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
1854         (WebCore::gcryptEncrypt): Use quotations when referencing s-expression names in
1855         comments to avoid confusion.
1856         (WebCore::gcryptDecrypt): Ditto.
1857
1858 2017-05-30  Zan Dobersek  <zdobersek@igalia.com>
1859
1860         [GCrypt] RSAES-PKCS1-v1_5 support
1861         https://bugs.webkit.org/show_bug.cgi?id=171219
1862
1863         Reviewed by Michael Catanzaro.
1864
1865         Add RSAES-PKCS1-v1_5 support for configurations that use libgcrypt.
1866
1867         The encryption operation embeds the plain-text data into a data s-expression,
1868         specifying PKCS#1 as the padding method of choice. That's passed to the
1869         gcry_pk_encrypt() call together with the specified key. The returned enc-val
1870         expression contains the 'a' MPI from which the data is extracted and returned.
1871
1872         The decryption operation goes in reverse -- the cipher-text data is embedded
1873         into an enc-val s-expression that again also specifies PKCS#1 as the padding
1874         method. The s-expression is passed to gcry_pk_decrypt() together with the
1875         specified key. The returned data s-expression contains the decrypted text
1876         inside the 'value' parameter, so the data is extracted from that and returned
1877         to the caller.
1878
1879         No new tests -- the revelant tests are passing and are unskipped, apart from
1880         the ones using PKCS#8 and SPKI formats.
1881
1882         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
1883         (WebCore::mpiData):
1884         (WebCore::gcryptEncrypt):
1885         (WebCore::gcryptDecrypt):
1886         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
1887         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
1888
1889 2017-05-30  Zan Dobersek  <zdobersek@igalia.com>
1890
1891         [GCrypt] RSASSA-PKCS1-v1_5 support
1892         https://bugs.webkit.org/show_bug.cgi?id=171220
1893
1894         Reviewed by Michael Catanzaro.
1895
1896         Add RSASSA-PKSC1-V_15 support for configurations that use libgcrypt.
1897
1898         The signing operation first digests data with the specified hash algorithm.
1899         That's then embedded in the data s-expression. That's then passed to the
1900         gcry_pk_sign() call together with the specified key, returning a sig-val
1901         s-expression containing the signature. The signature data is then retrieved
1902         from the relevant MPI and returned to the caller.
1903
1904         The verification operation first digests data with the specified hash
1905         algorithm. That's then embedded in the data s-expression. A sig-val
1906         s-expression is constructed, embedding the signature data. The data and
1907         sig-val s-expressions are passed to the gcry_sexp_verify() call which returns
1908         the resulting error code. The verification succeeds if the returned value is
1909         GPG_ERR_NO_ERROR, fails if it's GPG_ERR_BAD_SIGNATURE, or errors out with an
1910         OperationError otherwise.
1911
1912         No new tests -- the revelant tests are passing and are unskipped, apart from
1913         the ones using PKCS#8 and SPKI formats.
1914
1915         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
1916         (WebCore::hashCryptoDigestAlgorithm):
1917         (WebCore::hashAlgorithmName):
1918         (WebCore::mpiData):
1919         (WebCore::gcryptSign):
1920         (WebCore::gcryptVerify):
1921         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
1922         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
1923
1924 2017-05-29  Emilio Cobos Álvarez  <ecobos@igalia.com>
1925
1926         Use the parent box style to adjust RenderStyle for alignment.
1927         https://bugs.webkit.org/show_bug.cgi?id=172215
1928
1929         Reviewed by Antti Koivisto.
1930
1931         The css-flexbox spec defined align-self in terms of the parent
1932         element, which is what this code did.
1933
1934         The css-align spec defines these properties in terms of the style of
1935         the containing box instead, which means display: contents styles
1936         should not be used for this adjustment, but the parent box style
1937         instead.
1938
1939         For example, align-items is defined as:
1940
1941         > This property specifies the default align-self for all of the boxes
1942         > (including anonymous boxes) participating in this box’s formatting
1943         > context.
1944
1945         Note that the css-align spec was recently updated to align (no pun
1946         intended) with Gecko, and make the |auto| value compute to itself.
1947         This patch puts us in a more recent spec than before, but not totally
1948         up-to-date.
1949
1950         Tests: imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-001.html
1951                imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-002.html
1952
1953         * css/StyleResolver.cpp:
1954         (WebCore::StyleResolver::adjustRenderStyle):
1955         (WebCore::StyleResolver::adjustStyleForAlignment):
1956
1957 2017-05-28  Dan Bernstein  <mitz@apple.com>
1958
1959         [Xcode] ALWAYS_SEARCH_USER_PATHS is set to YES
1960         https://bugs.webkit.org/show_bug.cgi?id=172691
1961
1962         Reviewed by Tim Horton.
1963
1964         * Configurations/Base.xcconfig: Set ALWAYS_SEARCH_USER_PATHS to NO.
1965         * WebCore.xcodeproj/project.pbxproj: Added DateTimeChooser.h, DateTimeChooserClient.h,
1966           PerformanceMark.h, PerformanceMeasure.h, SVGUnknownElement.h, and MathMLUnknownElement.h
1967           to the WebCore target.
1968
1969 2017-05-28  Sam Weinig  <sam@webkit.org>
1970
1971         [WebIDL] @@iterator should only be accessed once when disambiguating a union type
1972         https://bugs.webkit.org/show_bug.cgi?id=172684
1973
1974         Reviewed by Yusuke Suzuki.
1975
1976         WebIDL specifies that when determining if the value you are converting to a union
1977         is a sequence, you must get the @@iterator property and, should it exist, use it
1978         to iterate the sequence. While we correctly accessing the property to make the 
1979         determination, we were not passing it into the sequence conversion code, and thus
1980         the sequence conversion code re-accessed it, which is observable and wrong.
1981
1982         This patch pipes the @@iterator method through the sequence conversion code to avoid
1983         this.
1984
1985         Test: js/dom/sequence-in-union-iterator-access.html
1986
1987         * bindings/js/JSDOMConvertSequences.h:
1988         (WebCore::Detail::GenericSequenceConverter::convert):
1989         (WebCore::Detail::NumericSequenceConverter::convertArray):
1990         (WebCore::Detail::NumericSequenceConverter::convert):
1991         (WebCore::Detail::SequenceConverter::convertArray):
1992         (WebCore::Detail::SequenceConverter::convert):
1993         (WebCore::Detail::SequenceConverter<IDLLong>::convert):
1994         (WebCore::Detail::SequenceConverter<IDLFloat>::convert):
1995         (WebCore::Detail::SequenceConverter<IDLUnrestrictedFloat>::convert):
1996         (WebCore::Detail::SequenceConverter<IDLDouble>::convert):
1997         (WebCore::Detail::SequenceConverter<IDLUnrestrictedDouble>::convert):
1998         (WebCore::Converter<IDLSequence<T>>::convert):
1999         (WebCore::Converter<IDLFrozenArray<T>>::convert):
2000         Add variants of convert that take a JSObject* (sequence) / JSValue (iterator method)
2001         rather than just the JSValue (sequence). To avoid too much duplication, split some
2002         parts of SequenceConverter and NumericSequenceConverter up so they could be reused.
2003
2004         * bindings/js/JSDOMConvertUnion.h:
2005         - Fix incorrect step 3 (WebIDL got updated at some point and we didn't notice) to remove
2006           records.
2007         - Update sequence and FrozenArray checking/conversion to get the iterator method and pass
2008           it along, using the new ConditionalSequenceConverter helper which forwards to the new
2009           sequence converters that accept the iterator method.
2010
2011 2017-05-27  Chris Dumez  <cdumez@apple.com>
2012
2013         imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_attribute.html is crashing
2014         https://bugs.webkit.org/show_bug.cgi?id=172472
2015         <rdar://problem/32334831>
2016
2017         Reviewed by Ryosuke Niwa.
2018
2019         Fix assertion hit when running imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_attribute.html.
2020
2021         When the form was removed from the document, A descendant would try to find a new form owner in the document. If the descendant had 
2022         a form content attribute and there was another form in the document with this ID, then we would erroneously associate the descendant with
2023         that other form, even though that descendant is being disconnected. This is because when the form with the given id is removed, we
2024         notify the IdTargetObservers of the change. In this case, the form control is an IdTargetObserver and gets notified after
2025         removedFrom() has been called on the form but *before* removedFrom() has been called on its descendant form control. As a result, the
2026         form control still thinks it is in the tree (i.e. isConnected() wrongly returns true) and we make the wrong decision and try to
2027         associate it with another form in the document.
2028
2029         To address the problem, we leverage the fact that when a form element is being removed, it already notifies its associated form
2030         controls that it is being removed. When it does, we make sure to clear the control's id observer if the form is its ancestor.
2031         The ID observer is no longer needed beyond this point since the control is now disconnected from the document, and the ID observer
2032         callback would erroneously associate it with another form element in the document of the same ID because isConnected() still returns
2033         true at that point.
2034         As a result, the control's form owner is kept unchanged, which is the right thing to do here, since it is its ancestor, even
2035         though both are detached.
2036
2037         Test: fast/dom/HTMLFormElement/form-removal-duplicate-id-crash.html
2038
2039         * dom/ContainerNode.h:
2040         (WebCore::Node::rootNode):
2041         Inline rootNode to avoid an extra function call in the fast path case. For the slow path, we now
2042         call traverseToRootNode() to avoid duolicating logic.
2043
2044         * dom/Node.cpp:
2045         (WebCore::Node::traverseToRootNode):
2046         Add a traverseToRootNode() method which gets the root node by traversing the ancestors. This logic was duplicated in 3 places:
2047         - Slow path in Node::rootNode()
2048         - computeRootNode() in FormAssociatedElement.cpp
2049         - findRoot() in HTMLFormElement.cpp
2050         They are now consolidated in a single place to avoid duplication.
2051
2052         * dom/Node.h:
2053         * html/FormAssociatedElement.cpp:
2054         (WebCore::FormAssociatedElement::removedFrom):
2055         Just simplify the logic a bit:
2056         - Clear the id observer (i.e. m_formAttributeTargetObserver) no matter what. Since the element is no longer part of the document,
2057           it is no longer needed. We would previously have checks that would basically avoid resetting m_formAttributeTargetObserver to
2058           null if it is already null. Settign m_formAttributeTargetObserver to null is cheap so there is no reason for those checks. Those
2059           checks were also confusing because they made it look like we would sometimes keep on id observer after being removed from the
2060           document.
2061         - Use new traverseToRootNode() utility function (no behavior change)
2062         - Drop unnecessary |element| local variable
2063
2064         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
2065         - Rename to formOwnerRemovedFromTree() to make it clear that it is the element's form owner that is removed, and not just any form.
2066         - As we traverse the tree up to find the root, also check if we find the form owner. If we do, clear the id observer since we are
2067           effectively detached from the document and return early since there is no need to reset our form owner in this case.
2068
2069         * html/FormAssociatedElement.h:
2070         * html/HTMLFormElement.cpp:
2071         (WebCore::HTMLFormElement::removedFrom):
2072         - Use new traverseToRootNode() utility function (no behavior change)
2073
2074 2017-05-27  Yusuke Suzuki  <utatane.tea@gmail.com>
2075
2076         [DOMJIT] Move DOMJIT patchpoint infrastructure out of domjit
2077         https://bugs.webkit.org/show_bug.cgi?id=172260
2078
2079         Reviewed by Filip Pizlo.
2080
2081         * ForwardingHeaders/jit/Snippet.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h.
2082         * ForwardingHeaders/jit/SnippetParams.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h.
2083         * bindings/scripts/CodeGeneratorJS.pm:
2084         (GenerateHeader):
2085         (GenerateImplementation):
2086         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2087         * domjit/DOMJITCheckDOM.h:
2088         (WebCore::DOMJIT::checkDOM):
2089         * domjit/DOMJITHelpers.h:
2090         (WebCore::DOMJIT::toWrapper):
2091         * domjit/JSDocumentDOMJIT.cpp:
2092         (WebCore::checkSubClassSnippetForJSDocument):
2093         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
2094         (WebCore::DocumentBodyDOMJIT::callDOMGetter):
2095         (WebCore::checkSubClassPatchpointForJSDocument): Deleted.
2096         * domjit/JSDocumentFragmentDOMJIT.cpp:
2097         (WebCore::checkSubClassSnippetForJSDocumentFragment):
2098         (WebCore::checkSubClassPatchpointForJSDocumentFragment): Deleted.
2099         * domjit/JSElementDOMJIT.cpp:
2100         (WebCore::checkSubClassSnippetForJSElement):
2101         (WebCore::checkSubClassPatchpointForJSElement): Deleted.
2102         * domjit/JSEventDOMJIT.cpp:
2103         (WebCore::checkSubClassSnippetForJSEvent):
2104         (WebCore::checkSubClassPatchpointForJSEvent): Deleted.
2105         * domjit/JSNodeDOMJIT.cpp:
2106         (WebCore::checkSubClassSnippetForJSNode):
2107         (WebCore::createCallDOMGetterForOffsetAccess):
2108         (WebCore::NodeFirstChildDOMJIT::callDOMGetter):
2109         (WebCore::NodeLastChildDOMJIT::callDOMGetter):
2110         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
2111         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
2112         (WebCore::NodeParentNodeDOMJIT::callDOMGetter):
2113         (WebCore::NodeNodeTypeDOMJIT::callDOMGetter):
2114         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
2115         (WebCore::checkSubClassPatchpointForJSNode): Deleted.
2116
2117 2017-05-26  Simon Fraser  <simon.fraser@apple.com>
2118
2119         getComputedStyle returns percentage values for left / right / top / bottom
2120         https://bugs.webkit.org/show_bug.cgi?id=29084
2121
2122         Reviewed by Zalan Bujtas.
2123         
2124         Fix getComputedStyle() to return pixel values for left / right / top / bottom, per spec.
2125
2126         This is mostly a merge of https://codereview.chromium.org/13871003/.
2127
2128         Behavior now matches Chrome and Firefox.
2129
2130         Test: fast/css/getComputedStyle/getComputedStyle-offsets.html
2131
2132         * css/CSSComputedStyleDeclaration.cpp:
2133         (WebCore::getOffsetComputedLength):
2134         (WebCore::getOffsetUsedStyleRelative):
2135         (WebCore::getOffsetUsedStyleAbsolute):
2136         (WebCore::positionOffsetValue):
2137         (WebCore::positionOffsetValueIsRendererDependent):
2138         (WebCore::isNonReplacedInline):
2139         (WebCore::isLayoutDependent):
2140         (WebCore::ComputedStyleExtractor::propertyValue):
2141
2142 2017-05-27  Zalan Bujtas  <zalan@apple.com>
2143
2144         enclosingIntRect returns a rect with -1 width/height when the input FloatRect overflows integer.
2145         https://bugs.webkit.org/show_bug.cgi?id=172676
2146
2147         Reviewed by Simon Fraser.
2148
2149         Clamp integer values soon after the enclosing rectangle is resolved.
2150
2151         * platform/graphics/FloatRect.cpp:
2152         (WebCore::enclosingIntRect):
2153
2154 2017-05-26  Joseph Pecoraro  <pecoraro@apple.com>
2155
2156         Simply some NSNumber usage
2157         https://bugs.webkit.org/show_bug.cgi?id=172677
2158
2159         Reviewed by Sam Weinig.
2160
2161         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2162         (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
2163         (AXAttributeStringSetFont):
2164         (AXAttributeStringSetStyle):
2165         * accessibility/mac/AXObjectCacheMac.mm:
2166         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2167         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2168         (AXAttributeStringSetStyle):
2169         (AXAttributeStringSetSpelling):
2170         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2171         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2172         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
2173         * rendering/RenderThemeMac.mm:
2174         (WebCore::RenderThemeMac::levelIndicatorFor):
2175
2176 2017-05-26  Youenn Fablet  <youenn@apple.com>
2177
2178         WebRTC stats should be in milliseconds
2179         https://bugs.webkit.org/show_bug.cgi?id=172644
2180
2181         Reviewed by Eric Carlson.
2182
2183         Covered by updated tests.
2184
2185         * Modules/mediastream/RTCStatsReport.h:
2186         * Modules/mediastream/RTCStatsReport.idl:
2187         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2188         (WebCore::fillRTCStats):
2189
2190 2017-05-26  Sam Weinig  <sam@webkit.org>
2191
2192         [WebIDL] Overloaded functions should throw this object check exception before argument check exception
2193         https://bugs.webkit.org/show_bug.cgi?id=172480
2194
2195         Reviewed by Chris Dumez.
2196
2197         - Codifies naming for both parts of the operation/attribute function implementation:
2198           - The 'trampoline' which is the actual host function and simply calls IDLOperation,
2199             IDLOperationReturningPromise or IDLAttribute.
2200           - The 'body' which is where argument checking and calling into the implementation
2201             takes place.
2202         - Made it so all operations, including static ones, use the trampoline / body model,
2203           simplifying code generation. The one exception is for overloaded operations, which
2204           now have a trampoline and body for the dispatcher, and only bodies for all the 
2205           overloads. This is what fixes the bug, since now that the dispatcher has a trampoline,
2206           it can do the correct this object checking via IDLOperation / IDLOperationReturningPromise.
2207         - Split out code generation for trampoline and body into separate subroutines and 
2208           simplified their implementations.
2209         - Changed GenerateOverloadDispatcher to only generate the body of the function, leaving it
2210           up to the caller to generate the signature, braces and conditionals if needed.
2211         - Made more subroutines take an output array and indent, in support of future endeavors
2212           that will need that support.
2213         - Remove unnecessary #includes of <runtime/Error.h>, which gets included already by virtue
2214           of JSDOMExceptionHandling.h
2215
2216         Test: js/dom/overloaded-operation-exception-order.html
2217
2218         * bindings/js/JSDOMOperation.h:
2219         * bindings/js/JSDOMOperationReturningPromise.h:
2220         Add no-op static versions of the bouncer functions.
2221
2222         * bindings/scripts/CodeGeneratorJS.pm:
2223         (GenerateOverloadDispatcher):
2224         (GenerateOperationTrampolineDefinition):
2225         (GenerateOperationBodyDefinition):
2226         (GenerateOperationDefinition):
2227         (GenerateSerializerDefinition):
2228         (GenerateLegacyCallerDefinitions):
2229         (GenerateLegacyCallerDefinition):
2230         (GenerateArgumentsCountCheck):
2231         (GenerateParametersCheck):
2232         (GenerateImplementationFunctionCall):
2233         (GenerateImplementationCustomFunctionCall):
2234         (GenerateConstructorDefinitions):
2235         (GenerateConstructorDefinition):
2236
2237         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2238         * bindings/scripts/test/JS/JSMapLike.cpp:
2239         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2240         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2241         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2242         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2243         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2244         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2245         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2246         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2247         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2248         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2249         * bindings/scripts/test/JS/JSTestException.cpp:
2250         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2251         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2252         * bindings/scripts/test/JS/JSTestInterface.cpp:
2253         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2254         * bindings/scripts/test/JS/JSTestIterable.cpp:
2255         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2256         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2257         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2258         * bindings/scripts/test/JS/JSTestNode.cpp:
2259         * bindings/scripts/test/JS/JSTestObj.cpp:
2260         * bindings/scripts/test/JS/JSTestObj.h:
2261         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2262         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2263         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2264         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2265         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2266         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2267         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2268         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2269         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2270         Update test results.
2271
2272 2017-05-26  Brent Fulgham  <bfulgham@apple.com>
2273
2274         [WK2] Address thread safety issues with ResourceLoadStatistics
2275         https://bugs.webkit.org/show_bug.cgi?id=172519
2276         <rdar://problem/31707642>
2277
2278         Reviewed by Chris Dumez.
2279
2280         * loader/ResourceLoadObserver.cpp:
2281         (WebCore::ResourceLoadObserver::setStatisticsQueue): Added.
2282         (WebCore::ResourceLoadObserver::clearInMemoryStore): Only interact with the HashTable on the statistics queue.
2283         (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore): Ditto.
2284         (WebCore::ResourceLoadObserver::logFrameNavigation): Ditto.
2285         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
2286         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
2287         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
2288         (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
2289         (WebCore::ResourceLoadObserver::clearUserInteraction): Protect HashTable while reading.
2290         (WebCore::ResourceLoadObserver::hasHadUserInteraction): Ditto.
2291         (WebCore::ResourceLoadObserver::setPrevalentResource): Ditto.
2292         (WebCore::ResourceLoadObserver::isPrevalentResource): Ditto.
2293         (WebCore::ResourceLoadObserver::clearPrevalentResource): Ditto.
2294         (WebCore::ResourceLoadObserver::setGrandfathered): Ditto.
2295         (WebCore::ResourceLoadObserver::isGrandfathered): Ditto.
2296         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin): Only interact with the HashTable on the statistics queue.
2297         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin): Ditto.
2298         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo): Ditto.
2299         (WebCore::ResourceLoadObserver::fireDataModificationHandler): ASSERT this is only called from the main thread, since this is
2300         only meant to be used as part of the testing harness.
2301         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler): Ditto.
2302         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler): Ditto.
2303         * loader/ResourceLoadObserver.h:
2304         * loader/ResourceLoadStatisticsStore.cpp:
2305         (WebCore::ResourceLoadStatisticsStore::isPrevalentResource): Protect HashTable while using it.
2306         (WebCore::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain): Ditto.
2307         (WebCore::ResourceLoadStatisticsStore::setResourceStatisticsForPrimaryDomain): Ditto.
2308         (WebCore::ResourceLoadStatisticsStore::createEncoderFromData): ASSERT this isn't being done on the main thread, and
2309         protect HashTable while using it.
2310         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder): Ditto.
2311         (WebCore::ResourceLoadStatisticsStore::clearInMemory): Ditto.
2312         (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Ditto.
2313         (WebCore::ResourceLoadStatisticsStore::statisticsForOrigin): Protect HashTable while using it.
2314         (WebCore::ResourceLoadStatisticsStore::takeStatistics): Ditto.
2315         (WebCore::ResourceLoadStatisticsStore::mergeStatistics): Ditto.
2316         (WebCore::ResourceLoadStatisticsStore::setNotificationCallback): Use WTF::Function.
2317         (WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback): Ditto.
2318         (WebCore::ResourceLoadStatisticsStore::setWritePersistentStoreCallback): Ditto.
2319         (WebCore::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback): Ditto.
2320         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler): ASSERT this is not called on the main thread,
2321         but dispatch the registered handler on the main thread.
2322         (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): Ditto.
2323         (WebCore::ResourceLoadStatisticsStore::processStatistics): ASSERT this isn't being done on the main thread, and
2324         protect the HashTable while using it. Also switch to WTF::Function.
2325         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): Make const correct.
2326         (WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Protect HashTable while using it.
2327         (WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords): Ditto.
2328         (WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore): Ditto.
2329         (WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords): Make const correct. ASSERT this is not being called
2330         on the main thread.
2331         (WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): ASSERT this is not being called on the main thread.
2332         (WebCore::ResourceLoadStatisticsStore::dataRecordsWereRemoved): Ditto.
2333         (WebCore::ResourceLoadStatisticsStore::statisticsLock): Added.
2334         * loader/ResourceLoadStatisticsStore.h:
2335
2336 2017-05-26  Joseph Pecoraro  <pecoraro@apple.com>
2337
2338         JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
2339         https://bugs.webkit.org/show_bug.cgi?id=172664
2340         <rdar://problem/32362933>
2341
2342         Reviewed by Matt Baker.
2343
2344         * inspector/InspectorController.h:
2345         * page/PageDebuggable.cpp:
2346         (WebCore::PageDebuggable::connect):
2347         * page/PageDebuggable.h:
2348         Pass an immediatelyPause boolean on to the controller.
2349
2350         * inspector/InspectorController.cpp:
2351         (WebCore::InspectorController::connectFrontend):
2352         (WebCore::InspectorController::disconnectFrontend):
2353         (WebCore::InspectorController::disconnectAllFrontends):
2354         Manage should immediately pause state.
2355
2356         (WebCore::InspectorController::frontendInitialized):
2357         When initialized, trigger a pause if requested.
2358
2359 2017-05-26  Don Olmstead  <don.olmstead@am.sony.com>
2360
2361         [CMake] Consolidate CMake code related to FreeType
2362         https://bugs.webkit.org/show_bug.cgi?id=172656
2363
2364         Reviewed by Michael Catanzaro.
2365
2366         No new tests. No change in behavior.
2367
2368         * PlatformGTK.cmake:
2369         * PlatformWPE.cmake:
2370         * platform/FreeType.cmake: Added.
2371
2372 2017-05-26  Sam Weinig  <sam@webkit.org>
2373
2374         [WebIDL] Another bindings cleanup pass, this time focusing on attributes
2375         https://bugs.webkit.org/show_bug.cgi?id=172619
2376
2377         Reviewed by Chris Dumez.
2378
2379         - Moved attribute getter / setter generation into their own subroutines.
2380         - As was done for operations, moved trampoline functions for attributes
2381           below their implementation functions to avoid unseemly forward declaration.
2382         - Changed to place the getter and setter for an attribute next to each other,
2383           rather than having all the getters and then all the setters.
2384         - Moved JSFoo::getConstructor and JSFoo::getNamedConstructor up to be with other
2385           member functions.
2386         - Fix an issue where we were generating a setJSFooConstructor function and not
2387           installing it anywhere. Now we always generate either both the getter and setter
2388           or neither for the constructor property. Also moved their definition to just above
2389           all the attributes, rather than the odd placements of between the getters and
2390           setters which is where they had been.
2391         - Made InstanceNeedsVisitChildren a complete answer, rather than relying on some
2392           loop of the attributes to update needsVisitChildren bit.
2393         - Move use of passing conditionals when adding headers.
2394
2395         * bindings/scripts/CodeGeneratorJS.pm:
2396         (InstanceNeedsVisitChildren):
2397         (GenerateHeader):
2398         (GenerateImplementation):
2399         (GenerateAttributeGetterDefinition):
2400         (GenerateAttributeSetterDefinition):
2401         (NeedsConstructorProperty):
2402
2403         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2404         * bindings/scripts/test/JS/JSMapLike.cpp:
2405         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2406         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2407         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2408         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2409         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2410         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2411         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2412         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2413         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2414         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2415         * bindings/scripts/test/JS/JSTestException.cpp:
2416         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2417         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2418         * bindings/scripts/test/JS/JSTestInterface.cpp:
2419         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2420         * bindings/scripts/test/JS/JSTestIterable.cpp:
2421         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2422         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2423         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2424         * bindings/scripts/test/JS/JSTestNode.cpp:
2425         * bindings/scripts/test/JS/JSTestObj.cpp:
2426         * bindings/scripts/test/JS/JSTestObj.h:
2427         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2428         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2429         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2430         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2431         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2432         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2433         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2434         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2435         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2436         Update test results.
2437
2438 2017-05-26  Don Olmstead  <don.olmstead@am.sony.com>
2439
2440         [CMake] Wrap CODE_GENERATOR_PREPROCESSOR_EXECUTABLE on Windows hosts
2441         https://bugs.webkit.org/show_bug.cgi?id=172553
2442
2443         Reviewed by Brent Fulgham.
2444
2445         No new tests. No change in behavior.
2446
2447         * bindings/scripts/preprocessor.pm:
2448         (applyPreprocessor): Use shellwords() instead of splitting
2449         preprocessor command by space. Combine it back in open3() call on
2450         Windows to work around Cygwin-specific issue.
2451
2452 2017-05-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2453
2454         Unreviewed, fix the build using the latest SDK
2455
2456         Add deprecation guards around newly introduced (and deprecated) SPI.
2457
2458         * platform/ios/WebItemProviderPasteboard.mm:
2459         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
2460
2461 2017-05-26  Beth Dakin  <bdakin@apple.com>
2462
2463         Media documents inside iframes should not get controls in the TouchBar unless the 
2464         video is playing
2465         https://bugs.webkit.org/show_bug.cgi?id=172620
2466         -and corresponding-
2467         rdar://problem/32165477
2468
2469         Reviewed by Jon Lee.
2470
2471         Media documents get to return early with true, but that should only apply to 
2472         mainframe media documents. 
2473         * html/MediaElementSession.cpp:
2474         (WebCore::MediaElementSession::canShowControlsManager):
2475
2476 2017-05-26  Youenn Fablet  <youenn@apple.com>
2477
2478         Minor clean-up related to DocumentThreadableLoader redirections
2479         https://bugs.webkit.org/show_bug.cgi?id=172647
2480
2481         Reviewed by Chris Dumez.
2482
2483         No change of behavior.
2484
2485         Decrementing m_options redirect count directly instead of using an
2486         additional counter.
2487
2488         To compare whether two URLs are same-origin, use scheme+host+port check
2489         as per the spec.
2490         This is fine as only the initial origin may have specific rules and we
2491         are using the scheme+host+port checks when already being gone to
2492         another origin.
2493
2494         * loader/DocumentThreadableLoader.cpp:
2495         (WebCore::DocumentThreadableLoader::redirectReceived):
2496         * loader/DocumentThreadableLoader.h:
2497         * loader/SubresourceLoader.cpp:
2498         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
2499
2500 2017-05-26  Youenn Fablet  <youenn@apple.com>
2501
2502         Fix memory leaks in MediaSampleAVFObjC::create
2503         https://bugs.webkit.org/show_bug.cgi?id=172600
2504
2505         Reviewed by Eric Carlson.
2506
2507         No change of behavior.
2508
2509         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2510         (WebCore::MediaSampleAVFObjC::createImageSample):
2511
2512 2017-05-26  Manuel Rego Casasnovas  <rego@igalia.com>
2513
2514         [css-grid] Add support for orthogonal positioned grid items
2515         https://bugs.webkit.org/show_bug.cgi?id=172591
2516
2517         Reviewed by Sergio Villar Senin.
2518
2519         This patch adds support for positioned grid items with orthogonal flows.
2520         Basically it just needs to check if the item is orthogonal to use
2521         the column or row offset as logical left or top depending on the case.
2522
2523         Tests: imported/w3c/web-platform-tests/css/css-grid-1/abspos/orthogonal-positioned-grid-items-***.html
2524
2525         * rendering/RenderGrid.cpp:
2526         (WebCore::RenderGrid::layoutPositionedObject):
2527
2528 2017-05-25  Emilio Cobos Álvarez  <ecobos@igalia.com>
2529
2530         Don't reset m_hasDisplayContents on ElementRareData::resetComputedStyle.
2531         https://bugs.webkit.org/show_bug.cgi?id=172503
2532
2533         Reviewed by Antti Koivisto.
2534
2535         We use that bit of information to determine whether we need to tear
2536         down the renderers of a display: contents subtree, so better for it to
2537         not change until the render tree is updated.
2538
2539         In practice, we may want to remove that bit and use ElementRareData's
2540         RenderStyle instead (keeping it around as appropriate), to ensure they
2541         don't go out of sync, but that's out of scope of this patch for now.
2542
2543         Tests: imported/w3c/web-platform-tests/css/css-display-3
2544
2545         * dom/ElementRareData.h:
2546         (WebCore::ElementRareData::resetComputedStyle):
2547
2548 2017-05-25  Sam Weinig  <sam@webkit.org>
2549
2550         Fix MediaDeviceInfo's extended attributes so they make sense
2551         https://bugs.webkit.org/show_bug.cgi?id=172629
2552
2553         Reviewed by Daniel Bates.
2554
2555         MediaDeviceInfo.idl had both a Constructor and NoInterfaceObject, which
2556         doesn't really make sense. Either way, the spec says it should have 
2557         neither, so remove both. And, while were there, add missing serializer.
2558
2559         Test: fast/mediastream/media-device-info.html
2560
2561         * Modules/mediastream/MediaDeviceInfo.idl:
2562
2563 2017-05-25  Chris Dumez  <cdumez@apple.com>
2564
2565         imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html is crashing
2566         https://bugs.webkit.org/show_bug.cgi?id=172628
2567         <rdar://problem/32418707>
2568
2569         Reviewed by Sam Weinig.
2570
2571         In the event where a form is removed synchronously by a script during parsing,
2572         FormAssociatedElement::m_formSetByParser may end up referring to a form that
2573         is no longer in the document. As a result, we should make sure m_formSetByParser
2574         is still connected in FormAssociatedElement::insertedInto() before we call
2575         FormAssociatedElement::setForm(m_formSetByParser).
2576
2577         Test: fast/dom/HTMLFormElement/form-removed-during-parsing-crash.html
2578
2579         * html/FormAssociatedElement.cpp:
2580         (WebCore::FormAssociatedElement::insertedInto):
2581
2582 2017-05-25  Zalan Bujtas  <zalan@apple.com>
2583
2584         Frame's composited content is visible when the frame has visibility: hidden.
2585         https://bugs.webkit.org/show_bug.cgi?id=125565
2586         <rdar://problem/32196849>
2587
2588         Reviewed by Simon Fraser.
2589
2590         Do not construct composited layers for hidden RenderWidgets (frameset, iframe, object).
2591         Note that we still construct layers for the associated renderers as usual. 
2592
2593         Tests: compositing/visibility/frameset-visibility-hidden.html
2594                compositing/visibility/iframe-visibility-hidden.html
2595                compositing/visibility/object-visibility-hidden.html
2596
2597         * rendering/RenderLayerCompositor.cpp:
2598         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin):
2599         (WebCore::RenderLayerCompositor::requiresCompositingForFrame):
2600
2601 2017-05-25  Yusuke Suzuki  <utatane.tea@gmail.com>
2602
2603         Unreviewed, build fix in GTK and WPE ports
2604         https://bugs.webkit.org/show_bug.cgi?id=172580
2605
2606         Missing RenderSVGResourceMode declaration in SVGInlineTextBox.h.
2607
2608         * rendering/svg/SVGInlineTextBox.h:
2609
2610 2017-05-25  Simon Fraser  <simon.fraser@apple.com>
2611
2612         Use a typedef for SVG resource mode flags union
2613         https://bugs.webkit.org/show_bug.cgi?id=172580
2614
2615         Reviewed by Sam Weinig.
2616
2617         Use an OptionSet<> for RenderSVGResourceModes flags, and use it in render
2618         SVG resource classes.
2619
2620         * rendering/svg/RenderSVGResource.cpp:
2621         (WebCore::requestPaintingResource):
2622         (WebCore::RenderSVGResource::fillPaintingResource):
2623         (WebCore::RenderSVGResource::strokePaintingResource):
2624         * rendering/svg/RenderSVGResource.h:
2625         (WebCore::RenderSVGResource::postApplyResource):
2626         * rendering/svg/RenderSVGResourceClipper.cpp:
2627         (WebCore::RenderSVGResourceClipper::applyResource):
2628         * rendering/svg/RenderSVGResourceClipper.h:
2629         * rendering/svg/RenderSVGResourceFilter.cpp:
2630         (WebCore::RenderSVGResourceFilter::applyResource):
2631         (WebCore::RenderSVGResourceFilter::postApplyResource):
2632         * rendering/svg/RenderSVGResourceFilter.h:
2633         * rendering/svg/RenderSVGResourceGradient.cpp:
2634         (WebCore::RenderSVGResourceGradient::applyResource):
2635         * rendering/svg/RenderSVGResourceGradient.h:
2636         * rendering/svg/RenderSVGResourceMarker.h:
2637         * rendering/svg/RenderSVGResourceMasker.cpp:
2638         (WebCore::RenderSVGResourceMasker::applyResource):
2639         * rendering/svg/RenderSVGResourceMasker.h:
2640         * rendering/svg/RenderSVGResourcePattern.cpp:
2641         (WebCore::RenderSVGResourcePattern::buildPattern):
2642         (WebCore::RenderSVGResourcePattern::applyResource):
2643         (WebCore::RenderSVGResourcePattern::postApplyResource):
2644         * rendering/svg/RenderSVGResourcePattern.h:
2645         * rendering/svg/RenderSVGResourceSolidColor.cpp:
2646         (WebCore::RenderSVGResourceSolidColor::applyResource):
2647         (WebCore::RenderSVGResourceSolidColor::postApplyResource):
2648         * rendering/svg/RenderSVGResourceSolidColor.h:
2649         * rendering/svg/RenderSVGShape.cpp:
2650         (WebCore::RenderSVGShape::fillShape):
2651         (WebCore::RenderSVGShape::strokeShape):
2652         * rendering/svg/SVGInlineTextBox.cpp:
2653         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
2654         (WebCore::SVGInlineTextBox::paintSelectionBackground):
2655         (WebCore::SVGInlineTextBox::paint):
2656         (WebCore::SVGInlineTextBox::acquirePaintingResource):
2657         (WebCore::SVGInlineTextBox::releasePaintingResource):
2658         (WebCore::SVGInlineTextBox::paintDecoration):
2659         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
2660         * rendering/svg/SVGInlineTextBox.h:
2661         * rendering/svg/SVGRenderingContext.cpp:
2662         (WebCore::SVGRenderingContext::~SVGRenderingContext):
2663         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2664         (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Avoid needless IntPoint -> LayoutPoint
2665         conversion.
2666
2667 2017-05-25  Chris Dumez  <cdumez@apple.com>
2668
2669         Regression(r215686): Videos sometimes do not load in iBooks
2670         https://bugs.webkit.org/show_bug.cgi?id=172604
2671         <rdar://problem/32003717>
2672
2673         Reviewed by Geoffrey Garen.
2674
2675         Before r215686, the loop would have a check at the beginning to check if the
2676         dataRequest's currentOffset was greater than the buffer length and would
2677         cause the function to return early.
2678
2679         This check was dropped in r215686, which caused us in some cases to call
2680         finishLoading / stopLoading() after the loop, even though we did not have
2681         enough data in the buffer to satisfy the data request.
2682
2683         To address the issue, we now return early after the loop if remainingLength
2684         is greater than 0, meaning that we could not satisfy the request. This makes
2685         sure we do not call finishLoading / stopLoading() prematurely.
2686
2687         Note that before r215686, the condition of the while loop was 
2688         "while (remainingLength)" so the only way to get out of the loop was to:
2689         1. Get remainingLength to 0, in which case we would fall through and
2690            potentially call finishLoading / stopLoading() after the loop.
2691         2. Fail the "(data->size() <= [dataRequest currentOffset] - responseOffset)"
2692            check at the beginning of the loop, meaning that we ran out of data in
2693            the buffer. This would cause us to return from the function, not fall
2694            through, so we would not call finishLoading / stopLoading().
2695
2696         No new tests, I do not know how to write a test for this.
2697
2698         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2699         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
2700
2701 2017-05-25  Sam Weinig  <sam@webkit.org>
2702
2703         [WebIDL] Use the term 'operation' more consistently
2704         https://bugs.webkit.org/show_bug.cgi?id=172601
2705
2706         Reviewed by Chris Dumez.
2707
2708         We were using the term 'operation', a WebIDL term for function-like
2709         constructs, inconsistently in the code generator. Now, when we use
2710         'operation' when referring to the IDL concept (usually the object the
2711         parser produces) and 'function' when referring to code being generated.
2712
2713         * bindings/scripts/CodeGenerator.pm:
2714         * bindings/scripts/IDLParser.pm:
2715         * bindings/scripts/generate-bindings.pl:
2716
2717 2017-05-25  Jer Noble  <jer.noble@apple.com>
2718
2719         System sleeps while playing to wireless target, ending stream.
2720         https://bugs.webkit.org/show_bug.cgi?id=172541
2721
2722         Reviewed by Eric Carlson.
2723
2724         API test: Tests/mac/MediaPlaybackSleepAssertion.mm
2725
2726         Keep the system from sleeping (but allow the display to sleep) while playing media to a wireless target.
2727
2728         Give the SleepDisabler a Type, either System or Display, which indicates what kind of sleep to disable.
2729         Update HTMLMediaElement::shouldDisableSleep() to differentiate between a video which is playing locally,
2730         one that is playing but not visible, and one that is playing remotely.
2731
2732         * html/HTMLMediaElement.cpp:
2733         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
2734         (WebCore::HTMLMediaElement::updateSleepDisabling):
2735         (WebCore::HTMLMediaElement::shouldDisableSleep):
2736         * html/HTMLMediaElement.h:
2737         * platform/SleepDisabler.cpp:
2738         (WebCore::SleepDisabler::create):
2739         (WebCore::SleepDisabler::SleepDisabler):
2740         * platform/SleepDisabler.h:
2741         (WebCore::SleepDisabler::type):
2742         * platform/cocoa/SleepDisablerCocoa.cpp:
2743         (WebCore::SleepDisabler::create):
2744         (WebCore::SleepDisablerCocoa::SleepDisablerCocoa):
2745         (WebCore::SleepDisablerCocoa::~SleepDisablerCocoa):
2746         * platform/cocoa/SleepDisablerCocoa.h:
2747         * platform/mac/WebVideoFullscreenController.mm:
2748         (-[WebVideoFullscreenController updatePowerAssertions]):
2749         * platform/spi/cocoa/IOPMLibSPI.h:
2750
2751 2017-05-25  Chris Dumez  <cdumez@apple.com>
2752
2753         DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader
2754         https://bugs.webkit.org/show_bug.cgi?id=172578
2755         <rdar://problem/30754582>
2756
2757         Reviewed by Youenn Fablet.
2758
2759         DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader. The rest of the methods do not.
2760         It is unsafe for it to rely on the resource's loader because it gets cleared when the load completes. A CachedRawresource
2761         may be reused from the memory cache once its load has completed.
2762
2763         This would cause crashes in CachedRawResource::didAddClient() when replaying the redirects because it would call
2764         DocumentThreadableLoader::redirectReceived() and potentially not have a loader anymore. To hit this exact code path,
2765         you would need to make repeated XHR to a cacheable simple cross-origin resource that has cacheable redirect.
2766
2767         Test: http/tests/xmlhttprequest/cacheable-cross-origin-redirect-crash.html
2768
2769         * loader/DocumentThreadableLoader.cpp:
2770         (WebCore::DocumentThreadableLoader::redirectReceived):
2771         * loader/DocumentThreadableLoader.h:
2772
2773 2017-05-25  Zalan Bujtas  <zalan@apple.com>
2774
2775         ASSERTION FAILED: !needsStyleRecalc() || !document().childNeedsStyleRecalc()
2776         https://bugs.webkit.org/show_bug.cgi?id=172576
2777         <rdar://problem/32181979>
2778
2779         Reviewed by Brent Fulgham.
2780
2781         Ensure that we clean the subframe's document before start searching for a focusable element.
2782
2783         Covered by existing test.
2784
2785         * page/FocusController.cpp:
2786         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
2787
2788 2017-05-24  Jiewen Tan  <jiewen_tan@apple.com>
2789
2790         Crash on WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance + 1195
2791         https://bugs.webkit.org/show_bug.cgi?id=172555
2792         <rdar://problem/32004724>
2793
2794         Reviewed by Ryosuke Niwa.
2795
2796         setSelectionWithoutUpdatingAppearance could dispatch a synchronous focusin event,
2797         which could invoke an event handler that deteles the frame. Therefore, add a
2798         protector before the call.
2799
2800         Test: editing/selection/select-iframe-focusin-document-crash.html
2801
2802         * editing/FrameSelection.cpp:
2803         (WebCore::FrameSelection::setSelection):
2804
2805 2017-05-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
2806
2807         Ensure ImageFrameCache does not access its BitmapImage after it is deleted
2808         https://bugs.webkit.org/show_bug.cgi?id=172563
2809
2810         Reviewed by Simon Fraser.
2811
2812         A crash may happen if the BitmapImage is deleted while the decoding thread
2813         is still active. Once the current frame finishes decoding, the decoding
2814         thread will make a callOnMainThread() which will access the deleted BitmapImage.
2815
2816         We need to ensure if BitmapImage is deleted, the raw pointer which references
2817         it in ImageFrameCache is cleared. If this is done, nothing else is needed.
2818         All all the accesses to container BitmapImage in ImageFrameCache are guarded
2819         by checking m_image is not null.
2820
2821         * platform/graphics/BitmapImage.cpp:
2822         (WebCore::BitmapImage::~BitmapImage): Make sure the decoding thread will
2823         not have access to the deleted BitmapImage when it finishes decoding and
2824         make its callOnMainThread().
2825         (WebCore::BitmapImage::destroyDecodedData): Use the function new name.
2826         (WebCore::BitmapImage::internalStartAnimation): Ditto.
2827         * platform/graphics/ImageFrameCache.cpp:
2828         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Protect the sourceURL
2829         for the decoding thread. ImageFrameCache::sourceURL() checks for the value
2830         of m_image which now may change from the main thread.
2831         * platform/graphics/ImageFrameCache.h:
2832         (WebCore::ImageFrameCache::clearImage): Add a new function to clear the 
2833         raw pointer m_image when its is deleted.
2834         * platform/graphics/ImageSource.cpp:
2835         (WebCore::ImageSource::resetData): Rename clear() to resetData() for better
2836         code readability. This function deletes the ImageDecoder and creates a new
2837         one if data is not null. The purpose is to delete the decoder raster data.
2838         (WebCore::ImageSource::clear): Deleted.
2839         * platform/graphics/ImageSource.h:
2840         (WebCore::ImageSource::clearImage): Wrapper for the ImageFrameCache function.
2841
2842 2017-05-25  youenn fablet  <youenn@apple.com>
2843
2844         Add some release logging for media elements
2845         https://bugs.webkit.org/show_bug.cgi?id=172581
2846
2847         Reviewed by Eric Carlson.
2848
2849         No change of behavior.
2850
2851          Adding logging for getUserMedia, video autoplay and incoming/outgoing webrtc video tracks.
2852
2853         * Modules/mediastream/UserMediaRequest.cpp:
2854         (WebCore::UserMediaRequest::allow):
2855         (WebCore::UserMediaRequest::deny):
2856         * html/HTMLMediaElement.cpp:
2857         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
2858         * html/MediaElementSession.cpp:
2859         (WebCore::MediaElementSession::playbackPermitted):
2860         * platform/Logging.h:
2861         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
2862         (WebCore::RealtimeIncomingVideoSource::OnFrame):
2863         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
2864         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2865         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
2866         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
2867         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2868
2869 2017-05-25  Sam Weinig  <sam@webkit.org>
2870
2871         [WebIDL] Do a pass of cleanup in the bindings generator
2872         https://bugs.webkit.org/show_bug.cgi?id=172566
2873
2874         Reviewed by Chris Dumez.
2875
2876         - Split JSDOMBindingCaller.h into four new files to allow for less 
2877           header inclusion (one includes a bunch of promise stuff that usually
2878           isn't needed): 
2879             - JSDOMCastedThisErrorBehavior (with shared casting enum)
2880             - JSDOMAttribute (for attribute getting / setting)
2881             - JSDOMOperation (for normal operations)
2882             - JSDOMOperationReturningPromise (for operations returning promises, obviously).
2883
2884           In addition to separating the files, rename to be more consistent with modern
2885           bindings conventions (new classes are IDLAttribute, IDLOperation, and 
2886           IDLOperationReturningPromise) and simplify function names
2887             - 'callOperation' becomes 'call'
2888             - 'attribute' becomes 'get'
2889             - 'setAttribute' becomes 'set'
2890
2891         - Remove extra generated trampoline function for operations returning promises
2892           by making JSDOMOperationReturningPromise handle all the promise related overhead.
2893
2894         - Make [Custom] operations returning promises go through the normal IDLOperationReturningPromise
2895           code path (simplifying JSReadableStreamSource and JSSubtleCrypto). Added [ReturnsOwnPromise]
2896           extended attribute to allow some functions that want to retain specialized behavior to do so
2897
2898         - Swap order of trampoline and implementation of operation, to avoid the need for
2899           a forward declaration and make reading more straightforward.
2900
2901         * WebCore.xcodeproj/project.pbxproj:
2902         Add / remove files.
2903
2904         * bindings/js/JSDOMBindingCaller.h: Removed.
2905
2906         * bindings/js/JSDOMCastedThisErrorBehavior.h: Added.
2907         Shared header for enum needed by JSDOMAttribute, JSDOMOperation and JSDOMOperationReturningPromise.
2908
2909         * bindings/js/JSDOMAttribute.h: Added.
2910         * bindings/js/JSDOMOperation.h: Added.
2911         * bindings/js/JSDOMOperationReturningPromise.h: Added.
2912         Split out JSDOMBindingCaller implementations into own classes / files. Simplify
2913         naming.
2914     
2915         * bindings/js/JSDOMPromiseDeferred.h:
2916         (WebCore::callPromiseFunction):
2917         Add a variant of callPromiseFunction that takes a lambda.
2918
2919         * bindings/js/JSEventTargetCustom.h:
2920         (WebCore::IDLOperation<JSEventTarget>::call):
2921         Update operation specialization to use new class.
2922
2923         * bindings/js/JSReadableStreamSourceCustom.cpp:
2924         * bindings/js/JSSubtleCryptoCustom.cpp:
2925         Simplify now that the callPromiseFunction is called for us.
2926
2927         * crypto/WebKitSubtleCrypto.idl:
2928         * css/FontFace.idl:
2929         * dom/CustomElementRegistry.idl:
2930         Add [ReturnsOwnPromise] to retain custom promise behavior.
2931
2932         * bindings/scripts/CodeGeneratorJS.pm:
2933         (GenerateHeader):
2934         Update header generation to account for custom functions that return promises now
2935         having a Ref<DeferredPromise>&& parameter.
2936
2937         (GenerateImplementation):
2938         - Update for new naming of cast functions.
2939         - Use AddToImplIncludes (and pass in conditional) rather than using $implIncludes
2940           directly, #includes to be grouped correctly.
2941         - Remove dead $inAppleCopyright code (it was moved to GenerateOperationDefinition 
2942           earlier).
2943
2944         (GenerateOperationDefinition):
2945         - Use $codeGenerator->IsPromiseType() rather than directly comparing to "Promise" string.
2946         - Restructure code to allow trampoline (the code that calls IDLOperation) to come after
2947           the main operation implementation (the part that calls into the impl).
2948         - Support custom functions returning promises (and the [ReturnsOwnPromise] variant).
2949
2950         (GenerateImplementationIterableFunctions):
2951         Update for name change to IDLOperation.
2952
2953         * bindings/scripts/IDLAttributes.json:
2954         Add [ReturnsOwnPromise].
2955
2956         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2957         * bindings/scripts/test/JS/JSMapLike.cpp:
2958         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2959         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2960         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2961         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2962         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2963         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2964         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2965         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2966         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2967         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2968         * bindings/scripts/test/JS/JSTestException.cpp:
2969         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2970         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2971         * bindings/scripts/test/JS/JSTestInterface.cpp:
2972         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2973         * bindings/scripts/test/JS/JSTestIterable.cpp:
2974         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2975         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2976         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2977         * bindings/scripts/test/JS/JSTestNode.cpp:
2978         * bindings/scripts/test/JS/JSTestObj.cpp:
2979         * bindings/scripts/test/JS/JSTestObj.h:
2980         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2981         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2982         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2983         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2984         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2985         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2986         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2987         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2988         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2989         Update test results.
2990
2991         * bindings/scripts/test/TestObj.idl:
2992         Add additional test cases for operations returning promises.
2993
2994 2017-05-25  Simon Fraser  <simon.fraser@apple.com>
2995
2996         Some <chrono> and ProgressTracker cleanup
2997         https://bugs.webkit.org/show_bug.cgi?id=172582
2998
2999         Reviewed by Sam Weinig.
3000
3001         Remove some unnecessary <chrono> includes.
3002         Convert some std::chrono to use MonotonicTime/Seconds.
3003         Clean up ProgressTracker.
3004         Some #pragma once.
3005
3006         * dom/Document.h:
3007         * loader/ProgressTracker.cpp:
3008         (WebCore::ProgressTracker::ProgressTracker):
3009         (WebCore::ProgressTracker::reset):
3010         (WebCore::ProgressTracker::progressStarted):
3011         (WebCore::ProgressTracker::finalProgressComplete):
3012         (WebCore::ProgressTracker::incrementProgress):
3013         * loader/ProgressTracker.h:
3014         * page/Settings.h:
3015         * platform/SearchPopupMenu.h:
3016         * platform/Timer.h:
3017         * platform/graphics/cg/IOSurfacePool.cpp:
3018         (WebCore::IOSurfacePool::markOlderSurfacesPurgeable):
3019         * platform/graphics/cg/IOSurfacePool.h:
3020         (WebCore::IOSurfacePool::CachedSurfaceDetails::resetLastUseTime):
3021         * platform/network/PlatformCookieJar.h:
3022
3023 2017-05-25  Joanmarie Diggs  <jdiggs@igalia.com>
3024
3025         [ATK] Expose doc-footnote ARIA role with ATK_ROLE_FOOTNOTE
3026         https://bugs.webkit.org/show_bug.cgi?id=172355
3027
3028         Reviewed by Chris Fleizach.
3029
3030         Add a new FootnoteRole accessibility role to WebCore and map it to
3031         ATK_ROLE_FOOTNOTE for WebKitGtk and NSAccessibilityGroupRole with
3032         a subrole of AXApplicationGroup for the Mac port.
3033
3034         No new tests because we already have coverage for this role.
3035         The existing test expectations were updated to reflect the
3036         new mapping of doc-footnote to ATK_ROLE_FOOTNOTE.
3037
3038         * accessibility/AccessibilityObject.cpp:
3039         (WebCore::initializeRoleMap):
3040         (WebCore::AccessibilityObject::computedRoleString):
3041         * accessibility/AccessibilityObject.h:
3042         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3043         (atkRole):
3044         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3045         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3046         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3047         (createAccessibilityRoleMap):
3048         (-[WebAccessibilityObjectWrapper subrole]):
3049
3050 2017-05-25  youenn fablet  <youenn@apple.com>
3051
3052         [macOS WK2 Debug] Layout Test webrtc/video.html is crashing.
3053         https://bugs.webkit.org/show_bug.cgi?id=172560
3054         <rdar://problem/32392611>
3055
3056         Reviewed by Eric Carlson.
3057
3058         webrtc/multiple-video.html is no longer crashing.
3059
3060         Allow autoplay only from going to not capture to capture, and not the reverse.
3061         Renamed HTMLMediaElement::mediaStreamCaptureStateChanged to mediaStreamCaptureStarted.
3062
3063         * dom/Document.cpp:
3064         (WebCore::Document::mediaStreamCaptureStateChanged):
3065         * html/HTMLMediaElement.cpp:
3066         (WebCore::HTMLMediaElement::mediaStreamCaptureStateChanged): Deleted.
3067         * html/HTMLMediaElement.h:
3068         (WebCore::HTMLMediaElement::mediaStreamCaptureStarted):
3069
3070 2017-05-25  Dave Hyatt  <hyatt@apple.com>
3071
3072         Baseline of number inputs not right.
3073         https://bugs.webkit.org/show_bug.cgi?id=172237
3074
3075         Reviewed by Dean Jackson.
3076
3077         Added fast/forms/baseline-of-number-inputs.html
3078
3079         * css/html.css:
3080         (input::-webkit-inner-spin-button):
3081         * rendering/RenderSearchField.cpp:
3082         (WebCore::RenderSearchField::computeLogicalHeightLimit): Deleted.
3083         (WebCore::RenderSearchField::centerContainerIfNeeded): Deleted.
3084         * rendering/RenderSearchField.h:
3085         * rendering/RenderTextControlSingleLine.cpp:
3086         (WebCore::RenderTextControlSingleLine::centerRenderer):
3087         (WebCore::RenderTextControlSingleLine::layout):
3088         (WebCore::RenderTextControlSingleLine::computeLogicalHeightLimit): Deleted.
3089         * rendering/RenderTextControlSingleLine.h:
3090         (WebCore::RenderTextControlSingleLine::centerContainerIfNeeded): Deleted.
3091
3092 2017-05-25  Manuel Rego Casasnovas  <rego@igalia.com>
3093
3094         [css-grid] Fix behavior of positioned items without specific dimensions
3095         https://bugs.webkit.org/show_bug.cgi?id=172117
3096
3097         Reviewed by Sergio Villar Senin.
3098
3099         Currently positioned items that doesn't have specific dimensions
3100         are not properly sized. This patch fixes the issues with them.
3101
3102         The patch removes the extraInline|BlockOffsets from RenderBox,
3103         so now RenderGrid is responsible of setting the location of the positioned item.
3104         This will be useful to add alignment support for positioned items later.
3105         It also removes grid specific logic from RenderBox.
3106
3107         RenderBox::computeInlineStaticDistance() was modified too.
3108         The problem here was that the containing block of the positioned gird items
3109         is the grid area (and not the grid container). The method didn't know
3110         anything about grid, so it was using the grid container causing wrong values
3111         when resolving "auto" in both left and right offset properties.
3112
3113         Note that after this patch we match Chrome and Firefox behavior on these cases.
3114
3115         Test: fast/css-grid-layout/positioned-grid-items-sizing.html
3116
3117         * rendering/RenderBox.cpp:
3118         (WebCore::RenderBox::willBeDestroyed):
3119         (WebCore::computeInlineStaticDistance):
3120         (WebCore::RenderBox::computePositionedLogicalWidth):
3121         (WebCore::RenderBox::computePositionedLogicalHeight):
3122         * rendering/RenderBox.h:
3123         * rendering/RenderGrid.cpp:
3124         (WebCore::RenderGrid::layoutPositionedObject):
3125         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3126
3127 2017-05-25  Claudio Saavedra  <csaavedra@igalia.com>
3128
3129         [WPE] Build fix after r217404
3130
3131         Unreviewed
3132
3133         * PlatformWPE.cmake: Include missing cairo cmake file.
3134
3135 2017-05-24  Chris Dumez  <cdumez@apple.com>
3136
3137         ResourceResponses for data URLs have their Source marked as Unknown
3138         https://bugs.webkit.org/show_bug.cgi?id=172573
3139         <rdar://problem/31786198>
3140
3141         Reviewed by Geoffrey Garen.
3142
3143         ResourceResponses for data URLs have their Source marked as Unknown.
3144
3145         Now set their source to Network to maintain previous behavior when
3146         we used to decode those data URLs on Network process side.
3147
3148         Test: fast/url/data-url-source.html
3149
3150         * loader/ResourceLoader.cpp:
3151         (WebCore::ResourceLoader::loadDataURL):
3152
3153 2017-05-24  Fujii Hironori  <Hironori.Fujii@sony.com>
3154
3155         [Win] An assertion fails if the custom cursor image isn't loaded yet
3156         https://bugs.webkit.org/show_bug.cgi?id=172209
3157
3158         Reviewed by Said Abou-Hallawa.
3159
3160         Test: fast/css/crash-on-custom-cursor-when-loading.html
3161
3162         A custom cursor image can be zero dimension if it is loading or
3163         decoding. Cursor::ensurePlatformCursor of Windows port should
3164         handle such case properly.
3165
3166         * platform/win/CursorWin.cpp:
3167         (WebCore::Cursor::ensurePlatformCursor): Load a stock cursor if
3168         the custom cursor image has zero dimension. Do not do null-check
3169         of the return value of createSharedCursor() because it never
3170         returns null.
3171
3172 2017-05-24  Don Olmstead  <don.olmstead@am.sony.com>
3173
3174         [CMake] Consolidate CMake code related to Cairo
3175         https://bugs.webkit.org/show_bug.cgi?id=172568
3176
3177         Reviewed by Alex Christensen.
3178
3179         No new tests. No change in behavior.
3180
3181         * PlatformGTK.cmake:
3182         * PlatformWPE.cmake:
3183         * PlatformWinCairo.cmake:
3184         * config.h:
3185         * platform/Cairo.cmake: Added.
3186         * platform/GStreamer.cmake:
3187         * platform/ImageDecoders.cmake:
3188
3189 2017-05-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
3190
3191         REGRESSION (r206481): Don't assume frameCount() is larger than or equal to the size of the image frame cache
3192         https://bugs.webkit.org/show_bug.cgi?id=172552
3193
3194         Reviewed by Geoffrey Garen.
3195
3196         If an image with many cached ImageFrames is cached but its encoded data is
3197         freed, then the same image is reused, the encoded data will be fetched.
3198         But the initial frameCount() might be less than the current size of the
3199         ImageFrames cache.
3200
3201         This was causing an assertion in the debug build and crash in the release
3202         build. Vector::grow() does not handle the case where the new size is smaller
3203         than the current size safely.
3204
3205         * platform/graphics/ImageFrameCache.cpp:
3206         (WebCore::ImageFrameCache::growFrames):
3207
3208 2017-05-24  Sergey Shekyan  <shekyan@gmail.com>
3209
3210         navigator.webdriver should return false if the page is not controlled by automation
3211         https://bugs.webkit.org/show_bug.cgi?id=171997
3212
3213         Reviewed by Chris Dumez.
3214
3215         Per WebDriver Specification at https://www.w3.org/TR/webdriver/#interface
3216
3217         Test: js/dom/navigator-webdriver.html
3218         Rebaseled fast/dom/navigator-detached-no-crash.html
3219
3220         * Modules/webdriver/NavigatorWebDriver.cpp:
3221         (WebCore::NavigatorWebDriver::NavigatorWebDriver):
3222         (WebCore::NavigatorWebDriver::isControlledByAutomation):
3223         (WebCore::NavigatorWebDriver::from):
3224         (WebCore::NavigatorWebDriver::webdriver):
3225         (WebCore::JSNavigator::webdriver): Deleted.
3226         * Modules/webdriver/NavigatorWebDriver.h:
3227         * Modules/webdriver/NavigatorWebDriver.idl:
3228
3229 2017-05-24  Ryan Haddad  <ryanhaddad@apple.com>
3230
3231         Unreviewed, suppress deprecation warnings to fix the build.
3232
3233         * platform/graphics/mac/GraphicsContextMac.mm:
3234         (WebCore::linearRGBColorSpaceRef):
3235
3236 2017-05-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3237
3238         Plumb additional image metadata to item providers when beginning data interaction on an image
3239         https://bugs.webkit.org/show_bug.cgi?id=172536
3240         <rdar://problem/32371300>
3241
3242         Reviewed by Beth Dakin.
3243
3244         Plumb suggestedName (the last path component of the image's source URL) and size (the actual size of the image)
3245         to item providers when beginning data interaction on an image.
3246
3247         Augments existing unit tests to cover these changes -- see DataInteractionTests.
3248
3249         * editing/ios/EditorIOS.mm:
3250         (WebCore::Editor::writeImageToPasteboard):
3251         * platform/Pasteboard.h:
3252         * platform/ios/PlatformPasteboardIOS.mm:
3253         (WebCore::PlatformPasteboard::writeObjectRepresentations):
3254         * platform/ios/WebItemProviderPasteboard.h:
3255         * platform/ios/WebItemProviderPasteboard.mm:
3256         (-[WebItemProviderRegistrationInfoList init]):
3257         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
3258         (temporaryFileURLForDataInteractionContent):
3259
3260 2017-05-24  Eric Carlson  <eric.carlson@apple.com>
3261
3262         CoreAudioCaptureSource is ducking system sound
3263         https://bugs.webkit.org/show_bug.cgi?id=172512
3264
3265         Reviewed by Youenn Fablet.
3266
3267         Manual testing.
3268
3269         * Configurations/WebCore.xcconfig: Adding CoreAudio as framework for iOS.
3270         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3271         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
3272         (WebCore::CoreAudioSharedUnit::defaultOutputDevice):
3273         * platform/spi/cf/CoreAudioSPI.h: Added.
3274
3275 2017-05-24  John Wilander  <wilander@apple.com>
3276
3277         Resource Load Statistics: Change grandfathering default to one hour
3278         https://bugs.webkit.org/show_bug.cgi?id=172524
3279         <rdar://problem/32360462>
3280
3281         Reviewed by Brent Fulgham.
3282
3283         Covered by existing test.
3284
3285         * loader/ResourceLoadStatisticsStore.cpp:
3286
3287 2017-05-24  Jer Noble  <jer.noble@apple.com>
3288
3289         Rename DisplaySleepDisabler -> SleepDisabler
3290         https://bugs.webkit.org/show_bug.cgi?id=172478
3291
3292         Reviewed by Sam Weinig.
3293
3294         Rename DisplaySleepDisabler to SleepDisabler so that different (i.e., non-Display) sleep types can be
3295         added in a future change.
3296
3297         * WebCore.xcodeproj/project.pbxproj:
3298         * html/HTMLMediaElement.cpp:
3299         (WebCore::HTMLMediaElement::updateSleepDisabling):
3300         * html/HTMLMediaElement.h:
3301         * platform/SleepDisabler.cpp: Renamed from Source/WebCore/platform/DisplaySleepDisabler.cpp.
3302         (WebCore::SleepDisabler::create):
3303         (WebCore::SleepDisabler::SleepDisabler):
3304         (WebCore::SleepDisabler::~SleepDisabler):
3305         * platform/SleepDisabler.h: Renamed from Source/WebCore/platform/DisplaySleepDisabler.h.
3306         * platform/cocoa/SleepDisablerCocoa.cpp: Renamed from Source/WebCore/platform/cocoa/DisplaySleepDisablerCocoa.cpp.
3307         (WebCore::SleepDisabler::create):
3308         (WebCore::SleepDisablerCocoa::SleepDisablerCocoa):
3309         (WebCore::SleepDisablerCocoa::~SleepDisablerCocoa):
3310         * platform/cocoa/SleepDisablerCocoa.h: Renamed from Source/WebCore/platform/cocoa/DisplaySleepDisablerCocoa.h.
3311         * platform/mac/WebVideoFullscreenController.h:
3312         * platform/mac/WebVideoFullscreenController.mm:
3313         (-[WebVideoFullscreenController updatePowerAssertions]):
3314         * CMakeLists.txt:
3315         * PlatformMac.cmake:
3316         * WebCore.order:
3317
3318 2017-05-24  Per Arne Vollan  <pvollan@apple.com>
3319
3320         [Win] Create unique network storage session for each DRT.
3321         https://bugs.webkit.org/show_bug.cgi?id=172540
3322
3323         Reviewed by Brent Fulgham.
3324
3325         During layout testing, each DRT instance should have its own network storage session.
3326
3327         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3328         (WebCore::NetworkStorageSession::switchToNewTestingSession):
3329
3330 2017-05-24  Sam Weinig  <sam@webkit.org>
3331
3332         [WebIDL] Overloaded functions unnecessarily duplicate argument checks
3333         https://bugs.webkit.org/show_bug.cgi?id=172481
3334
3335         Reviewed by Chris Dumez.
3336
3337         * bindings/scripts/CodeGeneratorJS.pm:
3338         (GenerateHeader):
3339         (GeneratePropertiesHashTable):
3340         Update for rename of GetConditionalForFunctionConsideringOverloads.
3341
3342         (AreTypesDistinguishableForOverloadResolution):
3343         Remove unnecessary subroutine isDictionary that can be replaced by
3344         a direct call to $codeGenerator->IsDictionaryType().
3345
3346         (GetConditionalForFunctionConsideringOverloads):
3347         Renamed from getConditionalForFunctionConsideringOverloads.
3348
3349         (GenerateOverloadDispatcher):
3350         Renamed from GenerateOverloadedFunctionOrConstructor. Moved Constructor/Operation/LegacyCaller
3351         specific code out, and into parameters.
3352
3353         (GenerateImplementation):
3354         Moved operation generation out into its own subroutine.
3355
3356         (GenerateOperationDefinition): Added.
3357         Moved from GenerateImplementation.
3358
3359         (GenerateLegacyCallerDefinitions):
3360         Pass function name and signature to GenerateOverloadDispatcher.
3361
3362         (GenerateArgumentsCountCheck):
3363         Don't generate an argument check if this is an overloaded function. The argument
3364         checks happen in the overload dispatcher.
3365
3366         (NeedsExplicitPropagateExceptionCall):
3367         (GenerateParametersCheck):
3368         (GenerateImplementationFunctionCall):
3369         Replace IsReturningPromise with more direct check.
3370
3371         (GenerateConstructorDefinitions):
3372         Pass function name and signature to GenerateOverloadDispatcher.
3373
3374         (getConditionalForFunctionConsideringOverloads): Renamed to GetConditionalForFunctionConsideringOverloads.
3375         (GenerateOverloadedFunctionOrConstructor): Renamed to GenerateOverloadDispatcher.
3376         (IsReturningPromise): Deleted.
3377
3378         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3379         * bindings/scripts/test/JS/JSTestInterface.cpp:
3380         * bindings/scripts/test/JS/JSTestObj.cpp:
3381         * bindings/scripts/test/TestInterface.idl:
3382         Update test results.
3383
3384 2017-05-24  Commit Queue  <commit-queue@webkit.org>
3385
3386         Unreviewed, rolling out r217319.
3387         https://bugs.webkit.org/show_bug.cgi?id=172538
3388
3389         This patch broke iOS Simulator Debug build (Requested by fredw
3390         on #webkit).
3391
3392         Reverted changeset:
3393
3394         "CoreAudioCaptureSource is ducking system sound"
3395         https://bugs.webkit.org/show_bug.cgi?id=172512
3396         http://trac.webkit.org/changeset/217319
3397
3398 2017-05-24  Antoine Quint  <graouts@apple.com>
3399
3400         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
3401         https://bugs.webkit.org/show_bug.cgi?id=168409
3402
3403         Unreviewed.
3404
3405         Remove temporary logging which prevents performance bots from reporting useful data.
3406
3407         * page/Page.cpp:
3408         (WebCore::Page::suspendScriptedAnimations):
3409
3410 2017-05-24  Javier Fernandez  <jfernandez@igalia.com>
3411
3412         [css-grid] Ignore collapsed tracks on content-distribution alignment
3413         https://bugs.webkit.org/show_bug.cgi?id=172493
3414
3415         Reviewed by Manuel Rego Casasnovas.
3416
3417         The CSS Box Alignment spec states that we should ignore the collapsed
3418         tracks when computing the Distribution Alignment space to assign to the
3419         different grid tracks.
3420
3421         No new tests, just unskipping the web-platform-tests imported to verify this use case.
3422
3423         * rendering/RenderGrid.cpp:
3424         (WebCore::RenderGrid::populateGridPositionsForDirection):
3425
3426 2017-05-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3427
3428         Respect image UTIs when writing to item providers when beginning data interaction on an image
3429         https://bugs.webkit.org/show_bug.cgi?id=172436
3430         <rdar://problem/31786569>
3431
3432         Reviewed by Beth Dakin.
3433