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