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