Remove a test that was accidentally checked in with r218408.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-06-16  Youenn Fablet  <youenn@apple.com>
2
3         Remove replaceTrack restriction about video resolution
4         https://bugs.webkit.org/show_bug.cgi?id=173490
5
6         Reviewed by Eric Carlson.
7
8         Covered by updated tests.
9
10         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
11         (WebCore::RealtimeOutgoingVideoSource::setSource):
12
13 2017-06-16  Jeremy Jones  <jeremyj@apple.com>
14
15         Handle timeout of prepareForPictureInPictureStopWithCompletionHandler.
16         https://bugs.webkit.org/show_bug.cgi?id=173462
17         rdar://problem/32128170
18
19         Reviewed by Jer Noble.
20
21         No new tests because no effect on the DOM.
22
23         If WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler doesn't respond fast enough,
24         the caller will timeout and call will/didStopPictureInPicture.
25
26         This is getting fullscreen state confused.
27
28         This change keeps state consistent by handling will/didStopPictureInPicture possibly being called before
29         prepareForPictureInPictureStopWithCompletionHandler calls its callback.
30
31         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
32         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
33         (WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture):
34         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
35         (WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
36         (WebVideoFullscreenInterfaceAVKit::watchdogTimerFired):
37
38 2017-06-16  Myles C. Maxfield  <mmaxfield@apple.com>
39
40         Make builds faster after r218371
41         https://bugs.webkit.org/show_bug.cgi?id=173453
42
43         Reviewed by Tim Horton.
44
45         Remove #includes from .h files.
46
47         No new tests because there is no behavior change.
48
49         * CMakeLists.txt:
50         * WebCore.xcodeproj/project.pbxproj: Add new .cpp file, and sort the project file
51         * platform/graphics/FontFamilySpecificationNull.cpp: Copied from Source/WebCore/platform/graphics/FontFamilySpecificationNull.h.
52         (WebCore::FontFamilySpecificationNull::fontRanges):
53         * platform/graphics/FontFamilySpecificationNull.h:
54         (WebCore::FontFamilySpecificationNull::fontRanges): Deleted.
55         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
56         (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
57         (WebCore::FontFamilySpecificationCoreText::~FontFamilySpecificationCoreText):
58         * platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
59         (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText): Deleted.
60
61 2017-06-16  Chris Dumez  <cdumez@apple.com>
62
63         [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies
64         https://bugs.webkit.org/show_bug.cgi?id=173472
65         <rdar://problem/28858817>
66
67         Reviewed by Brady Eidson.
68
69         Add PluginLoadClientPolicyMaximum value to PluginLoadClientPolicy enumeration
70         to facilitate input value validation on API side.
71
72         * plugins/PluginData.h:
73
74 2017-06-16  Jer Noble  <jer.noble@apple.com>
75
76         [iOS] Do not pause playing video when application resigns active state.
77         https://bugs.webkit.org/show_bug.cgi?id=173474
78
79         Reviewed by Tim Horton.
80
81         Test: media/video-inactive-playback.html
82
83         Separate out the concept of "inactive" playback from "process background" playback.
84         Move the implementation of applicationDidEnterBackground() from MediaSessionManagerIOS
85         into it's superclass, PlatformMediaSessionManager, and add a new set of restrictions
86         for "InactiveProcessPlaybackRestricted" and "SuspendedUnderLockPlaybackRestricted".
87         Leave the default restriction set for iOS as "BackgroundProcessPlaybackRestricted" and
88         "SuspendedUnderLockPlaybackRestricted", to preserve the existing behavior of suspending
89         playback when switching apps or when locking the device.
90
91         * platform/audio/PlatformMediaSession.cpp:
92         (WebCore::interruptionName):
93         * platform/audio/PlatformMediaSession.h:
94         * platform/audio/PlatformMediaSessionManager.cpp:
95         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive):
96         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive):
97         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground):
98         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
99         (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground): Deleted.
100         (WebCore::PlatformMediaSessionManager::applicationDidEnterForeground): Deleted.
101         * platform/audio/PlatformMediaSessionManager.h:
102         * platform/audio/ios/MediaSessionManagerIOS.h:
103         * platform/audio/ios/MediaSessionManagerIOS.mm:
104         (WebCore::MediaSessionManageriOS::resetRestrictions):
105         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
106         (-[WebMediaSessionHelper applicationWillResignActive:]):
107         (WebCore::MediaSessionManageriOS::applicationDidEnterBackground): Deleted.
108         (WebCore::MediaSessionManageriOS::applicationWillEnterForeground): Deleted.
109         * testing/Internals.cpp:
110         (WebCore::Internals::applicationWillBecomeInactive):
111         (WebCore::Internals::applicationDidBecomeActive):
112         (WebCore::Internals::applicationWillEnterForeground):
113         (WebCore::Internals::applicationDidEnterBackground):
114         (WebCore::Internals::setMediaSessionRestrictions):
115         (WebCore::Internals::applicationDidEnterForeground): Deleted.
116         (WebCore::Internals::applicationWillEnterBackground): Deleted.
117         * testing/Internals.h:
118         * testing/Internals.idl:
119
120 2017-06-16  Alex Christensen  <achristensen@webkit.org>
121
122         REGRESSION (r213126): Sync XHR needs partition for cache and credentials
123         https://bugs.webkit.org/show_bug.cgi?id=173496
124         <rdar://problem/31943596>
125
126         Reviewed by Darin Adler.
127
128         Test: http/tests/security/sync-xhr-partition.html
129
130         * xml/XMLHttpRequest.cpp:
131         (WebCore::XMLHttpRequest::createRequest):
132
133 2017-06-16  Commit Queue  <commit-queue@webkit.org>
134
135         Unreviewed, rolling out r218402 and r218404.
136         https://bugs.webkit.org/show_bug.cgi?id=173494
137
138         Seems to have mysteriously broken the build in bizarre ways
139         (Requested by thorton on #webkit).
140
141         Reverted changesets:
142
143         "Include a few widespread WTF headers in WebCorePrefix.h"
144         https://bugs.webkit.org/show_bug.cgi?id=173481
145         http://trac.webkit.org/changeset/218402
146
147         "Fix the Windows build after r218402"
148         http://trac.webkit.org/changeset/218404
149
150 2017-06-16  Brady Eidson  <beidson@apple.com>
151
152         REGRESSION (r218015) IconLoaders for already-cached resources expect to be asynchronous, no longer are.
153         <rdar://problem/32817519> and https://bugs.webkit.org/show_bug.cgi?id=173478
154
155         Reviewed by Daniel Bates.
156
157         Covered by API test.
158
159         Being synchronous is actually better as it's resolved another issue or two.
160         But only if we can actually deliver the data without crashing first.
161         So let's do that.
162         
163         * loader/DocumentLoader.cpp:
164         (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Put the IconLoader in the set of active icon loaders
165           before actually starting the icon loading.
166
167 2017-06-16  Jeremy Jones  <jeremyj@apple.com>
168
169         Don't use WebCore Timer from code that runs in the UI process.
170         https://bugs.webkit.org/show_bug.cgi?id=173460
171         rdar://problem/32750731
172
173         Reviewed by Jer Noble.
174
175         If a WebCore Timer is fired from the WebKit2 UI process, it will
176         create a web thread, which can cause a crash in this instance.
177
178         It was also causing the timer to be called back on the wrong thread.
179
180         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
181         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
182         (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
183
184 2017-06-16  Timothy Horton  <timothy_horton@apple.com>
185
186         Fix the Windows build after r218402
187
188         * WebCorePrefix.h:
189         I typed #import instead of #include on auto-pilot, and ... it mostly worked!
190         Except Windows.
191
192 2017-06-16  Jeremy Jones  <jeremyj@apple.com>
193
194         Hide inline captions in fullscreen. Remove fullscreen captions when no longer needed.
195         https://bugs.webkit.org/show_bug.cgi?id=173482
196
197         Reviewed by Eric Carlson.
198
199         Hide the inline captions while they are presenting to fullscreen.
200         Remove the text track representation as soon as it is no longer needed.
201         This allows the text track to render properly when returning to inline.
202
203         * html/shadow/MediaControlElements.cpp:
204         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
205
206 2017-06-16  Tim Horton  <timothy_horton@apple.com>
207
208         Include a few widespread WTF headers in WebCorePrefix.h
209         https://bugs.webkit.org/show_bug.cgi?id=173481
210
211         Reviewed by Alex Christensen.
212
213         * WebCorePrefix.h:
214         These are four of the headers that contribute the most pre-processed
215         source to the WebCore build. They (and their dependents) change infrequently
216         enough that a world rebuild of WebCore when they change seems like an
217         acceptable tradeoff for the ~9% reduction in WebCore build time that I
218         measure from this change.
219
220 2017-06-16  Antoine Quint  <graouts@apple.com>
221
222         REGRESSION: AirPlay placard is not shown when in fullscreen
223         https://bugs.webkit.org/show_bug.cgi?id=173447
224         <rdar://problem/32803773>
225
226         Reviewed by Jon Lee.
227
228         We only allowed a placard to be set on inline controls, but that was an oversight: placards
229         should be displayed in fullscreen as well. As such, we move the "placard" property up from
230         InlineMediaControls to MediaControls, and update the layout() logic in MacOSFullscreenMediaControls
231         to display a placard.
232
233         Test: media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html
234
235         * Modules/modern-media-controls/controls/inline-media-controls.js:
236         (InlineMediaControls):
237         (InlineMediaControls.prototype.layout):
238         (InlineMediaControls.prototype.get placard): Deleted.
239         (InlineMediaControls.prototype.set placard): Deleted.
240         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
241         (MacOSFullscreenMediaControls.prototype.layout):
242         * Modules/modern-media-controls/controls/media-controls.js:
243         (MediaControls.prototype.get placard):
244         (MediaControls.prototype.set placard):
245         (MediaControls.prototype.placardPreventsControlsBarDisplay):
246         (MediaControls.prototype.layout):
247         * Modules/modern-media-controls/media/placard-support.js:
248         (PlacardSupport.prototype._updatePlacard):
249         (PlacardSupport):
250
251 2017-06-16  Jer Noble  <jer.noble@apple.com>
252
253         [WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
254         https://bugs.webkit.org/show_bug.cgi?id=173398
255         <rdar://problem/32592961>
256
257         Reviewed by Eric Carlson.
258
259         API Test: Tests/WebKit2/MediaStreamTrackDetached.mm
260
261         Move the definition of a MediaStream as a MediaProducer from the stream itself to its constituent
262         MediaStreamTracks. This ensures that, even if a MediaStreamTrack is removed from its stream, the
263         document (and thus the clients) are notified that media capture is still occurring.
264
265         Though MediaStream is no longer a MediaProducer, it still uses the MediaProducer's state concept
266         to determine when to fire events. However it's mediaState() implementation will be moved into
267         MediaStreamTrack, and will instead simply bitwise-or together each of it's track's mediaState().
268
269         The MediaStream notifies the document that its state has changed asynchronously, so do the same
270         for MediaStreamTrack (which reduces the number of calls to the client when changes all occur
271         during a single run loop).
272
273         Because the MediaStreamTrackPrivate may be started externally (not by the MediaStreamTrack directly),
274         add a new client method that notifies observers when the track has been started, and the
275         MediaStreamTrack will use this notification to update the document with it's new mediaState().
276
277         * Modules/mediastream/MediaStream.cpp:
278         (WebCore::MediaStream::MediaStream):
279         (WebCore::MediaStream::~MediaStream):
280         (WebCore::MediaStream::mediaState):
281         (WebCore::MediaStream::statusDidChange):
282         (WebCore::MediaStream::characteristicsChanged):
283         (WebCore::MediaStream::pageMutedStateDidChange): Deleted.
284         * Modules/mediastream/MediaStream.h:
285         * Modules/mediastream/MediaStreamTrack.cpp:
286         (WebCore::MediaStreamTrack::MediaStreamTrack):
287         (WebCore::MediaStreamTrack::~MediaStreamTrack):
288         (WebCore::MediaStreamTrack::pageMutedStateDidChange):
289         (WebCore::MediaStreamTrack::mediaState):
290         (WebCore::MediaStreamTrack::trackStarted):
291         (WebCore::MediaStreamTrack::configureTrackRendering):
292         (WebCore::MediaStreamTrack::stop):
293         (WebCore::MediaStreamTrack::document):
294         * Modules/mediastream/MediaStreamTrack.h:
295         (WebCore::MediaStreamTrack::source):
296         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
297         * platform/mediastream/MediaStreamPrivate.cpp:
298         (WebCore::MediaStreamPrivate::trackStarted):
299         * platform/mediastream/MediaStreamPrivate.h:
300         * platform/mediastream/MediaStreamTrackPrivate.cpp:
301         (WebCore::MediaStreamTrackPrivate::sourceStarted):
302         * platform/mediastream/MediaStreamTrackPrivate.h:
303         * platform/mediastream/RealtimeMediaSource.cpp:
304         (WebCore::RealtimeMediaSource::start):
305         * platform/mediastream/RealtimeMediaSource.h:
306
307 2017-06-16  Antoine Quint  <graouts@apple.com>
308
309         Backdrop blur missing in media controls bar on Sierra
310         https://bugs.webkit.org/show_bug.cgi?id=173451
311
312         Reviewed by Simon Fraser.
313
314         On Sierra, we need to enforce a stacking context on controls bars to guarantee that
315         the backdrop filters on the BackgroundTint are applied correctly.
316
317         Test: media/modern-media-controls/controls-bar/controls-bar-stacking-context.html
318
319         * Modules/modern-media-controls/controls/controls-bar.css:
320         (.controls-bar):
321
322 2017-06-16  Matt Lewis  <jlewis3@apple.com>
323
324         Unreviewed, rolling out r218375.
325
326         The API test MediaStreamTrackDetached is still timing out
327         after the patch
328
329         Reverted changeset:
330
331         "[WebRTC] Removing a MediaStreamTrack from a MediaStream
332         reports no recording to WebKit clients"
333         https://bugs.webkit.org/show_bug.cgi?id=173398
334         http://trac.webkit.org/changeset/218375
335
336 2017-06-15  Simon Fraser  <simon.fraser@apple.com>
337
338         REGRESSION: Media control glyphs appear to invert colors when video is dragged
339         https://bugs.webkit.org/show_bug.cgi?id=173455
340         rdar://problem/32726887
341
342         Reviewed by Tim Horton.
343
344         Masks on composited layers were not correctly painted in drag images, because RenderLayer::paintLayerContents()
345         failed to pass the PaintBehaviorFlattenCompositingLayers flag down through the mask drawing code, causing
346         RenderBox::paintMaskImages() to fall into the composited mask code path.
347
348         Fix by making a local copy of PaintBehavior, and setting the PaintBehaviorFlattenCompositingLayers and PaintBehaviorSnapshotting
349         bits on it as appropriate, and passing it into paintMaskForFragments() and paintChildClippingMaskForFragments(). This is similar
350         to code above.
351
352         Can't test drag images.
353
354         * rendering/RenderLayer.cpp:
355         (WebCore::RenderLayer::paintLayerContents):
356         (WebCore::RenderLayer::paintMaskForFragments):
357         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
358         * rendering/RenderLayer.h:
359
360 2017-06-16  Matt Lewis  <jlewis3@apple.com>
361
362         Unreviewed, rolling out r218376.
363
364         The patch cause multiple Layout Test Crashes.
365
366         Reverted changeset:
367
368         "Web Inspector: Instrument 2D/WebGL canvas contexts in the
369         backend"
370         https://bugs.webkit.org/show_bug.cgi?id=172623
371         http://trac.webkit.org/changeset/218376
372
373 2017-06-16  Daniel Bates  <dabates@apple.com>
374
375         Use the term icon instead of favicon
376         https://bugs.webkit.org/show_bug.cgi?id=173400
377
378         Reviewed by Alex Christensen.
379
380         * inspector/InspectorPageAgent.cpp:
381         (WebCore::InspectorPageAgent::cachedResourceContent):
382         (WebCore::InspectorPageAgent::cachedResourceType):
383         * loader/LinkLoader.cpp:
384         (WebCore::createLinkPreloadResourceClient):
385         * loader/ResourceLoadInfo.cpp:
386         (WebCore::toResourceType):
387         * loader/SubresourceLoader.cpp:
388         (WebCore::logResourceLoaded):
389         * loader/cache/CachedRawResource.cpp:
390         (WebCore::CachedRawResource::CachedRawResource):
391         * loader/cache/CachedRawResource.h:
392         (isType):
393         * loader/cache/CachedResource.cpp:
394         (WebCore::CachedResource::defaultPriorityForResourceType):
395         * loader/cache/CachedResource.h:
396         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource):
397         (WebCore::CachedResource::ignoreForRequestCount):
398         (WebCore::CachedResource::isMainOrMediaOrFaviconOrRawResource): Deleted.
399         * loader/cache/CachedResourceLoader.cpp:
400         (WebCore::createResource):
401         (WebCore::CachedResourceLoader::requestIcon):
402         (WebCore::contentTypeFromResourceType):
403         (WebCore::CachedResourceLoader::checkInsecureContent):
404         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
405         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
406         (WebCore::CachedResourceLoader::requestFavicon): Deleted.
407         * loader/cache/CachedResourceLoader.h:
408         * loader/icon/IconLoader.cpp:
409         (WebCore::IconLoader::startLoading):
410
411 2017-06-16  Per Arne Vollan  <pvollan@apple.com>
412
413         WebKit does not honor closed caption stroke width.
414         https://bugs.webkit.org/show_bug.cgi?id=173402
415
416         Reviewed by Eric Carlson.
417
418         WebKit currently has an upper limit on the stroke width returned from MACaptionAppearanceCopyFontDescriptorWithStrokeForStyle.
419         Since only half the stroke is visible because the stroke is drawn before the fill, double the stroke width from
420         MediaAccessibility to get the correct visual stroke width. Also, the stroke width returned from this function should not be
421         interpreted as CSS points, but as CSS pixels.
422
423         * html/shadow/MediaControlElements.cpp:
424         (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
425         * page/CaptionUserPreferencesMediaAF.cpp:
426         (WebCore::CaptionUserPreferencesMediaAF::captionStrokeWidthForFont):
427
428 2017-06-16  Per Arne Vollan  <pvollan@apple.com>
429
430         [Win] WebKit renders scrollbar wrong at 125% scale.
431         https://bugs.webkit.org/show_bug.cgi?id=173363
432
433         Reviewed by Darin Adler.
434
435         Scrollbars are drawn with the GDI function DrawThemeBackground. Sometimes, the GDI clip
436         rectangle will be too small since we clamp a FloatRect to integer values when setting the
437         GDI clip rectangle.
438
439         * platform/graphics/win/GraphicsContextWin.cpp:
440         (WebCore::GraphicsContextPlatformPrivate::clip):
441
442 2017-06-15  Mark Lam  <mark.lam@apple.com>
443
444         Add a JSRunLoopTimer registry in VM.
445         https://bugs.webkit.org/show_bug.cgi?id=173429
446         <rdar://problem/31287961>
447
448         Reviewed by Filip Pizlo.
449
450         No new tests needed because:
451         1. it's already covered: it was also originally discovered by our API tests while
452            running on the iOS simulator. The test was intermittently failing on a debug
453            build.
454         2. the issue is racy (it depends on a JSRunLoopTimer firing at the right time).
455            Hence, it's non trivial to write a better test than the one we already have.
456
457         * bindings/js/CommonVM.cpp:
458         (WebCore::commonVMSlow):
459
460 2017-06-15  Antoine Quint  <graouts@apple.com>
461
462         REGRESSION: AirPlay button is incorrectly highlighted in inline and fullscreen
463         https://bugs.webkit.org/show_bug.cgi?id=173446
464
465         Reviewed by Dean Jackson.
466
467         A button's color should be applied to its <picture> element, not the containing
468         <button> element.
469
470         * Modules/modern-media-controls/controls/airplay-button.css:
471         (button.airplay.on > picture):
472         (button.airplay.on): Deleted.
473
474 2017-06-15  Matt Baker  <mattbaker@apple.com>
475
476         Web Inspector: Instrument 2D/WebGL canvas contexts in the backend
477         https://bugs.webkit.org/show_bug.cgi?id=172623
478         <rdar://problem/32415986>
479
480         Reviewed by Devin Rousso.
481
482         Test: inspector/canvas/create-canvas-contexts.html
483
484         * CMakeLists.txt:
485         * WebCore.xcodeproj/project.pbxproj:
486
487         * dom/Document.cpp:
488         (WebCore::Document::getCSSCanvasElement):
489         Instrument creation of CSS canvases. This merely registers the canvas
490         element with InspectorCanvasAgent and stores the name (identifier passed
491         to getCSSCanvasContext) for later use. It isn't until the context is
492         actually created that the frontend receives a notification.
493
494         * html/HTMLCanvasElement.cpp:
495         (WebCore::HTMLCanvasElement::getContext2d):
496         (WebCore::HTMLCanvasElement::getContextWebGL):
497         Instrument creation of 2D and WebGL canvas contexts.
498
499         * inspector/InspectorAllInOne.cpp:
500
501         * inspector/InspectorCanvasAgent.cpp: Added.
502         New backend agent for canvas inspection. Canvas creation and destruction
503         are continuously monitored by the agent, regardless of the presence of
504         a frontend. This is necessary since there is no way to retrieve the
505         rendering contexts for with a given frame once they've been created.
506
507         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
508         (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
509         (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
510         (WebCore::InspectorCanvasAgent::discardAgent):
511         Unregister canvas observers to prevent dangling agent pointer.
512         (WebCore::InspectorCanvasAgent::enable):
513         Dispatch events for existing canvases, now that the frontend exists.
514         (WebCore::InspectorCanvasAgent::disable):
515         (WebCore::InspectorCanvasAgent::frameNavigated):
516         (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
517         Register the name/identifier associated with the CSS canvas, so that it
518         can be retrieved and associated with the rendering context later.
519
520         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
521         (WebCore::InspectorCanvasAgent::canvasDestroyed):
522         Removes the canvas from the agent, and queues it for notifying the
523         frontend during the next event loop.
524
525         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
526         (WebCore::InspectorCanvasAgent::clearCanvasData):
527         (WebCore::InspectorCanvasAgent::getCanvasEntry):
528         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
529         * inspector/InspectorCanvasAgent.h: Added.
530
531         * inspector/InspectorController.cpp:
532         (WebCore::InspectorController::InspectorController):
533
534         * inspector/InspectorInstrumentation.cpp:
535         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
536         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
537         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
538
539         * inspector/InspectorInstrumentation.h:
540         (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
541         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
542         These instrumentation points should not fast return when no frontend
543         is attached.
544
545         * inspector/InstrumentingAgents.cpp:
546         (WebCore::InstrumentingAgents::reset):
547
548         * inspector/InstrumentingAgents.h:
549         (WebCore::InstrumentingAgents::inspectorCanvasAgent):
550         (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
551         Plumbing for the new agent.
552
553 2017-06-15  Jer Noble  <jer.noble@apple.com>
554
555         [WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
556         https://bugs.webkit.org/show_bug.cgi?id=173398
557         <rdar://problem/32592961>
558
559         Reviewed by Eric Carlson.
560
561         API Test: Tests/WebKit2/MediaStreamTrackDetached.mm
562
563         Move the definition of a MediaStream as a MediaProducer from the stream itself to its constituent
564         MediaStreamTracks. This ensures that, even if a MediaStreamTrack is removed from its stream, the
565         document (and thus the clients) are notified that media capture is still occurring.
566
567         Though MediaStream is no longer a MediaProducer, it still uses the MediaProducer's state concept
568         to determine when to fire events. However it's mediaState() implementation will be moved into
569         MediaStreamTrack, and will instead simply bitwise-or together each of it's track's mediaState().
570
571         The MediaStream notifies the document that its state has changed asynchronously, so do the same
572         for MediaStreamTrack (which reduces the number of calls to the client when changes all occur
573         during a single run loop).
574
575         Because the MediaStreamTrackPrivate may be started externally (not by the MediaStreamTrack directly),
576         add a new client method that notifies observers when the track has been started, and the
577         MediaStreamTrack will use this notification to update the document with it's new mediaState().
578
579         * Modules/mediastream/MediaStream.cpp:
580         (WebCore::MediaStream::MediaStream):
581         (WebCore::MediaStream::~MediaStream):
582         (WebCore::MediaStream::mediaState):
583         (WebCore::MediaStream::statusDidChange):
584         (WebCore::MediaStream::characteristicsChanged):
585         (WebCore::MediaStream::pageMutedStateDidChange): Deleted.
586         * Modules/mediastream/MediaStream.h:
587         * Modules/mediastream/MediaStreamTrack.cpp:
588         (WebCore::MediaStreamTrack::MediaStreamTrack):
589         (WebCore::MediaStreamTrack::~MediaStreamTrack):
590         (WebCore::MediaStreamTrack::pageMutedStateDidChange):
591         (WebCore::MediaStreamTrack::mediaState):
592         (WebCore::MediaStreamTrack::trackStarted):
593         (WebCore::MediaStreamTrack::configureTrackRendering):
594         (WebCore::MediaStreamTrack::stop):
595         (WebCore::MediaStreamTrack::document):
596         * Modules/mediastream/MediaStreamTrack.h:
597         (WebCore::MediaStreamTrack::source):
598         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
599         * platform/mediastream/MediaStreamPrivate.cpp:
600         (WebCore::MediaStreamPrivate::trackStarted):
601         * platform/mediastream/MediaStreamPrivate.h:
602         * platform/mediastream/MediaStreamTrackPrivate.cpp:
603         (WebCore::MediaStreamTrackPrivate::sourceStarted):
604         * platform/mediastream/MediaStreamTrackPrivate.h:
605         * platform/mediastream/RealtimeMediaSource.cpp:
606         (WebCore::RealtimeMediaSource::start):
607         * platform/mediastream/RealtimeMediaSource.h:
608
609 2017-06-15  Simon Fraser  <simon.fraser@apple.com>
610
611         Use WTFLogAlways for debug logging so that it shows up in device system logs
612         https://bugs.webkit.org/show_bug.cgi?id=173450
613
614         Reviewed by Tim Horton.
615
616         If you want to showRenderTree() on-device, the result doesn't show in system log so you can't see it
617         Switch to WTFLogAlways to fix this, for all the debug logging in WebCore.
618         
619         Also WKError () -> WKError() in the old WAK code, to allow for easier searching pending cleanup.
620
621         * Modules/webaudio/AudioContext.cpp:
622         (WebCore::AudioContext::~AudioContext):
623         * Modules/webaudio/AudioNode.cpp:
624         (WebCore::AudioNode::~AudioNode):
625         (WebCore::AudioNode::ref):
626         (WebCore::AudioNode::finishDeref):
627         (WebCore::AudioNode::printNodeCounts):
628         * bridge/objc/objc_instance.mm:
629         (ObjcInstance::invokeObjcMethod):
630         * bridge/objc/objc_utility.mm:
631         (JSC::Bindings::convertObjcValueToValue):
632         * css/StyleProperties.cpp:
633         (WebCore::StyleProperties::showStyle):
634         * dom/DocumentMarkerController.cpp:
635         (DocumentMarkerController::showMarkers):
636         * dom/Node.cpp:
637         (WebCore::Node::showNode):
638         (WebCore::Node::showNodePathForThis):
639         (WebCore::traverseTreeAndMark):
640         * dom/Position.cpp:
641         (WebCore::Position::debugPosition):
642         (WebCore::Position::showAnchorTypeAndOffset):
643         * dom/Range.cpp:
644         (showTree):
645         * editing/FrameSelection.cpp:
646         (WebCore::FrameSelection::debugRenderer):
647         * editing/VisiblePosition.cpp:
648         (WebCore::VisiblePosition::debugPosition):
649         * editing/VisibleSelection.cpp:
650         (WebCore::VisibleSelection::debugPosition):
651         * history/HistoryItem.cpp:
652         (WebCore::HistoryItem::showTreeWithIndent):
653         * html/parser/HTMLFormattingElementList.cpp:
654         (WebCore::HTMLFormattingElementList::show):
655         * inspector/DOMPatchSupport.cpp:
656         (WebCore::DOMPatchSupport::dumpMap):
657         * page/scrolling/ScrollingStateTree.cpp:
658         (showScrollingStateTree):
659         * platform/audio/ios/AudioDestinationIOS.cpp:
660         (WebCore::AudioDestinationIOS::frameSizeChangedProc):
661         * platform/graphics/GraphicsLayer.cpp:
662         (showGraphicsLayerTree):
663         * platform/graphics/displaylists/DisplayList.cpp:
664         (WebCore::DisplayList::DisplayList::dump):
665         * platform/ios/wak/WAKView.mm:
666         (+[WAKView _wrapperForViewRef:]):
667         (-[WAKView displayRect:]):
668         (-[WAKView displayRectIgnoringOpacity:inContext:]):
669         * platform/ios/wak/WKUtilities.c:
670         (WKRelease):
671         * platform/ios/wak/WKView.mm:
672         (_WKViewSetViewContext):
673         (WKViewGetBounds):
674         (WKViewGetFrame):
675         (_WKViewRecursivelyInvalidateGState):
676         (WKViewSetFrameOrigin):
677         (WKViewSetFrameSize):
678         (WKViewGetWindow):
679         (WKViewGetSubviews):
680         (WKViewAddSubview):
681         (WKViewRemoveFromSuperview):
682         (WKViewFirstChild):
683         (WKViewNextSibling):
684         (WKViewTraverseNext):
685         (WKViewGetVisibleRect):
686         (WKViewConvertRectToSuperview):
687         (WKViewConvertRectToBase):
688         (WKViewConvertPointToSuperview):
689         (WKViewConvertPointFromSuperview):
690         (WKViewConvertPointToBase):
691         (_WKViewGetAncestorViewsIncludingView):
692         (WKViewConvertPointFromBase):
693         (WKViewConvertRectFromSuperview):
694         (WKViewConvertRectFromBase):
695         (WKViewGetAutoresizingMask):
696         (WKViewSetAutoresizingMask):
697         * platform/text/TextEncodingRegistry.cpp:
698         (WebCore::dumpTextEncodingNameMap):
699         * rendering/CounterNode.cpp:
700         (WebCore::showTreeAndMark):
701         * rendering/InlineBox.cpp:
702         (WebCore::InlineBox::showLineBox):
703         * rendering/InlineTextBox.cpp:
704         (WebCore::InlineTextBox::showLineBox):
705         * rendering/RenderCounter.cpp:
706         (showCounterRendererTree):
707         * rendering/RenderLayer.cpp:
708         (WebCore::showLayerTree):
709         * rendering/RenderObject.cpp:
710         (WebCore::showRenderTreeLegend):
711         (WebCore::RenderObject::showRegionsInformation):
712         (WebCore::RenderObject::showRenderObject):
713         (WebCore::printRenderTreeForLiveDocuments):
714         (WebCore::printLayerTreeForLiveDocuments):
715         * rendering/SimpleLineLayoutFunctions.cpp:
716         (WebCore::SimpleLineLayout::printPrefix):
717         (WebCore::SimpleLineLayout::showLineLayoutForFlow):
718         * rendering/svg/SVGResources.cpp:
719         (WebCore::SVGResources::dump):
720         * rendering/svg/SVGResourcesCycleSolver.cpp:
721         (WebCore::SVGResourcesCycleSolver::resolveCycles):
722         * rendering/svg/SVGTextLayoutAttributes.cpp:
723         (WebCore::dumpSVGCharacterDataMapValue):
724         (WebCore::SVGTextLayoutAttributes::dump):
725         * rendering/svg/SVGTextLayoutEngine.cpp:
726         (WebCore::dumpTextBoxes):
727         (WebCore::SVGTextLayoutEngine::finishLayout):
728
729 2017-06-15  Myles C. Maxfield  <mmaxfield@apple.com>
730
731         Removing stray whitespace after r218371
732         https://bugs.webkit.org/show_bug.cgi?id=173043
733
734         Unreviewed.
735
736         No new tests because there is no behavior change.
737
738         * platform/graphics/FontCascadeFonts.cpp:
739         (WebCore::shouldIgnoreRotation):
740         (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
741         * platform/graphics/FontDescription.cpp:
742         * platform/graphics/FontDescription.h:
743         * platform/graphics/FontFamilySpecificationNull.h:
744         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
745         (WebCore::SystemFontDatabase::systemFontCascadeList):
746         (WebCore::systemFontParameters):
747         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
748         (WebCore::FontFamilySpecificationCoreText::fontRanges):
749         * platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
750
751 2017-06-15  Myles C. Maxfield  <mmaxfield@apple.com>
752
753         [Cocoa] Expand system-ui to include every item in the Core Text cascade list
754         https://bugs.webkit.org/show_bug.cgi?id=173043
755         <rdar://problem/21125708>
756
757         Reviewed by Simon Fraser.
758
759         The concept of the system font on Cocoa platforms represents the entire Core Text cascade list.
760         However, previously, WebKit only represented system-ui by pulling out the first item in the Core
761         Text cascade list. Instead, we should make all text rendered with "system-ui" match what the
762         platform would natively render.
763
764         Previously, we walked through the strings in the font-family property and looked them up one by
765         one. However, now we want to abstract this idea of a font family to possibly hold a
766         CTFontDescriptorRef instead of a string. This way, we expand a font-family list of ["fontA",
767         "system-ui", "fontB"] to ["fontA", ... a bunch of CTFontDescriptorRefs ..., "FontB"]. We can
768         then modify the consumer of this object to have two codepaths: the old string-based codepath,
769         and a new, platform-specific codepath which simply embeds the CTFontDesriptorRefs inside a Font
770         object.
771
772         We don't want to simply pull out the family name from each item in the Core Text fallback list
773         because that is a lossy translation. There is more information in these font descriptors which
774         cannot be represented by CSS. Therefore, we must keep the descriptors alive and add the new
775         codepath for them.
776
777         We also don't want to run the CSS font matching algorithm on each member of the Core Text
778         fallback list because it may yield different results from Core Text's font matching algorithm.
779         Our goal is to draw text as closely as possible to the system APIs. If we ran it, we may find
780         a font which is closer to the requested traits, but it would look out of place on the system.
781
782         This new codepath is only enabled on macOS High Sierra and iOS 11, because enabling it on all
783         operating systems would make fixing https://bugs.webkit.org/show_bug.cgi?id=173300 impossible.
784
785         Tests: fast/text/system-font-fallback-emoji.html
786                fast/text/system-font-fallback.html
787                fast/text/system-font-zero-size.html
788
789         * WebCore.xcodeproj/project.pbxproj:
790         * page/MemoryRelease.cpp:
791         (WebCore::releaseNoncriticalMemory):
792         * platform/graphics/FontCascadeFonts.cpp:
793         (WebCore::realizeNextFallback): The consumer of our new data type. Now uses WTF::visit().
794         (WebCore::FontCascadeFonts::realizeFallbackRangesAt): Now that the number of items to test
795         against the current character is larger than the number of strings in the font-family list,
796         we need to update the existing code to use the correct value.
797         * platform/graphics/FontDescription.cpp: Default implementation for non-Cocoa ports.
798         (WebCore::FontDescription::invalidateCaches):
799         (WebCore::FontCascadeDescription::effectiveFamilyCount):
800         (WebCore::FontCascadeDescription::effectiveFamilyAt):
801         * platform/graphics/FontDescription.h: Our new data type is a Variant of AtomicString and a
802         platform-specific class. Cocoa uses a class that holds a CTFontDescriptorRef and other ports
803         use an empty non-constructable class.
804         * platform/graphics/FontFamilySpecificationNull.h: Added. The empty non-constructable
805         class.
806         (WebCore::FontFamilySpecificationNull::fontRanges):
807         * platform/graphics/cocoa/FontCacheCoreText.cpp:
808         (WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
809         (WebCore::FontCache::platformInit): Changing the system language will change the system font
810         fallback list, so we need to listen to this notification. This also matters for
811         FontCache::systemFallbackForCharacters(), so we should build off the same callback we are
812         already using for font installation.
813         (WebCore::invalidateFontCache):
814         * platform/graphics/cocoa/FontDescriptionCocoa.cpp: Added. The platform-specific creation of
815         our CTFontDescriptorRefs. We hold them cached in a SystemFontDatabase.
816         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
817         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
818         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
819         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
820         (WebCore::SystemFontDatabase::singleton):
821         (WebCore::SystemFontDatabase::systemFontCascadeList):
822         (WebCore::SystemFontDatabase::clear):
823         (WebCore::SystemFontDatabase::SystemFontDatabase):
824         (WebCore::SystemFontDatabase::applyWeightAndItalics):
825         (WebCore::SystemFontDatabase::removeCascadeList):
826         (WebCore::SystemFontDatabase::computeCascadeList):
827         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash):
828         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal):
829         (WebCore::isSystemFontString):
830         (WebCore::systemFontParameters):
831         (WebCore::FontDescription::invalidateCaches):
832         (WebCore::FontCascadeDescription::effectiveFamilyCount): We don't store the result of this
833         because it would probably be a bad idea to increase the size of every single FontCascade just
834         in case it might ask for the system font. Most fonts never mention system-ui. Because it's so
835         rare, we can just recalculate the result of this as necessary. This shouldn't be slow because
836         the results are cached.
837         (WebCore::FontCascadeDescription::effectiveFamilyAt):
838         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: Added.
839         (WebCore::FontFamilySpecificationCoreText::fontRanges): Create a FontRanges from a
840         CTFontDescriptorRef.
841         * platform/graphics/cocoa/FontFamilySpecificationCoreText.h: Added.
842         (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
843         * platform/graphics/ios/FontCacheIOS.mm:
844         (WebCore::platformFontWithFamilySpecialCase):
845         * platform/graphics/mac/FontCacheMac.mm:
846         (WebCore::platformFontWithFamilySpecialCase):
847
848 2017-06-15  David Kilzer  <ddkilzer@apple.com>
849
850         Revert: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
851         <https://webkit.org/b/173386>
852         <rdar://problem/32776426>
853
854         Revert r218347 and r218339 since we're going to take a different
855         approach to investigating a crash on the WebThread.
856
857         * WebCore.xcodeproj/project.pbxproj:
858         * platform/ios/CrashReporterSupportSoftLink.h: Remove.
859         * platform/ios/CrashReporterSupportSoftLink.mm: Remove.
860         * platform/ios/wak/WebCoreThread.mm:
861         (WebThreadEnable):
862         * platform/spi/ios/CrashReporterSupportSPI.h: Remove.
863
864 2017-06-15  Matt Lewis  <jlewis3@apple.com>
865
866         Unreviewed, rolling out r218365.
867
868         The revision caused API timeouts on all builds.
869
870         Reverted changeset:
871
872         "[WebRTC] Removing a MediaStreamTrack from a MediaStream
873         reports no recording to WebKit clients"
874         https://bugs.webkit.org/show_bug.cgi?id=173398
875         http://trac.webkit.org/changeset/218365
876
877 2017-06-15  Simon Fraser  <simon.fraser@apple.com>
878
879         Allow use of Layout* TextStream operators in WebKit2
880         https://bugs.webkit.org/show_bug.cgi?id=173440
881
882         Reviewed by Zalan Bujtas.
883
884         Export TextStream& operator<< for LayoutPoint, LayoutSize and LayoutRect so that
885         WebKit2 can log them.
886
887         Use #pragma once in these geometry headers.
888
889         * platform/graphics/FloatPoint.h:
890         * platform/graphics/FloatRect.h:
891         * platform/graphics/FloatSize.h:
892         * platform/graphics/IntPoint.h:
893         * platform/graphics/IntRect.h:
894         * platform/graphics/IntSize.h:
895         * platform/graphics/LayoutPoint.h:
896         * platform/graphics/LayoutRect.h:
897         * platform/graphics/LayoutSize.h:
898
899 2017-06-15  Antoine Quint  <graouts@apple.com>
900
901         Modern media controls tests error in Button.js
902         https://bugs.webkit.org/show_bug.cgi?id=173439
903
904         Reviewed by Dean Jackson.
905
906         Tests would sometime yield an error when commit() would be called and the _imageSource
907         ivar hadn't been set. To more safely commit the mask image when it's loaded, we now use
908         a markDirtyProperty() call and a commitProperty() override to ensure that we cover the
909         case where we want to commit the mask image, and for other commits not to have to worry
910         about the mask image being defined.
911
912         * Modules/modern-media-controls/controls/button.js:
913         (Button.prototype.commitProperty):
914         (Button.prototype._updateImage):
915         (Button.prototype.commit): Deleted.
916
917 2017-06-15  Jer Noble  <jer.noble@apple.com>
918
919         [WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
920         https://bugs.webkit.org/show_bug.cgi?id=173398
921         <rdar://problem/32592961>
922
923         Reviewed by Eric Carlson.
924
925         API Test: Tests/WebKit2/MediaStreamTrackDetached.mm
926
927         Move the definition of a MediaStream as a MediaProducer from the stream itself to its constituent
928         MediaStreamTracks. This ensures that, even if a MediaStreamTrack is removed from its stream, the
929         document (and thus the clients) are notified that media capture is still occurring.
930
931         Though MediaStream is no longer a MediaProducer, it still uses the MediaProducer's state concept
932         to determine when to fire events. However it's mediaState() implementation will be moved into
933         MediaStreamTrack, and will instead simply bitwise-or together each of it's track's mediaState().
934
935         The MediaStream notifies the document that its state has changed asynchronously, so do the same
936         for MediaStreamTrack (which reduces the number of calls to the client when changes all occur
937         during a single run loop).
938
939         Because the MediaStreamTrackPrivate may be started externally (not by the MediaStreamTrack directly),
940         add a new client method that notifies observers when the track has been started, and the
941         MediaStreamTrack will use this notification to update the document with it's new mediaState().
942
943         * Modules/mediastream/MediaStream.cpp:
944         (WebCore::MediaStream::MediaStream):
945         (WebCore::MediaStream::~MediaStream):
946         (WebCore::MediaStream::mediaState):
947         (WebCore::MediaStream::statusDidChange):
948         (WebCore::MediaStream::characteristicsChanged):
949         (WebCore::MediaStream::pageMutedStateDidChange): Deleted.
950         * Modules/mediastream/MediaStream.h:
951         * Modules/mediastream/MediaStreamTrack.cpp:
952         (WebCore::MediaStreamTrack::MediaStreamTrack):
953         (WebCore::MediaStreamTrack::~MediaStreamTrack):
954         (WebCore::MediaStreamTrack::pageMutedStateDidChange):
955         (WebCore::MediaStreamTrack::mediaState):
956         (WebCore::MediaStreamTrack::trackStarted):
957         (WebCore::MediaStreamTrack::configureTrackRendering):
958         (WebCore::MediaStreamTrack::stop):
959         (WebCore::MediaStreamTrack::document):
960         * Modules/mediastream/MediaStreamTrack.h:
961         (WebCore::MediaStreamTrack::source):
962         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
963         * platform/mediastream/MediaStreamPrivate.cpp:
964         (WebCore::MediaStreamPrivate::trackStarted):
965         * platform/mediastream/MediaStreamPrivate.h:
966         * platform/mediastream/MediaStreamTrackPrivate.cpp:
967         (WebCore::MediaStreamTrackPrivate::sourceStarted):
968         * platform/mediastream/MediaStreamTrackPrivate.h:
969         * platform/mediastream/RealtimeMediaSource.cpp:
970         (WebCore::RealtimeMediaSource::start):
971         * platform/mediastream/RealtimeMediaSource.h:
972
973 2017-06-15  Jonathan Bedard  <jbedard@apple.com>
974
975         Unreviewed build fix after r218336
976
977         * platform/spi/cocoa/PassKitSPI.h: Add missing #ifdefs for Internal builds.
978
979 2017-06-15  Antoine Quint  <graouts@apple.com>
980
981         Ensure we only log changes to the ScriptedAnimationController suspended state in debug builds
982         https://bugs.webkit.org/show_bug.cgi?id=173423
983
984         Reviewed by Tim Horton.
985
986         We added logging for when the suspended state of the scripted animation controller would change in
987         webkit.org/b/173326. It was meant to only be enabled in debug builds and we actually did the wrong
988         thing and enabled it in non-debug builds.
989
990         We also added a setting that wasn't used and that we are removing here.
991
992         * dom/ScriptedAnimationController.cpp:
993         (WebCore::ScriptedAnimationController::logSuspendCount):
994         * page/Settings.in:
995         * testing/InternalSettings.cpp:
996         (WebCore::InternalSettings::resetToConsistentState):
997         (WebCore::InternalSettings::shouldLogScritedAnimationControllerSuspensionChange): Deleted.
998         (WebCore::InternalSettings::setShouldLogScritedAnimationControllerSuspensionChange): Deleted.
999         * testing/InternalSettings.h:
1000         * testing/InternalSettings.idl:
1001
1002 2017-06-15  David Kilzer  <ddkilzer@apple.com>
1003
1004         Build fix: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
1005         <https://webkit.org/b/173386>
1006         <rdar://problem/32776426>
1007
1008         * platform/ios/CrashReporterSupportSoftLink.h:
1009         * platform/ios/CrashReporterSupportSoftLink.mm:
1010         * platform/ios/wak/WebCoreThread.mm:
1011         (WebThreadEnable): Log to the console on iOS Simulator.
1012         * platform/spi/ios/CrashReporterSupportSPI.h:
1013         - CrashReporterSupport.h is not available on iOS Simulator, so
1014           restrict to iOS hardware only.
1015
1016 2017-06-15  Chris Dumez  <cdumez@apple.com>
1017
1018         Unreviewed, rolling out r218318.
1019
1020         Seems to have caused an 11% PLT regression. Rolling out to
1021         confirm.
1022
1023         Reverted changeset:
1024
1025         "Don't always recalc the style of display: contents elements."
1026         https://bugs.webkit.org/show_bug.cgi?id=172753
1027         http://trac.webkit.org/changeset/218318
1028
1029 2017-06-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1030
1031         Using -[WebItemProviderPasteboard setItemProviders:] to swap out item providers before a drop breaks item provider loading
1032         https://bugs.webkit.org/show_bug.cgi?id=173338
1033         <rdar://problem/32777720>
1034
1035         Reviewed by Tim Horton.
1036
1037         Currently, replacing the list of UIItemProviders right before a drop is handled results in
1038         WebItemProviderPasteboard failing to load non-"public.content"-conformant items. This is because DragController
1039         computes and sends to the UI process a list of UTIs to load (preferredTypeIdentifiers: one type identifier for
1040         each item provider in WebItemProviderPasteboard). However, if the list of item providers changes immediately
1041         before a drop is performed, WebItemProviderPasteboard will get into an inconsistent state where it has a
1042         different number of preferred type identifiers to load than available item providers. This causes
1043         WebItemProviderPasteboard to fail when choosing what type identifiers to load from each item provider.
1044
1045         To fix this, we instead have the web process propagate a list of supported type identifiers to the UI process,
1046         which is a property of only the drop destination rather than both the destination and item providers. When
1047         performing a drop, we then use the current item providers on WebItemProviderPasteboard to consult this list of
1048         supported type identifiers to resolve our list of preferred type identifiers to load.
1049
1050         Globally renames updatePreferredTypeIdentifiers to updateSupportedTypeIdentifiers.
1051
1052         Tests:
1053         DataInteractionTests.ExternalSourceOverrideDropFileUpload
1054         DataInteractionTests.ExternalSourceOverrideDropInsertURL
1055
1056         * page/DragController.cpp:
1057         (WebCore::DragController::dragEnteredOrUpdated):
1058         (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
1059         (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod): Deleted.
1060         * page/DragController.h:
1061         * page/mac/DragControllerMac.mm:
1062         (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
1063         (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod): Deleted.
1064         * platform/DragData.h:
1065         * platform/PasteboardStrategy.h:
1066         * platform/PlatformPasteboard.h:
1067         * platform/ios/AbstractPasteboard.h:
1068         * platform/ios/PlatformPasteboardIOS.mm:
1069         (WebCore::PlatformPasteboard::updateSupportedTypeIdentifiers):
1070         (WebCore::PlatformPasteboard::updatePreferredTypeIdentifiers): Deleted.
1071         * platform/ios/WebItemProviderPasteboard.mm:
1072         (-[WebItemProviderPasteboard init]):
1073         (-[WebItemProviderPasteboard updateSupportedTypeIdentifiers:]):
1074         (-[WebItemProviderPasteboard setItemProviders:]):
1075         (-[WebItemProviderPasteboard typeIsAppropriateForSupportedTypes:]):
1076         (-[WebItemProviderPasteboard typeIdentifierToLoadForRegisteredTypeIdentfiers:]):
1077
1078         Add logic to resolve preferred type identifiers from an item providers list of registered type identifiers.
1079         This formerly existed on DragData.
1080
1081         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
1082         (-[WebItemProviderPasteboard updatePreferredTypeIdentifiers:]): Deleted.
1083         * platform/mac/DragDataMac.mm:
1084
1085         Remove preferred type identifier resolution logic from DragData.
1086
1087         (WebCore::typeIsAppropriateForSupportedTypes): Deleted.
1088         (WebCore::DragData::updatePreferredTypeIdentifiers): Deleted.
1089
1090 2017-06-15  Sam Weinig  <sam@webkit.org>
1091
1092         [WebIDL] Replace general inclusion of JSDOMConvert.h with inclusion of individual converter files to reduce unnecessary inclusion
1093         https://bugs.webkit.org/show_bug.cgi?id=173392
1094
1095         Reviewed by Tim Horton.
1096
1097         Stop including the umbrella header JSDOMConvert.h in every generated bindings and 
1098         instead only include the specific converter needed. Then, go around and add all the
1099         now missing includes that used to be obtained transitively.
1100
1101         * Modules/indexeddb/IDBRequest.cpp:
1102         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1103         * Modules/plugins/QuickTimePluginReplacement.mm:
1104         * bindings/js/IDBBindingUtilities.cpp:
1105         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1106         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1107         * bindings/js/JSCustomElementInterface.cpp:
1108         * bindings/js/JSCustomElementRegistryCustom.cpp:
1109         * bindings/js/JSDOMConvertBase.h:
1110         * bindings/js/JSDOMConvertInterface.h:
1111         * bindings/js/JSDOMConvertRecord.h:
1112         * bindings/js/JSDOMConvertSequences.h:
1113         * bindings/js/JSDOMConvertUnion.h:
1114         * bindings/js/JSDOMGlobalObject.h:
1115         * bindings/js/JSDOMWindowCustom.cpp:
1116         * bindings/js/JSDOMWindowProperties.cpp:
1117         * bindings/js/JSDocumentCustom.cpp:
1118         * bindings/js/JSErrorHandler.cpp:
1119         * bindings/js/JSEventListener.cpp:
1120         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1121         * bindings/js/JSHTMLDocumentCustom.cpp:
1122         * bindings/js/JSHistoryCustom.cpp:
1123         * bindings/js/JSMessageEventCustom.cpp:
1124         (WebCore::JSMessageEvent::data):
1125         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
1126         * bindings/js/JSMutationCallback.cpp:
1127         * bindings/js/JSXMLHttpRequestCustom.cpp:
1128         (WebCore::JSXMLHttpRequest::retrieveResponse):
1129         * bindings/js/ScriptGlobalObject.cpp:
1130         * bindings/js/SerializedScriptValue.cpp:
1131         * bindings/scripts/CodeGeneratorJS.pm:
1132         (AddToIncludesForIDLType):
1133         (GetJSCAttributesForAttribute):
1134         (GenerateEnumerationHeader):
1135         (GenerateEnumerationImplementation):
1136         (GenerateEnumerationImplementationContent):
1137         (GenerateEnumerationsImplementationContent):
1138         (GenerateEnumerationHeaderContent):
1139         (GenerateEnumerationsHeaderContent):
1140         (GenerateDictionaryHeaderContent):
1141         (GenerateDictionariesHeaderContent):
1142         (GenerateDictionaryImplementationContent):
1143         (GenerateDictionariesImplementationContent):
1144         (GenerateHeader):
1145         (GeneratePropertiesHashTable):
1146         (GenerateOverloadDispatcher):
1147         (GenerateImplementation):
1148         (GenerateAttributeGetterDefinition):
1149         (GenerateSerializerDefinition):
1150         (GenerateDictionaryHeader):
1151         (JSValueToNative):
1152         (NativeToJSValueUsingReferences):
1153         (NativeToJSValueUsingPointers):
1154         (IsValidContextForNativeToJSValue):
1155         (NativeToJSValue):
1156         (GenerateConstructorDefinition):
1157         (ComputeFunctionSpecial):
1158         * bindings/scripts/test/JS/JSMapLike.cpp:
1159         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1160         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1161         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1162         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1163         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1164         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
1165         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
1166         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1167         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
1168         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1169         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1170         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1171         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1172         * bindings/scripts/test/JS/JSTestException.cpp:
1173         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1174         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1175         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1176         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1177         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1178         * bindings/scripts/test/JS/JSTestInterface.cpp:
1179         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1180         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1181         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1182         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1183         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1184         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1185         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1186         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1187         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1188         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1189         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1190         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1191         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1192         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1193         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1194         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1195         * bindings/scripts/test/JS/JSTestNode.cpp:
1196         * bindings/scripts/test/JS/JSTestNode.h:
1197         * bindings/scripts/test/JS/JSTestObj.cpp:
1198         * bindings/scripts/test/JS/JSTestObj.h:
1199         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1200         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1201         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1202         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1203         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
1204         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1205         * bindings/scripts/test/JS/JSTestSerialization.h:
1206         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1207         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
1208         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1209         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
1210         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1211         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1212         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1213         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
1214         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1215         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
1216         * dom/MouseEvent.cpp:
1217         * html/HTMLPlugInImageElement.cpp:
1218
1219 2017-06-14  David Kilzer  <ddkilzer@apple.com>
1220
1221         [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
1222         <https://webkit.org/b/173386>
1223         <rdar://problem/32776426>
1224
1225         Reviewed by Andy Estes.
1226
1227         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
1228         * platform/ios/CrashReporterSupportSoftLink.h: Add.  The using
1229         statement is so that we don't have to write
1230         WebCore::SimulateCrash() in WebCoreThread.mm since it's
1231         functions are not defined inside a WebCore namespace.  I also
1232         kept the 'pid' argument despite the style checker warning
1233         because it matches the internal method definition.
1234         * platform/ios/CrashReporterSupportSoftLink.mm: Add.
1235         * platform/ios/wak/WebCoreThread.mm: Sort headers.  Soft link to
1236         CrashReporterSupport.framework.
1237         (WebThreadEnable): Generate a simulated crash log if the
1238         WebThread ever starts in MobileSafari.
1239         * platform/spi/ios/CrashReporterSupportSPI.h: Add.  The header
1240         isn't safe to include in C++ source, so wrap the import in
1241         extern "C" macros.
1242
1243 2017-06-15  Jonathan Bedard  <jbedard@apple.com>
1244
1245         Build WebKit with High Sierra (Seed 1)
1246         https://bugs.webkit.org/show_bug.cgi?id=173371
1247
1248         Reviewed by Andy Estes.
1249
1250         * crypto/CommonCryptoUtilities.h: Added ccRSAPSSPadding to CCAsymmetricPading enum.
1251         * platform/spi/cocoa/AVKitSPI.h: Declare AVKit SPI used by WebKit in High Sierra.
1252         (-[AVTouchBarPlaybackControlsControlling NS_ENUM]): Added AVTouchBarMediaSelectionOptionType
1253         SPI used in WebPlaybackControlManager in High Sierra.
1254         * platform/spi/cocoa/PassKitSPI.h: Declare PassKit SPI used by WebKit in High Sierra.
1255         (NS_ERROR_ENUM): Added PKPaymentErrorCode used in WebPayment in High Sierra.
1256
1257 2017-06-15  Youenn Fablet  <youenn@apple.com>
1258
1259         RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would be appropriate
1260         https://bugs.webkit.org/show_bug.cgi?id=173118
1261         <rdar://problem/32746761>
1262
1263         Reviewed by Eric Carlson.
1264
1265         Test: webrtc/createOfferAnswer.html
1266
1267         Making the promise return a RTCSessionDescription::Init instead of a RTCSessionDescription.
1268         This aligns with the spec and is more optimal.
1269
1270         * Modules/mediastream/PeerConnectionBackend.cpp:
1271         (WebCore::PeerConnectionBackend::createOfferSucceeded):
1272         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
1273         * Modules/mediastream/PeerConnectionBackend.h:
1274         * Modules/mediastream/RTCSessionDescription.idl:
1275
1276 2017-06-15 Emilio Cobos Álvarez  <ecobos@igalia.com>
1277
1278         Don't always recalc the style of display: contents elements.
1279         https://bugs.webkit.org/show_bug.cgi?id=172753
1280
1281         Reviewed by Antti Koivisto.
1282
1283         No new tests (no functionality change). This only removes an
1284         inefficiency.
1285
1286         * dom/Element.cpp:
1287         (WebCore::Element::existingComputedStyle):
1288         * dom/Element.h:
1289         * style/RenderTreeUpdater.cpp:
1290         (WebCore::RenderTreeUpdater::updateRenderTree):
1291         (WebCore::RenderTreeUpdater::updateElementRenderer):
1292         * style/StyleTreeResolver.cpp:
1293         (WebCore::Style::TreeResolver::resolveElement):
1294         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1295         (WebCore::Style::shouldResolveElement):
1296         (WebCore::Style::TreeResolver::resolveComposedTree):
1297
1298 2017-06-14  Antoine Quint  <graouts@apple.com>
1299
1300         Rebaseline media/modern-media-controls/media-documents
1301         https://bugs.webkit.org/show_bug.cgi?id=173394
1302
1303         Reviewed by Dean Jackson.
1304
1305         We found two issues related to media documents while rebaselining the dedicated tests.
1306
1307         First, we needed to expose the --inline-controls-bar-height CSS variable to <video>
1308         elements in media documents that are actually showing an audio UI. Previously we would
1309         only expose the variable to <audio> elements.
1310
1311         Also, due to webkit.org/b/173387, we would fail to identify certain media documents as
1312         video because the videoTracks weren't set yet when the "loadedmetadata" event would be
1313         triggered. So now we also look at the videoWidth and videoHeight properties, which should
1314         provide accurate information in the "loadedmetadata" event handler.
1315
1316         * Modules/modern-media-controls/controls/media-controls.css:
1317         (:host(audio), :host(video.media-document.audio), *):
1318         (:host(audio), *): Deleted.
1319         * Modules/modern-media-controls/media/media-controller.js:
1320         (MediaController.prototype.get isAudio):
1321
1322 2017-06-14  Zalan Bujtas  <zalan@apple.com>
1323
1324         animations-paused-in-background-page.html and animated-svg-image-removed-from-document-paused.html fail after r218284
1325         https://bugs.webkit.org/show_bug.cgi?id=173393
1326
1327         Reviewed by Simon Fraser.
1328
1329         Testing cares really about whether the animation has initiated.  
1330
1331         * platform/graphics/Image.h:
1332         (WebCore::Image::animationPending):
1333         * testing/Internals.cpp:
1334         (WebCore::Internals::isImageAnimating):
1335
1336 2017-06-14  Dean Jackson  <dino@apple.com>
1337
1338         Restrict filtered painting across cross-origin boundaries with transforms
1339         https://bugs.webkit.org/show_bug.cgi?id=173388
1340         <rdar://problem/27362159>
1341
1342         Reviewed by Simon Fraser.
1343
1344         Make sure all cases of LayerPaintingInfo maintain the security
1345         flag. In this case there was only one new place, and since
1346         everything is scalar, there was no need for a real copy constructor.
1347
1348         Test: http/tests/css/filters-on-iframes-transform.html
1349
1350         * rendering/RenderLayer.cpp:
1351         (WebCore::RenderLayer::paintLayerByApplyingTransform): Make sure the cross
1352         origin flag is used in the call to paint the layer children.
1353         * rendering/RenderLayer.h: Fix some typos.
1354
1355 2017-06-14  Commit Queue  <commit-queue@webkit.org>
1356
1357         Unreviewed, rolling out r218285.
1358         https://bugs.webkit.org/show_bug.cgi?id=173391
1359
1360         API test fails on iOS (Requested by alexchristensen on
1361         #webkit).
1362
1363         Reverted changeset:
1364
1365         "Add SPI for immediate injection of user scripts"
1366         https://bugs.webkit.org/show_bug.cgi?id=173342
1367         http://trac.webkit.org/changeset/218285
1368
1369 2017-06-14  Jer Noble  <jer.noble@apple.com>
1370
1371         Video flashes black when switching back to a tab https://www.apple.com/homepod/
1372         https://bugs.webkit.org/show_bug.cgi?id=173377
1373
1374         Reviewed by Eric Carlson.
1375
1376         Previously, we had set the background color of the video layer to black in order to make the rect
1377         occupied by the HTMLMediaElement fully opaque. This worked around a graphics corruption bug. Since
1378         then, the code in RenderVideo::foregroundIsKnownToBeOpaqueInRect(...) has been fixed to fully account
1379         for whether the HTMLMediaElement has a valid frame to display, making the black layer background
1380         unnecessary.
1381
1382         Remove all the instances where we were setting the background color of the video layer to black.
1383
1384         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1385         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1386         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
1387         (WebCore::VideoFullscreenLayerManager::setVideoLayer):
1388         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
1389
1390 2017-06-14  Matt Lewis  <jlewis3@apple.com>
1391
1392         Unreviewed, rolling out r218161.
1393
1394         Introduced bot API test failures and Layout Test Failures.
1395
1396         Reverted changeset:
1397
1398         "[Cocoa] Expand system-ui to include every item in the Core
1399         Text cascade list"
1400         https://bugs.webkit.org/show_bug.cgi?id=173043
1401         http://trac.webkit.org/changeset/218161
1402
1403 2017-06-14  Alex Christensen  <achristensen@webkit.org>
1404
1405         Add SPI for immediate injection of user scripts
1406         https://bugs.webkit.org/show_bug.cgi?id=173342
1407         <rdar://problem/29202285>
1408
1409         Reviewed by Brady Eidson.
1410
1411         The new SPI is WKUserContentController._addUserScriptImmediately.
1412         It is covered by new API tests.
1413
1414         * page/Frame.cpp:
1415         (WebCore::Frame::injectUserScripts):
1416         (WebCore::Frame::injectUserScriptImmediately):
1417         Move injection functionality to allow us to call it directly from the new SPI.
1418         * page/Frame.h:
1419         * page/Page.cpp:
1420         (WebCore::Page::forEachPage):
1421         * page/Page.h:
1422
1423 2017-06-14  Zalan Bujtas  <zalan@apple.com>
1424
1425         Crash in WebCore::RenderStyle::colorIncludingFallback.
1426         https://bugs.webkit.org/show_bug.cgi?id=173347
1427         <rdar://problem/32675317>
1428
1429         Reviewed by Chris Dumez.
1430
1431         Starting an SVG image animation synchronously might trigger recursive style recalc.
1432         We should kick off the animation on a zero timer to reduce callstack complexity. 
1433
1434         Test: svg/as-image/svg-css-animation.html
1435
1436         * loader/cache/CachedImage.cpp:
1437         (WebCore::CachedImage::didAddClient):
1438         * platform/graphics/Image.cpp:
1439         (WebCore::Image::Image):
1440         (WebCore::Image::startAnimationAsynchronously):
1441         * platform/graphics/Image.h:
1442
1443 2017-06-14  Brady Eidson  <beidson@apple.com>
1444
1445         WKIconLoadingDelegate never gets asked about the default favicon if touch/touch-precomposed icons are in the <head>
1446         <rdar://problem/32614328> and https://bugs.webkit.org/show_bug.cgi?id=173376
1447
1448         Reviewed by Alex Christensen.
1449
1450         Covered by new API test
1451
1452         * loader/DocumentLoader.cpp:
1453         (WebCore::DocumentLoader::startIconLoading): Previously we applied the default favicon if the set of LinkIcons was empty.
1454           Now, apply the default favicon if the set of LinkIcons contains no explicit favicon.
1455
1456 2017-06-14  Jer Noble  <jer.noble@apple.com>
1457
1458         Flaky Test: media/media-source/media-source-unnecessary-seek-seeked.html
1459         https://bugs.webkit.org/show_bug.cgi?id=173344
1460
1461         Reviewed by Eric Carlson.
1462
1463         Separate the concept of "the page has asked us to seek" from "we have asked the
1464         media player to seek". When the media engine tells us its ready state has changed
1465         after the page has requested a seek, but before the media element has asked its
1466         player to perform the seek, we were previously firing a seeked event. Now we'll
1467         check this new ivar and see that we aren't expecting a seek to finish yet.
1468
1469         * html/HTMLMediaElement.cpp:
1470         (WebCore::HTMLMediaElement::HTMLMediaElement):
1471         (WebCore::HTMLMediaElement::setReadyState):
1472         (WebCore::HTMLMediaElement::finishSeek):
1473         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
1474         * html/HTMLMediaElement.h:
1475
1476 2017-06-14  Matt Lewis  <jlewis3@apple.com>
1477
1478         Unreviewed, rolling out r218157.
1479
1480         This patch caused multiple API failures on iOS Simulator.
1481
1482         Reverted changeset:
1483
1484         "@font-face rules with invalid primary fonts never download
1485         their secondary fonts"
1486         https://bugs.webkit.org/show_bug.cgi?id=173138
1487         http://trac.webkit.org/changeset/218157
1488
1489 2017-06-14  Chris Dumez  <cdumez@apple.com>
1490
1491         REGRESSION (r217997): mint.com header renders incorrectly when initially loaded
1492         https://bugs.webkit.org/show_bug.cgi?id=173302
1493         <rdar://problem/32731747>
1494
1495         Reviewed by Darin Adler.
1496
1497         r217997 updated ImplicitAnimation::reset() to not call updateStateMachine(AnimationStateInput::RestartAnimation)
1498         if the compositeAnimation is suspended. If the compositeAnimation is suspended, we would call
1499         updateStateMachine(AnimationStateInput::AnimationStateInput::PlayStatePaused), which was expected to be a no-op.
1500         This was needed because otherwise, changing the style of the animated element would restart the animation
1501         even though it was supposed to be suspended. One thing I did not realize is that calling
1502         updateStateMachine(AnimationStateInput::AnimationStateInput::PlayStatePaused) on an animation that is already
1503         in PausedNew state, will cause it to move to PausedWaitResponse state. This is an issue because upon resuming
1504         we would call AnimationBase::updatePlayState(AnimPlayStatePlaying) which would return early because
1505         AnimationBase::paused() would return false. To address the issue, we no longer call updateStateMachine(PlayStatePaused)
1506         in ImplicitAnimation::reset() when the compositeAnimation is suspended, so that the animation stays in
1507         PausedNew state until we resume. When we resume, AnimationBase::paused() returns false and we actually resume
1508         the animation.
1509
1510         Tests:
1511         fast/animation/css-animation-resuming-when-visible-with-style-change.html
1512         fast/animation/css-animation-resuming-when-visible-with-style-change2.html
1513
1514         * page/animation/ImplicitAnimation.cpp:
1515         (WebCore::ImplicitAnimation::reset):
1516
1517 2017-06-14  Miguel Gomez  <magomez@igalia.com>
1518
1519         REGRESSION(r216901): ImageDecoders: rendering of large images is broken since r216901
1520         https://bugs.webkit.org/show_bug.cgi?id=172502
1521
1522         Reviewed by Carlos Garcia Campos.
1523
1524         When using GTK and WPE image decoders, the decoded frames are stored inside a Vector of
1525         ImageFrames inside the decoders. These ImageFrames have and ImageBackingStore with the
1526         pixels. When a NativeImagePtr is requested, a cairo surface is created from the data
1527         in those ImageBackingStores, but the data keeps being owned by the backing stores. Due
1528         to this, if the decoder that created the image gets destroyed, the backing stores for
1529         the decoded frames get destroyed as well, causing the cairo surfaces that were using
1530         that data to contain garbage (and potentially cause a crash).
1531
1532         To fix this, we change ImageBackingStore so the pixels are stored in a SharedBuffer. The
1533         buffer will be reffed everytime a cairo surface is created with it, and the cairo surfaces
1534         will unref the buffer when they are destroyed. This way, the pixel data won't be freed
1535         while there are cairo surfaces using it.
1536
1537         No new tests, no behaviour change.
1538
1539         * platform/graphics/ImageBackingStore.h:
1540         (WebCore::ImageBackingStore::setSize):
1541         (WebCore::ImageBackingStore::ImageBackingStore):
1542         * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
1543         (WebCore::ImageBackingStore::image):
1544
1545 2017-06-14  Zan Dobersek  <zdobersek@igalia.com>
1546
1547         [GStreamer] Align GstBus signal watch priorities with RunLoop dispatches
1548         https://bugs.webkit.org/show_bug.cgi?id=173348
1549
1550         Reviewed by Carlos Garcia Campos.
1551
1552         When adding GstBus signal watches, use the gst_bus_add_signal_watch_full()
1553         function to also specify the GLib priority that's used for the underlying
1554         GSource object.
1555
1556         RunLoopSourcePriority::RunLoopDispatcher should be a good priority value
1557         to use here, matching the RunLoop::dispatch() priority that's e.g. used
1558         in the MainThreadNotifier class.
1559
1560         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
1561         (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
1562         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1563         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1564         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1565         (WebCore::AppendPipeline::AppendPipeline):
1566
1567 2017-06-14  Eric Carlson  <eric.carlson@apple.com>
1568
1569         [MediaStream iOS] Back camera view rendered upside down when in portrait mode
1570         https://bugs.webkit.org/show_bug.cgi?id=173346
1571         <rdar://problem/32713675>
1572
1573         Reviewed by Youenn Fablet.
1574
1575         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1576         (WebCore::AVVideoCaptureSource::computeSampleRotation): Use different rotations for front and
1577         back cameras when device is in portrait orientation.
1578
1579 2017-06-13  Chris Dumez  <cdumez@apple.com>
1580
1581         Event handlers should not be called in frameless documents
1582         https://bugs.webkit.org/show_bug.cgi?id=173233
1583
1584         Reviewed by Sam Weinig.
1585
1586         As per the HTML specification [1], for event handlers on elements, we should use the
1587         element's document to check if scripting is disabled [2]. Scripting is considered to
1588         be disabled if the document has no browsing context (i.e. a frame in WebKit terms).
1589
1590         In JSLazyEventListener::initializeJSFunction(), instead of using the element's
1591         document to do the checks, we would use the script execution context. In most cases,
1592         a node's document and its script execution context are the same so this is not an
1593         issue. However, if the node's document is a document created via JS, its nodes'
1594         script execution context will be the document's context document (i.e the one that
1595         created the document, see implementation of Node::scriptExecutionContext()). In those
1596         cases, using the wrong document is an issue because the document's context document
1597         (aka script execution context) may allow scripting but we still do not want to call
1598         the event handler because its document is frameless.
1599
1600         This impacts documents created by JS, using the following APIs:
1601         - DOMParser.parseFromHTML
1602         - new Document()
1603         - DOMImplementation.createDocument / createHTMLDocument
1604         - XHRs whose responseType is Document.
1605
1606         [1] https://html.spec.whatwg.org/multipage/webappapis.html#getting-the-current-value-of-the-event-handler (step 1.1.)
1607         [2] https://html.spec.whatwg.org/multipage/webappapis.html#concept-n-noscript
1608
1609         Tests: fast/events/event-handler-detached-document-dispatchEvent.html
1610                fast/events/event-handler-detached-document.html
1611
1612         * bindings/js/JSLazyEventListener.cpp:
1613         (WebCore::JSLazyEventListener::initializeJSFunction):
1614
1615 2017-06-13  Antoine Quint  <graouts@apple.com>
1616
1617         Rebaseline media/modern-media-controls/placard-support
1618         https://bugs.webkit.org/show_bug.cgi?id=173340
1619
1620         Reviewed by Dean Jackson.
1621
1622         We make a source change to use a "placard" getter/setter to show or hide a placard, making it
1623         more convenient to test whether a placard has been set.
1624
1625         * Modules/modern-media-controls/controls/inline-media-controls.js:
1626         (InlineMediaControls.prototype.get placard):
1627         (InlineMediaControls.prototype.set placard):
1628         (InlineMediaControls.prototype.showPlacard): Deleted.
1629         (InlineMediaControls.prototype.hidePlacard): Deleted.
1630         * Modules/modern-media-controls/media/placard-support.js:
1631         (PlacardSupport.prototype._updatePlacard):
1632         (PlacardSupport):
1633
1634 2017-06-11  Antoine Quint  <graouts@apple.com>
1635
1636         Rebaseline media/modern-media-controls/fullscreen-support
1637         https://bugs.webkit.org/show_bug.cgi?id=173199
1638
1639         Reviewed by Simon Fraser.
1640
1641         Test: media/modern-media-controls/fullscreen-support/fullscreen-support-press.html
1642
1643         We no longer need to track the "error" event for FullscreenSupport since we don't actually
1644         enable or disable the fullscreen button when an error happens, instead the media controls
1645         code will simply not present it since we'll be showing a placard instead.
1646
1647         * Modules/modern-media-controls/media/fullscreen-support.js:
1648         (FullscreenSupport.prototype.get mediaEvents):
1649
1650 2017-06-13  Matt Rajca  <mrajca@apple.com>
1651
1652         WebsitePolicies: let clients select specific autoplay quirks
1653         https://bugs.webkit.org/show_bug.cgi?id=173343
1654
1655         Reviewed by Alex Christensen.
1656
1657         Tests: Updated API tests accordingly to use new values.
1658
1659         Replace the 'allowsAutoplayQuirks' bool with an OptionSet so clients can selectively
1660         pick auto-play quirks.
1661
1662         * dom/Document.cpp:
1663         (WebCore::Document::processingUserGestureForMedia):
1664         * html/HTMLMediaElement.cpp:
1665         (WebCore::needsAutoplayPlayPauseEventsQuirk):
1666         * loader/DocumentLoader.h:
1667         (WebCore::DocumentLoader::allowedAutoplayQuirks):
1668         (WebCore::DocumentLoader::setAllowedAutoplayQuirks):
1669         (WebCore::DocumentLoader::allowsAutoplayQuirks): Deleted.
1670         (WebCore::DocumentLoader::setAllowsAutoplayQuirks): Deleted.
1671
1672 2017-06-13  Zalan Bujtas  <zalan@apple.com>
1673
1674         Synchronous media query callbacks on nested frames could produced a detached FrameView.
1675         https://bugs.webkit.org/show_bug.cgi?id=173330
1676
1677         Reviewed by Simon Fraser.
1678
1679         This patch fixes the crash when the nested frame's media query callback triggers navigation on the mainframe.
1680         webkit.org/b/173329 is to track whether we should allow synchronous callback firing from FrameView::layout(). 
1681
1682         Covered by show-modal-dialog-during-execCommand.html.
1683
1684         * page/FrameView.cpp:
1685         (WebCore::FrameView::layout):
1686
1687 2017-06-13  Chris Fleizach  <cfleizach@apple.com>
1688
1689         AX[macOS]: Expose Inline property as an accessibility attribute
1690         https://bugs.webkit.org/show_bug.cgi?id=173131
1691         <rdar://problem/32667686>
1692
1693         Reviewed by Joanmarie Diggs.
1694
1695         Expose whether a renderer is inline so that VoiceOver can make better use of that data when deciding what to output.
1696
1697         Test: accessibility/mac/inline-text-attribute.html
1698
1699         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1700         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1701
1702 2017-06-13  Jon Davis  <jond@apple.com>
1703
1704         Update Subresource Integrity status to Supported In Preview
1705         https://bugs.webkit.org/show_bug.cgi?id=173324
1706
1707         Reviewed by Sam Weinig.
1708
1709         * features.json:
1710
1711 2017-06-13  Antoine Quint  <graouts@apple.com>
1712
1713         Add logging for layout tests when rAF callbacks get suspended and resumed
1714         https://bugs.webkit.org/show_bug.cgi?id=173326
1715
1716         Reviewed by Simon Fraser.
1717
1718         In order to help diagnose webkit.org/b/168409 we log the ScriptedAnimationController
1719         suspend count when it changes and log the backtrace so that we may understand why it
1720         fails to be set back to 0 when some modern-media-controls tests run.
1721
1722         * dom/ScriptedAnimationController.cpp:
1723         (WebCore::ScriptedAnimationController::suspend):
1724         (WebCore::ScriptedAnimationController::resume):
1725         (WebCore::ScriptedAnimationController::logSuspendCount):
1726         * dom/ScriptedAnimationController.h:
1727         * page/Settings.in:
1728         * testing/InternalSettings.cpp:
1729         (WebCore::InternalSettings::resetToConsistentState):
1730         (WebCore::InternalSettings::shouldLogScritedAnimationControllerSuspensionChange):
1731         (WebCore::InternalSettings::setShouldLogScritedAnimationControllerSuspensionChange):
1732         * testing/InternalSettings.h:
1733         * testing/InternalSettings.idl:
1734
1735 2017-06-13  Jer Noble  <jer.noble@apple.com>
1736
1737         Crash when MSE backed media element changes src/srcObject during PiP
1738         https://bugs.webkit.org/show_bug.cgi?id=173288
1739
1740         Reviewed by Alex Christensen.
1741
1742         Tear down the MediaPlayerPrivateMediaSourceAVFObjC's layers fully whe the player
1743         is destroyed, which includes removing the player's AVSampleBufferDisplayLayer from
1744         the HTMLMediaElement's fullscreen layer.
1745
1746         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1747         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
1748
1749 2017-06-13  Daniel Bates  <dabates@apple.com>
1750
1751         Implement W3C Secure Contexts Draft Specification
1752         https://bugs.webkit.org/show_bug.cgi?id=158121
1753         <rdar://problem/26012994>
1754
1755         Reviewed by Brent Fulgham.
1756
1757         Part 4
1758
1759         Adds runtime enabled feature flag, isSecureContextAttributeEnabled, to toggle exposing
1760         the global object property isSecureContext (defaults: true - expose the property).
1761
1762         Test: security/isSecureContext-disabled.html
1763
1764         * page/RuntimeEnabledFeatures.h:
1765         (WebCore::RuntimeEnabledFeatures::setIsSecureContextAttributeEnabled):
1766         (WebCore::RuntimeEnabledFeatures::isSecureContextAttributeEnabled):
1767         * page/WindowOrWorkerGlobalScope.idl:
1768
1769 2017-06-13  Jer Noble  <jer.noble@apple.com>
1770
1771         Protect lifetime of media element during HTMLMediaElement::notifyAboutPlaying()
1772         https://bugs.webkit.org/show_bug.cgi?id=173320
1773         <rdar://problem/32590276>
1774
1775         Reviewed by Brent Fulgham.
1776
1777         * html/HTMLMediaElement.cpp:
1778         (WebCore::HTMLMediaElement::notifyAboutPlaying):
1779
1780 2017-06-13  Youenn Fablet  <youenn@apple.com>
1781
1782         getReceivers() should return transceivers that have only an active receiver
1783         https://bugs.webkit.org/show_bug.cgi?id=173313
1784
1785         Reviewed by Alex Christensen.
1786
1787         Test: webrtc/video-receivers.html
1788
1789         Creating transceivers for receivers created from an offer.
1790         Setting these as recvonly.
1791
1792         * Modules/mediastream/RTCRtpTransceiver.h:
1793         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1794         (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
1795         (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
1796
1797 2017-06-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1798
1799         Unable to paste text that was copied from a page into the universal search field
1800         https://bugs.webkit.org/show_bug.cgi?id=173293
1801         <rdar://problem/32440918>
1802
1803         Reviewed by Ryosuke Niwa.
1804
1805         Vend "public.utf8-plain-text" and "public.utf16-plain-text" as additional representations on the pasteboard when
1806         copying both rich and plain web content in PlatformPasteboardIOS.mm. This is because UITextView no longer
1807         supports pasting "public.text" as text in iOS 11.
1808
1809         Tests:
1810         UIPasteboardTests.CopyPlainTextWritesConcreteTypes
1811         UIPasteboardTests.CopyRichTextWritesConcreteTypes
1812
1813         * platform/ios/PasteboardIOS.mm:
1814         (WebCore::Pasteboard::writePlainText):
1815         * platform/ios/PlatformPasteboardIOS.mm:
1816         (WebCore::PlatformPasteboard::write):
1817
1818 2017-06-13  Sam Weinig  <sam@webkit.org>
1819
1820         Rename JSDOMWindowShell to JSDOMWindowProxy to match the HTML5 spec.
1821         https://bugs.webkit.org/show_bug.cgi?id=80733
1822
1823         Reviewed by Chris Dumez.
1824
1825         Goodbye dear shell.
1826
1827         * CMakeLists.txt:
1828         * WebCore.xcodeproj/project.pbxproj:
1829         * bindings/js/DOMWrapperWorld.cpp:
1830         (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
1831         (WebCore::DOMWrapperWorld::clearWrappers):
1832         * bindings/js/DOMWrapperWorld.h:
1833         (WebCore::DOMWrapperWorld::didCreateWindowProxy):
1834         (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
1835         (WebCore::DOMWrapperWorld::didCreateWindowShell): Deleted.
1836         (WebCore::DOMWrapperWorld::didDestroyWindowShell): Deleted.
1837         * bindings/js/JSBindingsAllInOne.cpp:
1838         * bindings/js/JSDOMWindowBase.cpp:
1839         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
1840         (WebCore::JSDOMWindowBase::finishCreation):
1841         (WebCore::JSDOMWindowBase::willRemoveFromWindowProxy):
1842         (WebCore::JSDOMWindowBase::proxy):
1843         (WebCore::toJSDOMWindow):
1844         (WebCore::JSDOMWindowBase::willRemoveFromWindowShell): Deleted.
1845         (WebCore::JSDOMWindowBase::shell): Deleted.
1846         * bindings/js/JSDOMWindowBase.h:
1847         (WebCore::toJS):
1848         (WebCore::toJSDOMWindow):
1849         * bindings/js/JSDOMWindowCustom.cpp:
1850         (WebCore::JSDOMWindow::toWrapped):
1851         * bindings/js/JSDOMWindowCustom.h:
1852         * bindings/js/JSDOMWindowProperties.h:
1853         (WebCore::JSDOMWindowProperties::JSDOMWindowProperties):
1854         * bindings/js/JSDOMWindowProxy.cpp: Copied from WebCore/bindings/js/JSDOMWindowShell.cpp.
1855         (WebCore::JSDOMWindowProxy::JSDOMWindowProxy):
1856         (WebCore::JSDOMWindowProxy::finishCreation):
1857         (WebCore::JSDOMWindowProxy::destroy):
1858         (WebCore::JSDOMWindowProxy::setWindow):
1859         (WebCore::JSDOMWindowProxy::wrapped):
1860         (WebCore::JSDOMWindowProxy::toWrapped):
1861         (WebCore::toJS):
1862         (WebCore::toJSDOMWindowProxy):
1863         (WebCore::JSDOMWindowShell::JSDOMWindowShell): Deleted.
1864         (WebCore::JSDOMWindowShell::finishCreation): Deleted.
1865         (WebCore::JSDOMWindowShell::destroy): Deleted.
1866         (WebCore::JSDOMWindowShell::setWindow): Deleted.
1867         (WebCore::JSDOMWindowShell::wrapped): Deleted.
1868         (WebCore::JSDOMWindowShell::toWrapped): Deleted.
1869         (WebCore::toJSDOMWindowShell): Deleted.
1870         * bindings/js/JSDOMWindowProxy.h: Copied from WebCore/bindings/js/JSDOMWindowShell.h.
1871         (WebCore::JSDOMWindowProxy::create):
1872         (WebCore::toJSDOMWindowProxy):
1873         (WebCore::JSDOMWindowShell::window): Deleted.
1874         (WebCore::JSDOMWindowShell::create): Deleted.
1875         (WebCore::JSDOMWindowShell::createStructure): Deleted.
1876         (WebCore::JSDOMWindowShell::world): Deleted.
1877         (WebCore::toJSDOMWindowShell): Deleted.
1878         * bindings/js/JSDOMWindowShell.cpp: Removed.
1879         * bindings/js/JSDOMWindowShell.h: Removed.
1880         * bindings/js/JSEventTargetCustom.cpp:
1881         (WebCore::JSEventTarget::toWrapped):
1882         * bindings/js/JSHTMLDocumentCustom.cpp:
1883         (WebCore::JSHTMLDocument::open):
1884         * bindings/js/ScheduledAction.cpp:
1885         (WebCore::ScheduledAction::execute):
1886         * bindings/js/ScriptCachedFrameData.cpp:
1887         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
1888         (WebCore::ScriptCachedFrameData::restore):
1889         * bindings/js/ScriptController.cpp:
1890         (WebCore::collectGarbageAfterWindowProxyDestruction):
1891         (WebCore::ScriptController::~ScriptController):
1892         (WebCore::ScriptController::destroyWindowProxy):
1893         (WebCore::ScriptController::createWindowProxy):
1894         (WebCore::ScriptController::evaluateInWorld):
1895         (WebCore::ScriptController::loadModuleScriptInWorld):
1896         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
1897         (WebCore::ScriptController::evaluateModule):
1898         (WebCore::ScriptController::windowProxies):
1899         (WebCore::ScriptController::clearWindowProxiesNotMatchingDOMWindow):
1900         (WebCore::ScriptController::setDOMWindowForWindowProxy):
1901         (WebCore::ScriptController::initScript):
1902         (WebCore::ScriptController::setupModuleScriptHandlers):
1903         (WebCore::ScriptController::eventHandlerPosition):
1904         (WebCore::ScriptController::enableEval):
1905         (WebCore::ScriptController::disableEval):
1906         (WebCore::ScriptController::canAccessFromCurrentOrigin):
1907         (WebCore::ScriptController::attachDebugger):
1908         (WebCore::ScriptController::updateDocument):
1909         (WebCore::ScriptController::cacheableBindingRootObject):
1910         (WebCore::ScriptController::bindingRootObject):
1911         (WebCore::ScriptController::createRootObject):
1912         (WebCore::ScriptController::collectIsolatedContexts):
1913         (WebCore::ScriptController::windowScriptNPObject):
1914         (WebCore::ScriptController::jsObjectForPluginElement):
1915         (WebCore::ScriptController::cleanupScriptObjectsForPlugin):
1916         (WebCore::ScriptController::clearScriptObjects):
1917         (WebCore::ScriptController::executeIfJavaScriptURL):
1918         (WebCore::collectGarbageAfterWindowShellDestruction): Deleted.
1919         (WebCore::ScriptController::destroyWindowShell): Deleted.
1920         (WebCore::ScriptController::createWindowShell): Deleted.
1921         (WebCore::ScriptController::windowShells): Deleted.
1922         (WebCore::ScriptController::clearWindowShellsNotMatchingDOMWindow): Deleted.
1923         (WebCore::ScriptController::setDOMWindowForWindowShell): Deleted.
1924         * bindings/js/ScriptController.h:
1925         (WebCore::ScriptController::windowProxy):
1926         (WebCore::ScriptController::existingWindowProxy):
1927         (WebCore::ScriptController::globalObject):
1928         (WebCore::ScriptController::windowShell): Deleted.
1929         (WebCore::ScriptController::existingWindowShell): Deleted.
1930         * bindings/js/ScriptControllerMac.mm:
1931         (WebCore::ScriptController::windowScriptObject):
1932         * bindings/js/ScriptState.cpp:
1933         (WebCore::mainWorldExecState):
1934         * bindings/scripts/CodeGeneratorJS.pm:
1935         (GenerateHeader):
1936         (GenerateOverloadDispatcher):
1937         (GenerateImplementation):
1938         * bindings/scripts/test/JS/JSTestObj.cpp:
1939         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
1940         * loader/FrameLoader.cpp:
1941         (WebCore::FrameLoader::clear):
1942         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
1943         * page/Frame.cpp:
1944         * page/csp/ContentSecurityPolicy.cpp:
1945         (WebCore::ContentSecurityPolicy::didCreateWindowProxy):
1946         (WebCore::ContentSecurityPolicy::didCreateWindowShell): Deleted.
1947         * page/csp/ContentSecurityPolicy.h:
1948
1949 2017-06-13  Chris Dumez  <cdumez@apple.com>
1950
1951         Unreviewed, fix typo in variable introduced in r218108.
1952
1953         * page/cocoa/MemoryReleaseCocoa.mm:
1954         (WebCore::platformReleaseMemory):
1955         (WebCore::registerSQLiteMemoryPressureHandler):
1956
1957 2017-06-13  Joanmarie Diggs  <jdiggs@igalia.com>
1958
1959         AX: [ATK] Implement missing AtkRelation types
1960         https://bugs.webkit.org/show_bug.cgi?id=155494
1961
1962         Reviewed by Darin Adler.
1963
1964         Add methods for getting the element(s) which reference a particular element via an
1965         ARIA attribute. Then use those methods to identify and expose the expected reverse/
1966         reciprocal AtkRelationType and targets. Also add ATK support for aria-owns.
1967
1968         Use SpaceSplitString in AccessibilityObject::elementsFromAttribute() so that unexpected
1969         whitespace characters in an attribute's list of ids does not prevent the desired element
1970         from being found.
1971
1972         Lastly, change the return type of AccessibilityObject::identifierAttribute() from a String
1973         to a const AtomicString& for better efficiency.
1974
1975         Tests: accessibility/aria-owns.html
1976                accessibility/gtk/relation-types.html
1977
1978         * accessibility/AccessibilityObject.cpp:
1979         (WebCore::AccessibilityObject::identifierAttribute):
1980         (WebCore::AccessibilityObject::elementsFromAttribute):
1981         (WebCore::AccessibilityObject::ariaElementsReferencedByAttribute):
1982         (WebCore::AccessibilityObject::ariaControlsReferencingElements):
1983         (WebCore::AccessibilityObject::ariaDescribedByReferencingElements):
1984         (WebCore::AccessibilityObject::ariaFlowToReferencingElements):
1985         (WebCore::AccessibilityObject::ariaLabelledByReferencingElements):
1986         (WebCore::AccessibilityObject::ariaOwnsReferencingElements):
1987         * accessibility/AccessibilityObject.h:
1988         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1989         (setAtkRelationSetFromCoreObject):
1990
1991 2017-06-13  Gwang Yoon Hwang  <yoon@igalia.com>
1992
1993         [GStreamerGL] Release GstVideoFrame when there is a flush event from the pipeline
1994         https://bugs.webkit.org/show_bug.cgi?id=172427
1995
1996         Reviewed by Žan Doberšek.
1997
1998         Without GStreamerGL MediaPlayerPrivateGStreamer copies the video frame from
1999         the decoder's buffer to the texture to display a video. So it makes possible
2000         to release the GstSample when it got a flush start event to free the decoder's
2001         buffer to the decoder without side-effects.
2002
2003         Unlike the traditional way to render video, GStreamer GL does not copy a
2004         texture from the decoder to the texture mapper's buffer to draw video frame.
2005         It uses same GstMemory with the gst pipeline to manage the texture to prevent
2006         copy operations. So without releasing a layer buffer, there is no way to
2007         return GstMemory to the buffer pool.
2008
2009         This patch releases current GstSample when the player got the flush start
2010         event.  It destructs the platform layer buffer any time there is a flush start
2011         event.
2012
2013         However, it is not enough to release the GstMemory. The platform layer proxy
2014         should copy current buffer to show it to the compositor instead of a blank
2015         frame. It prevents flickerings until getting a new frame after handling flush
2016         events.
2017
2018         No new tests, there shouldn't be behavior changes
2019
2020         * platform/graphics/cairo/ImageBufferCairo.cpp:
2021         (WebCore::ImageBufferData::swapBuffersIfNeeded):
2022         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2023         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2024         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2025         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Adds
2026         handler for the flush event.
2027         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2028         * platform/graphics/texmap/BitmapTextureGL.cpp:
2029         (WebCore::BitmapTextureGL::BitmapTextureGL):
2030         (WebCore::BitmapTextureGL::copyFromExternalTexture): Copies
2031         a external texture to the managed texture.
2032         * platform/graphics/texmap/BitmapTextureGL.h:
2033         (WebCore::BitmapTextureGL::create):
2034         To create the managed texture with specific format, this patch adds a
2035         optional parameter for a texture format.
2036         * platform/graphics/texmap/TextureMapper.h:
2037         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
2038         (WebCore::TextureMapperGC3DPlatformLayer::swapBuffersIfNeeded):
2039         * platform/graphics/texmap/TextureMapperGL.cpp:
2040         (WebCore::TextureMapperGL::createTexture):
2041         * platform/graphics/texmap/TextureMapperGL.h:
2042         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2043         (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
2044         (WebCore::TextureMapperPlatformLayerBuffer::clone):
2045         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2046         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2047         (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers): Added
2048         to schedule releasing unused buffers in main thread.
2049         (WebCore::TextureMapperPlatformLayerProxy::swapBuffer):
2050         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2051         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2052
2053 2017-06-13  Youenn Fablet  <youenn@apple.com>
2054
2055         Filter SDP from ICE candidates in case of local ICE candidate filtering
2056         https://bugs.webkit.org/show_bug.cgi?id=173120
2057
2058         Reviewed by Eric Carlson.
2059
2060         Covered by updated test.
2061
2062         Adding filtering of local description in getters and createOffer promise.
2063
2064         * Modules/mediastream/MediaEndpointSessionDescription.cpp:
2065         (WebCore::MediaEndpointSessionDescription::toRTCSessionDescription):
2066         * Modules/mediastream/PeerConnectionBackend.cpp:
2067         (WebCore::PeerConnectionBackend::createOfferSucceeded):
2068         (WebCore::filterICECandidate):
2069         (WebCore::PeerConnectionBackend::filterSDP):
2070         * Modules/mediastream/PeerConnectionBackend.h:
2071         * Modules/mediastream/RTCSessionDescription.h:
2072         (WebCore::RTCSessionDescription::setSdp):
2073         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2074         (WebCore::LibWebRTCPeerConnectionBackend::currentLocalDescription):
2075         (WebCore::LibWebRTCPeerConnectionBackend::pendingLocalDescription):
2076         (WebCore::LibWebRTCPeerConnectionBackend::localDescription):
2077
2078 2017-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
2079
2080         [iOS] [macOS] Stop soft-linking Core Text function in iOS 11 and macOS High Sierra
2081         https://bugs.webkit.org/show_bug.cgi?id=173289
2082
2083         Reviewed by Lucas Forschler.
2084
2085         No new tests because there is no behavior change.
2086
2087         * platform/graphics/ios/FontCacheIOS.mm:
2088         (WebCore::platformFontWithFamilySpecialCase):
2089         * platform/graphics/mac/FontCacheMac.mm:
2090         (WebCore::platformFontWithFamilySpecialCase):
2091
2092 2017-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
2093
2094         [Cocoa] Expand system-ui to include every item in the Core Text cascade list
2095         https://bugs.webkit.org/show_bug.cgi?id=173043
2096         <rdar://problem/21125708>
2097
2098         Reviewed by Simon Fraser.
2099
2100         The concept of the system font on Cocoa platforms represents the entire Core Text cascade list.
2101         However, previously, WebKit only represented system-ui by pulling out the first item in the Core
2102         Text cascade list. Instead, we should make all text rendered with "system-ui" match what the
2103         platform would natively render.
2104
2105         Previously, we walked through the strings in the font-family property and looked them up one by
2106         one. However, now we want to abstract this idea of a font family to possibly hold a
2107         CTFontDescriptorRef instead of a string. This way, we expand a font-family list of ["fontA",
2108         "system-ui", "fontB"] to ["fontA", ... a bunch of CTFontDescriptorRefs ..., "FontB"]. We can
2109         then modify the consumer of this object to have two codepaths: the old string-based codepath,
2110         and a new, platform-specific codepath which simply embeds the CTFontDesriptorRefs inside a Font
2111         object.
2112
2113         We don't want to simply pull out the family name from each item in the Core Text fallback list
2114         because that is a lossy translation. There is more information in these font descriptors which
2115         cannot be represented by CSS. Therefore, we must keep the descriptors alive and add the new
2116         codepath for them.
2117
2118         We also don't want to run the CSS font matching algorithm on each member of the Core Text
2119         fallback list because it may yield different results from Core Text's font matching algorithm.
2120         Our goal is to draw text as closely as possible to the system APIs. If we ran it, we may find
2121         a font which is closer to the requested traits, but it would look out of place on the system.
2122
2123         Tests: fast/text/system-font-fallback-emoji.html
2124                fast/text/system-font-fallback.html
2125
2126         * WebCore.xcodeproj/project.pbxproj:
2127         * page/MemoryRelease.cpp:
2128         (WebCore::releaseNoncriticalMemory):
2129         * platform/graphics/FontCascadeFonts.cpp:
2130         (WebCore::realizeNextFallback): The consumer of our new data type. Now uses WTF::visit().
2131         (WebCore::FontCascadeFonts::realizeFallbackRangesAt): Now that the number of items to test
2132         against the current character is larger than the number of strings in the font-family list,
2133         we need to update the existing code to use the correct value.
2134         * platform/graphics/FontDescription.cpp: Default implementation for non-Cocoa ports.
2135         (WebCore::FontDescription::invalidateCaches):
2136         (WebCore::FontCascadeDescription::effectiveFamilyCount):
2137         (WebCore::FontCascadeDescription::effectiveFamilyAt):
2138         * platform/graphics/FontDescription.h: Our new data type is a Variant of AtomicString and a
2139         platform-specific class. Cocoa uses a class that holds a CTFontDescriptorRef and other ports
2140         use an empty non-constructable class.
2141         * platform/graphics/FontFamilySpecificationNull.h: Added. The empty non-constructable
2142         class.
2143         (WebCore::FontFamilySpecificationNull::fontRanges):
2144         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2145         (WebCore::FontCache::platformInit): Changing the system language will change the system font
2146         fallback list, so we need to listen to this notification. This also matters for
2147         FontCache::systemFallbackForCharacters(), so we should build off the same callback we are
2148         already using for font installation.
2149         (WebCore::invalidateFontCache):
2150         * platform/graphics/cocoa/FontDescriptionCocoa.cpp: Added. The platform-specific creation of
2151         our CTFontDescriptorRefs. We hold them cached in a SystemFontDatabase.
2152         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
2153         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
2154         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
2155         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
2156         (WebCore::SystemFontDatabase::singleton):
2157         (WebCore::SystemFontDatabase::systemFontCascadeList):
2158         (WebCore::SystemFontDatabase::clear):
2159         (WebCore::SystemFontDatabase::SystemFontDatabase):
2160         (WebCore::SystemFontDatabase::applyWeightAndItalics):
2161         (WebCore::SystemFontDatabase::removeCascadeList):
2162         (WebCore::SystemFontDatabase::computeCascadeList):
2163         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash):
2164         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal):
2165         (WebCore::isSystemFontString):
2166         (WebCore::systemFontParameters):
2167         (WebCore::FontDescription::invalidateCaches):
2168         (WebCore::FontCascadeDescription::effectiveFamilyCount): We don't store the result of this
2169         because it would probably be a bad idea to increase the size of every single FontCascade just
2170         in case it might ask for the system font. Most fonts never mention system-ui. Because it's so
2171         rare, we can just recalculate the result of this as necessary. This shouldn't be slow because
2172         the results are cached.
2173         (WebCore::FontCascadeDescription::effectiveFamilyAt):
2174         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: Added.
2175         (WebCore::FontFamilySpecificationCoreText::fontRanges): Create a FontRanges from a
2176         CTFontDescriptorRef.
2177         * platform/graphics/cocoa/FontFamilySpecificationCoreText.h: Added.
2178         (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
2179         * platform/graphics/ios/FontCacheIOS.mm: Delete the old handling for system-ui.
2180         (WebCore::platformFontWithFamilySpecialCase):
2181         (WebCore::baseSystemFontDescriptor): Deleted.
2182         (WebCore::systemFontModificationAttributes): Deleted.
2183         (WebCore::systemFontDescriptor): Deleted.
2184         * platform/graphics/mac/FontCacheMac.mm: Ditto.
2185         (WebCore::platformFontWithFamilySpecialCase):
2186         (WebCore::toNSFontWeight): Deleted.
2187
2188 2017-06-12  Daewoong Jang  <daewoong.jang@navercorp.com>
2189
2190         Remove WebCore::unloadModule and related data types
2191         https://bugs.webkit.org/show_bug.cgi?id=173231
2192
2193         Reviewed by Darin Adler.
2194
2195         * platform/FileSystem.h:
2196         (WebCore::PlatformModuleVersion::PlatformModuleVersion): Deleted.
2197         * platform/glib/FileSystemGlib.cpp:
2198         (WebCore::unloadModule): Deleted.
2199         * platform/win/FileSystemWin.cpp:
2200         (WebCore::unloadModule): Deleted.
2201
2202 2017-06-12  Jer Noble  <jer.noble@apple.com>
2203
2204         Unreviewed build fix; fix a misspelling in CoreMediaSoftLink.{h,cpp}.
2205
2206         * platform/cf/CoreMediaSoftLink.cpp:
2207         * platform/cf/CoreMediaSoftLink.h:
2208
2209 2017-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
2210
2211         @font-face rules with invalid primary fonts never download their secondary fonts
2212         https://bugs.webkit.org/show_bug.cgi?id=173138
2213         <rdar://problem/32554450>
2214
2215         Reviewed by Simon Fraser.
2216
2217         We have logic in CSSFontAccessor::font() which disallows downloading a CSSFontFace if that CSSFontFace
2218         is already in the Succeeded state. However, it was possible for a succeeded CSSFontFace to still fail
2219         to create a font. In this situation, we wouldn't be able to use the downloaded font, and we wouldn't
2220         try to download the next item in the src: list because the CSSFontFace is succeeded.
2221
2222         This patch strengthens the meaning of the Succeeded state. Previously, it just meant that the bytes
2223         in the file were downloaded successfully. This patch extends this to also mean that the bytes in the
2224         file can be successfully interpreted as a font. This way, the CSSFontFace in the example above won't be
2225         set to the Succeeded state, so we will continue follow the src: list and download the secondary fonts.
2226
2227         This has an added benefit that the CSS Font Loading API's promises will be called more appropriately.
2228         The transition to the Succeeded state will trigger a resolve of the promise. Now, these promises will
2229         only be resolved if the fonts are actually parsed and understood by our text system.
2230
2231         Test: fast/text/font-fallback-invalid-load.html
2232
2233         * css/CSSFontFaceSource.cpp:
2234         (WebCore::CSSFontFaceSource::fontLoaded): Move to the failed state if we can't understand the font
2235         data. This is the crux of this patch.
2236         (WebCore::CSSFontFaceSource::font): This function should only be called if we are in the Succeeded
2237         state, which means now we know we should always be able to understand the bytes of the file. Therefore,
2238         we can change some if statements into ASSERT()s.
2239         * loader/cache/CachedSVGFont.cpp:
2240         (WebCore::CachedSVGFont::createFont): Ditto.
2241         (WebCore::CachedSVGFont::platformDataFromCustomData): Similarly to CSSFontFaceSource::fontLoaded(), this
2242         adds another check to our criteria for transitioning into the Succeeded state, which will guarantee that
2243         later we will always be able to create the font object.
2244
2245 2017-06-12  Chris Dumez  <cdumez@apple.com>
2246
2247         Add Arabic Kasra to list of blacklisted characters when puny-decoding URL
2248         https://bugs.webkit.org/show_bug.cgi?id=173283
2249         <rdar://problem/32725659>
2250
2251         Reviewed by Brent Fulgham.
2252
2253         Add Arabic Kasra to list of blacklisted characters when puny-decoding URL as
2254         it is almost invisible in the URL bar.
2255
2256         Test: fast/url/user-visible/arabic_kasra.html
2257
2258         * platform/mac/WebCoreNSURLExtras.mm:
2259         (WebCore::isLookalikeCharacter):
2260
2261 2017-06-12  Jer Noble  <jer.noble@apple.com>
2262
2263         Screen sleeps while doing WebRTC video
2264         https://bugs.webkit.org/show_bug.cgi?id=173278
2265
2266         Reviewed by Eric Carlson.
2267
2268         HTMLMediaElement triggers changing the sleep disabler token when the media engine
2269         says that its rate has changed; the MediaPlayerPrivateMediaStreamAVFObjC needs to
2270         notify its client (the HTMLMediaElement) that the rate has changed when the stream
2271         is played or paused.
2272
2273         Drive-by fix: Don't set a sleep disabler token (i.e., allow the system and display
2274         to sleep) if the stream is strictly local-capture.
2275
2276         * html/HTMLMediaElement.cpp:
2277         (WebCore::HTMLMediaElement::shouldDisableSleep):
2278         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2279         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
2280         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):
2281
2282 2017-06-12  Jer Noble  <jer.noble@apple.com>
2283
2284         Seeking an MSE video will begin playing audio long before rendering video
2285         https://bugs.webkit.org/show_bug.cgi?id=173269
2286
2287         Reviewed by Eric Carlson.
2288
2289         Add a notification listener which will be messaged when a to-be-displayed sample
2290         is decoded to signal that the 'seeked' event should fire. Consolidate all the various
2291         flush methods to funnel into a single flushVideo().
2292
2293         * platform/cf/CoreMediaSoftLink.cpp:
2294         * platform/cf/CoreMediaSoftLink.h:
2295         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2296         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2297         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2298         (-[WebBufferConsumedContext initWithParent:buffer:]):
2299         (-[WebBufferConsumedContext dealloc]):
2300         (-[WebBufferConsumedContext parent]):
2301         (-[WebBufferConsumedContext buffer]):
2302         (WebCore::bufferWasConsumedCallback):
2303         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2304         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
2305         (WebCore::SourceBufferPrivateAVFObjC::flush):
2306         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
2307         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2308         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
2309         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
2310
2311 2017-06-12  Eric Carlson  <eric.carlson@apple.com>
2312
2313         [MediaStream iOS] Set audio session mode and options when capturing
2314         https://bugs.webkit.org/show_bug.cgi?id=173276
2315         <rdar://problem/32059254>
2316
2317         Reviewed by Jer Noble.
2318
2319         * platform/audio/ios/AudioSessionIOS.mm:
2320         (WebCore::AudioSession::setCategory): Set mode and options so the default output is to the speaker,
2321         and so audio will be routed to bluetooth when appropriate.
2322
2323 2017-06-12  Jeremy Jones  <jeremyj@apple.com>
2324
2325         Remove watchdog timer from WebVideoFullscreenInterfaceAVKit
2326         https://bugs.webkit.org/show_bug.cgi?id=173272
2327         rdar://problem/32260378
2328
2329         Reviewed by Jer Noble.
2330
2331         No new tests because no effect on DOM.
2332
2333         WebVideoFullscreenInterfaceAVKit's watchdog attempts to clean-up fullscreen if the page becomes unresponsive.
2334         However, it is just calling exitfullscreen(), which initiates the animation, but leaves the fullscreen window
2335         in place and doesn't initiate cleanup. This leaves the browser in an unusable state since all events will still
2336         be captured by the fullscren window.
2337
2338         This change uses the same method of hiding fullscreen window as switching tabs does. This will
2339         hide the fullscreen winodw and controller, leaving the browser available for interaction, and the page
2340         can take its time to properly cleanup the fullscreen window while hidden.
2341
2342         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2343         (WebVideoFullscreenInterfaceAVKit::watchdogTimerFired):
2344
2345 2017-06-12  Alex Christensen  <achristensen@webkit.org>
2346
2347         Modernize UserScript.h
2348         https://bugs.webkit.org/show_bug.cgi?id=173273
2349
2350         Reviewed by Tim Horton.
2351
2352         No change in behavior. Moved encoders to UserScript.h. Use more Rvalues.
2353
2354         * page/UserScript.h:
2355         (WebCore::UserScript::UserScript):
2356         (WebCore::UserScript::encode):
2357         (WebCore::UserScript::decode):
2358
2359 2017-06-12  Aaron Chu  <aaron_chu@apple.com>
2360
2361         AX: Video/Audio Player Controls missing group container.
2362         https://bugs.webkit.org/show_bug.cgi?id=171790
2363         <rdar://problem/32008994>
2364
2365         Reviewed by Antoine Quint.
2366
2367         Added aria-label to group controls in media controls.
2368
2369         * English.lproj/modern-media-controls-localized-strings.js:
2370         * Modules/modern-media-controls/controls/controls-bar.js:
2371         * Modules/modern-media-controls/controls/inline-media-controls.js:
2372         (InlineMediaControls):
2373         (InlineMediaControls.prototype.set shouldUseAudioLayout):
2374         (InlineMediaControls.prototype._updateBottomControlsBarLabel):
2375
2376 2017-06-12  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2377
2378         [Curl] Use SynchronousLoaderClient for platformLoadResourceSynchronously on WinCairo
2379         https://bugs.webkit.org/show_bug.cgi?id=173195
2380
2381         Reviewed by Alex Christensen.
2382
2383         * PlatformWinCairo.cmake:
2384         * platform/network/curl/ResourceHandleCurl.cpp:
2385         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2386         * platform/network/curl/SynchronousLoaderClientCurl.cpp: Added.
2387         (WebCore::SynchronousLoaderClient::didReceiveAuthenticationChallenge):
2388         (WebCore::SynchronousLoaderClient::platformBadResponseError):
2389
2390 2017-06-12  Eric Carlson  <eric.carlson@apple.com>
2391
2392         [MediaStream iOS] If a capturing tab is muted while it is in the background, it can not be unmuted
2393         https://bugs.webkit.org/show_bug.cgi?id=173268
2394         <rdar://problem/32259809>
2395
2396         Reviewed by Jer Noble.
2397
2398         No new tests, tested manually.
2399
2400         * Modules/mediastream/MediaStream.cpp:
2401         (WebCore::MediaStream::startProducingData): Mute the private stream if page capture is muted.
2402         (WebCore::MediaStream::mediaState): Set new interrupted state.
2403
2404         * dom/Document.cpp:
2405         (WebCore::Document::notifyMediaCaptureOfVisibilityChanged): Don't track "muted for visibility"
2406         state, let the source center deal with it.
2407         * dom/Document.h:
2408
2409         * page/MediaProducer.h: Add bits for interrupted audio and video capture.
2410
2411         * platform/mediastream/RealtimeMediaSource.cpp:
2412         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Drive-by fix: delete m_suppressNotifications,
2413         it isn't used.
2414         (WebCore::RealtimeMediaSource::setInterrupted): New. Mute capture when an interruption begins,
2415         and unmute when it ends in an unmuted page.
2416         (WebCore::RealtimeMediaSource::setMuted): Do not unmute if interrupted.
2417         (WebCore::RealtimeMediaSource::settingsDidChange): Don't check m_suppressNotifications, it is
2418         never set.
2419         * platform/mediastream/RealtimeMediaSource.h:
2420
2421         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2422         (WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState): Renamed from 
2423         setVideoCaptureMutedForPageVisibility.
2424         (WebCore::RealtimeMediaSourceCenter::setVideoCaptureMutedForPageVisibility): Deleted.
2425         * platform/mediastream/RealtimeMediaSourceCenter.h:
2426
2427         * platform/mediastream/mac/AVMediaCaptureSource.h:
2428         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2429         (WebCore::AVMediaCaptureSource::stopProducingData): Clear m_interruption because the session
2430         has been deleted, so we will never get an "end interruption" notification.
2431         (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Don't return early if
2432         the muted state needs to be updated.
2433         (WebCore::AVMediaCaptureSource::captureSessionEndInterruption): Return early if the session
2434         has been cleared.
2435         (WebCore::AVMediaCaptureSource::interrupted): New.
2436
2437         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2438         (WebCore::AVVideoCaptureSourceFactory::setVideoCapturePageState): Renamed from 
2439         setVideoCaptureMutedForPageVisibility.
2440         (WebCore::AVVideoCaptureSourceFactory::setVideoCaptureMutedForPageVisibility): Deleted.
2441
2442         * platform/mock/MockRealtimeVideoSource.cpp:
2443         (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Ditto.
2444         (WebCore::MockRealtimeVideoSourceFactory::setVideoCaptureMutedForPageVisibility): Deleted.
2445
2446 2017-06-12  Jiewen Tan  <jiewen_tan@apple.com>
2447
2448         [WebCrypto] Remove experimental feature flag of SubtleCrypto
2449         https://bugs.webkit.org/show_bug.cgi?id=173197
2450         <rdar://problem/32688148>
2451
2452         Reviewed by Brent Fulgham.
2453
2454         The SubtleCrypto implementation is no longer experimental and is ready for production use. We are therefore removing the runtime flag.
2455
2456         No tests.
2457
2458         * page/Crypto.idl:
2459         * page/RuntimeEnabledFeatures.h:
2460         (WebCore::RuntimeEnabledFeatures::setSubtleCryptoEnabled): Deleted.
2461         (WebCore::RuntimeEnabledFeatures::subtleCryptoEnabled): Deleted.
2462
2463 2017-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2464
2465         [iOS DnD] Allow the injected bundle to add client data when writing an image to the pasteboard
2466         https://bugs.webkit.org/show_bug.cgi?id=173238
2467         <rdar://problem/31943370>
2468
2469         Reviewed by Ryosuke Niwa and Tim Horton.
2470
2471         Add clientTypes and clientData to PasteboardImage, and call out to the injected bundle using
2472         getClientPasteboardDataForRange when writing a PasteboardImage. When generating item providers for dragging in
2473         the UI process in PlatformPasteboard, add any available client data as representations to the initialization
2474         list used to set the WebItemProviderPasteboard.
2475
2476         Test: DataInteraction.InjectedBundleImageElementData
2477
2478         * editing/ios/EditorIOS.mm:
2479         (WebCore::Editor::writeImageToPasteboard):
2480         * platform/Pasteboard.h:
2481         * platform/ios/PlatformPasteboardIOS.mm:
2482         (WebCore::PlatformPasteboard::writeObjectRepresentations):
2483
2484 2017-06-12  Sam Weinig  <sam@webkit.org>
2485
2486         [WebIDL] Re-implement GetOwnPropertySlot[ByIndex] generation to more closely follow WebIDL
2487         https://bugs.webkit.org/show_bug.cgi?id=173229
2488
2489         Reviewed by Chris Dumez.
2490
2491         * WebCore.xcodeproj/project.pbxproj:
2492         * CMakeLists.txt:
2493         * bindings/js/JSBindingsAllInOne.cpp:
2494         Remove JSHTMLFrameSetElementCustom.cpp which is no longer needed.
2495
2496         * bindings/js/JSDOMAbstractOperations.h:
2497         (WebCore::isVisibleNamedProperty):
2498         Add OverrideBuiltins enum as requested by a previous review (and I forgot address) and adopt it
2499         in isVisibleNamedProperty, switch to VMInquiry as we use elsewhere and add a missing FIXME.
2500
2501         (WebCore::accessVisibleNamedProperty):
2502         Add variation of isVisibleNamedProperty that takes a functor and returns either the value the
2503         functor returns, or std::nullopt. This allows getOwnPropertySlot to avoid doing two lookups for
2504         property, once in the named property visibility algorithm and again when it needs the value.
2505
2506         * bindings/js/JSDOMWindowBase.cpp:
2507         * bindings/js/JSDOMWindowBase.h:
2508         * bindings/js/JSDOMWindowShell.cpp:
2509         * bindings/js/JSDOMWindowShell.h:
2510         Standardize toJS functions to match generated code (have one that takes a reference, and does the
2511         cast, and one that takes a pointer, does a null check and calls the one that takes a reference).
2512         
2513         * bindings/js/JSHTMLDocumentCustom.cpp:
2514         (WebCore::JSHTMLDocument::getOwnPropertySlot):.
2515         Update to use the implementation namedItem (which is also used by the generated getOwnPropertySlotByIndex)
2516         and match the updated bindings rules. This cannot yet be generated due to the odd case of the 'open'
2517         property requiring custom treatment. I tried removing this, but it cause tests to fail in a way that indicated
2518         that accessing the lexical global object in the open implementation was not working correctly.
2519
2520         * bindings/js/JSHTMLFrameSetElementCustom.cpp: Removed.
2521         Now generated.
2522
2523         * bindings/scripts/CodeGeneratorJS.pm:
2524         (GenerateIndexedGetter):
2525         Add description from the spec and change to return the computed values rather than
2526         print them to the output array. This will be useful for some clients going forward,
2527         who only want the attributes.
2528
2529         (GenerateNamedGetter):
2530         Add description from the spec and change to return the computed values rather than
2531         print them to the output array. This will be useful for some clients going forward,
2532         who only want the attributes. Also greatly simplifies things as [CustomNamedGetter]s
2533         are no longer needed/supported and the exception / null value checks are performed
2534         elsewhere.
2535
2536         (GenerateNamedGetterLambda):
2537         This generates a lambda functor for use in accessVisibleNamedProperty(...). It
2538         handles calling the named getter implementation, and transforming the result into
2539         an one that can be reasoned about by accessVisibleNamedProperty, specifically,
2540         converting it from using IDL's notion of nullability to std::optional. 
2541
2542         (GenerateGetOwnPropertySlot):
2543         (GenerateGetOwnPropertySlotByIndex):
2544         Add spec annotations and use helper functions. 
2545
2546         (GenerateGetOwnPropertyNames):
2547         Add FIXME about supporting non-contiguous indices (should that ever come up)
2548         and use JSObject explicitly, rather than base, to get the default getOwnPropertyNames
2549         implementation.
2550
2551         (GeneratePut):
2552         Use JSObject explicitly, rather than base, to get the default put implementation.
2553
2554         (GeneratePutByIndex):
2555         Use JSObject explicitly, rather than base, to get the default putByIndex implementation.
2556
2557         (GenerateDefineOwnProperty):
2558         Use JSObject explicitly, rather than base, to get the default getOwnPropertySlot/defineOwnProperty
2559         implementations.
2560
2561         (GenerateDeletePropertyCommon):
2562         Adopt new OverrideBuiltins enum.
2563
2564         (GenerateDeletePropertyDefinition):
2565         Use JSObject explicitly, rather than base, to get the default deleteProperty implementation.
2566
2567         (GenerateDeletePropertyByIndexDefinition):
2568         Use JSObject explicitly, rather than base, to get the default deletePropertyByIndex implementation.
2569
2570         (InstanceOverridesGetOwnPropertySlot):
2571         Remove [CustomNamedGetter] use.
2572  
2573         (GenerateHeader):
2574         Remove [CustomNamedGetter] use and merge InstanceOverridesGetOwnPropertySlotByIndex into
2575         InstanceOverridesGetOwnPropertySlot. Specifying either [CustomGetOwnPropertySlot] or
2576         [CustomGetOwnPropertySlotByIndex] will now declare both hooks.
2577         
2578         (GenerateImplementation):
2579         Rename GenerateGetOwnPropertySlotBody/GenerateGetOwnPropertySlotByIndexBody to remove the 'Body',
2580         and predicate their generation purely on InstanceOverridesGetOwnPropertySlot as noted for the 
2581         reasons above.
2582
2583         (GenerateGetOwnPropertySlotBody): Deleted.
2584         (GenerateGetOwnPropertySlotBodyByIndex): Deleted.
2585         (InstanceOverridesGetOwnPropertySlotByIndex): Deleted.
2586
2587         * bindings/scripts/IDLAttributes.json:
2588         Remove [CustomNamedGetter].
2589
2590         * dom/ExceptionOr.h:
2591         (WebCore::ExceptionOr<ReturnType>::returnValue):
2592         Add a function to peek at the return value
2593
2594         * html/HTMLDocument.h:
2595         * html/HTMLDocument.cpp:
2596         (WebCore::HTMLDocument::clear):
2597         (WebCore::HTMLDocument::captureEvents):
2598         (WebCore::HTMLDocument::releaseEvents):
2599         Move clear up to be with the other obsolete no-op functions. Add spec annotations
2600         to clear up any confusion about why they are no-ops.
2601
2602         (WebCore::HTMLDocument::namedItem):
2603         Add implementation of namedItem based on the one that was in JSDOMHTMLDocumentCustom.cpp.
2604
2605         (WebCore::HTMLDocument::supportedPropertyNames):
2606         Add stub version of supportedPropertyNames with the algorithm we need to implement.
2607         I don't want to change behavior in this patch, and since we have not enumerated the
2608         properties of document in the past, I left this unimplemented for now.
2609
2610         * html/HTMLDocument.idl:
2611         Remove [CustomNamedGetter] and add named getter.
2612
2613         * html/HTMLFrameSetElement.h:
2614         * html/HTMLFrameSetElement.cpp:
2615         (WebCore::HTMLFrameSetElement::namedItem):
2616         Add named getter based on the implementation in JSHTMLFrameSetElementCustom.cpp.
2617
2618         (WebCore::HTMLFrameSetElement::supportedPropertyNames):
2619         As noted above, I don't want to change behavior with this change, so I have left this unimplemented
2620         for now. However, we may not want to implement it at all, as this named getter is not specified and
2621         at least Firefox does not support it.
2622
2623         * html/HTMLFrameSetElement.idl:
2624         Remove [CustomNamedGetter] and add named getter.
2625
2626         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2627         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2628         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2629         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2630         * bindings/scripts/test/JS/JSTestInterface.cpp:
2631         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2632         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2633         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2634         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2635         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2636         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2637         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2638         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2639         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2640         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2641         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2642         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2643         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2644         * bindings/scripts/test/JS/JSTestNode.cpp:
2645         * bindings/scripts/test/JS/JSTestObj.cpp:
2646         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2647         Update test results.
2648
2649         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Removed.
2650         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Removed.
2651         * bindings/scripts/test/TestCustomNamedGetter.idl: Removed.
2652         Remove test of [CustomNamedGetter] which no longer exists. 
2653
2654 2017-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2655
2656         WebItemProviderPasteboard should call its completion block immediately after a synchronous load
2657         https://bugs.webkit.org/show_bug.cgi?id=173225
2658         <rdar://problem/32713144>
2659
2660         Reviewed by Tim Horton.
2661
2662         Ensures that a completion block passed to doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout: will be
2663         invoked immediately, if a synchronous timeout is specified and loading finishes before the synchronous timeout
2664         is reached. To do this, we first factor out the completion logic into a new block. If the synchronous timeout
2665         exists and dispatch_group_wait returns 0 (indicating that the dispatch group finished without hitting the
2666         wait timeout) we simply invoke the block and return early; otherwise, we will register the completion block
2667         using dispatch_group_notify.
2668
2669         Test: DataInteractionTests.WebItemProviderPasteboardLoading
2670
2671         * platform/ios/WebItemProviderPasteboard.mm:
2672         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
2673
2674 2017-06-12  Jeremy Jones  <jeremyj@apple.com>
2675
2676         WebAVPlayerController minTime and maxTime should be calculated properties to provide correct values when streaming.
2677         https://bugs.webkit.org/show_bug.cgi?id=173193
2678         rdar://problem/32684807
2679
2680         Reviewed by Jer Noble.
2681
2682         No new tests because no affect on the DOM. This only affects properties consumed to AVKit.
2683
2684         -minTime and -maxTime should be calculated properties so they supply the exptected values to AVKit while streaming.
2685
2686         * platform/ios/WebAVPlayerController.h:
2687         * platform/ios/WebAVPlayerController.mm:
2688         (-[WebAVPlayerController maxTime]):
2689         (+[WebAVPlayerController keyPathsForValuesAffectingMaxTime]):
2690         (-[WebAVPlayerController minTime]):
2691         (+[WebAVPlayerController keyPathsForValuesAffectingMinTime]):
2692         (-[WebAVPlayerController resetMediaState]):
2693         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
2694         (WebCore::WebPlaybackSessionInterfaceAVKit::durationChanged):
2695
2696 2017-06-12  Chris Dumez  <cdumez@apple.com>
2697
2698         Call _sqlite3_purgeEligiblePagerCacheMemory() on memory pressure only if sqlite is initialized
2699         https://bugs.webkit.org/show_bug.cgi?id=173264
2700
2701         Reviewed by Ryosuke Niwa.
2702
2703         Call _sqlite3_purgeEligiblePagerCacheMemory() on memory pressure only if sqlite is initialized.
2704         Otherwise, not only is it no needed, it is also potentially unsafe.
2705
2706         * page/MemoryRelease.cpp:
2707         (WebCore::registerSQLiteMemoryPressureHandler):
2708         * page/MemoryRelease.h:
2709         * page/cocoa/MemoryReleaseCocoa.mm:
2710         (WebCore::platformReleaseMemory):
2711         (WebCore::registerSQLiteMemoryPressureHandler):
2712         * platform/sql/SQLiteDatabase.cpp:
2713         (WebCore::initializeSQLiteIfNecessary):
2714
2715 2017-06-12  Zan Dobersek  <zdobersek@igalia.com>
2716
2717         [GCrypt] Use utility functions in CryptoKeyEC, CryptoKeyRSA
2718         https://bugs.webkit.org/show_bug.cgi?id=173253
2719
2720         Reviewed by Michael Catanzaro.
2721
2722         Use the utility functions from the GCryptUtilities.h header instead
2723         of writing the same code in both CryptoKeyEC and CryptoKeyRSA
2724         implementations. The switches are straightforward, the only difference
2725         is that the GCryptUtilities functions return a std::optional<> object,
2726         meaning we have to address possibly invalid return value.
2727
2728         The mpiData() function is overloaded, making it possible to pass to it
2729         either a gcry_sexp_t or gcry_mpi_t object. Additionally, mpiLength()
2730         function is added, overloading again for gcry_sexp_t and gcry_mpi_t.
2731         This function is used from mpiData() as well as in CryptoKeyRSA when
2732         retrieving the RSA modulus length.
2733
2734         No new tests -- no changes in behavior.
2735
2736         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2737         (WebCore::CryptoKeyEC::platformExportRaw):
2738         (WebCore::CryptoKeyEC::platformAddFieldElements):
2739         (WebCore::extractMPIData): Deleted.
2740         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2741         (WebCore::getRSAModulusLength):
2742         (WebCore::getRSAKeyParameter):
2743         (WebCore::CryptoKeyRSA::exportData):
2744         (WebCore::getParameterMPIData): Deleted.
2745         * crypto/gcrypt/GCryptUtilities.h:
2746         (WebCore::mpiLength):
2747         (WebCore::mpiData):
2748
2749 2017-06-09  Ryosuke Niwa  <rniwa@webkit.org>
2750
2751         didMoveToNewDocument doesn't get called on an Attr inside a shadow tree
2752         https://bugs.webkit.org/show_bug.cgi?id=173133
2753
2754         Reviewed by Antti Koivisto.
2755
2756         The bug was caused by moveShadowTreeToNewDocument never calling didMoveToNewDocument on Attr nodes.
2757         Fixed the bug by using the same traversal code as moveTreeToNewScope in moveShadowTreeToNewDocument
2758         by extracting the traversal code as a templatized traverseSubtreeToUpdateTreeScope.
2759
2760         Also removed the code to increment the DOM tree version in moveTreeToNewScope. This code was there
2761         to invalidate the HTML collection caches which used to clear the cache whenever the DOM tree version
2762         changed before r122621 (five years ago! by me). Since we now eagerly invalidate each node list and
2763         HTML collection's caches via NodeListsNodeData::adoptTreeScope and NodeListsNodeData::adoptDocument.
2764
2765         Test: fast/dom/adopt-attr-with-shadow-tree.html
2766
2767         * dom/Node.cpp:
2768         (WebCore::moveNodeToNewDocument): Assert that the node had been adopted to a new document.
2769         (WebCore::traverseSubtreeToUpdateTreeScope): Extracted from moveTreeToNewScope.
2770         (WebCore::moveShadowTreeToNewDocument): Use traverseSubtreeToUpdateTreeScope to adopt each node
2771         to the new document.
2772         (WebCore::Node::moveTreeToNewScope): See above.
2773         * testing/Internals.cpp:
2774         (WebCore::Internals::referencingNodeCount): Added. Used in the newly added regression test.
2775         * testing/Internals.h:
2776         * testing/Internals.idl:
2777
2778 2017-06-11  Dan Bernstein  <mitz@apple.com>
2779
2780         [Mac] Unaligned pointers in static CMBufferCallbacks structs defined in WebCoreDecompressionSession.mm
2781         https://bugs.webkit.org/show_bug.cgi?id=173245
2782
2783         Reviewed by Sam Weinig.
2784
2785         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2786         (WebCore::WebCoreDecompressionSession::enqueueSample): Prepend 4 bytes of padding to the
2787           structs so that the pointers are properly aligned.
2788
2789 2017-06-11  Tim Horton  <timothy_horton@apple.com>
2790
2791         REGRESSION (r217870): Null deref under PageOverlayController::uninstallPageOverlay using find in page
2792         https://bugs.webkit.org/show_bug.cgi?id=173196
2793         <rdar://problem/32686871>
2794
2795         Reviewed by Simon Fraser.
2796
2797         * page/TextIndicator.cpp:
2798         (WebCore::initializeIndicator):
2799         * page/TextIndicator.h:
2800         The change in r217870 had an expected but not thought-through side-effect
2801         that you cannot create a TextIndicator for far-off-screen elements. This
2802         is a problem for find-in-page, which uses TextIndicator to paint the yellow
2803         highlight before scrolling it into view.
2804
2805         Bring back TextIndicatorOptionDoNotClipToVisibleRect and revert to it for
2806         find in page, since it needs different behavior than something like
2807         drag and drop, which always operates on content near the visible viewport.
2808
2809 2017-06-10  Dan Bernstein  <mitz@apple.com>
2810
2811         Reverted r218056 because it made the IDE reindex constantly.
2812
2813         * Configurations/DebugRelease.xcconfig:
2814
2815 2017-06-10  Dan Bernstein  <mitz@apple.com>
2816
2817         [Xcode] With Xcode 9 developer beta, everything rebuilds when switching between command-line and IDE
2818         https://bugs.webkit.org/show_bug.cgi?id=173223
2819
2820         Reviewed by Sam Weinig.
2821
2822         The rebuilds were happening due to a difference in the compiler options that the IDE and
2823         xcodebuild were specifying. Only the IDE was passing the -index-store-path option. To make
2824         xcodebuild pass that option, too, set CLANG_INDEX_STORE_ENABLE to YES if it is unset, and
2825         specify an appropriate path in CLANG_INDEX_STORE_PATH.
2826
2827         * Configurations/DebugRelease.xcconfig:
2828
2829 2017-06-10  Dan Bernstein  <mitz@apple.com>
2830
2831         [macOS] REGRESSION: Link drag images blend into the background in Sierra and earlier
2832         https://bugs.webkit.org/show_bug.cgi?id=172933
2833         <rdar://problem/32580649>
2834
2835         Reviewed by Tim Horton.
2836
2837         * platform/mac/DragImageMac.mm:
2838         (WebCore::createDragImageForLink): When targeting macOS Sierra and earlier, give the link
2839           drag image a drop shadow that resembles the one that macOS High Sierra applies to drag
2840           image layers.
2841
2842 2017-06-10  Andy Estes  <aestes@apple.com>
2843
2844         [QuickLook] PreviewLoader needs to check if its ResourceLoader has reached the terminal state before calling didReceiveResponse() and friends
2845         https://bugs.webkit.org/show_bug.cgi?id=173190
2846         <rdar://problem/31360659>
2847
2848         Reviewed by Brady Eidson.
2849
2850         WebPreviewLoader's SubresourceLoader can reach a terminal state while data is loading from
2851         QLPreviewConverter (the user can cancel, for instance). We can't call functions like
2852         didReceiveResponse() in this state, because the loader no longer points to a CachedResource,
2853         leading to null pointer dereferences.
2854
2855         Fix this in WebPreviewLoader by checking if the SubresourceLoader is in a terminal state
2856         before calling didReceiveResponse(), didReceiveData(), didFinishLoading(), and didFail().
2857
2858         Fixes web process crashes in the QuickLook.CancelNavigationAfterResponse API test.
2859
2860         * loader/ios/PreviewLoader.mm:
2861         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
2862         (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
2863         (-[WebPreviewLoader connectionDidFinishLoading:]):
2864         (-[WebPreviewLoader connection:didFailWithError:]):
2865
2866 2017-06-09  Chris Dumez  <cdumez@apple.com>
2867
2868         Use WTF::Function instead of std::function in indexeddb code
2869         https://bugs.webkit.org/show_bug.cgi?id=173198
2870
2871         Reviewed by Sam Weinig.
2872
2873         Use WTF::Function instead of std::function in indexeddb code to avoid copying.
2874
2875         * Modules/indexeddb/IDBFactory.cpp:
2876         (WebCore::IDBFactory::getAllDatabaseNames):
2877         * Modules/indexeddb/IDBFactory.h:
2878         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2879         (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNames):
2880         * Modules/indexeddb/client/IDBConnectionProxy.h:
2881         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2882         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
2883         * Modules/indexeddb/client/IDBConnectionToServer.h:
2884         * Modules/indexeddb/client/TransactionOperation.h:
2885         (WebCore::IDBClient::TransactionOperation::doComplete):
2886         * Modules/indexeddb/server/IDBServer.cpp:
2887         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2888         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
2889         * Modules/indexeddb/server/IDBServer.h:
2890         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2891         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
2892         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
2893         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
2894         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
2895         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
2896         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
2897         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
2898         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
2899         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
2900         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
2901         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
2902         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
2903         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
2904         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
2905         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
2906         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
2907         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
2908         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
2909         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2910
2911 2017-06-09  Dan Bernstein  <mitz@apple.com>
2912
2913         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
2914
2915         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2916         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime):
2917         (WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval):
2918
2919 2017-06-09  Yoav Weiss  <yoav@yoav.ws>
2920
2921         [preload] Fix builds with ENABLE_VIDEO_TRACK set to false
2922         https://bugs.webkit.org/show_bug.cgi?id=173221
2923
2924         Reviewed by Chris Dumez.
2925
2926         https://bugs.webkit.org/show_bug.cgi?id=173047 introduced a build error for builds with video track support disabled.
2927         This fixes that build issue.
2928
2929         No new tests since there's no functional change.
2930
2931         * html/HTMLLinkElement.cpp:
2932         (WebCore::HTMLLinkElement::as):
2933
2934 2017-06-09  Ryosuke Niwa  <rniwa@webkit.org>
2935
2936         IsInShadowTreeFlag does not get updated for a non-container node
2937         https://bugs.webkit.org/show_bug.cgi?id=173084
2938
2939         Address Darin's review comment.
2940
2941         * dom/ContainerNodeAlgorithms.cpp:
2942         (WebCore::notifyNodeInsertedIntoDocument):
2943         (WebCore::notifyNodeInsertedIntoTree):
2944         (WebCore::notifyNodeRemovedFromDocument):
2945
2946 2017-06-09  Dan Bernstein  <mitz@apple.com>
2947
2948         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
2949
2950         * platform/spi/mac/AVFoundationSPI.h:
2951
2952 2017-06-09  Brady Eidson  <beidson@apple.com>
2953
2954         Crash when IndexedDB's getAll is used inside a Web Worker.
2955         https://bugs.webkit.org/show_bug.cgi?id=172434
2956
2957         Reviewed by Andy Estes.
2958
2959         Test: storage/indexeddb/modern/worker-getall.html
2960
2961         * Modules/indexeddb/IDBGetAllResult.cpp:
2962         (WebCore::IDBGetAllResult::IDBGetAllResult): Add an isolated-copying constructor.
2963         (WebCore::IDBGetAllResult::isolatedCopy):
2964         * Modules/indexeddb/IDBGetAllResult.h:
2965         
2966         * Modules/indexeddb/shared/IDBResultData.cpp:
2967         (WebCore::IDBResultData::isolatedCopy): Actually copy the IDBGetAllResult.
2968
2969 2017-06-09  Chris Dumez  <cdumez@apple.com>
2970
2971         Unreviewed attempt to fix Mac build after r218039.
2972
2973         * loader/ResourceLoader.cpp:
2974         (WebCore::ResourceLoader::loadDataURL):
2975         * platform/network/DataURLDecoder.h:
2976
2977 2017-06-09  Chris Dumez  <cdumez@apple.com>
2978
2979         Use WTF::Function instead of std::function in DataURLDecoder
2980         https://bugs.webkit.org/show_bug.cgi?id=173194
2981
2982         Reviewed by Sam Weinig.
2983
2984         Use WTF::Function instead of std::function in DataURLDecoder to avoid copying.
2985
2986         * platform/network/DataURLDecoder.cpp:
2987         (WebCore::DataURLDecoder::DecodeTask::DecodeTask):
2988         (WebCore::DataURLDecoder::createDecodeTask):
2989         * platform/network/DataURLDecoder.h:
2990
2991 2017-06-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
2992
2993         Image should clear its ImageObserver* when CachedImage releases the last reference to its RefCounted<ImageObserver>
2994         https://bugs.webkit.org/show_bug.cgi?id=173077
2995
2996         Reviewed by Simon Fraser.
2997
2998         Before dereferencing ImageObserver, CachedImage::clearImage() should check
2999         whether it is the only object that holds a reference to this ImageObserver.
3000         And if this is true, m_image have to clear its raw pointer to the deleted
3001         ImageObserver by calling m_image->setImageObserver(nullptr).
3002
3003         * loader/cache/CachedImage.cpp:
3004         (WebCore::CachedImage::setBodyDataFrom):
3005         (WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
3006         (WebCore::CachedImage::clearImage):
3007         * loader/cache/CachedImage.h:
3008
3009 2017-06-09  Daniel Bates  <dabates@apple.com>
3010
3011         Attempt to fix layout test failures following <https://trac.webkit.org/changeset/218028/webkit>
3012         (https://bugs.webkit.org/show_bug.cgi?id=158121)
3013         <rdar://problem/26012994>
3014
3015         For now, if we do not have a frame then consider the document a secure context. One way this can happen
3016         is the page accesses a frame that was removed from the document as demonstrated by the test:
3017         fast/dom/Window/property-access-on-cached-window-after-frame-removed.html. Treating a frameless
3018         document as a secure context also matches Blink's implementation:
3019         <https://chromium.googlesource.com/chromium/src/+/fc202b2b1174f5732f7b9e63a6c46fd01ac2be02/third_party/WebKit/Source/core/dom/Document.cpp#4079>.
3020
3021         * dom/Document.cpp:
3022         (WebCore::Document::isSecureContext):
3023
3024 2017-06-09  Ryan Haddad  <ryanhaddad@apple.com>
3025
3026         Unreviewed, rolling out r218003.
3027
3028         This change caused assertion failures in existing LayoutTests.
3029
3030         Reverted changeset:
3031
3032         "Image should clear its ImageObserver* when CachedImage
3033         releases the last reference to its RefCounted<ImageObserver>"
3034         https://bugs.webkit.org/show_bug.cgi?id=173077
3035         http://trac.webkit.org/changeset/218003
3036
3037 2017-06-09  Jiewen Tan  <jiewen_tan@apple.com>
3038
3039         [WebCrypto] Remove unsupported CryptoAlgorithmIdentifier
3040         https://bugs.webkit.org/show_bug.cgi?id=173128
3041         <rdar://problem/32666826>
3042
3043         Reviewed by Brent Fulgham.
3044
3045         This patch remove AES_CMAC, DH and CONCAT as they are not implemented and not recommended
3046         by the spec. Hence there is no plan to support them in short term.
3047
3048         No change of behaviour.
3049
3050         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3051         (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt):
3052         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt):
3053         (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign):
3054         (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
3055         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest):
3056         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
3057         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey):
3058         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits):
3059         (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
3060         (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey):
3061         * bindings/js/JSSubtleCryptoCustom.cpp:
3062         (WebCore::normalizeCryptoAlgorithmParameters):
3063         (WebCore::supportExportKeyThrow):
3064         * bindings/js/SerializedScriptValue.cpp:
3065         (WebCore::CloneSerializer::write):
3066         (WebCore::CloneDeserializer::read):
3067         * crypto/CryptoAlgorithmIdentifier.h:
3068         * crypto/keys/CryptoKeyAES.cpp:
3069         (WebCore::CryptoKeyAES::isValidAESAlgorithm):
3070
3071 2017-06-09  Daniel Bates  <dabates@apple.com>
3072
3073         Implement W3C Secure Contexts Draft Specification
3074         https://bugs.webkit.org/show_bug.cgi?id=158121
3075         <rdar://problem/26012994>
3076
3077         Reviewed by Alex Christensen.
3078
3079         Part 2
3080
3081         Implements the Secure Contexts spec., <https://w3c.github.io/webappsec-secure-contexts/> (Editor's
3082         Draft, 17 November 2016) except for the allow-secure-context sandbox flag and restrictions on window.opener
3083         as the former is at risk of being dropped from the specification and the latter is being discussed in
3084         <https://github.com/w3c/webappsec-secure-contexts/issues/42>. We are not making use of the Secure
3085         Contexts functionality at the moment. We will make use of it in a subsequent commit.
3086
3087         * dom/Document.cpp:
3088         (WebCore::Document::isSecureContext): Added,
3089         * dom/Document.h:
3090         * dom/ScriptExecutionContext.h:
3091         (WebCore::ScriptExecutionContext::isSecureContext): Deleted; moved to class SecurityContext.
3092         * dom/SecurityContext.h:
3093         * page/DOMWindow.cpp:
3094         (WebCore::DOMWindow::isSecureContext): Added.
3095         * page/DOMWindow.h:
3096         * page/SecurityOrigin.cpp:
3097         (WebCore::isLoopbackIPAddress): Convenience function to determine whether the host portion
3098         of the specified URL is a valid loopback address.
3099         (WebCore::shouldTreatAsPotentionallyTrustworthy): Implements the "Is origin potentially trustworthy?"
3100         algorithm from the Secure Context specification.
3101         (WebCore::SecurityOrigin::SecurityOrigin): Compute whether this origin is potentially trustworthy.
3102         Also, use C++ brace initialization syntax in member initialization list.
3103         * page/SecurityOrigin.h:
3104         (WebCore::SecurityOrigin::isPotentionallyTrustworthy): Added.
3105         * page/WindowOrWorkerGlobalScope.idl: Expose attribute isSecureContext. Fix style nit; remove
3106         period from a comment that is not meant to be a complete sentence.
3107         * workers/WorkerGlobalScope.cpp:
3108         (WebCore::WorkerGlobalScope::isSecureContext): Added.
3109         * workers/WorkerGlobalScope.h:
3110
3111 2017-06-09  Daniel Bates  <dabates@apple.com>
3112
3113         Implement W3C Secure Contexts Draft Specification
3114         https://bugs.webkit.org/show_bug.cgi?id=158121
3115         <rdar://problem/26012994>
3116
3117         Reviewed by Chris Dumez.
3118
3119         Part 1
3120
3121         Teach the bindings code generator to generate a runtime check for an interface, attribute or
3122         function annotated with the extended attribute [SecureContext]. For now, the runtime check
3123         (ScriptExecutionContext::isSecureContext()) always returns true. We will flesh out the
3124         implementation of this runtime check in a subsequent commit.
3125
3126         * bindings/scripts/CodeGeneratorJS.pm:
3127         (NeedsRuntimeCheck):
3128         (GenerateRuntimeEnableConditionalString):
3129         Generate a runtime check for an interface, attribute, or function that is annotated with
3130         the extended attribute [SecureContext].
3131
3132         * bindings/scripts/IDLAttributes.json: Update JSON now that we support SecureContext.
3133         * bindings/scripts/preprocess-idls.pl:
3134         (GenerateConstructorAttributes): Add the SecureContext extended attribute to a constructor,
3135         if applicable.
3136
3137         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3138         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
3139         (WebCore::IDLAttribute<JSTestGenerateIsReachable>::cast):
3140         (WebCore::jsTestGenerateIsReachableASecretAttributeGetter):
3141         (WebCore::jsTestGenerateIsReachableASecretAttribute):
3142         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3143         (WebCore::JSTestGlobalObject::finishCreation):
3144         (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResultBody):
3145         (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResult):
3146         (WebCore::jsTestGlobalObjectInstanceFunctionGetSecretBooleanBody):
3147         (WebCore::jsTestGlobalObjectInstanceFunctionGetSecretBoolean):
3148         (WebCore::jsTestGlobalObjectInstanceFunctionTestFeatureGetSecretBooleanBody):
3149         (WebCore::jsTestGlobalObjectInstanceFunctionTestFeatureGetSecretBoolean):
3150         * bindings/scripts/test/JS/JSTestNode.cpp:
3151         (WebCore::JSTestNodePrototype::finishCreation):
3152         (WebCore::jsTestNodePrototypeFunctionCalculateSecretResultBody):
3153         (WebCore::jsTestNodePrototypeFunctionCalculateSecretResult):
3154         (WebCore::jsTestNodePrototypeFunctionGetSecretBooleanBody):
3155         (WebCore::jsTestNodePrototypeFunctionGetSecretBoolean):
3156         (WebCore::jsTestNodePrototypeFunctionTestFeatureGetSecretBooleanBody):
3157         (WebCore::jsTestNodePrototypeFunctionTestFeatureGetSecretBoolean):
3158         * bindings/scripts/test/JS/JSTestObj.cpp:
3159         (WebCore::JSTestObjPrototype::finishCreation):
3160         (WebCore::jsTestObjPrototypeFunctionCalculateSecretResultBody):
3161         (WebCore::jsTestObjPrototypeFunctionCalculateSecretResult):
3162         (WebCore::jsTestObjPrototypeFunctionGetSecretBooleanBody):
3163         (WebCore::jsTestObjPrototypeFunctionGetSecretBoolean):
3164         (WebCore::jsTestObjPrototypeFunctionTestFeatureGetSecretBooleanBody):
3165         (WebCore::jsTestObjPrototypeFunctionTestFeatureGetSecretBoolean):
3166         Update expected results.
3167
3168         * bindings/scripts/test/TestGenerateIsReachable.idl:
3169         * bindings/scripts/test/TestGlobalObject.idl:
3170         * bindings/scripts/test/TestNode.idl:
3171         * bindings/scripts/test/TestObj.idl:
3172         Add test cases.
3173
3174         * dom/ScriptExecutionContext.h:
3175         (WebCore::ScriptExecutionContext::isSecureContext): Added. For now, always returns true.
3176         We will implement this function in a subsequent commit.
3177
3178 2017-06-09  Jer Noble  <jer.noble@apple.com>
3179
3180         Media elements are allowed to continue to load media data after navigation
3181         https://bugs.webkit.org/show_bug.cgi?id=173179
3182
3183         Reviewed by Eric Carlson.
3184
3185         Deny media sessions the ability to load media data when suspended.  
3186
3187         * Modules/webaudio/AudioContext.cpp:
3188         (WebCore::AudioContext::isSuspended):
3189         * Modules/webaudio/AudioContext.h:
3190         * html/HTMLMediaElement.cpp:
3191         (WebCore::HTMLMediaElement::isSuspended):
3192         * html/HTMLMediaElement.h:
3193         * platform/audio/PlatformMediaSession.cpp:
3194         (WebCore::PlatformMediaSession::isSuspended):
3195         * platform/audio/PlatformMediaSession.h:
3196         (WebCore::PlatformMediaSessionClient::isSuspended):
3197         * platform/audio/PlatformMediaSessionManager.cpp:
3198         (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia):
3199
3200 2017-06-09  Daniel Bates  <dabates@apple.com>
3201
3202         CSP: Apply img-src directive to favicon loads
3203         https://bugs.webkit.org/show_bug.cgi?id=172733
3204         <rdar://problem/32082654>
3205
3206         Reviewed by Brady Eidson.
3207
3208         Differentiate favicon requests from raw resources requests so that we can apply the Content
3209         Security Policy to favicon requests.
3210
3211         Tests: http/tests/security/contentSecurityPolicy/allow-favicon.html
3212                http/tests/security/contentSecurityPolicy/block-favicon.html
3213
3214         * inspector/InspectorPageAgent.cpp:
3215         (WebCore::InspectorPageAgent::cachedResourceContent): Keep our current behavior and treat a
3216         favicon resource analogous to a raw resource.
3217         (WebCore::InspectorPageAgent::cachedResourceType): Ditto.
3218         * loader/LinkLoader.cpp:
3219         (WebCore::createLinkPreloadResourceClient): Now that we differentiate between a favicon
3220         and a raw resource we add favicons to the list of unsupported <link as="..."> types. This
3221         makes the list of handled request destination types more closely match the list of valid types
3222         documented in <https://fetch.spec.whatwg.org/#concept-request-destination> (24 May 2017).
3223         * loader/ResourceLoadInfo.cpp:
3224         (WebCore::toResourceType): Keep our current behavior and treat a favicon resource analogous
3225         to a raw resource.
3226         * loader/SubresourceLoader.cpp:
3227         (WebCore::logResourceLoaded): Ditto.
3228         * loader/cache/CachedRawResource.cpp:
3229         (WebCore::CachedRawResource::CachedRawResource): Update for renaming.
3230         * loader/cache/CachedRawResource.h:
3231         (isType): Ditto.
3232         * loader/cache/CachedResource.cpp:
3233         (WebCore::CachedResource::defaultPriorityForResourceType): Keep our current behavior and treat
3234         a favicon resource analogous to a raw resource.
3235         * loader/cache/CachedResource.h:
3236         (WebCore::CachedResource::isMainOrMediaOrFaviconOrRawResource): Renamed; formerly named isMainOrMediaOrRawResource.
3237         Also return true if the this resource is a favicon.
3238         (WebCore::CachedResource::ignoreForRequestCount): Keep our current behavior and treat a
3239         favicon resource analogous to a raw resource.
3240         (WebCore::CachedResource::isMainOrMediaOrRawResource): Deleted; renamed to isMainOrMediaOrFaviconOrRawResource.
3241         * loader/cache/CachedResourceLoader.cpp:
3242         (WebCore::createResource): Keep our current behavior and treat a favicon resource analogous
3243         to a raw resource.
3244         (WebCore::CachedResourceLoader::requestFavicon): Added.
3245         (WebCore::contentTypeFromResourceType): Keep our current behavior and treat a favicon
3246         resource analogous to a raw resource.
3247         (WebCore::CachedResourceLoader::checkInsecureContent): Ditto.
3248         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy): Check if the favicon is
3249         allowed by the CSP of the page.
3250         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Update for renaming.
3251         * loader/cache/CachedResourceLoader.h:
3252         * loader/icon/IconLoader.cpp:
3253         (WebCore::IconLoader::startLoading): Substitute call CachedResourceLoader::requestFavicon() for CachedResourceLoader::requestRawResource()
3254         and remove comment about ContentSecurityPolicyImposition::DoPolicyCheck being a placeholder. This is no longer the
3255         case. This resource request option is now meaningful as we want to apply the CSP of the page with respect to the
3256         request for the favicon.
3257
3258 2017-06-09  Wenson Hsieh  <wenson_hsieh@apple.com>
3259
3260         [iOS DnD] Add a hook to perform two-step drops in editable content
3261         https://bugs.webkit.org/show_bug.cgi?id=172992
3262         <rdar://problem/32590174>
3263
3264         Reviewed by Tim Horton.
3265
3266         Adds hooks in DragController::concludeEditDrag to give the client layer a chance to perform custom handling when
3267         dropping in editable content.
3268         Tests:  DataInteractionTests.InjectedBundleOverridePerformTwoStepDrop
3269                 DataInteractionTests.InjectedBundleAllowPerformTwoStepDrop
3270
3271         * loader/EmptyClients.cpp:
3272         * page/DragController.cpp:
3273         (WebCore::DragController::concludeEditDrag):
3274         * page/EditorClient.h:
3275
3276 2017-06-09  Matthew Hanson  <matthew_hanson@apple.com>
3277
3278         Revert r217955. rdar://problem/21125708
3279
3280 2017-06-06 Konstantin Tokarev  <annulen@yandex.ru>
3281
3282         [MediaFoundation] Volume controls of different media elements should be independent
3283         https://bugs.webkit.org/show_bug.cgi?id=172967
3284
3285         Based on patch by Vitaly Slobodin <vitaliy.slobodin@gmail.com>
3286         Reviewed by Alex Christensen.
3287
3288         IMFSimpleAudioVolume interface controls master volume of the
3289         application. We should use IMFAudioStreamVolume interface instead.
3290
3291         No new tests needed.
3292
3293         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3294         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
3295         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes):
3296         (WebCore::MediaPlayerPrivateMediaFoundation::setVolume):
3297         (WebCore::MediaPlayerPrivateMediaFoundation::setMuted):
3298         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3299
3300 2017-06-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
3301
3302         Image should clear its ImageObserver* when CachedImage releases the last reference to its RefCounted<ImageObserver>
3303         https://bugs.webkit.org/show_bug.cgi?id=173077
3304
3305         Reviewed by Simon Fraser.
3306
3307         Before dereferencing ImageObserver, CachedImage::clearImage() should check
3308         whether it is the only object that holds a reference to this ImageObserver.
3309         And if this is true, m_image have to clear its raw pointer to the deleted
3310         ImageObserver by calling m_image->setImageObserver(nullptr).
3311
3312         * loader/cache/CachedImage.cpp:
3313         (WebCore::CachedImage::setBodyDataFrom):
3314         (WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
3315         (WebCore::CachedImage::clearImage):
3316         * loader/cache/CachedImage.h:
3317
3318 2017-06-09  Frederic Wang  <fwang@igalia.com>
3319
3320         Add flag allow-popups-to-escape-sandbox to iframe sandbox
3321         https://bugs.webkit.org/show_bug.cgi?id=158875
3322
3323         Reviewed by Chris Dumez.
3324
3325         This patch adds support for the iframe@allow-popups-to-escape-sandbox attribute.
3326         This allows to pass more W3C Web Platform tests.
3327
3328         Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html
3329                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html
3330
3331         * dom/SecurityContext.cpp: Add allow-popups-to-escape-sandbox flag.
3332         (WebCore::SecurityContext::isSupportedSandboxPolicy):
3333         (WebCore::SecurityContext::parseSandboxPolicy):
3334         * dom/SecurityContext.h: Ditto.
3335         * loader/FrameLoader.cpp:
3336         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Do not force sandbox flags when we have allow-popups-to-escape-sandbox.
3337         (WebCore::createWindow): Ditto.
3338
3339 2017-06-09  Jer Noble  <jer.noble@apple.com>
3340
3341         [iOS] Video occasionally mixes with other system audio instead of interrupting
3342         https://bugs.webkit.org/show_bug.cgi?id=173127
3343
3344         Reviewed by Eric Carlson.
3345
3346         Tests: platform/mac/audio-session-category-video-track-change.html
3347
3348         When an HTMLMediaElement's tracks change their enabled state, make sure to update
3349         the PlatformMediaElement, for canProduceAudio() may have changed. 
3350
3351         * html/HTMLMediaElement.cpp:
3352         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
3353         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
3354         (PlatformMediaSessionManager::updateSessionState):
3355
3356         The rest of the changes in this revision are to allow the above to be testable.
3357
3358         * page/Settings.cpp:
3359         * page/Settings.h:
3360         * platform/audio/AudioSession.h:
3361         * platform/audio/mac/AudioSessionMac.cpp:
3362         (WebCore::AudioSession::category):
3363         (WebCore::AudioSession::setCategory):
3364         * testing/InternalSettings.cpp:
3365         (WebCore::InternalSettings::Backup::Backup):
3366         (WebCore::InternalSettings::Backup::restoreTo):
3367         (WebCore::InternalSettings::setShouldManageAudioSessionCategory):
3368         * testing/InternalSettings.h:
3369         * testing/InternalSettings.idl:
3370         * testing/Internals.cpp:
3371         (WebCore::Internals::audioSessionCategory):
3372         * testing/Internals.h:
3373         * testing/Internals.idl:
3374
3375 2017-06-09  Chris Dumez  <cdumez@apple.com>
3376
3377         CSS transitions added while page is not visible do not start when the page becomes visible
3378         https://bugs.webkit.org/show_bug.cgi?id=173166
3379         <rdar://problem/32250351>
3380
3381         Reviewed by Darin Adler.
3382
3383         CSS transitions added while page is not visible would not start when the page becomes
3384         visible. The issue was that when CompositeAnimation::updateTransitions() was called
3385         while the page is hidden (and animations are therefore suspended), it would not
3386         populate m_transations with ImplicitAnimation objects. We would therefore have later
3387         no transitions to resume when the page becomes visible later on. This patch updates
3388         CompositeAnimation::updateTransitions() to properly populate m_transitions and instead
3389         pause the ImplicitAnimation it creates if animations are currently suspended. This
3390         behavior is more consistent with the one of CompositeAnimation::updateKeyframeAnimations().
3391
3392         I also needed to update ImplicitAnimation::animate() to