7dfe48ed27b680a988d9d5958cadaf87ba887cae
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2
3         WebRTC: Misc MediaStreamEvent fixes: Update build flag and remove PassRefPtr usage
4         https://bugs.webkit.org/show_bug.cgi?id=159132
5
6         Reviewed by Eric Carlson.
7
8         Use the WEB_RTC build flag instead of MEDIA_STREAM since this event is related to
9         RTCPeerConnection. Also remove PassRefPtr usage.
10
11         Updated existing expected results.
12
13         * Modules/mediastream/MediaStreamEvent.cpp:
14         (WebCore::MediaStreamEvent::create):
15         (WebCore::MediaStreamEvent::MediaStreamEvent):
16         * Modules/mediastream/MediaStreamEvent.h:
17         * Modules/mediastream/MediaStreamEvent.idl:
18         * dom/EventNames.in:
19
20 2016-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
21
22         REGRESSION(r202337) [WebRTC] Crash when loading html5test.com
23         https://bugs.webkit.org/show_bug.cgi?id=159145
24
25         Reviewed by Eric Carlson.
26
27         MediaEndpointPeerConnection uses an implementation of the MediaEndpoint interface to
28         interact with the port's WebRTC backend. A mock (MockMediaEndpoint) is used for testing.
29         This change adds an "empty" MediaEndpoint implementation that simplifies the case when a
30         port builds and tests with MediaEndpointPeerConnection/MockMediaEndpoint, but doesn't have
31         a "real" MediaEndpoint implementation yet (to use with MiniBrowser).
32
33         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
34         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
35         * platform/mediastream/MediaEndpoint.cpp:
36         (WebCore::EmptyRealtimeMediaSource::create):
37         (WebCore::EmptyRealtimeMediaSource::EmptyRealtimeMediaSource):
38         (WebCore::EmptyMediaEndpoint::EmptyMediaEndpoint):
39         (WebCore::createMediaEndpoint):
40
41 2016-06-29  Alejandro G. Castro  <alex@igalia.com>
42
43         Fix assertion in debug build when creating the SocketStreamHandle object.
44
45         We have to call relaxAdoptionRequirement to avoid the assertion
46         when protecting the non-adopted SocketStreamHandle we are
47         creating. Update to r202370.
48
49         Rubber-stamped by Carlos Garcia Campos.
50
51         * platform/network/soup/SocketStreamHandleSoup.cpp:
52         (WebCore::SocketStreamHandle::SocketStreamHandle):
53
54 2016-06-29  David Kilzer  <ddkilzer@apple.com>
55
56         Throw exceptions for invalid number of channels for ConvolverNode
57         <https://webkit.org/b/159238>
58         <rdar://problem/27020410>
59
60         Reviewed by Brent Fulgham.
61
62         Fix based on a Blink change (patch by <rtoy@chromium.org>):
63         <https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>
64
65         Test: webaudio/convolver-channels.html
66
67         * Modules/webaudio/ConvolverNode.cpp:
68         (WebCore::ConvolverNode::setBuffer): Throw an exception for
69         anything but 1, 2 or 4 channels.
70
71 2016-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
72
73         REGRESSION(r198782, r201043): [image-decoders] Flickering with some animated gif
74         https://bugs.webkit.org/show_bug.cgi?id=159089
75
76         Reviewed by Antonio Gomes.
77
78         There's some flickering when loading big enough animated gifs running the animation in a loop. The first time it
79         loads everything is fine, but after the first loop iteration there are several flickering effects, once every
80         time the animation finishes and some others happening in the middle of the animation loop. The flickering
81         happens because we fail to render some of the frames, and it has two diferent causes:
82
83          - In r198782, ImageDecoder::createFrameImageAtIndex(), was modified to check first if the image is empty to
84         return early, and then try to get the frame image from the decoder. This is the aone causing the flickering
85         always on the first frame after one iteration. It happens because ImageDecoder::size() is always empty at that
86         point. The first time doesn't happen because the gif is loaded and BitmapImage calls isSizeAvailable() from
87         BitmapImage::dataChanged(). The isSizeAvailable call makes the gif decoder calculate the size. But for the next
88         iterations, frames are cached and BitmapImage already has the decoded data so isSizeAvailable is not called
89         again. When createFrameImageAtIndex() is called again for the first frame, size is empty until the gif decoder
90         creates the reader again, which happens when frameBufferAtIndex() is called, so after that the size is
91         available. So, we could call isSizeAvailable before checking the size, or simply do the check after the
92         frameBufferAtIndex() call as we used to do.
93
94          - In r201043 BitmapImage::destroyDecodedDataIfNecessary() was fixed to use the actual bytes used by the frame
95         in order to decide whether to destroy decoded data or not. This actually revealed a bug, it didn't happen before
96         because we were never destroying frames before. The bug is in the gif decoder that doesn't correctly handle the
97         case of destroying only some of the frames from the buffer cache. The gif decoder is designed to always process the
98         frames in order, the reader keeps an index of the currently processed frame, so when some frames are read from the
99         cache, and then we ask the decoder for a not cached frame, the currently processed frame is not in sync with the
100         actual frame we are asking for, and we end do not processing any frame at all.
101
102         * platform/image-decoders/ImageDecoder.cpp:
103         (WebCore::ImageDecoder::createFrameImageAtIndex): Check the size after calling frameBufferAtIndex().
104         * platform/image-decoders/gif/GIFImageDecoder.cpp:
105         (WebCore::GIFImageDecoder::clearFrameBufferCache): Delete the reader when clearing the cache since it's out of sync.
106
107 2016-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>
108
109         [GStreamer] Adaptive streaming issues
110         https://bugs.webkit.org/show_bug.cgi?id=144040
111
112         Reviewed by Philippe Normand.
113
114         There are multiple deadlocks in the web process when HLS content is loaded by GStreamer. It happens because gst
115         is using several threads to download manifest, fragments, monitor the downloads, etc. To download the fragments
116         and manifest it always creates the source element in a separate thread, something that is not actually expected
117         to happen in WebKit source element. Our source element is always scheduling tasks (start, stop, need-data,
118         enough-data and seek) to the main thread, and those downloads that use the ResourceHandleStreamingClient
119         (there's no player associated) also happen in the main thread, because libsoup calls all its async callbacks in
120         the main thread. So, the result is that it can happen that we end up blocking the main thread in a lock until
121         the download finishes, but the download never finishes because tasks are scheduled in the main thread that is
122         blocked in a lock. This can be prevented by always using a secondary thread for downloads made by
123         ResourceHandleStreamingClient, using its own run loop with a different GMainContext so that libsoup sends
124         callbacks to the right thread. We also had to refactor the tasks a bit, leaving the thread safe parts to be run
125         in the calling thread always, and only scheduling to the main thread in case of not using
126         ResourceHandleStreamingClient and only for the non thread safe parts.
127         This patch also includes r200455 that was rolled out, but it was a perfectly valid workaround for GST bug.
128
129         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
130         (WTF::ensureGRef): Consume the floating ref if needed.
131         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
132         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
133         (webkit_web_src_init): Check if object is being created in the main thread.
134         (webKitWebSrcStop): Stop the media resource loader in the main thread and the resource handle streaming in the
135         current thread.
136         (webKitWebSrcStart): Start the media resource loader in the main thread and the resource handle streaming in
137         the current thread.
138         (webKitWebSrcChangeState): Call webKitWebSrcStart and webKitWebSrcStop in the current thread.
139         (webKitWebSrcNeedData): Update status in the current thread and notify the media resource loader in the main thread.
140         (webKitWebSrcEnoughData): Ditto.
141         (webKitWebSrcSeek): Ditto.
142         (webKitWebSrcSetMediaPlayer): Add an assert to ensure that source elements used by WebKit are always created in
143         the main thread.
144         (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Use a secondary thread to do the download.
145         (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Stop the secondary thread.
146         (ResourceHandleStreamingClient::setDefersLoading): Notify the secondary thread.
147
148 2016-06-28  Youenn Fablet  <youennf@gmail.com>
149
150         Remove ThreadableLoaderOptions origin
151         https://bugs.webkit.org/show_bug.cgi?id=159221
152
153         Reviewed by Sam Weinig.
154
155         No change of behavior.
156
157         * loader/DocumentThreadableLoader.cpp:
158         (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Adding origing parameter.
159         (WebCore::DocumentThreadableLoader::create): Ditto.
160         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
161         (WebCore::DocumentThreadableLoader::redirectReceived): Setting m_origin.
162         (WebCore::DocumentThreadableLoader::securityOrigin): Checking m_origin.
163         * loader/DocumentThreadableLoader.h: Adding m_origin member.
164         * loader/ThreadableLoader.cpp:
165         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Removing origin.
166         (WebCore::ThreadableLoaderOption::isolatedCopy): Deleted.
167         * loader/ThreadableLoader.h: Removing origin parameter and isolatedCopy function.
168         * loader/WorkerThreadableLoader.cpp:
169         (WebCore::LoaderTaskOptions::LoaderTaskOptions): Structure to pass loader task options from one thread to another.
170         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
171         * page/EventSource.cpp:
172         (WebCore::EventSource::connect): Removing setting of the origin.
173         * workers/WorkerScriptLoader.cpp:
174         (WebCore::WorkerScriptLoader::loadSynchronously): Ditto.
175         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
176         * xml/XMLHttpRequest.cpp:
177         (WebCore::XMLHttpRequest::createRequest): Ditto.
178
179 2016-06-28  Commit Queue  <commit-queue@webkit.org>
180
181         Unreviewed, rolling out r202580.
182         https://bugs.webkit.org/show_bug.cgi?id=159245
183
184         Caused all WKTR tests to fail on GuardMalloc and Production
185         only for unknown reasons, investigating offline. (Requested by
186         brrian on #webkit).
187
188         Reverted changeset:
189
190         "RunLoop::Timer should use constructor templates instead of
191         class templates"
192         https://bugs.webkit.org/show_bug.cgi?id=159153
193         http://trac.webkit.org/changeset/202580
194
195 2016-06-28  Benjamin Poulain  <benjamin@webkit.org>
196
197         Rename ChildrenAffectedByActive to StyleAffectedByActive
198         https://bugs.webkit.org/show_bug.cgi?id=159187
199
200         Reviewed by Antti Koivisto.
201
202         Flags named "ChildrenAffectedBy" are used when the invalidation
203         of children is so crazy that we invalidate the whole parent subtree instead.
204
205         That's not the case for :active. It is a straightforward element invalidation.
206         Consequently, the property is renamed to StyleAffectedByActive.
207
208         * dom/Element.cpp:
209         (WebCore::Element::setActive):
210         (WebCore::Element::setStyleAffectedByActive):
211         (WebCore::Element::hasFlagsSetDuringStylingOfChildren):
212         (WebCore::Element::rareDataStyleAffectedByActive):
213         (WebCore::Element::setChildrenAffectedByActive): Deleted.
214         (WebCore::Element::rareDataChildrenAffectedByActive): Deleted.
215         * dom/Element.h:
216         (WebCore::Element::styleAffectedByActive):
217         (WebCore::Element::childrenAffectedByActive): Deleted.
218         * dom/ElementRareData.h:
219         (WebCore::ElementRareData::styleAffectedByActive):
220         (WebCore::ElementRareData::setStyleAffectedByActive):
221         (WebCore::ElementRareData::ElementRareData):
222         (WebCore::ElementRareData::resetDynamicRestyleObservations):
223         (WebCore::ElementRareData::childrenAffectedByActive): Deleted.
224         (WebCore::ElementRareData::setChildrenAffectedByActive): Deleted.
225         * style/StyleRelations.cpp:
226         (WebCore::Style::commitRelations):
227
228 2016-06-28  Jiewen Tan  <jiewen_tan@apple.com>
229
230         Implement "replacement" codec
231         https://bugs.webkit.org/show_bug.cgi?id=159180
232         <rdar://problem/26015178>
233
234         Reviewed by Brent Fulgham.
235
236         Test: fast/encoding/charset-replacement.html
237
238         Add support for "replacement" codec according to the spec:
239         https://encoding.spec.whatwg.org/#replacement
240         According to the spec, encoding labels {"csiso2022kr", "hz-gb-2312", "iso-2022-cn",
241         "iso-2022-cn-ext", "iso-2022-kr"} are used to conduct certain attacks that abuse
242         a mismatch between encodings supported on the server and the client. Therefore,
243         they are grouped under the "replacement" codec, which does the following things
244         to prevent those attacks.
245         1) Decode: terminates with a single U+FFFD.
246         2) Encode: treated as UTF-8.
247
248         Furthermore, the "replacement" codec is a specification convenience to group those
249         vulnerable encoding labels. Therefore, it should not be able to use directly.
250
251         This change is based on the following Blink changes:
252         https://codereview.chromium.org/265973003, and
253         https://codereview.chromium.org/261013007.
254
255         * CMakeLists.txt:
256         * WebCore.xcodeproj/project.pbxproj:
257         * platform/text/TextAllInOne.cpp:
258         * platform/text/TextCodecReplacement.cpp: Added.
259         (WebCore::TextCodecReplacement::create):
260         (WebCore::TextCodecReplacement::TextCodecReplacement):
261         (WebCore::TextCodecReplacement::registerEncodingNames):
262         (WebCore::TextCodecReplacement::registerCodecs):
263         (WebCore::TextCodecReplacement::decode):
264         * platform/text/TextCodecReplacement.h: Added.
265         * platform/text/TextEncoding.cpp:
266         (WebCore::TextEncoding::TextEncoding):
267         * platform/text/TextEncodingRegistry.cpp:
268         (WebCore::isReplacementEncoding):
269         (WebCore::extendTextCodecMaps):
270         * platform/text/TextEncodingRegistry.h:
271
272 2016-06-28  Dean Jackson  <dino@apple.com>
273
274         Remove incorrect comments in HTMLCanvasElement
275         https://bugs.webkit.org/show_bug.cgi?id=159229
276
277         Reviewed by Sam Weinig.
278
279         These comments are wrong.
280
281         * html/HTMLCanvasElement.cpp:
282         (WebCore::HTMLCanvasElement::probablySupportsContext):
283         (WebCore::HTMLCanvasElement::getContext): Deleted.
284
285 2016-06-28  Geoffrey Garen  <ggaren@apple.com>
286
287         CrashTracer beneath JSC::MarkedBlock::specializedSweep
288         https://bugs.webkit.org/show_bug.cgi?id=159223
289
290         Reviewed by Saam Barati.
291
292         This crash is caused by a media element re-entering JS during the GC
293         sweep phase.
294
295         In theory, other CachedResourceClients in the DOM might also trigger
296         similar bugs, but our data only implicates the media elements, so this
297         fix targets them.
298
299         * html/HTMLDocument.h: Document has no reason to inherit from
300         CachedResourceClient. I found this becuase I had to search for all
301         CachedResourceClients in researching this patch.
302
303         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
304         (WebCore::WebCoreAVCFResourceLoader::invalidate): Delay our call to
305         stopLoading because it might re-enter JS, and we might have been called
306         by the GC sweep phase destroying a media element.
307
308         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
309         (WebCore::WebCoreAVFResourceLoader::invalidate): Ditto.
310
311 2016-06-28  Saam Barati  <sbarati@apple.com>
312
313         some Watchpoints' ::fireInternal method will call operations that might GC where the GC will cause the watchpoint itself to destruct
314         https://bugs.webkit.org/show_bug.cgi?id=159198
315         <rdar://problem/26302360>
316
317         Reviewed by Filip Pizlo.
318
319         * bindings/js/JSDOMWindowBase.cpp:
320         (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
321         * bindings/scripts/CodeGeneratorJS.pm:
322         (GenerateHeader):
323         * bindings/scripts/test/JS/JSTestEventTarget.h:
324         (WebCore::JSTestEventTarget::create):
325
326 2016-06-28  Anders Carlsson  <andersca@apple.com>
327
328         Move the user gesture requirement to the ApplePaySession constructor
329         https://bugs.webkit.org/show_bug.cgi?id=159225
330         rdar://problem/26507267
331
332         Reviewed by Tim Horton.
333
334         By doing this, clients can do pre-validation before showing the sheet, while we still maintain the user gesture requirement.
335
336         * Modules/applepay/ApplePaySession.cpp:
337         (WebCore::ApplePaySession::create):
338         (WebCore::ApplePaySession::begin): Deleted.
339
340 2016-06-28  Youenn Fablet  <youenn@apple.com>
341
342         Iterable interfaces should have their related prototype @@iterator property writable
343         https://bugs.webkit.org/show_bug.cgi?id=159211
344         <rdar://problem/26950766>
345
346         Reviewed by Chris Dumez.
347
348         Updating @@iterator property according  http://heycam.github.io/webidl/#es-iterator.
349
350         Covered by updated test.
351
352         * bindings/scripts/CodeGeneratorJS.pm:
353         (GenerateImplementation): Removing ReadOnly flag from @@iterator property of iterable interfaces.
354         * bindings/scripts/test/JS/JSTestNode.cpp:
355         (WebCore::JSTestNodePrototype::finishCreation): Rebasing expectation.
356         * bindings/scripts/test/JS/JSTestObj.cpp:
357         (WebCore::JSTestObjPrototype::finishCreation): Ditto.
358
359 2016-06-28  Anders Carlsson  <andersca@apple.com>
360
361         "Total amount is too big" error message is displaying on clicking Pay button
362         https://bugs.webkit.org/show_bug.cgi?id=159219
363         rdar://problem/26722110
364
365         Reviewed by Tim Horton.
366
367         Match the PassKit max amount.
368
369         * Modules/applepay/PaymentRequestValidator.cpp:
370         (WebCore::PaymentRequestValidator::validateTotal):
371
372 2016-06-28  Anders Carlsson  <andersca@apple.com>
373
374         PaymentMerchantSession should wrap a PKPaymentMerchantSession
375         https://bugs.webkit.org/show_bug.cgi?id=159218
376         rdar://problem/26872118
377
378         Reviewed by Tim Horton.
379
380         * Modules/applepay/ApplePaySession.cpp:
381         (WebCore::ApplePaySession::completeMerchantValidation):
382         Use PaymentMerchantSession::fromJS.
383
384         (WebCore::createMerchantSession): Deleted.
385
386         * Modules/applepay/PaymentCoordinator.h:
387         PaymentMerchantSession is now a class.
388
389         * Modules/applepay/PaymentCoordinatorClient.h:
390         PaymentMerchantSession is now a class.
391
392         * Modules/applepay/PaymentMerchantSession.h:
393         (WebCore::PaymentMerchantSession::PaymentMerchantSession):
394         (WebCore::PaymentMerchantSession::~PaymentMerchantSession):
395         (WebCore::PaymentMerchantSession::pkPaymentMerchantSession):
396         Store a PKPaymentMerchantSession in a RetainPtr inside the PaymentMerchantSession object.
397
398         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
399         (WebCore::PaymentMerchantSession::fromJS):
400         Convert the JS object to a PKPaymentMerchantSession and return a PaymentMerchantSession that wraps it.
401
402         * WebCore.xcodeproj/project.pbxproj:
403         Add new files.
404
405         * bindings/js/Dictionary.h:
406         (WebCore::Dictionary::initializerObject):
407         Add new getter.
408
409 2016-06-28  Brian Burg  <bburg@apple.com>
410
411         RunLoop::Timer should use constructor templates instead of class templates
412         https://bugs.webkit.org/show_bug.cgi?id=159153
413
414         Reviewed by Alex Christensen.
415
416         Remove the RunLoop::Timer class template argument, and pass its constructor
417         a reference to `this` instead of a pointer to `this`.
418
419         * Modules/mediasession/WebMediaSessionManager.cpp:
420         (WebCore::WebMediaSessionManager::WebMediaSessionManager):
421         * Modules/mediasession/WebMediaSessionManager.h:
422         * page/WheelEventTestTrigger.cpp:
423         (WebCore::WheelEventTestTrigger::WheelEventTestTrigger):
424         * page/WheelEventTestTrigger.h:
425         * page/mac/TextIndicatorWindow.h:
426         * page/mac/TextIndicatorWindow.mm:
427         (WebCore::TextIndicatorWindow::TextIndicatorWindow):
428         * platform/MainThreadSharedTimer.h:
429         * platform/cocoa/ScrollController.h:
430         * platform/cocoa/ScrollController.mm:
431         (WebCore::ScrollController::ScrollController):
432         * platform/glib/MainThreadSharedTimerGLib.cpp:
433         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
434         * platform/graphics/MediaPlaybackTargetPicker.cpp:
435         (WebCore::MediaPlaybackTargetPicker::MediaPlaybackTargetPicker):
436         * platform/graphics/MediaPlaybackTargetPicker.h:
437         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
438         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
439         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
440         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
441         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
442         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
443         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
444         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
445         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
446         (WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy):
447         (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
448         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
449         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
450         (WebCore::MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock):
451         * platform/mock/MediaPlaybackTargetPickerMock.h:
452         * platform/mock/MockRealtimeVideoSource.cpp:
453         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
454         * platform/mock/MockRealtimeVideoSource.h:
455         * platform/network/ResourceHandleInternal.h:
456         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
457
458 2016-06-27  Jer Noble  <jer.noble@apple.com>
459
460         Cross-domain video loads do not prompt for authorization.
461         https://bugs.webkit.org/show_bug.cgi?id=159195
462         <rdar://problem/26234612>
463
464         Reviewed by Brent Fulgham.
465
466         Test: http/tests/media/video-auth.html (modified)
467
468         We should prompt for authorization when a cross-origin <video> is embedded
469         in a web page.
470
471         * loader/MediaResourceLoader.cpp:
472         (WebCore::MediaResourceLoader::requestResource):
473
474 2016-06-28  Ryosuke Niwa  <rniwa@webkit.org>
475
476         REGRESSION(r201471): FormClient.textFieldDidEndEditing is no longer called when a text field is removed
477         https://bugs.webkit.org/show_bug.cgi?id=159199
478         <rdar://problem/26748189>
479
480         Reviewed by Alexey Proskuryakov.
481
482         The bug was caused by HTMLInputElement's endEditing no longer getting called due to the behavior change.
483         Preserve the WebKit2 API semantics by manually calling HTMLInputElement::endEditing in setFocusedElement.
484
485         Tests: WebKit2TextFieldDidBeginAndEndEditing
486
487         * dom/Document.cpp:
488         (WebCore::Document::setFocusedElement):
489
490 2016-06-28  Frederic Wang  <fwang@igalia.com>
491
492         Phrasing content should be accepted in <mo> elements
493         https://bugs.webkit.org/show_bug.cgi?id=130245
494
495         Reviewed by Brent Fulgham.
496
497         After r202420, the RenderMathMLOperator element no longer messes with anonymous block and
498         text nodes. Hence it is now safe to allow foreign content inside <mo>.
499
500         We extend foreign-element-in-token.html to cover the mo case.
501
502         * mathml/MathMLTextElement.cpp:
503         (WebCore::MathMLTextElement::childShouldCreateRenderer): Remove the early return for <mo> so
504         that it accepts phrasing content children.
505
506 2016-06-27  Anders Carlsson  <andersca@apple.com>
507
508         WebKit::WebPaymentCoordinator leak
509         https://bugs.webkit.org/show_bug.cgi?id=159168
510         rdar://problem/26929772
511
512         Reviewed by Beth Dakin.
513
514         * Modules/applepay/PaymentCoordinator.cpp:
515         (WebCore::PaymentCoordinator::~PaymentCoordinator):
516         Call paymentCoordinatorDestroyed().
517
518         * Modules/applepay/PaymentCoordinatorClient.h:
519         Rename mainFrameDestroyed to paymentCoordinatorDestroyed().
520
521         * loader/EmptyClients.cpp:
522
523 2016-06-28  Frederic Wang  <fwang@igalia.com>
524
525         Remove anonymous in renderName for all MathML renderers but RenderMathMLOperator
526         https://bugs.webkit.org/show_bug.cgi?id=159114
527
528         Reviewed by Martin Robinson.
529
530         After r202420, the only anonymous MathML renderers are the RenderMathMLOperators created by
531         the mfenced element. Hence we remove the special case for anonymous in the renderName
532         implementation of most MathML renderers.
533
534         No new tests, behavior unchanged.
535
536         * rendering/mathml/RenderMathMLRow.h:
537         * rendering/mathml/RenderMathMLSpace.h:
538         * rendering/mathml/RenderMathMLToken.h:
539
540 2016-06-28  Adam Bergkvist  <adam.bergkvist@ericsson.com>
541
542         WebRTC: Robustify 'this' type check in RTCPeerConnection JS built-ins
543         https://bugs.webkit.org/show_bug.cgi?id=158831
544
545         Reviewed by Youenn Fablet.
546
547         Use @operations slot in RTCPeerConnection type check.
548
549         Updated results of existing test.
550
551         * Modules/mediastream/RTCPeerConnection.js:
552         (initializeRTCPeerConnection):
553         Initialize @operations slot in constructor.
554         * Modules/mediastream/RTCPeerConnectionInternals.js:
555         (isRTCPeerConnection):
556         Use @operations slot in type check.
557
558 2016-06-28  Frederic Wang  <fwang@igalia.com>
559
560         AX: Remove dead code in AccessibilityRenderObject::textUnderElement
561         https://bugs.webkit.org/show_bug.cgi?id=159205
562
563         Reviewed by Joanmarie Diggs.
564
565         RenderMathMLOperator used to destroy its descendants and to replace them with an anonymous
566         text node wrapped inside anonymous blocks. After r202420, it just behaves as any other token
567         elements. Hence we remove the code in AccessibilityRenderObject::textUnderElement that was
568         used to handle this specific render tree structure.
569
570         No new tests, already covered by accessibility/math-text.html.
571
572         * accessibility/AccessibilityRenderObject.cpp:
573         (WebCore::AccessibilityRenderObject::textUnderElement): Remove dead code for RenderText and RenderMathMLOperator.
574
575 2016-06-28  Per Arne Vollan  <pvollan@apple.com>
576
577         [Win] Custom elements tests are failing.
578         https://bugs.webkit.org/show_bug.cgi?id=159139
579
580         Reviewed by Alex Christensen.
581
582         Fix compile errors after enabling custom element API.
583
584         * bindings/js/JSHTMLElementCustom.cpp:
585         (WebCore::constructJSHTMLElement):
586         * dom/CustomElementDefinitions.cpp:
587         (WebCore::CustomElementDefinitions::addElementDefinition):
588         * dom/Document.cpp:
589         (WebCore::createHTMLElementWithNameValidation):
590         (WebCore::createFallbackHTMLElement):
591         * dom/Element.cpp:
592         (WebCore::Element::attributeChanged):
593         * dom/LifecycleCallbackQueue.cpp:
594         (WebCore::LifecycleQueueItem::LifecycleQueueItem):
595         (WebCore::LifecycleCallbackQueue::enqueueElementUpgrade):
596         (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallback):
597         * html/parser/HTMLConstructionSite.cpp:
598         (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface):
599         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
600         * html/parser/HTMLDocumentParser.cpp:
601         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
602         * html/parser/HTMLTreeBuilder.cpp:
603         (WebCore::CustomElementConstructionData::CustomElementConstructionData):
604         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
605         * html/parser/HTMLTreeBuilder.h:
606
607 2016-06-28  Philippe Normand  <pnormand@igalia.com>
608
609         [GStreamer] usec rounding is wrong during accurate seeking
610         https://bugs.webkit.org/show_bug.cgi?id=90734
611
612         Reviewed by Carlos Garcia Campos.
613
614         Use floor() to round the microseconds value, this is more robust
615         than roundf.
616
617         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
618         (WebCore::toGstClockTime):
619         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
620         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
621
622 2016-06-28  Philippe Normand  <pnormand@igalia.com>
623
624         [GStreamer] improved duration query support in the HTTP source element
625         https://bugs.webkit.org/show_bug.cgi?id=159204
626
627         Reviewed by Carlos Garcia Campos.
628
629         When we have the Content-Length value it is possible to infer the TIME
630         duration in most cases by performing a convert query in the downstream
631         elements. This is especially useful when the duration query wasn't
632         managed by the sinks and thus reached the source element.
633
634         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
635         (webKitWebSrcQueryWithParent):
636
637 2016-06-28  Youenn Fablet  <youenn@apple.com>
638
639         Binding generator should generate accessors for constructors safely accessed from JS builtin
640         https://bugs.webkit.org/show_bug.cgi?id=159087
641
642         Reviewed by Alex Christensen.
643
644         Removed constructor private slots direct additions in JSDOMGlobalObject.
645         Added support for generating the code that will do that.
646         Advantage of the implementation:
647         - Private slots will expose constructors that are also publically visible (previously workers had some private slots filled with WebRTC constructors).
648         - Private slots no longer require the creation of the constructors at window creation time.
649
650         Although PublicIdentifier and PrivateIdentifier are both added where needed, the binding generator does not
651         support the case of a constructor accessible only privately.
652
653         Covered by existing test set and adding binding test.
654
655         * Modules/mediastream/MediaStream.idl: Marked as PublicIdentifier/PrivateIdentifier.
656         * Modules/mediastream/MediaStreamTrack.idl: Ditto.
657         * Modules/mediastream/RTCIceCandidate.idl: Ditto.
658         * Modules/mediastream/RTCSessionDescription.idl: Ditto.
659         * Modules/streams/ReadableStream.idl: Ditto.
660         * bindings/js/JSDOMGlobalObject.cpp:
661         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Removed unneeded additions.
662         * bindings/scripts/CodeGeneratorJS.pm:
663         (GenerateImplementation): Added support for private slots for interface constructors marked as
664         PrivateIdentifier.
665         * bindings/scripts/preprocess-idls.pl:
666         (GenerateConstructorAttribute): Make PublicIdentifier/PrivateIdentifier copied interface attributes.
667         * bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp:
668         (webkit_dom_test_global_object_set_property):
669         (webkit_dom_test_global_object_get_property):
670         (webkit_dom_test_global_object_class_init):
671         (webkit_dom_test_global_object_get_public_and_private_attribute):
672         (webkit_dom_test_global_object_set_public_and_private_attribute):
673         * bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h:
674         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
675         (WebCore::JSTestGlobalObject::finishCreation):
676         (WebCore::jsTestGlobalObjectPublicAndPrivateAttribute):
677         (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
678         * bindings/scripts/test/ObjC/DOMTestGlobalObject.h:
679         * bindings/scripts/test/ObjC/DOMTestGlobalObject.mm:
680         (-[DOMTestGlobalObject publicAndPrivateAttribute]):
681         (-[DOMTestGlobalObject setPublicAndPrivateAttribute:]):
682         * bindings/scripts/test/TestGlobalObject.idl:
683
684
685 2016-06-27  Jer Noble  <jer.noble@apple.com>
686
687         REGRESSION?(r202466): http/tests/security/canvas-remote-read-remote-video-redirect.html failing on Sierra
688         https://bugs.webkit.org/show_bug.cgi?id=159172
689         <rdar://problem/27030025>
690
691         Reviewed by Brent Fulgham.
692
693         Add a hasSingleSecurityOrigin property to WebCoreNSURLSession that gets updated each time one of that
694         sessions' tasks receieves a response or a redirect request. Check that property from the MediaPlayerPrivate.
695
696         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
697         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
698         * platform/network/cocoa/WebCoreNSURLSession.h:
699         * platform/network/cocoa/WebCoreNSURLSession.mm:
700         (-[WebCoreNSURLSession updateHasSingleSecurityOrigin:]):
701         (-[WebCoreNSURLSession dataTaskWithRequest:]):
702         (-[WebCoreNSURLSession dataTaskWithURL:]):
703         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
704         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
705
706 2016-06-27  Alex Christensen  <achristensen@webkit.org>
707
708         CMake build fix.
709
710         * PlatformMac.cmake:
711
712 2016-06-27  Youenn Fablet  <youenn@apple.com>
713
714         Remove didFailAccessControlCheck ThreadableLoaderClient callback
715         https://bugs.webkit.org/show_bug.cgi?id=159149
716
717         Reviewed by Daniel Bates.
718
719         Adding an AccessControl ResourceError type.
720         Replacing didFailAccessControlCheck callback by a direct call to didFail with an error of type AccessControl.
721
722         Making CrossOriginPreflightChecker always return an AccessControl error. Previously some errors created below
723         were passed directly to threadable loader clients.
724
725         When doing preflight on unauthorized web sites, WTR/DRT will trigger a cancellation error which was translating into an abort event in XMLHttpRequest.
726         This patch is changing the error type to AccessControl, which translates into an error event in XMLHttpReauest.
727
728         This change of behavior is seen in imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred.htm.
729         No other observable change of behavior should be expected.
730
731         * inspector/InspectorNetworkAgent.cpp: Computing error message in didFail according the error type.
732         * loader/CrossOriginPreflightChecker.cpp:
733         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Setting preflightFailure error type to AccessControl.
734         (WebCore::CrossOriginPreflightChecker::notifyFinished): Ditto.
735         (WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
736         * loader/DocumentThreadableLoader.cpp:
737         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): Replacing didFailAccessControlCheck
738         callback by a direct call to didFail with an error of type AccessControl.
739         (WebCore::reportContentSecurityPolicyError): Ditto.
740         (WebCore::reportCrossOriginResourceSharingError): Ditto.
741         (WebCore::DocumentThreadableLoader::didReceiveResponse): Ditto.
742         (WebCore::DocumentThreadableLoader::preflightFailure): Calling didFail directly.
743         * loader/ThreadableLoaderClient.h: Removing didFailAccessControlCheck.
744         * loader/ThreadableLoaderClientWrapper.h: Ditto.
745         * loader/WorkerThreadableLoader.cpp: Ditto.
746         * loader/WorkerThreadableLoader.h: Ditto.
747         * page/EventSource.cpp:
748         (WebCore::EventSource::didFail): Removing didFailAccessControlCheck and putting handling code in didFail.
749         * page/EventSource.h:
750         * platform/network/ResourceErrorBase.cpp:
751         (WebCore::ResourceErrorBase::setType): Softening the assertion to cover the case of migration to AccessControl.
752         * platform/network/ResourceErrorBase.h: Adding AccessControl error type.
753         (WebCore::ResourceErrorBase::isAccessControl):
754
755 2016-06-27  Chris Dumez  <cdumez@apple.com>
756
757         HTMLElement / SVGElement should implement GlobalEventHandlers, not Element
758         https://bugs.webkit.org/show_bug.cgi?id=159191
759         <rdar://problem/27019299>
760
761         Reviewed by Ryosuke Niwa.
762
763         HTMLElement / SVGElement should implement GlobalEventHandlers, not Element:
764         - https://html.spec.whatwg.org/multipage/dom.html#htmlelement
765         - https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement
766
767         Firefox and Chrome behave as per the specification.
768
769         Fixing this also fixes rendering on http://survey123.arcgis.com/.
770
771         No new tests, covered by existing tests that were rebaselined.
772
773         * dom/Element.idl:
774         * html/HTMLElement.idl:
775         * svg/SVGElement.idl:
776
777 2016-06-27  Myles C. Maxfield  <mmaxfield@apple.com>
778
779         [macOS] Test gardening: Generic font families should not map to fonts which aren't installed
780         https://bugs.webkit.org/show_bug.cgi?id=159111
781         <rdar://problem/25807529>
782
783         Unreviewed.
784
785         Osaka-Mono does not come preinstalled on macOS Sierra. However, many Japanese users
786         will have the font installed. Before setting the generic font family, we should check
787         to see if the font is present.
788
789         * page/cocoa/SettingsCocoa.mm:
790         (WebCore::osakaMonoIsInstalled):
791         (WebCore::Settings::initializeDefaultFontFamilies):
792
793 2016-06-24  Ryosuke Niwa  <rniwa@webkit.org>
794
795         Don't keep all newly created potential custom elements alive when the feature is disabled
796         https://bugs.webkit.org/show_bug.cgi?id=159113
797
798         Reviewed by Daniel Bates.
799
800         Don't keep all HTML unknown elements which has a valid custom element alive when the feature is turned off.
801
802         Ideally we want to conform to the behavior in the Custom Elements specification and only upgrade an element
803         that is inserted into the document. We'll implement that later.
804
805         * dom/Document.cpp:
806         (WebCore::createHTMLElementWithNameValidation):
807
808 2016-06-27  Simon Fraser  <simon.fraser@apple.com>
809
810         [iOS] -webkit-overflow-scrolling: touch prevents repaint with RTL
811         https://bugs.webkit.org/show_bug.cgi?id=159186
812         rdar://problem/26659341
813
814         Reviewed by Zalan Bujtas.
815         
816         There were two issues with repaints in -webkit-overflow-scrolling:touch scrolling
817         layers.
818
819         First, if the scrolled contents were inline (e.g. a <span>), then repaints were
820         broken because RenderInline didn't call shouldApplyClipAndScrollPositionForRepaint().
821         Fix by making shouldApplyClipAndScrollPositionForRepaint() a member function of RenderBox
822         and calling it from RenderBox::computeRectForRepaint() and RenderInline::clippedOverflowRectForRepaint().
823
824         Second, repaints were broken in RTL because RenderLayerBacking::setContentsNeedDisplayInRect()
825         confused scroll offset and scroll position; it needs to subtract scrollPosition.
826         
827         Finally renamed to applyCachedClipAndScrollOffsetForRepaint() to applyCachedClipAndScrollPositionForRepaint()
828         to make it clear that it uses scrollPosition, not scrollOffset.
829
830         Tests: compositing/scrolling/touch-scrolling-repaint-spans.html
831                compositing/scrolling/touch-scrolling-repaint.html
832
833         * rendering/RenderBox.cpp:
834         (WebCore::RenderBox::applyCachedClipAndScrollPositionForRepaint):
835         (WebCore::RenderBox::shouldApplyClipAndScrollPositionForRepaint):
836         (WebCore::RenderBox::computeRectForRepaint):
837         (WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint): Deleted.
838         (WebCore::shouldApplyContainersClipAndOffset): Deleted.
839         * rendering/RenderBox.h:
840         * rendering/RenderInline.cpp:
841         (WebCore::RenderInline::clippedOverflowRectForRepaint):
842         (WebCore::RenderInline::computeRectForRepaint):
843         * rendering/RenderLayerBacking.cpp:
844         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
845         * rendering/RenderObject.cpp:
846         (WebCore::RenderObject::computeRectForRepaint):
847
848 2016-06-27  Commit Queue  <commit-queue@webkit.org>
849
850         Unreviewed, rolling out r202436.
851         https://bugs.webkit.org/show_bug.cgi?id=159190
852
853         We don't need to make this change. (Requested by thorton on
854         #webkit).
855
856         Reverted changeset:
857
858         "Do not use iOS specific telephone detection on macOS."
859         https://bugs.webkit.org/show_bug.cgi?id=159096
860         http://trac.webkit.org/changeset/202436
861
862 2016-06-27  Benjamin Poulain  <benjamin@webkit.org>
863
864         Adopt the iOS TouchEventHandler API for cases that must have synchronous dispatch
865         https://bugs.webkit.org/show_bug.cgi?id=159179
866         rdar://problem/27006387
867
868         Reviewed by Simon Fraser.
869
870         Tests: fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-block-scrolling-state.html
871                fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-document-scrolling-state.html
872                fast/events/touch/ios/block-without-overflow-scroll-scrolling-state.html
873                fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on-block.html
874                fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on-document.html
875                fast/events/touch/ios/drag-block-without-overflow-scroll.html
876
877         * dom/Document.cpp:
878         (WebCore::Document::prepareForDestruction):
879         (WebCore::Document::removeAllEventListeners):
880         * dom/Node.cpp:
881         (WebCore::Node::willBeDeletedFrom):
882         (WebCore::tryAddEventListener):
883         (WebCore::tryRemoveEventListener):
884         * html/shadow/SliderThumbElement.cpp:
885         (WebCore::SliderThumbElement::registerForTouchEvents):
886         (WebCore::SliderThumbElement::unregisterForTouchEvents):
887         * rendering/RenderLayer.cpp:
888         (WebCore::RenderLayer::registerAsTouchEventListenerForScrolling):
889         (WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling):
890
891 2016-06-27  Alex Christensen  <achristensen@webkit.org>
892
893         Fix Windows build.
894
895         * bindings/js/SerializedScriptValue.h:
896         WTF
897
898 2016-06-27  Commit Queue  <commit-queue@webkit.org>
899
900         Unreviewed, rolling out r202520.
901         https://bugs.webkit.org/show_bug.cgi?id=159185
902
903         This change broke the 32-bit El Capitan build (Requested by
904         ryanhaddad on #webkit).
905
906         Reverted changeset:
907
908         "REGRESSION?(r202466): http/tests/security/canvas-remote-read-
909         remote-video-redirect.html failing on Sierra"
910         https://bugs.webkit.org/show_bug.cgi?id=159172
911         http://trac.webkit.org/changeset/202520
912
913 2016-06-27  Jer Noble  <jer.noble@apple.com>
914
915         REGRESSION?(r202466): http/tests/security/canvas-remote-read-remote-video-redirect.html failing on Sierra
916         https://bugs.webkit.org/show_bug.cgi?id=159172
917         <rdar://problem/27030025>
918
919         Reviewed by Brent Fulgham.
920
921         Add a hasSingleSecurityOrigin property to WebCoreNSURLSession that gets updated each time one of that
922         sessions' tasks receieves a response or a redirect request. Check that property from the MediaPlayerPrivate.
923
924         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
925         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
926         * platform/network/cocoa/WebCoreNSURLSession.h:
927         * platform/network/cocoa/WebCoreNSURLSession.mm:
928         (-[WebCoreNSURLSession updateHasSingleSecurityOrigin:]):
929         (-[WebCoreNSURLSession dataTaskWithRequest:]):
930         (-[WebCoreNSURLSession dataTaskWithURL:]):
931         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
932         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
933
934 2016-06-27  Benjamin Poulain  <benjamin@webkit.org>
935
936         Fix style invalidation for :active when the activated node has no renderer
937         https://bugs.webkit.org/show_bug.cgi?id=159125
938
939         Reviewed by Antti Koivisto.
940
941         Same old bug: a style invalidation path was depending
942         on the style.
943
944         Here we really need both flags. An element can have
945         childrenAffectedByActive() false and renderStyle->affectedByActive() true
946         if it was subject to style sharing.
947
948         The element state "childrenAffectedByActive" should be renamed
949         "styleAffectedByActive" since it is not a parent invalidation flag.
950         That will be done separately.
951
952         Tests: fast/css/pseudo-active-on-labeled-control-without-renderer.html
953                fast/css/pseudo-active-style-sharing-1.html
954                fast/css/pseudo-active-style-sharing-2.html
955                fast/css/pseudo-active-style-sharing-3.html
956                fast/css/pseudo-active-style-sharing-4.html
957                fast/css/pseudo-active-style-sharing-5.html
958                fast/css/pseudo-active-style-sharing-6.html
959
960         * dom/Element.cpp:
961         (WebCore::Element::setActive):
962         * style/StyleRelations.cpp:
963         (WebCore::Style::commitRelationsToRenderStyle):
964
965 2016-06-27  Joanmarie Diggs  <jdiggs@igalia.com>
966
967         AX: REGRESSION (r202063): ARIA role attribute is being ignored for label element
968         https://bugs.webkit.org/show_bug.cgi?id=159162
969
970         Reviewed by Chris Fleizach.
971
972         createFromRenderer() was creating an AccessibilityLabel for any HTMLLabelElement which
973         lacked an explicitly-handled ARIA role. We should instead create an AccessibilityLabel
974         when there is no ARIA role.
975
976         Test: accessibility/aria-role-on-label.html
977
978         * accessibility/AXObjectCache.cpp:
979         (WebCore::createFromRenderer):
980
981 2016-06-27  Commit Queue  <commit-queue@webkit.org>
982
983         Unreviewed, rolling out r202505.
984         https://bugs.webkit.org/show_bug.cgi?id=159169
985
986         The test added with this change is flaky and it caused an
987         existing test to time out on El Capitan. (Requested by
988         ryanhaddad on #webkit).
989
990         Reverted changeset:
991
992         "[iOS] Media controls are too cramped with small video"
993         https://bugs.webkit.org/show_bug.cgi?id=158815
994         http://trac.webkit.org/changeset/202505
995
996 2016-06-27  Benjamin Poulain  <bpoulain@apple.com>
997
998         Add :focus-within to the status page
999
1000         * features.json:
1001         I forgot to update the json file when landing the feature.
1002
1003 2016-06-27  Eric Carlson  <eric.carlson@apple.com>
1004
1005         [Mac] PiP placeholder should remain visible when 'controls' attribute is removed
1006         https://bugs.webkit.org/show_bug.cgi?id=159158
1007         <rdar://problem/26727435>
1008
1009         Reviewed by Jer Noble.
1010
1011         No new tests, existing test updated.
1012
1013         * Modules/mediacontrols/mediaControlsApple.js:
1014         (Controller.prototype.shouldHaveControls): Always return true when in PiP or AirPlay mode.
1015
1016 2016-06-27  Oliver Hunt  <oliver@apple.com>
1017
1018         Update ATS WebContent exception for more robust framework information
1019         https://bugs.webkit.org/show_bug.cgi?id=159151
1020
1021         Reviewed by Alex Christensen.
1022
1023         We found some unexpected poor interaction with AVFoundation in the existing
1024         CFNetwork SPI. This new SPI is more solid and let's us provide more useful
1025         information while also being more future proof against new frameworks and
1026         ATS modes.
1027
1028         * platform/network/mac/ResourceHandleMac.mm:
1029         (WebCore::ResourceHandle::createNSURLConnection):
1030
1031 2016-06-27  Antoine Quint  <graouts@apple.com>
1032
1033         [iOS] Media controls are too cramped with small video
1034         https://bugs.webkit.org/show_bug.cgi?id=158815
1035         <rdar://problem/26824238>
1036
1037         Reviewed by Dean Jackson.
1038
1039         In updateLayoutForDisplayedWidth(), we try to ensure a minimum width is guaranteed
1040         for the progress indicator. However, we were not accounting for the width used by
1041         the current and remaining time labels on either side of it, so we would incorrectly
1042         conclude that we were guaranteeing the minimum time and yield incorrect layouts since
1043         we were trying to fit more buttons than we had room for.
1044
1045         In order to correctly compute the available width for the progress indicator, we now
1046         have clones of the current and remaining time labels, hidden from video and VoiceOver,
1047         that we update along with the originals. The same styles apply to both clones and
1048         originals, so we may measure the clones to determine the space used by the time labels.
1049         The reason we need to use clones is that if the time labels had previously been hidden
1050         from view, precisely because there was not enough space to display them along with the
1051         progress indicator, then trying to obtain metrics from them would yield 0 since they had
1052         "display: none" styles applied. In order to avoid extra layouts and possible flashing, we
1053         use the clones so that we never have to toggle the "display" property of the originals
1054         just to obtain their measurements.
1055
1056         As a result of this change, we adjust the constant used to set the minimum required
1057         width available to display the progress indicator after all other essential controls
1058         and labels have been measured. That constant used to account for the width of the
1059         time labels, and this is no longer correct.
1060
1061         Test: media/video-controls-drop-and-restore-timeline.html
1062
1063         * Modules/mediacontrols/mediaControlsApple.css:
1064         (::-webkit-media-controls-time-remaining-display.clone):
1065         * Modules/mediacontrols/mediaControlsApple.js:
1066         (Controller):
1067         (Controller.prototype.createTimeClones):
1068         (Controller.prototype.removeTimeClass):
1069         (Controller.prototype.addTimeClass):
1070         (Controller.prototype.updateDuration):
1071         (Controller.prototype.updateLayoutForDisplayedWidth):
1072         (Controller.prototype.updateTime):
1073         (Controller.prototype.updateControlsWhileScrubbing):
1074         * Modules/mediacontrols/mediaControlsiOS.css:
1075         (::-webkit-media-controls-time-remaining-display.clone):
1076         * Modules/mediacontrols/mediaControlsiOS.js:
1077
1078 2016-06-27  Anders Carlsson  <andersca@apple.com>
1079
1080         No error message when passing an invalid API version to ApplePaySession constructor
1081         https://bugs.webkit.org/show_bug.cgi?id=159154
1082
1083         Reviewed by Tim Horton.
1084
1085         Log an error message if the version is not supported. Also, check for version 0 since that is also not supported.
1086
1087         * Modules/applepay/ApplePaySession.cpp:
1088         (WebCore::ApplePaySession::create):
1089
1090 2016-06-27  Joanmarie Diggs  <jdiggs@igalia.com>
1091
1092         AX: Anonymous RenderMathMLOperators are not exposed to the accessibility tree
1093         https://bugs.webkit.org/show_bug.cgi?id=139582
1094         <rdar://problem/26938849>
1095
1096         Reviewed by Chris Fleizach.
1097
1098         This is based on a patch by Frederic Wang <fwang@igalia.com>.
1099
1100         WebCore assigns the generic MathElementRole AccessibilityRole to elements
1101         which are expected to be included in the accessibility tree. This assignment
1102         is based on the AccessibilityRenderObject's node being a MathMLElement. The
1103         anonymous RenderMathMLOperators fail that test.
1104
1105         From the perspective of accessibility support, these operators function
1106         like MathMLElements. Furthermore, both WebCore and the platforms rely
1107         upon MathElementRole to identify accessible MathML objects. The simplest
1108         fix is to have AccessibilityRenderObject::isMathElement() treat anonymous
1109         MathML operators as if they were MathMLElements.
1110
1111         Now that these operators are being exposed, we need to handle them in
1112         AccessibilityRenderObject::textUnderElement() which assumes that anonymous
1113         objects either have nodes or have children with nodes. And crashes when
1114         that fails to be the case. Making RenderMathMLOperator::textContent()
1115         public and then using it to get the text under anonymous operators solves
1116         this problem. We also assign StaticTextRole to these operators on the Mac
1117         because the default platform mapping of MathElementRole is GroupRole, which
1118         made sense when we had a child RenderText object holding the operator.
1119
1120         Lastly, AccessibilityRenderObject::isIgnoredElementWithinMathTree() no
1121         longer needs to special-case anonymous operators because they now have
1122         MathElementRole.
1123
1124         Tests: accessibility/math-fenced.html
1125                accessibility/math-foreign-content.html
1126
1127         * accessibility/AccessibilityObject.h:
1128         (WebCore::AccessibilityObject::isAnonymousMathOperator):
1129         * accessibility/AccessibilityRenderObject.cpp:
1130         (WebCore::AccessibilityRenderObject::textUnderElement):
1131         (WebCore::AccessibilityRenderObject::stringValue):
1132         (WebCore::AccessibilityRenderObject::isMathElement):
1133         (WebCore::AccessibilityRenderObject::isAnonymousMathOperator):
1134         (WebCore::AccessibilityRenderObject::isIgnoredElementWithinMathTree):
1135         * accessibility/AccessibilityRenderObject.h:
1136         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1137         (-[WebAccessibilityObjectWrapper role]):
1138         * rendering/mathml/RenderMathMLMath.h:
1139         * rendering/mathml/RenderMathMLOperator.h:
1140         (WebCore::RenderMathMLOperator::textContent):
1141
1142 2016-06-27  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1143
1144         WebRTC: Remove unused RTCOfferAnswerOptionsPrivate.h
1145         https://bugs.webkit.org/show_bug.cgi?id=159130
1146
1147         Reviewed by Eric Carlson.
1148
1149         Remove unused RTCOfferAnswerOptionsPrivate.h file.
1150
1151         * platform/mediastream/RTCOfferAnswerOptionsPrivate.h: Removed.
1152
1153 2016-06-27  Jer Noble  <jer.noble@apple.com>
1154
1155         Crash in layout test /media/video-buffered-range-contains-currentTime.html
1156         https://bugs.webkit.org/show_bug.cgi?id=159109
1157         <rdar://problem/26535750>
1158
1159         Reviewed by Alex Christensen.
1160
1161         Guard against a dealloc race condition by holding a retain on the session
1162         until the task's _resource:loadFinishedWithError: completes, including
1163         main thread callbacks.
1164         
1165         * platform/network/cocoa/WebCoreNSURLSession.mm:
1166         (-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:]):
1167
1168 2016-06-27  Frederic Wang  <fwang@igalia.com>
1169
1170         Set an upper limit for the size or number of pieces of stretchy operators
1171         https://bugs.webkit.org/show_bug.cgi?id=155434
1172
1173         Reviewed by Brent Fulgham.
1174
1175         Stretchy MathML operators can currently use an arbitrary number of extension glyphs to cover
1176         a target size. This may result in hangs if large stretch sizes are requested. This change
1177         only allow at most the 128 first extensions to be painted by the MathOperator class, which
1178         should really be enough for mathematical formulas used in practice.
1179
1180         No new tests, already tested by very-large-stretchy-operators.
1181
1182         * rendering/mathml/MathOperator.cpp: Add a new kMaximumExtensionCount constant.
1183         (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Limit the number of step in this loop to kMaximumExtensionCount.
1184         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
1185
1186 2016-06-27  Frederic Wang  <fred.wang@free.fr>
1187
1188         Small refactoring MathMLInlineContainerElement::createElementRenderer
1189         https://bugs.webkit.org/show_bug.cgi?id=159131
1190
1191         Reviewed by Brent Fulgham.
1192
1193         Many of the MathML renderer classes have been merged during the MathML refactoring. We
1194         simplify how instances are created in MathMLInlineContainerElement::createElementRenderer
1195         by removing duplicate createRenderer calls.
1196
1197         No new tests, behavior unchanged.
1198
1199         * mathml/MathMLInlineContainerElement.cpp:
1200         (WebCore::MathMLInlineContainerElement::createElementRenderer):
1201
1202 2016-06-27  Miguel Gomez  <magomez@igalia.com>
1203
1204         [GTK][EFL] Build with threaded compositor enabled is broken
1205         https://bugs.webkit.org/show_bug.cgi?id=159138
1206
1207         Reviewed by Carlos Garcia Campos.
1208
1209         No need to set the device scale. The compositor buffer is only used for the accelerated
1210         canvas scenario, and the device scale is always 1 there.
1211         This change was introduced in r202421.
1212
1213         Covered by existing tests.
1214
1215         * platform/graphics/cairo/ImageBufferCairo.cpp:
1216         (WebCore::ImageBufferData::createCompositorBuffer):
1217
1218 2016-06-27  Philippe Normand  <philn@igalia.com>
1219
1220         [GStreamer] top/bottom black bars added needlessly in fullscreen
1221         https://bugs.webkit.org/show_bug.cgi?id=158980
1222
1223         Reviewed by Carlos Garcia Campos.
1224
1225         The natural video size calculation depends on the validity of the
1226         current sample, so whenever the first sample reached the sink it's a
1227         good idea to reflect this on the player which will update its natural
1228         size accordingly.
1229
1230         Fixes an issue where black borders were added on top and bottom of
1231         fullscreen video.
1232
1233         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1234         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1235
1236 2016-06-27  Youenn Fablet  <youenn@apple.com>
1237
1238         Remove didFailRedirectCheck ThreadableLoaderClient callback
1239         https://bugs.webkit.org/show_bug.cgi?id=159085
1240
1241         Reviewed by Daniel Bates.
1242
1243         Removing didFailRedirectCheck and using didFailAccessControlCheck instead.
1244         The change in behavior is that additional error messages are outputted in the console.
1245         These messages give additional debugging information.
1246
1247         Covered by rebased tests.
1248
1249         * Modules/fetch/FetchLoader.cpp: Removing didFailRedirectCheck.
1250         * Modules/fetch/FetchLoader.h: Ditto.
1251         * inspector/InspectorNetworkAgent.cpp: Ditto.
1252         * loader/DocumentThreadableLoader.cpp:
1253         (WebCore::DocumentThreadableLoader::redirectReceived): Calling didFailAccessControlCheck with information on failing
1254         URL.
1255         (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
1256         * loader/ThreadableLoaderClient.h: Removing didFailRedirectCheck.
1257         * loader/ThreadableLoaderClientWrapper.h: Ditto.
1258         * loader/WorkerThreadableLoader.cpp: Ditto.
1259         * loader/WorkerThreadableLoader.h: Ditto.
1260         * page/EventSource.cpp: Ditto.
1261         * page/EventSource.h: Ditto.
1262         * workers/WorkerScriptLoader.cpp: Ditto.
1263         * workers/WorkerScriptLoader.h: Ditto.
1264         * xml/XMLHttpRequest.cpp: Ditto.
1265         * xml/XMLHttpRequest.h: Ditto.
1266
1267 2016-06-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1268
1269         [EFL] Fix build warning when using geoclue2
1270         https://bugs.webkit.org/show_bug.cgi?id=159128
1271
1272         Reviewed by Antonio Gomes.
1273
1274         EFL port has handled build warning as error. So EFL port
1275         hasn't been built when we use geoclue2 library because a generated geoclue2 file
1276         has unused-parameter build warning. To fix it this patch set to ignore the build warning
1277         in the generated geoclue2 file.
1278
1279         * PlatformEfl.cmake:
1280
1281 2016-06-26  Chris Dumez  <cdumez@apple.com>
1282
1283         Regression: HTMLOptionsCollection's named properties have precedence over indexed properties
1284         https://bugs.webkit.org/show_bug.cgi?id=159058
1285         <rdar://problem/26988542>
1286
1287         Reviewed by Ryosuke Niwa.
1288
1289         HTMLOptionsCollection's named properties had precedence over indexed properties,
1290         which is wrong as per:
1291         http://heycam.github.io/webidl/#getownproperty-guts
1292
1293         The reason is that there was a named property getter defined on HTMLOptionsCollection
1294         but no indexed property getter. As a result, HTMLOptionsCollection would fall back to
1295         using HTMLCollection's indexed property getter but HTMLOptionsCollection's named getter
1296         would take precedence. This patch defines an indexed property getter on
1297         HTMLOptionsCollection to fix the problem.
1298
1299         Ideally, HTMLOptionsCollection would have no indexed / named property getters and would
1300         entirely rely on the ones from HTMLCollection. However, our bindings generator currently
1301         has trouble with this and requires HTMLOptionsCollection to have a named getter.
1302
1303         Test: fast/dom/HTMLSelectElement/options-indexed-getter-precedence.html
1304
1305         * html/HTMLOptionsCollection.idl:
1306
1307 2016-06-26  Chris Dumez  <cdumez@apple.com>
1308
1309         Regression(r202262): Infinite loop under searchForLinkRemovingExistingDDLinks()
1310         https://bugs.webkit.org/show_bug.cgi?id=159122
1311         <rdar://problem/27014649>
1312
1313         Reviewed by Ryosuke Niwa.
1314
1315         Infinite loop under searchForLinkRemovingExistingDDLinks() because the
1316         value returned by NodeTraversal::next() was ignored and the node iterator
1317         was never updated.
1318
1319         * editing/cocoa/DataDetection.mm:
1320         (WebCore::searchForLinkRemovingExistingDDLinks):
1321
1322 2016-06-25  Benjamin Poulain  <bpoulain@apple.com>
1323
1324         The active state of elements can break when focus changes
1325         https://bugs.webkit.org/show_bug.cgi?id=159112
1326
1327         Reviewed by Antti Koivisto.
1328
1329         The pseudo class :active was behaving weirdly when used
1330         with label elements with an associated form element.
1331         The form element would get the :active state on the first click
1332         then no longer get the state until the focus changes.
1333
1334         What was happenning is setFocusedElement() was clearing active
1335         for some unknown reason. When you really do that on an active element,
1336         you end up in an inconsistent state where no invalidation works.
1337
1338         The two tests illustrates 2 ways this breaks.
1339
1340         The test "pseudo-active-on-labeled-element-not-canceled-by-focus" clicks
1341         several time on a lable element. The first time, the input element gets
1342         the focus. The second time, it already has the focus, setFocusedElement()
1343         clears :active before finding the focusable element and end up clearing
1344         the active state on a target in the active chain.
1345
1346         The test "pseudo-active-with-programmatic-focus.html" shows how to invalidate
1347         arbitrary elements using JavaScript. This can cause severely broken active
1348         chains where invalidation never cleans some ancestors.
1349
1350         Tests: fast/css/pseudo-active-on-labeled-element-not-canceled-by-focus.html
1351                fast/css/pseudo-active-with-programmatic-focus.html
1352
1353         * dom/Document.cpp:
1354         (WebCore::Document::setFocusedElement): Deleted.
1355
1356         * page/EventHandler.cpp:
1357         (WebCore::EventHandler::handleMouseDoubleClickEvent):
1358         This is WebKit1 specific. The double click event was dispatching
1359         the mouseUp and Click with after doing an Active hit test.
1360         This causes us to have :active state in and after mouseUp in WebKit1.
1361
1362 2016-06-24  Jer Noble  <jer.noble@apple.com>
1363
1364         Consider exposing or hiding knowledge of a redirect from clients of WebCoreNSURLSession
1365         https://bugs.webkit.org/show_bug.cgi?id=156722
1366         <rdar://problem/25780035>
1367
1368         Reviewed by Alex Christensen.
1369
1370         Fixes tests: http/tests/security/contentSecurityPolicy/audio-redirect-allowed2.html
1371                      http/tests/security/contentSecurityPolicy/video-redirect-allowed2.html
1372
1373         When receieving a NSURLResponse containing a redirected URL, AVFoundadtion will use the
1374         URL in the response for subsequent requests. This violates the HTTP specification if the
1375         redirect was temporary, and it also breaks two CSP tests by bypassing the redirect step
1376         for subsequent requests.
1377
1378         Work around this behavior in AVFoundation by recreating the NSURLResponse with the original
1379         request URL in the case of a temporary redirect.
1380
1381         * platform/network/cocoa/WebCoreNSURLSession.mm:
1382         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
1383         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
1384
1385 2016-06-24  Jer Noble  <jer.noble@apple.com>
1386
1387         MSE gets confused by in-band text tracks
1388         https://bugs.webkit.org/show_bug.cgi?id=159107
1389         <rdar://problem/26871330>
1390
1391         Reviewed by Eric Carlson.
1392
1393         We can't currently handle text track samples in SourceBufferPrivateAVFObjC,
1394         so don't pass them up to SourceBuffer.
1395
1396         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1397         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1398         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
1399
1400 2016-06-24  Mark Lam  <mark.lam@apple.com>
1401
1402         [JSC] Error prototypes are called on remote scripts.
1403         https://bugs.webkit.org/show_bug.cgi?id=52192
1404
1405         Reviewed by Keith Miller.
1406
1407         Test: http/tests/security/regress-52192.html
1408
1409         Parsing errors are reported to the main script's window.onerror function.  AFAIK,
1410         both Chrome and Firefox have the error reporting mechanism use an internal
1411         sanitized version of Error.prototype.toString() that will not invoke any getters
1412         or proxies instead.
1413
1414         This patch fixes this issue by matching Chrome and Firefox's behavior.
1415
1416         Note: we did not choose to make error objects and prototypes read-only because
1417         that was observed to have broken the web.
1418         See https://bugs.chromium.org/p/chromium/issues/detail?id=69187#c73
1419
1420         Credit for reporting this issue goes to Daniel Divricean (http://divricean.ro).
1421
1422         * bindings/js/JSDOMBinding.cpp:
1423         (WebCore::reportException):
1424         * ForwardingHeaders/runtime/ErrorInstance.h: Added.
1425
1426 2016-06-24  Jer Noble  <jer.noble@apple.com>
1427
1428         Media elements should not lose playback controls when muted by a user gesture
1429         https://bugs.webkit.org/show_bug.cgi?id=159078
1430         <rdar://problem/26925904>
1431
1432         Reviewed by Beth Dakin.
1433
1434         Rearrange canControlControlsManager() so that the muted check only occurs if
1435         a user gesture is required.
1436
1437         * html/MediaElementSession.cpp:
1438         (WebCore::MediaElementSession::canControlControlsManager):
1439
1440 2016-06-24  Beth Dakin  <bdakin@apple.com>
1441
1442         Include enclosingListType in EditorState
1443         https://bugs.webkit.org/show_bug.cgi?id=159102
1444         -and corresponding-
1445         rdar://problem/26932490
1446
1447         Reviewed by Enrica Casucci.
1448
1449         Make HTMLOListElement.h and HTMLUListElement.h Private instead of Project.
1450         * WebCore.xcodeproj/project.pbxproj:
1451
1452         Export enclosingList(Node*)
1453         * editing/htmlediting.h:
1454
1455 2016-06-24  Anders Carlsson  <andersca@apple.com>
1456
1457         Another Windows build fix.
1458
1459         * platform/network/BlobRegistry.h:
1460
1461 2016-06-24  Anders Carlsson  <andersca@apple.com>
1462
1463         Yet another Windows build fix.
1464
1465         * dom/ActiveDOMCallbackMicrotask.h:
1466
1467 2016-06-24  Anders Carlsson  <andersca@apple.com>
1468
1469         Another Windows build fix.
1470
1471         * page/FrameView.h:
1472
1473 2016-06-24  Anders Carlsson  <andersca@apple.com>
1474
1475         Inline more of the Apple Pay source code
1476         https://bugs.webkit.org/show_bug.cgi?id=159099
1477
1478         Reviewed by Andreas Kling.
1479
1480         * page/Settings.h:
1481         (WebCore::Settings::applePayEnabled):
1482         (WebCore::Settings::setApplePayEnabled):
1483         (WebCore::Settings::applePayCapabilityDisclosureAllowed):
1484         (WebCore::Settings::setApplePayCapabilityDisclosureAllowed):
1485
1486 2016-06-24  Anders Carlsson  <andersca@apple.com>
1487
1488         Windows build fix.
1489
1490         * platform/GenericTaskQueue.h:
1491         (WebCore::TaskDispatcher::postTask):
1492
1493 2016-06-24  Frederic Wang  <fwang@igalia.com>
1494
1495         Use auto* for MathML elements and renderers when possible
1496         https://bugs.webkit.org/show_bug.cgi?id=159090
1497
1498         Reviewed by Alex Christensen.
1499
1500         No new tests, behavior is unchanged.
1501
1502         * mathml/MathMLElement.cpp:
1503         (WebCore::MathMLElement::attributeChanged):
1504         * mathml/MathMLSelectElement.cpp:
1505         (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex):
1506         (WebCore::MathMLSelectElement::getSelectedActionChild):
1507         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
1508         (WebCore::MathMLSelectElement::updateSelectedChild):
1509         * rendering/mathml/RenderMathMLFraction.cpp:
1510         (WebCore::RenderMathMLFraction::isValid):
1511         * rendering/mathml/RenderMathMLMenclose.cpp:
1512         (WebCore::RenderMathMLMenclose::layoutBlock):
1513         * rendering/mathml/RenderMathMLRoot.cpp:
1514         (WebCore::RenderMathMLRoot::isValid):
1515         * rendering/mathml/RenderMathMLRow.cpp:
1516         (WebCore::RenderMathMLRow::firstLineBaseline):
1517         (WebCore::RenderMathMLRow::computeLineVerticalStretch):
1518         (WebCore::RenderMathMLRow::computePreferredLogicalWidths):
1519         (WebCore::RenderMathMLRow::layoutRowItems):
1520         * rendering/mathml/RenderMathMLScripts.cpp:
1521         (WebCore::RenderMathMLScripts::unembellishedOperator):
1522         (WebCore::RenderMathMLScripts::getBaseAndScripts):
1523         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
1524         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
1525         (WebCore::RenderMathMLScripts::layoutBlock):
1526         (WebCore::RenderMathMLScripts::firstLineBaseline):
1527         * rendering/mathml/RenderMathMLUnderOver.cpp:
1528         (WebCore::RenderMathMLUnderOver::firstLineBaseline):
1529         (WebCore::RenderMathMLUnderOver::isValid):
1530         (WebCore::RenderMathMLUnderOver::over):
1531
1532 2016-06-24  Joseph Pecoraro  <pecoraro@apple.com>
1533
1534         Remove unused and static return value from InspectorStyle::populateAllProperties
1535         https://bugs.webkit.org/show_bug.cgi?id=159069
1536
1537         Reviewed by Andreas Kling.
1538
1539         * inspector/InspectorStyleSheet.cpp:
1540         (WebCore::InspectorStyle::populateAllProperties):
1541         * inspector/InspectorStyleSheet.h:
1542
1543 2016-06-21  Anders Carlsson  <andersca@apple.com>
1544
1545         Rename NoncopyableFunction to Function
1546         https://bugs.webkit.org/show_bug.cgi?id=158354
1547
1548         Reviewed by Chris Dumez.
1549
1550         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1551         (WebCore::MediaEndpointPeerConnection::runTask):
1552         * Modules/mediastream/MediaEndpointPeerConnection.h:
1553         * Modules/webaudio/AudioDestinationNode.h:
1554         (WebCore::AudioDestinationNode::resume):
1555         (WebCore::AudioDestinationNode::suspend):
1556         (WebCore::AudioDestinationNode::close):
1557         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1558         (WebCore::DefaultAudioDestinationNode::resume):
1559         (WebCore::DefaultAudioDestinationNode::suspend):
1560         (WebCore::DefaultAudioDestinationNode::close):
1561         * Modules/webaudio/DefaultAudioDestinationNode.h:
1562         * dom/ActiveDOMCallbackMicrotask.cpp:
1563         (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
1564         * dom/ActiveDOMCallbackMicrotask.h:
1565         * dom/ScriptExecutionContext.h:
1566         (WebCore::ScriptExecutionContext::Task::Task):
1567         * fileapi/AsyncFileStream.cpp:
1568         (WebCore::callOnFileThread):
1569         (WebCore::AsyncFileStream::perform):
1570         * fileapi/AsyncFileStream.h:
1571         * page/FrameView.cpp:
1572         (WebCore::FrameView::queuePostLayoutCallback):
1573         (WebCore::FrameView::flushPostLayoutTasksQueue):
1574         * page/FrameView.h:
1575         * page/scrolling/ScrollingThread.cpp:
1576         (WebCore::ScrollingThread::dispatch):
1577         (WebCore::ScrollingThread::dispatchBarrier):
1578         (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
1579         * page/scrolling/ScrollingThread.h:
1580         * platform/GenericTaskQueue.cpp:
1581         (WebCore::TaskDispatcher<Timer>::postTask):
1582         * platform/GenericTaskQueue.h:
1583         (WebCore::TaskDispatcher::postTask):
1584         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1585         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1586         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
1587         * platform/mediastream/MediaStreamPrivate.cpp:
1588         (WebCore::MediaStreamPrivate::scheduleDeferredTask):
1589         * platform/mediastream/MediaStreamPrivate.h:
1590         * platform/mediastream/mac/AVMediaCaptureSource.h:
1591         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1592         (WebCore::AVMediaCaptureSource::scheduleDeferredTask):
1593         * style/StyleTreeResolver.cpp:
1594         (WebCore::Style::postResolutionCallbackQueue):
1595         (WebCore::Style::queuePostResolutionCallback):
1596         * style/StyleTreeResolver.h:
1597
1598 2016-06-24  Amir Alavi  <aalavi@apple.com>
1599
1600         Use _CFHTTPCookieStorageGetDefault directly instead of NSHTTPCookieStorage to get default cookie storage
1601         https://bugs.webkit.org/show_bug.cgi?id=159095
1602         rdar://problem/26630073
1603
1604         Reviewed by Brent Fulgham.
1605
1606         No new tests, it isn't possible to test this in a LayoutTest.
1607
1608         * platform/network/mac/CookieJarMac.mm:
1609         (WebCore::httpCookiesForURL): Get a CFHTTPCookieStorageRef when no cookie storage is provided to match the case when cookie storage is provided.
1610
1611 2016-06-24  Enrica Casucci  <enrica@apple.com>
1612
1613         Do not use iOS specific telephone detection on macOS.
1614         https://bugs.webkit.org/show_bug.cgi?id=159096
1615         rdar://problem/25870571
1616
1617         Reviewed by Anders Carlsson.
1618
1619         Adding platform guard.
1620
1621         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
1622         (WebCore::TelephoneNumberDetector::phoneNumbersScanner):
1623
1624 2016-06-24  Jer Noble  <jer.noble@apple.com>
1625
1626         Unreviewed build fix after r202429; AVStreamDataParser does not exist on iOS.
1627
1628         * platform/spi/mac/AVFoundationSPI.h:
1629
1630 2016-06-24  Jer Noble  <jer.noble@apple.com>
1631
1632         Unreviewed build fix after r202429; Fix the type of the delegate property on AVStreamDataParser.
1633
1634         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1635         * platform/spi/mac/AVFoundationSPI.h:
1636
1637 2016-06-02  Jer Noble  <jer.noble@apple.com>
1638
1639         [MSE] Adopt +[AVStreamDataParser outputMIMECodecParameterForInputMIMECodecParameter:]
1640         https://bugs.webkit.org/show_bug.cgi?id=158312
1641
1642         Reviewed by Eric Carlson.
1643
1644         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1645         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
1646
1647         Move the declaration of AVStreamDataParser into AVFoundationSPI.h:
1648
1649         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1650         (WebCore::CDMSessionAVStreamSession::update):
1651         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1652         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1653         (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
1654         * platform/spi/mac/AVFoundationSPI.h:
1655
1656 2016-06-24  Eric Carlson  <eric.carlson@apple.com>
1657
1658         [iOS, Mac] Assume a media file has audio during AirPlay
1659         https://bugs.webkit.org/show_bug.cgi?id=159088
1660         <rdar://problem/24616592>
1661
1662         Reviewed by Jer Noble.
1663
1664         No new tests, it isn't possible to test this in a LayoutTest.
1665
1666         * html/HTMLMediaElement.cpp:
1667         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Call 
1668           mediaSession->setCanProduceAudio(true) when AirPlay becomes active.
1669
1670 2016-06-24  Jer Noble  <jer.noble@apple.com>
1671
1672         Playback controls refer to wrong element when playing multiple items in a page.
1673         https://bugs.webkit.org/show_bug.cgi?id=159076
1674         <rdar://problem/26953532>
1675
1676         Reviewed by Beth Dakin.
1677
1678         Use a new method PlatformMediaSessionManager::currentSessionMatching() to get
1679         the most recently active media element which qualifies for playback controls.
1680
1681         * html/HTMLMediaElement.cpp:
1682         (WebCore::HTMLMediaElement::updatePlaybackControlsManager): Get the most recently active session.
1683         * html/MediaElementSession.cpp:
1684         (WebCore::MediaElementSession::canControlControlsManager): Make virtual; no longer takes an element.
1685         * html/MediaElementSession.h:
1686         (isType): Allow downcasting from PlatformMediaSession -> MediaElementSession.
1687         * page/ChromeClient.h:
1688         * platform/audio/PlatformMediaSession.h:
1689         (WebCore::PlatformMediaSession::canControlControlsManager): Defaults to false;
1690         * platform/audio/PlatformMediaSessionManager.cpp:
1691         (WebCore::PlatformMediaSessionManager::currentSessionMatching): Added.
1692         * platform/audio/PlatformMediaSessionManager.h:
1693
1694 2016-06-24  Dan Bernstein  <mitz@apple.com>
1695
1696         Fixed the macOS build.
1697
1698         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
1699
1700 2016-06-24  Dan Bernstein  <mitz@apple.com>
1701
1702         [iOS] Inline DataDetectorsAdditions.h
1703         https://bugs.webkit.org/show_bug.cgi?id=159093
1704
1705         Reviewed by Anders Carlsson.
1706
1707         * editing/cocoa/DataDetection.mm:
1708         (WebCore::constructURLStringForResult): Use soft-linked constant directly.
1709
1710         * platform/cocoa/DataDetectorsCoreSoftLink.h: Declare soft-linked constant.
1711         * platform/cocoa/DataDetectorsCoreSoftLink.mm: Define soft-linked constant.
1712         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Declare constant.
1713
1714 2016-06-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1715
1716         [GTK][EFL] ImageBufferCairo should accept resolution factor
1717         https://bugs.webkit.org/show_bug.cgi?id=157848
1718
1719         Reviewed by Martin Robinson.
1720
1721         ImageBufferCairo ignored the resolution factor passed in its constructor.
1722         This resolution factor is originally introduced for HiDPI Canvas,
1723         and since HiDPI canvas is not enabled in the ports using Cairo,
1724         the lack of this implementation does not cause any problems.
1725         And now, HiDPI Canvas is removed from the tree.
1726
1727         However, WebKit CSS filter uses this path.
1728         The missing implementation is required under the HiDPI environment.
1729
1730         Since Cairo surface can have the device scale factor transparently,
1731         the operations onto the surface is correctly done in the logical coordinate system.
1732         So all we need to handle carefully is the direct surface modification done
1733         in filter effects.
1734
1735         In this patch, we extend the image buffer size according to the resolution factor,
1736         as the same to the CoreGraphics' implementation (ImageBufferCG). And by setting the
1737         device scale factor of the surface correctly, we ensure that the rest of the Cairo
1738         painting stack works with the existing logical coordinate system. And in ImageBufferCairo,
1739         we carefully handle the logical and backing store coordinate system.
1740
1741         The attached test applies the CSS filter onto the svg image. And we resize the image size,
1742         and perform scrolling. It incurs the paint, and filter effect recalcuation.
1743         In that path, the filter effect side assumes that the image buffer size is scaled with the
1744         resolution factor. So without this patch, it incurs buffer overflow and leads WebProcess crash.
1745
1746         * platform/graphics/IntPoint.h:
1747         (WebCore::IntPoint::scale):
1748         * platform/graphics/cairo/ImageBufferCairo.cpp:
1749         (WebCore::ImageBufferData::createCompositorBuffer):
1750         (WebCore::ImageBuffer::ImageBuffer):
1751         (WebCore::ImageBuffer::copyImage):
1752         (WebCore::ImageBuffer::platformTransformColorSpace):
1753         (WebCore::getImageData):
1754         (WebCore::logicalUnit):
1755         (WebCore::backingStoreUnit):
1756         (WebCore::ImageBuffer::getUnmultipliedImageData):
1757         (WebCore::ImageBuffer::getPremultipliedImageData):
1758         (WebCore::ImageBuffer::putByteArray):
1759         (WebCore::ImageBuffer::copyToPlatformTexture):
1760
1761 2016-06-24  Frederic Wang  <fwang@igalia.com>
1762
1763         Refactor RenderMathMLOperator and RenderMathMLToken to avoid using anonymous renderers.
1764         https://bugs.webkit.org/show_bug.cgi?id=155018
1765
1766         Reviewed by Martin Robinson.
1767
1768         No new tests, already covered by existing tests.
1769
1770         We use MathOperator for RenderMathMLOperator to avoid creating anonymous text nodes again
1771         and again. We reimplement implicit mathvariant="italic" on single-char mi in a way that does
1772         not rely on creating anonymous text nodes. Finally, we improve the determination/update of
1773         when mathvariant is italic to avoid breaking foreign-mi-dynamic test.
1774         The change in the render tree structure breaks mfenced accessibility support but that will
1775         be fixed in follow-up patches. The simplifications made here will also allow to simplify the
1776         accessibility code.
1777
1778         * css/mathml.css:
1779         (mo): Deleted. This flexbox rule is no longer needed.
1780         * rendering/mathml/RenderMathMLBlock.cpp:
1781         (WebCore::RenderMathMLBlock::createAnonymousMathMLBlock): Deleted. We no longer need to
1782         create anonymous renderer with this function.
1783         * rendering/mathml/RenderMathMLBlock.h: Delete createAnonymousMathMLBlock.
1784         * rendering/mathml/RenderMathMLOperator.cpp: Implement layout functions without relying on
1785         flexbox or anonymous.
1786         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Handle the case of !useMathOperator()
1787         for which we need to add extra operator spacing after the RenderMathMLToken layout.
1788         (WebCore::RenderMathMLOperator::layoutBlock): Ditto.
1789         (WebCore::RenderMathMLOperator::isChildAllowed): Deleted. We allow the non-anonymous text.
1790         (WebCore::RenderMathMLOperator::rebuildTokenContent): No longer destroy and rebuild
1791         anonymous wrapper. Remove updateStyle call.
1792         (WebCore::RenderMathMLOperator::updateStyle): Deleted. We no longer need anonymous style for the spacing.
1793         * rendering/mathml/RenderMathMLOperator.h: Remove updateStyle() and isChildAllowed().
1794         Make textContent() public so that it can be accessed from the accessibility code.
1795         * rendering/mathml/RenderMathMLToken.cpp: Reimplement implicit mathvariant="italic" by
1796         painting MATHEMATICAL ITALIC characters instead of styling an anonymous wrapper.
1797         (WebCore::RenderMathMLToken::RenderMathMLToken): Init m_mathVariantGlyph and m_mathVariantGlyphDirty
1798         (WebCore::RenderMathMLToken::updateTokenContent): Set mathvariant glyph dirty when the content changes.
1799         (WebCore::transformToItalic): Helper function to map latin and greek alphabets to their
1800         MATHEMATICAL ITALIC counterpart.
1801         (WebCore::RenderMathMLToken::computePreferredLogicalWidths): Implement this function to
1802         handle the case where the mathvariant glyph is used.
1803         (WebCore::RenderMathMLToken::updateMathVariantGlyph): Helper function to update the mathvariant glyph.
1804         For now, we try and keep with the old (and limited) implementation: a mathvariant glyph may
1805         only used for single-char <mi> without mathvariant attribute attached to it.
1806         (WebCore::RenderMathMLToken::styleDidChange): Set the mathvariant glyph dirty when the style
1807         changes.
1808         (WebCore::RenderMathMLToken::updateFromElement): Remove updateStyle call and set mathvariant
1809         glyph dirty.
1810         (WebCore::RenderMathMLToken::firstLineBaseline): Implement this function to handle the case
1811          where the mathvariant glyph is used.
1812         (WebCore::RenderMathMLToken::layoutBlock): Ditto.
1813         (WebCore::RenderMathMLToken::paint): Ditto.
1814         (WebCore::RenderMathMLToken::paintChildren): Ditto.
1815         (WebCore::RenderMathMLToken::addChild): Deleted. No need to bother with anonymous renderer
1816         or style.
1817         (WebCore::RenderMathMLToken::createWrapperIfNeeded): Deleted. Ditto.
1818         (WebCore::RenderMathMLToken::updateStyle): Deleted. Ditto.
1819         * rendering/mathml/RenderMathMLToken.h: Update declarations of functions.
1820         (WebCore::RenderMathMLToken::setMathVariantGlyphDirty): Helper function to indicate that the
1821         mathvariant glyph will need to be updated.
1822
1823 2016-06-24  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1824
1825         Unreviewed EFL build fix.
1826
1827         There is forward declaration build error on EFL port.
1828
1829         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp: Include DOMWindow.h and Document.h.
1830
1831 2016-06-23  Brady Eidson  <beidson@apple.com>
1832
1833         Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing)
1834         https://bugs.webkit.org/show_bug.cgi?id=158991
1835
1836         Reviewed by Alex Christensen.
1837
1838         Test: storage/indexeddb/modern/blob-cursor.html
1839
1840         * platform/network/BlobDataFileReference.cpp:
1841         (WebCore::BlobDataFileReference::startTrackingModifications): Deleted.
1842
1843 2016-06-23  Alex Christensen  <achristensen@webkit.org>
1844
1845         Remove unused didCancelAuthenticationChallenge
1846         https://bugs.webkit.org/show_bug.cgi?id=158819
1847
1848         Reviewed by David Kilzer.
1849
1850         No change in behavior.  This callback was deprecated in Yosemite.  It is never called.
1851
1852         * loader/EmptyClients.h:
1853         * loader/FrameLoaderClient.h:
1854         * loader/ResourceLoadNotifier.cpp:
1855         (WebCore::ResourceLoadNotifier::didCancelAuthenticationChallenge): Deleted.
1856         * loader/ResourceLoadNotifier.h:
1857         * loader/ResourceLoader.cpp:
1858         (WebCore::ResourceLoader::didCancelAuthenticationChallenge): Deleted.
1859         * loader/ResourceLoader.h:
1860         * platform/network/ResourceHandle.h:
1861         * platform/network/ResourceHandleClient.h:
1862         (WebCore::ResourceHandleClient::didCancelAuthenticationChallenge): Deleted.
1863         * platform/network/mac/ResourceHandleMac.mm:
1864         (WebCore::ResourceHandle::didCancelAuthenticationChallenge): Deleted.
1865         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1866         (-[WebCoreResourceHandleAsDelegate connection:didCancelAuthenticationChallenge:]): Deleted.
1867         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1868         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didCancelAuthenticationChallenge:]): Deleted.
1869         * platform/spi/cocoa/NSURLDownloadSPI.h:
1870
1871 2016-06-23  Anders Carlsson  <andersca@apple.com>
1872
1873         Add "shippingType" to the list of valid payment request properties
1874         https://bugs.webkit.org/show_bug.cgi?id=159079
1875         <rdar://problem/26988429>
1876
1877         Reviewed by Dean Jackson.
1878
1879         * Modules/applepay/ApplePaySession.cpp:
1880         (WebCore::isValidPaymentRequestPropertyName):
1881
1882 2016-06-23  Benjamin Poulain  <benjamin@webkit.org>
1883
1884         Specialize synchronous event tracking per event type
1885         https://bugs.webkit.org/show_bug.cgi?id=158826
1886
1887         Reviewed by Simon Fraser.
1888
1889         First, kudos to Rick Byers for all his helps on passive event dispatch.
1890         The specs are pretty damn good and his help reviewing patches is very useful.
1891
1892         This patch change synchronous event dispatch to happen per event
1893         instead of per sequence touchstart->touchend.
1894
1895         The big advantage of this is we can dispatch more events asynchronously.
1896         For example, to handle a tap programmatically, you can limit the active listener
1897         to the touchend event. The touchstart and touchmove are now dispatched asynchronously.
1898
1899         The implementation is a simple extension to EventTrackingRegions.
1900         Instead of a single synchronous region, we have one region per event type.
1901         When processing the events, we only need to send the events synchronously
1902         if that particular event type has a synchronous region.
1903
1904         Note that EventDispatcher's touch event support already supports
1905         mixing synchronous and asynchronous events. The events are always processed
1906         in order even if asynchronous events are pending when a synchronous dispatch
1907         happens.
1908
1909         Tests: fast/events/touch/ios/tap-with-active-listener-inside-document-with-passive-listener.html
1910                fast/events/touch/ios/tap-with-active-listener-inside-window-with-passive-listener.html
1911                fast/events/touch/ios/tap-with-active-touch-end-listener.html
1912                fast/events/touch/ios/tap-with-passive-listener-inside-active-listener.html
1913                fast/events/touch/ios/tap-with-passive-touch-end-listener.html
1914                fast/events/touch/ios/tap-with-passive-touch-start-active-touch-end-listeners-on-elements.html
1915                fast/events/touch/ios/tap-with-passive-touch-start-active-touch-move-listeners-on-elements.html
1916
1917         * CMakeLists.txt:
1918         * WebCore.xcodeproj/project.pbxproj:
1919         * dom/EventTarget.cpp:
1920         (WebCore::EventTarget::hasActiveTouchEventListeners): Deleted.
1921         * dom/EventTarget.h:
1922         * page/DebugPageOverlays.cpp:
1923         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
1924         * page/Page.cpp:
1925         (WebCore::Page::nonFastScrollableRects):
1926         * page/scrolling/ScrollingCoordinator.cpp:
1927         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame):
1928         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1929         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
1930         * page/scrolling/ScrollingTree.cpp:
1931         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
1932         (WebCore::ScrollingTree::eventTrackingTypeForPoint):
1933         * page/scrolling/ScrollingTree.h:
1934         * platform/EventTrackingRegions.cpp: Added.
1935         (WebCore::EventTrackingRegions::trackingTypeForPoint):
1936         (WebCore::EventTrackingRegions::isEmpty):
1937         (WebCore::EventTrackingRegions::translate):
1938         (WebCore::EventTrackingRegions::uniteSynchronousRegion):
1939         (WebCore::EventTrackingRegions::unite):
1940         (WebCore::operator==):
1941         * platform/EventTrackingRegions.h:
1942         (WebCore::EventTrackingRegions::isEmpty): Deleted.
1943         (WebCore::EventTrackingRegions::trackingTypeForPoint): Deleted.
1944         (WebCore::operator==): Deleted.
1945
1946 2016-06-23  Simon Fraser  <simon.fraser@apple.com>
1947
1948         More attempting to fix external iOS builds.
1949
1950         * platform/spi/cocoa/QuartzCoreSPI.h:
1951
1952 2016-06-23  Simon Fraser  <simon.fraser@apple.com>
1953
1954         Try to fix the non-internal builds by defining CARenderServerBufferRef.
1955
1956         * platform/spi/cocoa/QuartzCoreSPI.h:
1957
1958 2016-06-23  Simon Fraser  <simon.fraser@apple.com>
1959
1960         [iOS] Make DumpRenderTree and WebKitTestRunner in the simulator use render server snapshotting
1961         https://bugs.webkit.org/show_bug.cgi?id=159077
1962
1963         Reviewed by Tim Horton.
1964
1965         Add CARenderServer SPIs.
1966
1967         Test: fast/harness/snapshot-captures-compositing.html
1968
1969         * platform/spi/cocoa/QuartzCoreSPI.h:
1970
1971 2016-06-23  Brian Burg  <bburg@apple.com>
1972
1973         Web Inspector: add assertions to catch dangling frontends that persist between tests
1974         https://bugs.webkit.org/show_bug.cgi?id=159073
1975
1976         Reviewed by Joseph Pecoraro.
1977
1978         Based on the analysis in https://webkit.org/b/159070, we suspect that some test
1979         flakiness might be caused by dangling frontends from previous test cases. Add an
1980         assertion that should catch any frontends that are attached to the inspected page's
1981         backend. There should never be any frontends connected when a test first starts.
1982
1983         * inspector/InspectorController.cpp:
1984         (WebCore::InspectorController::setIsUnderTest):
1985         * inspector/InspectorController.h:
1986
1987 2016-06-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
1988
1989         requestFrameAnimation() callback timestamp should be very close to Performance.now() 
1990         https://bugs.webkit.org/show_bug.cgi?id=159038
1991
1992         Reviewed by Simon Fraser.
1993
1994         Pass the Performance.now() to requestFrameAnimation() callback. Do not add
1995         the timeUntilOutput which is the difference between outputTime and now since
1996         this addition makes us report a timestamp ahead in the future by almost 33ms.
1997
1998         A new function named "nowTimestamp()" is added to the DOMWindow class. It
1999         calls Performance.now() if WEB_TIMING is enabled, otherwise it calls
2000         monotonicallyIncreasingTime(). The returned timestamp is seconds and it is
2001         relative to the document loading time.
2002
2003         The timestamp passing will be removed all the down till the callers of
2004         ScriptedAnimationController::serviceScriptedAnimations(). The callers will
2005         getting the now timestamp by calling DOMWindow::nowTimestamp().
2006
2007         Tests: animations/animation-callback-timestamp.html
2008                animations/animation-multiple-callbacks-timestamp.html
2009
2010         * dom/Document.cpp:
2011         (WebCore::Document::monotonicTimestamp):
2012         (WebCore::Document::serviceScriptedAnimations):
2013         * dom/Document.h:
2014         * dom/ScriptedAnimationController.cpp:
2015         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
2016         (WebCore::ScriptedAnimationController::animationTimerFired):
2017         (WebCore::ScriptedAnimationController::displayRefreshFired):
2018         * dom/ScriptedAnimationController.h:
2019         * html/HTMLMediaElement.cpp:
2020         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
2021         * loader/DocumentLoadTiming.h:
2022         (WebCore::DocumentLoadTiming::referenceWallTime):
2023         * page/DOMWindow.cpp:
2024         (WebCore::DOMWindow::nowTimestamp):
2025         * page/DOMWindow.h:
2026         * page/FrameView.cpp:
2027         (WebCore::FrameView::serviceScriptedAnimations):
2028         * page/FrameView.h:
2029         * platform/graphics/DisplayRefreshMonitor.cpp:
2030         (WebCore::DisplayRefreshMonitor::DisplayRefreshMonitor):
2031         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
2032         * platform/graphics/DisplayRefreshMonitor.h:
2033         (WebCore::DisplayRefreshMonitor::setMonotonicAnimationStartTime): Deleted.
2034         * platform/graphics/DisplayRefreshMonitorClient.cpp:
2035         (WebCore::DisplayRefreshMonitorClient::fireDisplayRefreshIfNeeded):
2036         * platform/graphics/DisplayRefreshMonitorClient.h:
2037         * platform/graphics/GraphicsLayerUpdater.cpp:
2038         (WebCore::GraphicsLayerUpdater::displayRefreshFired):
2039         * platform/graphics/GraphicsLayerUpdater.h:
2040         * platform/graphics/ios/DisplayRefreshMonitorIOS.h:
2041         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
2042         (-[WebDisplayLinkHandler handleDisplayLink:]):
2043         (WebCore::DisplayRefreshMonitorIOS::displayLinkFired):
2044         (WebCore::mediaTimeToCurrentTime): Deleted.
2045         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
2046         (WebCore::displayLinkCallback):
2047         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
2048         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
2049         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
2050         (WebCore::CompositingCoordinator::syncDisplayState):
2051         (WebCore::CompositingCoordinator::nextAnimationServiceTime):
2052
2053 2016-06-23  David Kilzer  <ddkilzer@apple.com>
2054
2055         Remove unused HarfBuzzFaceCoreText.cpp
2056         <https://webkit.org/b/159065>
2057
2058         Reviewed by Myles C. Maxfield.
2059
2060         * platform/graphics/harfbuzz/HarfBuzzFaceCoreText.cpp: Removed.
2061
2062 2016-06-23  Joseph Pecoraro  <pecoraro@apple.com>
2063
2064         Web Inspector: Memory Timeline sometimes shows impossible value for bmalloc size (underflowed)
2065         https://bugs.webkit.org/show_bug.cgi?id=158110
2066         <rdar://problem/26498584>
2067
2068         Reviewed by Andreas Kling.
2069
2070         IOSurface memory backing Canvas element buffers should be classified as "GC Owned",
2071         but should not be considered a part of bmalloc. In fact, the actual memory cost is
2072         external to the Web Content Process. The majority of extra memory reporters tend
2073         to report extra memory that is also allocated in bmalloc. However, some report
2074         non-bmalloc memory, such as the IOSurfaces here.
2075         
2076         Continue to report the memory cost without changes to inform the Heap for garbage
2077         collection. However, also keep better accounting of GCOwned memory that is external
2078         to the process for better accounting for the Resource Usage overlay and Web Inspector
2079         Memory timeline.
2080         
2081         This is a bit of a game where we want to display the best possible number for
2082         "GCOwned memory" in the tools, but some of that memory shows up in the other
2083         regions (bmalloc, system malloc, etc). Already many sizes are estimates
2084         (ReportExtraMemory, reportExtraMemory ignores small allocations), so we just focus
2085         on getting the largest sources of allocations, such as Canvas IOSurfaces here,
2086         into the right bucket. ResourceUsageThreadCocoa continues to subtract the "extra"
2087         memory from bmalloc. So, we should address other large sources of "extra memory"
2088         not in bmalloc. A likely candidate is HTMLMediaElement which uses the deprecated
2089         reporting right now.
2090
2091         * bindings/scripts/CodeGeneratorJS.pm:
2092         (GenerateImplementation):
2093         * bindings/scripts/IDLAttributes.txt:
2094         Add a way to report External memory, dependent on reporting Extra memory.
2095
2096         * html/HTMLCanvasElement.cpp:
2097         (WebCore::HTMLCanvasElement::externalMemoryCost):
2098         * html/HTMLCanvasElement.h:
2099         * html/HTMLCanvasElement.idl:
2100         Report external memory cost just like extra memory.
2101
2102         * page/ResourceUsageData.cpp:
2103         (WebCore::ResourceUsageData::ResourceUsageData):
2104         * page/ResourceUsageData.h:
2105         (WebCore::MemoryCategoryInfo::totalSize):
2106         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2107         (WebCore::RingBuffer::at):
2108         (WebCore::appendDataToHistory):
2109         (WebCore::ResourceUsageOverlay::platformDraw):
2110         * page/cocoa/ResourceUsageThreadCocoa.mm:
2111         (WebCore::categoryForVMTag):
2112         (WebCore::ResourceUsageThread::platformThreadBody):
2113         Do not count the GCOwned External memory as dirty memory.
2114         Include External memory output in the overlay.
2115
2116         * inspector/InspectorMemoryAgent.cpp:
2117         (WebCore::InspectorMemoryAgent::collectSample):
2118         When sizing the JavaScript portion, include both the GC Owned
2119         category's dirty and external memory. Ultimately we will
2120         want this everywhere in case things change.
2121
2122         * platform/graphics/ImageBuffer.cpp:
2123         (WebCore::memoryCost):
2124         (WebCore::externalMemoryCost):
2125         * platform/graphics/ImageBuffer.h:
2126         * platform/graphics/cg/ImageBufferCG.cpp:
2127         (WebCore::ImageBuffer::memoryCost):
2128         (WebCore::ImageBuffer::externalMemoryCost):
2129         Report IOSurface total bytes as extra memory and external memory
2130         so that it can be tracked as GC Owned memory that is separate from
2131         regular (bmalloc/other) in process memory.
2132
2133 2016-06-23  Alexey Proskuryakov  <ap@apple.com>
2134
2135         Handle (0, 0) ranges from Lookup
2136         https://bugs.webkit.org/show_bug.cgi?id=159062
2137         rdar://problem/26960385
2138
2139         Reviewed by Tim Horton.
2140
2141         * editing/mac/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeAtHitTestResult):
2142         Paper over <https://bugs.webkit.org/show_bug.cgi?id=159063>, which seems too involved
2143         to fix now.
2144
2145 2016-06-23  Joseph Pecoraro  <pecoraro@apple.com>
2146
2147         Web Inspector: first heap snapshot taken when a page is reloaded happens before the reload navigation
2148         https://bugs.webkit.org/show_bug.cgi?id=158995
2149         <rdar://problem/26923778>
2150
2151         Reviewed by Brian Burg.
2152
2153         When the "Heap" instrument is included in the Timeline list
2154         of instruments, defer starting it in an auto-capture scenario
2155         until after the page does its first navigation.
2156
2157         AutoCapture on the backend happens when it is enabled at
2158         the main resource starts loading. In that case it proceeds
2159         through the following phases:
2160
2161             No Auto Capture:
2162                 None
2163
2164             Auto Capture:
2165                 BeforeLoad -> FirstNavigation -> AfterFirstNavigation
2166
2167         When toggling instruments for backend initiated capture
2168         most instruments do not care and will just start/stop.
2169
2170         * inspector/InspectorInstrumentation.cpp:
2171         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2172         Inform the TimelineAgent that the main frame navigated.
2173         Do this after informing the HeapAgent (so any potential
2174         snapshot does not get cleared) and PageAgent (so the
2175         frontend knows the page navigated before the agent starts).
2176
2177         * inspector/InspectorTimelineAgent.h:
2178         * inspector/InspectorTimelineAgent.cpp:
2179         (WebCore::InspectorTimelineAgent::internalStop):
2180         (WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
2181         (WebCore::InspectorTimelineAgent::mainFrameNavigated):
2182         Update the auto capture phase transitions.
2183
2184         (WebCore::InspectorTimelineAgent::toggleHeapInstrument):
2185         Only start the heap agent during the None phase (console.profile)
2186         or with the first navigation (auto capture page navigation).
2187
2188 2016-06-23  Joseph Pecoraro  <pecoraro@apple.com>
2189
2190         Web Inspector: Snapshots should be cleared at some point
2191         https://bugs.webkit.org/show_bug.cgi?id=157907
2192         <rdar://problem/26373610>
2193
2194         Reviewed by Timothy Hatcher.
2195
2196         * CMakeLists.txt:
2197         * WebCore.xcodeproj/project.pbxproj:
2198         * inspector/InspectorAllInOne.cpp:
2199         New specialized agent.
2200
2201         * inspector/InspectorController.cpp:
2202         (WebCore::InspectorController::InspectorController):
2203         Construct a specialized HeapAgent.
2204
2205         * inspector/PageHeapAgent.h:
2206         * inspector/PageHeapAgent.cpp:
2207         (WebCore::PageHeapAgent::PageHeapAgent):
2208         (WebCore::PageHeapAgent::enable):
2209         (WebCore::PageHeapAgent::disable):
2210         (WebCore::PageHeapAgent::mainFrameNavigated):
2211         Clear backend snapshots on page navigations.
2212         Set the PageHeapAgent instrumenting agent on enable/disable.
2213
2214         * inspector/InstrumentingAgents.cpp:
2215         (WebCore::InstrumentingAgents::reset):
2216         * inspector/InstrumentingAgents.h:
2217         (WebCore::InstrumentingAgents::pageHeapAgent):
2218         (WebCore::InstrumentingAgents::setPageHeapAgent):
2219         Active PageHeapAgent.
2220
2221         * inspector/InspectorInstrumentation.cpp:
2222         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2223         Inform the PageHeapAgent when the mainframe navigates.
2224
2225 2016-06-23  Joseph Pecoraro  <pecoraro@apple.com>
2226
2227         CSSComputedStyleDeclaration::length should recalculate styles if needed to provide the correct value
2228         https://bugs.webkit.org/show_bug.cgi?id=159053
2229         <rdar://problem/26638119>
2230
2231         Reviewed by Simon Fraser.
2232
2233         Test: fast/css/variables/custom-property-computed-style-length-update.html
2234
2235         * css/CSSComputedStyleDeclaration.cpp:
2236         (WebCore::CSSComputedStyleDeclaration::length):
2237
2238 2016-06-23  John Wilander  <wilander@apple.com>
2239
2240         Enable window.open() for existing versions of Secret Society
2241         https://bugs.webkit.org/show_bug.cgi?id=159049
2242         <rdar://problem/26528349>
2243
2244         Reviewed by Andy Estes.
2245
2246         The Secret Society Hidden Mystery app has a broken version check treating iOS 10
2247         as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
2248         handler. We should allow the existing versions of the app to do this to not break
2249         them.
2250
2251         No new tests. Tested manually in the app.
2252
2253         * page/DOMWindow.cpp:
2254         (WebCore::DOMWindow::allowPopUp):
2255             Now checks with Settings whether it should allow a popup even though it is
2256             not processing a user gesture.
2257         * page/Settings.in:
2258             Added setting allowWindowOpenWithoutUserGesture.
2259         * platform/RuntimeApplicationChecks.h:
2260         * platform/RuntimeApplicationChecks.mm:
2261         (WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
2262             Added.
2263
2264 2016-06-23  Chris Dumez  <cdumez@apple.com>
2265
2266         Only call sqlite3_initialize() when a SQLite database is actually being opened
2267         https://bugs.webkit.org/show_bug.cgi?id=159033
2268
2269         Reviewed by Brady Eidson.
2270
2271         Only call sqlite3_initialize() when a SQLite database is actually being opened
2272         instead of doing it unconditionally. sqlite3_initialize() was previously called
2273         in the SQLiteDatabase constructor which gets called on WebContent process
2274         initialization because a DatabaseTracker is constructed on initialization and
2275         DatabaseTracker has a SQLiteDatabase data member.
2276
2277         * platform/sql/SQLiteDatabase.cpp:
2278         (WebCore::initializeSQLiteIfNecessary):
2279         (WebCore::SQLiteDatabase::open):
2280         (WebCore::SQLiteDatabase::SQLiteDatabase): Deleted.
2281         * platform/sql/SQLiteDatabase.h:
2282
2283 2016-06-23  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2284
2285         WebRTC: Align 'update ICE connection/gathering state' steps with the WebRTC 1.0 specification
2286         https://bugs.webkit.org/show_bug.cgi?id=159054
2287
2288         Reviewed by Eric Carlson.
2289
2290         Add checks for same state and closed RTCPeerConnection in the 'update ICE connection state'
2291         and 'update ICE gathering state' routines as described in [1].
2292
2293         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#update-ice-gathering-state
2294
2295         No change in current behavior.
2296
2297         * Modules/mediastream/RTCPeerConnection.cpp:
2298         (WebCore::RTCPeerConnection::updateIceGatheringState):
2299         (WebCore::RTCPeerConnection::updateIceConnectionState):
2300
2301 2016-06-23  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2302
2303         WebRTC: Add support for RTCPeerConnection legacy MediaStream-based API
2304         https://bugs.webkit.org/show_bug.cgi?id=158940
2305
2306         Reviewed by Eric Carlson.
2307
2308         Implement the legacy MediaStream-based RTCPeerConnection API as JS built-ins. The
2309         getRemoteStreams() function and the 'addstream' event are partly implemented with native
2310         code.
2311
2312         Test: fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html
2313
2314         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2315         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
2316         (WebCore::MediaEndpointPeerConnection::getRemoteStreams):
2317         The getRemoteStreams() function and the 'addstream' event is backed up by native code.
2318         * Modules/mediastream/MediaEndpointPeerConnection.h:
2319         * Modules/mediastream/MediaStream.idl:
2320         * Modules/mediastream/PeerConnectionBackend.h:
2321         * Modules/mediastream/RTCPeerConnection.h:
2322         * Modules/mediastream/RTCPeerConnection.idl:
2323         * Modules/mediastream/RTCPeerConnection.js:
2324         (initializeRTCPeerConnection):
2325         (getLocalStreams):
2326         (getRemoteStreams):
2327         (getStreamById):
2328         (addStream):
2329         (removeStream):
2330         Legacy API implemented as JS built-ins.
2331         * bindings/js/JSDOMGlobalObject.cpp:
2332         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2333         * bindings/js/WebCoreBuiltinNames.h:
2334
2335 2016-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2336
2337         Unreviewed. Fix the build with CSS Shapes disabled.
2338
2339         * css/StyleBuilderConverter.h:
2340
2341 2016-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2342
2343         [Soup] Clean up SocketStreamHandle soup implementation
2344         https://bugs.webkit.org/show_bug.cgi?id=159024
2345
2346         Reviewed by Žan Doberšek.
2347
2348         Stop using a global HashMap to "acivate"/"deactivate" handles, and just take a reference of the handle and
2349         pass the ownership to the callbacks, using a GCancellable to cancel all async operations.
2350
2351         * platform/network/soup/SocketStreamHandle.h:
2352         (WebCore::SocketStreamHandle::create):
2353         (WebCore::SocketStreamHandle::id): Deleted.
2354         * platform/network/soup/SocketStreamHandleSoup.cpp:
2355         (WebCore::SocketStreamHandle::SocketStreamHandle):
2356         (WebCore::SocketStreamHandle::connected):
2357         (WebCore::SocketStreamHandle::connectedCallback):
2358         (WebCore::SocketStreamHandle::readBytes):
2359         (WebCore::SocketStreamHandle::readReadyCallback):
2360         (WebCore::SocketStreamHandle::didFail):
2361         (WebCore::SocketStreamHandle::platformSend):
2362         (WebCore::SocketStreamHandle::platformClose):
2363         (WebCore::SocketStreamHandle::beginWaitingForSocketWritability):
2364         (WebCore::SocketStreamHandle::writeReadyCallback):
2365         (WebCore::getHandleFromId): Deleted.
2366         (WebCore::deactivateHandle): Deleted.
2367         (WebCore::activateHandle): Deleted.
2368         (WebCore::SocketStreamHandle::~SocketStreamHandle): Deleted.
2369         (WebCore::connectedCallback): Deleted.
2370         (WebCore::readReadyCallback): Deleted.
2371         (WebCore::writeReadyCallback): Deleted.
2372
2373 2016-06-22  Brady Eidson  <beidson@apple.com>
2374
2375         DatabaseProcess doesn't handle WebProcesses going away uncleanly.
2376         https://bugs.webkit.org/show_bug.cgi?id=158894
2377
2378         Reviewed by Alex Christensen.
2379
2380         No new tests (Covered by additions to existing API test).
2381
2382         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2383         (WebCore::IDBServer::IDBConnectionToClient::registerDatabaseConnection):
2384         (WebCore::IDBServer::IDBConnectionToClient::unregisterDatabaseConnection):
2385         (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
2386         * Modules/indexeddb/server/IDBConnectionToClient.h:
2387         
2388         * Modules/indexeddb/server/IDBServer.cpp:
2389         (WebCore::IDBServer::IDBServer::unregisterConnection): Call connectionToClientClosed() on
2390           the connection, which cleans up after it in the server.
2391         
2392         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2393         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
2394         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
2395
2396 2016-06-22  Benjamin Poulain  <bpoulain@apple.com>
2397
2398         AX: Add support for CSS4 :focus-within pseudo
2399         https://bugs.webkit.org/show_bug.cgi?id=140144
2400
2401         Reviewed by Antti Koivisto.
2402
2403         Tests: fast/css/pseudo-focus-within-basics.html
2404                fast/css/pseudo-focus-within-inside-shadow-dom.html
2405                fast/css/pseudo-focus-within-style-sharing-1.html
2406                fast/css/pseudo-focus-within-style-sharing-2.html
2407                fast/selectors/focus-within-style-update.html
2408
2409         * css/CSSSelector.cpp:
2410         (WebCore::CSSSelector::selectorText):
2411         * css/CSSSelector.h:
2412         * css/SelectorChecker.cpp:
2413         (WebCore::SelectorChecker::checkOne):
2414         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2415         * cssjit/SelectorCompiler.cpp:
2416         (WebCore::SelectorCompiler::addPseudoClassType):
2417         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2418         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasFocusWithin):
2419         * dom/ContainerNode.cpp:
2420         (WebCore::destroyRenderTreeIfNeeded):
2421         * dom/Element.cpp:
2422         (WebCore::Element::~Element):
2423         (WebCore::Element::setFocus):
2424         (WebCore::Element::unregisterNamedFlowContentElement):
2425         (WebCore::Element::setIsNamedFlowContentElement):
2426         (WebCore::Element::clearIsNamedFlowContentElement):
2427         (WebCore::Element::setStyleAffectedByFocusWithin):
2428         (WebCore::Element::rareDataStyleAffectedByFocusWithin):
2429         (WebCore::Element::rareDataIsNamedFlowContentElement):
2430         * dom/Element.h:
2431         (WebCore::Element::hasFocusWithin):
2432         (WebCore::Element::styleAffectedByFocusWithin):
2433         (WebCore::Element::isNamedFlowContentElement):
2434         (WebCore::Element::setHasFocusWithin):
2435         * dom/ElementRareData.h:
2436         (WebCore::ElementRareData::styleAffectedByFocusWithin):
2437         (WebCore::ElementRareData::setStyleAffectedByFocusWithin):
2438         (WebCore::ElementRareData::isNamedFlowContentElement):
2439         (WebCore::ElementRareData::setIsNamedFlowContentElement):
2440         (WebCore::ElementRareData::ElementRareData):
2441         (WebCore::ElementRareData::resetComputedStyle):
2442         * dom/Node.h:
2443         (WebCore::Node::flagHasFocusWithin):
2444         (WebCore::Node::isNamedFlowContentNode): Deleted.
2445         (WebCore::Node::setIsNamedFlowContentNode): Deleted.
2446         (WebCore::Node::clearIsNamedFlowContentNode): Deleted.
2447         * rendering/RenderNamedFlowThread.cpp:
2448         (WebCore::RenderNamedFlowThread::clearContentElements):
2449         (WebCore::RenderNamedFlowThread::registerNamedFlowContentElement):
2450         (WebCore::RenderNamedFlowThread::unregisterNamedFlowContentElement):
2451         (WebCore::nextNodeInsideContentElement):
2452         * style/RenderTreeUpdater.cpp:
2453         (WebCore::RenderTreeUpdater::updateElementRenderer):
2454         * style/StyleRelations.cpp:
2455         (WebCore::Style::commitRelationsToRenderStyle):
2456         (WebCore::Style::commitRelations):
2457         * style/StyleRelations.h:
2458         * style/StyleSharingResolver.cpp:
2459         (WebCore::Style::SharingResolver::canShareStyleWithElement):
2460
2461 2016-06-22  Oliver Hunt  <oliver@apple.com>
2462
2463         Integrate WebKit's CFURLConnection with App Transport Security
2464         https://bugs.webkit.org/show_bug.cgi?id=159039
2465         <rdar://problem/26953685>
2466
2467         Reviewed by Alex Christensen.
2468
2469         Pass additional options to NSURLConnect initialiser to identify that
2470         this connection is for WebKit content loading.
2471
2472         * platform/network/mac/ResourceHandleMac.mm:
2473         (WebCore::ResourceHandle::createNSURLConnection):
2474
2475 2016-06-20  Jeremy Jones  <jeremyj@apple.com>
2476
2477         Adopt commitPriority to get rid of the 2 AVPL solution for PiP
2478         https://bugs.webkit.org/show_bug.cgi?id=158949
2479         rdar://problem/26867866
2480
2481         Reviewed by Simon Fraser.
2482
2483         No new tests because there is no behavior change. This reverts changes from 
2484         https://bugs.webkit.org/show_bug.cgi?id=158148 and instead uses -[CAContext commitPriority:]
2485         to prevent flicker when moving a layer between contexts. 
2486         commitPriority allows the layer to be added to the destination context before it is 
2487         removed from the source context.
2488
2489         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: remove m_secondaryVideoLayer.
2490         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: ditto
2491         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity): ditto.
2492         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds): ditto.
2493         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): ditto.
2494         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity): ditto.
2495         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: ditto
2496         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): ditto
2497         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: ditto
2498         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers):ditto
2499         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: ditto
2500         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: ditto
2501         (WebCore::VideoFullscreenLayerManager::setVideoLayer): ditto
2502         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): ditto and adopt commitPriority.
2503         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenFrame): ditto
2504         (WebCore::VideoFullscreenLayerManager::setVideoLayers): Deleted. 
2505         (WebCore::VideoFullscreenLayerManager::didDestroyVideoLayer): remove m_secondaryVideoLayer.
2506         * platform/spi/cocoa/QuartzCoreSPI.h: Add commitPriority.
2507
2508 2016-06-22  Simon Fraser  <simon.fraser@apple.com>
2509
2510         REGRESSION (r201629): Weird button glitching on github.com
2511         https://bugs.webkit.org/show_bug.cgi?id=159031
2512         rdar://problem/26880332
2513
2514         Reviewed by Tim Horton.
2515
2516         r201629 changed the logic slightly when creating an image buffer for a scaled context;
2517         it set the buffer context's scale to the scale in the source context, but this failed
2518         to take into account the rounding up of the buffer size, which the old code did.
2519
2520         Fix by reverting to the old behavior.
2521
2522         Since buffer sizes can only be integral, changed compatibleBufferSize() to return
2523         an IntSize.
2524
2525         Test: fast/backgrounds/scaled-gradient-background.html
2526
2527         * platform/graphics/ImageBuffer.cpp:
2528         (WebCore::ImageBuffer::createCompatibleBuffer):
2529         (WebCore::ImageBuffer::compatibleBufferSize):
2530         * platform/graphics/ImageBuffer.h:
2531         * platform/graphics/IntRect.h:
2532         (WebCore::IntRect::area):
2533         * platform/graphics/IntSize.h:
2534         (WebCore::IntSize::area): Make this return an unsigned.
2535
2536 2016-06-22  Anders Carlsson  <andersca@apple.com>
2537
2538         Inline the last of the Apple Pay WebCore code
2539         https://bugs.webkit.org/show_bug.cgi?id=159032
2540
2541         Reviewed by Tim Horton.
2542
2543         * loader/EmptyClients.cpp:
2544         (WebCore::fillWithEmptyClients):
2545         * page/MainFrame.cpp:
2546         (WebCore::MainFrame::MainFrame):
2547         * page/MainFrame.h:
2548         * page/PageConfiguration.h:
2549         * platform/cocoa/ThemeCocoa.mm:
2550         (WebCore::passKitBundle):
2551         (WebCore::loadPassKitPDFPage):
2552         (WebCore::applePayButtonLogoBlack):
2553         (WebCore::applePayButtonLogoWhite):
2554         (WebCore::drawApplePayButton):
2555         (WebCore::ThemeCocoa::drawNamedImage):
2556
2557 2016-06-22  Anders Carlsson  <andersca@apple.com>
2558
2559         Exception is not thrown when shipping method is an invalid amount
2560         https://bugs.webkit.org/show_bug.cgi?id=159030
2561         rdar://problem/26700413
2562
2563         Reviewed by Tim Horton.
2564
2565         * Modules/applepay/ApplePaySession.cpp:
2566         (WebCore::createShippingMethods):
2567         Bail if createShippingMethod returns Nullopt.
2568
2569         (WebCore::createPaymentRequest):
2570         Bail if createShippingMethods returns Nullopt.
2571
2572 2016-06-22  Anders Carlsson  <andersca@apple.com>
2573
2574         Exception is not thrown when shipping method is an invalid amount
2575         https://bugs.webkit.org/show_bug.cgi?id=159029
2576         rdar://problem/26700413
2577
2578         Reviewed by Tim Horton.
2579
2580         * Modules/applepay/PaymentRequest.h:
2581         Change ShippingMethod::amount to be a signed 64-bit integer.
2582
2583         * Modules/applepay/PaymentRequestValidator.cpp:
2584         (WebCore::PaymentRequestValidator::validate):
2585         Call validateShippingMethods.
2586
2587         (WebCore::PaymentRequestValidator::validateShippingMethods):
2588         Validate all the shipping methods.
2589
2590         (WebCore::PaymentRequestValidator::validateShippingMethod):
2591         Check that the amount is >= 0.
2592
2593         * Modules/applepay/PaymentRequestValidator.h:
2594         Add new members.
2595
2596 2016-06-22  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2597
2598         WebRTC: Add support for the negotiationneeded event in MediaEndpointPeerConnection
2599         https://bugs.webkit.org/show_bug.cgi?id=158985
2600
2601         Reviewed by Eric Carlson.
2602
2603         Implement MediaEndpointPeerConnection's isNegotiationNeeded, markAsNeedingNegotiation and
2604         clearNegotiationNeededState functions. The calls to these functions are already up-to-date.
2605
2606         Test: fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html
2607
2608         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2609         (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation):
2610         * Modules/mediastream/MediaEndpointPeerConnection.h:
2611         * Modules/mediastream/RTCPeerConnection.cpp:
2612         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
2613
2614 2016-06-22  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2615
2616         WebRTC: Replace RTCPeerConnection custom constructor with a JS built-in constructor
2617         https://bugs.webkit.org/show_bug.cgi?id=158832
2618
2619         Reviewed by Eric Carlson and Youenn Fablet.
2620
2621         Use a JS built-in constructor instead of a custom constructor. This makes it easier to
2622         initialize private fields for functions implemented as JS built-ins. The constructor
2623         behavior is in need of updating, but that is left to a follow-up change [1].
2624
2625         [1] http://webkit.org/b/158936
2626         No change in behavior.
2627
2628         * CMakeLists.txt:
2629         * Modules/mediastream/RTCPeerConnection.cpp:
2630         (WebCore::RTCPeerConnection::create):
2631         (WebCore::RTCPeerConnection::RTCPeerConnection):
2632         (WebCore::RTCPeerConnection::~RTCPeerConnection):
2633         (WebCore::RTCPeerConnection::initializeWith):
2634         * Modules/mediastream/RTCPeerConnection.h:
2635         * Modules/mediastream/RTCPeerConnection.idl:
2636         * Modules/mediastream/RTCPeerConnection.js:
2637         (initializeRTCPeerConnection):
2638         Add JS built-in constructor function.
2639         * WebCore.xcodeproj/project.pbxproj:
2640         * bindings/js/JSRTCPeerConnectionCustom.cpp: Removed.
2641         (WebCore::constructJSRTCPeerConnection): Deleted.
2642
2643 2016-06-22  Youenn Fablet  <youenn@apple.com>
2644
2645         CrossOriginPreflightChecker should call DocumentThreadableLoader preflightFailure instead of didFailLoading
2646         https://bugs.webkit.org/show_bug.cgi?id=158984
2647
2648         Reviewed by Darin Adler.
2649
2650         No change of behavior.
2651
2652         Calling DocumentThreadableLoader preflightFailure instead of didFailLoading for any preflight error case.
2653
2654         * loader/CrossOriginPreflightChecker.cpp:
2655         (WebCore::CrossOriginPreflightChecker::notifyFinished): Directly calling preflightFailure callback.
2656         (WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
2657         (WebCore::CrossOriginPreflightChecker::handleLoadingFailure): Deleted.
2658         (WebCore::CrossOriginPreflightChecker::redirectReceived): Deleted (should have been removed as part of
2659         https://bugs.webkit.org/show_bug.cgi?id=111008).
2660         * loader/CrossOriginPreflightChecker.h:
2661
2662 2016-06-22  Youenn Fablet  <youennf@gmail.com>
2663
2664         JSDOMIterator forEach should support second optional parameter
2665         https://bugs.webkit.org/show_bug.cgi?id=159020
2666
2667         Reviewed by Chris Dumez.
2668
2669         Covered by beefed up test.
2670
2671         * bindings/js/JSDOMIterator.h:
2672         (WebCore::iteratorForEach): Setting callback thisValue to the second argument passed to forEach.
2673
2674 2016-06-22  Jer Noble  <jer.noble@apple.com>
2675
2676         Media controls stop working after exiting PiP
2677         https://bugs.webkit.org/show_bug.cgi?id=159026
2678         <rdar://problem/26753579>
2679
2680         Reviewed by Eric Carlson.
2681
2682         Do not slave setting WebVideoFullscreenModelVideoElement::setVideoElement() to
2683         WebPlaybackSessionModelVideoElement::setMediaElement(). After all, someone else
2684         (i.e., the media controls) may still be using it.
2685
2686         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
2687         (WebVideoFullscreenModelVideoElement::setVideoElement): Deleted.
2688         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2689         (WebVideoFullscreenControllerContext::didCleanupFullscreen):
2690         (WebVideoFullscreenControllerContext::setUpFullscreen):
2691
2692 2016-06-22  Jer Noble  <jer.noble@apple.com>
2693
2694         Update document's isPlayingMedia() state whenever media element's media state changes
2695         https://bugs.webkit.org/show_bug.cgi?id=159018
2696         <rdar://problem/26586630>
2697
2698         Reviewed by Beth Dakin.
2699
2700         The Document can end up with a stale m_mediaState if its own value isn't updated when
2701         its constituent HTMLMediaElement's m_mediaStates change.
2702
2703         * html/HTMLMediaElement.cpp:
2704         (WebCore::HTMLMediaElement::updateMediaState):
2705
2706 2016-06-22  Simon Fraser  <simon.fraser@apple.com>
2707
2708         Crash under GraphicsLayerCA::recursiveCommitChanges() with deep layer trees
2709         https://bugs.webkit.org/show_bug.cgi?id=159023
2710         rdar://problem/25377842
2711
2712         Reviewed by Tim Horton.
2713
2714         Having an on-stack DisplayList::Recorder increased the stack frame size significantly,
2715         causing stack exhaustion with deep layer trees, despite the existing depth check.
2716
2717         Make the Recorder heap-allocated to fix this.
2718
2719         Tested by LayoutTests/compositing//layer-creation/deep-tree.html.
2720
2721         * platform/graphics/ca/GraphicsLayerCA.cpp:
2722         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2723
2724 2016-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2725
2726         [GTK] Add support for variadic parameters to GObject DOM bindings
2727         https://bugs.webkit.org/show_bug.cgi?id=158942
2728
2729         Reviewed by Michael Catanzaro.
2730
2731         Generate code for functions having variadic parameters.
2732
2733         * bindings/scripts/CodeGeneratorGObject.pm:
2734         (GenerateFunction):
2735         (SkipFunction):
2736         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2737         (webkit_dom_test_obj_variadic_string_method):
2738         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2739
2740 2016-06-21  Benjamin Poulain  <bpoulain@apple.com>
2741
2742         :hover CSS pseudo-class sometimes keeps matching ever after mouse has left the element
2743         https://bugs.webkit.org/show_bug.cgi?id=158340
2744
2745         Reviewed by Simon Fraser.
2746
2747         When removing a hovered subtree from the document, we were getting
2748         into an inconsistent state where m_hoveredElement is in the detached
2749         subtree and we have no way of clearing the existing IsHovered flags.
2750
2751         What happens is:
2752         -The root "a" has an child "b" that is hovered.
2753         -"a" starts being removed from the tree, its renderer is destroyed.
2754         -RenderTreeUpdater::tearDownRenderers() pushes "a" on the teardownStack
2755          and calls hoveredElementDidDetach().
2756         -hoveredElementDidDetach() is called with "a". "a" is not the hovered
2757          element, the function does nothing.
2758         -RenderTreeUpdater::tearDownRenderers() pushes "b" on the teardownStack
2759          and calls hoveredElementDidDetach().
2760         -hoveredElementDidDetach() is called with "b". The next parent with a renderer
2761          is "a", m_hoveredElement is set to "a".
2762         -"a"'s parent is set to nullptr.
2763
2764         -> We have a m_hoveredElement on the root of a detached tree, making
2765            it impossible to clear the real dirty tree.
2766
2767         This patch changes the order in which we clear the flags.
2768         It is done in the order in which we clear the renderers to ensure
2769         the last element with a dead renderer is the last to update m_hoveredElement.
2770
2771         Tests: fast/css/ancestor-of-hovered-element-detached.html
2772                fast/css/ancestor-of-hovered-element-removed.html
2773
2774         * Source/WebCore/style/RenderTreeUpdater.cpp:
2775
2776 2016-06-21  Youenn Fablet  <youennf@gmail.com>
2777
2778         [Fetch API] Rename 'origin-only' referrer policy to 'origin'
2779         https://bugs.webkit.org/show_bug.cgi?id=158982
2780
2781         Reviewed by Alex Christensen.
2782
2783         Covered by updated tests.
2784
2785         * Modules/fetch/FetchRequest.cpp:
2786         (WebCore::setReferrerPolicy): Renaming origin-only to origin.
2787         * Modules/fetch/FetchRequest.idl: Ditto.
2788         * loader/FetchOptions.h: Ditto.
2789
2790 2016-06-21  Chris Dumez  <cdumez@apple.com>
2791
2792         Let the compiler generate the move constructor and assignment operator for ScriptExecutionContext::Task
2793         https://bugs.webkit.org/show_bug.cgi?id=159013
2794
2795         Reviewed by Brady Eidson.
2796
2797         Let the compiler generate the move constructor and assignment operator for
2798         ScriptExecutionContext::Task. We previously manually defined the move
2799         constructor but there is no need as it doesn't do anything special.
2800
2801         * dom/ScriptExecutionContext.h:
2802
2803 2016-06-21  Dean Jackson  <dino@apple.com>
2804
2805         DumpRenderTree crashed in com.apple.WebCore: WebCore::HTMLSelectElement::updateSelectedState
2806         https://bugs.webkit.org/show_bug.cgi?id=159009
2807         <rdar://problem/23454623>
2808
2809         Reviewed by Jon Lee.
2810
2811         It seems we can get bogus indices from UIKit's implementation
2812         of UIWebSelectMultiplePicker. Guard against this situation.
2813
2814         Covered by running the existing tests in WebKit1 with Guard Malloc,
2815         such as fast/spatial-navigation/snav-multiple-select-optgroup.html
2816
2817         * html/HTMLSelectElement.cpp:
2818         (WebCore::HTMLSelectElement::updateSelectedState): Early return
2819         if we get an index out of range.
2820
2821 2016-06-21  Chris Dumez  <cdumez@apple.com>
2822
2823         Pass ScriptExecutionContext::Task as rvalue reference
2824         https://bugs.webkit.org/show_bug.cgi?id=159007
2825
2826         Reviewed by Anders Carlsson.
2827
2828         Pass ScriptExecutionContext::Task as rvalue reference since its non-copyable
2829         and has to be moved in.
2830
2831         * workers/WorkerLoaderProxy.h:
2832         * workers/WorkerMessagingProxy.cpp:
2833         (WebCore::WorkerMessagingProxy::postTaskToLoader):
2834         (WebCore::WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope):
2835         * workers/WorkerMessagingProxy.h:
2836         * workers/WorkerRunLoop.cpp:
2837         (WebCore::WorkerRunLoop::postTask):
2838         (WebCore::WorkerRunLoop::postTaskAndTerminate):
2839         (WebCore::WorkerRunLoop::postTaskForMode):
2840         (WebCore::WorkerRunLoop::Task::Task):
2841         * workers/WorkerRunLoop.h:
2842
2843 2016-06-21  Anders Carlsson  <andersca@apple.com>
2844
2845         Include IdentifierInlines.h.
2846
2847         * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp:
2848
2849 2016-06-21  Anders Carlsson  <andersca@apple.com>
2850
2851         Add PaymentHeaders.h file.
2852
2853         * Modules/applepay/PaymentHeaders.h: Added.
2854         * WebCore.xcodeproj/project.pbxproj:
2855
2856 2016-06-21  Anders Carlsson  <andersca@apple.com>
2857
2858         Make a bunch of Apple Pay headers private instead of project.
2859
2860         * WebCore.xcodeproj/project.pbxproj:
2861
2862 2016-06-21  Anders Carlsson  <andersca@apple.com>
2863
2864         Move the last Apple Pay WebCore files to the open source repository
2865         https://bugs.webkit.org/show_bug.cgi?id=159005
2866
2867         Reviewed by Tim Horton.
2868
2869         * DerivedSources.make:
2870         * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp: Added.
2871         * Modules/applepay/ApplePayPaymentAuthorizedEvent.h: Added.
2872         * Modules/applepay/ApplePayPaymentAuthorizedEvent.idl: Added.
2873         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp: Added.
2874         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h: Added.
2875         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl: Added.
2876         * Modules/applepay/ApplePaySession.cpp: Added.
2877         * Modules/applepay/ApplePaySession.h: Added.
2878         * Modules/applepay/ApplePaySession.idl: Added.
2879         * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp: Added.
2880         * Modules/applepay/ApplePayShippingContactSelectedEvent.h: Added.
2881         * Modules/applepay/ApplePayShippingContactSelectedEvent.idl: Added.
2882         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp: Added.
2883         * Modules/applepay/ApplePayShippingMethodSelectedEvent.h: Added.
2884         * Modules/applepay/ApplePayShippingMethodSelectedEvent.idl: Added.
2885         * Modules/applepay/ApplePayValidateMerchantEvent.cpp: Added.
2886         * Modules/applepay/ApplePayValidateMerchantEvent.h: Added.
2887         * Modules/applepay/ApplePayValidateMerchantEvent.idl: Added.
2888         * Modules/applepay/Payment.h: Added.
2889         * Modules/applepay/PaymentAuthorizationStatus.h: Added.
2890         * Modules/applepay/PaymentContact.h: Added.
2891         * Modules/applepay/PaymentMerchantSession.h: Added.
2892         * Modules/applepay/PaymentMethod.h: Added.
2893         * Modules/applepay/PaymentRequestValidator.cpp: Added.
2894         * Modules/applepay/PaymentRequestValidator.h: Added.
2895         * Modules/applepay/cocoa/PaymentContactCocoa.mm: Added.
2896         * Modules/applepay/cocoa/PaymentMethodCocoa.mm: Added.
2897         * WebCore.xcodeproj/project.pbxproj:
2898         * bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp: Added.
2899         * bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp: Added.
2900         * bindings/js/JSApplePaySessionCustom.cpp: Added.
2901         * bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp: Added.
2902         * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp: Added.
2903         * dom/EventNames.in:
2904         * dom/EventTargetFactory.in:
2905
2906 2016-06-21  Anders Carlsson  <andersca@apple.com>
2907
2908         Fix build.
2909
2910         * Configurations/FeatureDefines.xcconfig:
2911
2912 2016-06-21  Jiewen Tan  <jiewen_tan@apple.com>
2913
2914         Unreviewed, rolling out r202302, r202303, r202305, and
2915         r202306.
2916
2917         Roll out the rollouts because of breaking the build.
2918
2919         Reverted changesets:
2920
2921         "Unreviewed, rolling out r200678."
2922         https://bugs.webkit.org/show_bug.cgi?id=157453
2923         http://trac.webkit.org/changeset/202302
2924
2925         "Unreviewed, rolling out r200619."
2926         https://bugs.webkit.org/show_bug.cgi?id=131443
2927         http://trac.webkit.org/changeset/202303
2928
2929         "Unreviewed, attempt to fix the build after r202303."
2930         http://trac.webkit.org/changeset/202305
2931
2932         "Unreviewed, attempt to fix the build after r202303."
2933         http://trac.webkit.org/changeset/202306
2934
2935 2016-06-21  Chris Dumez  <cdumez@apple.com>
2936
2937         Unreviewed, attempt to fix the build after r202303.
2938
2939         * bindings/js/JSDOMIterator.h:
2940         (WebCore::IteratorInspector::decltype):
2941         (WebCore::IteratorInspector::test):
2942
2943 2016-06-21  Chris Dumez  <cdumez@apple.com>
2944
2945         Unreviewed, attempt to fix the build after r202303.
2946
2947         * bindings/js/JSDOMIterator.h:
2948         (WebCore::toJS):
2949
2950 2016-06-21  Jiewen Tan  <jiewen_tan@apple.com>
2951
2952         Unreviewed, rolling out r200619.
2953
2954         This incompleted feature broke http://m.yahoo.co.jp. Roll it
2955         out together with r200678.
2956
2957         Reverted changeset:
2958
2959         "NodeList should be iterable"
2960         https://bugs.webkit.org/show_bug.cgi?id=131443
2961         http://trac.webkit.org/changeset/200619
2962
2963 2016-06-21  Jiewen Tan  <jiewen_tan@apple.com>
2964
2965         Unreviewed, rolling out r200678.
2966
2967         This incompleted feature broke http://m.yahoo.co.jp. Roll it
2968         out together with r200619.
2969
2970         Reverted changeset:
2971
2972         "Ensure DOM iterators remain done"
2973         https://bugs.webkit.org/show_bug.cgi?id=157453
2974         http://trac.webkit.org/changeset/200678
2975
2976 2016-06-21  Anders Carlsson  <andersca@apple.com>
2977
2978         Begin moving the Apple Pay code to the open source repository
2979         https://bugs.webkit.org/show_bug.cgi?id=158998
2980
2981         Reviewed by Tim Horton.
2982
2983         * Configurations/FeatureDefines.xcconfig:
2984         Add ENABLE_APPLE_PAY.
2985
2986         * Modules/applepay/PaymentCoordinator.cpp: Added.
2987         * Modules/applepay/PaymentCoordinator.h: Added.
2988         * Modules/applepay/PaymentCoordinatorClient.h: Added.
2989         * Modules/applepay/PaymentRequest.cpp: Added.
2990         * Modules/applepay/PaymentRequest.h: Added.
2991         * Modules/applepay/cocoa/PaymentCocoa.mm: Added.
2992         * WebCore.xcodeproj/project.pbxproj:
2993         Add new files.
2994
2995         * dom/EventNames.h:
2996         Add new event names.
2997
2998         * page/MainFrame.h:
2999         Use a forward declaration.
3000
3001 2016-06-21  Said Abou-Hallawa  <sabouhallawa@apple,com>
3002
3003         Add system tracing points for requestAnimationFrame() workflow
3004         https://bugs.webkit.org/show_bug.cgi?id=158723
3005
3006         Reviewed by Simon Fraser.
3007
3008         Add trace points for requestAnimationFrame().
3009
3010         * dom/ScriptedAnimationController.cpp:
3011         (WebCore::ScriptedAnimationController::requestAnimationFrameEnabled):
3012         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
3013         (WebCore::ScriptedAnimationController::windowScreenDidChange):
3014         (WebCore::ScriptedAnimationController::scheduleAnimation):
3015         * dom/ScriptedAnimationController.h:
3016         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
3017         (WebCore::DisplayRefreshMonitorIOS::requestRefreshCallback):
3018         (WebCore::DisplayRefreshMonitorIOS::displayLinkFired):
3019
3020 2016-06-20  Simon Fraser  <simon.fraser@apple.com>
3021
3022         [iOS] Typing text into a text field or text area causes screen to scroll down (hiding text entry)
3023         https://bugs.webkit.org/show_bug.cgi?id=158970
3024
3025         Reviewed by Ryosuke Niwa.
3026
3027         insertTextWithoutSendingTextEvent() should only reveal the selection up to the main frame on iOS,
3028         since the UI process can zoom and scroll the view to the text input.
3029
3030         Test: fast/forms/ios/typing-in-input-in-iframe.html
3031
3032         * editing/Editor.cpp:
3033         (WebCore::Editor::insertTextWithoutSendingTextEvent):
3034
3035 2016-06-21  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3036
3037         WebRTC: Remove unused MediaEndpointClient::gotRemoteSource function
3038         https://bugs.webkit.org/show_bug.cgi?id=158986
3039
3040         Reviewed by Eric Carlson.
3041
3042         Remote sources are explicitly created with MediaEndpoint::createMutedRemoteSource so the
3043         MediaEndpointClient::gotRemoteSource can be removed.
3044
3045         No change in behavior.
3046
3047         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3048         (WebCore::MediaEndpointPeerConnection::gotRemoteSource): Deleted.
3049         * Modules/mediastream/MediaEndpointPeerConnection.h:
3050         * platform/mediastream/MediaEndpoint.h:
3051
3052 2016-06-20  Simon Fraser  <simon.fraser@apple.com>
3053
3054         Focus event dispatched in iframe causes parent document to scroll incorrectly
3055         https://bugs.webkit.org/show_bug.cgi?id=158629
3056         rdar://problem/26521616
3057
3058         Reviewed by Tim Horton.
3059
3060         When focussing elements in iframes, the page could scroll to an incorrect location.
3061         This happened because code in Element::focus() tried to disable scrolling on focus,
3062         but did so only for the current frame, so ancestor frames got programmatically scrolled.
3063         On iOS we handle the scrolling in the UI process, so never want the web process to
3064         do programmatic scrolling.
3065
3066         Fix by changing the focus and cache restore code to use SelectionRevealMode::DoNotReveal,
3067         rather than manually prohibiting frame scrolling. Pass SelectionRevealMode through various callers,
3068         and use RevealUpToMainFrame for iOS, allowing the UI process to do the zoomToRect: for the main frame.
3069
3070         Tests: fast/forms/ios/focus-input-in-iframe.html
3071                fast/forms/ios/programmatic-focus-input-in-iframe.html
3072
3073         * dom/Document.h:
3074         * dom/Element.cpp:
3075         (WebCore::Element::scrollIntoView):
3076         (WebCore::Element::scrollIntoViewIfNeeded):
3077         (WebCore::Element::scrollIntoViewIfNotVisible):
3078         (WebCore::Element::focus):
3079         (WebCore::Element::updateFocusAppearance):
3080         * dom/Element.h:
3081         * editing/Editor.cpp:
3082         (WebCore::Editor::insertTextWithoutSendingTextEvent):
3083         (WebCore::Editor::revealSelectionAfterEditingOperation):
3084         (WebCore::Editor::findStringAndScrollToVisible):
3085         * editing/FrameSelection.cpp:
3086         (WebCore::FrameSelection::updateAndRevealSelection):
3087         (WebCore::FrameSelection::revealSelection):
3088         (WebCore::FrameSelection::FrameSelection): Deleted.
3089         * editing/FrameSelection.h:
3090         * html/HTMLInputElement.cpp:
3091         (WebCore::HTMLInputElement::updateFocusAppearance):
3092         * html/HTMLTextAreaElement.cpp:
3093         (WebCore::HTMLTextAreaElement::updateFocusAppearance):
3094         * page/ContextMenuController.cpp:
3095         (WebCore::ContextMenuController::contextMenuItemSelected):
3096         * page/FrameView.cpp:
3097         (WebCore::FrameView::scrollToAnchor):
3098         * rendering/RenderLayer.cpp:
3099         (WebCore::RenderLayer::scrollRectToVisible):
3100         (WebCore::RenderLayer::autoscroll):
3101         * rendering/RenderLayer.h:
3102         * rendering/RenderObject.cpp:
3103         (WebCore::RenderObject::scrollRectToVisible):
3104         * rendering/RenderObject.h:
3105
3106 2016-06-21  Frederic Wang  <fwang@igalia.com>
3107
3108         Implement RenderMathMLOperator::layoutBlock
3109         https://bugs.webkit.org/show_bug.cgi?id=157521
3110
3111         Reviewed by Brent Fulgham.
3112
3113         No new tests, already covered by existing tests.
3114
3115         Add an initial implementation of RenderMathMLOperator::layoutBlock, which will perform
3116         special layout when the MathOperator is used. We also improved how the logical height is
3117         calculated and avoid updating the style when stretchTo is called.
3118
3119         * rendering/mathml/RenderMathMLOperator.cpp:
3120         (WebCore::RenderMathMLOperator::stretchTo):
3121         (WebCore::RenderMathMLOperator::layoutBlock):
3122         (WebCore::RenderMathMLOperator::computeLogicalHeight): Deleted.
3123         * rendering/mathml/RenderMathMLOperator.h:
3124
3125 2016-06-21  Chris Dumez  <cdumez@apple.com>
3126
3127         Unreviewed, roll out r202268 as it looks like it was a ~50% regression on Dromaeo DOM Core
3128
3129         * bindings/scripts/CodeGeneratorJS.pm:
3130         (GenerateImplementation):
3131         (GeneratePrototypeDeclaration):
3132         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3133         (WebCore::JSInterfaceNamePrototype::finishCreation):
3134         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3135         (WebCore::JSTestActiveDOMObjectPrototype::finishCreation):
3136         (WebCore::JSTestActiveDOMObject::createPrototype): Deleted.
3137         (WebCore::JSTestActiveDOMObject::prototype): Deleted.
3138         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3139         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation):
3140         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3141         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
3142         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3143         (WebCore::JSTestCustomNamedGetterPrototype::finishCreation):
3144         (WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter): Deleted.
3145         (WebCore::JSTestCustomNamedGetter::createPrototype): Deleted.
3146         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3147         (WebCore::JSTestEventConstructorPrototype::finishCreation):
3148         (WebCore::JSTestEventConstructor::createPrototype): Deleted.
3149         (WebCore::JSTestEventConstructor::prototype): Deleted.
3150         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3151         (WebCore::JSTestEventTargetPrototype::finishCreation):
3152         (WebCore::JSTestEventTarget::JSTestEventTarget): Deleted.
3153         (WebCore::JSTestEventTarget::createPrototype): Deleted.
3154         * bindings/scripts/test/JS/JSTestException.cpp:
3155         (WebCore::JSTestExceptionPrototype::finishCreation):
3156         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3157         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
3158         * bindings/scripts/test/JS/JSTestInterface.cpp:
3159         (WebCore::JSTestInterfacePrototype::finishCreation):
3160         (WebCore::jsTestInterfaceImplementsStr2): Deleted.
3161         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3162         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
3163         (WebCore::JSTestJSBuiltinConstructor::JSTestJSBuiltinConstructor): Deleted.
3164         (WebCore::JSTestJSBuiltinConstructor::createPrototype): Deleted.
3165         (WebCore::JSTestJSBuiltinConstructor::destroy): Deleted.
3166         (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom): Deleted.
3167         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3168         (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation):
3169         (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener): Deleted.
3170         (WebCore::JSTestMediaQueryListListener::createPrototype): Deleted.
3171         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3172         (WebCore::JSTestNamedConstructorPrototype::finishCreation):
3173         * bindings/scripts/test/JS/JSTestNode.cpp:
3174         (WebCore::JSTestNodePrototype::finishCreation):
3175         (WebCore::JSTestNode::JSTestNode): Deleted.
3176         (WebCore::JSTestNode::prototype): Deleted.
3177         (WebCore::jsTestNodeName): Deleted.
3178         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3179         (WebCore::JSTestNondeterministicPrototype::finishCreation):
3180         (WebCore::JSTestNondeterministic::JSTestNondeterministic): Deleted.
3181         (WebCore::JSTestNondeterministic::prototype): Deleted.
3182         (WebCore::JSTestNondeterministic::destroy): Deleted.
3183         * bindings/scripts/test/JS/JSTestObj.cpp:
3184         (WebCore::JSTestObjPrototype::finishCreation):
3185         (WebCore::JSTestObj::JSTestObj): Deleted.
3186         (WebCore::JSTestObj::createPrototype): Deleted.
3187         (WebCore::JSTestObj::prototype): Deleted.
3188         (WebCore::JSTestObj::destroy): Deleted.
3189         (WebCore::JSTestObj::getOwnPropertySlot): Deleted.
3190         (WebCore::JSTestObj::getOwnPropertySlotByIndex): Deleted.
3191         (WebCore::jsTestObjReadOnlyLongAttr): Deleted.
3192         (WebCore::jsTestObjReadOnlyStringAttr): Deleted.
3193         (WebCore::jsTestObjReadOnlyTestObjAttr): Deleted.
3194         (WebCore::jsTestObjConstructorStaticReadOnlyLongAttr): Deleted.
3195         (WebCore::jsTestObjConstructorStaticStringAttr): Deleted.
3196         (WebCore::jsTestObjConstructorTestSubObj): Deleted.
3197         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor): Deleted.
3198         (WebCore::jsTestObjEnumAttr): Deleted.
3199         (WebCore::jsTestObjByteAttr): Deleted.
3200         (WebCore::jsTestObjOctetAttr): Deleted.
3201         (WebCore::jsTestObjShortAttr): Deleted.
3202         (WebCore::jsTestObjClampedShortAttr): Deleted.
3203         (WebCore::jsTestObjEnforceRangeShortAttr): Deleted.
3204         (WebCore::jsTestObjUnsignedShortAttr): Deleted.
3205         (WebCore::jsTestObjLongAttr): Deleted.
3206         (WebCore::jsTestObjLongLongAttr): Deleted.
3207         (WebCore::jsTestObjReflectedCustomBooleanAttr): Deleted.
3208         (WebCore::jsTestObjReflectedCustomURLAttr): Deleted.
3209         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3210         (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation):
3211         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3212         (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation):
3213         (WebCore::JSTestOverrideBuiltins::JSTestOverrideBuiltins): Deleted.
3214         (WebCore::JSTestOverrideBuiltins::createPrototype): Deleted.
3215         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3216         (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation):
3217         (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface): Deleted.
3218         (WebCore::JSTestSerializedScriptValueInterface::prototype): Deleted.
3219         (WebCore::JSTestSerializedScriptValueInterface::destroy): Deleted.
3220         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3221         (WebCore::JSTestTypedefsPrototype::finishCreation):
3222         (WebCore::JSTestTypedefs::JSTestTypedefs): Deleted.
3223         (WebCore::JSTestTypedefs::createPrototype): Deleted.
3224         (WebCore::JSTestTypedefs::prototype): Deleted.
3225         (WebCore::JSTestTypedefs::destroy): Deleted.
3226         (WebCore::jsTestTypedefsUnsignedLongLongAttr): Deleted.
3227         (WebCore::jsTestTypedefsImmutableSerializedScriptValue): Deleted.
3228         (WebCore::jsTestTypedefsAttrWithGetterException): Deleted.
3229         * bindings/scripts/test/JS/JSattribute.cpp:
3230         (WebCore::JSattributePrototype::finishCreation):
3231         * bindings/scripts/test/JS/JSreadonly.cpp:
3232         (WebCore::JSreadonlyPrototype::finishCreation):
3233
3234 2016-06-21  Keith Miller  <keith_miller@apple.com>
3235
3236         It should be easy to add a private global helper function for builtins
3237         https://bugs.webkit.org/show_bug.cgi?id=158893
3238
3239         Reviewed by Mark Lam.
3240
3241         Add JSCJSValueInlines.h to fix build issues.
3242
3243         * platform/mock/mediasource/MockBox.cpp:
3244
3245 2016-06-21  Amir Alavi  <aalavi@apple.com>
3246
3247         Upstream WKHTTPCookiesForURL from WebKitSystemInterface to OpenSource
3248         https://bugs.webkit.org/show_bug.cgi?id=158967
3249
3250         Reviewed by Brent Fulgham.
3251
3252         * platform/ios/WebCoreSystemInterfaceIOS.mm:
3253         * platform/mac/WebCoreSystemInterface.h:
3254         * platform/mac/WebCoreSystemInterface.mm:
3255         * platform/network/mac/CookieJarMac.mm:
3256         (WebCore::httpCookiesForURL): Upstreamed from WebKitSystemInterface.
3257         (WebCore::cookiesForURL): Changed to call httpCookiesForURL.
3258         (WebCore::deleteCookie): Ditto.
3259         * platform/spi/cf/CFNetworkSPI.h:
3260
3261 2016-06-21  Chris Dumez  <cdumez@apple.com>
3262
3263         Unreviewed, rolling out r202231.
3264
3265         Seems to have regressed PLT on both iOS and Mac (very obvious
3266         on iOS Warm PLT)
3267
3268         Reverted changeset:
3269
3270         "When navigating, discard decoded image data that is only live
3271         due to page cache."
3272         https://bugs.webkit.org/show_bug.cgi?id=158941
3273         http://trac.webkit.org/changeset/202231
3274
3275 2016-06-21  Youenn Fablet  <youennf@gmail.com>
3276
3277         Add bindings generator support to add a native JS function to both a 'name' and a private '@name' slot
3278         https://bugs.webkit.org/show_bug.cgi?id=158777
3279
3280         Reviewed by Eric Carlson.
3281
3282         Adding a new PublicIdentifier keyword to cover the case of the same function exposed publicly and privately.
3283         Renaming Private keyword to PrivateIdentifier.
3284         Functions exposed both publicly and privately should set both keywords.
3285         By default, functions are publically exposed.
3286
3287         Updated binding generator to generate public exposure except if PrivateIdentifer is set and PublicIdentifier is
3288         not set.
3289
3290         Keeping skipping of ObjC/GObject binding for PrivateIdentifier-only functions.
3291
3292         Covered by rebased binding tests.
3293
3294         * Modules/fetch/FetchHeaders.idl:
3295         * Modules/fetch/FetchResponse.idl:
3296         * Modules/mediastream/MediaDevices.idl:
3297         * Modules/mediastream/RTCPeerConnection.idl:
3298         * bindings/scripts/CodeGeneratorGObject.pm:
3299         (SkipFunction):
3300         * bindings/scripts/CodeGeneratorJS.pm:
3301         (GeneratePropertiesHashTable):
3302         (GenerateImplementation):
3303         * bindings/scripts/CodeGeneratorObjC.pm:
3304         (SkipFunction):
3305         * bindings/scripts/IDLAttributes.txt:
3306         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3307         (webkit_dom_test_obj_private_also_method):
3308         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3309         * bindings/scripts/test/JS/JSTestObj.cpp:
3310         (WebCore::JSTestObjPrototype::finishCreation):
3311         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
3312         (WebCore::jsTestObjPrototypeFunctionPrivateAlsoMethod):
3313         * bindings/scripts/test/ObjC/DOMTestObj.h:
3314         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3315         (-[DOMTestObj privateAlsoMethod:]):
3316         * bindings/scripts/test/TestObj.idl:
3317
3318 2016-06-21  Dan Bernstein  <mitz@apple.com>
3319
3320         Inlined some picture-in-picture code.
3321         https://bugs.webkit.org/show_bug.cgi?id=158977
3322
3323         Reviewed by Eric Carlsson.
3324
3325         This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
3326         Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
3327         Jon Lee, Remy Demarest, and Zach Li.
3328
3329         * English.lproj/Localizable.strings:
3330           Updated using update-webkit-localizable-strings.
3331
3332         * Modules/mediacontrols/mediaControlsApple.css:
3333         (video:-webkit-full-screen::-webkit-media-controls-panel .picture-in-picture-button):
3334
3335         * Modules/mediacontrols/mediaControlsApple.js:
3336         (Controller.prototype.configureFullScreenControls):
3337
3338         * WebCore.xcodeproj/project.pbxproj: Added PIPSPI.h.
3339
3340         * html/HTMLMediaElement.cpp: Inlined code from HTMLMediaElementAdditions.cpp.
3341
3342         * html/HTMLVideoElement.cpp: Inlined code from HTMLVideoElementSupportsFullscreenAdditions.cpp.
3343
3344         * platform/LocalizedStrings.cpp:
3345         (WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen): Brought in from ContextMenuLocalizedStringsAdditions.cpp.
3346         (WebCore::contextMenuItemTagExitVideoEnhancedFullscreen): Ditto.
3347         (WebCore::AXARIAContentGroupText): Made updates that should have been part of r198543.
3348
3349         * platform/mac/WebVideoFullscreenInterfaceMac.h: Removed USE(APPLE_INTERNAL_SDK) guards.
3350         * platform/mac/WebVideoFullscreenInterfaceMac.mm: Inlined WebVideoFullscreenInterfaceMacAdditions.mm.
3351
3352         * platform/spi/mac/PIPSPI.h: Added.
3353
3354         * rendering/HitTestResult.cpp: Inlined HitTestResultAdditions.cpp.
3355
3356         * rendering/RenderThemeMac.mm:
3357         (WebCore::RenderThemeMac::mediaControlsStyleSheet): Removed include of
3358           RenderThemeMacMediaControlsStyleSheetAdditions.mm now that the content is in
3359           mediaControlsApple.css.
3360         (WebCore::RenderThemeMac::mediaControlsScript): Removed include of
3361           RenderThemeMacMediaControlsScriptAdditions.mm now that the content is in mediaControlsApple.js.
3362
3363 2016-06-21  Miguel Gomez  <magomez@igalia.com>
3364
3365         [GStreamer] video orientation support
3366         https://bugs.webkit.org/show_bug.cgi?id=148524
3367
3368         Reviewed by Philippe Normand.
3369
3370         Rotate video frames to follow the orientation metadata in the video file.
3371         When accelerated compositing is disabled, the rotation is performed by a videoflip element added
3372         to the playbin.
3373         When accelerated compositing is enabled, the rotation is peformed by the TextureMapper in response
3374         to a rotation flag set on the frame buffers.
3375
3376         Test: media/video-orientation.html
3377
3378         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3379         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3380         Handle the GST_MESSAGE_TAG message from the bin.
3381         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3382         Add the videflip element to the bin when accelerated compositing is disabled.
3383         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3384         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
3385         Receive and use extra flags for the TextureMapper.
3386         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
3387         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
3388         When using accelerated compositing, transpose the video size if the rotation is 90 or 270 degrees.
3389         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
3390         Add rotation flag to frame holder and layer buffer.
3391         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
3392         Use rotation flag when requesting the TextureMapper to draw.
3393         (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceRotation):
3394         Function to store the video rotation.
3395         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3396         Add bits to store the video rotation.
3397         * platform/graphics/texmap/TextureMapperGL.cpp:
3398         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
3399         Modify the patternTransform according to the rotation flag passed.
3400         * platform/graphics/texmap/TextureMapperGL.h:
3401         Add new flags to handle the video souce rotation.
3402         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
3403         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
3404         Change the drawTexture method used so custom flags can be passed.
3405         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
3406         (WebCore::TextureMapperPlatformLayerBuffer::setExtraFlags):
3407         New method to set TextureMapper flags.
3408
3409 2016-06-20  Frederic Wang  <fwang@igalia.com>
3410
3411         Use the MathOperator to handle some non-stretchy operators
3412         https://bugs.webkit.org/show_bug.cgi?id=157519
3413
3414         Reviewed by Brent Fulgham.
3415
3416         To prepare for the removal of anonymous text node from the render classes of token elements
3417         we use MathOperator to handle two cases where the actual text to display may not be
3418         available in the DOM: mfenced and minus operators. This change removes support for the
3419         case of mfenced operators with multiple characters since that it is not supported by
3420         MathOperator. It is a edge case that is not used in practice since fences and separators are
3421         only made of a single character. However, it would still be possible to duplicate some
3422         code/logic to add it back if that turns out to be necessary.
3423
3424         No new tests, already covered by existing tests.
3425
3426         * rendering/mathml/MathOperator.cpp:
3427         (WebCore::MathOperator::MathOperator): Rename UndefinedOperator.
3428         (WebCore::RenderMathMLOperator::firstLineBaseline): Improve rounding of ascent so that mfenced operators are correctly aligned.
3429         * rendering/mathml/MathOperator.h: Rename UndefinedOperator, since it can now be used to draw non-stretchy operators.
3430         (WebCore::MathOperator::isStretched): Deleted. This function is no longer used by RenderMathMLOperator.
3431         (WebCore::MathOperator::unstretch): Deleted. This function is no longer used by RenderMathMLOperator.
3432         * rendering/mathml/RenderMathMLOperator.cpp:
3433         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Use useMathOperator.
3434         (WebCore::RenderMathMLOperator::rebuildTokenContent): Set the MathOperator when useMathOperator() is true.
3435         When the operator is not likely to stretch we just leave its type as NormalOperator.
3436         (WebCore::RenderMathMLOperator::useMathOperator): Helper function to determine when MathOperator should be used.
3437         (WebCore::RenderMathMLOperator::firstLineBaseline): Use useMathOperator.
3438         (WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto.
3439         (WebCore::RenderMathMLOperator::paint): Ditto.
3440         (WebCore::RenderMathMLOperator::paintChildren): Ditto.
3441         * rendering/mathml/RenderMathMLOperator.h: Declare useMathOperator.
3442
3443 2016-06-19  Gavin & Ellie Barraclough  <barraclough@apple.com>
3444
3445         Don't eagerly reify DOM Prototype properties
3446         https://bugs.webkit.org/show_bug.cgi?id=158557
3447
3448         Reviewed by Andreas Kling.
3449
3450         We were eagerly reifying these properties to avoid virtualizing getOwnPropertySlot,
3451         but since bug #158059 this does not require a method table call in any case.
3452         Eagerly reifying these values likely has some CPU and memory cost on page load.
3453
3454         * bindings/scripts/CodeGeneratorJS.pm:
3455         (GenerateImplementation):
3456             - should generate compressed index for hashtable,
3457               prototype object ClassInfo should contain static table,
3458               don't reifyStaticProperties for prototype objects.
3459         (GeneratePrototypeDeclaration):
3460             - Set HasStaticPropertyTable for DOM prototype objects.
3461         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3462         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
3463         (WebCore::JSInterfaceNamePrototype::finishCreation):
3464         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3465         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
3466         (WebCore::JSTestActiveDOMObjectPrototype::finishCreation):
3467         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3468         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype):
3469         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation):
3470         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3471         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
3472         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
3473         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3474         (WebCore::JSTestCustomNamedGetterPrototype::JSTestCustomNamedGetterPrototype):
3475         (WebCore::JSTestCustomNamedGetterPrototype::finishCreation):
3476         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3477         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype):
3478         (WebCore::JSTestEventConstructorPrototype::finishCreation):
3479         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3480         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype):
3481         (WebCore::JSTestEventTargetPrototype::finishCreation):
3482         * bindings/scripts/test/JS/JSTestException.cpp:
3483         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
3484         (WebCore::JSTestExceptionPrototype::finishCreation):
3485         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3486         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype):
3487         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
3488         * bindings/scripts/test/JS/JSTestInterface.cpp:
3489         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
3490         (WebCore::JSTestInterfacePrototype::finishCreation):
3491         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3492         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
3493         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
3494         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3495         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
3496         (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation):
3497         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3498         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype):
3499         (WebCore::JSTestNamedConstructorPrototype::finishCreation):
3500         * bindings/scripts/test/JS/JSTestNode.cpp:
3501         (WebCore::JSTestNodePrototype::JSTestNodePrototype):
3502         (WebCore::JSTestNodePrototype::finishCreation):
3503         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3504         (WebCore::JSTestNondeterministicPrototype::JSTestNondeterministicPrototype):
3505         (WebCore::JSTestNondeterministicPrototype::finishCreation):
3506         * bindings/scripts/test/JS/JSTestObj.cpp:
3507         (WebCore::JSTestObjPrototype::JSTestObjPrototype):
3508         (WebCore::JSTestObjPrototype::finishCreation):
3509         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3510         (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype):
3511         (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation):
3512         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3513         (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype):
3514         (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation):
3515         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3516         (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
3517         (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation):
3518         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3519         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):
3520         (WebCore::JSTestTypedefsPrototype::finishCreation):
3521         * bindings/scripts/test/JS/JSattribute.cpp:
3522         (WebCore::JSattributePrototype::JSattributePrototype):
3523         (WebCore::JSattributePrototype::finishCreation):
3524         * bindings/scripts/test/JS/JSreadonly.cpp:
3525         (WebCore::JSreadonlyPrototype::JSreadonlyPrototype):
3526         (WebCore::JSreadonlyPrototype::finishCreation):
3527
3528 2016-06-20  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3529
3530         WebRTC: RTCIceCandidate init dictionary don't handle explicit null or undefined values correctly
3531         https://bugs.webkit.org/show_bug.cgi?id=158873
3532
3533         Reviewed by Alejandro G. Castro.
3534
3535         Prevent explicit null and undefined values from being converted to "null" and "undefined"
3536         strings.
3537
3538         Test: Extended fast/mediastream/RTCIceCandidate.html
3539
3540         * Modules/mediastream/RTCIceCandidate.cpp:
3541         (WebCore::RTCIceCandidate::create):
3542
3543 2016-06-20  Commit Queue  <commit-queue@webkit.org>
3544
3545         Unreviewed, rolling out r202252.
3546         https://bugs.webkit.org/show_bug.cgi?id=158974
3547
3548         See rdar://problem/26867866 for details (Requested by ap on
3549         #webkit).
3550
3551         Reverted changeset:
3552
3553         "Adopt commitPriority to get rid of the 2 AVPL solution for
3554         PiP"
3555         https://bugs.webkit.org/show_bug.cgi?id=158949
3556         http://trac.webkit.org/changeset/202252
3557
3558 2016-06-20  Commit Queue  <commit-queue@webkit.org>
3559
3560         Unreviewed, rolling out r202243.
3561         https://bugs.webkit.org/show_bug.cgi?id=158972
3562
3563         Broke Windows build and iOS tests (Requested by ap on
3564         #webkit).
3565
3566         Reverted changeset:
3567
3568         "Focus event dispatched in iframe causes parent document to
3569         scroll incorrectly"
3570         https://bugs.webkit.org/show_bug.cgi?id=158629
3571         http://trac.webkit.org/changeset/202243
3572
3573 2016-06-20  Chris Dumez  <cdumez@apple.com>
3574
3575         Simplify / Optimize DataDetector's searchForLinkRemovingExistingDDLinks()
3576         https://bugs.webkit.org/show_bug.cgi?id=158968
3577
3578         Reviewed by Ryosuke Niwa.
3579
3580         Simplify / Optimize DataDetector's searchForLinkRemovingExistingDDLinks():
3581         - Use modern ancestorsOfType<HTMLAnchorElement>() to traverse anchor ancestors
3582           instead of traversing by hand.
3583         - Use NodeTraversal::next() to traverse the tree until we find endNode and
3584           use a for loop instead of a while loop. Previously, the logic the determine
3585           the next node was at the end of the loop and was identical behavior-wise
3586           to NodeTraversal::next(). However, the previous code for a lot less efficient
3587           because it was calling Node::childNodes() to get a NodeList of the children,
3588           then calling length() on it to check if we had children and finally use
3589           the first item in the list as next node. This was very inefficient because
3590           NodeList::length() would need to traverse all children to figure out the
3591           length and would cache all the children in a Vector in CollectionIndexCache.
3592
3593         * dom/ElementAncestorIterator.h:
3594         (WebCore::ancestorsOfType):
3595         * dom/ElementIterator.h:
3596         (WebCore::findElementAncestorOfType):
3597         (WebCore::findElementAncestorOfType<Element>):
3598         Update ancestorsOfType() to take a Node instead of an Element. There are no
3599         performance benefits to taking an Element here and it is a valid use case to
3600         want an Element ancestor of a non-Element node.
3601
3602         * editing/cocoa/DataDetection.mm:
3603         (WebCore::searchForLinkRemovingExistingDDLinks):
3604         (WebCore::dataDetectorTypeForCategory): Deleted.
3605
3606 2016-06-20  Commit Queue  <commit-queue@webkit.org>
3607
3608         Unreviewed, rolling out r202248.
3609         https://bugs.webkit.org/show_bug.cgi?id=158960
3610
3611         breaks builds on the simulator (Requested by keith_mi_ on
3612         #webkit).
3613
3614         Reverted changeset:
3615
3616         "It should be easy to add a private global helper function for
3617         builtins"
3618         https://bugs.webkit.org/show_bug.cgi?id=158893
3619         http://trac.webkit.org/changeset/202248
3620
3621 2016-06-20  Jeremy Jones  <jeremyj@apple.com>
3622
3623         Adopt commitPriority to get rid of the 2 AVPL solution for PiP
3624         https://bugs.webkit.org/show_bug.cgi?id=158949
3625         rdar://problem/26867866
3626
3627         Reviewed by Simon Fraser.
3628
3629         No new tests because there is no behavior change. This reverts changes from 
3630         https://bugs.webkit.org/show_bug.cgi?id=158148 and instead uses -[CAContext commitPriority:]
3631         to prevent flicker when moving a layer between contexts. 
3632         commitPriority allows the layer to be added to the destination context before it is 
3633         removed from the source context.
3634
3635         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: remove m_secondaryVideoLayer.
3636         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: ditto
3637         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity): ditto.
3638         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds): ditto.
3639         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): ditto.
3640         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity): ditto.
3641         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: ditto
3642         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): ditto
3643         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: ditto
3644         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers):ditto
3645         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: ditto
3646         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: ditto
3647         (WebCore::VideoFullscreenLayerManager::setVideoLayer): ditto
3648         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): ditto and adopt commitPriority.
3649         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenFrame): ditto
3650         (WebCore::VideoFullscreenLayerManager::setVideoLayers): Deleted. 
3651         (WebCore::VideoFullscreenLayerManager::didDestroyVideoLayer): remove m_secondaryVideoLayer.
3652         * platform/spi/cocoa/QuartzCoreSPI.h: Add commitPriority.
3653
3654 2016-06-20  Zalan Bujtas  <zalan@apple.com>
3655
3656         Set the end position on the placeholder BidiRun properly.
3657         https://bugs.webkit.org/show_bug.cgi?id=158958
3658
3659         Reviewed by Myles C. Maxfield.
3660         rdar://problem/26609266
3661
3662         The second paramenter for BidiRun indicates the end position and not the length of the run.
3663         This was regressed at r102875 where only the start position was changed from 0 to pos.
3664
3665         Test: fast/text/international/bidi-style-in-isolate-crash.html
3666
3667         * rendering/InlineIterator.h:
3668         (WebCore::addPlaceholderRunForIsolatedInline):
3669
3670 2016-06-20  Fujii Hironori  <Hironori.Fujii@sony.com>
3671
3672         A composition underline is placed to wrong position in RTL
3673         https://bugs.webkit.org/show_bug.cgi?id=158602
3674
3675         Reviewed by Myles C. Maxfield.
3676
3677         InlineTextBox::paintCompositionUnderline does not take RTL into
3678         account.  The position of composition underline should be
3679         mirrored in RTL.
3680
3681         Test: editing/input/composition-underline-rtl.html
3682
3683         * rendering/InlineTextBox.cpp:
3684         (WebCore::mirrorRTLSegment): New helper function to convert RTL start position to LTR.
3685         (WebCore::InlineTextBox::paintDecoration): Use mirrorRTLSegment.
3686         (WebCore::InlineTextBox::paintCompositionUnderline): Ditto.
3687
3688 2016-06-20  Keith Miller  <keith_miller@apple.com>
3689
3690         It should be easy to add a private global helper function for builtins
3691         https://bugs.webkit.org/show_bug.cgi?id=158893
3692
3693         Reviewed by Mark Lam.
3694
3695         Add JSCJSValueInlines.h to fix build issues.
3696
3697         * platform/mock/mediasource/MockBox.cpp:
3698
3699 2016-06-20  Benjamin Poulain  <benjamin@webkit.org>
3700
3701         :default CSS pseudo-class should match checkboxes+radios with a `checked` attribute
3702         https://bugs.webkit.org/show_bug.cgi?id=156230
3703
3704         Reviewed by Alex Christensen.
3705
3706         This patch update the :default pseudo class matching to be closer to the spec:
3707         https://html.spec.whatwg.org/multipage/scripting.html#selector-default
3708
3709         The main remaining difference with the spec is the definition of "default button".
3710         This is an unrelated problem that should be addressed separately.
3711
3712         The implementation was missing support for:
3713         -input elements of type "checkbox" or "radio" with the "checked" attribute defined.
3714         -option elements with the "selected" attribute defined.
3715
3716         The existing support for default button was pretty bad, I fixed that too.
3717         The owner form now has a resetDefaultButton() API. When a Form Associated Element
3718         becomes a submit button or loses that property, the element calls its form
3719         to update the style as needed.
3720
3721         Whenever the submit button changes, 2 elements needs to have their style invalidated:
3722         -The former default button.
3723         -The new default button.
3724         To invalidate the former button, FormElement now caches the computed
3725         default button. When the default button changes, the cached value is invalidated
3726         in addition to the new value.
3727
3728         Computing the new default button takes linear time in the number of form associated element.
3729         To mitigate that, resetDefaultButton() is only called when changes are related
3730         to submit buttons. Since those changes are rare, I don't expect the invalidation
3731         to be a problem.
3732
3733         Tests: fast/css/pseudo-default-basics.html
3734                fast/selectors/default-style-update.html
3735
3736         * css/SelectorChecker.cpp:
3737         (WebCore::SelectorChecker::checkOne):
3738         * css/SelectorCheckerTestFunctions.h:
3739         (WebCore::matchesDefaultPseudoClass):
3740         (WebCore::isDefaultButtonForForm): Deleted.
3741         * cssjit/SelectorCompiler.cpp:
3742         (WebCore::SelectorCompiler::addPseudoClassType):
3743         * dom/Element.cpp:
3744         (WebCore::Element::matchesValidPseudoClass):
3745         (WebCore::Element::matchesInvalidPseudoClass):
3746         (WebCore::Element::matchesDefaultPseudoClass):
3747         * dom/Element.h:
3748         (WebCore::Element::matchesValidPseudoClass): Deleted.
3749         (WebCore::Element::matchesInvalidPseudoClass): Deleted.
3750         (WebCore::Element::isDefaultButtonForForm): Deleted.
3751         * html/HTMLButtonElement.cpp:
3752         (WebCore::HTMLButtonElement::parseAttribute):
3753         (WebCore::HTMLButtonElement::matchesDefaultPseudoClass):
3754         * html/HTMLButtonElement.h:
3755         * html/HTMLFormControlElement.cpp:
3756         (WebCore::HTMLFormControlElement::isDefaultButtonForForm): Deleted.
3757         * html/HTMLFormControlElement.h:
3758         * html/HTMLFormElement.cpp:
3759         (WebCore::HTMLFormElement::~HTMLFormElement):
3760         (WebCore::HTMLFormElement::registerFormElement):
3761         (WebCore::HTMLFormElement::removeFormElement):
3762         (WebCore::HTMLFormElement::defaultButton):
3763         (WebCore::HTMLFormElement::resetDefaultButton):
3764         * html/HTMLFormElement.h:
3765         * html/HTMLInputElement.cpp:
3766         (WebCore::HTMLInputElement::updateType):
3767         (WebCore::HTMLInputElement::parseAttribute):
3768         (WebCore::HTMLInputElement::matchesDefaultPseudoClass):
3769         * html/HTMLInputElement.h:
3770         * html/HTMLOptionElement.cpp:
3771         (WebCore::HTMLOptionElement::matchesDefaultPseudoClass):
3772         (WebCore::HTMLOptionElement::parseAttribute):
3773         * html/HTMLOptionElement.h:
3774         * style/StyleSharingResolver.cpp:
3775         (WebCore::Style::SharingResolver::canShareStyleWithElement):
3776         (WebCore::Style::canShareStyleWithControl): Deleted.
3777
3778 2016-06-20  Simon Fraser  <simon.fraser@apple.com>
3779
3780         Focus event dispatched in iframe causes parent document to scroll incorrectly
3781         https://bugs.webkit.org/show_bug.cgi?id=158629
3782         rdar://problem/26521616
3783
3784         Reviewed by Tim Horton.
3785
3786         When focussing elements in iframes, the page could scroll to an incorrect location.
3787         This happened because code in Element::focus() tried to disable scrolling on focus,
3788         but did so only for the current frame, so ancestor frames got programmatically scrolled.
3789         On iOS we handle the scrolling in the UI process, so never want the web process to
3790         do programmatic scrolling.
3791
3792         Fix by changing the focus and cache restore code to use SelectionRevealMode::DoNotReveal,
3793         rather than manually prohibiting frame scrolling. Pass SelectionRevealMode through various callers,
3794         and use RevealUpToMainFrame for iOS, allowing the UI process to do the zoomToRect: for the main frame.
3795
3796         Tests: fast/forms/ios/focus-input-in-iframe.html
3797                fast/forms/ios/programmatic-focus-input-in-iframe.html
3798
3799         * dom/Document.h:
3800         * dom/Element.cpp:
3801         (WebCore::Element::scrollIntoView):
3802         (WebCore::Element::scrollIntoViewIfNeeded):
3803         (WebCore::Element::scrollIntoViewIfNotVisible):
3804         (WebCore::Element::focus):
3805         (WebCore::Element::updateFocusAppearance):
3806         * dom/Element.h:
3807         * editing/Editor.cpp:
3808         (WebCore::Editor::insertTextWithoutSendingTextEvent):
3809         (WebCore::Editor::revealSelectionAfterEditingOperation):
3810         (WebCore::Editor::findStringAndScrollToVisible):
3811         * editing/FrameSelection.cpp:
3812         (WebCore::FrameSelection::updateAndRevealSelection):
3813         (WebCore::FrameSelection::revealSelection):
3814         (WebCore::FrameSelection::FrameSelection): Deleted.
3815         * editing/FrameSelection.h:
3816         * html/HTMLInputElement.cpp:
3817         (WebCore::HTMLInputElement::updateFocusAppearance):
3818         * html/HTMLTextAreaElement.cpp:
3819         (WebCore::HTMLTextAreaElement::updateFocusAppearance):
3820         * page/ContextMenuController.cpp:
3821         (WebCore::ContextMenuController::contextMenuItemSelected):
3822         * page/FrameView.cpp:
3823         (WebCore::FrameView::scrollToAnchor):
3824         * rendering/RenderLayer.cpp:
3825         (WebCore::RenderLayer::scrollRectToVisible):
3826         (WebCore::RenderLayer::autoscroll):
3827         * rendering/RenderLayer.h:
3828         * rendering/RenderObject.cpp:
3829         (WebCore::RenderObject::scrollRectToVisible):
3830         * rendering/RenderObject.h:
3831
3832 2016-06-20  Keith Rollin  <krollin@apple.com>
3833
3834         Remove RefPtr::release() and change calls sites to use WTFMove()
3835         https://bugs.webkit.org/show_bug.cgi?id=158369
3836
3837         Reviewed by Chris Dumez.
3838
3839         RefPtr::release() releases its managed pointer awkwardly. It's more
3840         direct and clearer to use WTFMove to transfer ownership of the managed
3841         pointer.
3842
3843         As part of this cleanup, also change a lot of explicit data types to
3844         'auto'.
3845
3846         No new tests: there's no new functionality, just a refactoring of
3847         existing code.
3848
3849         * Modules/mediasource/SourceBuffer.cpp:
3850         (WebCore::removeSamplesFromTrackBuffer):
3851         (WebCore::SourceBuffer::provideMediaData):
3852         * Modules/mediastream/UserMediaRequest.cpp:
3853         (WebCore::UserMediaRequest::start):
3854         * Modules/webdatabase/SQLCallbackWrapper.h:
3855         (WebCore::SQLCallbackWrapper::clear):
3856         * bindings/js/JSDOMWindowCustom.cpp:
3857         (WebCore::handlePostMessage):
3858         * bindings/js/JSHistoryCustom.cpp:
3859         (WebCore::JSHistory::pushState):
3860         (WebCore::JSHistory::replaceState):
3861         * bindings/js/JSMessagePortCustom.h:
3862         (WebCore::handlePostMessage):
3863         * bindings/js/ScriptControllerMac.mm:
3864         (WebCore::ScriptController::createScriptInstanceForWidget):
3865         * bindings/js/SerializedScriptValue.cpp:
3866         (WebCore::CloneDeserializer::readTerminal):
3867         * css/CSSComputedStyleDeclaration.cpp:
3868         (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
3869         * css/SVGCSSParser.cpp:
3870         (WebCore::CSSParser::parseSVGValue):
3871         * css/StyleBuilderConverter.h:
3872         (WebCore::StyleBuilderConverter::convertShapeValue):
3873         * css/StyleProperties.cpp:
3874         (WebCore::StyleProperties::copyPropertiesInSet):
3875         * css/StyleResolver.cpp:
3876         (WebCore::StyleResolver::loadPendingImages):
3877         * dom/InlineStyleSheetOwner.cpp:
3878         (WebCore::InlineStyleSheetOwner::clearSheet):
3879         * editing/ApplyStyleCommand.cpp:
3880         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
3881         * editing/CompositeEditCommand.cpp:
3882         (WebCore::CompositeEditCommand::removeChildrenInRange):
3883         (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors):
3884         (WebCore::CompositeEditCommand::prune):
3885         (WebCore::CompositeEditCommand::replaceSelectedTextInNode):
3886         (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
3887         * editing/CreateLinkCommand.cpp:
3888         (WebCore::CreateLinkCommand::doApply):
3889         * editing/EditingStyle.cpp:
3890         (WebCore::EditingStyle::mergeStyle):
3891         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
3892         * editing/Editor.cpp:
3893         (WebCore::ClearTextCommand::CreateAndApply):
3894         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
3895         * editing/EditorCommand.cpp:
3896         (WebCore::executeInsertNode):
3897         * editing/InsertTextCommand.cpp:
3898         (WebCore::InsertTextCommand::performOverwrite):
3899         (WebCore::InsertTextCommand::insertTab):
3900         * editing/RemoveNodePreservingChildrenCommand.cpp:
3901         (WebCore::RemoveNodePreservingChildrenCommand::doApply):
3902         * editing/ReplaceSelectionCommand.cpp:
3903         (WebCore::ReplacementFragment::removeNodePreservingChildren):
3904         (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
3905         * html/FTPDirectoryDocument.cpp:
3906         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
3907         * html/HTMLFontElement.cpp:
3908         (WebCore::HTMLFontElement::collectStyleForPresentationAttribute):
3909         * html/HTMLFormElement.cpp:
3910         (WebCore::HTMLFormElement::prepareForSubmission):
3911         * html/HTMLTableElement.cpp:
3912         (WebCore::leakBorderStyle):
3913         (WebCore::leakGroupBorderStyle):
3914         * html/parser/HTMLDocumentParser.cpp:
3915         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
3916         * html/track/InbandDataTextTrack.cpp:
3917         (WebCore::InbandDataTextTrack::addDataCue):
3918         * html/track/InbandGenericTextTrack.cpp:
3919         (WebCore::InbandGenericTextTrack::newCuesParsed):
3920         * html/track/InbandWebVTTTextTrack.cpp:
3921         (WebCore::InbandWebVTTTextTrack::newCuesParsed):
3922         * html/track/TextTrackCueList.cpp:
3923         (WebCore::TextTrackCueList::add):
3924         * inspector/InspectorCSSAgent.cpp:
3925         (WebCore::InspectorCSSAgent::getInlineStylesForNode):
3926         * inspector/InspectorDOMAgent.cpp:
3927         (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
3928         * inspector/InspectorIndexedDBAgent.cpp:
3929         * inspector/InspectorNetworkAgent.cpp:
3930         (WebCore::InspectorNetworkAgent::loadResource):
3931         * inspector/InspectorStyleSheet.cpp:
3932         (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
3933         * loader/FormSubmission.cpp:
3934         (WebCore::FormSubmission::create):
3935         * loader/FrameLoader.cpp:
3936         (WebCore::FrameLoader::loadURLIntoChildFrame):
3937         (WebCore::FrameLoader::loadURL):
3938         (WebCore::FrameLoader::loadPostRequest):
3939         * loader/ProgressTracker.cpp:
3940         (WebCore::ProgressTracker::finalProgressComplete):
3941         * loader/appcache/ApplicationCacheGroup.cpp:
3942         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader):
3943         (WebCore::ApplicationCacheGroup::didFinishLoading):
3944         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
3945         * loader/appcache/ApplicationCacheStorage.cpp:
3946         (WebCore::ApplicationCacheStorage::loadCacheGroup):
3947         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
3948         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
3949         (WebCore::ApplicationCacheStorage::loadCache):
3950         * loader/archive/ArchiveResourceCollection.cpp:
3951         (WebCore::ArchiveResourceCollection::popSubframeArchive):
3952         * loader/archive/cf/LegacyWebArchive.cpp:
3953         (WebCore::LegacyWebArchive::extract):
3954         (WebCore::LegacyWebArchive::create):
3955         (WebCore::LegacyWebArchive::createFromSelection):
3956         * loader/cache/CachedImage.cpp:
3957         (WebCore::CachedImage::createImage):
3958         * loader/icon/IconDatabase.cpp:
3959         (WebCore::IconDatabase::setIconDataForIconURL):
3960         (WebCore::IconDatabase::getOrCreateIconRecord):
3961         (WebCore::IconDatabase::readFromDatabase):
3962         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
3963         * page/DOMWindow.cpp:
3964         (WebCore::DOMWindow::sessionStorage):
3965         (WebCore::DOMWindow::localStorage):
3966         * page/EventHandler.cpp:
3967         (WebCore::EventHandler::updateDragAndDrop):
3968         * page/animation/CompositeAnimation.cpp:
3969         (WebCore::CompositeAnimation::updateTransitions):
3970         * page/csp/ContentSecurityPolicy.cpp:
3971         (WebCore::ContentSecurityPolicy::reportViolation):
3972         * page/mac/ServicesOverlayController.mm:
3973         (WebCore::ServicesOverlayController::createOverlayIfNeeded):
3974         (WebCore::ServicesOverlayController::determineActiveHighlight):
3975         * page/scrolling/AsyncScrollingCoordinator.h:
3976         (WebCore::AsyncScrollingCoordinator::releaseScrollingTree):
3977         * page/scrolling/ScrollingStateNode.cpp:
3978         (WebCore::ScrollingStateNode::cloneAndReset):
3979         * page/scrolling/ScrollingStateTree.cpp:
3980         (WebCore::ScrollingStateTree::attachNode):
3981         * platform/audio/HRTFElevation.cpp:
3982         (WebCore::getConcatenatedImpulseResponsesForSubject):
3983         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3984         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
3985         * platform/graphics/FontCascadeFonts.cpp:
3986         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
3987         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3988         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
3989         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3990         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
3991         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3992         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
3993         * platform/graphics/ca/GraphicsLayerCA.cpp:
3994         * platform/graphics/ca/PlatformCALayer.cpp:
3995         (WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool):
3996         * platform/graphics/cg/ImageBufferDataCG.cpp:
3997         (WebCore::ImageBufferData::getData):
3998         * platform/graphics/filters/FilterEffect.cpp:
3999         (WebCore::FilterEffect::asUnmultipliedImage):
4000         (WebCore::FilterEffect::asPremultipliedImage):
4001         * platform/graphics/mac/ImageMac.mm:
4002         (WebCore::Image::loadPlatformResource):
4003         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
4004         (WebCore::GraphicsContext3D::createForCurrentGLContext):
4005         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
4006         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
4007         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
4008         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
4009         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
4010         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
4011         * platform/network/BlobRegistryImpl.cpp: