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