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