[GTK] Update cookie manager API to properly work with ephemeral sessions
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [GTK] Update cookie manager API to properly work with ephemeral sessions
4         https://bugs.webkit.org/show_bug.cgi?id=168230
5
6         Reviewed by Michael Catanzaro.
7
8         Add implementation for deleteAllCookiesModifiedSince. Note that this only works when the timespan is 0, we need
9         new libsoup API to support removing recently modified cookies.
10
11         * platform/network/soup/CookieJarSoup.cpp:
12         (WebCore::deleteAllCookiesModifiedSince):
13
14 2017-02-14  Joseph Pecoraro  <pecoraro@apple.com>
15
16         [WebIDL] Improve serializer = { inherit }
17         https://bugs.webkit.org/show_bug.cgi?id=168293
18
19         Reviewed by Youenn Fablet.
20
21         * bindings/scripts/CodeGeneratorJS.pm:
22         (GenerateHeader):
23         Expose a serialize() method on the interface.
24
25         (GenerateSerializerFunction):
26         (GenerateSerializerAttributesForInterface): Deleted.
27         Subclasses that have `serializer = { inherit }` can use
28         their parent's serialize() method to get the initial object.
29         We can now collapse everything back into a single function
30         because we only generate code for our own attributes.
31
32         * bindings/scripts/test/JS/JSTestNode.cpp:
33         (WebCore::JSTestNode::serialize):
34         (WebCore::jsTestNodePrototypeFunctionToJSONCaller):
35         * bindings/scripts/test/JS/JSTestNode.h:
36         * bindings/scripts/test/JS/JSTestObj.cpp:
37         (WebCore::JSTestObj::serialize):
38         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
39         * bindings/scripts/test/JS/JSTestObj.h:
40         * bindings/scripts/test/JS/JSTestSerialization.cpp:
41         (WebCore::JSTestSerialization::serialize):
42         (WebCore::jsTestSerializationPrototypeFunctionToJSONCaller):
43         * bindings/scripts/test/JS/JSTestSerialization.h:
44         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
45         (WebCore::JSTestSerializationInherit::serialize):
46         (WebCore::jsTestSerializationInheritPrototypeFunctionToJSONCaller):
47         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
48         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
49         (WebCore::JSTestSerializationInheritFinal::serialize):
50         (WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSONCaller):
51         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
52         Updated results.
53
54 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
55
56         Move methods from WebCoreThread.h to WebCoreThreadInternal.h
57         https://bugs.webkit.org/show_bug.cgi?id=168326
58
59         Reviewed by Alexey Proskuryakov.
60
61         * platform/ios/wak/WebCoreThread.h: Move methods WebThreadRunLoop and WebThreadCurrentContext to WebCoreThreadInternal.h
62         * platform/ios/wak/WebCoreThreadInternal.h: Ditto.
63         * platform/ios/wak/WebCoreThreadRun.cpp: Removed WebCoreThread.h as it is already included by WebCoreThreadInternal.h
64         * platform/ios/wak/WKGraphics.mm: Included WebCoreThreadInternal.h, it subsequently includes WebCoreThread.h
65         * inspector/InspectorTimelineAgent.cpp: Ditto.
66         * page/mac/PageMac.mm: Ditto.
67         * platform/cf/MainThreadSharedTimerCF.cpp: Ditto.
68         * platform/cocoa/MemoryPressureHandlerCocoa.mm: Ditto.
69         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Ditto.
70         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Ditto.
71         * bindings/js/CommonVM.cpp: included WebCoreThreadInternal.h
72
73 2017-02-14  Wenson Hsieh  <wenson_hsieh@apple.com>
74
75         [WK2] Support data interaction on links
76         https://bugs.webkit.org/show_bug.cgi?id=168331
77         <rdar://problem/30200837>
78
79         Reviewed by Tim Horton.
80
81         Adds support for data interaction on links at the WebCore layer, refactoring some drag-and-drop code on the Mac
82         along the way. Also adds two new TestWebKitAPI unit tests in DataInteractionTests.mm: LinkToInput and
83         BackgroundImageLinkToInput (see Tools/ChangeLog for more information).
84
85         * page/DragController.cpp:
86         (WebCore::DragController::startDrag):
87         (WebCore::DragController::doImageDrag):
88         (WebCore::DragController::doSystemDrag):
89
90         Introduce platformAdjustDragImageForDeviceScaleFactor, and special-case drag images for links to anchor at the
91         bottom center.
92
93         * platform/DragImage.cpp:
94         (WebCore::platformAdjustDragImageForDeviceScaleFactor):
95
96         Scale the drag image up by the device scale factor. In WebDragClient, we scale the image back down to the
97         original size. It seems the reason we do this extra dance is because the image sizing heuristic in between
98         assumes that the image dimensions are for a non-retina device, but this work should really not be necessary if
99         we tweak the heuristic to account for deviceScaleFactor. We should address this in a separate patch.
100
101         * platform/DragImage.h:
102         * platform/graphics/Path.h:
103
104 2017-02-14  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
105
106         [CURL] ResourceError created with error information should have default type Type::General
107         https://bugs.webkit.org/show_bug.cgi?id=168345
108
109         Reviewed by Alex Christensen.
110
111         ResourceError has separate implementaion for each platform
112         so that the interface should be same.
113         On CURL port, the constructor with error information has
114         different default value on `type` parameter. It is Type::Null but other implementaitons have Type::General.
115         This causes some ResourceError is created inconsistent. 
116
117         * platform/network/curl/ResourceError.h:
118         (WebCore::ResourceError::ResourceError):
119
120 2017-02-14  Youenn Fablet  <youennf@gmail.com>
121
122         [WebRTC] Add support for libwebrtc negotiation needed event
123         https://bugs.webkit.org/show_bug.cgi?id=168267
124
125         Reviewed by Eric Carlson.
126
127         Test: webrtc/negotiatedneeded-event-addStream.html
128
129         Moving generic code (markAsNeedingNegotiation) from MediaEndpointPeerConnection to PeerConnectionBackend.
130         This code handles the control of sending or not the negotiationneeded event.
131
132         Updating mock to use markAsNeedingNegotiation when streams are changed.
133         Updating libwebrtc backend to call markAsNeedingNegotiation when required by libwebrtc implementation.
134
135         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
136         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
137         * Modules/mediastream/MediaEndpointPeerConnection.h:
138         * Modules/mediastream/PeerConnectionBackend.cpp:
139         (WebCore::PeerConnectionBackend::markAsNeedingNegotiation):
140         * Modules/mediastream/PeerConnectionBackend.h:
141         (WebCore::PeerConnectionBackend::isNegotiationNeeded):
142         (WebCore::PeerConnectionBackend::clearNegotiationNeededState):
143         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
144         (WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded):
145         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
146         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
147         * testing/MockLibWebRTCPeerConnection.cpp:
148         (WebCore::MockLibWebRTCPeerConnection::AddStream):
149         (WebCore::MockLibWebRTCPeerConnection::RemoveStream):
150
151 2017-02-14  Brady Eidson  <beidson@apple.com>
152
153         Unreviewed followup to r212330 to fix Debug builds
154
155         * loader/DocumentThreadableLoader.cpp:
156         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Add call to relaxAdoptionRequirement().
157
158 2017-02-14  Matt Rajca  <mrajca@apple.com>
159
160         Website policies: iframes should respect the autoplay policy of the top-level document
161         https://bugs.webkit.org/show_bug.cgi?id=168333
162
163         Reviewed by Alex Christensen.
164
165         API tests were added.
166
167         * html/HTMLMediaElement.cpp:
168         (WebCore::HTMLMediaElement::HTMLMediaElement):
169
170 2017-02-14  Dean Jackson  <dino@apple.com>
171
172         Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
173         https://bugs.webkit.org/show_bug.cgi?id=168339
174         <rdar://problem/30522092>
175
176         Reviewed by Simon Fraser.
177
178         Use a setting name that more clearly reflects what it is doing. It's not
179         preferring to use the low-power GPU, it's forcing it.
180
181         * html/canvas/WebGLRenderingContextBase.cpp:
182         (WebCore::WebGLRenderingContextBase::create):
183         * page/Settings.in:
184
185 2017-02-14  Brady Eidson  <beidson@apple.com>
186
187         Speculative fix for: Crash in DocumentThreadableLoader::redirectReceived.
188         <rdar://problem/29899473> and https://bugs.webkit.org/show_bug.cgi?id=168337
189
190         Reviewed by Geoffrey Garen.
191
192         No new tests (Unable to find a reproduction).
193
194         * loader/DocumentThreadableLoader.cpp:
195         (WebCore::DocumentThreadableLoader::loadRequest):
196
197 2017-02-14  Youenn Fablet  <youenn@apple.com>
198
199         [WebRTC] Remove obsolete WebRTC stats API
200         https://bugs.webkit.org/show_bug.cgi?id=167910
201
202         Reviewed by Alex Christensen.
203
204         No change of behavior as removed constructs are not functional.
205         Removing RTCStatsResponse which no longer exists and made RTCStatsReport an empty container for now.
206
207         * CMakeLists.txt:
208         * DerivedSources.cpp:
209         * DerivedSources.make:
210         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
211         (WebCore::MediaEndpointPeerConnection::getStats):
212         * Modules/mediastream/MediaEndpointPeerConnection.h:
213         * Modules/mediastream/PeerConnectionBackend.h:
214         * Modules/mediastream/RTCPeerConnection.cpp:
215         (WebCore::RTCPeerConnection::getStats):
216         * Modules/mediastream/RTCStatsReport.cpp:
217         (WebCore::RTCStatsReport::create): Deleted.
218         (WebCore::RTCStatsReport::RTCStatsReport): Deleted.
219         (WebCore::RTCStatsReport::names): Deleted.
220         (WebCore::RTCStatsReport::local): Deleted.
221         (WebCore::RTCStatsReport::remote): Deleted.
222         (WebCore::RTCStatsReport::addStatistic): Deleted.
223         * Modules/mediastream/RTCStatsReport.h:
224         (WebCore::RTCStatsReport::create):
225         (WebCore::RTCStatsReport::timestamp): Deleted.
226         (WebCore::RTCStatsReport::id): Deleted.
227         (WebCore::RTCStatsReport::type): Deleted.
228         (WebCore::RTCStatsReport::stat): Deleted.
229         * Modules/mediastream/RTCStatsReport.idl:
230         * Modules/mediastream/RTCStatsResponse.cpp: Removed.
231         * Modules/mediastream/RTCStatsResponse.h: Removed.
232         * Modules/mediastream/RTCStatsResponse.idl: Removed.
233         * WebCore.xcodeproj/project.pbxproj:
234         * platform/mediastream/MediaEndpoint.h:
235         (WebCore::MediaEndpoint::getStats):
236         * platform/mediastream/RTCStatsRequest.h: Removed.
237         * platform/mediastream/RTCStatsResponseBase.h: Removed.
238
239 2017-02-14  Karim H  <karim@karhm.com>
240
241         Removed unused methods of WebCore::FileStream
242         https://bugs.webkit.org/show_bug.cgi?id=168025
243
244         Reviewed by Michael Catanzaro.
245
246         * fileapi/AsyncFileStream.cpp:
247         (WebCore::AsyncFileStream::openForWrite): Deleted.
248         (WebCore::AsyncFileStream::write): Deleted.
249         (WebCore::AsyncFileStream::truncate): Deleted.
250         * fileapi/AsyncFileStream.h:
251         * platform/FileStream.cpp:
252         (WebCore::FileStream::openForWrite): Deleted.
253         (WebCore::FileStream::write): Deleted.
254         (WebCore::FileStream::truncate): Deleted.
255         * platform/FileStream.h:
256
257 2017-02-14  Chris Dumez  <cdumez@apple.com>
258
259         HTML Form Validation bubble should take minimum font size setting into consideration
260         https://bugs.webkit.org/show_bug.cgi?id=168271
261         <rdar://problem/29869869>
262
263         Reviewed by Simon Fraser.
264
265         HTML Form Validation bubble should take minimum font size setting into consideration
266         for better accessibility.
267
268         Test: fast/forms/validation-message-minimum-font-size.html
269
270         * platform/ValidationBubble.h:
271         (WebCore::ValidationBubble::create):
272         (WebCore::ValidationBubble::fontSize):
273         * platform/ios/ValidationBubbleIOS.mm:
274         (WebCore::ValidationBubble::ValidationBubble):
275         * platform/mac/ValidationBubbleMac.mm:
276         (WebCore::ValidationBubble::ValidationBubble):
277         Update the ValidationBubble constructor to take in Settings. For now, there is a
278         single setting that is the minimum font size and that is taken into account when
279         setting the font size of the validation bubble text.
280
281 2017-02-14  Eric Carlson  <eric.carlson@apple.com>
282
283         [MediaStream] add navigator.getUserMedia for compatibility with legacy content
284         https://bugs.webkit.org/show_bug.cgi?id=168324
285         <rdar://problem/30513125>
286
287         Reviewed by Youenn Fablet.
288
289         Tests: fast/mediastream/argument-types.html
290                fast/mediastream/getusermedia.html
291                fast/mediastream/webkitGetUserMedia-shadowing-then.html
292
293         * CMakeLists.txt:
294         * DerivedSources.cpp:
295         * DerivedSources.make:
296         * Modules/mediastream/MediaDevices.idl:
297         * Modules/mediastream/NavigatorUserMedia.idl: Added.
298         * Modules/mediastream/NavigatorUserMedia.js: Added.
299         * WebCore.xcodeproj/project.pbxproj:
300         * bindings/js/WebCoreBuiltinNames.h:
301         * page/Navigator.idl:
302
303 2017-02-14  Chris Dumez  <cdumez@apple.com>
304
305         Fallback to legacy type only when event is trusted
306         https://bugs.webkit.org/show_bug.cgi?id=168301
307
308         Reviewed by Ryosuke Niwa.
309
310         Fallback to legacy type only when event is trusted as per a recent
311         DOM specification change:
312         - https://github.com/whatwg/dom/issues/404
313         - https://github.com/whatwg/dom/pull/406
314
315         No new tests, rebaselined existing test.
316
317         * dom/EventTarget.cpp:
318         (WebCore::legacyType):
319         (WebCore::EventTarget::fireEventListeners):
320
321 2017-02-13  Dean Jackson  <dino@apple.com>
322
323         Rename preferLowPowerToHighPerformance to powerPreference
324         https://bugs.webkit.org/show_bug.cgi?id=168269
325         <rdar://problem/30504444>
326
327         Reviewed by Chris Dumez.
328
329         Based on the discussion in https://github.com/KhronosGroup/WebGL/pull/2283.
330
331         Change WebGLContextAttributes's preferLowPowerToHighPerformance boolean
332         into a powerPreference enum taking three values. The implementation
333         of the enum is in GraphicsContext3DAttributes.
334
335         While the name and values have changed, there should be no change in
336         behaviour caused by this patch.
337
338         * html/canvas/WebGLContextAttributes.h: Use GraphicsContext3DAttributes
339         enum GraphicsContext3DPowerPreference.
340         * html/canvas/WebGLContextAttributes.idl: Rename and add the WebIDL enum.
341         * html/canvas/WebGLRenderingContextBase.cpp: Use the new values.
342         (WebCore::WebGLRenderingContextBase::create):
343         (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
344         * platform/WebGLStateTracker.cpp:
345         * platform/WebGLStateTracker.h: Update the state tracker to use the new
346         values.
347         * platform/graphics/GraphicsContext3DAttributes.h:
348         * platform/graphics/mac/GraphicsContext3DMac.mm:
349         (WebCore::setPixelFormat): Accept GraphicsContext3DPowerPreference as a parameter.
350         (WebCore::GraphicsContext3D::GraphicsContext3D):
351
352 2017-02-14  Youenn Fablet  <youennf@gmail.com>
353
354         [WebRTC] Implement description getters for libwebrtc RTCPeerConnection
355         https://bugs.webkit.org/show_bug.cgi?id=168234
356
357         Reviewed by Alex Christensen.
358
359         Allows passing W3C webrtc tests.
360
361         Implementing localDescription/remoteDescription using libwebrtc backend.
362         current and pending description getters are made the same as local/remote getters for the moment.
363         This should be fixed when upgrading to latest libwebrtc revision.
364
365         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
366         (WebCore::toSessionDescriptionType):
367         (WebCore::fromSessionDescriptionType):
368         (WebCore::fromSessionDescription):
369         (WebCore::LibWebRTCMediaEndpoint::localDescription):
370         (WebCore::LibWebRTCMediaEndpoint::remoteDescription):
371         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
372         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
373         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
374         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
375         (WebCore::LibWebRTCPeerConnectionBackend::localDescription):
376         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
377
378 2017-02-14  Jeremy Jones  <jeremyj@apple.com>
379
380         When playing inline after fullscreen, set a flag instead of adding attribute plays inline, and use in requiresFullscreenForVideoPlayback.
381         https://bugs.webkit.org/show_bug.cgi?id=167815
382         rdar://problem/27685077
383
384         Reviewed by Jer Noble.
385
386         Test: media/media-fullscreen-loop-inline.html
387
388         When video is allowed to play inline after fullscreen. Looped video causes play state to update, which can send video back to fullscreen when
389         allowsInline is false. This change will set a new flag when allowsInlineMediaPlaybackAfterFullscreen allows inline playback that can be tested
390         in requiresFullscreenForVideoPlayback to prevent sending video back into fullscreen when video loops.
391
392         * html/HTMLMediaElement.cpp:
393         (WebCore::HTMLMediaElement::enterFullscreen):
394         (WebCore::HTMLMediaElement::exitFullscreen):
395         * html/HTMLMediaElement.h:
396         (WebCore::HTMLMediaElement::isTemporarilyAllowingInlinePlaybackAfterFullscreen): Added.
397         * html/MediaElementSession.cpp:
398         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
399
400 2017-02-14  Jer Noble  <jer.noble@apple.com>
401
402         Video elements with MediaSource objects set by srcObject are not cleared when srcObject is set to null
403         https://bugs.webkit.org/show_bug.cgi?id=168268
404
405         Reviewed by Eric Carlson.
406
407         Test: fast/mediastream/MediaStream-MediaElement-setObject-null.html
408
409         Make the setSrcObject() operation compliant with the HTML spec. Since the specification defines
410         srcObject in terms of either a MediaSource, MediaStream, or Blob object, add the variant typedef
411         to HTMLMediaElement and move the definition out of the Modules/mediastream extension IDL and into
412         HTMLMediaElement.idl. Then bring the "media elements load" and "resource selection" algorithms up
413         to their most recent definitions in the HTML5 spec.
414
415         Drive-by fix: Allow the (admittedly weird) single-element-union type in IDL.
416
417         * CMakeLists.txt:
418         * DerivedSources.cpp:
419         * DerivedSources.make:
420         * Modules/mediastream/HTMLMediaElementMediaStream.cpp: Removed.
421         * Modules/mediastream/HTMLMediaElementMediaStream.h: Removed.
422         * Modules/mediastream/HTMLMediaElementMediaStream.idl: Removed.
423         * WebCore.xcodeproj/project.pbxproj:
424         * bindings/scripts/IDLParser.pm:
425         (parseUnionType):
426         * html/HTMLAudioElement.cpp:
427         (WebCore::HTMLAudioElement::createForJSConstructor):
428         * html/HTMLMediaElement.cpp:
429         (WebCore::actionName):
430         (WebCore::HTMLMediaElement::parseAttribute):
431         (WebCore::HTMLMediaElement::insertedInto):
432         (WebCore::HTMLMediaElement::scheduleDelayedAction):
433         (WebCore::HTMLMediaElement::scheduleNextSourceChild):
434         (WebCore::HTMLMediaElement::pendingActionTimerFired):
435         (WebCore::HTMLMediaElement::setSrcObject):
436         (WebCore::HTMLMediaElement::load):
437         (WebCore::HTMLMediaElement::prepareForLoad):
438         (WebCore::HTMLMediaElement::selectMediaResource):
439         (WebCore::HTMLMediaElement::loadResource):
440         (WebCore::HTMLMediaElement::playInternal):
441         (WebCore::HTMLMediaElement::pauseInternal):
442         (WebCore::HTMLMediaElement::sourceWasAdded):
443         (WebCore::HTMLMediaElement::clearMediaPlayer):
444         (WebCore::HTMLMediaElement::resume):
445         (WebCore::HTMLMediaElement::mediaCanStart):
446         (WebCore::HTMLMediaElement::createMediaPlayer):
447         (WebCore::HTMLMediaElement::loadInternal): Deleted.
448         * html/HTMLMediaElement.h:
449         (WebCore::HTMLMediaElement::srcObject):
450         * html/HTMLMediaElement.idl:
451         * platform/ContentType.h:
452
453 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
454
455         Remove unused WebThreadContextIsCurrent method from WebCoreThread.h
456         https://bugs.webkit.org/show_bug.cgi?id=168254
457
458         Reviewed by Dan Bernstein.
459
460         * platform/ios/wak/WebCoreThread.h: Removed unused WebThreadContextIsCurrent.
461         * platform/ios/wak/WebCoreThread.mm:
462         (WebThreadContextIsCurrent): Deleted.
463
464 2017-02-14  Alexey Proskuryakov  <ap@apple.com>
465
466         WebCore shouldn't export SystemMemory.h
467         https://bugs.webkit.org/show_bug.cgi?id=168285
468
469         Reviewed by Alex Christensen.
470
471         * WebCore.xcodeproj/project.pbxproj:
472
473 2017-02-13  Filip Pizlo  <fpizlo@apple.com>
474
475         worker.postMessage should throw a TypeError if a SharedArrayBuffer is in the transfer list
476         https://bugs.webkit.org/show_bug.cgi?id=168277
477
478         Reviewed by Mark Lam.
479
480         Test: workers/sab/postMessage-transfer-type-error.html
481         
482         This is a simple spec compliance change. The title says it all.
483
484         * bindings/js/SerializedScriptValue.cpp:
485         (WebCore::SerializedScriptValue::create):
486
487 2017-02-14  Zan Dobersek  <zdobersek@igalia.com>
488
489         HTMLMediaElement: WebKitMediaKeys member name should be prefixed
490         https://bugs.webkit.org/show_bug.cgi?id=168297
491
492         Reviewed by Xabier Rodriguez-Calvar.
493
494         Rename the LEGACY_ENCRYPTED_MEDIA m_mediaKeys variable to m_webkitMediaKeys
495         so that it contains the legacy prefix, just like the API. This will make
496         room for the MediaKeys member variable that will be implemented under
497         the ENCRYPTED_MEDIA guards.
498
499         * html/HTMLMediaElement.cpp:
500         (WebCore::HTMLMediaElement::mediaPlayerCachedKeyForKeyId):
501         (WebCore::HTMLMediaElement::webkitSetMediaKeys):
502         * html/HTMLMediaElement.h:
503         (WebCore::HTMLMediaElement::webkitKeys):
504
505 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
506
507         [GTK] Make DragImageRef a RefPtr instead of a plain pointer
508         https://bugs.webkit.org/show_bug.cgi?id=168296
509
510         Reviewed by Sergio Villar Senin.
511
512         Use RefPtr<cairo_surface_t> as DragImageRef for GTK+ port to avoid memory leaks.
513
514         * platform/DragImage.h:
515         * platform/gtk/DragImageGtk.cpp:
516         (WebCore::dragImageSize):
517         (WebCore::deleteDragImage):
518         (WebCore::scaleDragImage):
519         (WebCore::dissolveDragImageToFraction):
520         (WebCore::createDragImageFromImage):
521         (WebCore::createDragImageIconForCachedImageFilename):
522
523 2017-02-14  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
524
525         [GStreamer][MSE] Some GStreamer log messages are generated with the 'default' category
526         https://bugs.webkit.org/show_bug.cgi?id=168015
527
528         Reviewed by Xabier Rodriguez-Calvar.
529
530         The elements AppendPipeline, PlaybackPipeline, MediaSourceClientGstreamerMSE do not have
531         a defined Gstreamer log category, then the webkitmse category has been added to them.
532         WebKitMediaSourceGstreamer has its own category but was not declared at the beginning of
533         the .cpp file.
534
535         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added webkitmse category.
536         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
537         Added webkitmse category and gst header.
538         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added webkitmse category.
539         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
540         Added webkitmediasrc category.
541
542 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
543
544         CookieManager only works with the default session
545         https://bugs.webkit.org/show_bug.cgi?id=168229
546
547         Reviewed by Alex Christensen.
548
549         Update cookie observer API to use a std::function instead of a function pointer and make it work with multiple
550         sessions in the backends that support it.
551
552         * platform/network/CookieStorage.h:
553         * platform/network/cf/CookieStorageCFNet.cpp:
554         (WebCore::cookieChangeCallbackMap):
555         (WebCore::notifyCookiesChanged):
556         (WebCore::startObservingCookieChanges):
557         (WebCore::stopObservingCookieChanges):
558         * platform/network/mac/CookieStorageMac.mm:
559         (-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]):
560         (-[WebCookieStorageObjCAdapter stopListeningForCookieChangeNotifications]):
561         (WebCore::startObservingCookieChanges):
562         (WebCore::stopObservingCookieChanges):
563         * platform/network/soup/CookieStorageSoup.cpp:
564         (WebCore::cookieChangeCallbackMap):
565         (WebCore::soupCookiesChanged):
566         (WebCore::startObservingCookieChanges):
567         (WebCore::stopObservingCookieChanges):
568
569 2017-02-13  Antoine Quint  <graouts@apple.com>
570
571         REGRESSION: Update volume and scrubbing slider to match HI designs
572         https://bugs.webkit.org/show_bug.cgi?id=168170
573         <rdar://problem/28095266>
574
575         Reviewed by Dean Jackson.
576
577         We bring the designs of the control's background materials, scrubber and
578         volume slider up to spec.
579
580         The first important set of changes is that, on macOS, the materials and colors
581         were incorrect. Buttons and time labels now set a mix-blend-mode to correctly
582         appear vibrant against the media, and the controls bar, volume container
583         and tracks menu now use a new BackgroundTint node to correctly apply both
584         a backdrop-filter and blended tint above it.
585
586         The second important set of changes is the rendering of the sliders. Up to now
587         we would simply style the <input type="range"> track and thumb, applying solid
588         fills and strokes. We now draw sliders in two ways depending on the platform.
589         
590         On macOS, we draw the whole slider with a <canvas> element with "mix-blend-mode"
591         set to "plus-lighter". On iOS, we draw the track as a <div> with "mix-blend-mode"
592         set to "plus-darker" and draw the fill (up to the thumb) in the <canvas> with
593         no blend mode to obtain a pure white color, finally the thumb is rendered by the
594         <input> element. We couldn't draw the pure white color with the track in the
595         same <canvas> due to the "plus-darker" blend mode.
596
597         Test: media/modern-media-controls/background-tint/background-tint.html
598
599         * Modules/modern-media-controls/controls/airplay-button.css:
600         (button.airplay.on):
601         * Modules/modern-media-controls/controls/background-tint.css: Added.
602         (.background-tint):
603         (.background-tint,):
604         (.background-tint > .blur):
605         (.background-tint > .tint):
606         * Modules/modern-media-controls/controls/background-tint.js: Added.
607         (BackgroundTint):
608         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
609         (.media-controls.ios.inline .scrubber.slider):
610         (.media-controls.ios.inline .scrubber.slider > div):
611         (.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
612         (.media-controls.ios.inline .scrubber.slider > .fill): Deleted.
613         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
614         (.media-controls.mac.inline.compact .volume-slider-container):
615         (.media-controls.mac.inline.compact .volume.slider):
616         (.media-controls.mac.inline.compact .scrubber.slider > input::-webkit-slider-thumb): Deleted.
617         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
618         (.media-controls.mac.fullscreen > .controls-bar):
619         (.media-controls.mac.fullscreen > .controls-bar > .background-tint > div):
620         (.media-controls.mac.fullscreen .volume.slider):
621         (.media-controls.mac.fullscreen button.volume-up):
622         (.media-controls.mac.fullscreen button.rewind):
623         (.media-controls.mac.fullscreen button.forward):
624         (.media-controls.mac.fullscreen .buttons-container.right button):
625         (.media-controls.mac.fullscreen .scrubber):
626         (.media-controls.mac.fullscreen > .controls-bar button): Deleted.
627         (.media-controls.mac.fullscreen button.airplay): Deleted.
628         (.media-controls.mac.fullscreen button.aspect-ratio): Deleted.
629         (.media-controls.mac.fullscreen button.pip): Deleted.
630         (.media-controls.mac.fullscreen button.tracks): Deleted.
631         (.media-controls.mac.fullscreen button.fullscreen): Deleted.
632         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
633         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
634         (.media-controls.mac.inline .scrubber.slider):
635         (.media-controls.mac.inline .volume-slider-container):
636         (.media-controls.mac.inline .volume-slider-container > .background-tint):
637         (.media-controls.mac.inline .volume-slider-container > .background-tint > div):
638         (.media-controls.mac.inline .volume.slider):
639         (.media-controls.mac.inline button): Deleted.
640         (.media-controls.mac.inline button:active): Deleted.
641         (.media-controls.mac.inline > .controls-bar button): Deleted.
642         (.media-controls.mac.inline > .controls-bar,): Deleted.
643         (.media-controls.mac.inline .volume-slider-container:before): Deleted.
644         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
645         (MacOSInlineMediaControls.prototype.layout):
646         * Modules/modern-media-controls/controls/macos-media-controls.css: Added.
647         (.media-controls.mac button:active):
648         (.media-controls.mac > .controls-bar button):
649         (.media-controls.mac > .controls-bar .time-label):
650         (.media-controls.mac > .controls-bar .slider > canvas):
651         (.media-controls.mac > .controls-bar .slider > input::-webkit-slider-thumb):
652         * Modules/modern-media-controls/controls/scrubber.css: Removed.
653         * Modules/modern-media-controls/controls/scrubber.js:
654         (Scrubber):
655         (Scrubber.prototype.get buffered):
656         (Scrubber.prototype.set buffered):
657         (Scrubber.prototype.draw):
658         (Scrubber.prototype._drawMacOS):
659         (Scrubber.prototype._drawiOS):
660         * Modules/modern-media-controls/controls/slider.css:
661         (.slider):
662         (.slider > canvas,):
663         (.slider > canvas):
664         (.slider > input):
665         (.slider > input,): Deleted.
666         (.slider > .fill): Deleted.
667         (.slider > input::-webkit-slider-thumb): Deleted.
668         * Modules/modern-media-controls/controls/slider.js:
669         (Slider.prototype.set value):
670         (Slider.prototype.set width):
671         (Slider.prototype.commitProperty):
672         (Slider.prototype.layout):
673         (Slider.prototype.draw):
674         (Slider.prototype._handleInputEvent):
675         (Slider.prototype._handleChangeEvent):
676         (addRoundedRect):
677         (Slider.prototype._updateFill): Deleted.
678         * Modules/modern-media-controls/controls/start-button.css:
679         (button.start):
680         * Modules/modern-media-controls/controls/time-control.js:
681         * Modules/modern-media-controls/controls/time-label.css:
682         (.time-label):
683         * Modules/modern-media-controls/controls/tracks-panel.css:
684         (.tracks-panel):
685         (.tracks-panel > .background-tint > div):
686         (.tracks-panel > section):
687         (.tracks-panel > section:first-of-type):
688         (.tracks-panel > section > h3):
689         (.tracks-panel > section > ul):
690         (.tracks-panel > section > ul > li):
691         (.tracks-panel > section > ul > li:focus):
692         (.tracks-panel > section > ul > li.selected:before):
693         (.tracks-panel > section > ul > li.animated):
694         (.tracks-panel-section): Deleted.
695         (.tracks-panel-section:first-of-type): Deleted.
696         (.tracks-panel-section > h3): Deleted.
697         (.tracks-panel-section > ul): Deleted.
698         (.tracks-panel-section > ul > li): Deleted.
699         (.tracks-panel-section > ul > li:focus): Deleted.
700         (.tracks-panel-section > ul > li.selected:before): Deleted.
701         (.tracks-panel-section > ul > li.animated): Deleted.
702         * Modules/modern-media-controls/controls/tracks-panel.js:
703         (TracksPanel.prototype._childrenFromDataSource):
704         (TracksPanel.prototype._childrenFromDataSource.): Deleted.
705         * Modules/modern-media-controls/controls/volume-slider.js:
706         (VolumeSlider):
707         (VolumeSlider.prototype.handleEvent):
708         (VolumeSlider.prototype.draw):
709         * Modules/modern-media-controls/js-files:
710         * Modules/modern-media-controls/media/scrubbing-support.js:
711         (ScrubbingSupport.prototype.get mediaEvents):
712         (ScrubbingSupport.prototype.syncControl):
713         (ScrubbingSupport):
714
715 2017-02-13  Alex Christensen  <achristensen@webkit.org>
716
717         URLs with an invalid IPv4 address should be invalid
718         https://bugs.webkit.org/show_bug.cgi?id=168260
719
720         Reviewed by Tim Horton.
721
722         All URL hosts are fed through the IPv4 parser.  https://webkit.org/ doesn't
723         look enough like an IPv4 address to be considered an invalid IPv4 address, so 
724         we continue to the String host processing.  http://127.0.0.257 does, though, and
725         according to https://url.spec.whatwg.org/#concept-ipv4-parser parsing that URL
726         should fail.
727
728         Covered by newly passing web platform tests.
729
730         * platform/URLParser.cpp:
731         (WebCore::URLParser::parseIPv4Host):
732         (WebCore::URLParser::parseHostAndPort):
733         * platform/URLParser.h:
734
735 2017-02-13  Dan Bernstein  <mitz@apple.com>
736
737         Reverted r212275. It still breaks some Apple-internal builds.
738
739         * platform/spi/mac/TUCallSPI.h:
740
741 2017-02-13  Joseph Pecoraro  <pecoraro@apple.com>
742
743         Address ESLint warnings in modern-media-controls
744         https://bugs.webkit.org/show_bug.cgi?id=168224
745
746         Reviewed by Alexey Proskuryakov.
747
748         * Modules/modern-media-controls/controls/controls-bar.js:
749         * Modules/modern-media-controls/controls/fullscreen-button.js:
750         * Modules/modern-media-controls/controls/layout-node.js:
751         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
752         * Modules/modern-media-controls/controls/media-controls.js:
753         * Modules/modern-media-controls/controls/scheduler.js:
754         * Modules/modern-media-controls/controls/seek-button.js:
755         * Modules/modern-media-controls/controls/tracks-panel.js:
756         * Modules/modern-media-controls/controls/volume-slider.js:
757         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
758         * Modules/modern-media-controls/gesture-recognizers/pinch.js:
759         * Modules/modern-media-controls/media/fullscreen-support.js:
760         * Modules/modern-media-controls/media/media-controller.js:
761         * Modules/modern-media-controls/media/placard-support.js:
762         * Modules/modern-media-controls/media/status-support.js:
763         Address pedantic warnings.
764
765 2017-02-13  Dan Bernstein  <mitz@apple.com>
766
767         Restored changes from r212210 in a way that does not break the build.
768
769         * platform/spi/mac/TUCallSPI.h:
770
771 2017-02-13  Zalan Bujtas  <zalan@apple.com>
772
773         FontCascade::widthForSimpleText should skip applyTransforms() when kerning and ligatures are off.
774         https://bugs.webkit.org/show_bug.cgi?id=168251
775         <rdar://problem/30498102>
776
777         Reviewed by Antti Koivisto.
778
779         Covered by existing (perf)tests.
780
781         * platform/graphics/FontCascade.cpp:
782         (WebCore::FontCascade::widthForSimpleText):
783
784 2017-02-12  Brian Burg  <bburg@apple.com>
785
786         Web Inspector: expose system user interface layout direction through InspectorFrontendHost
787         https://bugs.webkit.org/show_bug.cgi?id=168209
788         <rdar://problem/11573736>
789
790         Reviewed by Joseph Pecoraro.
791
792         Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
793         properly set the UI directionality from system settings in PageClient, this will get inherited
794         automatically by the Inspector's WebPage instance.
795
796         * inspector/InspectorFrontendClient.h:
797         * inspector/InspectorFrontendClientLocal.cpp:
798         (WebCore::InspectorFrontendClientLocal::userInterfaceLayoutDirection):
799         * inspector/InspectorFrontendClientLocal.h:
800
801         * inspector/InspectorFrontendHost.h:
802         * inspector/InspectorFrontendHost.idl:
803         * inspector/InspectorFrontendHost.cpp:
804         (WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
805         Expose the directionality to the frontend as "ltr" or "rtl" strings.
806
807 2017-02-13  Zalan Bujtas  <zalan@apple.com>
808
809         Simple line layout: Do not measure runs with trailing whitespace when kerning and ligatures are off.
810         https://bugs.webkit.org/show_bug.cgi?id=168247
811         <rdar://problem/30497288>
812
813         Reviewed by Antti Koivisto.
814
815         The width of the run is supposed to be the same with or without the trailing whitespace.
816
817         Covered by performance test.
818
819         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
820         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
821         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
822         * rendering/SimpleLineLayoutTextFragmentIterator.h:
823
824 2017-02-13  Karim H  <karim@karhm.com>
825
826         Added the other missing BSTR roles tag names.
827         https://bugs.webkit.org/show_bug.cgi?id=165545
828
829         Reviewed by Chris Fleizach.
830
831         Test: accessibility/win/bstr-elements-role.html
832
833         * accessibility/AccessibilityRenderObject.cpp:
834         (WebCore::shouldReturnTagNameAsRoleForMSAA):
835
836 2017-02-13  Youenn Fablet  <youennf@gmail.com>
837
838         [WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
839         https://bugs.webkit.org/show_bug.cgi?id=168250
840
841         Reviewed by Alex Christensen.
842
843         Covered by webrtc tests in LayoutTests and in web-platform-tests.
844         Making mock peer connection factory keep a ref of the real libwebrtc peer connection factory.
845         That way, it can create real libwebrtc backends whenever requested by tests.
846
847         Moving LibWebRTCUtils.h routines as static LibWebRTCProvider methods.
848         In the future, we should make them no longer static.
849
850         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
851         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
852         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
853         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
854         * WebCore.xcodeproj/project.pbxproj:
855         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp.
856         (WebCore::LibWebRTCProvider::callOnWebRTCNetworkThread):
857         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
858         (WebCore::LibWebRTCProvider::factory):
859         (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
860         (WebCore::createActualPeerConnection):
861         (WebCore::LibWebRTCProvider::createPeerConnection):
862         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
863         * platform/mediastream/libwebrtc/LibWebRTCUtils.h: Removed.
864         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
865         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
866         * testing/Internals.cpp:
867         * testing/MockLibWebRTCPeerConnection.cpp:
868         (WebCore::useMockRTCPeerConnectionFactory):
869         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
870         (WebCore::releaseInNetworkThread):
871         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
872         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
873         (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
874         (WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
875
876 2017-02-13  Anders Carlsson  <andersca@apple.com>
877
878         Simplify DragController::startDrag
879         https://bugs.webkit.org/show_bug.cgi?id=168240
880
881         Reviewed by Tim Horton.
882
883         Use early returns instead of assigning to a variable that's returned at the end of the function.
884
885         * page/DragController.cpp:
886         (WebCore::DragController::startDrag):
887
888 2017-02-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
889
890         The current frame of an image should not deleted if another frame is asynchronously being decoded
891         https://bugs.webkit.org/show_bug.cgi?id=167618
892
893         Reviewed by Simon Fraser.
894
895         Test: fast/images/animated-image-draw-while-decode.html
896
897         If the memory cache asks the BitmapImage to destroy all its frames while
898         the next frame is being decoded, a thread contention may happen. This can
899         happen when BitmapImage::draw() is called and the next frame is not ready
900         yet for drawing, so the current frame has to be drawn. This will invoke
901         a frame decoding in the same image from the drawing committing thread.
902
903         We can avoid that by destroying all the frames except the current frame if
904         the image is asynchronously decoding its frames. This should not add extra
905         memory overhead because building the image frame cache and then destroying
906         it, when needed, is an on-going process. The frames will be allocated and
907         decoded all the time and all of them can be destroyed except the current one.
908         
909         * platform/graphics/BitmapImage.cpp:
910         (WebCore::BitmapImage::destroyDecodedData):
911         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
912         The logic of destroying the ImageFrames was split among BitmapImage, ImageSource
913         and ImageFrameCache. Move all the logic to BitmapImage and have ImageFrameCache
914         be responsible only for destroying a range of ImageFrames.
915
916         (WebCore::BitmapImage::draw): add an ASSERT_IMPLIES to ensure the current frame
917         is ready to be rendered if the next frame is being decoded.
918         
919         * platform/graphics/BitmapImage.h: Move a const from ImageFrameCache.h to BitmapImage.h.
920
921         * platform/graphics/ImageFrameCache.cpp:
922         (WebCore::ImageFrameCache::destroyDecodedData):
923         (WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Deleted.
924         * platform/graphics/ImageFrameCache.h:
925         (WebCore::ImageFrameCache::destroyAllDecodedData):
926         (WebCore::ImageFrameCache::destroyAllDecodedDataExcludeFrame):
927         (WebCore::ImageFrameCache::destroyDecodedDataBeforeFrame):
928         Make ImageFrameCache be responsible for destroying a range of ImageFrames.
929         This range might include all the frames, all the frames but up to a specific
930         frame, or all the frames but exclude one frame in the middle.
931         
932         * platform/graphics/ImageSource.cpp:
933         (WebCore::ImageSource::clear): No need to call clearFrameBufferCache() from clear().
934         The decision to call clearFrameBufferCache() or clear() is moved to
935         BitmapImage::destroyDecodedData().
936          
937         (WebCore::ImageSource::destroyDecodedData): Deleted.
938         (WebCore::ImageSource::destroyDecodedDataIfNecessary): Deleted.
939         These functions are replaced by another set of functions in ImageSource.h.
940         
941         * platform/graphics/ImageSource.h:
942         (WebCore::ImageSource::destroyAllDecodedData):
943         (WebCore::ImageSource::destroyAllDecodedDataExcludeFrame):
944         (WebCore::ImageSource::destroyDecodedDataBeforeFrame):
945         (WebCore::ImageSource::hasDecodingQueue):
946         These are new wrappers which call the corresponding ImageFrameCache functions.
947
948 2017-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
949
950         [Cocoa] Stop soft-linking CTRunGetBaseAdvancesAndOrigins()
951         https://bugs.webkit.org/show_bug.cgi?id=168256
952
953         Reviewed by Alex Christensen.
954
955         Use of this function is already behind a platform guard.
956
957         No new tests because there is no behavior change.
958
959         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
960         (SOFT_LINK): Deleted.
961
962 2017-02-13  Jiewen Tan  <jiewen_tan@apple.com>
963
964         [WebCrypto] WebInspector should indicate webkitSubtle is deprecated
965         https://bugs.webkit.org/show_bug.cgi?id=165913
966         <rdar://problem/30477222>
967
968         Reviewed by Joseph Pecoraro.
969
970         Covered by existing tests.
971
972         * page/Crypto.cpp:
973         (WebCore::Crypto::webkitSubtle):
974
975 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
976
977         Call WKDestroyRenderingResources() on iOS when tabs are backgrounded
978         https://bugs.webkit.org/show_bug.cgi?id=168261
979         rdar://problem/30481079
980
981         Reviewed by Tim Horton.
982
983         Add CABackingStoreCollectBlocking() to QuartzCoreSPI.h, and fix files in WebCore
984         that do a framework include.
985
986         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
987         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
988         * platform/spi/cocoa/QuartzCoreSPI.h:
989         * platform/spi/mac/NSViewSPI.h:
990
991 2017-02-13  Youenn Fablet  <youenn@apple.com>
992
993         ASSERTION FAILED: !m_bodyLoader
994         https://bugs.webkit.org/show_bug.cgi?id=166986
995
996         Reviewed by Sam Weinig.
997
998         Refactoring to make the unset/set pending activity part of body loader.
999         This allows ensuring to not forget to do that by simply deleting the body loader.
1000
1001         * Modules/fetch/FetchResponse.cpp:
1002         (WebCore::FetchResponse::fetch):
1003         (WebCore::FetchResponse::BodyLoader::didSucceed):
1004         (WebCore::FetchResponse::BodyLoader::didFail):
1005         (WebCore::FetchResponse::BodyLoader::BodyLoader):
1006         (WebCore::FetchResponse::BodyLoader::~BodyLoader):
1007         (WebCore::FetchResponse::stop):
1008         * Modules/fetch/FetchResponse.h:
1009
1010 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
1011
1012         Remove unused WebCoreThreadSafe.h
1013         https://bugs.webkit.org/show_bug.cgi?id=168236
1014
1015         Reviewed by Dan Bernstein.
1016
1017         * platform/ios/wak/WebCoreThreadSafe.h: Removed.
1018         * WebCore.xcodeproj/project.pbxproj: Removed WebCoreThreadSafe.h
1019         * platform/ios/wak/WebCoreThread.mm: Removed WebCoreThreadSafe.h and included WAKWindow.h directly
1020
1021 2017-02-13  Anders Carlsson  <andersca@apple.com>
1022
1023         Fix iOS build.
1024
1025         * platform/ios/DragImageIOS.mm:
1026         (WebCore::deleteDragImage):
1027
1028 2017-02-13  Sam Weinig  <sam@webkit.org>
1029
1030         Rename MediaQueryExp.h/cpp to MediaQueryExpression.h/cpp
1031         https://bugs.webkit.org/show_bug.cgi?id=168249
1032
1033         Reviewed by Dean Jackson.
1034
1035         Fix a FIXME and rename MediaQueryExp.h/cpp to match the class it contains, MediaQueryExpression.
1036
1037         * CMakeLists.txt:
1038         * WebCore.xcodeproj/project.pbxproj:
1039         * css/CSSAllInOne.cpp:
1040         * css/MediaQuery.h:
1041         * css/MediaQueryEvaluator.h:
1042         * css/MediaQueryExp.cpp: Removed.
1043         * css/MediaQueryExp.h: Removed.
1044         * css/MediaQueryExpression.cpp: Copied from Source/WebCore/css/MediaQueryExp.cpp.
1045         * css/MediaQueryExpression.h: Copied from Source/WebCore/css/MediaQueryExp.h.
1046         * css/parser/MediaQueryParser.h:
1047
1048 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
1049
1050         WAKResponder should be exported from WebCore
1051         https://bugs.webkit.org/show_bug.cgi?id=168245
1052
1053         Reviewed by Dan Bernstein.
1054
1055         * platform/ios/wak/WAKResponder.h:
1056
1057 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
1058
1059         Log to the History Channel in a few more places
1060         https://bugs.webkit.org/show_bug.cgi?id=168252
1061
1062         Reviewed by Brady Eidson.
1063
1064         *** Aliens ***
1065
1066         * loader/HistoryController.cpp:
1067         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1068         (WebCore::HistoryController::updateForReload):
1069         * loader/NavigationScheduler.cpp:
1070         (WebCore::NavigationScheduler::scheduleHistoryNavigation):
1071         (WebCore::NavigationScheduler::timerFired):
1072         (WebCore::NavigationScheduler::cancel):
1073         * page/History.cpp:
1074         (WebCore::History::go):
1075
1076 2017-02-13  Alex Christensen  <achristensen@webkit.org>
1077
1078         Percent should be allowed in non-special URL hosts
1079         https://bugs.webkit.org/show_bug.cgi?id=168255
1080
1081         Reviewed by Tim Horton.
1082
1083         In the last few weeks, the spec has consolidated its sets of code points.
1084         Now forbidden host code points replace the old invalid host code points with
1085         the modification that percents are allowed in non-special hosts because we
1086         percent-encode non-ascii code points in non-special hosts.
1087         See https://url.spec.whatwg.org/#concept-opaque-host-parser
1088
1089         Covered by newly passing web platform tests.
1090
1091         * platform/URLParser.cpp:
1092         (WebCore::isC0Control):
1093         (WebCore::isInUserInfoEncodeSet):
1094         (WebCore::URLParser::hasForbiddenHostCodePoint):
1095         (WebCore::URLParser::parseHostAndPort):
1096         (WebCore::isInvalidDomainCharacter): Deleted.
1097         (WebCore::URLParser::hasInvalidDomainCharacter): Deleted.
1098         * platform/URLParser.h:
1099
1100 2017-02-13  Anders Carlsson  <andersca@apple.com>
1101
1102         Fix Windows build.
1103
1104         * platform/win/PasteboardWin.cpp:
1105         (WebCore::Pasteboard::setDragImage):
1106
1107 2017-02-13  Alex Christensen  <achristensen@webkit.org>
1108
1109         Fix Yosemite build after r211765
1110         https://bugs.webkit.org/show_bug.cgi?id=168246
1111         <rdar://problem/30494174>
1112
1113         Reviewed by Brady Eidson.
1114
1115         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1116         (SOFT_LINK):
1117
1118 2017-02-13  Anders Carlsson  <andersca@apple.com>
1119
1120         Add a DragImage class that wraps a DragImageRef
1121         https://bugs.webkit.org/show_bug.cgi?id=168131
1122
1123         Reviewed by Beth Dakin.
1124
1125         This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
1126         various drag code paths possible. No functionality change.
1127
1128         * dom/DataTransfer.cpp:
1129         (WebCore::DataTransfer::updateDragImage):
1130         * page/DragController.cpp:
1131         (WebCore::DragController::startDrag):
1132         (WebCore::DragController::doImageDrag):
1133         (WebCore::DragController::doSystemDrag):
1134         * page/DragController.h:
1135         * platform/DragImage.cpp:
1136         (WebCore::DragImage::DragImage):
1137         (WebCore::DragImage::operator=):
1138         (WebCore::DragImage::~DragImage):
1139         * platform/DragImage.h:
1140         * platform/Pasteboard.h:
1141         * platform/StaticPasteboard.h:
1142         * platform/mac/PasteboardMac.mm:
1143         (WebCore::Pasteboard::setDragImage):
1144
1145 2017-02-13  Chris Dumez  <cdumez@apple.com>
1146
1147         Regression(r211455): ASSERTION FAILED: frameView || pageCacheState() == InPageCache in com.apple.WebCore: WebCore::Document::destroyRenderTree
1148         https://bugs.webkit.org/show_bug.cgi?id=168237
1149         <rdar://problem/30494165>
1150
1151         Reviewed by Gavin Barraclough.
1152
1153         Drop bad assertion under document::destroyRenderTree() that was introduced in r211455.
1154         The assertion seemed like a good idea but the issue is that CachedFrame::destroy()
1155         reset's the document's pageCacheState before calling Document::prepareForDestruction().
1156
1157         No new tests, this fixes assertion hits on our bots.
1158
1159         * dom/Document.cpp:
1160         (WebCore::Document::destroyRenderTree):
1161
1162 2017-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
1163
1164         Update custom line breaking iterators to the latest version of Unicode
1165         https://bugs.webkit.org/show_bug.cgi?id=168182
1166
1167         Reviewed by Zalan Bujtas.
1168
1169         Clean up our breaking code to be more descriptive about the difference between
1170         line-break: auto vs line-break: loose | normal | strict. The only difference is
1171         that we have some hardcoded tables to speed up character iteration for
1172         line-break: auto.
1173
1174         Tests: TestWebKitAPI WebKit2.LineBreaking
1175
1176         * rendering/BreakLines.h:
1177         (WebCore::nextBreakablePosition):
1178         (WebCore::nextBreakablePositionIgnoringNBSP):
1179         (WebCore::nextBreakablePositionWithoutShortcut):
1180         (WebCore::nextBreakablePositionIgnoringNBSPWithoutShortcut):
1181         (WebCore::isBreakable):
1182         (WebCore::nextBreakablePositionNonLoosely): Deleted.
1183         (WebCore::nextBreakablePositionLoosely): Deleted.
1184         (WebCore::nextBreakablePositionLoose): Deleted.
1185         (WebCore::nextBreakablePositionIgnoringNBSPLoose): Deleted.
1186         * rendering/RenderText.cpp:
1187         (WebCore::RenderText::computePreferredLogicalWidths):
1188         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1189         (WebCore::SimpleLineLayout::nextBreakablePositionInSegment):
1190         * rendering/line/BreakingContext.h:
1191         (WebCore::BreakingContext::handleText):
1192         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
1193
1194 2017-02-13  Youenn Fablet  <youenn@apple.com>
1195
1196         Remove @getUserMedia identifier
1197         https://bugs.webkit.org/show_bug.cgi?id=168216
1198
1199         Reviewed by Sam Weinig.
1200
1201         No change of behavior.
1202
1203         * Modules/mediastream/MediaDevices.idl:
1204         * bindings/js/WebCoreBuiltinNames.h:
1205
1206 2017-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1207
1208         [GTK] Non-accelerated drawing is broken with HiDPI
1209         https://bugs.webkit.org/show_bug.cgi?id=168128
1210
1211         Reviewed by Michael Catanzaro.
1212
1213         When device scale factor changes, the page notifies the page overlay controller about it. Then overlay root
1214         layers are created to be notified about the device scale factor. That causes us to enter in accelerated
1215         compositing mode, because the graphics layer factory is called. But the render layer compositor doesn't really
1216         enter in accelerated mode, because there aren't page overlays, the accelerated mode is not forced and the website
1217         doesn't require acceleration either. This leaves our drawing area in an inconsistent state, it thinks it's in AC
1218         mode because it has a layer tree host, but without a root layer attached, so nothing is rendered. The page
1219         overlay controller doesn't need to create the layers when device scale factor changes, when an overlay is
1220         installed, layers will be created with the current device scale factor anyway.
1221
1222         * page/PageOverlayController.cpp:
1223         (WebCore::PageOverlayController::didChangeDeviceScaleFactor): Return early if not initialized yet.
1224
1225 2017-02-13  Csaba Osztrogonác  <ossy@webkit.org>
1226
1227         REGRESSION(r210845) Build broken with ENABLE_MHTML disabled
1228         https://bugs.webkit.org/show_bug.cgi?id=167771
1229
1230         Reviewed by Daniel Bates.
1231
1232         * loader/DocumentLoader.cpp:
1233         (WebCore::DocumentLoader::commitData):
1234
1235 2017-02-12  Dan Bernstein  <mitz@apple.com>
1236
1237         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
1238
1239         * platform/spi/mac/TUCallSPI.h: Reverted to r212210.
1240
1241 2017-02-12  Dan Bernstein  <mitz@apple.com>
1242
1243         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
1244
1245         * platform/spi/mac/TUCallSPI.h:
1246
1247 2017-02-12  Dan Bernstein  <mitz@apple.com>
1248
1249         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
1250
1251         * platform/spi/mac/TUCallSPI.h:
1252
1253 2017-02-12  Dan Bernstein  <mitz@apple.com>
1254
1255         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
1256
1257         * platform/spi/mac/NSMenuSPI.h: Replaced declaration of deprecated method with its current
1258           equivalent.
1259
1260 2017-02-12  Dan Bernstein  <mitz@apple.com>
1261
1262         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
1263
1264         * platform/spi/mac/NSImmediateActionGestureRecognizerSPI.h:
1265
1266 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
1267
1268         parserRemoveChild should unload subframes
1269         https://bugs.webkit.org/show_bug.cgi?id=168151
1270
1271         Reviewed by Darin Adler.
1272
1273         Fix the bug that the adoption agency algorithm does not unload subframes as it disconnects nodes.
1274
1275         Also moved calls to nodeWillBeRemoved inside NoEventDispatchAssertion to expand on r211965.
1276
1277         Tests: fast/parser/adoption-agency-clear-focus-range.html
1278                fast/parser/adoption-agency-unload-iframe-1.html
1279                fast/parser/adoption-agency-unload-iframe-2.html
1280
1281         * dom/ContainerNode.cpp:
1282         (WebCore::ContainerNode::takeAllChildrenFrom): Rewritten using idioms used in removeChildren and parserAppendChild.
1283
1284         Disconnect all subframes first since this can synchronously dispatch an unload event. Then update DOM ranges,
1285         the focused element, and other states in the document.
1286
1287         Second, use the regular removeBetween, notifyChildNodeRemoved, childrenChanged sequence of calls to disconnect nodes
1288         instead of a single call to removeDetachedChildren to properly disconnect child nodes since those nodes may have
1289         already come live due to execution of synchronous scripts prior to the adoption agency algorithm has run, or in
1290         response to the unload event we just dispatched.
1291
1292         Third, append these nodes using parserAppendChild to avoid dispatching mutation events.
1293
1294         (WebCore::willRemoveChild): Removed the call to nodeWillBeRemoved. It's now called within NoEventDispatchAssertion
1295         in each call site of willRemoveChild and willRemoveChildren.
1296         (WebCore::willRemoveChildren): Ditto.
1297         (WebCore::ContainerNode::removeChild): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
1298         (WebCore::ContainerNode::replaceAllChildren): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
1299         (WebCore::ContainerNode::parserRemoveChild): Disconnect subframes and update document's states.
1300
1301         * html/parser/HTMLConstructionSite.cpp:
1302         (WebCore::executeTakeAllChildrenAndReparentTask): Add a release assert that new parent does not already have a parent. 
1303
1304 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
1305
1306         REGRESSION (r179497): Crash inside setAttributeNode
1307         https://bugs.webkit.org/show_bug.cgi?id=168161
1308         <rdar://problem/30451581>
1309
1310         Reviewed by Andreas Kling.
1311
1312         The bug was caused by setAttributeNode calling setAttributeInternal with the same element data as the one used
1313         to call removeAttributeInternal despite of the fact removeAttributeInternal could have invoked arbitrary scripts
1314         and mutated element's m_elementData.
1315
1316         Fixed the bug by calling with setAttributeInternal with the result of new invocation of ensureUniqueElementData().
1317
1318         Test: fast/dom/Attr/make-unique-element-data-while-replacing-attr.html
1319
1320         * dom/Element.cpp:
1321         (WebCore::Element::setAttributeNode):
1322
1323 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
1324
1325         Rebaseline bindings tests after r212207.
1326
1327         * bindings/scripts/test/JS/JSTestObj.cpp:
1328         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1329
1330 2017-02-12  Dan Bernstein  <mitz@apple.com>
1331
1332         [Cocoa] Some -respondsToSelector: checks are unnecessary
1333         https://bugs.webkit.org/show_bug.cgi?id=168183
1334
1335         Reviewed by Tim Horton.
1336
1337         * English.lproj/Localizable.strings: Removed a string that’s no longer needed after the
1338           change to WebKit2/Platform/mac/MenuUtilities.mm.
1339
1340         * editing/mac/DictionaryLookup.mm:
1341         (WebCore::showPopupOrCreateAnimationController): Removed check whether
1342           LULookupDefinitionModule responds to +showDefinitionForTerm:relativeToRect:ofView:options:.
1343
1344         * platform/cocoa/NetworkExtensionContentFilter.mm:
1345         (WebCore::NetworkExtensionContentFilter::initialize): Changed to use
1346           -[NEFilterSource setSourceAppIdentifier:], without checking, instead of
1347           -setSourceAppBundleID:, which does not exist.
1348
1349         * platform/cocoa/ScrollController.mm:
1350         (systemUptime): Deleted.
1351         (WebCore::ScrollController::snapRubberBand): Use -[NSProcessInfo systemUptime] directly.
1352
1353         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1354         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Remove unnecessary check.
1355
1356         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1357         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Ditto.
1358         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
1359         (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck): Replaced
1360           -respondsToSelector: check with -isKindOfClass: check corresponding to the above cast.
1361         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): Removed unnecessary
1362           check.
1363
1364         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
1365         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): Removed unnecessary checks.
1366
1367         * platform/graphics/mac/WebGLLayer.mm:
1368         (-[WebGLLayer initWithGraphicsContext3D:]): Ditto.
1369
1370         * platform/mac/PlatformEventFactoryMac.mm:
1371         (WebCore::typeForEvent): Removed check whether NSMenu responds to +menuTypeForEvent: and
1372           all code to handle that case that it doesn’t.
1373
1374         * platform/mac/WebVideoFullscreenController.mm:
1375         (-[WebVideoFullscreenController applicationDidResignActive:]): Removed check whether
1376           NSWindow responds to -isOnActiveSpace.
1377         (-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Removed check whether
1378           NSApplication responds to -setPresentationOptions:
1379
1380         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1381         (-[WebVideoFullscreenInterfaceMacObjC updateIsPlaying:newPlaybackRate:]): Removed
1382           unnecessary -respondsToSelector: check.
1383         (-[WebVideoFullscreenInterfaceMacObjC setVideoDimensions:]): Ditto.
1384         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): Ditto.
1385
1386         * platform/spi/cf/CFNetworkSPI.h: Moved declarations of
1387           -[NSURLCache _initWithMemoryCapacity:diskCapacity:relativePath:] and
1388           -[NSURLCache _CFURLCache] to the !USE(APPLE_INTERNAL_SDK) section.
1389
1390         * platform/spi/cocoa/NEFilterSourceSPI.h: Added declaration of NEFilterSource’
1391           sourceAppIdentifier property to the !USE(APPLE_INTERNAL_SDK) section and deleted
1392           unconditional declaration of sourceAppBundleID property, which doesn’t exist.
1393
1394         * platform/spi/cocoa/QuartzCoreSPI.h: Removed redundant declarations.
1395
1396         * platform/spi/ios/DataDetectorsUISPI.h: Moved declarations of DDDetectionController methods
1397           from WebKit2/UIProcess/ios/{WKActionSheetAssistant,WKContentViewInteraction}.mm to here.
1398           Removed an unused declaration.
1399
1400         * platform/spi/mac/LookupSPI.h: Moved redundant declarations into the
1401           !USE(APPLE_INTERNAL_SDK) section.
1402
1403         * platform/spi/mac/NSMenuSPI.h: Changed to import NSMenu_Private.h when using the
1404           Apple internal SDK. Cleaned up the declarations for the other case.
1405
1406         * platform/spi/mac/TUCallSPI.h: Changed to import TUCall_Strings.h when use the Apple
1407           internal SDK.
1408
1409 2017-02-11  Sam Weinig  <sam@webkit.org>
1410
1411         Remove the remaining functions out of JSDOMBinding
1412         https://bugs.webkit.org/show_bug.cgi?id=168179
1413
1414         Reviewed by Darin Adler.
1415
1416         Move utility functions into more appropriate locations.
1417         - Move hasIteratorMethod to runtime/IteratorOperations.h
1418         - Move nonCachingStaticFunctionGetter to runtime/Lookup.h
1419         - Move addImpureProperty to CommonVM
1420
1421         Remove toJS overload that took a Vector<T>. Replace it's usage
1422         with toJS<IDLSequence<T>> usage. To make this work, added two
1423         new types, IDLIDBKeyData and IDLIDBValue.
1424
1425         * Modules/indexeddb/IDBCursor.cpp:
1426         (WebCore::IDBCursor::setGetResult):
1427         * Modules/indexeddb/IDBRequest.cpp:
1428         (WebCore::IDBRequest::setResult):
1429         (WebCore::IDBRequest::setResultToStructuredClone):
1430         Adopt JSDOMConvert infrastructure for conversions using new types.
1431
1432         * bindings/IDLTypes.h:
1433         * bindings/js/JSDOMConvertIndexedDB.h:
1434         (WebCore::JSConverter<IDLIDBKeyData>::convert):
1435         (WebCore::JSConverter<IDLIDBValue>::convert):
1436         Add new types for IDBKeyData and IDBValue.
1437
1438         * bindings/js/CommonVM.cpp:
1439         (WebCore::addImpureProperty):
1440         * bindings/js/CommonVM.h:
1441         Move addImpureProperty here from JSDOMBinding.
1442
1443         * bindings/js/IDBBindingUtilities.cpp:
1444         (WebCore::idbKeyDataToScriptValue): Deleted.
1445         * bindings/js/IDBBindingUtilities.h:
1446         Remove unused idbKeyDataToScriptValue, and group like functions
1447         together.
1448
1449         * bindings/js/JSDOMBinding.cpp: Removed.
1450         * bindings/js/JSDOMBinding.h:
1451         (WebCore::nonCachingStaticFunctionGetter): Deleted.
1452         (WebCore::toJS): Deleted.
1453         Move/remove functions.
1454
1455         * bindings/js/JSDOMConvertUnion.h:
1456         Update for move of hasIteratorMethod to runtime/IteratorOperations.h
1457
1458         * bindings/js/JSDOMWindowCustom.cpp:
1459         * bindings/js/JSHTMLDocumentCustom.cpp:
1460         * bindings/js/JSLocationCustom.cpp:
1461         Update for move of nonCachingStaticFunctionGetter to runtime/Lookup.h
1462
1463         * bindings/js/JSSubtleCryptoCustom.cpp:
1464         Remove unneeded include of runtime/IteratorOperations.h
1465
1466         * bindings/scripts/CodeGeneratorJS.pm:
1467         (GenerateOverloadedFunctionOrConstructor):
1468         Include runtime/IteratorOperations when needing to distinguish a sequence.
1469
1470         * html/HTMLDocument.cpp:
1471         Replace include of JSDOMBinding.h with CommonVM.h for addImpureProperty.
1472
1473 2017-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1474
1475         [GTK] Handle caps lock indicator in event modifiers
1476         https://bugs.webkit.org/show_bug.cgi?id=168186
1477
1478         Reviewed by Michael Catanzaro.
1479
1480         Add helper function to check if caps lock is present in the given modifiers. We need this because in GDK
1481         GDK_LOCK_MASK might be either CapsLock or ShiftLock in X11. We use this new method in all platform event
1482         implementations to add the appropriate modifiers.
1483
1484         Fixes: fast/events/special-key-events-in-input-text.html
1485
1486         * platform/PlatformKeyboardEvent.h:
1487         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1488         (WebCore::modifiersForGdkKeyEvent):
1489         (WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
1490         * platform/gtk/PlatformMouseEventGtk.cpp:
1491         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1492         * platform/gtk/PlatformWheelEventGtk.cpp:
1493         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1494
1495 2017-02-11  Sam Weinig  <sam@webkit.org>
1496
1497         Remove custom bindings for XSLTProcessor.idl
1498         https://bugs.webkit.org/show_bug.cgi?id=168174
1499
1500         Reviewed by Andreas Kling.
1501
1502         * CMakeLists.txt:
1503         * WebCore.xcodeproj/project.pbxproj:
1504         * bindings/js/JSBindingsAllInOne.cpp:
1505         * bindings/js/JSXSLTProcessorCustom.cpp: Removed.
1506         Remove file.
1507  
1508         * bindings/js/JSDOMBinding.cpp:
1509         (WebCore::jsStringOrUndefined): Deleted.
1510         * bindings/js/JSDOMBinding.h:
1511         Remove now unused jsStringOrUndefined.
1512
1513         * xml/XSLTProcessor.cpp:
1514         (WebCore::XSLTProcessor::setParameter):
1515         (WebCore::XSLTProcessor::getParameter):
1516         (WebCore::XSLTProcessor::removeParameter):
1517         * xml/XSLTProcessor.idl:
1518         Replace custom bindings bindings with early returns. One subtle difference
1519         between the custom bindings and this, is that getParameter will return 
1520         jsNull() rather than jsUndefined() for null String returns. This matches
1521         all other bindings.
1522
1523 2017-02-11  Olivier Blin  <olivier.blin@softathome.com>
1524
1525         [GStreamer][MSE][EME] Fix decryptor assignment
1526         https://bugs.webkit.org/show_bug.cgi?id=168122
1527
1528         Reviewed by Michael Catanzaro.
1529
1530         The new decryptor is a floating reference so we should not use the
1531         adopt GRefPtr constructor, but use the regular assignment operator
1532         that will sink the object (clear the floating flag).
1533
1534         This fixes assertions in debug build.
1535
1536         See previous pipeline fix in r210851 and WPE commit
1537         06020b18831e1c0eead34e2c1a5a4b7d026c227d.
1538
1539         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1540         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1541         Do not use adoptGRef(), it prevented the object from being sunk.
1542
1543 2017-02-11  Simon Fraser  <simon.fraser@apple.com>
1544
1545         Avoid a redundant scroll to 0,0 when navigating back to a url with no fragment
1546         https://bugs.webkit.org/show_bug.cgi?id=168177
1547
1548         Reviewed by Sam Weinig.
1549
1550         FrameView::scrollToFragment() is called from FrameLoader::scrollToFragmentWithParentBoundary()
1551         when navigating within the page. If the URL had no fragment identifier, this code would
1552         call into FrameView::scrollToAnchor() with an empty name, where maintainScrollPositionAtAnchor()
1553         used the document as the anchor, thus scrolling to 0,0. Later, history().restoreScrollPositionAndViewState()
1554         the restores the scroll position from history.
1555         
1556         This scroll to 0,0 happened to be not visible to the page because of scroll event
1557         coalescing, but it makes implementation of history.scrollRestoration harder, so avoid it
1558         by just returning early from FrameView::scrollToFragment() if there is no fragment,
1559         making sure to clear the document's CSSTarget.
1560
1561         * dom/Document.cpp:
1562         (WebCore::Document::setCSSTarget):
1563         * page/FrameView.cpp:
1564         (WebCore::FrameView::scrollToFragment):
1565         (WebCore::FrameView::scrollToAnchor):
1566
1567 2017-02-11  Chris Dumez  <cdumez@apple.com>
1568
1569         Implement URL's toJSON()
1570         https://bugs.webkit.org/show_bug.cgi?id=167979
1571
1572         Reviewed by Sam Weinig.
1573
1574         Implement URL's toJSON() as per:
1575         - https://url.spec.whatwg.org/#dom-url-tojson
1576
1577         This is already supported by Firefox.
1578
1579         Also, drop URLUtils.idl as it is no longer in the specification.
1580         Merge its content to DOMURL.idl as per the URL specification.
1581
1582         Finally, mark href attribute as stringifier and drop the toString()
1583         operation to match the specification. This fixes a bug where our
1584         toString property was not enumerable but should have been.
1585
1586         Tests: fast/url/url-tojson.html
1587                imported/w3c/web-platform-tests/url/url-tojson.html
1588
1589         * CMakeLists.txt:
1590         * DerivedSources.make:
1591         * WebCore.xcodeproj/project.pbxproj:
1592         * html/DOMURL.idl:
1593         * html/URLUtils.h:
1594         (WebCore::URLUtils<T>::toJSON):
1595         * html/URLUtils.idl: Removed.
1596
1597 2017-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1598
1599         [GTK][EFL] Implement MIMETypeRegistry::getPreferredExtensionForMIMEType
1600         https://bugs.webkit.org/show_bug.cgi?id=168163
1601
1602         Reviewed by Michael Catanzaro.
1603
1604         It's missing causing several HTML anchor download tests to fail because the suggested filename missed the
1605         extension. This patch moves MIMETypeRegistry::appendFileExtensionIfNecessary() from the cocoa specific file to the
1606         common file because it's not actually platform specific. MIMETypeRegistry::getPreferredExtensionForMIMEType() is
1607         what platforms should implement.
1608
1609         Fixes: fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html
1610                fast/dom/HTMLAnchorElement/anchor-download.html
1611                fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
1612                fast/dom/HTMLAnchorElement/anchor-nodownload-set.html
1613
1614         * platform/MIMETypeRegistry.cpp:
1615         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
1616         * platform/cocoa/MIMETypeRegistryCocoa.mm:
1617         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary): Deleted.
1618         * platform/efl/MIMETypeRegistryEfl.cpp:
1619         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
1620         * platform/gtk/MIMETypeRegistryGtk.cpp:
1621         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
1622
1623 2017-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1624
1625         Unreviewed. Update imageTitle translatable string.
1626
1627         To match mac port. Fixes fast/images/imageDocument-title.html.
1628
1629         * platform/gtk/LocalizedStringsGtk.cpp:
1630         (WebCore::imageTitle):
1631
1632 2017-02-10  John Wilander  <wilander@apple.com>
1633
1634         Updates to Resource Load Statistics: Get the right website data store and introduce timeout for user interaction
1635         https://bugs.webkit.org/show_bug.cgi?id=167474
1636         <rdar://problem/24681808>
1637         <rdar://problem/24703286>
1638         <rdar://problem/30290270>
1639
1640         This patch does the following:
1641         1. Gets the right website data store. API::WebsiteDataStore::defaultDataStore()
1642             does not provide the right data store.
1643         2. Introduces timeout for user interaction. A domain needs interaction every 30
1644             days to stay in that category.
1645         3. Adds grandfathered to the statistics model in preparation for grandfathering of
1646             existing data records.
1647         4. Adds test infrastructure to allow testing of the various rules in place for
1648             data records removal.
1649         5. Fixes various smaller bugs that were found as part of setting up the tests.
1650         6. Regresses the data records removal counting. We need to come up with a thread
1651             safe way of gathering removal statistics from more than one data store now
1652             that we potentially interact with multiple stores.
1653         7. Adds a first set of layout tests for resource load statistics.
1654
1655         Reviewed by Andy Estes.
1656
1657         Tests: http/tests/loading/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html
1658                http/tests/loading/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html
1659                http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html
1660                http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction.html
1661                http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html
1662
1663         * dom/Document.cpp:
1664         (WebCore::Document::updateLastHandledUserGestureTimestamp):
1665             This now calls ResourceLoadObserver::logUserInteraction() every time since
1666             we want to keep track of the most recent user interaction.
1667         * loader/ResourceLoadObserver.cpp:
1668         (WebCore::ResourceLoadObserver::statisticsStore):
1669             New getter used by WebResourceLoadStatisticsManager::resetToConsistentState().
1670         (WebCore::reduceTimeResolutionToOneDay):
1671             Convenience function.
1672         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1673             Reduces time resolution for privacy reasons.
1674         (WebCore::ResourceLoadObserver::logUserInteraction):
1675         (WebCore::ResourceLoadObserver::clearUserInteraction):
1676         (WebCore::ResourceLoadObserver::hasHadUserInteraction):
1677         (WebCore::ResourceLoadObserver::setPrevalentResource):
1678         (WebCore::ResourceLoadObserver::isPrevalentResource):
1679         (WebCore::ResourceLoadObserver::clearPrevalentResource):
1680         (WebCore::ResourceLoadObserver::setTimeToLiveUserInteraction):
1681         (WebCore::ResourceLoadObserver::fireDataModificationHandler):
1682             New functions that allow WebKitTestRunner to stage exact
1683             statistics, fire the handler, and test the outcome.
1684         * loader/ResourceLoadObserver.h:
1685         * loader/ResourceLoadStatistics.cpp:
1686         (WebCore::ResourceLoadStatistics::encode):
1687         (WebCore::ResourceLoadStatistics::decode):
1688         (WebCore::ResourceLoadStatistics::toString):
1689         (WebCore::ResourceLoadStatistics::merge):
1690             Support for statistics mostRecentUserInteraction, grandfathered, and
1691             dataRecordsRemoved.
1692         * loader/ResourceLoadStatistics.h:
1693         * loader/ResourceLoadStatisticsStore.cpp:
1694         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1695             New function that allows WebKitTestRunner to test 
1696             aging out of user interaction.
1697         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
1698             Now takes into account the timestamp and ages
1699             out user interaction.
1700         (WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
1701             Now makes use of ResourceLoadStatisticsStore::hasHadRecentUserInteraction().
1702         * loader/ResourceLoadStatisticsStore.h:
1703
1704 2017-02-10  Sam Weinig  <sam@webkit.org>
1705
1706         [WebIDL] Cleanup XMLHttpRequest's bindings
1707         https://bugs.webkit.org/show_bug.cgi?id=168067
1708
1709         Reviewed by Chris Dumez.
1710
1711         * bindings/js/JSDOMBinding.cpp:
1712         (WebCore::jsOwnedStringOrNull): Deleted.
1713         * bindings/js/JSDOMBinding.h:
1714         Remove jsOwnedStringOrNull and inline it into it's one use
1715         in JSXMLHttpRequestCustom.
1716
1717         * bindings/js/JSXMLHttpRequestCustom.cpp:
1718         (WebCore::JSXMLHttpRequest::responseText):
1719         (WebCore::SendFunctor::SendFunctor): Deleted.
1720         (WebCore::SendFunctor::line): Deleted.
1721         (WebCore::SendFunctor::column): Deleted.
1722         (WebCore::SendFunctor::url): Deleted.
1723         (WebCore::SendFunctor::operator()): Deleted.
1724         (WebCore::JSXMLHttpRequest::send): Deleted.
1725         * xml/XMLHttpRequest.cpp:
1726         (WebCore::XMLHttpRequest::send):
1727         * xml/XMLHttpRequest.h:
1728         Remove custom send, replacing it with a single send implementation that
1729         takes a variant.
1730
1731         * xml/XMLHttpRequest.idl:
1732         Cleanup the IDL to better match the spec. Update correct types where trivial.
1733
1734 2017-02-10  Chris Dumez  <cdumez@apple.com>
1735
1736         document.origin doesn't match spec
1737         https://bugs.webkit.org/show_bug.cgi?id=168022
1738
1739         Reviewed by Sam Weinig.
1740
1741         Update document.origin to return the origin in the expected format:
1742         - https://dom.spec.whatwg.org/#dom-document-origin
1743
1744         Change: "https_webkit.org_0 -> "https://webkit.org".
1745
1746         The new behavior matches Firefox and Chrome.
1747
1748         No new tests, updated existing tests.
1749
1750         * dom/Document.cpp:
1751         (WebCore::Document::origin):
1752
1753 2017-02-10  Daniel Bates  <dabates@apple.com>
1754
1755         Attempt to fix the build following <https://trac.webkit.org/changeset/212173>
1756         (https://bugs.webkit.org/show_bug.cgi?id=166774)
1757
1758         * dom/Document.cpp:
1759         (WebCore::Document::detachFromCachedFrame): Use ASSER_UNUSED() instead of ASSERT() since
1760         the parameter cachedFrame is unused in non-debug build.
1761
1762 2017-02-10  Daniel Bates  <dabates@apple.com>
1763
1764         Detach frame from document when entering page cache
1765         https://bugs.webkit.org/show_bug.cgi?id=166774
1766         <rdar://problem/29904368>
1767
1768         Reviewed by Chris Dumez.
1769
1770         When a page enters the page cache it is unnecessary for it to hold a reference to its
1771         associated frame because subsequent interactions with the page do not need to make use
1772         of it. Once a page exits the page cache we associate it with its frame.
1773
1774         * dom/Document.cpp:
1775         (WebCore::Document::frameDestroyed): Update comment to reflect the renaming of disconnectFromFrame().
1776         (WebCore::Document::attachToCachedFrame): Added.
1777         (WebCore::Document::detachFromCachedFrame): Added.
1778         (WebCore::Document::prepareForDestruction): Only call CSSAnimationController::detachFromDocument() if
1779         we have a frame. Substitute detachFromFrame() for disconnectFromFrame() as the latter was renamed to
1780         the former.
1781         (WebCore::Document::hasEverCalledWindowOpen): Deleted.
1782         (WebCore::Document::markHasCalledWindowOpen): Deleted.
1783         (WebCore::Document::disconnectFromFrame): Renamed to detachFromFrame.
1784         * dom/Document.h:
1785         (WebCore::Document::detachFromFrame): Renamed; formerly named disconnectFromFrame(). Changed
1786         visibility from public to private and made this function inline.
1787         * history/CachedFrame.cpp:
1788         (WebCore::CachedFrameBase::pruneDetachedChildFrames): Remove cached child frames that were
1789         removed from the page when it was in the page cache as there is no need to restore such frames.
1790         (WebCore::CachedFrameBase::restore): Call pruneDetachedChildFrames() before restoring the
1791         frame tree.
1792         (WebCore::CachedFrame::CachedFrame): Detach from the frame.
1793         (WebCore::CachedFrame::open): Assert that we have a document and re-attach the frame.
1794         (WebCore::CachedFrame::destroy): Update assertion as this function should only be called for a
1795         frameless document. Only detach the FrameView, DocumentLoader, and Page when the cached frame is for
1796         subframe and is associated with a Page object. Call CSSAnimationController::detachFromDocument() to
1797         detach the animation controller from the document as it is being destroyed. We have to do this here
1798         because the document does not have a frame. And Document::prepareForDestruction() only calls
1799         CSSAnimationController::detachFromDocument() if the document has a frame.
1800         * history/CachedFrame.h:
1801         * history/PageCache.cpp:
1802         (WebCore::canCachePage): Remove logic that prevents caching of a page that called window.open()
1803         or has an opener as it is feasible to keep such pages in the page cache.
1804         * html/HTMLFrameElementBase.cpp:
1805         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Fix style nit.
1806         * loader/FrameLoader.cpp:
1807         (WebCore::FrameLoader::frameDetached): Only stop all loaders and stop active DOM objects if the
1808         page is not in- or about to enter- the page cache. A page in the page cache has finished loading
1809         and its active DOM objects are suspended. Also fix style nit in comment.
1810         (WebCore::FrameLoader::detachFromParent): Only stop all loaders if the page is not in- or about to
1811         enter- the page cache. A page in the page cache has finished loading. Also added a comment to explain
1812         that we protect the frame because stopAllLoaders() can cause the frame to be deallocated.
1813         * page/DOMWindow.cpp:
1814         (WebCore::DOMWindow::createWindow): Remove logic to call markHasCalledWindowOpen() as this
1815         function will be removed.
1816         * page/DiagnosticLoggingKeys.cpp:
1817         (WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey): Deleted.
1818         (WebCore::DiagnosticLoggingKeys::hasOpenerKey): Deleted.
1819         * page/DiagnosticLoggingKeys.h:
1820         * page/Page.cpp:
1821         (WebCore::Page::openedByWindowOpen): Deleted.
1822         * page/Page.h:
1823         * page/Settings.in: Remove setting allowsPageCacheWithWindowOpener.
1824
1825 2017-02-10  Simon Fraser  <simon.fraser@apple.com>
1826
1827         REGRESSION (r211845): [ios-simulator] LayoutTest compositing/masks/solid-color-masked.html is a flaky failure
1828         https://bugs.webkit.org/show_bug.cgi?id=168054
1829
1830         Reviewed by Tim Horton.
1831
1832         When adding mask layers, there was an ordering dependency. There was a hack in GraphicsLayerCA::setVisibleAndCoverageRects()
1833         to propagate m_intersectsCoverageRect to masks. However, if GraphicsLayerCA::setVisibleAndCoverageRects()
1834         ran on the masked layer before the mask was added, nothing updated the "m_intersectsCoverageRect" state of the mask layer.
1835
1836         Fix by explicitly calling setVisibleAndCoverageRects() on the mask layer, passing the same rects and
1837         viewport-constrained state as for its host layer (we already assume that their geometry matches).
1838
1839         Tested by compositing/masks/solid-color-masked.html
1840
1841         * platform/graphics/ca/GraphicsLayerCA.cpp:
1842         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1843         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1844
1845 2017-02-10  Commit Queue  <commit-queue@webkit.org>
1846
1847         Unreviewed, rolling out r212154, r212154, and r212156.
1848         https://bugs.webkit.org/show_bug.cgi?id=168156
1849
1850         broke internal builds (Requested by smfr on #webkit).
1851
1852         Reverted changesets:
1853
1854         "Add a DragImage class that wraps a DragImageRef"
1855         https://bugs.webkit.org/show_bug.cgi?id=168131
1856         http://trac.webkit.org/changeset/212154
1857
1858         "Add a DragImage class that wraps a DragImageRef"
1859         https://bugs.webkit.org/show_bug.cgi?id=168131
1860         http://trac.webkit.org/changeset/212154
1861
1862         "Try to fix the iOS and Windows builds."
1863         http://trac.webkit.org/changeset/212156
1864
1865 2017-02-10  Csaba Osztrogonác  <ossy@webkit.org>
1866
1867         Fix the !ENABLE(WEBGL) build
1868         https://bugs.webkit.org/show_bug.cgi?id=168112
1869
1870         Reviewed by Alex Christensen.
1871
1872         * html/canvas/WebGLRenderingContextBase.h:
1873
1874 2017-02-10  Youenn Fablet  <youenn@apple.com>
1875
1876         [Fetch API] fetch fails when undefined is passed as headers
1877         https://bugs.webkit.org/show_bug.cgi?id=168043
1878
1879         Reviewed by Geoffrey Garen.
1880
1881         Covered by updated test.
1882
1883         * Modules/fetch/FetchInternals.js:
1884         (fillFetchHeaders): Exit early in case of undefined headers, since it is an optional parameter.
1885
1886 2017-02-10  Csaba Osztrogonác  <ossy@webkit.org>
1887
1888         Fix the !ENABLE(WEB_TIMING) build
1889         https://bugs.webkit.org/show_bug.cgi?id=168113
1890
1891         Reviewed by Alex Christensen.
1892
1893         * workers/WorkerGlobalScope.cpp:
1894         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1895
1896 2017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
1897
1898         Update features.json for Performance Timing APIs
1899         https://bugs.webkit.org/show_bug.cgi?id=168148
1900
1901         Reviewed by Simon Fraser.
1902
1903         * features.json:
1904
1905 2017-02-10  Anders Carlsson  <andersca@apple.com>
1906
1907         Try to fix the iOS and Windows builds.
1908
1909         * platform/ios/DragImageIOS.mm:
1910         (WebCore::deleteDragImage):
1911         * platform/win/PasteboardWin.cpp:
1912         (WebCore::Pasteboard::setDragImage):
1913
1914 2017-02-10  Anders Carlsson  <andersca@apple.com>
1915
1916         Add a DragImage class that wraps a DragImageRef
1917         https://bugs.webkit.org/show_bug.cgi?id=168131
1918
1919         Reviewed by Beth Dakin.
1920
1921         This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
1922         various drag code paths possible. No functionality change.
1923
1924         * dom/DataTransfer.cpp:
1925         (WebCore::DataTransfer::updateDragImage):
1926         * page/DragController.cpp:
1927         (WebCore::DragController::startDrag):
1928         (WebCore::DragController::doImageDrag):
1929         (WebCore::DragController::doSystemDrag):
1930         * page/DragController.h:
1931         * platform/DragImage.cpp:
1932         (WebCore::DragImage::DragImage):
1933         (WebCore::DragImage::operator=):
1934         (WebCore::DragImage::~DragImage):
1935         * platform/DragImage.h:
1936         * platform/Pasteboard.h:
1937         * platform/StaticPasteboard.h:
1938         * platform/mac/PasteboardMac.mm:
1939         (WebCore::Pasteboard::setDragImage):
1940
1941 2017-02-10  Simon Fraser  <simon.fraser@apple.com>
1942
1943         Make sure the "inwindow" flag propagates to TiledBackings for masks and reflections
1944         https://bugs.webkit.org/show_bug.cgi?id=168127
1945         rdar://problem/30467120
1946
1947         Reviewed by Tim Horton.
1948         
1949         Replace the special-case, but wrong, GraphicsLayer traversal in setIsInWindowIncludingDescendants()
1950         which forgot to hit masks and replica layers with a generic traverse() function, which
1951         is then used for setting 'inWindow' as well as resetting tracked repaints.
1952
1953         Tests: compositing/tiling/tiled-mask-inwindow.html
1954                compositing/tiling/tiled-reflection-inwindow.html
1955
1956         * page/PageOverlayController.cpp:
1957         (WebCore::PageOverlayController::layerWithDocumentOverlays):
1958         (WebCore::PageOverlayController::layerWithViewOverlays):
1959         * platform/graphics/GraphicsLayer.cpp:
1960         (WebCore::GraphicsLayer::setIsInWindow):
1961         (WebCore::GraphicsLayer::setReplicatedByLayer):
1962         (WebCore::GraphicsLayer::traverse):
1963         (WebCore::GraphicsLayer::setIsInWindowIncludingDescendants): Deleted.
1964         * platform/graphics/GraphicsLayer.h:
1965         * rendering/RenderLayerCompositor.cpp:
1966         (WebCore::RenderLayerCompositor::setIsInWindow):
1967         (WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
1968         (WebCore::resetTrackedRepaintRectsRecursive): Deleted.
1969
1970 2017-02-09  Simon Fraser  <simon.fraser@apple.com>
1971
1972         Tiled layers are sometimes left with some tiles when outside the viewport
1973         https://bugs.webkit.org/show_bug.cgi?id=168104
1974         rdar://problem/30459055
1975
1976         Reviewed by Tim Horton.
1977
1978         When the coverage rect of a TiledBacking goes from a non-empty rect to an empty rect, we
1979         shouldn't just early return from TileGrid::revalidateTiles(), otherwise we are left with some
1980         tiles. Run through the function as normal, which will remove all the tiles for an empty coverage rect.
1981         
1982         Minor logging changes.
1983
1984         Test: tiled-drawing/tile-coverage-iframe-to-zero-coverage.html
1985
1986         * platform/graphics/ca/TileGrid.cpp:
1987         (WebCore::TileGrid::revalidateTiles):
1988
1989 2017-02-10  Zalan Bujtas  <zalan@apple.com>
1990
1991         Mail hangs when removing multiple rows from large table.
1992         https://bugs.webkit.org/show_bug.cgi?id=168103
1993         <rdar://problem/30090186>
1994
1995         Reviewed by Ryosuke Niwa.
1996
1997         DeleteSelectionCommand::removeNode doesn't actually destroy table structure items,
1998         but instead it removes their content. In order to be able to continue editing the table after
1999         the delete, we need to ensure that its cells' width and height are > 0. Currently we issue layout on
2000         each table item recursively.
2001         This patch delays the layout until after we've finished with the entire subtree delete (10x progression).
2002
2003         Performance test added.
2004
2005         * editing/DeleteSelectionCommand.cpp:
2006         (WebCore::DeleteSelectionCommand::insertBlockPlaceholderForTableCellIfNeeded):
2007         (WebCore::DeleteSelectionCommand::removeNodeUpdatingStates):
2008         (WebCore::shouldRemoveContentOnly):
2009         (WebCore::DeleteSelectionCommand::removeNode):
2010         * editing/DeleteSelectionCommand.h:
2011
2012 2017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
2013
2014         [Resource Timing] Enable Resource Timing by default in Tests
2015         https://bugs.webkit.org/show_bug.cgi?id=168145
2016
2017         Reviewed by Ryosuke Niwa.
2018
2019         * loader/ResourceTimingInformation.cpp:
2020         (WebCore::ResourceTimingInformation::addResourceTiming):
2021         * testing/InternalSettings.cpp:
2022         (WebCore::InternalSettings::Backup::Backup):
2023         (WebCore::InternalSettings::Backup::restoreTo):
2024         (WebCore::InternalSettings::setResourceTimingEnabled): Deleted.
2025         * testing/InternalSettings.h:
2026         * testing/InternalSettings.idl:
2027         No longer needed for tests.
2028
2029 2017-02-10  Dan Bernstein  <mitz@apple.com>
2030
2031         [Cocoa] Add shouldChangeSelectedRange to WKWebProcessPlugInEditingDelegate
2032         https://bugs.webkit.org/show_bug.cgi?id=168097
2033
2034         Reviewed by Tim Horton.
2035
2036         Added a userTriggered argument to FrameSelection::setSelectedRange so that WebKit2 can
2037         indicate that changes should be agreed to by the delegate.
2038
2039         * editing/FrameSelection.cpp:
2040         (WebCore::FrameSelection::setSelectedRange): If the change is user-triggered, check with
2041           shouldChangeSelection.
2042         * editing/FrameSelection.h:
2043
2044 2017-02-10  Jonathan Bedard  <jbedard@apple.com>
2045
2046         Removing LayoutTestRelay
2047         https://bugs.webkit.org/show_bug.cgi?id=165927
2048
2049         Reviewed by Daniel Bates.
2050         Part 2
2051
2052         LayoutTestRelay uses SPI, since recent versions of the iOS SDK allow for installing apps on
2053         simulators through simctl (iOS 10 and later), use this functionality instead.
2054
2055         * platform/RuntimeApplicationChecks.mm:
2056         (WebCore::IOSApplication::isDumpRenderTree): Update comment to reflect removal of LayoutTestRelay.
2057
2058 2017-02-10  Youenn Fablet  <youenn@apple.com>
2059
2060         [WebRTC] Implement Outgoing libwebrtc audio source support
2061         https://bugs.webkit.org/show_bug.cgi?id=168118
2062
2063         Reviewed by Eric Carlson.
2064
2065         No new automated tests as we need the audio rendering to work to test the whole loop.
2066
2067         Using an AudioSampleDataSource to convert the captured data to libwebrtc expected format.
2068         Capturing and pushing data happens in the capture thread.
2069         Pulling of converted data happens in libwebrtc thread.
2070
2071         Introducing LibWebRTCAudioFormat.h to centralize libwbebrtc expected audio format.
2072
2073         * WebCore.xcodeproj/project.pbxproj:
2074         * platform/audio/WebAudioBufferList.cpp:
2075         (WebCore::WebAudioBufferList::WebAudioBufferList): Missing initialization leads to assertion failure.
2076         * platform/audio/mac/AudioSampleBufferList.cpp:
2077         (WebCore::AudioSampleBufferList::copyFrom): In case of interleaved channels, there is one buffer but two channels.
2078         * platform/audio/mac/AudioSampleDataSource.cpp:
2079         (WebCore::AudioSampleDataSource::pushSamples):
2080         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
2081         * platform/audio/mac/AudioSampleDataSource.h:
2082         * platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Added.
2083         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
2084         (WebCore::libwebrtcAudioFormat):
2085         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
2086         (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
2087         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
2088         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
2089         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2090
2091 2017-02-10  Ryosuke Niwa  <rniwa@webkit.org>
2092
2093         HTMLConstructionSiteTask::Insert should never be called on a node with a parent
2094         https://bugs.webkit.org/show_bug.cgi?id=168099
2095
2096         Reviewed by Sam Weinig.
2097
2098         insertAlreadyParsedChild always use HTMLConstructionSiteTask::InsertAlreadyParsedChild instead
2099         of using HTMLConstructionSiteTask::Insert when fostering a child.
2100
2101         Also combine the step to take all children and re-parenting into a single task instead of
2102         separately issuing TakeAllChildren and Reparent tasks.
2103
2104         No new tests since this is a refactoring.
2105
2106         * html/parser/HTMLConstructionSite.cpp:
2107         (WebCore::insert): Now asserts that the child node never have a parent.
2108         (WebCore::executeInsertAlreadyParsedChildTask): Moved the code to remove the parent here.
2109         (WebCore::executeTakeAllChildrenAndReparentTask): Renamed from executeTakeAllChildrenTask
2110         now that this function also does the reparenting.
2111         (WebCore::executeTask):
2112         (WebCore::HTMLConstructionSite::reparent): Removed the variant only used with takeAllChildren.
2113         (WebCore::HTMLConstructionSite::insertAlreadyParsedChild): Always use InsertAlreadyParsedChild
2114         instead of calling fosterParent which uses Insert when fostering parents.
2115         (WebCore::HTMLConstructionSite::takeAllChildrenAndReparent): Renamed from takeAllChildren.
2116         * html/parser/HTMLConstructionSite.h:
2117         (WebCore::HTMLConstructionSiteTask:Operation):
2118         * html/parser/HTMLTreeBuilder.cpp:
2119         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
2120
2121 2017-02-10  Dave Hyatt  <hyatt@apple.com>
2122
2123         [CSS Parser] Make intercap property values serialize correctly
2124         https://bugs.webkit.org/show_bug.cgi?id=168073
2125
2126         Reviewed by Zalan Bujtas.
2127
2128         Fix CSS value keywords to preserve case when the value contains capital
2129         letters. Examples include optimizeSpeed, translateX, scaleY, etc.
2130
2131         * css/CSSPrimitiveValueMappings.h:
2132         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2133         (WebCore::CSSPrimitiveValue::operator EPointerEvents):
2134         (WebCore::CSSPrimitiveValue::operator TextRenderingMode):
2135         (WebCore::CSSPrimitiveValue::operator EImageRendering):
2136         (WebCore::CSSPrimitiveValue::operator EColorInterpolation):
2137         (WebCore::CSSPrimitiveValue::operator EColorRendering):
2138         (WebCore::CSSPrimitiveValue::operator EShapeRendering):
2139         * css/MediaQueryEvaluator.cpp:
2140         (WebCore::colorGamutEvaluate):
2141         * css/SVGCSSValueKeywords.in:
2142         * css/TransformFunctions.cpp:
2143         (WebCore::transformOperationType):
2144         (WebCore::transformsForValue):
2145         * css/makevalues.pl:
2146         * css/parser/CSSParserFastPaths.cpp:
2147         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2148         (WebCore::parseTransformTranslateArguments):
2149         (WebCore::parseSimpleTransformValue):
2150         * css/parser/CSSPropertyParser.cpp:
2151         (WebCore::consumeTransformValue):
2152         * css/parser/CSSPropertyParserHelpers.cpp:
2153         (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
2154
2155 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
2156
2157         [EME] Implement MediaKeySession::load()
2158         https://bugs.webkit.org/show_bug.cgi?id=168041
2159
2160         Reviewed by Xabier Rodriguez-Calvar.
2161
2162         Implement the MediaKeySession::load() method, tracing the steps as they
2163         are defined in the EME specification. The only exception is step 8.3,
2164         which requires additional facility that tracks currently open sessions
2165         and provides information whether for a given session ID there's already
2166         a MediaKeySession that's not yet been closed.
2167
2168         Session ID sanitization is done through the CDM::sanitizeSessionId()
2169         method, which relays the task to the CDMPrivate implementation.
2170
2171         The CDMInstance::loadSession() virtual method is called with the session
2172         type, sanitized ID, the Document's origin (in string form) and the
2173         callback that's invoked upon completion of the task. The callback
2174         checks whether the operation was successful, or examines the reason for
2175         the load failure in case it wasn't, rejecting the promise in the latter
2176         case either immediately or in the following task at the latest.
2177
2178         When the load was successful, the optional known keys, expiration time
2179         and message are handled appropriately, and the promise is resolved.
2180
2181         MockCDM::sanitizeSessionId() implementation only treats
2182         'valid-loaded-session' as a valid session ID.
2183         MockCDMInstance::loadSession() implementation is kept slim for now, only
2184         providing the 'license-renewal' message when invoking the passed-in
2185         callback. Known keys and expiration time will also be tested once the
2186         relevant MediaKeySession algorithms are implemented.
2187
2188         Test: media/encrypted-media/mock-MediaKeySession-load.html
2189
2190         * Modules/encryptedmedia/CDM.cpp:
2191         (WebCore::CDM::sanitizeSessionId):
2192         * Modules/encryptedmedia/CDM.h:
2193         * Modules/encryptedmedia/CDMInstance.h:
2194         * Modules/encryptedmedia/CDMPrivate.h:
2195         * Modules/encryptedmedia/MediaKeySession.cpp:
2196         (WebCore::MediaKeySession::load):
2197         * testing/MockCDMFactory.cpp:
2198         (WebCore::MockCDM::sanitizeSessionId):
2199         (WebCore::MockCDMInstance::loadSession):
2200         * testing/MockCDMFactory.h:
2201
2202 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
2203
2204         [EME] Implement MediaKeySession::sessionClosed()
2205         https://bugs.webkit.org/show_bug.cgi?id=168039
2206
2207         Reviewed by Xabier Rodriguez-Calvar.
2208
2209         Implement the 'session closed' algorithm for MediaKeySession by
2210         following the specified steps. After this algorithm is run, the
2211         session should be considered closed, which we track via the m_closed
2212         member variable on the class. This is set to true before the promise
2213         that's accessible through the 'closed' attribute is resolved.
2214
2215         Because the algorithm requires the CDM instance to store any record
2216         of key usage when the session's type is 'persistent-usage-record', the
2217         storeRecordOfKeyUsage() virtual method is added to the CDMInstance
2218         interface. MockCDMInstance implementation is left unimplemented for now.
2219
2220         JSMediaKeySession::closed() accessor now has a custom implementation
2221         that creates a deferred promise for that object if there's none yet, and
2222         shares it with the wrapped class through the registerClosedPromise()
2223         method, storing a reference to the promise in the m_closedPromise
2224         member variable, or resolving the promise immediately if the session was
2225         already closed.
2226
2227         Test cases added to media/encrypted-media/mock-MediaKeySession-close.html.
2228
2229         * Modules/encryptedmedia/CDMInstance.h:
2230         * Modules/encryptedmedia/MediaKeySession.cpp:
2231         (WebCore::MediaKeySession::registerClosedPromise):
2232         (WebCore::MediaKeySession::sessionClosed):
2233         * Modules/encryptedmedia/MediaKeySession.h:
2234         * bindings/js/JSMediaKeySessionCustom.cpp:
2235         (WebCore::JSMediaKeySession::closed):
2236         * testing/MockCDMFactory.cpp:
2237         (WebCore::MockCDMInstance::storeRecordOfKeyUsage):
2238         * testing/MockCDMFactory.h:
2239
2240 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
2241
2242         [EME] Implement MediaKeySession::updateKeyStatuses(), MediaKeyStatusMap
2243         https://bugs.webkit.org/show_bug.cgi?id=167888
2244
2245         Reviewed by Xabier Rodriguez-Calvar.
2246
2247         Implement MediaKeySession::updateKeyStatuses(), transforming the passed-in
2248         KeyStatusVector into a Vector mapping the key IDs to MediaKeyStatus values.
2249         A keystatuseschange event is fired on the MediaKeySession object afterwards.
2250         The queueing of the task that runs the 'attemp to resume playback' on the
2251         related HTMLMediaElement objects isn't done yet since that algorithm isn't
2252         implemented yet.
2253
2254         The statuses Vector is stored on the MediaKeySession object. That Vector is
2255         then exposed through the MediaKeyStatusMap object, each such object being
2256         unique to one MediaKeySession object. The implementation of MediaKeyStatusMap
2257         thus keeps a reference to the session object as long as that object is alive,
2258         and queries the MediaKeySession::statuses() getter to access the Vector that
2259         contains status information for all the key IDs.
2260
2261         MediaKeyStatusMap::Iterator object keeps a reference to the MediaKeyStatusMap
2262         object and accesses the statuses by indexing into the status Vector of the
2263         related MediaKeySession object.
2264
2265         CDMInstance::updateLicense() now accepts the session ID string as the first
2266         argument, making it possible to specify which session should be updated.
2267
2268         MockCDMFactory::keysForSessionWithID() returns an optional reference to the
2269         Vector value in the session map that lists all the key IDs that are being
2270         stored for that session.
2271
2272         MockCDMInstance::updateLicense() now detects the 'keys-changed' entry in the
2273         passed-in response data, and upon detecting that constructs a KeyStatusVector
2274         object containing all the keys for that session. KeyStatus::Usable is returned
2275         for each object at the moment, but this should be adjustable in the future
2276         through additional parameters passed through the response data. The Vector
2277         object is then passed to the callback and is then passed to the 'update key
2278         statuses' algorithm in MediaKeySession.
2279
2280         Covered by a test case in media/encrypted-media/mock-MediaKeySession-update.html.
2281
2282         * Modules/encryptedmedia/CDMInstance.h:
2283         * Modules/encryptedmedia/MediaKeySession.cpp:
2284         (WebCore::MediaKeySession::MediaKeySession):
2285         (WebCore::MediaKeySession::~MediaKeySession):
2286         (WebCore::MediaKeySession::update):
2287         (WebCore::MediaKeySession::updateKeyStatuses):
2288         * Modules/encryptedmedia/MediaKeySession.h:
2289         * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
2290         (WebCore::MediaKeyStatusMap::MediaKeyStatusMap):
2291         (WebCore::MediaKeyStatusMap::detachSession):
2292         (WebCore::MediaKeyStatusMap::size):
2293         (WebCore::keyIdsMatch):
2294         (WebCore::MediaKeyStatusMap::has):
2295         (WebCore::MediaKeyStatusMap::get):
2296         (WebCore::MediaKeyStatusMap::Iterator::Iterator):
2297         (WebCore::MediaKeyStatusMap::Iterator::next):
2298         * Modules/encryptedmedia/MediaKeyStatusMap.h:
2299         (WebCore::MediaKeyStatusMap::create):
2300         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
2301         * testing/MockCDMFactory.cpp:
2302         (WebCore::MockCDMFactory::keysForSessionWithID):
2303         (WebCore::MockCDMInstance::updateLicense):
2304         * testing/MockCDMFactory.h:
2305
2306 2017-02-09  Simon Fraser  <simon.fraser@apple.com>
2307
2308         Improve IOSurfacePool logging
2309         https://bugs.webkit.org/show_bug.cgi?id=168098
2310
2311         Reviewed by Tim Horton.
2312
2313         Pass a string to DUMP_POOL_STATISTICS so we can tell what's triggering the
2314         logging.
2315
2316         * platform/graphics/cg/IOSurfacePool.cpp:
2317         (WebCore::IOSurfacePool::takeSurface):
2318         (WebCore::IOSurfacePool::addSurface):
2319         (WebCore::IOSurfacePool::evict):
2320         (WebCore::IOSurfacePool::collectionTimerFired):
2321         (WebCore::IOSurfacePool::showPoolStatistics):
2322         * platform/graphics/cg/IOSurfacePool.h:
2323
2324 2017-02-09  Alex Christensen  <achristensen@webkit.org>
2325
2326         Unreviewed, rolling out r212040.
2327
2328         Broke build.  I'm not surprised
2329
2330         Reverted changeset:
2331
2332         "[WebRTC][Mac] Activate libwebrtc"
2333         https://bugs.webkit.org/show_bug.cgi?id=167293
2334         http://trac.webkit.org/changeset/212040
2335
2336 2017-02-09  Chris Dumez  <cdumez@apple.com>
2337
2338         [Mac][WK2] Use MIME type to add file extension to downloads' suggested filenames when missing
2339         https://bugs.webkit.org/show_bug.cgi?id=168077
2340         <rdar://problem/30412595>
2341
2342         Reviewed by Alex Christensen.
2343
2344         Add utility function to MIMETypeRegistry that appends an extension to
2345         a filename if necessary, based on a provided MIME type.
2346
2347         Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
2348                http/tests/download/anchor-download-no-extension.html
2349
2350         * platform/MIMETypeRegistry.cpp:
2351         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
2352         * platform/MIMETypeRegistry.h:
2353         * platform/cocoa/MIMETypeRegistryCocoa.mm:
2354         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
2355
2356 2017-02-09  Youenn Fablet  <youenn@apple.com>
2357
2358         [WebRTC][Mac] Activate libwebrtc
2359         https://bugs.webkit.org/show_bug.cgi?id=167293
2360
2361         Reviewed by Alex Christensen.
2362
2363         * Configurations/WebCore.xcconfig:
2364         * Configurations/WebCoreTestSupport.xcconfig:
2365
2366 2017-02-09  Philip Rogers  <pdr@google.com>
2367
2368         SVG clip-path references can clip out later content
2369         https://bugs.webkit.org/show_bug.cgi?id=164181
2370
2371         Reviewed by Said Abou-Hallawa.
2372
2373         RenderSVGResourceClipper can modify the GraphicsContext state (through the path-only
2374         clipping codepath) so we need to ensure RenderLayer::setupClipPath saves the context
2375         and its caller restores it back so later content is not clipped as well.
2376
2377         This patch is based on a chromium patch by fs@opera.com:
2378         https://chromium.googlesource.com/chromium/src/+/b3f7e7d2c4afb3c7e5c7eb438ff5933cbe2109b3
2379
2380         Test: css3/masking/clip-path-reference-restore.html
2381
2382         * rendering/RenderLayer.cpp:
2383         (WebCore::RenderLayer::setupClipPath): Add a GC save and return true to restore. Also switch to downcast instead of static_cast.
2384
2385 2017-02-09  Filip Pizlo  <fpizlo@apple.com>
2386
2387         SharedArrayBuffer does not need to be in the transfer list
2388         https://bugs.webkit.org/show_bug.cgi?id=168079
2389
2390         Reviewed by Geoffrey Garen and Keith Miller.
2391
2392         Tests: workers/sab/multi-memory-multi-buffer.html
2393                workers/sab/multi-memory.html
2394                workers/sab/no-transfer.html
2395                workers/sab/postMessage-clones.html
2396                workers/sab/sent-from-worker-no-transfer.html
2397                workers/sab/sent-from-worker-transfer.html
2398
2399         The SAB API that we originally implemented required that SABs get put in transfer lists
2400         when they are sent to workers.
2401         
2402         The new SAB API that everyone is converging towards requires that you do not put the
2403         SAB in the transfer list. That's supposed to be an error. Instead, anytime that a SAB
2404         is part of any message to or from a dedicated worker then it is automatically shared.
2405         
2406         The new API provides a lot more clarity about what is supposed to happen in contexts
2407         that support transfering but don't support sharing.
2408         
2409         Right now this patch allows both styles to work, but I hope we can disable the transfer
2410         list capability soon.
2411
2412         * bindings/js/IDBBindingUtilities.cpp:
2413         (WebCore::deserializeIDBValueToJSValue):
2414         * bindings/js/JSMessageEventCustom.cpp:
2415         (WebCore::JSMessageEvent::data):
2416         * bindings/js/SerializedScriptValue.cpp:
2417         (WebCore::CloneSerializer::serialize):
2418         (WebCore::CloneSerializer::CloneSerializer):
2419         (WebCore::CloneSerializer::dumpIfTerminal):
2420         (WebCore::CloneDeserializer::deserialize):
2421         (WebCore::CloneDeserializer::CloneDeserializer):
2422         (WebCore::CloneDeserializer::readTerminal):
2423         (WebCore::SerializedScriptValue::SerializedScriptValue):
2424         (WebCore::SerializedScriptValue::create):
2425         (WebCore::SerializedScriptValue::deserialize):
2426         * bindings/js/SerializedScriptValue.h:
2427         (): Deleted.
2428         * dom/CustomEvent.cpp:
2429         (WebCore::CustomEvent::trySerializeDetail):
2430         * dom/ErrorEvent.cpp:
2431         (WebCore::ErrorEvent::trySerializeError):
2432         * dom/MessageEvent.cpp:
2433         (WebCore::MessageEvent::trySerializeData):
2434         * dom/PopStateEvent.cpp:
2435         (WebCore::PopStateEvent::trySerializeState):
2436         * workers/DedicatedWorkerGlobalScope.cpp:
2437         (WebCore::DedicatedWorkerGlobalScope::postMessage):
2438         * workers/Worker.cpp:
2439         (WebCore::Worker::postMessage):
2440
2441 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
2442
2443         Unreviewed build fix after r212025.
2444
2445         inDocument -> isConnected
2446
2447         * html/FormAssociatedElement.cpp:
2448         (WebCore::FormAssociatedElement::didMoveToNewDocument):
2449         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
2450         * html/HTMLFormElement.cpp:
2451         (WebCore::HTMLFormElement::formElementIndex):
2452
2453 2017-02-09  Chris Dumez  <cdumez@apple.com>
2454
2455         Make sure Event keeps its current target element alive
2456         https://bugs.webkit.org/show_bug.cgi?id=167885
2457         <rdar://problem/30376972>
2458
2459         Reviewed by Brent Fulgham.
2460
2461         Make sure Event keeps its current target element alive to avoid
2462         crashes if it is accessed by JS after it has been garbage collected.
2463
2464         Test: fast/events/currentTarget-gc-crash.html
2465
2466         * dom/Event.cpp:
2467         (WebCore::Event::setCurrentTarget):
2468         * dom/Event.h:
2469         (WebCore::Event::currentTarget):
2470
2471 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
2472
2473         Crash in render tree after dynamically mutating the slot value
2474         https://bugs.webkit.org/show_bug.cgi?id=167502
2475
2476         Reviewed by Antti Koivisto.
2477
2478         The crash was caused by attributeChanged not destructing the render tree after an assigned element had been
2479         removed from its slot. Since the style resolver can no longer find this element in the flat tree, we need to
2480         delete its render object as if the element had been removed from the DOM tree.
2481
2482         Tests: fast/html/details-summary-slot.html
2483                fast/shadow-dom/shadow-slot-attribute-change-crash.html
2484
2485         * dom/Element.cpp:
2486         (WebCore::Element::attributeChanged):
2487         * html/HTMLSummaryElement.cpp:
2488         (WebCore::SummarySlotElement): Added. Always use the default slot regardless of the slot attribute's value.
2489         (WebCore::HTMLSummaryElement::create): Use SummarySlotElement
2490
2491 2017-02-09  Antti Koivisto  <antti@apple.com>
2492
2493         Details element doesn't work correctly when mutating content between closing and opening
2494         https://bugs.webkit.org/show_bug.cgi?id=167310
2495
2496         Reviewed by Ryosuke Niwa.
2497
2498         Tests: fast/html/details-close-modify-open.html
2499                fast/shadow-dom/slot-remove-mutate-add.html
2500
2501         * dom/SlotAssignment.cpp:
2502         (WebCore::SlotAssignment::didChangeSlot):
2503
2504             Always reset the slot assignment when content is mutated.
2505
2506 2017-02-09  Chris Dumez  <cdumez@apple.com>
2507
2508         Crash under FormSubmission::create()
2509         https://bugs.webkit.org/show_bug.cgi?id=167200
2510         <rdar://problem/30096323>
2511
2512         Reviewed by Darin Adler.
2513
2514         The issue is that FormSubmission::create() was iterating over
2515         form.associatedElements() as was calling Element::appendFormData()
2516         in the loop. HTMLObjectElement::appendFormData() was calling
2517         pluginWidget(PluginLoadingPolicy::Load) which causes a synchronous
2518         layout and can fire events (such as focus event) synchronously.
2519         Firing those events synchronously allows the JS to modify the
2520         form.associatedElements() vector we are currently iterating on.
2521
2522         To avoid this issue, we now call pluginWidget(PluginLoadingPolicy::DoNotLoad)
2523         in HTMLObjectElement::appendFormData() as we are not allowed to fire
2524         synchronous events at this point. I also added a security assertion
2525         in FormSubmission::create() to catch cases where we fire JS events
2526         while iterating over the form associated elements to more easily
2527         notice these things in the future.
2528
2529         Test: fast/forms/formsubmission-appendFormData-crash.html
2530
2531         * html/HTMLObjectElement.cpp:
2532         (WebCore::HTMLObjectElement::appendFormData):
2533         * loader/FormSubmission.cpp:
2534         (WebCore::FormSubmission::create):
2535
2536 2017-02-09  Chris Dumez  <cdumez@apple.com>
2537
2538         Crash under HTMLFormElement::registerFormElement()
2539         https://bugs.webkit.org/show_bug.cgi?id=167162
2540
2541         Reviewed by Ryosuke Niwa.
2542
2543         didMoveToNewDocument() was re-registering FormAttributeTargetObserver
2544         even if the element's inDocument was not set yet. As a result, it was
2545         possible for FormAssociatedElement::resetFormOwner() to be called
2546         when the element was in the tree but with its inDocument still being
2547         false (because insertedInto() has not been called yet). This could
2548         end up calling HTMLFormElement::registerFormElement() even though
2549         the element is still recognized as detached. This is an issue because
2550         HTMLFormElement::m_associatedElements's order and its corresponding
2551         indexes (m_associatedElementsBeforeIndex / m_associatedElementsAfterIndex)
2552         rely on the position of the element with regards to the form element
2553         (before / inside / after).
2554
2555         To address the issue, we now only register the FormAttributeTargetObserver
2556         in didMoveToNewDocument() if the inDocument flag is set to true. This
2557         is similar to what is done at other call sites of
2558         resetFormAttributeTargetObserver(). We also ignore the form content
2559         attribute in HTMLFormElement::formElementIndex() if the element is
2560         not connected.
2561
2562         As per the HTML specification [1], the form content attribute is only
2563         taken if the element is connected (i.e. inDocument flag is true).
2564
2565         Note that FormAssociatedElement::findAssociatedForm() was already
2566         ignoring the form content attribute if the element is disconnected.
2567
2568         [1] https://html.spec.whatwg.org/#reset-the-form-owner (step 3)
2569
2570         Test: fast/forms/registerFormElement-crash.html
2571
2572         * html/FormAssociatedElement.cpp:
2573         (WebCore::FormAssociatedElement::didMoveToNewDocument):
2574         Only call resetFormAttributeTargetObserver() if inDocument flag is set,
2575         similarly to what is done at other call sites.
2576
2577         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
2578         Add an assertion to make sure no one call this method on an element that
2579         is not connected.
2580
2581         * html/HTMLFormElement.cpp:
2582         (WebCore::HTMLFormElement::formElementIndex):
2583         Ignore the form content attribute if the element is not connected, as
2584         per the HTML specification [1].
2585
2586 2017-02-09  Antti Koivisto  <antti@apple.com>
2587
2588         Tear down existing renderers when adding a shadow root.
2589         https://bugs.webkit.org/show_bug.cgi?id=167117
2590
2591         Reviewed by Andreas Kling.
2592
2593         Adding a shadow root may cause children no longer be part of the flat tree. If they had renderers
2594         tear down code would no longer reach them.
2595
2596         Test: fast/shadow-dom/attach-shadow-teardown.html
2597
2598         * dom/Element.cpp:
2599         (WebCore::Element::addShadowRoot):
2600
2601             Tear down existing render tree when adding a shadow root.
2602
2603 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
2604
2605         Handle synchronous layout when setting a selection range
2606         https://bugs.webkit.org/show_bug.cgi?id=167092
2607         <rdar://problem/30041640>
2608
2609         Reviewed by Antti Koivisto.
2610
2611         The 'innerTextElement' of a form control can change during layout due
2612         to arbitrary JavaScript executing. Handle the case where the inner text
2613         element has changed so that current render box height is while setting
2614         a selection range.
2615
2616         Test: fast/forms/input-type-change-during-selection.html
2617
2618         * html/HTMLTextFormControlElement.cpp:
2619         (WebCore::HTMLTextFormControlElement::setSelectionRange):
2620
2621 2017-02-09  Alex Christensen  <achristensen@webkit.org>
2622
2623         Fix CMake build.
2624
2625         * PlatformMac.cmake:
2626
2627 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
2628
2629         Disconnect shadow children of root when detaching a frame
2630         https://bugs.webkit.org/show_bug.cgi?id=166851
2631         <rdar://problem/29930443>
2632
2633         Reviewed by Andy Estes.
2634
2635         If the root of the tree we are disconnecting has a shadow element, include it in the set of
2636         things to disconnect.
2637
2638         Tests: fast/shadow-dom/shadow-at-root-during-disconnect.html
2639
2640         * dom/ContainerNodeAlgorithms.cpp:
2641         (WebCore::disconnectSubframes):
2642
2643 2017-02-09  Alexey Proskuryakov  <ap@apple.com>
2644
2645         Remove unused WebThreadRunSync
2646         https://bugs.webkit.org/show_bug.cgi?id=168024
2647
2648         Reviewed by Tim Horton.
2649
2650         * platform/ios/wak/WebCoreThreadRun.cpp:
2651         * platform/ios/wak/WebCoreThreadRun.h:
2652         * platform/ios/wak/WebCoreThreadSystemInterface.cpp:
2653         (InitWebCoreThreadSystemInterface):
2654
2655 2017-02-09  Ryan Haddad  <ryanhaddad@apple.com>
2656
2657         Unreviewed, rolling out r211802.
2658
2659         This change caused fast/regions/inline-block-inside-anonymous-
2660         overflow-with-covered-controls.html to be a flaky failure.
2661
2662         Reverted changeset:
2663
2664         "[Modern Media Controls] Improve handling of <video> with only
2665         audio tracks"
2666         https://bugs.webkit.org/show_bug.cgi?id=167836
2667         http://trac.webkit.org/changeset/211802
2668
2669 2017-02-09  Alex Christensen  <achristensen@webkit.org>
2670
2671         Fix i386 libwebrtc build
2672         https://bugs.webkit.org/show_bug.cgi?id=168038
2673
2674         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
2675         DataChannelInterface::buffered_amount returns a uint64_t, and we want a size_t.
2676         If this overflows, then we've run out of memory and crashed a long time ago.
2677
2678 2017-02-09  Andreas Kling  <akling@apple.com>
2679
2680         Document::settings() should return a const Settings&.
2681         <https://webkit.org/b/168061>
2682
2683         Reviewed by Geoffrey Garen.
2684
2685         - Make Document::settings() return a const reference.
2686         - Added Document::mutableSettings() for all your non-const needs.
2687         - Fixed up settings generator to produce const getters.
2688         - Simplify a few settings() call sites that exposed themselves.
2689
2690         * Modules/applepay/ApplePaySession.cpp:
2691         (WebCore::shouldDiscloseApplePayCapability):
2692         * Modules/mediastream/UserMediaRequest.cpp:
2693         (WebCore::canCallGetUserMedia):
2694         * css/CSSFontFace.cpp:
2695         (WebCore::CSSFontFace::appendSources):
2696         * css/CSSFontSelector.cpp:
2697         (WebCore::resolveGenericFamily):
2698         * css/StyleResolver.h:
2699         (WebCore::StyleResolver::settings):
2700         * dom/Document.h:
2701         (WebCore::Document::settings):
2702         (WebCore::Document::mutableSettings):
2703         * html/FTPDirectoryDocument.cpp:
2704         (WebCore::createTemplateDocumentData):
2705         * html/HTMLCanvasElement.cpp:
2706         (WebCore::shouldEnableWebGL):
2707         * html/HTMLEmbedElement.cpp:
2708         (WebCore::HTMLEmbedElement::rendererIsNeeded):
2709         * html/HTMLSelectElement.cpp:
2710         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2711         * html/ImageDocument.cpp:
2712         (WebCore::ImageDocument::updateDuringParsing):
2713         * page/csp/ContentSecurityPolicy.cpp:
2714         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
2715         * page/make_settings.pl:
2716         (printGetterAndSetter):
2717         * rendering/SimpleLineLayout.cpp:
2718         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
2719
2720 2017-02-09  Jer Noble  <jer.noble@apple.com>
2721
2722         Make passing PlatformAudioData in audioSamplesAvaliable const-correct.
2723         https://bugs.webkit.org/show_bug.cgi?id=168051
2724
2725         Reviewed by Eric Carlson.
2726
2727         Modify all the functions which take a (conceptually) read-only audio buffer const-correct.
2728
2729         Drive-by fix: AudioSampleBufferList::copyFrom() set a ivar pointer to the passed in
2730         AudioBufferList. Ensure that the ivar is reset when copyFrom() returns by using a
2731         SetForScope.
2732
2733         * platform/audio/mac/AudioSampleBufferList.cpp:
2734         (WebCore::AudioSampleBufferList::copyFrom):
2735         * platform/audio/mac/AudioSampleBufferList.h:
2736         * platform/audio/mac/AudioSampleDataSource.cpp:
2737         (WebCore::AudioSampleDataSource::pushSamplesInternal):
2738         (WebCore::AudioSampleDataSource::pushSamples):
2739         * platform/audio/mac/AudioSampleDataSource.h:
2740         * platform/mediastream/RealtimeMediaSource.cpp:
2741         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
2742         * platform/mediastream/RealtimeMediaSource.h:
2743         (WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
2744         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
2745         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
2746         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
2747         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
2748         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
2749         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2750
2751 2017-02-09  Jer Noble  <jer.noble@apple.com>
2752
2753         Fix some logging statements in MediaPlayerPrivateMediaStreamAVFObjC
2754         https://bugs.webkit.org/show_bug.cgi?id=168063
2755
2756         Reviewed by Eric Carlson.
2757
2758         Make the format string match the types passed in (i.e., floats, not strings).
2759
2760         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2761         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes):
2762
2763 2017-02-09  Eric Carlson  <eric.carlson@apple.com>
2764
2765         [MediaStream Mac] Handle NULL m_sampleBufferDisplayLayer
2766         https://bugs.webkit.org/show_bug.cgi?id=168060
2767
2768         Reviewed by Jer Noble.
2769
2770         No new tests, this avoids an occasional crash on the bots.
2771
2772         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2773         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Don't assume
2774         m_sampleBufferDisplayLayer is valid.
2775
2776 2017-02-09  Chris Dumez  <cdumez@apple.com>
2777
2778         Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
2779         https://bugs.webkit.org/show_bug.cgi?id=167964
2780
2781         Reviewed by Youenn Fablet.
2782
2783         Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
2784         after the following WebIDL spec change:
2785         - https://github.com/heycam/webidl/issues/96
2786
2787         This aligns our behavior with other browsers as the spec has been updated to match
2788         the majority.
2789
2790         No new tests, rebaselined existing test.
2791
2792         * bindings/scripts/CodeGeneratorJS.pm:
2793         (GenerateConstructorHelperMethods):
2794         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2795         (WebCore::JSTestCallbackInterfaceConstructor::prototypeForStructure):
2796
2797 2017-02-09  Miguel Gomez  <magomez@igalia.com>
2798
2799         [GTK] scroll with transparent background not repainted after scrollY >= 32768
2800         https://bugs.webkit.org/show_bug.cgi?id=154283
2801
2802         Reviewed by Carlos Garcia Campos.
2803
2804         Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
2805         not able to draw anything when using transformation matrices with values bigger than 32768. When
2806         drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
2807         draw anything in, which causes the reported transparent backgrounds.
2808
2809         The patch modifies the transformation matrices both from the current context and the pattern we
2810         are painting, to avoid them to hold values that cannot stored in 16 bits.
2811
2812         There's still the possibility that this happens, but it would require using a pattern with a size
2813         bigger than 32768.
2814
2815         Based on a previous patch by Gwang Yoon Hwang  <yoon@igalia.com>.
2816
2817         No new tests.
2818
2819         * platform/graphics/cairo/CairoUtilities.cpp:
2820         (WebCore::drawPatternToCairoContext):
2821
2822 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
2823
2824         Unreviewed build fix after r211965.
2825
2826         * dom/Document.cpp:
2827         (WebCore::Document::adoptNode): inDocument -> isConnected
2828
2829 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
2830
2831         Adopting a child node of a script element can run script
2832         https://bugs.webkit.org/show_bug.cgi?id=167318
2833
2834         Reviewed by Darin Adler.
2835
2836         The bug was caused by ScriptElement::childrenChanged indiscriminately running the script.
2837         Do this only if some node has been inserted as spec'ed:
2838
2839         https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model
2840         "The script element is connected and a node or document fragment is inserted into
2841         the script element, after any script elements inserted at that time."
2842
2843         Split NonContentsChildChanged into NonContentsChildInserted and NonContentsChildRemoved to disambiguate
2844         non-contents child such as text and element being removed or inserted. New behavior matches that of
2845         Gecko and Chrome as well as the latest HTML5 specification.
2846
2847         Also deploy NoEventDispatchAssertion in more places. Unfortunately, this results in some DOM trees
2848         internal to WebKit to be mutated while there is NoEventDispatchAssertion in the stack. Added a new RAII
2849         object "EventAllowedScope" to temporarily disable this assertion within such a tree. CachedSVGFont's
2850         ensureCustomFontData used to completely disable this assertion but we no longer have to do this either.
2851
2852         To clarify the new semantics, renamed isEventDispatchForbidden to isEventAllowedInMainThread with
2853         the negated boolean value, and added a new variant isEventDispatchAllowedInSubtree, which checks
2854         isEventDispatchForbidden() is true or if the node was one of an internal DOM node or its descendent
2855         held by EventAllowedScope.
2856
2857         Inspired by https://chromium.googlesource.com/chromium/src/+/604e798ec6ee30f44d57a5c4a44ce3dab3a871ed
2858
2859         Tests: fast/html/script-must-not-run-when-child-is-adopted.html
2860                fast/html/script-must-not-run-when-child-is-removed.html
2861
2862         * dom/CharacterData.cpp:
2863         (WebCore::CharacterData::notifyParentAfterChange): Added NoEventDispatchAssertion.
2864         * dom/ContainerNode.cpp:
2865         (WebCore::ContainerNode::insertBefore): Added NoEventDispatchAssertion around TreeScope's adoptIfNeeded
2866         and insertBeforeCommon as done elsewhere.
2867         (WebCore::ContainerNode::appendChildCommon): Added NoEventDispatchAssertion.
2868         (WebCore::ContainerNode::changeForChildInsertion): Use NonContentsChildInserted here.
2869         (WebCore::ContainerNode::notifyChildRemoved): Added NoEventDispatchAssertion.
2870         (WebCore::ContainerNode::replaceChild): Moved adoptIfNeeded into NoEventDispatchAssertion.
2871         (WebCore::ContainerNode::removeChild): Added NoEventDispatchAssertion.
2872         (WebCore::ContainerNode::parserRemoveChild): Added NoEventDispatchAssertion.
2873         (WebCore::ContainerNode::removeChildren): Call childrenChanged in NoEventDispatchAssertion.
2874         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Moved adoptIfNeeded into
2875         NoEventDispatchAssertion.
2876         (WebCore::dispatchChildInsertionEvents): Check the forbidden-ness more precisely.
2877         (WebCore::dispatchChildRemovalEvents): Ditto.
2878         * dom/ContainerNode.h:
2879         (WebCore::ContainerNode::ChildChange::isInsertion): Added.
2880         * dom/ContainerNodeAlgorithms.cpp:
2881         (WebCore::notifyChildNodeInserted): Check the forbidden-ness more precisely. Here, we check against
2882         insertionPoint since EventAllowedScope checks against the root node.
2883         * dom/Document.cpp:
2884         (WebCore::Document::adoptNode): Assert the node to be adopted has not been inserted back, or else
2885         remove() had resulted in an exception before calling TreeScope::adoptIfNeeded.
2886         * dom/Element.cpp:
2887         (WebCore::Element::childrenChanged):
2888         * dom/NoEventDispatchAssertion.h:
2889         (WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Added a new variant that takes a node.
2890         If this node is a descendent of a node "marked as safe" by EventAllowedScope, then we don't consider
2891         the event dispatch to be forbidden.
2892         (WebCore::NoEventDispatchAssertion::dropTemporarily): Deleted.
2893         (WebCore::NoEventDispatchAssertion::restoreDropped): Deleted.
2894         (WebCore::NoEventDispatchAssertion::EventAllowedScope): Added. A RAII object which marks descendants of
2895         a given node as "safe" for the purpose of checking isEventDispatchForbidden.
2896         (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Added. There can be a chain
2897         of EventAllowedScope objects in the stack. s_currentScope points to the most recently instantiated
2898         RAII object, and each instance remembers prior instance. 
2899         (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Added.
2900         (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Added. Returns true if the given
2901         node is a descendent of any node held by instances of EventAllowedScope.
2902         (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Added. A helper function
2903         for isAllowedNode.
2904         * dom/Node.cpp:
2905         (WebCore::Node::dispatchSubtreeModifiedEvent): Check the forbidden-ness more precisely.
2906         * dom/ScriptElement.cpp:
2907         (WebCore::ScriptElement::childrenChanged): Only prepare the script if we've inserted nodes.
2908         (WebCore::ScriptElement::executeClassicScript): Assert isEventDispatchForbidden is false since running
2909         arbitrary author scripts can, indeed, result dispatch any events.
2910         * dom/ScriptElement.h:
2911         * html/HTMLElement.cpp:
2912         (WebCore::textToFragment): Made this a static local function and not return an exception since there
2913         is no way appendChild called in this function can throw an exception.
2914         (WebCore::HTMLElement::setInnerText): Create EventAllowedScope for the fragment. It's called called by
2915         HTMLTextAreaElement's childrenChanged to update its UA shadow tree, and it's dispatching as event on
2916         a new fragment can't execute arbitrary scripts since it has never been exposed to author scripts.
2917         Because of the precise-ness of this check, this does not disable the assertion for "this" element.
2918         HTMLTextFormControlElement::setInnerTextValue explicitly creates another EventAllowedScope to mark
2919         the shadow tree into which the fragment is inserted safe.
2920         (WebCore::HTMLElement::setOuterText):
2921         * html/HTMLElement.h:
2922         * html/HTMLScriptElement.cpp:
2923         (WebCore::HTMLScriptElement::childrenChanged):
2924         * html/HTMLTextFormControlElement.cpp:
2925         (WebCore::HTMLTextFormControlElement::setInnerTextValue): See above (setInnerText).
2926         * html/track/VTTCue.cpp:
2927         (WebCore::VTTCue::createCueRenderingTree): Create EventAllowedScope for the cloned fragment here since
2928         the VTT tree is never exposed to author scripts.
2929         (WebCore::VTTCue::updateDisplayTree): Ditto.
2930         * loader/cache/CachedSVGFont.cpp:
2931         (WebCore::CachedSVGFont::ensureCustomFontData): Use EventAllowedScope to disable assertions only on
2932         the new SVG document we just created instead of disabling for all DOM trees.
2933         * svg/SVGScriptElement.cpp:
2934         (WebCore::SVGScriptElement::childrenChanged):
2935
2936 2017-02-09  Andreas Kling  <akling@apple.com>
2937
2938         Document should always have a Settings.
2939         <https://webkit.org/b/120172>
2940
2941         Reviewed by Antti Koivisto.
2942
2943         Since a Document can't move between Frames, and it's either frameless
2944         or partnered with a Frame provided at construction time, we know that
2945         it will never need to switch between different Settings objects either.
2946
2947         Give Document a Ref<Settings> that contains either the Frame's Settings
2948         or a default-constructed Settings object if frameless.
2949         Document::settings() is promoted to a reference getter.
2950
2951         The bulk of this patch is removing now-unnecessary null checks.
2952
2953         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2954         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
2955         * Modules/plugins/PluginReplacement.h:
2956         (WebCore::ReplacementPlugin::isEnabledBySettings):
2957         * Modules/plugins/QuickTimePluginReplacement.h:
2958         * Modules/plugins/QuickTimePluginReplacement.mm:
2959         (WebCore::QuickTimePluginReplacement::isEnabledBySettings):
2960         * Modules/plugins/YouTubePluginReplacement.cpp:
2961         (WebCore::YouTubePluginReplacement::isEnabledBySettings):
2962         * Modules/plugins/YouTubePluginReplacement.h:
2963         * Modules/webaudio/AudioContext.cpp:
2964         (WebCore::AudioContext::constructCommon):
2965         * bindings/js/CachedScriptFetcher.cpp:
2966         (WebCore::CachedScriptFetcher::requestScriptWithCache):
2967         * css/CSSFontFace.cpp:
2968         (WebCore::CSSFontFace::appendSources):
2969         (WebCore::CSSFontFace::webFontsShouldAlwaysFallBack):
2970         * css/CSSFontSelector.cpp:
2971         (WebCore::CSSFontSelector::fallbackFontCount):
2972         (WebCore::CSSFontSelector::fallbackFontAt):
2973         * css/StyleBuilderConverter.h:
2974         (WebCore::StyleBuilderConverter::convertResize):
2975         * css/StyleBuilderCustom.h:
2976         (WebCore::StyleBuilderCustom::applyValueFontFamily):
2977         * css/StyleResolver.cpp:
2978         (WebCore::StyleResolver::StyleResolver):
2979         (WebCore::StyleResolver::defaultStyleForElement):
2980         (WebCore::StyleResolver::adjustRenderStyle):
2981         (WebCore::StyleResolver::checkForGenericFamilyChange):
2982         (WebCore::StyleResolver::initializeFontStyle):
2983         * css/StyleResolver.h:
2984         (WebCore::StyleResolver::settings):
2985         (WebCore::StyleResolver::documentSettings): Deleted.
2986         * css/parser/CSSParser.cpp:
2987         (WebCore::CSSParserContext::CSSParserContext):
2988         * dom/Document.cpp:
2989         (WebCore::Document::Document):
2990         (WebCore::Document::setReadyState):
2991         (WebCore::Document::setVisualUpdatesAllowed):
2992         (WebCore::Document::defaultCharsetForLegacyBindings):
2993         (WebCore::Document::recalcStyle):
2994         (WebCore::Document::implicitClose):
2995         (WebCore::Document::minimumLayoutDelay):
2996         (WebCore::Document::setDomain):
2997         (WebCore::Document::audioPlaybackRequiresUserGesture):
2998         (WebCore::Document::videoPlaybackRequiresUserGesture):
2999         (WebCore::Document::storageBlockingStateDidChange):
3000         (WebCore::Document::isTelephoneNumberParsingEnabled):
3001         (WebCore::Document::initSecurityContext):
3002         (WebCore::Document::initDNSPrefetch):
3003         (WebCore::Document::getCachedLocale):
3004         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox):
3005         (WebCore::Document::settings): Deleted.
3006         * dom/Document.h:
3007         (WebCore::Document::settings):
3008         * dom/Element.cpp:
3009         (WebCore::subpixelMetricsEnabled):
3010         * dom/ExtensionStyleSheets.cpp:
3011         (WebCore::ExtensionStyleSheets::pageUserSheet):
3012         * dom/ScriptExecutionContext.cpp:
3013         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
3014         * dom/ScriptableDocumentParser.cpp:
3015         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
3016         * dom/ScriptedAnimationController.cpp:
3017         (WebCore::ScriptedAnimationController::requestAnimationFrameEnabled):
3018         * dom/make_names.pl:
3019         (printConstructorInterior):
3020         * editing/Editor.cpp:
3021         * editing/markup.cpp:
3022         (WebCore::createMarkupInternal):
3023         * html/FTPDirectoryDocument.cpp:
3024         (WebCore::createTemplateDocumentData):
3025         * html/HTMLAnchorElement.cpp:
3026         (WebCore::HTMLAnchorElement::setActive):
3027         (WebCore::HTMLAnchorElement::sendPings):
3028         (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
3029         * html/HTMLAppletElement.cpp:
3030         (WebCore::HTMLAppletElement::canEmbedJava):
3031         * html/HTMLCanvasElement.cpp:
3032         (WebCore::HTMLCanvasElement::getContext2d):
3033         (WebCore::shouldEnableWebGL):
3034         (WebCore::HTMLCanvasElement::shouldAccelerate):
3035         * html/HTMLFormElement.cpp:
3036         (WebCore::HTMLFormElement::submitImplicitly):
3037         * html/HTMLFrameElementBase.cpp:
3038         (WebCore::HTMLFrameElementBase::setLocation):
3039         * html/HTMLImageElement.cpp:
3040         (WebCore::HTMLImageElement::updateImageControls):
3041         * html/HTMLImageLoader.cpp:
3042         (WebCore::HTMLImageLoader::sourceURI):
3043         * html/HTMLInputElement.cpp:
3044         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
3045         * html/HTMLLinkElement.cpp:
3046         (WebCore::HTMLLinkElement::process):
3047         * html/HTMLMediaElement.cpp:
3048         (WebCore::HTMLMediaElement::HTMLMediaElement):
3049         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
3050         (WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
3051         (WebCore::HTMLMediaElement::enterFullscreen):
3052         (WebCore::HTMLMediaElement::exitFullscreen):
3053         (WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks):
3054         (WebCore::HTMLMediaElement::mediaPlayerNetworkInterfaceName):
3055         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
3056         (WebCore::HTMLMediaElement::doesHaveAttribute):
3057         * html/HTMLVideoElement.cpp:
3058         (WebCore::HTMLVideoElement::HTMLVideoElement):
3059         * html/MediaElementSession.cpp:
3060         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
3061         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
3062         (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading):
3063         (WebCore::MediaElementSession::allowsPictureInPicture):
3064         (WebCore::MediaElementSession::maximumMediaSourceBufferSize):
3065         * html/parser/HTMLParserOptions.cpp:
3066         (WebCore::HTMLParserOptions::HTMLParserOptions):
3067         * html/shadow/MediaControlElements.cpp:
3068         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
3069         * loader/LinkLoader.cpp:
3070         (WebCore::LinkLoader::loadLink):
3071         * page/csp/ContentSecurityPolicy.cpp:
3072         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
3073         * rendering/SimpleLineLayout.cpp:
3074         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
3075         * style/StyleFontSizeFunctions.cpp:
3076         (WebCore::Style::computedFontSizeFromSpecifiedSize):
3077         (WebCore::Style::fontSizeForKeyword):
3078         (WebCore::Style::legacyFontSizeForPixelSize):
3079         * style/StyleScope.cpp:
3080         (WebCore::Style::Scope::collectActiveStyleSheets):
3081         * xml/XMLHttpRequest.cpp:
3082         (WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode):
3083
3084 2017-02-09  Antti Koivisto  <antti@apple.com>
3085
3086         Use all cacheable speculatively loaded responses
3087         https://bugs.webkit.org/show_bug.cgi?id=168052
3088
3089         Reviewed by Andreas Kling.
3090
3091         * platform/network/CacheValidation.cpp:
3092         (WebCore::isStatusCodeCacheableByDefault):
3093         (WebCore::isStatusCodePotentiallyCacheable):
3094
3095         Moved here from WebKit2.
3096
3097         * platform/network/CacheValidation.h:
3098
3099 2017-02-09  Eric Carlson  <eric.carlson@apple.com>
3100
3101         [MediaStream] Remove legacy Navigator.webkitGetUserMedia
3102         https://bugs.webkit.org/show_bug.cgi?id=168016
3103
3104         Reviewed by Youenn Fablet.
3105
3106         No new tests, existing tests updated.
3107
3108         * WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
3109         * DerivedSources.make: Ditto.
3110         * CMakeLists.txt: Ditto.
3111         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
3112         * Modules/mediastream/NavigatorUserMedia.js: Removed.
3113         * WebCore.xcodeproj/project.pbxproj:
3114         * page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.
3115
3116 2017-02-09  Antoine Quint  <graouts@apple.com>
3117
3118         [Modern Media Controls] Tapping the skip back button on iOS inline media controls make the controls disappear
3119         https://bugs.webkit.org/show_bug.cgi?id=168049
3120         <rdar://problem/30442660>
3121
3122         Reviewed by Eric Carlson.
3123
3124         Calling elementAtPoint() on the Document will not return an element in the ShadowRoot,
3125         we need to call it on the ShadowRoot. So we now iterate over ancestors of the controls
3126         bar to find the ShadowRoot, if any, and check whether the tapped element is contained
3127         within the controls bar. We only fade the controls bar out if the tapped element is
3128         outside of the controls bar hierarchy.
3129
3130         Test: media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html
3131
3132         * Modules/modern-media-controls/controls/controls-bar.js:
3133         (ControlsBar.prototype.gestureRecognizerStateDidChange):
3134
3135 2017-02-09  Jer Noble  <jer.noble@apple.com>
3136
3137         Configure MockRealtimeAudioSourceMac to generate stereo audio
3138         https://bugs.webkit.org/show_bug.cgi?id=168027
3139
3140         Reviewed by Eric Carlson.
3141
3142         Update MockRealtimeAudioSourceMac to generate stereo audio.
3143
3144         First, because the pattern of creating a AudioBufferList structure (with all it's quirks and
3145         weird requirements) was repeated multiple places, add a new wrapper around ABL called
3146         WebAudioBufferList which takes care of correctly initializing the ABL structure and manages
3147         the lifetime of its data members.
3148
3149         * WebCore.xcodeproj/project.pbxproj:
3150         * platform/audio/PlatformAudioData.h: Added.
3151         (WebCore::PlatformAudioData::kind):
3152         * platform/audio/WebAudioBufferList.cpp: Added.
3153         (WebCore::WebAudioBufferList::WebAudioBufferList):
3154         (WebCore::WebAudioBufferList::buffers):
3155         (WebCore::WebAudioBufferList::bufferCount):
3156         (WebCore::WebAudioBufferList::buffer):
3157         * platform/audio/WebAudioBufferList.h: Added.
3158         (WebCore::WebAudioBufferList::list):
3159         (WebCore::WebAudioBufferList::operator AudioBufferList&):
3160         (WebCore::WebAudioBufferList::kind):
3161         (isType):
3162
3163         Then update existing code to work in terms of WebAudioBufferList:
3164
3165         * platform/audio/mac/AudioSampleBufferList.cpp:
3166         (WebCore::AudioSampleBufferList::AudioSampleBufferList):
3167         (WebCore::AudioSampleBufferList::mixFrom):
3168         (WebCore::AudioSampleBufferList::copyFrom):
3169         (WebCore::AudioSampleBufferList::copyTo):
3170         (WebCore::AudioSampleBufferList::reset):
3171         (WebCore::AudioSampleBufferList::configureBufferListForStream): Deleted.
3172         * platform/audio/mac/AudioSampleBufferList.h:
3173         (WebCore::AudioSampleBufferList::bufferList):
3174         * platform/audio/mac/AudioSampleDataSource.cpp:
3175         (WebCore::AudioSampleDataSource::pushSamples):
3176         * platform/audio/mac/AudioSampleDataSource.h:
3177         * platform/mediastream/RealtimeMediaSource.cpp:
3178         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
3179         * platform/mediastream/RealtimeMediaSource.h:
3180         (WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
3181         * platform/mediastream/mac/AVAudioCaptureSource.h:
3182         * platform/mediastream/mac/AVAudioCaptureSource.mm:
3183         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
3184         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3185         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3186         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
3187         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3188         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3189         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3190
3191         Finally, actually update MockRealtimeAudioSource to emit stereo samples. Importantly, set
3192         the correct values for the m_streamFormat; mBytesPerFrame and mBytesPerPacket are not
3193         multiplied by the channelCount. When generating audio, write to both channels of data.
3194
3195         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
3196         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
3197         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
3198         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
3199         (WebCore::MockRealtimeAudioSourceMac::render):
3200
3201 2017-02-09  Antti Koivisto  <antti@apple.com>
3202
3203         Nullptr crash under styleForFirstLetter
3204         https://bugs.webkit.org/show_bug.cgi?id=167756
3205         rdar://problem/30029354
3206
3207         Reviewed by Zalan Bujtas.
3208
3209         Don't know how we get here. Paper over the crash.
3210
3211         * rendering/RenderBlock.cpp:
3212         (WebCore::styleForFirstLetter):
3213
3214             Use parent first line style if we compute null style for the first letter renderer.
3215
3216 2017-02-09  Antoine Quint  <graouts@apple.com>
3217
3218         [Modern Media Controls] Playing an <audio> element on iOS makes the controls disappear
3219         https://bugs.webkit.org/show_bug.cgi?id=168047
3220         <rdar://problem/30441939>
3221
3222         Reviewed by Eric Carlson.
3223
3224         The controls bar auto-hide behavior is disabled for <audio> elements, but on iOS we have
3225         a TapGestureRecognizer to identify when controls are tapped to toggle controls visibility.
3226         This gesture recognizer would be on at all times, but it should only be enabled when
3227         fadesToIdle is set to true.
3228
3229         Test: media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle.html
3230
3231         * Modules/modern-media-controls/controls/controls-bar.js:
3232         (ControlsBar.prototype.set fadesWhileIdle):
3233
3234 2017-02-09  Antoine Quint  <graouts@apple.com>
3235
3236         [Modern Media Controls] <audio> element does not show any background on iOS
3237         https://bugs.webkit.org/show_bug.cgi?id=168046
3238         <rdar://problem/30441872>
3239
3240         Reviewed by Eric Carlson.
3241
3242         Use a solid gray background for <audio> elements on iOS.
3243
3244         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background.html
3245
3246         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
3247         (:host(audio) .media-controls.ios.inline > .controls-bar:before):
3248
3249 2017-02-09  Antoine Quint  <graouts@apple.com>
3250
3251         [Modern Media Controls] Controls fail to instantiate in an XHTML document
3252         https://bugs.webkit.org/show_bug.cgi?id=168045
3253         <rdar://problem/30290095>
3254
3255         Reviewed by Eric Carlson.
3256
3257         Always use valid HTML and XHTML strings when creating HTML elements.
3258
3259         Test: media/modern-media-controls/media-controller/media-controller-in-xhtml.xhtml
3260
3261         * Modules/modern-media-controls/controls/button.js:
3262         (Button):
3263         * Modules/modern-media-controls/controls/buttons-container.js:
3264         * Modules/modern-media-controls/controls/controls-bar.js:
3265         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
3266         * Modules/modern-media-controls/controls/media-controls.js:
3267         * Modules/modern-media-controls/controls/slider.js:
3268         * Modules/modern-media-controls/controls/status-label.js:
3269         * Modules/modern-media-controls/controls/time-control.js:
3270         * Modules/modern-media-controls/controls/time-label.js:
3271         * Modules/modern-media-controls/controls/tracks-panel.js:
3272
3273 2017-02-09  Michael Catanzaro  <mcatanzaro@igalia.com>
3274
3275         Unreviewed, fix typo in comment
3276
3277         * loader/DocumentWriter.cpp:
3278         (WebCore::DocumentWriter::replaceDocument):
3279
3280 2017-02-09  Andreas Kling  <akling@apple.com>
3281
3282         Disallow accelerated rendering for ginormous 2D canvases.
3283         <https://webkit.org/b/167968>
3284         <rdar://problem/30119483>
3285
3286         Reviewed by Antti Koivisto.
3287
3288         Add a "maximumAccelerated2dCanvasSize" setting that defaults to 5120x2880
3289         which is the 5K resolution for 16:9.
3290
3291         Also added a way to include the "accelerates drawing" flag in layer tree dumps.
3292
3293         Test: compositing/canvas/accelerated-canvas-compositing-size-limit.html
3294
3295         * html/HTMLCanvasElement.cpp:
3296         (WebCore::HTMLCanvasElement::shouldAccelerate):
3297         * page/Frame.h:
3298         * page/Settings.in:
3299         * platform/graphics/GraphicsLayer.cpp:
3300         (WebCore::GraphicsLayer::dumpProperties):
3301         * platform/graphics/GraphicsLayerClient.h:
3302         * rendering/RenderLayerCompositor.cpp:
3303         (WebCore::RenderLayerCompositor::layerTreeAsText):
3304         * testing/Internals.cpp:
3305         (WebCore::toLayerTreeFlags):
3306         * testing/Internals.h:
3307         * testing/Internals.idl:
3308
3309 2017-02-09  Antti Koivisto  <antti@apple.com>
3310
3311         Remove most cases of #if ENABLE(CACHE_PARTITIONING)
3312         https://bugs.webkit.org/show_bug.cgi?id=167990
3313
3314         Reviewed by Sam Weinig.
3315
3316         We'll just return empty string for the partition if partitioning is not enabled.
3317
3318         * html/DOMURL.cpp:
3319         (WebCore::DOMURL::revokeObjectURL):
3320         * inspector/InspectorPageAgent.cpp:
3321         (WebCore::InspectorPageAgent::cachedResource):
3322         * loader/FrameLoader.cpp:
3323         (WebCore::FrameLoader::loadURL):
3324         * loader/archive/cf/LegacyWebArchive.cpp:
3325         (WebCore::LegacyWebArchive::create):
3326         * loader/cache/CachedResource.h:
3327         (WebCore::CachedResource::url):
3328         (WebCore::CachedResource::cachePartition):
3329         * loader/cache/CachedResourceLoader.cpp:
3330         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3331         (WebCore::CachedResourceLoader::requestResource):
3332         * loader/cache/CachedResourceRequest.cpp:
3333         (WebCore::CachedResourceRequest::setDomainForCachePartition):
3334         * loader/cache/CachedResourceRequest.h:
3335         * loader/cache/MemoryCache.cpp:
3336         (WebCore::MemoryCache::add):
3337         (WebCore::MemoryCache::revalidationSucceeded):
3338         (WebCore::MemoryCache::resourceForRequestImpl):
3339         (WebCore::MemoryCache::addImageToCache):
3340         (WebCore::MemoryCache::removeImageFromCache):
3341         (WebCore::MemoryCache::remove):
3342         (WebCore::MemoryCache::removeResourcesWithOrigin):
3343         (WebCore::MemoryCache::removeResourcesWithOrigins):
3344         (WebCore::MemoryCache::getOriginsWithCache):
3345         (WebCore::MemoryCache::originsWithCache):
3346         * loader/cache/MemoryCache.h:
3347         * page/SecurityOrigin.cpp:
3348         (WebCore::SecurityOrigin::domainForCachePartition):
3349         * page/SecurityOrigin.h:
3350         * platform/SchemeRegistry.cpp:
3351         (WebCore::cachePartitioningSchemes):
3352         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
3353         * platform/SchemeRegistry.h:
3354         * platform/ios/WebCoreSystemInterfaceIOS.mm:
3355         * platform/mac/WebCoreSystemInterface.h:
3356         * platform/mac/WebCoreSystemInterface.mm:
3357         * platform/network/ResourceRequestBase.cpp:
3358         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
3359         (WebCore::ResourceRequestBase::setCachePartition):
3360         (WebCore::ResourceRequestBase::partitionName):
3361         * platform/network/ResourceRequestBase.h:
3362         (WebCore::ResourceRequestBase::cachePartition):
3363         (WebCore::ResourceRequestBase::setDomainForCachePartition):
3364         * platform/network/cf/ResourceRequest.h:
3365         (WebCore::ResourceRequest::cachePartition): Deleted.
3366         (WebCore::ResourceRequest::setCachePartition): Deleted.
3367         (WebCore::ResourceRequest::setDomainForCachePartition): Deleted.
3368         * platform/network/cf/ResourceRequestCFNet.cpp:
3369         (WebCore::ResourceRequest::doUpdatePlatformRequest):
3370         (WebCore::ResourceRequest::doUpdateResourceRequest):
3371         (WebCore::ResourceRequest::partitionName): Deleted.
3372         (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy): Deleted.
3373         * platform/network/cf/ResourceResponse.h:
3374         * platform/network/cocoa/ResourceRequestCocoa.mm:
3375         (WebCore::ResourceRequest::doUpdateResourceRequest):
3376         (WebCore::ResourceRequest::doUpdatePlatformRequest):
3377         * testing/Internals.cpp:
3378         (WebCore::Internals::isLoadingFromMemoryCache):
3379
3380 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
3381
3382         Add Web Bluetooth as Not Considering
3383         https://bugs.webkit.org/show_bug.cgi?id=168042
3384
3385         Reviewed by Yusuke Suzuki.
3386
3387         Add Web Bluetooth as a feature not being considered to be implemented in WebKit.
3388
3389         * features.json:
3390
3391 2017-02-08  Simon Fraser  <simon.fraser@apple.com>
3392
3393         Put names on more UIViews for ease of debugging
3394         https://bugs.webkit.org/show_bug.cgi?id=168035
3395
3396         Reviewed by Tim Horton.
3397
3398         Name the page overlay layers.
3399
3400         * page/PageOverlayController.cpp:
3401         (WebCore::PageOverlayController::createRootLayersIfNeeded):
3402         (WebCore::PageOverlayController::installPageOverlay):
3403
3404 2017-02-08  Commit Queue  <commit-queue@webkit.org>
3405
3406         Unreviewed, rolling out r211912.
3407         https://bugs.webkit.org/show_bug.cgi?id=168034
3408
3409         http/tests/media/media-stream/disconnected-frame-permission-
3410         denied.html should be updated (Requested by youenn on
3411         #webkit).
3412
3413         Reverted changeset:
3414
3415         "[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
3416         https://bugs.webkit.org/show_bug.cgi?id=168016
3417         http://trac.webkit.org/changeset/211912
3418
3419 2017-02-08  Youenn Fablet  <youennf@gmail.com>
3420
3421         HTML Link elements should load data URLs as same origin
3422         https://bugs.webkit.org/show_bug.cgi?id=168032
3423         <rdar://problem/30275036>
3424
3425         Reviewed by Alex Christensen.
3426
3427         Test: fast/dom/data-url-css-link-element-cors-active.html
3428
3429         Making CSS data URLs resources considered as same origin when loaded through link elements.
3430         In the future, we should consider remove the data URL same origin flag and fully align with the fetch and HTML spec.
3431
3432         * html/HTMLLinkElement.cpp:
3433         (WebCore::HTMLLinkElement::process):
3434
3435 2017-02-08  Sam Weinig  <sam@webkit.org>
3436
3437         REGRESSION (r193286): Promise chain no longer prevent UI refresh
3438         <rdar://problem/28062149>
3439         https://bugs.webkit.org/show_bug.cgi?id=161291
3440
3441         Reviewed by Geoffrey Garen.
3442
3443         Add new subtest to js/dom/Promise.html
3444
3445         * dom/Microtasks.cpp:
3446         (WebCore::MicrotaskQueue::append):
3447         (WebCore::MicrotaskQueue::remove):
3448         (WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
3449         * dom/Microtasks.h:
3450         The microtask queue needs to be completely drained, even of new microtasks added while
3451         the previous task was run. Remove the m_tasksAppendedDuringMicrotaskCheckpoint as it is
3452         no longer needed.
3453
3454 2017-02-08  Eric Carlson  <eric.carlson@apple.com>
3455
3456         [MediaStream] Remove legacy Navigator.webkitGetUserMedia
3457         https://bugs.webkit.org/show_bug.cgi?id=168016
3458
3459         Reviewed by Youenn Fablet.
3460
3461         No new tests, existing tests updated.
3462
3463         * WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
3464         * DerivedSources.make: Ditto.
3465         * CMakeLists.txt: Ditto.
3466         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
3467         * Modules/mediastream/NavigatorUserMedia.js: Removed.
3468         * WebCore.xcodeproj/project.pbxproj:
3469         * page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.
3470
3471 2017-02-08  Chris Dumez  <cdumez@apple.com>
3472
3473         Use smaller tiles in windows that are not active to facilitate App Napping
3474         https://bugs.webkit.org/show_bug.cgi?id=167997
3475         <rdar://problem/30358835>
3476
3477         Reviewed by Simon Fraser.
3478
3479         Use smaller / non-adaptative tiles in windows that are not active to facilitate
3480         App Napping after <https://trac.webkit.org/r197594>.
3481
3482         Test: compositing/tiling/non-active-window-tiles-size.html
3483
3484         * page/FrameView.cpp:
3485         (WebCore::FrameView::contentsResized):
3486         (WebCore::FrameView::addedOrRemovedScrollbar):
3487         (WebCore::FrameView::computeScrollability):
3488         (WebCore::FrameView::updateTiledBackingAdaptiveSizing):
3489         (WebCore::FrameView::unobscuredContentSizeChanged):
3490         (WebCore::FrameView::setViewExposedRect):
3491         * page/FrameView.h:
3492         * page/Page.cpp:
3493         (WebCore::Page::setActivityState):
3494         (WebCore::Page::isWindowActive):
3495         * page/Page.h:
3496         * platform/graphics/TiledBacking.h:
3497         * platform/graphics/ca/TileController.cpp:
3498         (WebCore::TileController::setTileSizeUpdateDelayDisabledForTesting):
3499         (WebCore::TileController::notePendingTileSizeChange):
3500         * platform/graphics/ca/TileController.h:
3501         * testing/Internals.cpp:
3502         (WebCore::Internals::resetToConsistentState):
3503         (WebCore::Internals::disableTileSizeUpdateDelay):
3504         * testing/Internals.h:
3505         * testing/Internals.idl:
3506
3507 2017-02-08  Chris Dumez  <cdumez@apple.com>
3508
3509         Unreviewed, rolling out r211907.
3510
3511         Broke the build
3512
3513         Reverted changeset:
3514
3515         "[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
3516         https://bugs.webkit.org/show_bug.cgi?id=168016
3517         http://trac.webkit.org/changeset/211907
3518
3519 2017-02-08  Eric Carlson  <eric.carlson@apple.com>
3520
3521         [MediaStream] Remove legacy Navigator.webkitGetUserMedia
3522         https://bugs.webkit.org/show_bug.cgi?id=168016
3523
3524         Reviewed by Youenn Fablet.
3525
3526         No new tests, existing tests updated.
3527
3528         * WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
3529         * DerivedSources.make: Ditto.
3530         * CMakeLists.txt: Ditto.
3531         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
3532         * Modules/mediastream/NavigatorUserMedia.js: Removed.
3533         * WebCore.xcodeproj/project.pbxproj:
3534
3535 2017-02-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3536
3537         Add kUTTypeUTF8PlainText and kUTTypeJPEG to the list of compatible content types in DragData
3538         https://bugs.webkit.org/show_bug.cgi?id=167942
3539         <rdar://problem/30315079>
3540
3541         Reviewed by Tim Horton.
3542
3543         Adds UTI types for dragging UTF8 plain text and JPEG images to the list of supported types in DragDataMac.mm.
3544         Also handles reading these types in PasteboardMac.mm. I verified manually with a test app that if a platform
3545         NSView vends only UTF8 plaintext or JPEG images when dragging, WebKit is able to read the contents of the
3546         pasteboard as text and an image, respectively.
3547
3548         New TestWebKitAPI tests in DragAndDropPasteboardTests.mm.
3549
3550         * platform/mac/DragDataMac.mm:
3551         (WebCore::DragData::containsCompatibleContent):
3552         * platform/mac/PasteboardMac.mm:
3553         (WebCore::Pasteboard::read):
3554
3555 2017-02-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3556
3557         getIntersectionList always returns empty NodeList until layout is complete
3558         https://bugs.webkit.org/show_bug.cgi?id=81423
3559
3560         Reviewed by Simon Fraser.
3561
3562         Layout needs to be forced before trying to figure out which SVGElements
3563         intersect with a given SVGRect. We do the same thing in the DOM API
3564         Element::getBoundingClientRect().
3565
3566         Test: svg/custom/intersection-list-before-layout.html
3567
3568         * svg/SVGSVGElement.cpp:
3569         (WebCore::SVGSVGElement::getIntersectionList):
3570
3571 2017-02-08  Antoine Quint  <graouts@apple.com>
3572
3573         [Modern Media Controls] Implement reduced and tight padding modes
3574         https://bugs.webkit.org/show_bug.cgi?id=167933
3575         <rdar://problem/30396994>
3576
3577         Reviewed by Dean Jackson.
3578
3579         The design specs for modern media controls mandate the following for inline media controls:
3580
3581             - controls at or below 300pt width use a 12pt left margin for the left buttons container,
3582             and a 12pt right margin for the right buttons container, and 16pth button margin inside
3583             both containers ("reduced padding mode").
3584
3585             - when dropping at or below 120pt width, controls use an 8pt left margin for
3586             the left buttons container, and an 8pt right margin for the right buttons container, and
3587             12pt button margin inside both containers and a shorter bar (25pt) ("compact mode").
3588
3589             - in the case of audio controls, at 400pt or less, controls switch to 12pt margins and
3590             button margins for both buttons containers ("tight padding mode").
3591
3592         The "compact" mode was already implemented as a dedicated MacOSInlineMediaControls subclass.
3593         Since we now have a more generic need to vary the metrics used for inline media controls on
3594         macOS, we add new features to MacOSInlineMediaControls to support varying metrics based on
3595         the controls' "layoutTraits" property.
3596
3597         So MediaController is changed such that it knows to use the new TightPadding and ReducedPadding
3598         layout traits based on the conditions defined above, and _updateControlsIfNeeded() is changed
3599         to set the "layoutTraits" property on the controls whenever called, which in our case is most
3600         relevantly a "resize" event on the shadow root or a TrackEvent on the video tracks (to determine
3601         when we're possibly changing between a video and audio file).
3602
3603         As a result, the "layoutTraits" setter is called on MacOSInlineMediaControls, which updates
3604         the metrics for the various buttons containers, but also notifies the buttons contained
3605         within that layout traits may have changed, since some buttons support a "compact" appearance
3606         that is shorter and require a different image file. To that end, IconButton has been updated
3607         so that it may be notified of a layout traits change through a new layoutTraitsDidChange()
3608         method, that checks whether the current layout traits differ from those last used when loading
3609         the icon.
3610
3611         Tests: media/modern-media-controls/icon-button/icon-button-change-layout-traits.html
3612                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-buttons-styles.html
3613                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-controls-bar-styles.html
3614                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact.html
3615                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding.html
3616                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding.html
3617                media/modern-media-controls/media-controller/media-controller-compact.html
3618                media/modern-media-controls/media-controller/media-controller-reduced-padding.html
3619                media/modern-media-controls/media-controller/media-controller-tight-padding.html
3620
3621         * Modules/modern-media-controls/controls/icon-button.js:
3622         (IconButton.prototype.set iconName):
3623         (IconButton.prototype.layoutTraitsDidChange):
3624         (IconButton.prototype._loadImage):
3625         * Modules/modern-media-controls/controls/layout-item.js:
3626         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.js: Removed.
3627         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
3628         (MacOSInlineMediaControls.prototype.get layoutTraits):
3629         (MacOSInlineMediaControls.prototype.set layoutTraits):
3630         (MacOSInlineMediaControls.prototype._matchLayoutTraits):
3631         * Modules/modern-media-controls/js-files:
3632         * Modules/modern-media-controls/media/media-controller.js:
3633         (MediaController):
3634         (MediaController.prototype.get layoutTraits):
3635         (MediaController.prototype.handleEvent):
3636         (MediaController.prototype._updateControlsIfNeeded):
3637         (MediaController.prototype._controlsClassForLayoutTraits):
3638         (MediaController.prototype._shouldFadeBetweenControls): Deleted.
3639         (MediaController.prototype._controlsClass): Deleted.
3640         * WebCore.xcodeproj/project.pbxproj:
3641
3642 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
3643
3644         Move private methods from WKGraphics.h to a separate header file
3645         https://bugs.webkit.org/show_bug.cgi?id=167996
3646
3647         Reviewed by Alexey  Proskuryakov.
3648
3649         * platform/ios/wak/WKGraphicsInternal.h: Added.
3650         * WebCore.xcodeproj/project.pbxproj: Added WKGraphicsInternal.h
3651         * platform/ios/wak/WKGraphics.h: Moved methods to WKGraphicsInternal.h
3652         * platform/graphics/mac/GraphicsContextMac.mm: Included new header file.
3653         * platform/ios/wak/WKGraphics.mm: Same.
3654
3655 2017-02-08  Brady Eidson  <beidson@apple.com>
3656
3657         Opt-out iBooks from synchronous willSendRequest on iOS.
3658         <rdar://problem/30129966> and https://bugs.webkit.org/show_bug.cgi?id=168006
3659
3660         Reviewed by Brent Fulgham.
3661
3662         No new tests (Not a testable behavior change at this time).
3663
3664         * platform/network/mac/ResourceHandleMac.mm:
3665         (WebCore::synchronousWillSendRequestEnabled): iBooks never gets synchronous willSendRequest:
3666
3667 2017-02-08  Sam Weinig  <sam@webkit.org>
3668
3669         Split JSDOMConstructor.h/cpp up by class
3670         https://bugs.webkit.org/show_bug.cgi?id=167958
3671
3672         Reviewed by Tim Horton.
3673
3674         Splits JSDOMConstructor up by class.
3675         - Renames DOMConstructorObject to JSDOMConstructorBase.
3676         - Renames DOMConstructorWithDocument to JSDOMConstructorWithDocument.
3677         - Renames DOMConstructorJSBuiltinObject to JSDOMBuiltinConstructorBase.
3678         - Renames JSBuiltinConstructor to JSDOMBuiltinConstructor.
3679
3680         * CMakeLists.txt:
3681         * WebCore.xcodeproj/project.pbxproj:
3682         * bindings/js/JSBindingsAllInOne.cpp:
3683         Add new files.
3684
3685         * bindings/js/JSDOMBinding.h:
3686         (WebCore::propertyNameToString): Deleted.
3687         (WebCore::propertyNameToAtomicString): Deleted.
3688         * bindings/js/JSDOMBuiltinConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
3689         * bindings/js/JSDOMBuiltinConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
3690         * bindings/js/JSDOMBuiltinConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
3691         * bindings/js/JSDOMConstructor.cpp: Removed.
3692         * bindings/js/JSDOMConstructor.h: Remove all classes other than JSDOMConstructor.
3693         * bindings/js/JSDOMConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
3694         * bindings/js/JSDOMConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
3695         * bindings/js/JSDOMConstructorNotConstructable.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
3696         * bindings/js/JSDOMConstructorWithDocument.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
3697         * bindings/js/JSDOMConstructorWithDocument.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
3698         * bindings/js/JSDOMNamedConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
3699
3700         * bindings/js/JSDOMConvertStrings.h:
3701         (WebCore::propertyNameToString):
3702         (WebCore::propertyNameToAtomicString):
3703         Move these here from JSDOMBinding.
3704
3705         * bindings/js/JSHTMLElementCustom.cpp:
3706         (WebCore::constructJSHTMLElement):
3707         * bindings/js/JSMutationObserverCustom.cpp:
3708         (WebCore::constructJSMutationObserver):
3709         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
3710         * bindings/js/JSStorageCustom.cpp:
3711         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp:
3712         (WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
3713         * bindings/js/JSWorkerCustom.cpp:
3714         (WebCore::constructJSWorker):
3715         * bindings/scripts/CodeGeneratorJS.pm:
3716         (GetConstructorTemplateClassName):
3717         (GenerateConstructorDeclaration):
3718         Update includes/names.
3719
3720         * dom/StaticRange.cpp:
3721         (WebCore::StaticRange::~StaticRange):
3722         * dom/StaticRange.h:
3723         Add out-of-line destructor, so Node.h does not have to be included.
3724
3725 2017-02-08  Joseph Pecoraro  <pecoraro@apple.com>
3726
3727         Initialize the main RunLoop in iOS WebKitLegacy
3728         https://bugs.webkit.org/show_bug.cgi?id=167953
3729
3730         Reviewed by Alexey Proskuryakov.
3731
3732         * platform/ios/wak/WebCoreThread.mm:
3733         (StartWebThread):
3734         Initialize the main runloop on the main thread during iOS WebKit initialization.
3735
3736 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
3737
3738         Move private methods from WKContentObservation.h to a separate header file
3739         https://bugs.webkit.org/show_bug.cgi?id=167998
3740
3741         Reviewed by Alexey Proskuryakov.
3742
3743         * WebCore.xcodeproj/project.pbxproj: Added WKContentObservationInternal.h
3744         * platform/ios/wak/WKContentObservationInternal.h: Added.
3745         * platform/ios/wak/WKContentObservation.h: Moved methods to WKContentObservationInternal.h
3746         * platform/ios/wak/WKContentObservation.cpp: Included new header file.
3747         * page/DOMTimer.cpp: Same.
3748         * page/DOMWindow.cpp: Same.
3749         * style/RenderTreeUpdater.cpp: Same.
3750
3751 2017-02-08  Youenn Fablet  <youenn@apple.com>
3752
3753         RTCPeerConnection constructor can take null as input
3754         https://bugs.webkit.org/show_bug.cgi?id=167992
3755
3756         Reviewed by Chris Dumez.
3757
3758         Covered by updated test.
3759
3760         RTCPeerConnection takes an optional Dictionary as input.
3761         As per https://heycam.github.io/webidl/#es-dictionary, null is converted to an empty dictionary.
3762
3763         * Modules/mediastream/RTCPeerConnection.js:
3764         (initializeRTCPeerConnection):
3765
3766 2017-02-08  Andreas Kling  <akling@apple.com>
3767
3768         No need for CachedFrame to detach custom scrollbars.
3769         <https://webkit.org/b/167995>
3770
3771         Reviewed by Sam Weinig.
3772
3773         Custom scrollbars have already been torn down with the rest of the render tree
3774         by the time we're creating a CachedFrame.
3775
3776         * history/CachedFrame.cpp:
3777         (WebCore::CachedFrame::CachedFrame):
3778
3779 2017-02-08  Zalan Bujtas  <zalan@apple.com>
3780
3781         Simple line layout: Fix printReason for unsupported overflow values.
3782         https://bugs.webkit.org/show_bug.cgi?id=168000
3783
3784         Reviewed by Simon Fraser.
3785
3786         Not testable.
3787
3788         * rendering/SimpleLineLayout.cpp:
3789         (WebCore::SimpleLineLayout::canUseForStyle):
3790         (WebCore::SimpleLineLayout::printReason):
3791
3792 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
3793
3794         Remove WebCoreObjCDeallocWithWebThreadLock from header file
3795         https://bugs.webkit.org/show_bug.cgi?id=167987
3796
3797         Reviewed by Alexey Proskuryakov.
3798
3799         * platform/ios/wak/WebCoreThread.mm: Added WebCoreObjCDeallocWithWebThreadLock.
3800         * platform/ios/wak/WebCoreThreadMessage.h: Removed WebCoreObjCDeallocWithWebThreadLock.
3801
3802 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
3803
3804         Move WKMouseInRect to WAKView.mm
3805         https://bugs.webkit.org/show_bug.cgi?id=167989
3806
3807         Reviewed by Alexey Proskuryakov.
3808
3809         * platform/ios/wak/WAKAppKitStubs.h: Removed WKMouseInRect.
3810         * platform/ios/wak/WAKAppKitStubs.m:
3811         (WKMouseInRect): Deleted.
3812         * platform/ios/wak/WAKView.mm: 
3813         (-[WAKView mouse:inRect:]): Added the logic of WKMouseInRect here instead of separate function call.
3814
3815 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
3816
3817         Remove unused method WebCore::PluginData::pluginNameForMimeType
3818         https://bugs.webkit.org/show_bug.cgi?id=167986
3819
3820         Reviewed by Anders Carlsson.
3821
3822         * plugins/PluginData.cpp:
3823         (WebCore::PluginData::pluginNameForWebVisibleMimeType): Deleted.
3824         * plugins/PluginData.h: Removed pluginNameForWebVisibleMimeType.
3825
3826 2017-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3827
3828         [GTK] Fix translatable form validation messages
3829         https://bugs.webkit.org/show_bug.cgi?id=167984
3830
3831         Reviewed by Michael Catanzaro.
3832
3833         Most of them are just wrong. Use the same mesages than mac, which also makes some tests pass.
3834
3835         Fixes: fast/forms/validation-message-maxLength.html
3836                fast/forms/validationMessage.html
3837
3838         * platform/gtk/LocalizedStringsGtk.cpp:
3839         (WebCore::validationMessageValueMissingText):
3840         (WebCore::validationMessageValueMissingForCheckboxText):
3841         (WebCore::validationMessageValueMissingForFileText):
3842         (WebCore::validationMessageValueMissingForMultipleFileText):
3843         (WebCore::validationMessageValueMissingForRadioText):
3844         (WebCore::validationMessageValueMissingForSelectText):
3845         (WebCore::validationMessageTypeMismatchText):
3846         (WebCore::validationMessageTypeMismatchForEmailText):
3847         (WebCore::validationMessageTypeMismatchForMultipleEmailText):
3848         (WebCore::validationMessageTypeMismatchForURLText):
3849         (WebCore::validationMessagePatternMismatchText):
3850         (WebCore::validationMessageTooShortText):
3851         (WebCore::validationMessageTooLongText):
3852         (WebCore::validationMessageRangeUnderflowText):
3853         (WebCore::validationMessageRangeOverflowText):
3854         (WebCore::validationMessageStepMismatchText):
3855         (WebCore::validationMessageBadInputForNumberText):
3856
3857 2017-02-08  Chris Dumez  <cdumez@apple.com>
3858
3859         Add support for enhanced privacy diagnostic logging
3860         https://bugs.webkit.org/show_bug.cgi?id=167948
3861         <rdar://problem/30385112>
3862
3863         Reviewed by Antti Koivisto.
3864
3865         Add new logDiagnosticMessageWithEnhancedPrivacy() method to DiagnosticLoggingClient
3866         that is used for enhanced privacy logging. Start using this new API to log domains
3867         that are visited.
3868
3869         * loader/EmptyClients.cpp:
3870         * loader/FrameLoader.cpp:
3871         (WebCore::logNavigation):
3872         (WebCore::FrameLoader::loadWithDocumentLoader):
3873         * page/DiagnosticLoggingClient.h:
3874         * page/DiagnosticLoggingKeys.cpp:
3875         (WebCore::DiagnosticLoggingKeys::domainVisitedKey):
3876         * page/DiagnosticLoggingKeys.h:
3877
3878 2017-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3879
3880         [GStreamer] Critical warnings when media player is destroyed
3881         https://bugs.webkit.org/show_bug.cgi?id=167981
3882
3883         Reviewed by Xabier Rodriguez-Calvar.
3884
3885         It can happen that the source doesn't have a parent when we try to disconnect the element-added signal.
3886
3887         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3888         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3889         (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
3890
3891 2017-02-08  Miguel Gomez  <magomez@igalia.com>
3892
3893         [GTK] Reduce TiledBackingStore tile coverage when on memory pressure state
3894         https://bugs.webkit.org/show_bug.cgi?id=167980
3895
3896         Reviewed by Carlos Garcia Campos.
3897
3898         Use a smaller coverAreaMultiplier in the TiledBackingStore when in memory pressure situation, to reduce
3899         the amount of tiles created.
3900
3901         No new tests.
3902
3903         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
3904         (WebCore::TiledBackingStore::createTilesIfNeeded):
3905         (WebCore::TiledBackingStore::createTiles):
3906         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
3907
3908 2017-02-08  Zan Dobersek  <zdobersek@igalia.com>
3909
3910         [EME] Implement MediaKeySession::remove()
3911         https://bugs.webkit.org/show_bug.cgi?id=167870
3912
3913         Reviewed by Xabier Rodriguez-Calvar.
3914
3915         Implement MediaKeySession::remove() as outlined in the specification.
3916
3917         The CDMInstance::removeSessionData() virtual method is added. CDMInstance
3918         implementors should remove any session data stored for the session that's
3919         represented by the passed-in session ID and session type.
3920
3921         Once the session data is removed, the passed-in callback should be invoked
3922         by the CDMInstance object so that MediaKeySession can immediately queue a
3923         task in which it updates key statuses and expiration, reject the promise if
3924         the data removal failed, or enqueue any license-release message and finally
3925         successfully resolve the promise.
3926
3927         MockCDMFactory gains the removeKeysFromSessionWithID() method that purges
3928         the keys for a given session ID. The method is called from
3929         MockCDMInstance::removeSessionData() implementation, which passes the
3930         removed keys to the RemoveSessionDataCallback, along with a license-release
3931         message that is checked in the tests. The key removal itself isn't tested
3932         yet because the MediaKeySession's `update key statuses` algorithm isn't
3933         implemented yet.
3934
3935         Test: media/encrypted-media/mock-MediaKeySession-remove.html
3936
3937         * Modules/encryptedmedia/CDMInstance.h:
3938         * Modules/encryptedmedia/MediaKeySession.cpp:
3939         (WebCore::MediaKeySession::remove):
3940         * testing/MockCDMFactory.cpp:
3941         (WebCore::MockCDMFactory::removeKeysFromSessionWithID):
3942         (WebCore::MockCDMInstance::removeSessionData):
3943         * testing/MockCDMFactory.h:
3944
3945 2017-02-08  Zan Dobersek  <zdobersek@igalia.com>
3946
3947         [EME] Implement MediaKeySession::close()
3948         https://bugs.webkit.org/show_bug.cgi?id=167869
3949
3950         Reviewed by Xabier Rodriguez-Calvar.
3951
3952         Implement MediaKeySession::close() as outlined in the specification.
3953
3954         The CDMInstance::closeSession() virtual method, when called, should
3955         close the session that's represented by the passed-in session ID on
3956         the CDMInstance implementor object. That's the same session ID that
3957         the CDMInstance object passes to the MediaKeySession class through
3958         the callback that's provided to the updateLicense call.
3959
3960         The CloseSessionCallback, passed to CDMInstance::closeSession(),
3961         should be invoked by the CDMInstance implementor once the session
3962         is closed. When that is invoked, another task is queued for the
3963         MediaKeySession object that runs the `session closed` algorithm
3964         and resolves the promise.
3965
3966         MockCDMInstance::closeSession() is defined to remove the session
3967         from the MockCDMFactory object and invoke the CloseSessionCallback.
3968
3969         Test: media/encrypted-media/mock-MediaKeySession-close.html
3970
3971         * Modules/encryptedmedia/CDMInstance.h:
3972         * Modules/encryptedmedia/MediaKeySession.cpp:
3973         (WebCore::MediaKeySession::close):
3974         * testing/MockCDMFactory.cpp:
3975         (WebCore::MockCDMInstance::closeSession):
3976         * testing/MockCDMFactory.h:
3977
3978 2017-02-08  Zan Dobersek  <zdobersek@igalia.com>
3979
3980         [EME] Alias CDMInstance enums to the specification-defined enums
3981         https://bugs.webkit.org/show_bug.cgi?id=167896
3982
3983         Reviewed by Sam Weinig.
3984
3985         Simplify the enums in the CDMInstance class by simply aliasing them
3986         to the EME specification-defined enums. CDMInstance::KeyStatus and
3987         CDMInstance::MessageType were already direct copies of the
3988         MediaKeyStatus and MediaKeyMessageType enums, while the
3989         CDMInstance::LicenseType had the members as MediaKeySessionType,
3990         but with slightly different names.
3991
3992         No changes in behavior.
3993
3994         * Modules/encryptedmedia/CDMInstance.h:
3995         * Modules/encryptedmedia/MediaKeySession.cpp:
3996         (WebCore::MediaKeySession::generateRequest):
3997         (WebCore::MediaKeySession::update):
3998         * testing/MockCDMFactory.cpp:
3999         (WebCore::MockCDMInstance::requestLicense):
4000
4001 2017-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
4002
4003         REGRESSION(r210740): [GTK] 2.15 broke embedded videos in GNOME's yelp app
4004         https://bugs.webkit.org/show_bug.cgi?id=167887
4005
4006         Reviewed by Michael Catanzaro.
4007
4008         Update the m_renderingCanBeAccelerated when accelerated rendering state changes.
4009
4010         * platform/graphics/g