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