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