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