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