b9a5d28e772dccac9bc2bcd0a4d8293daf45f2b4
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-21  Simon Fraser  <simon.fraser@apple.com>
2
3         [iOS WK2] Use larger tiles when possible to reduce per-tile painting overhead
4         https://bugs.webkit.org/show_bug.cgi?id=155734
5         rdar://problem/24968144
6
7         Reviewed by Tim Horton.
8
9         The existing tile size logic is wired to adjustScrollbars, which doesn't fire
10         when scrolling is delegated. For iOS WK2, key off of a new unobscuredContentSizeChanged()
11         function that runs when the UI process tells told WebCore that the unobscured size
12         has changed. In addition, contentsResized() is used to update scrollability when
13         page changes size.
14
15         * page/FrameView.cpp:
16         (WebCore::FrameView::contentsResized):
17         (WebCore::FrameView::addedOrRemovedScrollbar):
18         (WebCore::FrameView::adjustTiledBackingScrollability): Handle both delegated and non-delegated
19         scrolling; the former looks at the visible size (based on the unobscuredVisibleContentRect),
20         the latter at the presence of scrollbars.
21         (WebCore::FrameView::unobscuredContentSizeChanged):
22         * page/FrameView.h:
23         * platform/ScrollView.h:
24         (WebCore::ScrollView::unobscuredContentSizeChanged):
25         * platform/graphics/ca/TileController.cpp:
26         (WebCore::TileController::adjustTileCoverageRect): Use kDefaultTileSize rather than the
27         tile size, to retain the old amount of overdraw.
28         (WebCore::TileController::tileSize): There was a bug in the not-scrollable case; we need
29         to scale.
30         * platform/ios/ScrollViewIOS.mm:
31         (WebCore::ScrollView::setUnobscuredContentSize):
32
33 2016-03-21  Chris Dumez  <cdumez@apple.com>
34
35         Unreviewed, rolling out r197552.
36
37         May have caused a ~2% PLT regression on iOS
38
39         Reverted changeset:
40
41         "Drop DocumentSharedObjectPool immediately when going into
42         PageCache."
43         https://bugs.webkit.org/show_bug.cgi?id=154986
44         http://trac.webkit.org/changeset/197552
45
46 2016-03-21  Simon Fraser  <simon.fraser@apple.com>
47
48         Very flashy scrolling on http://quellish.tumblr.com page
49         https://bugs.webkit.org/show_bug.cgi?id=155728
50         rdar://problem/22299375
51
52         Reviewed by Zalan Bujtas.
53
54         http://quellish.tumblr.com/post/126712999812/how-on-earth-the-facebook-ios-application-is-so
55         has many elements that are nested inside elements with non-equal corner radius clipping.
56         This requires building bezier paths for the rounded-rect clip which is expensive.
57
58         For many rows of the table, we can avoid the rounded-rect clipping because the intersection
59         of the paintDirtyRect and the clip is actually rectangular.
60
61         * platform/graphics/FloatRoundedRect.cpp:
62         (WebCore::FloatRoundedRect::intersectionIsRectangular):
63         * platform/graphics/FloatRoundedRect.h:
64         * rendering/RenderLayer.cpp:
65         (WebCore::RenderLayer::clipToRect):
66
67 2016-03-21  Zalan Bujtas  <zalan@apple.com>
68
69         Web Inspector search icon does not fit when zoomed in.
70         https://bugs.webkit.org/show_bug.cgi?id=155708
71
72         Reviewed by Simon Fraser.
73
74         Adjusts the paint rect for the magnifier icon so that it fits even when zoomed in.
75
76         Covered by existing tests.
77
78         * rendering/RenderThemeMac.mm:
79         (WebCore::RenderThemeMac::resultsButtonSizes):
80         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
81
82 2016-03-21  Per Arne Vollan  <peavo@outlook.com>
83
84         [WinCairo][MediaFoundation] Crash when media player is destroyed.
85         https://bugs.webkit.org/show_bug.cgi?id=155716
86
87         Reviewed by Alex Christensen.
88
89         Increase the reference count on the video presenter object in the ActivateObject method
90         to avoid referencing a deleted object when the media player is destroyed.
91
92         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
93         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ActivateObject):
94
95 2016-03-21  Eric Carlson  <eric.carlson@apple.com>
96
97         Add a WebRTC specific compile flag
98         https://bugs.webkit.org/show_bug.cgi?id=155663
99
100         Guard WebRTC-only files with ENABLE(WEB_RTC) rather than ENABLE(MEDIA_STREAM).
101
102         Reviewed by Jer Noble.
103
104         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
105         * Modules/mediastream/MediaEndpointPeerConnection.h:
106         * Modules/mediastream/PeerConnectionBackend.h:
107         * Modules/mediastream/PeerConnectionStates.h:
108         * Modules/mediastream/RTCConfiguration.cpp:
109         * Modules/mediastream/RTCConfiguration.h:
110         * Modules/mediastream/RTCConfiguration.idl:
111         * Modules/mediastream/RTCDTMFSender.cpp:
112         * Modules/mediastream/RTCDTMFSender.h:
113         * Modules/mediastream/RTCDTMFSender.idl:
114         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
115         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
116         * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
117         * Modules/mediastream/RTCDataChannel.cpp:
118         * Modules/mediastream/RTCDataChannel.h:
119         * Modules/mediastream/RTCDataChannel.idl:
120         * Modules/mediastream/RTCDataChannelEvent.cpp:
121         * Modules/mediastream/RTCDataChannelEvent.h:
122         * Modules/mediastream/RTCDataChannelEvent.idl:
123         * Modules/mediastream/RTCIceCandidate.cpp:
124         * Modules/mediastream/RTCIceCandidate.h:
125         * Modules/mediastream/RTCIceCandidate.idl:
126         * Modules/mediastream/RTCIceCandidateEvent.cpp:
127         * Modules/mediastream/RTCIceCandidateEvent.h:
128         * Modules/mediastream/RTCIceCandidateEvent.idl:
129         * Modules/mediastream/RTCIceServer.h:
130         * Modules/mediastream/RTCIceServer.idl:
131         * Modules/mediastream/RTCOfferAnswerOptions.cpp:
132         * Modules/mediastream/RTCOfferAnswerOptions.h:
133         * Modules/mediastream/RTCPeerConnection.cpp:
134         * Modules/mediastream/RTCPeerConnection.h:
135         * Modules/mediastream/RTCPeerConnection.idl:
136         * Modules/mediastream/RTCPeerConnection.js:
137         (createOffer):
138         * Modules/mediastream/RTCPeerConnectionInternals.js:
139         * Modules/mediastream/RTCRtpReceiver.cpp:
140         * Modules/mediastream/RTCRtpReceiver.h:
141         * Modules/mediastream/RTCRtpReceiver.idl:
142         * Modules/mediastream/RTCRtpSender.cpp:
143         * Modules/mediastream/RTCRtpSender.h:
144         * Modules/mediastream/RTCRtpSender.idl:
145         * Modules/mediastream/RTCRtpSenderReceiverBase.h:
146         * Modules/mediastream/RTCSessionDescription.cpp:
147         * Modules/mediastream/RTCSessionDescription.h:
148         * Modules/mediastream/RTCSessionDescription.idl:
149         * Modules/mediastream/RTCStatsReport.cpp:
150         * Modules/mediastream/RTCStatsReport.idl:
151         * Modules/mediastream/RTCStatsResponse.cpp:
152         * Modules/mediastream/RTCStatsResponse.idl:
153         * Modules/mediastream/RTCTrackEvent.cpp:
154         * Modules/mediastream/RTCTrackEvent.h:
155         * Modules/mediastream/RTCTrackEvent.idl:
156         * Modules/mediastream/SDPProcessor.cpp:
157         * Modules/mediastream/SDPProcessor.h:
158         * bindings/generic/RuntimeEnabledFeatures.cpp:
159         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
160         * bindings/generic/RuntimeEnabledFeatures.h:
161         (WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled):
162         (WebCore::RuntimeEnabledFeatures::webkitGetUserMediaEnabled):
163         (WebCore::RuntimeEnabledFeatures::webkitMediaStreamEnabled):
164         (WebCore::RuntimeEnabledFeatures::peerConnectionEnabled):
165         (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
166         (WebCore::RuntimeEnabledFeatures::webkitRTCPeerConnectionEnabled):
167         * bindings/js/JSDOMGlobalObject.cpp:
168         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
169         * bindings/js/JSDictionary.cpp:
170         (WebCore::JSDictionary::convertValue):
171         * bindings/js/JSDictionary.h:
172         * bindings/js/JSRTCIceCandidateCustom.cpp:
173         * bindings/js/JSRTCPeerConnectionCustom.cpp:
174         * bindings/js/JSRTCSessionDescriptionCustom.cpp:
175         * bindings/js/JSRTCStatsResponseCustom.cpp:
176         * bindings/js/WebCoreJSBuiltinInternals.cpp:
177         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
178         (WebCore::JSBuiltinInternalFunctions::visit):
179         (WebCore::JSBuiltinInternalFunctions::initialize):
180         * bindings/js/WebCoreJSBuiltinInternals.h:
181         (WebCore::JSBuiltinInternalFunctions::rtcPeerConnectionInternals):
182         * bindings/js/WebCoreJSBuiltins.h:
183         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
184         (WebCore::JSBuiltinFunctions::mediaDevicesBuiltins):
185         (WebCore::JSBuiltinFunctions::navigatorUserMediaBuiltins):
186         (WebCore::JSBuiltinFunctions::rtcPeerConnectionBuiltins):
187         (WebCore::JSBuiltinFunctions::rtcPeerConnectionInternalsBuiltins):
188         * dom/EventNames.in:
189         * dom/EventTargetFactory.in:
190         * loader/FrameLoaderClient.h:
191         * platform/mediastream/IceCandidate.h:
192         * platform/mediastream/MediaEndpoint.cpp:
193         * platform/mediastream/MediaEndpoint.h:
194         * platform/mediastream/MediaEndpointConfiguration.cpp:
195         * platform/mediastream/MediaEndpointConfiguration.h:
196         * platform/mediastream/MediaEndpointSessionConfiguration.h:
197         * platform/mediastream/MediaPayload.h:
198         * platform/mediastream/PeerMediaDescription.h:
199         * platform/mediastream/RTCConfigurationPrivate.h:
200         * platform/mediastream/RTCDTMFSenderHandler.h:
201         * platform/mediastream/RTCDTMFSenderHandlerClient.h:
202         * platform/mediastream/RTCDataChannelHandler.h:
203         * platform/mediastream/RTCDataChannelHandlerClient.h:
204         * platform/mediastream/RTCIceCandidateDescriptor.cpp:
205         * platform/mediastream/RTCIceCandidateDescriptor.h:
206         * platform/mediastream/RTCIceServerPrivate.h:
207         * platform/mediastream/RTCPeerConnectionHandler.cpp:
208         * platform/mediastream/RTCPeerConnectionHandler.h:
209         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
210         * platform/mediastream/RTCSessionDescriptionDescriptor.cpp:
211         * platform/mediastream/RTCSessionDescriptionDescriptor.h:
212         * platform/mediastream/RTCSessionDescriptionRequest.h:
213         * platform/mediastream/RTCStatsRequest.h:
214         * platform/mediastream/RTCStatsResponseBase.h:
215         * platform/mediastream/RTCVoidRequest.h:
216         * platform/mediastream/SDPProcessorScriptResource.cpp:
217         * platform/mediastream/SDPProcessorScriptResource.h:
218         * platform/mock/MockMediaEndpoint.cpp:
219         * platform/mock/MockMediaEndpoint.h:
220         * platform/mock/RTCDTMFSenderHandlerMock.cpp:
221         * platform/mock/RTCDTMFSenderHandlerMock.h:
222         * platform/mock/RTCDataChannelHandlerMock.cpp:
223         * platform/mock/RTCDataChannelHandlerMock.h:
224         * platform/mock/RTCNotifiersMock.cpp:
225         * platform/mock/RTCNotifiersMock.h:
226         * platform/mock/RTCPeerConnectionHandlerMock.cpp:
227         * platform/mock/RTCPeerConnectionHandlerMock.h:
228         * platform/mock/TimerEventBasedMock.h:
229         (WebCore::RenderLayerBacking::paintIntoLayer):
230         * testing/Internals.cpp:
231         (WebCore::Internals::Internals):
232         (WebCore::Internals::enableMockSpeechSynthesizer):
233         (WebCore::Internals::enableMockMediaEndpoint):
234         (WebCore::Internals::enableMockRTCPeerConnectionHandler):
235         (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
236         * testing/Internals.h:
237
238 2016-03-21  Joonghun Park  <jh718.park@samsung.com>
239
240         [JSC] Add ArrayBuffer::tryCreate and change the callsites where it is needed
241         https://bugs.webkit.org/show_bug.cgi?id=155328
242
243         Reviewed by Darin Adler.
244
245         No new tests, no new behaviours.
246
247         * Modules/fetch/FetchBody.cpp:
248         (WebCore::FetchBody::processIfEmptyOrDisturbed):
249         (WebCore::FetchBody::consumeText):
250         * Modules/fetch/FetchLoader.cpp:
251         (WebCore::FetchLoader::didFinishLoading):
252         * bindings/js/JSDOMPromise.h:
253         (WebCore::char>>):
254         * dom/MessageEvent.cpp:
255         (WebCore::MessageEvent::MessageEvent):
256         * dom/MessageEvent.h:
257         * fileapi/FileReaderLoader.cpp:
258         (WebCore::FileReaderLoader::didReceiveResponse):
259         (WebCore::FileReaderLoader::didReceiveData):
260         (WebCore::FileReaderLoader::arrayBufferResult):
261         * html/canvas/WebGLBuffer.cpp:
262         (WebCore::WebGLBuffer::associateBufferDataImpl):
263         * html/track/DataCue.cpp:
264         (WebCore::DataCue::DataCue):
265         (WebCore::DataCue::data):
266         (WebCore::DataCue::setData):
267         (WebCore::DataCue::cueContentsMatch):
268         * html/track/DataCue.h:
269         * html/track/InbandDataTextTrack.cpp:
270         (WebCore::InbandDataTextTrack::addDataCue):
271         (WebCore::InbandDataTextTrack::removeCue):
272         * platform/mac/SerializedPlatformRepresentationMac.mm:
273         (WebCore::jsValueWithDataInContext):
274
275 2016-02-03  Sergio Villar Senin  <svillar@igalia.com>
276
277         [css-grid] Fix percentage tracks' size computation in grids with gutters
278         https://bugs.webkit.org/show_bug.cgi?id=153825
279
280         Reviewed by Darin Adler.
281
282         The track sizing algorithm is passed an available size
283         (freeSpace in the code) where to size the tracks. The total size of the grid
284         gutters was pre-removed from that available size because we cannot use it to size
285         the tracks. However that available size is also used to compute the size of
286         percentage tracks. As we're removing the size of the gutters, the base size for
287         percentage computations is smaller than it should be.
288
289         * rendering/RenderGrid.cpp:
290         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
291
292 2016-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
293
294         [GTK] scrollbar thumb clipped in 2.11.92
295         https://bugs.webkit.org/show_bug.cgi?id=155586
296
297         Reviewed by Michael Catanzaro.
298
299         In the current version of Adwaita, the scrollbar itself also has a
300         one pixel border that we are not taking into account.
301
302         * platform/gtk/ScrollbarThemeGtk.cpp:
303         (WebCore::ScrollbarThemeGtk::paintThumb): Use the scrollbar size
304         in indicator mode, instead of only the thumb size, to correctly
305         position the thumb in indicator mode.
306
307 2016-03-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
308
309         Reduce uses of PassRefPtr in WebCore/dom - 6
310         https://bugs.webkit.org/show_bug.cgi?id=155579
311
312         Reviewed by Darin Adler.
313
314         * dom/MessagePortChannel.h:
315         * dom/default/PlatformMessagePortChannel.cpp:
316         (WebCore::PlatformMessagePortChannel::EventData::EventData):
317         (WebCore::MessagePortChannel::createChannel):
318         (WebCore::MessagePortChannel::MessagePortChannel):
319         (WebCore::MessagePortChannel::postMessageToRemote):
320         (WebCore::PlatformMessagePortChannel::create):
321         (WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel):
322         * dom/default/PlatformMessagePortChannel.h:
323         (WebCore::PlatformMessagePortChannel::EventData::message):
324
325 2016-03-20  Jinwoo Jeong  <jw00.jeong@samsung.com>
326
327         The setter of binaryType attribute in WebSocket should raise the exception.
328         https://bugs.webkit.org/show_bug.cgi?id=135874
329
330         Reviewed by Antonio Gomes.
331
332         According to W3C WebSocket Specification, <https://www.w3.org/TR/2012/CR-websockets-20120920/>
333         when an invalid value is set on binaryType of WebSocket, a SyntaxError should be raised.
334
335         * Modules/websockets/WebSocket.cpp:
336         (WebCore::WebSocket::setBinaryType): Add a parameter to set an exception.
337         * Modules/websockets/WebSocket.h: Ditto.
338         * Modules/websockets/WebSocket.idl: Update that setter of binaryType could raise an exception.
339
340 2016-03-20  Dan Bernstein  <mitz@apple.com>
341
342         [Mac] Determine TARGET_MAC_OS_X_VERSION_MAJOR from MACOSX_DEPLOYMENT_TARGET rather than from MAC_OS_X_VERSION_MAJOR
343         https://bugs.webkit.org/show_bug.cgi?id=155707
344         <rdar://problem/24980691>
345
346         Reviewed by Darin Adler.
347
348         * Configurations/Base.xcconfig: Set TARGET_MAC_OS_X_VERSION_MAJOR based on the last
349           component of MACOSX_DEPLOYMENT_TARGET.
350         * Configurations/DebugRelease.xcconfig: For engineering builds, preserve the behavior of
351           TARGET_MAC_OS_X_VERSION_MAJOR being the host’s OS version.
352
353 2016-03-20  Konstantin Tokarev  <annulen@yandex.ru>
354
355         Added implementations of AXObjectCache methods for !HAVE(ACCESSIBILITY).
356         https://bugs.webkit.org/show_bug.cgi?id=155697
357
358         Reviewed by Darin Adler.
359
360         No new tests needed.
361
362         * accessibility/AXObjectCache.h:
363         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
364         (WebCore::AXObjectCache::absoluteCaretBoundsForCharacterOffset):
365         (WebCore::AXObjectCache::characterOffsetForIndex):
366         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
367         (WebCore::AXObjectCache::endCharacterOffsetOfLine):
368         (WebCore::AXObjectCache::nextCharacterOffset):
369         (WebCore::AXObjectCache::previousCharacterOffset):
370
371 2016-03-20  Darin Adler  <darin@apple.com>
372
373         Disable Caches in Safari's Develop menu does not disable caches.
374         https://bugs.webkit.org/show_bug.cgi?id=64483
375
376         Reviewed by Antti Koivisto.
377
378         Moved feature from Settings to Page.
379
380         * history/PageCache.cpp:
381         (WebCore::canCachePage): Use function on Page instead of Settings.
382         (WebCore::PageCache::take): Ditto.
383         (WebCore::PageCache::get): Ditto.
384         * loader/FrameLoader.cpp:
385         (WebCore::FrameLoader::subresourceCachePolicy): Ditto.
386         (WebCore::FrameLoader::addExtraFieldsToRequest): Ditto.
387         * loader/cache/CachedResourceLoader.cpp:
388         (WebCore::CachedResourceLoader::cachePolicy): Ditto.
389
390         * page/Page.h:
391         (WebCore::Page::isResourceCachingDisabled): Added.
392         (WebCore::Page::setResourceCachingDisabled): Added.
393
394         * page/Settings.in: Removed resourceCachingDisabled.
395
396 2016-03-20  Dan Bernstein  <mitz@apple.com>
397
398         Update build settings
399
400         Rubber-stamped by Andy Estes.
401
402         * Configurations/DebugRelease.xcconfig:
403         * Configurations/FeatureDefines.xcconfig:
404         * Configurations/Version.xcconfig:
405
406 2016-03-20  Chris Fleizach  <cfleizach@apple.com>
407
408         AX: Radio button members are not identified together in all cases
409         https://bugs.webkit.org/show_bug.cgi?id=155604
410         <rdar://problem/21186992>
411
412         Reviewed by Darin Adler.
413
414         Allow aria radio buttons to be grouped together as linked ui elements even if they're not input types of radio button.
415
416         Modified test: accessibility/radio-button-group-members.html
417
418         * accessibility/AccessibilityRenderObject.cpp:
419         (WebCore::AccessibilityRenderObject::speakProperty):
420         (WebCore::AccessibilityRenderObject::addRadioButtonGroupChildren):
421         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
422         * accessibility/AccessibilityRenderObject.h:
423
424 2016-03-19  Joonghun Park  <jh718.park@samsung.com>
425
426         Purge PassRefPtr from WebCore/html/shadow
427         https://bugs.webkit.org/show_bug.cgi?id=155681
428
429         Reviewed by Darin Adler.
430
431         No new tests, no new behaviours.
432
433         * html/HTMLImageElement.cpp:
434         (WebCore::HTMLImageElement::updateImageControls):
435         (WebCore::HTMLImageElement::tryCreateImageControls):
436         (WebCore::HTMLImageElement::createImageControls): Deleted.
437         * html/HTMLImageElement.h:
438         * html/shadow/ImageControlsRootElement.h:
439         * html/shadow/MediaControls.h:
440         * html/shadow/MediaControlsApple.cpp:
441         (WebCore::MediaControls::tryCreate):
442         (WebCore::MediaControlsApple::tryCreateControls):
443         (WebCore::MediaControlsApple::showClosedCaptionTrackList):
444         (WebCore::MediaControlsApple::hideClosedCaptionTrackList):
445         (WebCore::MediaControlsApple::eventListener):
446         (WebCore::MediaControls::create): Deleted.
447         (WebCore::MediaControlsApple::createControls): Deleted.
448         * html/shadow/MediaControlsApple.h:
449         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
450         (WebCore::ImageControlsButtonElementMac::tryCreate):
451         (WebCore::ImageControlsButtonElementMac::maybeCreate): Deleted.
452         * html/shadow/mac/ImageControlsButtonElementMac.h:
453         * html/shadow/mac/ImageControlsRootElementMac.cpp:
454         (WebCore::ImageControlsRootElement::tryCreate):
455         (WebCore::ImageControlsRootElement::maybeCreate): Deleted.
456
457 2016-03-19  Antti Koivisto  <antti@apple.com>
458
459         Data URL DecodeTask may get deleted outside main thread
460         https://bugs.webkit.org/show_bug.cgi?id=155584
461         rdar://problem/24492104
462
463         Reviewed by David Kilzer.
464
465         Follow-up: fix a possible null pointer crash.
466
467         * platform/network/DataURLDecoder.cpp:
468         (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer):
469
470             If timer fires under startOneShot m_decodeTask may become zero before schedule() is called.
471             Fix by copying schedule context to a local before calling startOneShot.
472
473 2016-03-18  Zhuo Li  <zachli@apple.com>
474
475         Update AutoFill button in input fields.
476         https://bugs.webkit.org/show_bug.cgi?id=155619.
477         rdar://problem/24486939.
478
479         Reviewed by Daniel Bates.
480
481         * css/html.css:
482         (input::-webkit-contacts-auto-fill-button):
483         Use the new AutoFill button.
484
485 2016-03-18  Alex Christensen  <achristensen@webkit.org>
486
487         Give NSURLSessionConfiguration information about parent process
488         https://bugs.webkit.org/show_bug.cgi?id=155661
489
490         Reviewed by Anders Carlsson.
491
492         * platform/spi/cf/CFNetworkSPI.h:
493         Add newly-used SPI declarations.
494
495 2016-03-18  Simon Fraser  <simon.fraser@apple.com>
496
497         Sideways-scrollable RTL document has wrong initial and reload offset in WKWebView
498         https://bugs.webkit.org/show_bug.cgi?id=155660
499         rdar://problem/22212662
500
501         Reviewed by Tim Horton.
502         
503         There were two problems with the scroll position of RTL documents on initial and reload
504         in WKWebView.
505
506         First, in the delegatesScrolling() code path, ScrollView::updateScrollbars() needs to
507         tell someone that the scroll origin changed, to trigger a scroll to the page origin.
508
509         Secondly, WKWebView had scrollPosition/scrollOffset confusion in various places.
510
511         Test: fast/scrolling/rtl-initial-scroll-position.html
512
513         * platform/ScrollView.cpp:
514         (WebCore::ScrollView::updateScrollbars):
515
516 2016-03-18  Ryan Haddad  <ryanhaddad@apple.com>
517
518         Unreviewed, rolling out r198443.
519
520         This change caused API test failures on El Capitan
521
522         Reverted changeset:
523
524         "CRASH in WebCore::MediaResourceLoader::requestResource + 698"
525         https://bugs.webkit.org/show_bug.cgi?id=155651
526         http://trac.webkit.org/changeset/198443
527
528 2016-03-18  Darin Adler  <darin@apple.com>
529
530         ASSERTION FAILED: m_isValid == valid() in WebCore::HTMLFormControlElement::isValidFormControlElement
531         https://bugs.webkit.org/show_bug.cgi?id=139481
532
533         Reviewed by Daniel Bates.
534
535         Test: fast/forms/validity-assertion-inserting-into-datalist.html
536
537         * html/HTMLFormControlElement.cpp:
538         (WebCore::HTMLFormControlElement::insertedInto): Set the flags that will cause
539         "will validate" to be recomputed *before* calling willValidate().
540
541 2016-03-18  Chris Dumez  <cdumez@apple.com>
542
543         Speculative revalidation requests do not have their HTTP user-agent set
544         https://bugs.webkit.org/show_bug.cgi?id=155620
545         <rdar://problem/24657567>
546
547         Reviewed by Brady Eidson.
548
549         Export a couple of symbols so they can be used from WebKit2.
550
551         Test: http/tests/cache/disk-cache/speculative-validation/validation-request.html
552
553         * platform/network/ResourceRequestBase.h:
554
555 2016-03-18  Zhuo Li  <zachli@apple.com>
556
557         Need to forward declare NSScrollerImpSPI::scrollerLayoutDirection.
558         https://bugs.webkit.org/show_bug.cgi?id=155662.
559
560         Reviewed by Myles C. Maxfield.
561
562         * platform/spi/mac/NSScrollerImpSPI.h:
563         Forward declare NSScrollerImpSPI::scrollerLayoutDirection.
564
565 2016-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
566
567         [OS X] Scrollbars are sometimes erroneously reported as overlay
568         https://bugs.webkit.org/show_bug.cgi?id=155630
569
570         Reviewed by Darin Adler.
571
572         When AppKit boots up, if the system preference is set to determine at runtime whether
573         scrollbars should be overlay or always-on, AppKit must do some processing to determine
574         this scrollbar state. We listen for the results by using NSScrollerImpPairDelegate's
575         scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle: method.
576
577         However, our NSScrollerImpPairDelegates are owned by the FrameView, and when loading
578         a page, there is a short amount of time when no FrameViews are alive. This means that
579         there is a point in time when we don't have any NSScrollerImpPairs alive. Unfortunately,
580         the processesing that AppKit does to determine the scrollbar state is done
581         asynchronously, and the results may be reported within this short window. In this case,
582         we don't receive the notification that the scrollbar should be non-overlay, and our
583         internal state (gUsesOverlayScrollbars in ScrollbarThemeMac) becomes stale.
584
585         The solution is to simply always check what the scrollbar state is upon creation of a
586         NSScrollerImpPair. That way, as soon as the second FrameView is created, the scrollbar
587         state will be correctly updated immediately.
588
589         An alternative, similar, approach would be for ScrollbarThemeMac to listen to the
590         NSPreferredScrollerStyleDidChangeNotification. This patch doesn't use this approach
591         in order to align with the current division of responsibilities between ScrollAnimator
592         and ScrollbarTheme.
593
594         Covered by existing (RTL Scrollbar) tests.
595
596         * platform/mac/ScrollAnimatorMac.mm:
597         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
598
599 2016-03-18  Jer Noble  <jer.noble@apple.com>
600
601         CRASH in WebCore::MediaResourceLoader::requestResource + 698
602         https://bugs.webkit.org/show_bug.cgi?id=155651
603         <rdar://problem/25130582>
604
605         Reviewed by Eric Carlson.
606
607         No new tests, fixes existing tests running under GuardMalloc.
608
609         Protect against the Document passed into MediaResourceLoader being destroyed during the MediaResourceLoader's lifetime.
610
611         * loader/MediaResourceLoader.cpp:
612         (WebCore::MediaResourceLoader::MediaResourceLoader):
613         (WebCore::MediaResourceLoader::contextDestroyed):
614         (WebCore::MediaResourceLoader::requestResource):
615         (WebCore::MediaResource::responseReceived):
616         * loader/MediaResourceLoader.h:
617
618 2016-03-18  Mark Lam  <mark.lam@apple.com>
619
620         JSDOMGlobalObject.h needs to #include StructureInlines.h.
621         https://bugs.webkit.org/show_bug.cgi?id=155657
622
623         Reviewed by Filip Pizlo.
624
625         No new tests needed.  This is a build fix for the Win EWS.
626
627         * bindings/js/JSDOMGlobalObject.h:
628
629 2016-03-18  Brent Fulgham  <bfulgham@apple.com>
630
631         Local file restrictions should not block sessionStorage access
632         https://bugs.webkit.org/show_bug.cgi?id=155609
633         <rdar://problem/25229461>
634
635         Reviewed by Andy Estes.
636
637         Use of 'sesssionStorage' is governed by SecurityOrigin with third party access
638         set to 'ShouldAllowFromThirdParty::AlwaysAllowFromThirdParty'. We should not
639         reject local files for this combination of arguments.
640
641         Test: storage/domstorage/sessionstorage/blocked-file-access.html
642
643         * page/SecurityOrigin.cpp:
644         (WebCore::SecurityOrigin::canAccessStorage): For the case of sessionStorage,
645         allow local file access.
646
647 2016-03-18  Jer Noble  <jer.noble@apple.com>
648
649         CachedResource::MediaResource types shouldn't be blocked due to mixed-content.
650         https://bugs.webkit.org/show_bug.cgi?id=155588
651         <rdar://problem/25177795>
652
653         Reviewed by Daniel Bates.
654
655         The Mixed Content spec specifically allows (with certain restrictions) loads of <image>,
656         <video>, and <audio> resources from mixed-content origins, albeit with warnings.
657
658         No new tests, fixes existing test: http/tests/security/mixedContent/insecure-audio-video-in-main-frame.html
659
660         * loader/cache/CachedResourceLoader.cpp:
661         (WebCore::contentTypeFromResourceType):
662
663 2016-03-18  Nan Wang  <n_wang@apple.com>
664
665         AX: AXARIACurrent exposed but not displayed in Accessibility Inspector
666         https://bugs.webkit.org/show_bug.cgi?id=155600
667
668         Reviewed by Chris Fleizach.
669
670         AXARIACurrent attribute was added to a temporary array that was never returned.
671
672         Test: accessibility/mac/aria-current-attribute-exposed.html
673
674         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
675         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
676
677 2016-03-18  Nan Wang  <n_wang@apple.com>
678
679         AX: Typing broken on form input field while using VoiceOver
680         https://bugs.webkit.org/show_bug.cgi?id=155613
681
682         Reviewed by Chris Fleizach.
683
684         The div element inside the INPUT element gives a collapsed TextMarkerRange which then creates
685         a collapsed Range. Fixed it by using the parent node to create the Range when the div node has
686         no children.
687
688         Test: accessibility/mac/text-marker-range-for-node-without-children.html
689
690         * accessibility/AXObjectCache.cpp:
691         (WebCore::setRangeStartOrEndWithCharacterOffset):
692
693 2016-03-18  Chris Fleizach  <cfleizach@apple.com>
694
695         AX: Implement AutoFill Available attribute for a text field
696         https://bugs.webkit.org/show_bug.cgi?id=155567
697
698         Reviewed by Darin Adler.
699
700         This file was left out of original commit accidentally.
701
702         * accessibility/AccessibilityRenderObject.cpp:
703         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
704
705 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
706
707         [Mac][cmake] Unreviewed speculative buildfix after r197956. Just for fun.
708
709         * PlatformMac.cmake:
710
711 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
712
713         [Mac][cmake] Unreviewed speculative buildfix after r197628. Just for fun.
714
715         * PlatformMac.cmake:
716
717 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
718
719         [Mac][cmake] One more attempt to try to fix the build after r197633.
720
721         * PlatformMac.cmake:
722
723 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
724
725         [Mac][cmake] One more attempt to try to fix the build after r197633.
726
727         * PlatformMac.cmake:
728
729 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
730
731         [Mac][cmake] One more attempt to try to fix the build after r197633.
732
733         * PlatformMac.cmake: Revert r198398, which was incorrect.
734
735 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
736
737         [Mac][cmake] Last attempt to try to fix the build after r197633.
738
739         * PlatformMac.cmake:
740
741 2016-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
742
743         [css-grid] Rename GridSpan properties
744         https://bugs.webkit.org/show_bug.cgi?id=155636
745
746         Reviewed by Sergio Villar Senin.
747
748         GridSpan was using old names initialResolvedPosition and
749         finalResolvedPosition.
750         This patch rename them to startLine and endLine.
751
752         Some reasons for this refactoring:
753         - "position" is a vague term not defined in the spec.
754         - GridSpan is currently storing grid lines. A grid "line" is defined
755           in the spec: https://drafts.csswg.org/css-grid/#grid-line-concept
756         - The spec uses the concepts "start" and "end" lines too.
757
758         No new tests, no change of behavior.
759
760         * css/CSSGridTemplateAreasValue.cpp:
761         (WebCore::stringForPosition):
762         * css/CSSParser.cpp:
763         (WebCore::CSSParser::parseGridTemplateAreasRow):
764         * css/StyleBuilderConverter.h:
765         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
766         * rendering/RenderGrid.cpp:
767         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
768         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
769         (WebCore::RenderGrid::insertItemIntoGrid):
770         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
771         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
772         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
773         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
774         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
775         (WebCore::RenderGrid::columnAxisOffsetForChild):
776         (WebCore::RenderGrid::rowAxisOffsetForChild):
777         * rendering/style/GridArea.h:
778         (WebCore::GridSpan::untranslatedDefiniteGridSpan):
779         (WebCore::GridSpan::translatedDefiniteGridSpan):
780         (WebCore::GridSpan::operator==):
781         (WebCore::GridSpan::integerSpan):
782         (WebCore::GridSpan::untranslatedStartLine):
783         (WebCore::GridSpan::untranslatedEndLine):
784         (WebCore::GridSpan::startLine):
785         (WebCore::GridSpan::endLine):
786         (WebCore::GridSpan::begin):
787         (WebCore::GridSpan::end):
788         (WebCore::GridSpan::translate):
789         (WebCore::GridSpan::GridSpan):
790         (WebCore::GridSpan::untranslatedResolvedInitialPosition): Deleted.
791         (WebCore::GridSpan::untranslatedResolvedFinalPosition): Deleted.
792         (WebCore::GridSpan::resolvedInitialPosition): Deleted.
793         (WebCore::GridSpan::resolvedFinalPosition): Deleted.
794         * rendering/style/GridPositionsResolver.cpp:
795         (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
796         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
797         (WebCore::resolveGridPositionAgainstOppositePosition):
798         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
799
800 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
801
802         [Mac][cmake] One more unreviewed speculative buildfix after r197633. Just for fun.
803
804         * PlatformMac.cmake:
805
806 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
807
808         [Mac][cmake] Unreviewed speculative buildfix after r197633. Just for fun.
809
810         * PlatformMac.cmake:
811
812 2016-03-18  Youenn Fablet  <youenn.fablet@crf.canon.fr>
813
814         crossorigin element resource loading should check HTTP redirection
815         https://bugs.webkit.org/show_bug.cgi?id=130578
816
817         Reviewed by Daniel Bates and Brent Fulgham.
818
819         Moved part of DocumentThreadableLoader redirection cross origin control code
820         into functions in CrossOriginAccessControl.cpp. Added cross origin control for
821         redirections in SubResourceLoader when policy is set to PotentiallyCrossOriginEnabled 
822         using CrossOriginAccessControl.cpp new functions. Added a new test that checks that 
823         cross-origin redirections are checked against CORS.
824
825         Test: http/tests/security/shape-image-cors-redirect.html
826
827         * loader/CrossOriginAccessControl.cpp:
828         (WebCore::isValidCrossOriginRedirectionURL): Returns true if the redirected URL is a valid URL for cross-origin requests.
829         (WebCore::cleanRedirectedRequestForAccessControl): Removes all headers added by the network backend that may cause the response CORS validation to fail.
830         * loader/CrossOriginAccessControl.h: Added above function prototypes.
831         * loader/DocumentThreadableLoader.cpp:
832         (WebCore::DocumentThreadableLoader::redirectReceived): Used new CORS redirection methods of CrossOriginAccessControl.cpp.
833         * loader/SubresourceLoader.cpp:
834         (WebCore::SubresourceLoader::init): Initialize the SecurityOrigin to be used for loading the resource.
835         (WebCore::SubresourceLoader::willSendRequest): Added cross-origin redirection response check.
836         (WebCore::SubresourceLoader::checkCrossOriginAccessControl): Checks CORS and update request if needed. Returns true if control checks passed.
837         * loader/SubresourceLoader.h: Added checkCrossOriginAccessControl declaration and m_origin declaration.
838
839 2016-03-18  Darin Adler  <darin@apple.com>
840
841         Disable Caches in Safari's Develop menu does not disable caches.
842         https://bugs.webkit.org/show_bug.cgi?id=64483
843
844         Reviewed by Antti Koivisto.
845
846         Add a new setting, ResourceCachingDisabled, for use in future versions of Safari.
847
848         * history/PageCache.cpp:
849         (WebCore::canCachePage): Check resourceCachingDisabled and return false.
850         (WebCore::PageCache::take): Check resourceCachingDisabled, and return null.
851         (WebCore::PageCache::get): Ditto.
852
853         * loader/FrameLoader.cpp:
854         (WebCore::FrameLoader::subresourceCachePolicy): Check resourceCachingDisabled, and
855         request a reload.
856         (WebCore::FrameLoader::addExtraFieldsToRequest): Check resourceCachingDisabled, and
857         set the cache policy to trigger a reload.
858         * loader/cache/CachedResourceLoader.cpp:
859         (WebCore::CachedResourceLoader::cachePolicy): Check resourceCachingDisabled, and
860         request a reload.
861
862         * page/Settings.in: Added resourceCachingDisabled.
863
864 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
865
866         [Mac][cmake] Unreviewed speculative buildfix. Just for fun.
867
868         * loader/EmptyClients.cpp:
869
870 2016-03-17  Antti Koivisto  <antti@apple.com>
871
872         Data URL DecodeTask may get deleted outside main thread
873         https://bugs.webkit.org/show_bug.cgi?id=155584
874         rdar://problem/24492104
875
876         Reviewed by Darin Adler.
877
878         This is unsafe as it owns strings and other types that are only safe to delete in the main thread.
879
880         There is a race between deref in dispatch() and deref in timerFired(). If the timer fires before dispatch()
881         exits the implicit deref will trigger deletion of DecodingResultDispatcher in the dispatching thread.
882
883         (WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired):
884
885             Fix by clearing m_decodeTask when the timer fires.
886
887 2016-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
888
889         REGRESSION(r195661): [GTK] very slow scrolling
890         https://bugs.webkit.org/show_bug.cgi?id=155334
891
892         Reviewed by Michael Catanzaro.
893
894         We need to also restore the PerAxisData visible length when it's
895         reset because of a non animated scroll. To prevent making the same
896         mistake in the future, the current position and visible lengths
897         members are now required to construct PerAxisData. This also
898         simplifies the code and ensures that when the ScrollAnimatorSmooth
899         is created, it's updated to the current position.
900
901         * platform/ScrollAnimationSmooth.cpp:
902         (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
903         Initialize PerAxisData members.
904         (WebCore::ScrollAnimationSmooth::setCurrentPosition): Pass the
905         current position and visible length as parameters to the
906         PerAxisData constructor.
907         (WebCore::ScrollAnimationSmooth::animateScroll): Ditto.
908         * platform/ScrollAnimationSmooth.h: Add a PerAxisData constructor
909         that receives current position and visible length and disallow to
910         use the default constructor.
911         * platform/ScrollAnimatorSmooth.cpp:
912         (WebCore::ScrollAnimatorSmooth::ScrollAnimatorSmooth): Pass the
913         current position to the ScrollAnimationSmooth constructor.
914         * platform/gtk/ScrollAnimatorGtk.cpp:
915         (WebCore::ScrollAnimatorGtk::ensureSmoothScrollingAnimation): Ditto.
916
917 2016-03-17  Chris Fleizach  <cfleizach@apple.com>
918
919         AX: WEB: VoiceOver does not announce some WAI-ARIA document structures
920         https://bugs.webkit.org/show_bug.cgi?id=155603
921         <rdar://problem/25227385>
922
923         Reviewed by Darin Adler.
924
925         Expose more ARIA landmark type roles on iOS for accessibility.
926
927         Updated test: accessibility/ios-simulator/landmark-type.html
928
929         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
930         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
931         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
932         * platform/LocalizedStrings.cpp:
933         (WebCore::searchMenuClearRecentSearchesText):
934         (WebCore::AXWebAreaText):
935         (WebCore::AXListItemActionVerb):
936         (WebCore::AXAutoFillCredentialsLabel):
937         * platform/LocalizedStrings.h:
938
939 2016-03-17  Daniel Bates  <dabates@apple.com>
940
941         Cleanup: Remove the need to pass reporting status to ContentSecurityPolicy functions
942         https://bugs.webkit.org/show_bug.cgi?id=155623
943
944         Reviewed by Andy Estes and Alex Christensen.
945
946         ScriptController::initScript() is the only function that passes ContentSecurityPolicy::ReportingStatus::SuppressReport
947         following the removal of the SecurityPolicy script interface in <http://trac.webkit.org/changeset/197142>. It
948         passes this reporting status to prevent sending a violation report when determining whether the CSP policy allows
949         use of the JavaScript eval()/operator eval so that it enable or disable this capability as appropriate. We
950         should teach ScriptController::initScript() to delegate the responsibility of enabling/disabling this capability
951         to the ContentSecurityPolicy. Then we can remove the need to expose ContentSecurityPolicy::ReportingStatus as
952         part of the ContentSecurityPolicy interface.
953
954         No functionality changed. So, no new tests.
955
956         * bindings/js/ScriptController.cpp:
957         (WebCore::ScriptController::createWindowShell): Return a reference to a JSDOMWindowShell object
958         instead of a pointer as the pointer is always non-null.
959         (WebCore::ScriptController::initScript): Updated as needed now that ScriptController::createWindowShell()
960         returns a reference. Moved logic to enable/disable JavaScript eval() and operator eval from here into
961         ContentSecurityPolicy::didCreateWindowShell() and make use of this member function.
962         * bindings/js/ScriptController.h:
963         * page/csp/ContentSecurityPolicy.cpp:
964         (WebCore::ContentSecurityPolicy::didCreateWindowShell): Added. Moved logic from to enable/disable JavaScript
965         eval() and operator eval from ScriptController::initScript() to here.
966         (WebCore::ContentSecurityPolicy::didReceiveHeader): Substitute ContentSecurityPolicyDirectiveList::ReportingStatus::SuppressReport
967         for ContentSecurityPolicy::ReportingStatus::SuppressReport as the enum has moved from class ContentSecurityPolicy
968         to ContentSecurityPolicyDirectiveList. Fix minor code style nit; substitute nullptr for 0 in the first argument
969         to ContentSecurityPolicyDirectiveList::allowEval().
970         (WebCore::isAllowedByAllWithFrame): Substitute ContentSecurityPolicyDirectiveList::ReportingStatus::SuppressReport
971         for ContentSecurityPolicy::ReportingStatus::SuppressReport as the enum has moved from class ContentSecurityPolicy
972         to ContentSecurityPolicyDirectiveList.
973         (WebCore::isAllowedByAll): Substitute ContentSecurityPolicyDirectiveList::ReportingStatus::SuppressReport
974         for ContentSecurityPolicy::ReportingStatus::SuppressReport as the enum has moved from class ContentSecurityPolicy
975         to ContentSecurityPolicyDirectiveList. Also make this function static so that it has internal linkage.
976         (WebCore::isAllowedByAllWithState): Ditto.
977         (WebCore::isAllowedByAllWithContext): Ditto.
978         (WebCore::isAllowedByAllWithHashFromContent): Ditto.
979         (WebCore::isAllowedByAllWithURL): Ditto.
980         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs): Remove argument reportingStatus and always pass
981         ContentSecurityPolicyDirectiveList::ReportingStatus::SendReport to the directive list member function. In a
982         subsequent patch we will remove the need to pass the reporting status to the directive list member function.
983         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers): Ditto.
984         (WebCore::ContentSecurityPolicy::allowInlineScript): Ditto.
985         (WebCore::ContentSecurityPolicy::allowInlineStyle): Ditto.
986         (WebCore::ContentSecurityPolicy::allowEval): Ditto.
987         (WebCore::ContentSecurityPolicy::allowFrameAncestors): Ditto.
988         (WebCore::ContentSecurityPolicy::allowPluginType): Ditto.
989         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Ditto.
990         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
991         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
992         (WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
993         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
994         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
995         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
996         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
997         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
998         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
999         (WebCore::ContentSecurityPolicy::allowBaseURI): Ditto.
1000         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage): Deleted.
1001         * page/csp/ContentSecurityPolicy.h:
1002         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1003         (WebCore::ContentSecurityPolicyDirectiveList::allowJavaScriptURLs): Substitute ReportingStatus for
1004         ContentSecurityPolicy::ReportingStatus as the enum has moved from class ContentSecurityPolicy to this class.
1005         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineEventHandlers): Ditto.
1006         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineScript): Ditto.
1007         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineStyle): Ditto.
1008         (WebCore::ContentSecurityPolicyDirectiveList::allowEval): Ditto.
1009         (WebCore::ContentSecurityPolicyDirectiveList::allowPluginType): Ditto.
1010         (WebCore::ContentSecurityPolicyDirectiveList::allowScriptFromSource): Ditto.
1011         (WebCore::ContentSecurityPolicyDirectiveList::allowObjectFromSource): Ditto.
1012         (WebCore::ContentSecurityPolicyDirectiveList::allowChildContextFromSource): Ditto.
1013         (WebCore::ContentSecurityPolicyDirectiveList::allowChildFrameFromSource): Ditto.
1014         (WebCore::ContentSecurityPolicyDirectiveList::allowImageFromSource): Ditto.
1015         (WebCore::ContentSecurityPolicyDirectiveList::allowStyleFromSource): Ditto.
1016         (WebCore::ContentSecurityPolicyDirectiveList::allowFontFromSource): Ditto.
1017         (WebCore::ContentSecurityPolicyDirectiveList::allowMediaFromSource): Ditto.
1018         (WebCore::ContentSecurityPolicyDirectiveList::allowConnectToSource): Ditto.
1019         (WebCore::ContentSecurityPolicyDirectiveList::allowFormAction): Ditto.
1020         (WebCore::ContentSecurityPolicyDirectiveList::allowBaseURI): Ditto.
1021         (WebCore::ContentSecurityPolicyDirectiveList::allowFrameAncestors): Ditto.
1022         * page/csp/ContentSecurityPolicyDirectiveList.h:
1023
1024 2016-03-17  Brent Fulgham  <bfulgham@apple.com>
1025
1026         [XSS Auditor] Off by one in XSSAuditor::canonicalizedSnippetForJavaScript()
1027         https://bugs.webkit.org/show_bug.cgi?id=155624
1028         <rdar://problem/25219962>
1029
1030         Unreviewed merge from Blink (patch by Tom Sepez <tsepez@chromium.org>):
1031         <https://src.chromium.org/viewvc/blink?revision=201803&view=revision>
1032
1033         Test: http/tests/security/xssAuditor/script-tag-with-trailing-script-and-urlencode.html
1034
1035         * html/parser/XSSAuditor.cpp:
1036         (WebCore::XSSAuditor::canonicalizedSnippetForJavaScript): Correct off-by-one error.
1037
1038 2016-03-17  Zalan Bujtas  <zalan@apple.com>
1039
1040         Images in feed on ebay.com jiggle when one is hovered
1041         https://bugs.webkit.org/show_bug.cgi?id=155608
1042         <rdar://problem/25160681>
1043
1044         The content offset in compositing layer = subpixel gap between the graphics layer and the layer bounds + layer bounds top left.
1045
1046         Reviewed by Simon Fraser.
1047
1048         Test: compositing/hidpi-viewport-clipping-on-composited-content.html
1049
1050         * rendering/RenderLayerBacking.cpp:
1051         (WebCore::RenderLayerBacking::updateGeometry):
1052         (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
1053         * rendering/RenderLayerBacking.h:
1054
1055 2016-03-17  Zalan Bujtas  <zalan@apple.com>
1056
1057         Don't initiate a style recall while drawing text 
1058         https://bugs.webkit.org/show_bug.cgi?id=155618
1059
1060         Reviewed by Simon Fraser.
1061
1062         This patch ensures that we don't initiate a style recalc while in the middle of text drawing.
1063
1064         Test: fast/canvas/crash-while-resizing-canvas.html
1065
1066         * html/canvas/CanvasRenderingContext2D.cpp:
1067         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1068
1069 2016-03-17  Commit Queue  <commit-queue@webkit.org>
1070
1071         Unreviewed, rolling out r198335.
1072         https://bugs.webkit.org/show_bug.cgi?id=155617
1073
1074         This change caused existing LayoutTests to crash
1075         intermittently (Requested by ryan|afk on #webkit).
1076
1077         Reverted changeset:
1078
1079         "DataURLDecoder::DecodingResultDispatcher may get deleted
1080         outside main thread"
1081         https://bugs.webkit.org/show_bug.cgi?id=155584
1082         http://trac.webkit.org/changeset/198335
1083
1084 2016-03-17  Eric Carlson  <eric.carlson@apple.com>
1085
1086         Improve some metadata tests
1087         https://bugs.webkit.org/show_bug.cgi?id=155616
1088
1089         Reviewed by Saam Barati.
1090
1091         * html/track/DataCue.cpp:
1092         (WebCore::DataCue::DataCue):
1093         (WebCore::DataCue::setData):
1094
1095 2016-03-17  Myles C. Maxfield  <mmaxfield@apple.com>
1096
1097         [RTL Scrollbars] Position: absolute divs are covered by vertical scrollbar
1098         https://bugs.webkit.org/show_bug.cgi?id=155531
1099
1100         Reviewed by Darin Adler.
1101
1102         This patch updates ScrollView::documentScrollPositionRelativeToViewOrigin(), which is
1103         a helper function primarily used by WebCore::ScrollView::viewToContents() and
1104         WebCore::ScrollView::contentsToView().
1105
1106         Tests: fast/scrolling/rtl-scrollbars-elementFromPoint-static.html
1107                fast/scrolling/rtl-scrollbars-elementFromPoint.html
1108                fast/scrolling/rtl-scrollbars-iframe-offset.html
1109                fast/scrolling/rtl-scrollbars-iframe-position-absolute.html
1110                fast/scrolling/rtl-scrollbars-iframe-scrolled.html
1111                fast/scrolling/rtl-scrollbars-iframe.html
1112                fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html
1113                fast/scrolling/rtl-scrollbars-overflow-position-absolute.html
1114                fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html
1115                fast/scrolling/rtl-scrollbars-position-absolute.html
1116                fast/scrolling/rtl-scrollbars-position-fixed.html
1117                fast/scrolling/rtl-scrollbars-text-selection-scrolled.html
1118                fast/scrolling/rtl-scrollbars-text-selection.html
1119
1120         * platform/ScrollView.cpp:
1121         (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin):
1122
1123 2016-03-17  Filip Pizlo  <fpizlo@apple.com>
1124
1125         Replace all of the various non-working and non-compiling sampling profiler hacks with a single super hack
1126         https://bugs.webkit.org/show_bug.cgi?id=155561
1127
1128         Reviewed by Saam Barati.
1129
1130         No new tests because no new behavior.
1131
1132         * platform/audio/ios/MediaSessionManagerIOS.mm:
1133         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1134
1135 2016-03-17  Brent Fulgham  <bfulgham@apple.com>
1136
1137         Some media tests are flaky.
1138         https://bugs.webkit.org/show_bug.cgi?id=155614
1139
1140         Reviewed by Eric Carlson.
1141
1142         * html/track/TextTrack.cpp:
1143         (WebCore::TextTrack::~TextTrack):
1144
1145 2016-03-17  Brady Eidson  <beidson@apple.com>
1146
1147         Don't try to restore deleted MemoryIndexes if their owning object store is not restored.
1148         https://bugs.webkit.org/show_bug.cgi?id=155068
1149
1150         Reviewed by Alex Christensen.
1151
1152         Test: storage/indexeddb/modern/deleteindex-4-private.html
1153
1154         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1155         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted):
1156
1157 2016-03-17  Doug Russell  <d_russell@apple.com>
1158
1159         AX: attributes to retrieve focusable and editable ancestors
1160         https://bugs.webkit.org/show_bug.cgi?id=155554
1161
1162         Reviewed by Chris Fleizach.
1163
1164         Add attributes to help give context to focus changes:
1165         AXFocusableAncestor - nearest accessibility ancestor that returns true for
1166         canSetFocusAttribute().
1167         AXEditableAncestor - nearest accessibility ancestor that returns true for
1168         isTextControl().
1169         AXHighestEditableAncestor - highest element in accessibility that returns true
1170         for isTextControl().
1171
1172         Test: accessibility/mac/ancestor-attributes.html
1173
1174         * accessibility/AccessibilityNodeObject.cpp:
1175         * accessibility/AccessibilityObject.cpp:
1176         (WebCore::AccessibilityObject::focusableAncestor):
1177         (WebCore::AccessibilityObject::editableAncestor):
1178         (WebCore::AccessibilityObject::highestEditableAncestor):
1179         * accessibility/AccessibilityObject.h:
1180         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1181         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
1182         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1183
1184 2016-03-17  Sam Weinig  <sam@webkit.org>
1185
1186         Implement document.queryCommandSupported("copy")
1187         https://bugs.webkit.org/show_bug.cgi?id=155548
1188         <rdar://problem/25195295>
1189
1190         Reviewed by Enrica Casucci.
1191
1192         - document.queryCommandSupported("copy") and document.queryCommandSupported("cut") need
1193           to return true if the ClipboardAccessPolicy is either Allow or RequiresUserGesture.
1194           But, document.queryCommandEnabled("copy") and document.queryCommandEnabled("cut")
1195           should still return false when there is no user gesture. I also had to maintain a weird
1196           quirk that copy and cut should be allowed to execute, and thus fire the oncopy and oncut
1197           events, even when disabled, if coming from a "MenuOrKeyBinding" source. To do this, I
1198           upgraded the allowExecutionWhenDisabled bit to a function taking a source, and return true
1199           only when the correct source is specified.
1200
1201         * editing/Editor.h:
1202         * editing/EditorCommand.cpp:
1203         (WebCore::defaultValueForSupportedCopyCut):
1204         (WebCore::allowCopyCutFromDOM):
1205         (WebCore::enabledCopy):
1206         (WebCore::enabledCut):
1207         (WebCore::allowExecutionWhenDisabled):
1208         (WebCore::doNotAllowExecutionWhenDisabled):
1209         (WebCore::allowExecutionWhenDisabledCopyCut):
1210         (WebCore::Editor::Command::execute):
1211         (WebCore::Editor::Command::allowExecutionWhenDisabled):
1212
1213 2016-03-17  Antti Koivisto  <antti@apple.com>
1214
1215         DataURLDecoder::DecodingResultDispatcher may get deleted outside main thread
1216         https://bugs.webkit.org/show_bug.cgi?id=155584
1217         rdar://problem/24492104
1218
1219         Reviewed by Chris Dumez.
1220
1221         This is unsafe as it owns strings and other types that are only safe to delete in the main thread.
1222
1223         * platform/network/DataURLDecoder.cpp:
1224         (WebCore::DataURLDecoder::DecodingResultDispatcher::dispatch):
1225
1226             The problem is that this was a refcounted type. This created a race. If the timer fired before dispatch()
1227             was exited the implicit deref here would trigger the deletion in the dispatching thread.
1228
1229             Fix by getting rid of the unnecessary refcounting. Timer firing will now delete the instance explicitly.
1230
1231         (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer):
1232         (WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired):
1233
1234 2016-03-17  Commit Queue  <commit-queue@webkit.org>
1235
1236         Unreviewed, rolling out r198201.
1237         https://bugs.webkit.org/show_bug.cgi?id=155585
1238
1239         That was not the proper solution (Requested by KaL on
1240         #webkit).
1241
1242         Reverted changeset:
1243
1244         "REGRESSION (r197724): [GTK] Web Inspector: Images being
1245         blocked by CSP 2.0"
1246         https://bugs.webkit.org/show_bug.cgi?id=155432
1247         http://trac.webkit.org/changeset/198201
1248
1249 2016-03-16  Chris Fleizach  <cfleizach@apple.com>
1250
1251         AX: Implement AutoFill Available attribute for a text field
1252         https://bugs.webkit.org/show_bug.cgi?id=155567
1253
1254         Reviewed by Darin Adler.
1255
1256         Expose the auto fill buttons to the AX hierarchy.
1257         Add an attribute for the textfield to inform when the auto fill button is available.
1258
1259         Test: accessibility/auto-fill-types.html
1260
1261         * English.lproj/Localizable.strings:
1262         * accessibility/AccessibilityObject.cpp:
1263         (WebCore::AccessibilityObject::element):
1264         (WebCore::AccessibilityObject::isValueAutofillAvailable):
1265         (WebCore::AccessibilityObject::isValueAutofilled):
1266         * accessibility/AccessibilityObject.h:
1267         (WebCore::AccessibilityObject::passwordFieldValue):
1268         * accessibility/AccessibilityRenderObject.cpp:
1269         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
1270         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1271         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1272         * html/TextFieldInputType.cpp:
1273         (WebCore::limitLength):
1274         (WebCore::autoFillButtonTypeToAccessibilityLabel):
1275         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
1276         (WebCore::TextFieldInputType::createAutoFillButton):
1277         (WebCore::TextFieldInputType::updateAutoFillButton):
1278         * platform/LocalizedStrings.cpp:
1279         (WebCore::AXListItemActionVerb):
1280         (WebCore::AXAutoFillCredentialsLabel):
1281         (WebCore::AXAutoFillContactsLabel):
1282         (WebCore::AXARIAContentGroupText):
1283         * platform/LocalizedStrings.h:
1284
1285 2016-03-17  Csaba Osztrogonác  <ossy@webkit.org>
1286
1287         [Mac][cmake] Unreviewed speculative buildfix after r198179. Just for fun.
1288
1289         * PlatformMac.cmake:
1290
1291 2016-03-17  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1292
1293         [Fetch API] response-consume.html is crashing on Mac WK1 Debug builds
1294         https://bugs.webkit.org/show_bug.cgi?id=155490
1295
1296         Reviewed by Darin Adler.
1297
1298         Covered by existing tests.
1299
1300         Ensured to lock state before calling JSC:JSONParse.
1301         Adding fulfillPromiseWithJSON routine to handle it.
1302         Applied it to FetchBody.
1303
1304         * Modules/fetch/FetchBody.cpp:
1305         (WebCore::FetchBody::json):
1306         (WebCore::FetchBody::loadedAsText):
1307         (WebCore::FetchBody::resolveAsJSON): Deleted.
1308         * Modules/fetch/FetchBody.h:
1309         * Modules/fetch/FetchBodyOwner.cpp:
1310         (WebCore::FetchBodyOwner::loadedBlobAsText):
1311         * bindings/js/JSDOMPromise.cpp:
1312         (WebCore::parseAsJSON):
1313         (WebCore::fulfillPromiseWithJSON):
1314         * bindings/js/JSDOMPromise.h:
1315
1316 2016-03-17  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1317
1318         WebRTC: Update RTCIceCandidate
1319         https://bugs.webkit.org/show_bug.cgi?id=155535
1320
1321         Reviewed by Eric Carlson.
1322
1323         Update the RTCIceCandidate constructor procedure to match the WebRTC 1.0 specification [1].
1324         In short: The "candidate" init dictionary member is required. At least one of the dictionary
1325         members "sdpMid" and "sdpMLine" needs to be present; the corresponding attribute of the
1326         other, is initialized to null.
1327
1328         [1] https://w3c.github.io/webrtc-pc/archives/20160215/webrtc.html
1329
1330         Tests: Updated fast/mediastream/RTCIceCandidate.htm
1331
1332         * Modules/mediastream/RTCIceCandidate.cpp:
1333         (WebCore::RTCIceCandidate::create):
1334         (WebCore::RTCIceCandidate::RTCIceCandidate):
1335         * Modules/mediastream/RTCIceCandidate.h:
1336         (WebCore::RTCIceCandidate::sdpMLineIndex):
1337         (WebCore::RTCIceCandidate::setSdpMLineIndex):
1338         * Modules/mediastream/RTCIceCandidate.idl:
1339         * bindings/js/JSRTCIceCandidateCustom.cpp:
1340         (WebCore::JSRTCIceCandidate::sdpMid):
1341         (WebCore::JSRTCIceCandidate::sdpMLineIndex):
1342
1343 2016-03-16  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
1344
1345         SVG tear offs should return a const reference if possible
1346         https://bugs.webkit.org/show_bug.cgi?id=153214
1347
1348         Reviewed by Alex Christensen.
1349
1350         A smaller change than expected because the returned reference is being copied into a value in additional locations that baseVal and animVal are used.
1351
1352         No new tests as there is no change in behaviour.
1353
1354         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
1355         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
1356         (WebCore::SVGAnimatedStaticPropertyTearOff::baseVal):
1357         (WebCore::SVGAnimatedStaticPropertyTearOff::animVal):
1358
1359 2016-03-16  Chris Dumez  <cdumez@apple.com>
1360
1361         Unreviewed, partial roll out of r197254.
1362         <rdar://problem/25078552>
1363
1364         It caused a ~1.1% PLT regression on iOS.
1365
1366         * loader/FrameLoader.cpp:
1367         (WebCore::FrameLoader::commitProvisionalLoad): Deleted.
1368
1369 2016-03-16  Enrica Casucci  <enrica@apple.com>
1370
1371         Recognize mailto and tel url as data detector links.
1372         https://bugs.webkit.org/show_bug.cgi?id=155569
1373         rdar://problem/24836185
1374
1375         Reviewed by Sam Weinig.
1376
1377         When we check if the element is a data detector link,
1378         we should return true also for URLs with mailto: and tel: scheme.
1379
1380         * editing/cocoa/DataDetection.mm:
1381         (WebCore::DataDetection::isDataDetectorLink):
1382
1383 2016-03-16  Zalan Bujtas  <zalan@apple.com>
1384
1385         Subpixel rendering: Directly composited image layers need pixelsnapping.
1386         https://bugs.webkit.org/show_bug.cgi?id=155558
1387
1388         Reviewed by Simon Fraser.
1389
1390         In order to match non-composited image size/position, we need to pixelsnap both the contents and the clipping
1391         layer bounds for directly composited images.
1392
1393         Test: fast/images/hidpi-directly-composited-image-on-subpixel-position.html
1394
1395         * rendering/RenderLayerBacking.cpp:
1396         (WebCore::RenderLayerBacking::resetContentsRect):
1397         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
1398         (WebCore::RenderLayerBacking::updateImageContents):
1399
1400 2016-03-16  Beth Dakin  <bdakin@apple.com>
1401
1402         Provide NSSpellChecker spellChecking methods with the current insertion point
1403         https://bugs.webkit.org/show_bug.cgi?id=155532
1404         -and corresponding-
1405         rdar://problem/24066952
1406
1407         Reviewed by Simon Fraser.
1408
1409         Pass the Frame’s selection to a handful of spelling checking methods that 
1410         call into WebKit/WebKit2 to ultimately call into NSSpellChecker.
1411         * accessibility/AccessibilityObject.cpp:
1412         (WebCore::AccessibilityObject::hasMisspelling):
1413         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1414         (AXAttributeStringSetSpelling):
1415         * editing/AlternativeTextController.cpp:
1416         (WebCore::AlternativeTextController::timerFired):
1417         * editing/Editor.cpp:
1418         (WebCore::Editor::guessesForMisspelledWord):
1419         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
1420         * editing/SpellChecker.cpp:
1421         (WebCore::SpellChecker::invokeRequest):
1422         (WebCore::SpellChecker::enqueueRequest):
1423         * editing/TextCheckingHelper.cpp:
1424         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
1425         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
1426         (WebCore::TextCheckingHelper::unifiedTextCheckerEnabled):
1427         (WebCore::checkTextOfParagraph):
1428         * editing/TextCheckingHelper.h:
1429         * loader/EmptyClients.cpp:
1430         (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
1431         (WebCore::EmptyTextCheckerClient::requestCheckingOfString):
1432         * loader/EmptyClients.h:
1433         * platform/text/TextCheckerClient.h:
1434         (WebCore::TextCheckerClient::~TextCheckerClient):
1435
1436         The key needed to include the insertion point.
1437         * platform/spi/mac/NSSpellCheckerSPI.h:
1438
1439 2016-03-16  Alex Christensen  <achristensen@webkit.org>
1440
1441         Fix assertion failure on drive.google.com after r196052
1442         https://bugs.webkit.org/show_bug.cgi?id=155562
1443
1444         Reviewed by Jer Noble.
1445
1446         * rendering/RenderGeometryMap.cpp:
1447         (WebCore::RenderGeometryMap::mapToContainer):
1448         Change float equality check to areEssentiallyEqual.
1449         This assertion was failing because rendererMappedResult was (944.335693, 232.047409)
1450         but result was (944.335693, 232.047394).  They differ by (0, 0.000015).
1451
1452 2016-03-16  Nan Wang  <n_wang@apple.com>
1453
1454         AX: Expose aria-current status to children
1455         https://bugs.webkit.org/show_bug.cgi?id=155469
1456
1457         Reviewed by Chris Fleizach.
1458
1459         Added aria-current to the global ARIA attributes list.
1460
1461         Test: accessibility/aria-current-global-attribute.html
1462
1463         * accessibility/AccessibilityObject.cpp:
1464         (WebCore::AccessibilityObject::supportsARIAAttributes):
1465
1466 2016-03-16  Tim Horton  <timothy_horton@apple.com>
1467
1468         [mac] Printing test snapshots are upside-down after r198242
1469         https://bugs.webkit.org/show_bug.cgi?id=155543
1470
1471         Reviewed by Simon Fraser.
1472
1473         * page/PrintContext.cpp:
1474         (WebCore::PrintContext::spoolAllPagesWithBoundaries):
1475         Stop PLATFORM(COCOA)-conditionally flipping here. Just paint.
1476         This function is only used by the test runners so this doesn't have a
1477         huge impact on anything else.
1478
1479 2016-03-16  Daniel Bates  <dabates@apple.com>
1480
1481         Update WebKit Feature Status page to include the status of Content Security Policy Level 2 and Level 3
1482
1483         * features.json:
1484
1485 2016-03-16  Daniel Bates  <dabates@apple.com>
1486
1487         <video> and <audio> elements do not obey Content Security Policy on redirect
1488         https://bugs.webkit.org/show_bug.cgi?id=155509
1489         <rdar://problem/10234844>
1490
1491         Reviewed by Alex Christensen.
1492
1493         Fixes an issue where the Content Security Policy of the page was not enforced
1494         on redirects when loading a media subresource via an HTML video or HTML audio
1495         element.
1496
1497         Tests: http/tests/security/contentSecurityPolicy/audio-redirect-allowed.html
1498                http/tests/security/contentSecurityPolicy/audio-redirect-blocked.html
1499                http/tests/security/contentSecurityPolicy/font-redirect-allowed.html
1500                http/tests/security/contentSecurityPolicy/font-redirect-blocked.html
1501                http/tests/security/contentSecurityPolicy/image-redirect-allowed.html
1502                http/tests/security/contentSecurityPolicy/image-redirect-blocked.html
1503                http/tests/security/contentSecurityPolicy/script-redirect-allowed.html
1504                http/tests/security/contentSecurityPolicy/script-redirect-blocked.html
1505                http/tests/security/contentSecurityPolicy/stylesheet-redirect-allowed.html
1506                http/tests/security/contentSecurityPolicy/stylesheet-redirect-blocked.html
1507                http/tests/security/contentSecurityPolicy/svg-font-redirect-allowed.html
1508                http/tests/security/contentSecurityPolicy/svg-font-redirect-blocked.html
1509                http/tests/security/contentSecurityPolicy/svg-image-redirect-allowed.html
1510                http/tests/security/contentSecurityPolicy/svg-image-redirect-blocked.html
1511                http/tests/security/contentSecurityPolicy/track-redirect-allowed.html
1512                http/tests/security/contentSecurityPolicy/track-redirect-blocked.html
1513                http/tests/security/contentSecurityPolicy/video-redirect-allowed.html
1514                http/tests/security/contentSecurityPolicy/video-redirect-blocked.html
1515                http/tests/security/contentSecurityPolicy/xsl-redirect-allowed.html
1516                http/tests/security/contentSecurityPolicy/xsl-redirect-blocked.html
1517
1518         * inspector/InspectorPageAgent.cpp:
1519         (WebCore::InspectorPageAgent::cachedResourceContent): Treat media resources as raw resources just as we do currently.
1520         (WebCore::InspectorPageAgent::cachedResourceType): Ditto.
1521         * loader/MediaResourceLoader.cpp:
1522         (WebCore::MediaResourceLoader::requestResource): Modified to use CachedResourceLoader::requestMedia() instead
1523         of CachedResourceLoader::requestRawResource() so that we can differentiate between a media resource and a raw
1524         resource in CachedResourceLoader. Added FIXME comment to skip checking the Content Security Policy for loads
1525         initiated by an element in a user agent shadow tree. See <https://bugs.webkit.org/show_bug.cgi?id=155505> for
1526         more details.
1527         * loader/ResourceLoadInfo.cpp:
1528         (WebCore::toResourceType): Treat media resources as raw resources just as we do currently. Also, add cases for
1529         CachedResource::LinkPrefetch and CachedResource::LinkSubresource (when ENABLE(LINK_PREFETCH) is enabled) and
1530         remove the default statement to force a compile-time error when a new CachedResource enumerator is added and
1531         the switch block in this function is not updated.
1532         * loader/SubresourceLoader.cpp:
1533         (WebCore::logResourceLoaded): Ditto.
1534         * loader/cache/CachedRawResource.cpp:
1535         (WebCore::CachedRawResource::CachedRawResource): Substitute CachedResource::isMainOrMediaOrRawResource() for
1536         CachedResource::isMainOrRawResource() as the latter was renamed to the former.
1537         * loader/cache/CachedRawResource.h:
1538         (isType): Ditto.
1539         * loader/cache/CachedResource.cpp:
1540         (WebCore::defaultPriorityForResourceType): Use priority ResourceLoadPriority::Medium for media resources just as
1541         we do currently.
1542         * loader/cache/CachedResource.h:
1543         (WebCore::CachedResource::isMainOrMediaOrRawResource): Formerly named isMainOrRawResource. Returns true if the type
1544         of this resource is a main resource, media resource, or raw resource.
1545         (WebCore::CachedResource::isMainOrRawResource): Deleted.
1546         * loader/cache/CachedResourceLoader.cpp:
1547         (WebCore::createResource): Treat media resources as raw resources just as we do currently.
1548         (WebCore::CachedResourceLoader::requestMedia): Added.
1549         (WebCore::contentTypeFromResourceType): Consider media resources as MixedContentChecker::ContentType::Active
1550         just as we do currently.
1551         (WebCore::CachedResourceLoader::checkInsecureContent): Apply the mixed content policy to media resources
1552         just as we do currently.
1553         (WebCore::CachedResourceLoader::canRequest): Apply the Same Origin Policy to media resources just as we
1554         do currently. Query the Content Security Policy of the page to determine if the media resource can be
1555         requested.
1556         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Substitute CachedResource::isMainOrMediaOrRawResource()
1557         for CachedResource::isMainOrRawResource() as the latter was renamed to the former.
1558         * loader/cache/CachedResourceLoader.h:
1559         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1560         (WebCore::WebCoreAVFResourceLoader::startLoading): Modified to use CachedResourceLoader::requestMedia() instead
1561         of CachedResourceLoader::requestRawResource() so that we can differentiate between a media resource and a raw
1562         resource in CachedResourceLoader. Added FIXME comment to skip checking the Content Security Policy for loads
1563         initiated by an element in a user agent shadow tree. See <https://bugs.webkit.org/show_bug.cgi?id=155505> for
1564         more details. Additionally, simplified code that determined whether to request the media resource or error out
1565         by coalescing two conditional expressions into one conditional on whether we have a loader and substituted
1566         nullptr for 0.
1567
1568 2016-03-16  Chris Dumez  <cdumez@apple.com>
1569
1570         Unreviewed, rolling out r198235, r198240, r198241, and
1571         r198252.
1572
1573         Causing crashes on ARM
1574
1575         Reverted changesets:
1576
1577         "Remove compile time define for SEPARATED_HEAP"
1578         https://bugs.webkit.org/show_bug.cgi?id=155508
1579         http://trac.webkit.org/changeset/198235
1580
1581         "Gardening: build fix after r198235."
1582         http://trac.webkit.org/changeset/198240
1583
1584         "Build fix."
1585         http://trac.webkit.org/changeset/198241
1586
1587         "Rename performJITMemcpy to something more inline with our
1588         normal webkit function names"
1589         https://bugs.webkit.org/show_bug.cgi?id=155525
1590         http://trac.webkit.org/changeset/198252
1591
1592 2016-03-16  Jiewen Tan  <jiewen_tan@apple.com>
1593
1594         URL Parsing should signal failure for illegal IDN
1595         https://bugs.webkit.org/show_bug.cgi?id=154945
1596         <rdar://problem/8014795>
1597
1598         Reviewed by Brent Fulgham.
1599
1600         WebCore::URL will now invalidate URLs with illegal IDN. And functions inside WebCoreNSURLExtras.h
1601         that deal with IDN mapping will now return nil to signal error.
1602
1603         Test: fast/url/invalid-idn.html
1604
1605         * platform/URL.cpp:
1606         (WebCore::isSchemeFirstChar):
1607         (WebCore::URL::init):
1608         (WebCore::appendEncodedHostname):
1609         (WebCore::encodeHostnames):
1610         (WebCore::encodeRelativeString):
1611         * platform/mac/WebCoreNSURLExtras.h:
1612         * platform/mac/WebCoreNSURLExtras.mm:
1613         (WebCore::mapHostNameWithRange):
1614         (WebCore::hostNameNeedsDecodingWithRange):
1615         (WebCore::hostNameNeedsEncodingWithRange):
1616         (WebCore::decodeHostNameWithRange):
1617         (WebCore::encodeHostNameWithRange):
1618         (WebCore::decodeHostName):
1619         (WebCore::encodeHostName):
1620         (WebCore::collectRangesThatNeedMapping):
1621         (WebCore::mapHostNames):
1622         (WebCore::URLWithData):
1623         (WebCore::dataWithUserTypedString):
1624         (WebCore::URLWithUserTypedString):
1625         (WebCore::URLWithUserTypedStringDeprecated):
1626         (WebCore::userVisibleString):
1627
1628 2016-03-16  Antti Koivisto  <antti@apple.com>
1629
1630         Don't invalidate style unnecessarily when setting inline style cssText
1631         https://bugs.webkit.org/show_bug.cgi?id=155541
1632         rdar://problem/23318893
1633
1634         Reviewed by Simon Fraser.
1635
1636         We currently invalidate style when cssText is set whether the style declaration changed or not.
1637
1638         Based on a patch by Simon.
1639
1640         Test: fast/css/style-invalidation-inline-csstext.html
1641
1642         * css/PropertySetCSSStyleDeclaration.cpp:
1643         (WebCore::PropertySetCSSStyleDeclaration::cssText):
1644         (WebCore::PropertySetCSSStyleDeclaration::setCssText):
1645
1646             Invalidate only if the parsed style changed.
1647
1648         * css/StyleProperties.cpp:
1649         (WebCore::MutableStyleProperties::parseDeclaration):
1650
1651             Compare the original and new style after parsing, return result.
1652
1653         * css/StyleProperties.h:
1654
1655 2016-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1656
1657         REGRESSION(r195661): [GTK] very slow scrolling
1658         https://bugs.webkit.org/show_bug.cgi?id=155334
1659
1660         Reviewed by Sergio Villar Senin.
1661
1662         Fix smooth scrolling behaviour change after r195661.
1663
1664         * platform/ScrollAnimationSmooth.cpp:
1665         (WebCore::getAnimationParametersForGranularity): Fix a typo,
1666         animationTime for pixel granularity should be 11 * tickTime.
1667         (WebCore::ScrollAnimationSmooth::animateScroll): Previous code
1668         reset all the data except the visibleLenght, so keep it in the
1669         PerAxisData after the reset.
1670
1671 2016-03-16  Commit Queue  <commit-queue@webkit.org>
1672
1673         Unreviewed, rolling out r196803.
1674         https://bugs.webkit.org/show_bug.cgi?id=155534
1675
1676         Introduced several rendering issues in popular websites
1677         (Requested by KaL on #webkit).
1678
1679         Reverted changeset:
1680
1681         "[GTK] Limit the number of tiles according to the visible
1682         area"
1683         https://bugs.webkit.org/show_bug.cgi?id=126122
1684         http://trac.webkit.org/changeset/196803
1685
1686 2016-03-15  Zalan Bujtas  <zalan@apple.com>
1687
1688         Remove overflow: -webkit-marquee
1689         https://bugs.webkit.org/show_bug.cgi?id=155517
1690         <rdar://problem/25028481>
1691
1692         Reviewed by Simon Fraser.
1693
1694         This patch is based on Blink patch from jchaffraix@chromium.org (https://src.chromium.org/viewvc/blink?revision=151756&view=revision)
1695
1696         * css/CSSParser.cpp:
1697         (WebCore::isValidKeywordPropertyAndValue):
1698         * css/CSSPrimitiveValueMappings.h:
1699         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
1700         (WebCore::CSSPrimitiveValue::operator EOverflow): Deleted.
1701         * css/CSSValueKeywords.in:
1702         * css/StyleResolver.cpp:
1703         (WebCore::StyleResolver::adjustRenderStyle):
1704         * css/html.css:
1705         (marquee): Deleted.
1706         * rendering/RenderBox.cpp:
1707         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
1708         * rendering/RenderLayer.cpp:
1709         (WebCore::RenderLayer::scrollTo):
1710         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1711         (WebCore::RenderLayer::calculateClipRects):
1712         * rendering/RenderLayer.h:
1713         * rendering/RenderMarquee.h:
1714         * rendering/style/RenderStyleConstants.h:
1715
1716 2016-03-15  Joanmarie Diggs  <jdiggs@igalia.com>
1717
1718         AX: Expose pointers to SVG elements referenced by aria-labelledby
1719         https://bugs.webkit.org/show_bug.cgi?id=155481
1720
1721         Reviewed by Chris Fleizach.
1722
1723         Expose elements referenced by aria-labelledby via ATK_RELATION_LABELLED_BY.
1724         Stop calling the supportsARIA* methods before getting the elements referred
1725         to by the associated ARIA property in the accessible wrapper for ATK and
1726         the inspector: Getting the elements will be just as fast when there are no
1727         such elements, and faster when there are.
1728
1729         Modified the w3c-svg-name-calculation.html test to include AXTitleUIElement
1730         in its output.
1731
1732         * accessibility/AccessibilityObject.cpp:
1733         (WebCore::AccessibilityObject::supportsARIAAttributes):
1734         (WebCore::AccessibilityObject::ariaElementsFromAttribute): Added.
1735         (WebCore::AccessibilityObject::ariaControlsElements): Added.
1736         (WebCore::AccessibilityObject::ariaDescribedByElements): Added.
1737         (WebCore::AccessibilityObject::ariaFlowToElements): Added.
1738         (WebCore::AccessibilityObject::ariaLabelledByElements): Added.
1739         (WebCore::AccessibilityObject::ariaOwnsElements): Added.
1740         * accessibility/AccessibilityObject.h:
1741         (WebCore::AccessibilityObject::ariaOwnsElements): No longer virtual.
1742         (WebCore::AccessibilityObject::supportsARIAFlowTo): Deleted.
1743         (WebCore::AccessibilityObject::ariaFlowToElements): No longer virtual.
1744         (WebCore::AccessibilityObject::supportsARIADescribedBy): Deleted.
1745         (WebCore::AccessibilityObject::ariaDescribedByElements): No longer virtual.
1746         (WebCore::AccessibilityObject::supportsARIAControls): Deleted.
1747         (WebCore::AccessibilityObject::ariaControlsElements): No longer virtual.
1748         * accessibility/AccessibilityRenderObject.cpp:
1749         (WebCore::AccessibilityRenderObject::ariaElementsFromAttribute): Moved to AccessibilityObject.
1750         (WebCore::AccessibilityRenderObject::supportsARIAFlowTo): Deleted.
1751         (WebCore::AccessibilityRenderObject::ariaFlowToElements): Moved to AccessibilityObject.
1752         (WebCore::AccessibilityRenderObject::supportsARIADescribedBy): Deleted.
1753         (WebCore::AccessibilityRenderObject::ariaDescribedByElements): Moved to AccessibilityObject.
1754         (WebCore::AccessibilityRenderObject::supportsARIAControls): Deleted.
1755         (WebCore::AccessibilityRenderObject::ariaControlsElements): Moved to AccessibilityObject.
1756         (WebCore::AccessibilityRenderObject::ariaOwnsElements): Moved to AccessibilityObject.
1757         * accessibility/AccessibilityRenderObject.h:
1758         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1759         (setAtkRelationSetFromCoreObject):
1760         * inspector/InspectorDOMAgent.cpp:
1761         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1762
1763 2016-03-15  Simon Fraser  <simon.fraser@apple.com>
1764
1765         Occasional crash under GraphicsContext::platformContext when dragging Google maps
1766         https://bugs.webkit.org/show_bug.cgi?id=155521
1767         rdar://problem/24357307
1768
1769         Reviewed by Tim Horton.
1770
1771         It's possible for createDragImageForSelection() to return a null image, if the bounds
1772         of the selection are an empty rect. That would cause a crash under convertImageToBitmap()
1773         because a zero-sized ShareableBitmap will return a null GraphicsContext.
1774         
1775         To avoid this, early return from DragController::startDrag() if the dragImage is null.
1776         
1777         I wasn't able to come up with a test for this.
1778
1779         * page/DragController.cpp:
1780         (WebCore::DragController::startDrag):
1781
1782 2016-03-15  Tim Horton  <timothy_horton@apple.com>
1783
1784         iOS <attachment> element should allow customization of action text color
1785         https://bugs.webkit.org/show_bug.cgi?id=155513
1786         <rdar://problem/24805991>
1787
1788         Reviewed by Simon Fraser.
1789
1790         Test: fast/attachment/attachment-action.html
1791
1792         * css/html.css:
1793         (attachment):
1794         On iOS (the only place it is used), <attachment> color should default to system blue.
1795
1796         * rendering/RenderThemeIOS.mm:
1797         (WebCore::attachmentActionColor):
1798         (WebCore::AttachmentInfo::AttachmentInfo):
1799         Make use of the <attachment>'s CSS color for the action text.
1800         This is a little weird because there are multiple bits of text in an
1801         <attachment>, but only the action text ever changes color.
1802
1803 2016-03-15  Zalan Bujtas  <zalan@apple.com>
1804
1805         Delay HTMLFormControlElement::focus() call until after layout is finished.
1806         https://bugs.webkit.org/show_bug.cgi?id=155503
1807         <rdar://problem/24046635>
1808
1809         Reviewed by Simon Fraser.
1810
1811         Calling focus on a form element can trigger arbitrary JS code which could interfere with
1812         the ongoing layout. 
1813         This patch delays HTMLFormControlElement::focus() call until after layout is finished.
1814         If we are currently not in the middle of a layout, HTMLFormControlElement::focus() is delayed until
1815         after style resolution is done. 
1816
1817         Covered by LayoutTests/fast/dom/adopt-node-crash-2.html
1818
1819         * accessibility/AccessibilityObject.cpp:
1820         (WebCore::AccessibilityObject::updateBackingStore):
1821         * dom/Document.cpp:
1822         (WebCore::Document::updateStyleIfNeeded):
1823         (WebCore::Document::updateLayout):
1824         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1825         * html/HTMLEmbedElement.cpp:
1826         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin):
1827         * html/HTMLFormControlElement.cpp:
1828         (WebCore::HTMLFormControlElement::didAttachRenderers):
1829         * page/FrameView.cpp:
1830         (WebCore::FrameView::layout):
1831         (WebCore::FrameView::queuePostLayoutCallback):
1832         (WebCore::FrameView::flushPostLayoutTasksQueue):
1833         (WebCore::FrameView::performPostLayoutTasks):
1834         (WebCore::FrameView::sendResizeEventIfNeeded):
1835         * page/FrameView.h:
1836         * rendering/RenderBox.cpp:
1837         (WebCore::RenderBox::imageChanged):
1838         * rendering/RenderLayer.cpp:
1839         (WebCore::RenderLayer::scrollTo):
1840
1841 2016-03-15  Oliver Hunt  <oliver@apple.com>
1842
1843         Remove compile time define for SEPARATED_HEAP
1844         https://bugs.webkit.org/show_bug.cgi?id=155508
1845
1846         Reviewed by Mark Lam.
1847
1848         Remove the feature define.
1849
1850         * Configurations/FeatureDefines.xcconfig:
1851
1852 2016-03-15  Chris Dumez  <cdumez@apple.com>
1853
1854         Restore pre-r197244 behavior on Mac
1855         https://bugs.webkit.org/show_bug.cgi?id=155507
1856         <rdar://problem/25174132>
1857
1858         Reviewed by Gavin Barraclough.
1859
1860         <http://trac.webkit.org/changeset/197244> changed the session restore
1861         behavior to disallow stale content on all platforms except iOS.
1862         We would also like to maintain the behavior on Mac for performance
1863         reasons and consistency between iOS and Mac.
1864
1865         * loader/FrameLoader.cpp:
1866         (WebCore::FrameLoader::loadDifferentDocumentItem):
1867
1868 2016-03-15  Tim Horton  <timothy_horton@apple.com>
1869
1870         <attachment> on iOS isn't quite vertically centered
1871         https://bugs.webkit.org/show_bug.cgi?id=155502
1872         <rdar://problem/24805991>
1873
1874         Reviewed by Beth Dakin.
1875
1876         No new tests; there are existing tests that will be enabled shortly.
1877
1878         * rendering/RenderThemeIOS.mm:
1879         (WebCore::AttachmentInfo::AttachmentInfo):
1880         We were overcounting the total height of the attachment content by one margin, because each item
1881         would add in its margin, including the last one. Remove one margin.
1882
1883 2016-03-15  Chris Fleizach  <cfleizach@apple.com>
1884
1885         AX: certain elements not included in accessibility tree
1886         https://bugs.webkit.org/show_bug.cgi?id=155480
1887
1888         Reviewed by Beth Dakin.
1889
1890         This test case exposed a hole in the nextSibling logic where you can get into a state where we skip content.
1891         The fix is to check if an inline element continuation has no sibling, to fall back on to the parent case to see if that has a sibling.
1892
1893         Test: accessibility/double-nested-inline-element-missing-from-tree.html
1894
1895         * accessibility/AccessibilityRenderObject.cpp:
1896         (WebCore::AccessibilityRenderObject::nextSibling):
1897
1898 2016-03-15  Chris Dumez  <cdumez@apple.com>
1899
1900         Unreviewed, rolling out r198203.
1901
1902         Favorites view is no longer loading on iOS
1903
1904         Reverted changeset:
1905
1906         "URL Parsing should signal failure for illegal IDN"
1907         https://bugs.webkit.org/show_bug.cgi?id=154945
1908         http://trac.webkit.org/changeset/198203
1909
1910 2016-03-15  Tim Horton  <timothy_horton@apple.com>
1911
1912         <attachment> on iOS should use short and emphasized fonts
1913         https://bugs.webkit.org/show_bug.cgi?id=155485
1914         <rdar://problem/24805991>
1915
1916         Reviewed by Simon Fraser.
1917
1918         No new tests; there are existing tests that will be enabled shortly.
1919
1920         * rendering/RenderThemeIOS.mm:
1921         (WebCore::attachmentActionFont):
1922         (WebCore::attachmentTitleFont):
1923         (WebCore::attachmentSubtitleFont):
1924         (WebCore::AttachmentInfo::buildTitleLines):
1925         (WebCore::AttachmentInfo::buildSingleLine):
1926         (WebCore::AttachmentInfo::AttachmentInfo):
1927         No need for UIFonts, we can use CoreText, and that allows us to ask for the
1928         correct Short and Emphasized variants that we need.
1929
1930 2016-03-15  Antti Koivisto  <antti@apple.com>
1931
1932         REGRESSION (196383): Class change invalidation does not handle :not correctly
1933         https://bugs.webkit.org/show_bug.cgi?id=155493
1934         <rdar://problem/24846762>
1935
1936         Reviewed by Andreas Kling.
1937
1938         We fail to invalidate bar style in
1939
1940             :not(.foo) bar { }
1941
1942         when class foo is added or removed.
1943
1944         There is a logic error in the invalidation code. It assumes that class addition can only make new selectors match
1945         and removal make them not match. This is not true when :not is present.
1946
1947         * style/AttributeChangeInvalidation.h:
1948         (WebCore::Style::AttributeChangeInvalidation::AttributeChangeInvalidation):
1949         * style/ClassChangeInvalidation.cpp:
1950         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
1951
1952             Invalidate style and collect full set of rules that may affect descendant style.
1953
1954         (WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle):
1955
1956             Invalidate with this set both before and after committing the changes.
1957
1958         (WebCore::Style::ClassChangeInvalidation::computeClassChange): Deleted.
1959         * style/ClassChangeInvalidation.h:
1960         (WebCore::Style::ClassChangeInvalidation::ClassChangeInvalidation):
1961         (WebCore::Style::ClassChangeInvalidation::~ClassChangeInvalidation):
1962
1963 2016-03-14  Jer Noble  <jer.noble@apple.com>
1964
1965         Video elements with autoplay do not begin playing when scrolling into view if InvisibleAutoplayNotPermitted is set.
1966         https://bugs.webkit.org/show_bug.cgi?id=155468
1967
1968         Reviewed by Eric Carlson.
1969
1970         Test: media/video-restricted-invisible-autoplay-allowed-when-visible.html
1971
1972         A few bugs came together to cause this behavior. We were not telling the media session that we were going to begin
1973         the autoplaying state, we were not restoring the correct state when the interruption ended, and we were not checking
1974         to see if we could actually play correctly when the interruption ended.
1975
1976         * html/HTMLMediaElement.cpp:
1977         (WebCore::HTMLMediaElement::prepareForLoad):
1978         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
1979         (WebCore::HTMLMediaElement::setReadyState):
1980         (WebCore::HTMLMediaElement::resumeAutoplaying):
1981         (WebCore::HTMLMediaElement::updateShouldPlay):
1982         (WebCore::elementCanTransitionFromAutoplayToPlay): Deleted.
1983         * html/HTMLMediaElement.h:
1984         * platform/audio/PlatformMediaSession.cpp:
1985         (WebCore::PlatformMediaSession::endInterruption):
1986
1987 2016-03-15  Manuel Rego Casasnovas  <rego@igalia.com>
1988
1989         [css-grid] Rename GridCoordinate to GridArea
1990         https://bugs.webkit.org/show_bug.cgi?id=155489
1991
1992         Reviewed by Sergio Villar Senin.
1993
1994         As the comment in GridCoordinate states,
1995         it actually represents a grid area as it stores
1996         the initial and final positions in both axis (columns and rows).
1997
1998         Someone can think about a grid coordinate just like a single cell.
1999         However this class was representing an area of several cells.
2000
2001         On top of that the "grid area" concept is defined in the spec:
2002         https://drafts.csswg.org/css-grid/#grid-area-concept
2003
2004         No new tests, no change of behavior.
2005
2006         * WebCore.xcodeproj/project.pbxproj:
2007         * css/CSSGridTemplateAreasValue.cpp:
2008         (WebCore::stringForPosition):
2009         * css/CSSGridTemplateAreasValue.h:
2010         * css/CSSParser.cpp:
2011         (WebCore::CSSParser::parseGridTemplateAreasRow):
2012         * css/CSSParser.h:
2013         * rendering/RenderGrid.cpp:
2014         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
2015         (WebCore::RenderGrid::insertItemIntoGrid):
2016         (WebCore::RenderGrid::placeItemsOnGrid):
2017         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2018         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
2019         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2020         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2021         (WebCore::RenderGrid::clearGrid):
2022         (WebCore::RenderGrid::cachedGridArea):
2023         (WebCore::RenderGrid::cachedGridSpan):
2024         * rendering/RenderGrid.h:
2025         * rendering/style/GridArea.h: Renamed from Source/WebCore/rendering/style/GridCoordinate.h.
2026         (WebCore::GridSpan::untranslatedDefiniteGridSpan):
2027         (WebCore::GridSpan::translatedDefiniteGridSpan):
2028         (WebCore::GridSpan::indefiniteGridSpan):
2029         (WebCore::GridSpan::operator==):
2030         (WebCore::GridSpan::integerSpan):
2031         (WebCore::GridSpan::untranslatedResolvedInitialPosition):
2032         (WebCore::GridSpan::untranslatedResolvedFinalPosition):
2033         (WebCore::GridSpan::resolvedInitialPosition):
2034         (WebCore::GridSpan::resolvedFinalPosition):
2035         (WebCore::GridSpan::GridSpanIterator::GridSpanIterator):
2036         (WebCore::GridSpan::GridSpanIterator::operator unsigned&):
2037         (WebCore::GridSpan::GridSpanIterator::operator*):
2038         (WebCore::GridSpan::begin):
2039         (WebCore::GridSpan::end):
2040         (WebCore::GridSpan::isTranslatedDefinite):
2041         (WebCore::GridSpan::isIndefinite):
2042         (WebCore::GridSpan::translate):
2043         (WebCore::GridSpan::GridSpan):
2044         (WebCore::GridArea::GridArea):
2045         (WebCore::GridArea::operator==):
2046         (WebCore::GridArea::operator!=):
2047         * rendering/style/GridPositionsResolver.cpp:
2048         * rendering/style/StyleGridData.h:
2049
2050 2016-03-15  Joonghun Park  <jh718.park@samsung.com>
2051
2052         [GTK] Remove duplicate HashMap traversal and unneeded reference count churn in DataObjectGtk::forClipboard
2053         https://bugs.webkit.org/show_bug.cgi?id=155470
2054
2055         Reviewed by Carlos Garcia Campos.
2056
2057         No new tests, no new behaviours.
2058
2059         * platform/gtk/DataObjectGtk.cpp:
2060         (WebCore::DataObjectGtk::forClipboard):
2061
2062 2016-03-15  Manuel Rego Casasnovas  <rego@igalia.com>
2063
2064         [css-grid] Rename GridResolvedPosition to GridPositionsResolver
2065         https://bugs.webkit.org/show_bug.cgi?id=155486
2066
2067         Reviewed by Sergio Villar Senin.
2068
2069         GridResolvedPosition is not storing a position (track or line) anymore.
2070         Currently it's just a class wrapping the methods to resolve
2071         grid positions from style.
2072         Renamed the class to avoid confusions.
2073
2074         No new tests, no change of behavior.
2075
2076         * CMakeLists.txt:
2077         * WebCore.xcodeproj/project.pbxproj:
2078         * rendering/RenderGrid.cpp:
2079         (WebCore::RenderGrid::placeItemsOnGrid):
2080         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2081         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
2082         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2083         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2084         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2085         * rendering/RenderGrid.h:
2086         * rendering/style/GridCoordinate.h:
2087         * rendering/style/GridPositionsResolver.cpp: Renamed from Source/WebCore/rendering/style/GridResolvedPosition.cpp.
2088         (WebCore::isColumnSide):
2089         (WebCore::isStartSide):
2090         (WebCore::initialPositionSide):
2091         (WebCore::finalPositionSide):
2092         (WebCore::gridLinesForSide):
2093         (WebCore::implicitNamedGridLineForSide):
2094         (WebCore::GridPositionsResolver::isNonExistentNamedLineOrArea):
2095         (WebCore::adjustGridPositionsFromStyle):
2096         (WebCore::GridPositionsResolver::explicitGridColumnCount):
2097         (WebCore::GridPositionsResolver::explicitGridRowCount):
2098         (WebCore::explicitGridSizeForSide):
2099         (WebCore::lookAheadForNamedGridLine):
2100         (WebCore::lookBackForNamedGridLine):
2101         (WebCore::resolveNamedGridLinePositionFromStyle):
2102         (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
2103         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
2104         (WebCore::resolveGridPositionAgainstOppositePosition):
2105         (WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem):
2106         (WebCore::resolveGridPositionFromStyle):
2107         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
2108         * rendering/style/GridPositionsResolver.h: Renamed from Source/WebCore/rendering/style/GridResolvedPosition.h.
2109         * rendering/style/StyleAllInOne.cpp:
2110
2111 2016-03-15  Miguel Gomez  <magomez@igalia.com>
2112
2113         Leak: Accelerated ImageBufferCairo doesn't destroy the used textures
2114         https://bugs.webkit.org/show_bug.cgi?id=155431
2115
2116         Reviewed by Žan Doberšek.
2117
2118         When using the Cairo backend, add a destructor to ImageBufferData and use it to destroy the
2119         textures created if the buffer is being accelerated.
2120
2121         No new tests, already covered by existing ones.
2122
2123         * platform/graphics/cairo/ImageBufferCairo.cpp:
2124         (WebCore::ImageBufferData::ImageBufferData):
2125         Store the renderingMode flag.
2126         (WebCore::ImageBufferData::~ImageBufferData):
2127         Destroy gl resources if renderingMode is accelerated.
2128         (WebCore::ImageBuffer::ImageBuffer):
2129         Pass renderingMode to the data class and use it fro checks instead of the function parameter.
2130         * platform/graphics/cairo/ImageBufferDataCairo.h:
2131         Add destructor and a renderingMode flag.
2132
2133 2016-03-15  Jiewen Tan  <jiewen_tan@apple.com>
2134
2135         URL Parsing should signal failure for illegal IDN
2136         https://bugs.webkit.org/show_bug.cgi?id=154945
2137         <rdar://problem/8014795>
2138
2139         Reviewed by Brent Fulgham.
2140
2141         WebCore::URL will now invalidate URLs with illegal IDN. And functions inside WebCoreNSURLExtras.h
2142         that deal with IDN mapping will now return nil to signal error.
2143
2144         Test: fast/url/invalid-idn.html
2145
2146         * platform/URL.cpp:
2147         (WebCore::isSchemeFirstChar):
2148         (WebCore::URL::init):
2149         (WebCore::appendEncodedHostname):
2150         (WebCore::encodeHostnames):
2151         (WebCore::encodeRelativeString):
2152         * platform/mac/WebCoreNSURLExtras.h:
2153         * platform/mac/WebCoreNSURLExtras.mm:
2154         (WebCore::mapHostNameWithRange):
2155         (WebCore::hostNameNeedsDecodingWithRange):
2156         (WebCore::hostNameNeedsEncodingWithRange):
2157         (WebCore::decodeHostNameWithRange):
2158         (WebCore::encodeHostNameWithRange):
2159         (WebCore::decodeHostName):
2160         (WebCore::encodeHostName):
2161         (WebCore::collectRangesThatNeedMapping):
2162         (WebCore::mapHostNames):
2163         (WebCore::URLWithData):
2164         (WebCore::dataWithUserTypedString):
2165         (WebCore::URLWithUserTypedString):
2166         (WebCore::URLWithUserTypedStringDeprecated):
2167         (WebCore::userVisibleString):
2168
2169 2016-03-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2170
2171         REGRESSION (r197724): [GTK] Web Inspector: Images being blocked by CSP 2.0
2172         https://bugs.webkit.org/show_bug.cgi?id=155432
2173
2174         Reviewed by Darin Adler.
2175
2176         The GTK+ port Web Inspector uses GResources for all internal
2177         resources (images, fonts, scripts, etc.) that are now blocked by
2178         the CSP. GResouces are like data URLs in practice, so we should
2179         always allow them.
2180
2181         * page/csp/ContentSecurityPolicySourceList.cpp:
2182         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar):
2183
2184 2016-03-14  Alex Christensen  <achristensen@webkit.org>
2185
2186         Fix WinCairo build after r198195.
2187
2188         * platform/network/NetworkingContext.h:
2189         curl networking now uses NetworkingContext::storageSession.  That's everybody!
2190
2191 2016-03-14  Per Arne Vollan  <peavo@outlook.com>
2192
2193         [WinCairo] Compile fix.
2194         https://bugs.webkit.org/show_bug.cgi?id=155463
2195
2196         Reviewed by Alex Christensen.
2197
2198         Get the NetworkStorageSession object from the document in the same way as other platforms do.
2199
2200         * loader/CookieJar.cpp:
2201         (WebCore::storageSession):
2202
2203 2016-03-14  Tim Horton  <timothy_horton@apple.com>
2204
2205         <attachment> on iOS should paint its progress indicator instead of a green square
2206         https://bugs.webkit.org/show_bug.cgi?id=155482
2207         <rdar://problem/24805991>
2208
2209         Reviewed by Simon Fraser.
2210
2211         No new tests; there are existing tests that will be enabled shortly.
2212
2213         * rendering/RenderThemeIOS.mm:
2214         (WebCore::getAttachmentProgress):
2215         Clamp progress to 0-1.
2216
2217         (WebCore::paintAttachmentProgress):
2218         Paint a pie.
2219
2220 2016-03-14  Chris Dumez  <cdumez@apple.com>
2221
2222         Unreviewed, rolling out r197981.
2223
2224         Caused a massive PLT regression on Mac.
2225
2226         Reverted changeset:
2227
2228         "Font antialiasing (smoothing) changes when elements are
2229         rendered into compositing layers"
2230         https://bugs.webkit.org/show_bug.cgi?id=23364
2231         http://trac.webkit.org/changeset/197981
2232
2233 2016-03-14  Chris Dumez  <cdumez@apple.com>
2234
2235         Unreviewed, rolling out r198145.
2236
2237         This attempt to disable the feature did not fix the PLT
2238         regression
2239
2240         Reverted changeset:
2241
2242         "Regression(r197981): Huge regression on Mac PLT"
2243         https://bugs.webkit.org/show_bug.cgi?id=155443
2244         http://trac.webkit.org/changeset/198145
2245
2246 2016-03-14  Sam Weinig  <sam@webkit.org>
2247
2248         Remove errant space.
2249
2250         * page/UserContentController.cpp:
2251
2252 2016-03-14  Sam Weinig  <sam@webkit.org>
2253
2254         Fix the windows build.
2255
2256         * page/UserContentController.cpp:
2257
2258 2016-03-14  Sam Weinig  <sam@webkit.org>
2259
2260         Add a baseURL parameter to _WKUserStyleSheet
2261         https://bugs.webkit.org/show_bug.cgi?id=155219
2262
2263         Reviewed by Tim Horton.
2264
2265         - Moves to a model for user content where instead of each page having a WebCore::UserContentController
2266           object, we have an abstract WebCore::UserContentProvider interface that can be implemented at the WebKit
2267           level. For now, legacy WebKit continues to use the old UserContentController, which implements 
2268           WebCore::UserContentProvider, and WebKit2 implements its own implementation so it can store additional
2269           state.
2270
2271         * WebCore.xcodeproj/project.pbxproj:
2272         Add new files.
2273
2274         * dom/ExtensionStyleSheets.cpp:
2275         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
2276         Switch to using forEachUserStyleSheet on the UserContentProvider.
2277
2278         * html/HTMLMediaElement.cpp:
2279         (WebCore::HTMLMediaElement::loadResource):
2280         Remove null check now that we always have a UserContentProvider.
2281
2282         * loader/EmptyClients.cpp:
2283         (WebCore::fillWithEmptyClients):
2284         * loader/EmptyClients.h:
2285         Add new EmptyClients.
2286
2287         * loader/FrameLoader.cpp:
2288         (WebCore::FrameLoader::loadResourceSynchronously):
2289         Remove null check now that we always have a UserContentProvider.
2290
2291         * loader/PingLoader.cpp:
2292         (WebCore::processContentExtensionRulesForLoad):
2293         Remove null check now that we always have a UserContentProvider.
2294
2295         * loader/ResourceLoader.cpp:
2296         (WebCore::ResourceLoader::willSendRequestInternal):
2297         Remove null check now that we always have a UserContentProvider.
2298
2299         * loader/cache/CachedResourceLoader.cpp:
2300         (WebCore::CachedResourceLoader::requestResource):
2301         Remove null check now that we always have a UserContentProvider.
2302
2303         * page/DOMWindow.cpp:
2304         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
2305         Remove null checks now that we always have a UserContentProvider, and userMessageHandlerDescriptors
2306         returns a reference.
2307
2308         (WebCore::DOMWindow::open):
2309         Remove null check now that we always have a UserContentProvider.
2310
2311         * page/Frame.cpp:
2312         (WebCore::Frame::injectUserScripts):
2313         Simplify by lifting document check out of the main loop and using forEachUserScript.
2314
2315         * page/Page.cpp:
2316         (WebCore::Page::Page):
2317         (WebCore::Page::~Page):
2318         (WebCore::Page::userContentProvider):
2319         (WebCore::Page::setUserContentProvider):
2320         (WebCore::Page::setUserContentController): Deleted.
2321         * page/Page.h:
2322         (WebCore::Page::userContentController): Deleted.
2323         * page/PageConfiguration.h:
2324         Store the UserContentProvider in a Ref, and require PageConfigurations to provide one. This
2325         removes a bunch of null checks and simplifies the code.
2326
2327         * page/UserContentController.cpp:
2328         (WebCore::UserContentController::~UserContentController):
2329         (WebCore::UserContentController::forEachUserScript):
2330         (WebCore::UserContentController::forEachUserStyleSheet):
2331         (WebCore::UserContentController::addUserScript):
2332         (WebCore::UserContentController::removeUserScript):
2333         (WebCore::UserContentController::removeUserScripts):
2334         (WebCore::UserContentController::addUserStyleSheet):
2335         (WebCore::UserContentController::removeUserStyleSheet):
2336         (WebCore::UserContentController::removeUserStyleSheets):
2337         (WebCore::UserContentController::addUserMessageHandlerDescriptor):
2338         (WebCore::UserContentController::removeUserMessageHandlerDescriptor):
2339         (WebCore::UserContentController::addUserContentExtension):
2340         (WebCore::UserContentController::removeUserContentExtension):
2341         (WebCore::UserContentController::removeAllUserContentExtensions):
2342         (WebCore::UserContentController::removeAllUserContent):
2343         (WebCore::UserContentController::addPage): Deleted.
2344         (WebCore::UserContentController::removePage): Deleted.
2345         (WebCore::contentExtensionsEnabled): Deleted.
2346         (WebCore::UserContentController::processContentExtensionRulesForLoad): Deleted.
2347         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
2348         * page/UserContentController.h:
2349         (WebCore::UserContentController::userScripts): Deleted.
2350         (WebCore::UserContentController::userStyleSheets): Deleted.
2351         (WebCore::UserContentController::userMessageHandlerDescriptors): Deleted.
2352         Add inheritance from UserContentProvider and simplify things by removing unique_ptrs
2353         that were holding the member variables. There is usually only one UserContentController
2354         so having these in unique_ptrs doesn't make much sense.
2355         
2356         * page/UserContentProvider.cpp: Added.
2357         (WebCore::UserContentProvider::UserContentProvider):
2358         (WebCore::UserContentProvider::~UserContentProvider):
2359         (WebCore::UserContentProvider::addPage):
2360         (WebCore::UserContentProvider::removePage):
2361         (WebCore::UserContentProvider::invalidateInjectedStyleSheetCacheInAllFramesInAllPages):
2362         (WebCore::contentExtensionsEnabled):
2363         (WebCore::UserContentProvider::processContentExtensionRulesForLoad):
2364         (WebCore::UserContentProvider::actionsForResourceLoad):
2365         * page/UserContentProvider.h: Added.
2366         Add abstract class for providing user content and add some helpers on it.
2367
2368         * page/UserMessageHandlerDescriptor.h:
2369         (WebCore::UserMessageHandlerDescriptor::create):
2370         (WebCore::UserMessageHandlerDescriptor::client):
2371         (WebCore::UserMessageHandlerDescriptor::invalidateClient):
2372         * page/UserMessageHandlersNamespace.cpp:
2373         (WebCore::UserMessageHandlersNamespace::handler):
2374         Simplify now that userContentProvider() and userMessageHandlerDescriptors() are references.
2375
2376 2016-03-14  Enrica Casucci  <enrica@apple.com>
2377
2378         iOS: RTFD format is not available in the pasteboard after copy/cut.
2379         https://bugs.webkit.org/show_bug.cgi?id=155477
2380         rdar://problem/23500600
2381
2382         Reviewed by Tim Horton.
2383
2384         WebKit is using UTTypeRTFD instead of UTTypeFlatRTFD that is the
2385         proper RTFD format for pastedboard. I also discovered that, when
2386         we create the NSTextAttachment in the NSAttributedString we produce
2387         from the DOM range, we are not generating a file name with the
2388         appropriate extension for the MIME type. The iOS specific implementation
2389         of the MIMETypeRegistry functions were empty.
2390         There is no need to have a differentiation between OS X and iOS, so
2391         we now have only one file called MIMETypeRegistryCocoa.mm.
2392
2393         * WebCore.xcodeproj/project.pbxproj:
2394         * platform/cocoa/MIMETypeRegistryCocoa.mm: Added.
2395         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
2396         (WebCore::MIMETypeRegistry::getExtensionsForMIMEType):
2397         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
2398         (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
2399         * platform/ios/MIMETypeRegistryIOS.mm: Removed.
2400         * platform/ios/PasteboardIOS.mm:
2401         (WebCore::Pasteboard::read):
2402         (WebCore::Pasteboard::supportedPasteboardTypes):
2403         (WebCore::Pasteboard::hasData):
2404         * platform/ios/PlatformPasteboardIOS.mm:
2405         (WebCore::PlatformPasteboard::write):
2406         * platform/mac/MIMETypeRegistryMac.mm: Removed.
2407
2408 2016-03-14  Daniel Bates  <dabates@apple.com>
2409
2410         Web Inspector: Display Content Security Policy hash in details sidebar for script and style elements
2411         https://bugs.webkit.org/show_bug.cgi?id=155466
2412         <rdar://problem/25152480>
2413
2414         Reviewed by Joseph Pecoraro and Timothy Hatcher.
2415
2416         For convenience, display the SHA-256 Content Security Policy (CSP) hash in the node details
2417         sidebar for the selected HTML script element or HTML style element. A CSP script hash is
2418         only applicable to inline JavaScript scripts. Therefore, we will display a hash for HTML
2419         script elements only if they do not have a src attribute.
2420
2421         Tests: inspector/dom/csp-big5-hash.html
2422                inspector/dom/csp-hash.html
2423
2424         * inspector/InspectorDOMAgent.cpp:
2425         (WebCore::computeContentSecurityPolicySHA256Hash): Added.
2426         (WebCore::InspectorDOMAgent::buildObjectForNode): For an applicable HTML script- or style-
2427         element, pass the computed SHA-256 CSP hash to the Inspector front end.
2428
2429 2016-03-14  Joonghun Park  <jh718.park@samsung.com>
2430
2431         Purge PassRefPtr from ArrayBuffer, ArchiveResource, Pasteboard, LegacyWebArchive and DataObjectGtk
2432         https://bugs.webkit.org/show_bug.cgi?id=150497
2433
2434         Reviewed by Darin Adler.
2435
2436         No new tests, no new behaviours.
2437
2438         * Modules/indexeddb/IDBGetResult.h:
2439         (WebCore::IDBGetResult::IDBGetResult):
2440         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2441         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2442         * Modules/mediastream/RTCDataChannel.cpp:
2443         (WebCore::RTCDataChannel::didReceiveRawData):
2444         * dom/MessageEvent.cpp:
2445         (WebCore::MessageEvent::MessageEvent):
2446         * dom/MessageEvent.h:
2447         * editing/Editor.cpp:
2448         (WebCore::Editor::selectedRange):
2449         * editing/Editor.h:
2450         * editing/FrameSelection.h:
2451         (WebCore::FrameSelection::toNormalizedRange):
2452         * editing/VisiblePosition.cpp:
2453         (WebCore::makeRange):
2454         * editing/VisiblePosition.h:
2455         * editing/VisibleSelection.cpp:
2456         (WebCore::VisibleSelection::toNormalizedRange):
2457         * editing/VisibleSelection.h:
2458         * editing/VisibleUnits.cpp:
2459         (WebCore::enclosingTextUnitOfGranularity):
2460         (WebCore::wordRangeFromPosition):
2461         (WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary):
2462         (WebCore::rangeExpandedAroundPositionByCharacters):
2463         * editing/VisibleUnits.h:
2464         * editing/cocoa/HTMLConverter.mm:
2465         (HTMLConverter::_addAttachmentForElement):
2466         (fileWrapperForURL):
2467         * editing/efl/EditorEfl.cpp:
2468         (WebCore::Editor::webContentFromPasteboard):
2469         * editing/gtk/EditorGtk.cpp:
2470         (WebCore::createFragmentFromPasteboardData):
2471         (WebCore::Editor::webContentFromPasteboard):
2472         * editing/ios/EditorIOS.mm:
2473         (WebCore::dataInRTFDFormat):
2474         (WebCore::dataInRTFFormat):
2475         (WebCore::Editor::selectionInWebArchiveFormat):
2476         (WebCore::Editor::WebContentReader::addFragment):
2477         (WebCore::Editor::WebContentReader::readWebArchive):
2478         (WebCore::Editor::WebContentReader::readRTFD):
2479         (WebCore::Editor::WebContentReader::readRTF):
2480         (WebCore::Editor::WebContentReader::readImage):
2481         (WebCore::Editor::WebContentReader::readURL):
2482         (WebCore::Editor::webContentFromPasteboard):
2483         (WebCore::Editor::pasteWithPasteboard):
2484         (WebCore::Editor::createFragmentAndAddResources):
2485         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
2486         * editing/mac/EditorMac.mm:
2487         (WebCore::Editor::selectionInWebArchiveFormat):
2488         (WebCore::Editor::adjustedSelectionRange):
2489         (WebCore::dataInRTFDFormat):
2490         (WebCore::dataInRTFFormat):
2491         (WebCore::Editor::dataSelectionForPasteboard):
2492         (WebCore::Editor::WebContentReader::readWebArchive):
2493         (WebCore::Editor::WebContentReader::readRTFD):
2494         (WebCore::Editor::WebContentReader::readRTF):
2495         (WebCore::Editor::WebContentReader::readImage):
2496         (WebCore::Editor::WebContentReader::readURL):
2497         (WebCore::Editor::webContentFromPasteboard):
2498         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
2499         (WebCore::Editor::createFragmentAndAddResources):
2500         * editing/win/EditorWin.cpp:
2501         (WebCore::createFragmentFromPlatformData):
2502         (WebCore::Editor::webContentFromPasteboard):
2503         * inspector/InspectorPageAgent.cpp:
2504         (WebCore::InspectorPageAgent::archive):
2505         * loader/DocumentLoader.cpp:
2506         (WebCore::DocumentLoader::mainResourceData):
2507         (WebCore::DocumentLoader::maybeCreateArchive):
2508         (WebCore::DocumentLoader::addArchiveResource):
2509         (WebCore::DocumentLoader::mainResource):
2510         * loader/DocumentLoader.h:
2511         * loader/FrameLoader.cpp:
2512         (WebCore::FrameLoader::loadArchive):
2513         * loader/SubstituteData.h:
2514         (WebCore::SubstituteData::SubstituteData):
2515         (WebCore::SubstituteData::isValid):
2516         * loader/SubstituteResource.h:
2517         (WebCore::SubstituteResource::data):
2518         (WebCore::SubstituteResource::SubstituteResource):
2519         * loader/appcache/ApplicationCacheGroup.cpp:
2520         (WebCore::ApplicationCacheGroup::didReceiveResponse):
2521         (WebCore::ApplicationCacheGroup::didReceiveData):
2522         (WebCore::ApplicationCacheGroup::didFail):
2523         (WebCore::ApplicationCacheGroup::didReceiveManifestData):
2524         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
2525         * loader/appcache/ApplicationCacheHost.cpp:
2526         (WebCore::ApplicationCacheHost::maybeLoadMainResource):
2527         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
2528         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
2529         * loader/appcache/ApplicationCacheResource.cpp:
2530         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
2531         (WebCore::ApplicationCacheResource::deliver):
2532         (WebCore::ApplicationCacheResource::estimatedSizeInStorage):
2533         * loader/appcache/ApplicationCacheResource.h:
2534         (WebCore::ApplicationCacheResource::create):
2535         * loader/appcache/ApplicationCacheStorage.cpp:
2536         (WebCore::ApplicationCacheStorage::store):
2537         (WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
2538         * loader/appcache/ApplicationCacheStorage.h:
2539         * loader/archive/ArchiveFactory.cpp:
2540         (WebCore::archiveFactoryCreate):
2541         (WebCore::ArchiveFactory::create):
2542         * loader/archive/ArchiveFactory.h:
2543         * loader/archive/ArchiveResource.cpp:
2544         (WebCore::ArchiveResource::ArchiveResource):
2545         (WebCore::ArchiveResource::create):
2546         * loader/archive/ArchiveResource.h:
2547         * loader/archive/ArchiveResourceCollection.cpp:
2548         (WebCore::ArchiveResourceCollection::addResource):
2549         * loader/archive/ArchiveResourceCollection.h:
2550         * loader/archive/cf/LegacyWebArchive.cpp:
2551         (WebCore::LegacyWebArchive::createPropertyListRepresentation):
2552         (WebCore::LegacyWebArchive::createResource):
2553         (WebCore::LegacyWebArchive::create):
2554         (WebCore::LegacyWebArchive::createFromSelection):
2555         * loader/archive/cf/LegacyWebArchive.h:
2556         * loader/archive/mhtml/MHTMLArchive.cpp:
2557         (WebCore::MHTMLArchive::create):
2558         * loader/archive/mhtml/MHTMLArchive.h:
2559         * loader/archive/mhtml/MHTMLParser.cpp:
2560         (WebCore::MHTMLParser::parseArchive):
2561         (WebCore::MHTMLParser::parseArchiveWithHeader):
2562         (WebCore::MHTMLParser::parseNextPart):
2563         * loader/archive/mhtml/MHTMLParser.h:
2564         * loader/cache/CachedImage.cpp:
2565         (WebCore::CachedImage::didAddClient):
2566         * loader/icon/IconDatabase.cpp:
2567         (WebCore::loadDefaultIconRecord):
2568         * loader/icon/IconRecord.cpp:
2569         (WebCore::IconRecord::setImageData):
2570         * loader/icon/IconRecord.h:
2571         * platform/Pasteboard.h:
2572         * platform/PasteboardStrategy.h:
2573         * platform/PlatformPasteboard.h:
2574         * platform/SharedBuffer.cpp:
2575         (WebCore::SharedBuffer::createArrayBuffer):
2576         (WebCore::utf8Buffer):
2577         * platform/SharedBuffer.h:
2578         (WebCore::SharedBuffer::create):
2579         * platform/cf/SharedBufferCF.cpp:
2580         (WebCore::SharedBuffer::wrapCFData):
2581         * platform/cocoa/NetworkExtensionContentFilter.mm:
2582         (WebCore::NetworkExtensionContentFilter::replacementData):
2583         * platform/cocoa/ParentalControlsContentFilter.mm:
2584         (WebCore::ParentalControlsContentFilter::replacementData):
2585         * platform/graphics/Image.cpp:
2586         (WebCore::Image::setData):
2587         * platform/graphics/Image.h:
2588         * platform/gtk/DataObjectGtk.cpp:
2589         (WebCore::DataObjectGtk::forClipboard):
2590         * platform/gtk/DataObjectGtk.h:
2591         (WebCore::DataObjectGtk::create):
2592         * platform/gtk/PasteboardGtk.cpp:
2593         (WebCore::Pasteboard::Pasteboard):
2594         (WebCore::Pasteboard::dataObject):
2595         * platform/ios/PasteboardIOS.mm:
2596         (WebCore::Pasteboard::read):
2597         * platform/ios/PlatformPasteboardIOS.mm:
2598         (WebCore::PlatformPasteboard::bufferForType):
2599         (WebCore::PlatformPasteboard::readBuffer):
2600         * platform/mac/PasteboardMac.mm:
2601         (WebCore::writeFileWrapperAsRTFDAttachment):
2602         (WebCore::Pasteboard::read):
2603         * platform/mac/PlatformPasteboardMac.mm:
2604         (WebCore::PlatformPasteboard::bufferForType):
2605         * platform/mac/SharedBufferMac.mm:
2606         (WebCore::SharedBuffer::wrapNSData):
2607         (WebCore::SharedBuffer::createFromReadingFile):
2608         * platform/network/MIMEHeader.cpp:
2609         (WebCore::retrieveKeyValuePairs):
2610         (WebCore::MIMEHeader::parseHeader):
2611         * platform/network/MIMEHeader.h:
2612         * platform/soup/SharedBufferSoup.cpp:
2613         (WebCore::SharedBuffer::wrapSoupBuffer):
2614         * platform/win/ClipboardUtilitiesWin.cpp:
2615         (WebCore::fragmentFromFilenames):
2616         (WebCore::fragmentFromCFHTML):
2617         (WebCore::fragmentFromHTML):
2618         * platform/win/ClipboardUtilitiesWin.h:
2619         * platform/win/PasteboardWin.cpp:
2620         (WebCore::Pasteboard::documentFragment):
2621
2622 2016-03-14  Oliver Hunt  <oliver@apple.com>
2623
2624         Temporarily disable the separated heap.
2625         https://bugs.webkit.org/show_bug.cgi?id=155472
2626
2627         Reviewed by Geoffrey Garen.
2628
2629         Temporarily disable this.
2630
2631         * Configurations/FeatureDefines.xcconfig:
2632
2633 2016-03-10  Antonio Gomes  <tonikitoo@webkit.org>
2634
2635         Selecting with shift+drag results in unexpected drag-n-drop
2636         https://bugs.webkit.org/show_bug.cgi?id=155314
2637
2638         Reviewed by Darin Adler.
2639
2640         Test: editing/selection/shift-drag-selection-no-drag-n-drop.html
2641
2642         Whenever user tries to extend an existing text selection by dragging the mouse
2643         (left button hold) with shift key pressed, WebKit enters drag-n-drop mode.
2644         This behavior does not match common editing behavior out there, including other
2645         browsers' (Firefox, Opera/Presto and IE).
2646
2647         Patch changes WebKit so that whenever one extends a selection with mouse
2648         and shift key pressed off of a #text node, it does not enter drag-n-drop mode.
2649
2650         Additionally, patch also adds some further tests to ensure that when
2651         selection is extended off of either a link or an image, drag-n-drop does
2652         get triggered, no matter if shift key is pressed.
2653
2654         * page/EventHandler.cpp:
2655         (WebCore::EventHandler::handleMousePressEvent):
2656
2657 2016-03-14  Brent Fulgham  <bfulgham@apple.com>
2658
2659         REGRESSION (r197114): Crash in WebCore::MediaDevicesRequest::didCompletePermissionCheck
2660         https://bugs.webkit.org/show_bug.cgi?id=155453
2661         <rdar://problem/24879447>
2662
2663         Reviewed by Daniel Bates.
2664
2665         Tested by fast/mediastream/enumerating-crash.html.
2666
2667         * Modules/mediastream/MediaDevicesRequest.cpp:
2668         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Prevent UserMediaPermissionCheck object from being
2669         destroyed before the method completes.
2670
2671 2016-03-14  Simon Fraser  <simon.fraser@apple.com>
2672
2673         Fix crash when reloading a page using requestAnimationFrame on iOS
2674         https://bugs.webkit.org/show_bug.cgi?id=155465
2675         rdar://problem/25100202
2676
2677         Reviewed by Tim Horton.
2678
2679         On iOS, it's possible for all clients for a DisplayRefreshMonitor
2680         to be unregistered, but still get a subsequent displayDidRefresh() for that monitor.
2681         In this case, we would remove(notFound) which release-asserts.
2682         
2683         Fix by just checking for notFound.
2684         
2685         Unable to test because requestAnimationFrame doesn't work in the simulator.
2686
2687         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2688         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
2689
2690 2016-03-14  Per Arne Vollan  <peavo@outlook.com>
2691
2692         [WinCairo][MediaFoundation] Implement float versions of MediaPlayer methods.
2693         https://bugs.webkit.org/show_bug.cgi?id=155357
2694
2695         Reviewed by Brent Fulgham.
2696
2697         It is better to implement the float versions of some of the MediaPlayer methods,
2698         since the default implementation of the double versions is to call the float version.
2699         Also added override keyword to overridden methods.
2700
2701         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2702         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
2703         (WebCore::MediaPlayerPrivateMediaFoundation::seek):
2704         (WebCore::MediaPlayerPrivateMediaFoundation::setRate):
2705         (WebCore::MediaPlayerPrivateMediaFoundation::duration):
2706         (WebCore::MediaPlayerPrivateMediaFoundation::currentTime):
2707         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble): Deleted.
2708         (WebCore::MediaPlayerPrivateMediaFoundation::setRateDouble): Deleted.
2709         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble): Deleted.
2710         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2711
2712 2016-03-14  Tim Horton  <timothy_horton@apple.com>
2713
2714         Revert r194125 and r194186: We're going to fix this a different way.
2715
2716         * page/EventHandler.cpp:
2717         (WebCore::EventHandler::clear):
2718         * page/EventHandler.h:
2719
2720 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2721
2722         [Fetch API] FetchLoader should check for empty bodies
2723         https://bugs.webkit.org/show_bug.cgi?id=155440
2724
2725         Reviewed by Darin Adler.
2726
2727         Covered by added tests.
2728
2729         * Modules/fetch/FetchLoader.cpp:
2730         (WebCore::FetchLoader::didFinishLoading): returning empty array buffer/empty string if no data received during loading.
2731
2732 2016-03-14  Chris Dumez  <cdumez@apple.com>
2733
2734         Regression(r197981): Huge regression on Mac PLT
2735         https://bugs.webkit.org/show_bug.cgi?id=155443
2736         <rdar://problem/25113391>
2737
2738         Reviewed by Gavin Barraclough.
2739
2740         We have experience a huge regression on Mac PLT after r197981, so
2741         disable the feature until the performance issue is resolved.
2742
2743         * platform/graphics/ca/GraphicsLayerCA.cpp:
2744         (WebCore::GraphicsLayer::supportsSmoothedLayerText):
2745
2746 2016-03-14  Chris Vienneau  <chris.vno@outlook.com>
2747
2748         PingHandle delete's itself but pointer is still used by handleDataURL
2749         https://bugs.webkit.org/show_bug.cgi?id=154752
2750         <rdar://problem/24872347>
2751
2752         Reviewed by Alex Christensen.
2753
2754         When a PingHandle is destroyed, we should tell its client so that the client can clear the pointer it
2755         holds to the element to avoid accidentally attempting to use deallocated memory.
2756
2757         The ResourceHandle's client member may be null after "didReceiveResponse" is called. We should confirm
2758         the client is still valid after these calls.
2759
2760         * platform/network/DataURL.cpp:
2761         (WebCore::handleDataURL): Check the client pointer before using it.
2762         * platform/network/PingHandle.h:
2763         (WebCore::PingHandle::~PingHandle): Notify the client we are being destroyed.
2764         * platform/platform/network/ResourceHandle.h:
2765
2766 2016-03-14  Zalan Bujtas  <zalan@apple.com>
2767
2768         Negative outline offset could break curved outline-style: auto
2769         https://bugs.webkit.org/show_bug.cgi?id=155416
2770
2771         Reviewed by Tim Horton.
2772
2773         When radius becomes negative the rounded rect could end up being un-renderable -> no rounded corners at all.
2774
2775         Test: fast/inline/hidpi-outline-auto-negative-offset-with-border-radius.html
2776
2777         * platform/graphics/PathUtilities.cpp:
2778         (WebCore::adjustedtRadiiForHuggingCurve):
2779
2780 2016-03-14  Zalan Bujtas  <zalan@apple.com>
2781
2782         [Outline: auto] Fractional radius value could result in non-renderable rounded border.
2783         https://bugs.webkit.org/show_bug.cgi?id=155420
2784
2785         Reviewed by Tim Horton.
2786
2787         RoundedRect::pixelSnappedRoundedRectForPainting ensures that the rounded rect is always renderable.
2788
2789         Test: fast/inline/hidpi-outline-auto-with-fractional-radius.html
2790
2791         * platform/graphics/PathUtilities.cpp:
2792         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
2793         * platform/graphics/PathUtilities.h:
2794         * rendering/RenderElement.cpp:
2795         (WebCore::RenderElement::paintFocusRing):
2796
2797 2016-03-14  Zalan Bujtas  <zalan@apple.com>
2798
2799         Outline: auto has sharp corners with single line contenteditable.
2800         https://bugs.webkit.org/show_bug.cgi?id=155418
2801
2802         Reviewed by Tim Horton.
2803
2804         Multiple rectangles assumed multiline content and it broke bottomLeft and bottomRight corner check.
2805         This patch adds fast path for polygons with 4 corners.
2806
2807         Test: fast/inline/hidpi-outline-auto-with-one-focusring-rect.html
2808
2809         * platform/graphics/PathUtilities.cpp:
2810         (WebCore::cornerType):
2811         (WebCore::cornerTypeForMultiline):
2812         (WebCore::rectFromPolygon):
2813         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
2814
2815 2016-03-14  Joanmarie Diggs  <jdiggs@igalia.com>
2816
2817         [AX] SVG element with child desc not exposed
2818         https://bugs.webkit.org/show_bug.cgi?id=155374
2819
2820         Reviewed by Darin Adler.
2821
2822         Covered by the accessibility/w3c-svg-roles.html test, which was updated.
2823
2824         AccessibilitySVGRoot is now a subclass of AccessibilitySVGElement, which
2825         exposes SVG elements with a child desc element as per the specification.
2826         Also made existing protected methods private.
2827
2828         * accessibility/AccessibilitySVGElement.h:
2829         * accessibility/AccessibilitySVGRoot.cpp:
2830         (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
2831         (WebCore::AccessibilitySVGRoot::parentObject):
2832         * accessibility/AccessibilitySVGRoot.h:
2833
2834 2016-03-14  Alexey Proskuryakov  <ap@apple.com>
2835
2836         Build fix.
2837
2838         * Modules/fetch/FetchBodyOwner.cpp:
2839         (WebCore::FetchBodyOwner::loadedBlobAsText):
2840
2841 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2842
2843         [Fetch API] Implement data resolution for blob stored in Body
2844         https://bugs.webkit.org/show_bug.cgi?id=155359
2845
2846         Reviewed by Darin Adler.
2847
2848         Introducing FetchLoader as a wrapper around ThreadableLoader to load resources.
2849         FetchLoader can retrieve data as text or array buffer. It only supports blob currently.
2850
2851         Introducing FetchLoaderClient interface and FetchBodyOwner::BlobLoader as specifc blob loader client.
2852
2853         Covered by existing rebased tests.
2854
2855         * CMakeLists.txt:
2856         * Modules/fetch/FetchBody.cpp:
2857         (WebCore::FetchBody::loadingType):
2858         (WebCore::FetchBody::loadedAsArrayBuffer):
2859         (WebCore::FetchBody::loadedAsText):
2860         * Modules/fetch/FetchBody.h:
2861         * Modules/fetch/FetchBodyOwner.cpp: Added.
2862         (WebCore::FetchBodyOwner::FetchBodyOwner):
2863         (WebCore::FetchBodyOwner::loadBlob):
2864         (WebCore::FetchBodyOwner::finishBlobLoading):
2865         (WebCore::FetchBodyOwner::blobLoadingFailed):
2866         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
2867         * Modules/fetch/FetchBodyOwner.h:
2868         (WebCore::FetchBodyOwner::loadedBlobAsText):
2869         (WebCore::FetchBodyOwner::loadedBlobAsArrayBuffer):
2870         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
2871         * Modules/fetch/FetchLoader.cpp: Added.
2872         (WebCore::FetchLoader::start):
2873         (WebCore::FetchLoader::FetchLoader):
2874         (WebCore::FetchLoader::stop):
2875         (WebCore::FetchLoader::didReceiveResponse):
2876         (WebCore::FetchLoader::didReceiveData):
2877         (WebCore::FetchLoader::didFinishLoading):
2878         (WebCore::FetchLoader::didFail):
2879         * Modules/fetch/FetchLoader.h: Added.
2880         * Modules/fetch/FetchLoaderClient.h: Added.
2881         (WebCore::FetchLoaderClient::~FetchLoaderClient):
2882         (WebCore::FetchLoaderClient::didReceiveResponse):
2883         (WebCore::FetchLoaderClient::didFinishLoadingAsText):
2884         (WebCore::FetchLoaderClient::didFinishLoadingAsArrayBuffer):
2885         * WebCore.xcodeproj/project.pbxproj:
2886
2887 2016-03-14  Frederic Wang  <fwang@igalia.com>
2888
2889         Make MathML colspan/rowspan consistent with HTML table cells.
2890         https://bugs.webkit.org/show_bug.cgi?id=150253
2891
2892         Reviewed by Martin Robinson.
2893
2894         Test: mathml/rowspan-crash.xhtml
2895
2896         We make MathMLElement::colSpan and MathMLElement::rowSpan consistent with the corresponding functions in HTMLTableCellElement.cpp.
2897         These functions now return unsigned integers, use the same parsing functions and set a maximum for rowspan.
2898         This latter change fixes crash/timeout with large values of rowspan.
2899
2900         * mathml/MathMLElement.cpp: Include HTMLParserIdioms to use limitToOnlyHTMLNonNegative.
2901         (WebCore::MathMLElement::colSpan): Use unsigned integer and limitToOnlyHTMLNonNegative.
2902         (WebCore::MathMLElement::rowSpan): ditto. We also use the same maximum limit as HTMLTableCellElement.
2903         * mathml/MathMLElement.h: Make colSpan and rowSpan return unsigned integers.
2904
2905 2016-03-14  Tomas Popela  <tpopela@redhat.com>
2906
2907         Enable GSS-Negotiate support in libsoup
2908         https://bugs.webkit.org/show_bug.cgi?id=155354
2909
2910         Reviewed by Carlos Garcia Campos.
2911
2912         Enable the SOUP_TYPE_AUTH_NEGOTIATE feature if libsoup was compiled
2913         with the GSS-Negotiate support.
2914
2915         * platform/network/soup/SoupNetworkSession.cpp:
2916         (WebCore::SoupNetworkSession::SoupNetworkSession):
2917
2918 2016-03-14  Ryosuke Niwa  <rniwa@webkit.org>
2919
2920         Add slotchange event
2921         https://bugs.webkit.org/show_bug.cgi?id=155424
2922         <rdar://problem/24997534>
2923
2924         Reviewed by Antti Koivisto.
2925
2926         Added `slotchange` event as discussed on https://github.com/w3c/webcomponents/issues/288.
2927
2928         While the exact semantics of it could still evolve over time, this patch implements as
2929         an asynchronous event that fires on a slot element whenever its distributed nodes change
2930         (flattened assigned nodes):
2931         http://w3c.github.io/webcomponents/spec/shadow/#dfn-distributed-nodes
2932
2933         Since inserting or removing an element from a shadow host could needs to enqueue this event
2934         on the right slot element, this patch moves the invalidation point of element removals and
2935         insertions from Element::childrenChanged to Element::insertedInto and Element::removedFrom.
2936         Text nodes are still invalidated at Element::childrenChanged for performance reasons
2937         since it could only appear within a default slot element.
2938
2939         Because this more fine-grained invalidation needs to be overridden by HTMLDetailsElement,
2940         we now subclass SlotAssignment in HTMLDetailsElement instead of passing in a std::function.
2941
2942         Test: fast/shadow-dom/slotchange-event.html
2943
2944         * dom/Document.cpp:
2945         (WebCore::Document::enqueueSlotchangeEvent): Added.
2946         * dom/Document.h:
2947         * dom/Element.cpp:
2948         (WebCore::Element::attributeChanged): Call hostChildElementDidChangeSlotAttr.
2949         (WebCore::Element::insertedInto): Call hostChildElementDidChange.
2950         (WebCore::Element::removedFrom): Ditto.
2951         (WebCore::Element::childrenChanged): Don't invalidate the slots on ElementInserted and
2952         ElementRemoved since they're now done in Element::insertedInto and Element::removedFrom.
2953         * dom/Event.cpp:
2954         (WebCore::Event::scoped): slotchange event is scoped.
2955         * dom/EventNames.h: Added eventNames().slotchange.
2956         * dom/ShadowRoot.cpp:
2957         (WebCore::ShadowRoot::invalidateSlotAssignments): Deleted.
2958         (WebCore::ShadowRoot::invalidateDefaultSlotAssignments): Deleted.
2959         * dom/ShadowRoot.h:
2960         (ShadowRoot): Added more fine-grained invalidators, mirroring changes to SlotAssignment.
2961         * dom/SlotAssignment.cpp:
2962         (WebCore::SlotAssignment::SlotAssignment): Removed a variant that takes SlotNameFunction
2963         since HTMLDetailsElement now subclasses SlotAssignment.
2964         (WebCore::SlotAssignment::~SlotAssignment): Added now that the class is virtual.
2965         (WebCore::recursivelyFireSlotChangeEvent): Added.
2966         (WebCore::SlotAssignment::didChangeSlot): Added. Invalidates the style tree only if there
2967         is a corresponding slot element, and fires slotchange event. When the slot element we found
2968         in this shadow tree is assigned to a slot element inside an inner shadow tree, recursively
2969         fire slotchange event on each such inner slots.
2970         (WebCore::SlotAssignment::hostChildElementDidChange): Added. Update the matching slot when
2971         an element is inserted or removed under a shadow host.
2972         (WebCore::SlotAssignment::assignedNodesForSlot): Removed the superfluous early exit to an
2973         release assert since addSlotElementByName should always create a SlotInfo for each element.
2974         (WebCore::SlotAssignment::slotNameForHostChild): Added. This is the equivalent of old
2975         m_slotNameFunction which DetailsSlotAssignment overrides.
2976         (WebCore::SlotAssignment::invalidateDefaultSlot): Deleted.
2977         (WebCore::SlotAssignment::findFirstSlotElement): Added an assertion. slotInfo.element must
2978         be nullptr if elementCount is 0, and elementCount must be 0 if slotInfo.element is nullptr
2979         after calling resolveAllSlotElements, which traverses the entire shadow tree to find all
2980         slot elements.
2981         (WebCore::SlotAssignment::assignSlots):
2982         * dom/SlotAssignment.h: Implemented inline functions of ShadowRoot here to avoid including
2983         SlotAssignment.h in ShadowRoot.h. Not inlining them results in extra function calls for all
2984         builtin elements with shadow root without slot elements, which impacts performance.
2985         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost): Added.
2986         (WebCore::ShadowRoot::didChangeDefaultSlot): Added.
2987         (WebCore::ShadowRoot::hostChildElementDidChange): Added.
2988         (WebCore::ShadowRoot::hostChildElementDidChangeSlotAttribute): Added.
2989         (WebCore::ShadowRoot::innerSlotDidChange):
2990         * html/HTMLDetailsElement.cpp:
2991         (WebCore::DetailsSlotAssignment): Added. Subclasses SlotAssignment to override
2992         hostChildElementDidChange and slotNameForHostChild.
2993         (WebCore::DetailsSlotAssignment::hostChildElementDidChange): Added. We don't check if this
2994         is the first summary element since we don't know the answer when this function is called
2995         inside Element::removedFrom.
2996         (WebCore::DetailsSlotAssignment::slotNameForHostChild): Renamed from slotNameFunction. Also
2997         removed the code to return nullAtom when details element is not open as that messes up new
2998         fine-grained invalidation. Insert/remove the slot element in parseAttribute instead.
2999         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot): Don't insert the slot element for
3000         the summary since the details element is not open now.
3001         (WebCore::HTMLDetailsElement::parseAttribute): Remove and insert the slot element for the
3002         summary here instead of changing the behavior of slotNameForHostChild.
3003         * html/HTMLDetailsElement.h:
3004         * html/HTMLSlotElement.cpp:
3005         (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Added. Enqueues a new slotchange event
3006         if we haven't done so for this element yet.
3007         (WebCore::HTMLSlotElement::dispatchEvent): Added. Clear m_hasEnqueuedSlotChangeEvent when
3008         dispatching a slotchange event so that a subsequent call to enqueueSlotChangeEvent would
3009         enqueue a new event. Note scripts call EventTarget::dispatchEventForBindings instead.
3010         * html/HTMLSlotElement.h:
3011
3012 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3013
3014         Introduce CallWith=Document in binding generator
3015         https://bugs.webkit.org/show_bug.cgi?id=155358
3016
3017         Reviewed by Darin Adler.
3018
3019         Covered by existing tests and binding test.
3020
3021         * Modules/notifications/Notification.cpp:
3022         (WebCore::Notification::permission): Taking a Document& instead of ScriptExecutionContext&.
3023         (WebCore::Notification::requestPermission): Ditto.
3024         * Modules/notifications/Notification.h:
3025         * Modules/notifications/Notification.idl: Using CallWith=Document.
3026         * bindings/scripts/CodeGeneratorJS.pm: Adding support for CallWith=Document and changed name from scriptContext to context.
3027         (GenerateCallWith):
3028         (GenerateConstructorDefinition):
3029         * bindings/scripts/IDLAttributes.txt: Adding support for CallWith=Document.
3030         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3031         (webkit_dom_test_obj_with_document_argument):
3032         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3033         * bindings/scripts/test/JS/JSTestInterface.cpp:
3034         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
3035         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
3036         * bindings/scripts/test/JS/JSTestObj.cpp:
3037         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
3038         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
3039         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
3040         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3041         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3042         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
3043         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
3044         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
3045         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3046         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3047         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
3048         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
3049         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
3050         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
3051         (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
3052         * bindings/scripts/test/ObjC/DOMTestObj.h:
3053         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3054         (-[DOMTestObj withDocumentArgument]):
3055         * bindings/scripts/test/TestObj.idl: Adding binding test.
3056         * page/DOMWindow.cpp:
3057         (WebCore::DOMWindow::focus): Taking a Document& instead of ScriptExecutionContext&.
3058         (WebCore::DOMWindow::close): Ditto.
3059         * page/DOMWindow.h:
3060         * page/DOMWindow.idl:
3061         * page/History.cpp:
3062         (WebCore::History::back): Ditto.
3063         (WebCore::History::forward): Ditto.
3064         (WebCore::History::go): Ditto.
3065         * page/History.h:
3066         * page/History.idl:
3067         * testing/Internals.cpp:
3068         (WebCore::InspectorStubFrontend::closeWindow): Calling DOMWindow::close() directly.
3069
3070 2016-03-13  Joseph Pecoraro  <pecoraro@apple.com>
3071
3072         Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
3073         https://bugs.webkit.org/show_bug.cgi?id=155417
3074
3075         Reviewed by Yusuke Suzuki.
3076
3077         * Configurations/FeatureDefines.xcconfig:
3078
3079 2016-03-13  Sam Weinig  <sam@webkit.org>
3080
3081         Implement unprivileged execCommand("copy") and execCommand("cut")
3082         <rdar://problem/24354406>
3083         https://bugs.webkit.org/show_bug.cgi?id=146336
3084
3085         Reviewed by Dean Jackson.
3086
3087         Test: editing/execCommand/clipboard-access-with-user-gesture.html
3088
3089         * WebCore.xcodeproj/project.pbxproj:
3090         Add new files.
3091
3092         * editing/ClipboardAccessPolicy.h:
3093         Added.
3094
3095         * editing/EditorCommand.cpp:
3096         (WebCore::defaultValueForSupportedCopyCut):
3097         (WebCore::supportedCopyCut):
3098         Match other browsers and allow the copy and cut commands
3099         to be executed when there is a user gesture.
3100
3101         * page/Settings.h:
3102         Add include of ClipboardAccessPolicy.h.
3103
3104         * page/Settings.in:
3105         Add new setting for ClipboardAccessPolicy
3106
3107 2016-03-13  Ryosuke Niwa  <rniwa@webkit.org>
3108
3109         REGRESSION (r190840): crash inside details element's slotNameFunction
3110         https://bugs.webkit.org/show_bug.cgi?id=155388
3111
3112         Reviewed by Antti Koivisto.
3113
3114         The bug was caused by HTMLDetailsElement::isActiveSummary calling findAssignedSlot with a summary element
3115         inside the shadow tree of the detials element. Fixed it by existing early when the summary element passed
3116         to isActiveSummary is not a direct child of the details element.
3117
3118         Test: fast/html/details-summary-tabindex-crash.html
3119
3120         * dom/ShadowRoot.cpp:
3121         (WebCore::ShadowRoot::findAssignedSlot): Added an assertion for regression testing.
3122         * dom/SlotAssignment.cpp:
3123         (WebCore::SlotAssignment::findAssignedSlot): Removed the superfluous call to assignSlots added in r190840.
3124         There is no need to update the slot assignments here (entires in m_slots are added or removed by
3125         addSlotElementByName or removeSlotElementByName and assignSlots only updates assignedNodes in each SlotInfo
3126         which is never used in this function or findFirstSlotElement.
3127         * html/HTMLDetailsElement.cpp:
3128         (WebCore::HTMLDetailsElement::isActiveSummary): Fixed the bug.
3129
3130 2016-03-13  Antti Koivisto  <antti@apple.com>
3131
3132         ComposedTreeIterator fails to traverse slots if root is shadow host
3133         https://bugs.webkit.org/show_bug.cgi?id=155407
3134
3135         Reviewed by Darin Adler.
3136
3137         Test: fast/shadow-dom/composed-tree-shadow-subtree.html
3138
3139         * dom/ComposedTreeIterator.cpp:
3140         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
3141
3142             Traversal functions assume m_contextStack is deeper than 1 before they need to enter slot traversal code paths.
3143             Call initializeContextStack in case of shadow host which does the right thing.
3144
3145         (WebCore::ComposedTreeIterator::traverseSiblingInSlot):
3146         (WebCore::composedTreeAsText):
3147
3148             Add option to include pointers as debugging aid.
3149
3150         * dom/ComposedTreeIterator.h:
3151         (WebCore::composedTreeChildren):
3152
3153 2016-03-12  Sam Weinig  <sam@webkit.org>
3154
3155         WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
3156         <rdar://problem/25129946>
3157         https://bugs.webkit.org/show_bug.cgi?id=155401
3158
3159         Reviewed by Alex Christensen.
3160
3161         Add a SessionID as a member of NetworkStorageSession. This allows us to avoid having HashMaps
3162         to map between the two types.
3163
3164         * platform/network/NetworkStorageSession.h:
3165         (WebCore::NetworkStorageSession::sessionID):
3166         (WebCore::NetworkStorageSession::credentialStorage):
3167         (WebCore::NetworkStorageSession::platformSession):
3168         * platform/network/NetworkStorageSessionStub.cpp:
3169         (WebCore::NetworkStorageSession::NetworkStorageSession):
3170         (WebCore::NetworkStorageSession::context):
3171         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
3172         (WebCore::defaultSession):
3173         (WebCore::NetworkStorageSession::defaultStorageSession):
3174         (WebCore::NetworkStorageSession::switchToNewTestingSession):
3175         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3176         (WebCore::NetworkStorageSession::NetworkStorageSession):
3177         (WebCore::NetworkStorageSession::switchToNewTestingSession):
3178         (WebCore::NetworkStorageSession::defaultStorageSession):
3179         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
3180         * platform/network/soup/NetworkStorageSessionSoup.cpp:
3181         (WebCore::NetworkStorageSession::NetworkStorageSession):
3182         (WebCore::NetworkStorageSession::defaultStorageSession):
3183         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
3184         (WebCore::NetworkStorageSession::switchToNewTestingSession):
3185         (WebCore::NetworkStorageSession::soupNetworkSession):
3186
3187 2016-03-13  Jon Lee  <jonlee@apple.com>
3188
3189         getUserMedia requests from the main frame should be treated the same as requests from an iframe with the same origin
3190         https://bugs.webkit.org/show_bug.cgi?id=155405
3191         <rdar://problem/25131007>
3192
3193         Reviewed by Eric Carlson.
3194
3195         When gUM is called from the main frame, or from a subframe with the same origin, the
3196         top level document origin should be the same.
3197
3198         * Modules/mediastream/UserMediaRequest.cpp:
3199         (WebCore::UserMediaRequest::userMediaDocumentOrigin): Reverse the logic so that it is similar
3200         to topLevelDocumentOrigin.
3201         (WebCore::UserMediaRequest::topLevelDocumentOrigin): Return the top origin always.
3202
3203 2016-03-13  David Kilzer  <ddkilzer@apple.com>
3204
3205         REGRESSION (r198079): Windows build broke because of "%PRId64" format specifier
3206
3207         * platform/network/ParsedContentRange.cpp: Add #include
3208         <wtf/StdLibExtras.h> and remove local definition of "PRId64".
3209
3210 2016-03-13  Joonghun Park  <jh718.park@samsung.com>
3211
3212         [EFL] Fix debug build error since r197690. Unreviewed.
3213         https://bugs.webkit.org/show_bug.cgi?id=155408
3214
3215         Unreviewed. Change %lld to %PRId instead to correct the error below.
3216         error: format ‘%lld’ expects argument of type ‘long long int’,
3217         but argument 5 has type ‘std::chrono::duration<long int, std::ratio<1l, 1000l> >::rep
3218         {aka long int}’ [-Werror=format=]
3219
3220         * page/DOMTimer.cpp:
3221         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
3222
3223 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
3224
3225         [Cocoa] Remove typedef from NSScrollerImp to ScrollbarPainter
3226         https://bugs.webkit.org/show_bug.cgi?id=155379
3227
3228         Reviewed by Beth Dakin.
3229
3230         There's no reason to not call them what they are.
3231
3232         No new tests because there is no behavior change.
3233
3234         * page/scrolling/AsyncScrollingCoordinator.cpp:
3235         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3236         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3237         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3238         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
3239         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
3240         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3241         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
3242         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
3243         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
3244         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3245         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3246         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
3247         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
3248         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread):
3249         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
3250         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
3251         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
3252         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread): Deleted.
3253         * platform/ScrollbarThemeComposite.h:
3254         * platform/mac/ScrollAnimatorMac.h:
3255         * platform/mac/ScrollAnimatorMac.mm:
3256         (scrollbarPainterForScrollbar):
3257         (-[WebScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
3258         (-[WebScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
3259         (-[WebScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
3260         (-[WebScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
3261         (-[WebScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
3262         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
3263         (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
3264         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
3265         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
3266         (WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
3267         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
3268         (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
3269         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
3270         (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
3271         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
3272         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
3273         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
3274         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
3275         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
3276         (WebCore::ScrollAnimatorMac::cancelAnimations):
3277         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
3278         (WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
3279         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]): Deleted.
3280         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]): Deleted.
3281         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]): Deleted.
3282         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]): Deleted.
3283         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]): Deleted.
3284         * platform/mac/ScrollbarThemeMac.h:
3285         * platform/mac/ScrollbarThemeMac.mm:
3286         (WebCore::scrollbarMap):
3287         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
3288         (WebCore::ScrollbarThemeMac::registerScrollbar):
3289         (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
3290         (WebCore::ScrollbarThemeMac::painterForScrollbar):
3291         (WebCore::ScrollbarThemeMac::scrollbarThickness):
3292         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
3293         (WebCore::ScrollbarThemeMac::hasThumb):
3294         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
3295         (WebCore::scrollbarPainterPaint):
3296
3297 2016-03-12  Dean Jackson  <dino@apple.com>
3298
3299         REGRESSION (r188647): Teamtreehouse website sidebar buttons are not rendered
3300         https://bugs.webkit.org/show_bug.cgi?id=155400
3301         <rdar://problem/24818602>
3302
3303         Reviewed by Anders Carlsson.
3304
3305         When we unprefixed CSS filters we accidentally
3306         stopped SVG elements that use the CSS filter shorthands
3307         from rendering. We still don't actually support
3308         the shorthands in this case, but we should render
3309         the element without the filter.
3310
3311         Tests: css3/filters/filters-on-svg-element.html
3312                css3/filters/filters-on-svg-root.html
3313
3314         * rendering/style/RenderStyle.cpp:
3315         (WebCore::RenderStyle::hasReferenceFilterOnly): Add
3316         this new function that tells us if we have the
3317         style of filter that we can handle in SVG content.
3318         * rendering/style/RenderStyle.h:
3319         * rendering/svg/SVGRenderingContext.cpp:
3320         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
3321         We can mark an element as ready to render if it
3322         has a shorthand filter.
3323
3324 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
3325
3326         Delete dead SVG Font code
3327         https://bugs.webkit.org/show_bug.cgi?id=154718
3328
3329         Reviewed by Antti Koivisto.
3330
3331         All the ports have adopted the SVG -> OTF Font Converter, so there will never
3332         be an instantiation of a font backed by a DOM subtree. We can remove all the
3333         infrastructure used to support that.
3334
3335         No new tests because there is no behavior change.
3336
3337         * CMakeLists.txt:
3338         * Configurations/FeatureDefines.xcconfig:
3339         * WebCore.order:
3340         * WebCore.xcodeproj/project.pbxproj:
3341         * css/CSSFontFaceSource.cpp:
3342         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
3343         (WebCore::CSSFontFaceSource::font): Deleted.
3344         * css/CSSFontFaceSource.h:
3345         * loader/cache/CachedFont.cpp:
3346         * loader/cache/CachedSVGFont.cpp:
3347         (WebCore::CachedSVGFont::createFont): Deleted.
3348         (WebCore::CachedSVGFont::ensureCustomFontData): Deleted.
3349         * loader/cache/CachedSVGFont.h:
3350         * platform/graphics/Font.cpp:
3351         (WebCore::Font::Font):
3352         (WebCore::fillGlyphPage):
3353         (WebCore::Font::description): Deleted.
3354         (WebCore::Font::createScaledFont): Deleted.
3355         (WebCore::Font::applyTransforms): Deleted.
3356         * platform/graphics/Font.h:
3357         (WebCore::Font::widthForGlyph):
3358         (WebCore::Font::SVGData::~SVGData): Deleted.
3359         (WebCore::Font::create): Deleted.
3360         (WebCore::Font::svgData): Deleted.
3361         (WebCore::Font::isSVGFont): Deleted.
3362         * platform/graphics/win/FontWin.cpp:
3363         * platform/graphics/FontCascade.cpp:
3364         (WebCore::FontCascade::drawText):
3365         (WebCore::FontCascade::drawEmphasisMarks):
3366         (WebCore::FontCascade::glyphDataForCharacter):
3367         (WebCore::FontCascade::adjustSelectionRectForText):
3368         (WebCore::FontCascade::offsetForPosition):
3369         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
3370         (WebCore::FontCascade::drawGlyphBuffer):
3371         (WebCore::isDrawnWithSVGFont): Deleted.
3372         (WebCore::FontCascade::width): Deleted.
3373         (WebCore::FontCascade::codePath): Deleted.
3374         * platform/graphics/FontCascade.h:
3375         * platform/graphics/GraphicsContext.h:
3376         * platform/graphics/SVGGlyph.cpp: Removed.
3377         (WebCore::processArabicFormDetection): Deleted.
3378         (WebCore::charactersWithArabicForm): Deleted.
3379         (WebCore::isCompatibleArabicForm): Deleted.
3380         (WebCore::isCompatibleGlyph): Deleted.
3381         * platform/graphics/SVGGlyph.h: Removed.
3382         (WebCore::SVGGlyph::SVGGlyph): Deleted.
3383         (WebCore::SVGGlyph::inheritedValue): Deleted.
3384         (WebCore::SVGGlyph::operator==): Deleted.
3385         * platform/graphics/TextRun.cpp:
3386         * platform/graphics/TextRun.h:
3387         (WebCore::TextRun::RenderingContext::~RenderingContext): Deleted.
3388         (WebCore::TextRun::renderingContext): Deleted.
3389         (WebCore::TextRun::setRenderingContext): Deleted.
3390         * platform/graphics/WidthIterator.cpp:
3391         (WebCore::WidthIterator::applyFontTransforms):
3392         (WebCore::WidthIterator::advanceInternal):
3393         (WebCore::WidthIterator::glyphDataForCharacter): Deleted.
3394         * platform/graphics/WidthIterator.h:
3395         (WebCore::WidthIterator::lastGlyphName): Deleted.
3396         (WebCore::WidthIterator::setLastGlyphName): Deleted.
3397         (WebCore::WidthIterator::arabicForms): Deleted.
3398         * platform/graphics/cairo/FontCairo.cpp:
3399         (WebCore::CairoGlyphToPathTranslator::advance):
3400         (WebCore::FontCascade::dashesForIntersectionsWithRect):
3401         (WebCore::CairoGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
3402         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3403         (WebCore::MacGlyphToPathTranslator::advance):
3404         (WebCore::FontCascade::dashesForIntersectionsWithRect):
3405         (WebCore::FontCascade::primaryFontIsSystemFont):
3406         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3407         (WebCore::MacGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
3408         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3409         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Deleted.
3410         * platform/graphics/mac/ComplexTextController.cpp:
3411         (WebCore::TextLayout::isNeeded):
3412         (WebCore::TextLayout::TextLayout):
3413         (WebCore::TextLayout::constructTextRun):
3414         * rendering/EllipsisBox.cpp:
3415         (WebCore::EllipsisBox::paint):
3416         (WebCore::EllipsisBox::selectionRect):
3417         (WebCore::EllipsisBox::paintSelection):
3418         * rendering/InlineTextBox.cpp:
3419         (WebCore::InlineTextBox::localSelectionRect):
3420         (WebCore::InlineTextBox::paint):
3421         (WebCore::InlineTextBox::paintSelection):
3422         (WebCore::InlineTextBox::paintCompositionBackground):
3423         (WebCore::InlineTextBox::paintDocumentMarker):
3424         (WebCore::InlineTextBox::paintTextMatchMarker):
3425         (WebCore::InlineTextBox::offsetForPosition):
3426         (WebCore::InlineTextBox::positionForOffset):
3427         (WebCore::InlineTextBox::constructTextRun):
3428         * rendering/InlineTextBox.h:
3429         * rendering/RenderBlock.cpp:
3430         (WebCore::RenderBlock::constructTextRun):
3431         * rendering/RenderBlock.h:
3432         * rendering/RenderBlockFlow.cpp:
3433         (WebCore::stripTrailingSpace):
3434         * rendering/RenderBlockLineLayout.cpp:
3435         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
3436         * rendering/RenderDeprecatedFlexibleBox.cpp:
3437         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
3438         * rendering/RenderFileUploadControl.cpp:
3439         (WebCore::RenderFileUploadControl::paintObject):
3440         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
3441         * rendering/RenderImage.cpp:
3442         (WebCore::RenderImage::setImageSizeForAltText):
3443         (WebCore::RenderImage::paintReplaced):
3444         * rendering/RenderListBox.cpp:
3445         (WebCore::RenderListBox::updateFromElement):
3446         * rendering/RenderListMarker.cpp:
3447         (WebCore::RenderListMarker::paint):
3448         (WebCore::RenderListMarker::computePreferredLogicalWidths):
3449         (WebCore::RenderListMarker::getRelativeMarkerRect):
3450         * rendering/RenderMenuList.cpp:
3451         (RenderMenuList::updateOptionsWidth):
3452         * rendering/RenderText.cpp:
3453         (WebCore::RenderText::widthFromCache):
3454         (WebCore::RenderText::trimmedPrefWidths):
3455         (WebCore::hyphenWidth):
3456         (WebCore::maxWordFragmentWidth):
3457         (WebCore::RenderText::computePreferredLogicalWidths):
3458         (WebCore::RenderText::width):
3459         * rendering/RenderTextControl.cpp:
3460         (WebCore::RenderTextControl::getAverageCharWidth):
3461         * rendering/RenderThemeIOS.mm:
3462         (WebCore::RenderThemeMeasureTextClient::RenderThemeMeasureTextClient):
3463         (WebCore::adjustInputElementButtonStyle):
3464         * rendering/SimpleLineLayout.cpp:
3465         (WebCore::SimpleLineLayout::canUseForFontAndText): Deleted.
3466         * rendering/line/BreakingContext.h:
3467         (WebCore::WordTrailingSpace::WordTrailingSpace):
3468         (WebCore::WordTrailingSpace::width):
3469         (WebCore::measureHyphenWidth):
3470         (WebCore::textWidth):
3471         (WebCore::tryHyphenating):
3472         (WebCore::BreakingContext::handleText):
3473         * rendering/svg/RenderSVGAllInOne.cpp:
3474         * rendering/svg/RenderSVGText.cpp:
3475         * rendering/svg/SVGInlineTextBox.cpp:
3476         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
3477         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
3478         (WebCore::SVGInlineTextBox::paintTextWithShadows):
3479         (WebCore::SVGInlineTextBox::constructTextRun): Deleted.
3480         * rendering/svg/SVGInlineTextBox.h:
3481         * rendering/svg/SVGTextLayoutEngine.cpp:
3482         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
3483         * rendering/svg/SVGTextLayoutEngineSpacing.cpp:
3484         (WebCore::SVGTextLayoutEngineSpacing::calculateSVGKerning): Deleted.
3485         * rendering/svg/SVGTextLayoutEngineSpacing.h:
3486         * rendering/svg/SVGTextMetrics.cpp:
3487         (WebCore::SVGTextMetrics::SVGTextMetrics):
3488         (WebCore::SVGTextMetrics::constructTextRun): Deleted.
3489         * rendering/svg/SVGTextMetrics.h:
3490         * rendering/svg/SVGTextMetricsBuilder.cpp:
3491         (WebCore::SVGTextMetricsBuilder::advanceSimpleText):
3492         * rendering/svg/SVGTextRunRenderingContext.cpp: Removed.
3493         (WebCore::svgFontAndFontFaceElementForFontData): Deleted.
3494         (WebCore::SVGTextRunRenderingContext::floatWidthUsingSVGFont): Deleted.
3495         (WebCore::SVGTextRunRenderingContext::applySVGKerning): Deleted.
3496         (WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator): Deleted.
3497         (WebCore::SVGGlyphToPathTranslator::transform): Deleted.
3498         (WebCore::SVGGlyphToPathTranslator::path): Deleted.
3499         (WebCore::SVGGlyphToPathTranslator::extents): Deleted.
3500         (WebCore::SVGGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
3501         (WebCore::SVGGlyphToPathTranslator::advance): Deleted.
3502         (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator): Deleted.
3503         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs): Deleted.
3504         (WebCore::missingGlyphForFont): Deleted.
3505         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): Deleted.
3506         * rendering/svg/SVGTextRunRenderingContext.h: Removed.
3507         * svg/SVGAllInOne.cpp:
3508         * svg/SVGFontData.cpp: Removed.
3509         (WebCore::SVGFontData::SVGFontData): Deleted.
3510         (WebCore::SVGFontData::initializeFont): Deleted.
3511         (WebCore::SVGFontData::widthForSVGGlyph): Deleted.
3512         (WebCore::SVGFontData::applySVGGlyphSelection): Deleted.
3513         (WebCore::SVGFontData::fillSVGGlyphPage): Deleted.
3514         (WebCore::SVGFontData::fillBMPGlyphs): Deleted.
3515         (WebCore::SVGFontData::fillNonBMPGlyphs): Deleted.
3516         (WebCore::computeNormalizedSpaces): Deleted.
3517         (WebCore::createStringWithMirroredCharacters): Deleted.
3518         * svg/SVGFontData.h: Removed.
3519         (WebCore::SVGFontData::~SVGFontData): Deleted.
3520         (WebCore::SVGFontData::svgFontFaceElement): Deleted.
3521         (WebCore::SVGFontData::horizontalOriginX): Deleted.
3522         (WebCore::SVGFontData::horizontalOriginY): Deleted.
3523         (WebCore::SVGFontData::horizontalAdvanceX): Deleted.
3524         (WebCore::SVGFontData::verticalOriginX): Deleted.
3525         (WebCore::SVGFontData::verticalOriginY): Deleted.
3526         (WebCore::SVGFontData::verticalAdvanceY): Deleted.
3527         * svg/SVGFontElement.cpp:
3528         (WebCore::SVGFontElement::SVGFontElement): Deleted.
3529         (WebCore::SVGFontElement::invalidateGlyphCache): Deleted.
3530         (WebCore::SVGFontElement::firstMissingGlyphElement): Deleted.
3531         (WebCore::SVGFontElement::registerLigaturesInGlyphCache): Deleted.
3532         (WebCore::SVGFontElement::ensureGlyphCache): Deleted.
3533         (WebCore::SVGKerningMap::clear): Deleted.
3534         (WebCore::SVGKerningMap::insert): Deleted.
3535         (WebCore::stringMatchesUnicodeRange): Deleted.
3536         (WebCore::stringMatchesGlyphName): Deleted.
3537         (WebCore::stringMatchesUnicodeName): Deleted.
3538         (WebCore::matches): Deleted.
3539         (WebCore::kerningForPairOfStringsAndGlyphs): Deleted.
3540         (WebCore::SVGFontElement::horizontalKerningForPairOfStringsAndGlyphs): Deleted.
3541         (WebCore::SVGFontElement::verticalKerningForPairOfStringsAndGlyphs): Deleted.
3542         (WebCore::SVGFontElement::collectGlyphsForString): Deleted.
3543         (WebCore::SVGFontElement::collectGlyphsForGlyphName): Deleted.
3544         (WebCore::SVGFontElement::svgGlyphForGlyph): Deleted.
3545         (WebCore::SVGFontElement::missingGlyph): Deleted.
3546         * svg/SVGFontElement.h:
3547         (WebCore::SVGKerning::SVGKerning): Deleted.
3548         (WebCore::SVGKerningMap::isEmpty): Deleted.
3549         * svg/SVGGlyphElement.cpp:
3550         (WebCore::SVGGlyphElement::invalidateGlyphCache): Deleted.
3551         (WebCore::SVGGlyphElement::parseAttribute): Deleted.
3552         (WebCore::SVGGlyphElement::insertedInto): Deleted.
3553         (WebCore::SVGGlyphElement::removedFrom): Deleted.
3554         (WebCore::parseArabicForm): Deleted.
3555         (WebCore::parseOrientation): Deleted.
3556         (WebCore::SVGGlyphElement::inheritUnspecifiedAttributes): Deleted.
3557         (WebCore::parseSVGGlyphAttribute): Deleted.
3558         (WebCore::SVGGlyphElement::buildGenericGlyphIdentifier): Deleted.
3559         (WebCore::SVGGlyphElement::buildGlyphIdentifier): Deleted.
3560         * svg/SVGGlyphElement.h:
3561         * svg/SVGGlyphMap.h: Removed.
3562         (WebCore::GlyphMapNode::GlyphMapNode): Deleted.
3563         (WebCore::GlyphMapNode::create): Deleted.
3564         (WebCore::SVGGlyphMap::SVGGlyphMap): Deleted.
3565         (WebCore::SVGGlyphMap::addGlyph): Deleted.
3566         (WebCore::SVGGlyphMap::appendToGlyphTable): Deleted.
3567         (WebCore::SVGGlyphMap::compareGlyphPriority): Deleted.
3568         (WebCore::SVGGlyphMap::collectGlyphsForString): Deleted.
3569         (WebCore::SVGGlyphMap::clear): Deleted.
3570         (WebCore::SVGGlyphMap::svgGlyphForGlyph): Deleted.
3571         (WebCore::SVGGlyphMap::glyphIdentifierForGlyphName): Deleted.
3572         * svg/SVGHKernElement.cpp:
3573         (WebCore::SVGHKernElement::insertedInto): Deleted.
3574         (WebCore::SVGHKernElement::removedFrom): Deleted.
3575         * svg/SVGHKernElement.h:
3576         * svg/SVGToOTFFontConversion.cpp:
3577         * svg/SVGToOTFFontConversion.h:
3578         * svg/SVGVKernElement.cpp:
3579         (WebCore::SVGVKernElement::insertedInto): Deleted.
3580         (WebCore::SVGVKernElement::removedFrom): Deleted.
3581         * svg/SVGVKernElement.h:
3582
3583 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
3584
3585         [OS X] Scrollbars of overflow:scroll divs should appear on the left on RTL systems
3586         https://bugs.webkit.org/show_bug.cgi?id=155385
3587
3588         Reviewed by Simon Fraser.
3589
3590         There is already some existing setup for RTL scrollbars. This patch hooks up this
3591         existing support to the OS X triggering mechanism introduced in r197956. It also
3592         fixes up the existing support to function even when the direction of the
3593         RTL-scrollbar div is LTR (this means the contents of the div must be pushed
3594         over by the width of the scrollbar).
3595
3596         Tests: fast/scrolling/rtl-scrollbars-overflow-contents.html
3597                fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html
3598                fast/scrolling/rtl-scrollbars-overflow-padding.html
3599                fast/scrolling/rtl-scrollbars-overflow-simple.html
3600                fast/scrolling/rtl-scrollbars-overflow.html
3601
3602         * rendering/RenderBlock.cpp:
3603         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
3604         (WebCore::RenderBlock::logicalLeftOffsetForContent):
3605         (WebCore::RenderBlock::logicalRightOffsetForContent):
3606         * rendering/RenderBlockFlow.cpp:
3607         (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
3608         * rendering/RenderBox.cpp:
3609         (WebCore::RenderBox::overflowClipRect):
3610         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3611         * rendering/RenderLayer.cpp:
3612         (WebCore::RenderLayer::computeScrollDimensions):
3613         * rendering/style/RenderStyle.cpp:
3614         (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLogicalLeft):
3615         * rendering/style/RenderStyle.h:
3616
3617 2016-03-12  Zalan Bujtas  <zalan@apple.com>
3618
3619         [Forms: focus] focus rings around text fields do not follow contour (border-radius)
3620         https://bugs.webkit.org/show_bug.cgi?id=154099
3621         rdar://problem/9988429
3622
3623         Reviewed by Tim Horton.
3624
3625         This patch enables outline-style: auto to follow the curve of border-radius.
3626         When both border-radius and outline-style: auto are set, the native focusring painting will take the border-radius values
3627         into account. This is only for outline-style: auto, other non-auto outline styles paint as if there
3628         was no border-radius set.
3629         It supports both single and multiline content with joint rectangles.
3630         However in case of disjoint rectangles, we fallback to the non-radius drawing.
3631
3632         Tests: fast/inline/hidpi-outline-auto-with-border-radius-horizontal-ltr.html
3633                fast/inline/hidpi-outline-auto-with-border-radius-horizontal-rtl.html
3634                fast/inline/hidpi-outline-auto-with-border-radius-vertical-ltr.html
3635                fast/inline/hidpi-outline-auto-with-border-radius-vertical-rtl.html
3636
3637         * platform/graphics/GraphicsContext.h:
3638         * platform/graphics/Path.cpp:
3639         (WebCore::Path::addBeziersForRoundedRect):
3640         * platform/graphics/Path.h:
3641         (WebCore::Path::circleControlPoint):
3642         * platform/graphics/PathUtilities.cpp:
3643         (WebCore::polygonsForRect):
3644         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
3645         (WebCore::startAndEndPointsForCorner):
3646         (WebCore::cornerType):
3647         (WebCore::controlPointsForBezierCurve):
3648         (WebCore::adjustedtRadiiForHuggingCurve):
3649         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
3650         * platform/graphics/PathUtilities.h:
3651         * platform/graphics/mac/GraphicsContextMac.mm:
3652         (WebCore::GraphicsContext::drawFocusRing):
3653         * rendering/RenderElement.cpp:
3654         (WebCore::RenderElement::paintFocusRing):
3655
3656 2016-03-11  Ryosuke Niwa  <rniwa@webkit.org>
3657
3658         Add Event.deepPath() and Event.scoped
3659         https://bugs.webkit.org/show_bug.cgi?id=153538
3660         <rdar://problem/24363836>
3661
3662         Reviewed by Darin Adler.
3663
3664         Added the support for deepPath(), scoped, and relatedTargetScoped on Event.prototype for shadow DOM:
3665         http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event-interface
3666         and updated the EventPath class to respect scoped and relatedTargetScoped flags as specified at:
3667         http://w3c.github.io/webcomponents/spec/shadow/#get-the-parent
3668
3669         Tests: fast/shadow-dom/Extensions-to-Event-Interface.html
3670                fast/shadow-dom/trusted-event-scoped-flags.html
3671
3672         * bindings/scripts/CodeGeneratorJS.pm:
3673         (GenerateConstructorDefinition): Added the support for Conditional for InitializedByEventConstructor.
3674         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
3675         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.h:
3676         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3677         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
3678         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm:
3679         * bindings/scripts/test/TestEventConstructor.idl: Added a test case for using InitializedByEventConstructor
3680         with Conditional.
3681         * dom/Event.cpp:
3682         (WebCore::Event::Event): Initialize m_scoped and m_relatedTargetScoped from EventInit dictionary.
3683         (WebCore::Event::scoped): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#scoped-flag
3684         (WebCore::Event::deepPath): Added.
3685         * dom/Event.h:
3686         (WebCore::Event::relatedTargetScoped): Added. Overridden by FocusEvent and MouseEvent to implement
3687         http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
3688         (WebCore::Event::setEventPath): Added.
3689         (WebCore::Event::clearEventPath): Added.
3690         * dom/Event.idl: Added scoped, relatedTargetScoped, and deepPath() conditionally enabled for shadow DOM.
3691         * dom/EventContext.h:
3692         (WebCore::EventContext::currentTarget):
3693         * dom/EventDispatcher.cpp:
3694         (WebCore::EventDispatcher::dispatchEvent): Set the event path while the event is being dispatched.
3695         * dom/EventPath.cpp:
3696         (WebCore::shouldEventCrossShadowBoundary): Check event.scoped flag instead of hard-coding a list of events here
3697         which has been moved to Event::scoped. See above.
3698         (WebCore::EventPath::setRelatedTarget): Check m_event.relatedTargetScoped() instead of hard-coding a list of
3699         events here. relatedTargetScoped is overridden by FocusEvent and MouseEvent.
3700         (WebCore::EventPath::hasEventListeners): Fixed the misleading variable name.
3701         (WebCore::isUnclosedNodeOf): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#dfn-unclosed-node
3702         (WebCore::EventPath::computePathDisclosedToTarget): Added. Implements the algorithm to filter event targets:
3703         http://w3c.github.io/webcomponents/spec/shadow/#widl-Event-deepPath-sequence-EventTarget
3704         * dom/EventPath.h:
3705         * dom/FocusEvent.cpp:
3706         (WebCore::FocusEvent::relatedTargetScoped): Returns true when this is a trusted event per:
3707         http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
3708         * dom/FocusEvent.h:
3709         * dom/MouseEvent.cpp:
3710         (WebCore::MouseEvent::relatedTargetScoped): Ditto.
3711         * dom/MouseEvent.h:
3712
3713 2016-03-11  John Wilander  <wilander@apple.com>
3714
3715         Move prevalent resource classifier from WebCore to WebKit.
3716         https://bugs.webkit.org/show_bug.cgi?id=155242
3717         <rdar://problem/24913272>
3718
3719         Reviewed by Andy Estes.
3720
3721         No new tests since we have yet to decide how to set up tests for prevalent resources.
3722
3723         * loader/ResourceLoadObserver.cpp:
3724         (WebCore::ResourceLoadObserver::logFrameNavigation):
3725         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3726             - Removed calls to old classifier in WebCore.
3727         * loader/ResourceLoadStatistics.cpp:
3728         (WebCore::encodeHashCountedSet):
3729         (WebCore::ResourceLoadStatistics::checkAndSetAsPrevalentResourceIfNecessary): Deleted.
3730         (WebCore::ResourceLoadStatistics::hasPrevalentResourceCharacteristics): Deleted.
3731         * loader/ResourceLoadStatistics.h:
3732             - Deleted old classification functions.
3733         * loader/ResourceLoadStatisticsStore.cpp:
3734         (WebCore::ResourceLoadStatisticsStore::create):
3735         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler):
3736         (WebCore::ResourceLoadStatisticsStore::hasEnoughDataForStatisticsProcessing):
3737             - New function to allow for checks before calls to processStatistics.
3738         (WebCore::ResourceLoadStatisticsStore::processStatistics):
3739             - New function that receives a lamda and executes it on every entry in its statistics map.
3740         * loader/ResourceLoadStatisticsStore.h:
3741
3742 2016-03-11  Jiewen Tan  <jiewen_tan@apple.com>
3743
3744         WebKit should not be redirected to an invalid URL
3745         https://bugs.webkit.org/show_bug.cgi?id=155263
3746         <rdar://problem/22820172>
3747
3748         Reviewed by Brent Fulgham.
3749
3750         Test: http/tests/navigation/redirect-to-invalid-url.html
3751
3752         * loader/SubresourceLoader.cpp:
3753         (WebCore::SubresourceLoader::willSendRequestInternal):
3754
3755 2016-03-10  Maksim Kisilev <mkisilev@yandex-team.ru>
3756
3757         Fix typo in StyleTreeResolver.cpp
3758         https://bugs.webkit.org/show_bug.cgi?id=139946
3759
3760         Reviewed by Andy Estes.
3761
3762         The constructor for CheckForVisibilityChangeOnRecalcStyle was improperly comparing the
3763         result of WKContentChange() (which is not a function) to WKContentVisibilityChange. I
3764         believe the above cast would implicitly resolve to WKContentNoChange in all cases,
3765         whether a visibility change had been observed or not.
3766         
3767         This patch corrects this problem. I would expect that this might affect some content
3768         visibility change behavior, but I'm not sure what the appropriate test case would be
3769         since this was apparently found through code inspection.
3770
3771         * style/StyleTreeResolver.cpp:
3772         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle):
3773
3774 2016-03-11  Chris Dumez  <cdumez@apple.com>
3775
3776         iOS-sim debug: WebCoreNSURLSessionTest.BasicOperation and WebCoreNSURLSessionTest.InvalidateEmpty asserting
3777         https://bugs.webkit.org/show_bug.cgi?id=155256
3778
3779         Reviewed by Alexey Proskuryakov.
3780
3781         r197628 consolidated the runtime application checking code for iOS and
3782         Mac. However, while the new code works fine for WebKit2, it is unsafe
3783         on WebKit1 / iOS and hits assertion in debug. The reason is that
3784         applicationBundleIdentifier() for getting called from several threads
3785         (WebThread, UIThread).
3786
3787         To address the problem, this patch renames applicationBundleIdentifier()
3788         to applicationBundleIdentifierOverride() and only initializes the
3789         override upon WebProcess and Network process initialization. We therefore
3790         do not initialize the override in WebKit1 or in the WebKit2 UIProcess.
3791         When the override is not set, we fall back to using the main bundle
3792         identifier (which does the right thing for WebKit1 / WebKit2 UIProcess)
3793         but without caching it to avoid thread safety issues.
3794
3795         No new tests, already covered by API tests currently crashing.
3796
3797         * platform/RuntimeApplicationChecks.mm:
3798         (WebCore::applicationBundleIdentifierOverride):
3799         - Renamed applicationBundleIdentifier() to applicationBundleIdentifierOverride()
3800           and only initialize upon initialization of the WebProcess or the Network
3801           process.
3802         - In debug, set a flag to indicate that the override was already queried.
3803
3804         (WebCore::applicationBundleIdentifier):
3805         New utility function that is returns the application bundle override if it is
3806         set and fallback to calling [[NSBundle mainBundle] bundleIdentifier] otherwise.
3807
3808         (WebCore::setApplicationBundleIdentifier):
3809         Add assertions to make sure that:
3810         1. This is always called from the main thread.
3811         2. The application bundle identifier has not been queried *before* getting
3812            overriden as this would indicate a bug in our code and we would have wrongly
3813            returned the main bundle identifier in such case.
3814
3815         (WebCore::MacApplication::isAppleMail):
3816         (WebCore::MacApplication::isIBooks):
3817         (WebCore::MacApplication::isITunes):
3818         (WebCore::MacApplication::isMicrosoftMessenger):
3819         (WebCore::MacApplication::isAdobeInstaller):
3820         (WebCore::MacApplication::isMicrosoftOutlook):
3821         (WebCore::MacApplication::isQuickenEssentials):
3822         (WebCore::MacApplication::isAperture):
3823         (WebCore::MacApplication::isVersions):
3824         (WebCore::MacApplication::isHRBlock):
3825         (WebCore::MacApplication::isHipChat):
3826         (WebCore::IOSApplication::isMobileSafari):
3827         (WebCore::IOSApplication::isDumpRenderTree):
3828         (WebCore::IOSApplication::isMobileStore):
3829         (WebCore::IOSApplication::isFacebook):
3830         (WebCore::IOSApplication::isDaijisenDictionary):
3831         (WebCore::IOSApplication::isNASAHD):
3832         (WebCore::IOSApplication::isTheEconomistOnIphone):
3833         (WebCore::IOSApplication::isWebProcess):
3834         (WebCore::IOSApplication::isIBooks):
3835         Drop assertions making sure the cached flag is correct. We now have
3836         an assertion to detect this earlier in setApplicationBundleIdentifier().
3837
3838 2016-03-10  Jer Noble  <jer.noble@apple.com>
3839
3840         Web Audio becomes distorted after sample rate changes
3841         https://bugs.webkit.org/show_bug.cgi?id=154538
3842         <rdar://problem/24771292>
3843
3844         Reviewed by Darin Adler.
3845
3846         When the underlying audio hardware sample rate changes, the AudioUnit render callback will begin asking
3847         for fewer or more frames. For example, when the sample rate goes from 44.1kHz to 48kHz, it will ask for
3848         118 samples instead of 128. (And vice-versa, 140 samples instead of 128.) But the Web Audio engine can only
3849         really handle requests in multiples of 128 samples. In the case where there are requests for < 128 samples,
3850         actually render 128, but save off the unrequested samples in a separate bus. Then fill that bus during the
3851         next request.
3852
3853         * platform/audio/AudioBus.cpp:
3854         (WebCore::AudioBus::copyFromRange): Added utility method.
3855         * platform/audio/AudioBus.h:
3856         * platform/audio/ios/AudioDestinationIOS.cpp:
3857         (WebCore::AudioDestinationIOS::AudioDestinationIOS): Create a "spare" bus.
3858         (WebCore::assignAudioBuffersToBus): Moved from inside render.
3859         (WebCore::AudioDestinationIOS::render): Save off extra samples to the "spare" bus.
3860         * platform/audio/ios/AudioDestinationIOS.h:
3861
3862 2016-03-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3863
3864         Unreviewed build fix after r198023.
3865         https://bugs.webkit.org/show_bug.cgi?id=155024
3866
3867         Reviewed by Geoffrey Garen.
3868
3869         Update binding test results.
3870
3871         * bindings/scripts/test/JS/JSTestObj.cpp:
3872         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
3873         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
3874         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
3875         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3876         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3877
3878 2016-03-11  Ryan Haddad  <ryanhaddad@apple.com>
3879
3880         Unreviewed, rolling out r197984.
3881
3882         This change caused an existing LayoutTest to fail
3883
3884         Reverted changeset:
3885
3886         "WebKit should not be redirected to an invalid URL"
3887         https://bugs.webkit.org/show_bug.cgi?id=155263
3888         http://trac.webkit.org/changeset/197984
3889
3890 2016-03-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3891
3892         [ES6] Implement Reflect.set without receiver support
3893         https://bugs.webkit.org/show_bug.cgi?id=155024
3894
3895         Reviewed by Geoffrey Garen.
3896
3897         CustomSetter returns boolean value that indicates the result of [[Set]].
3898         According to this change, this patch modifies the CodeGeneratorJS and test results.
3899
3900         Currently, DOM elements' [[Set]] return true when the setter is found.
3901         This is good for the first step.
3902
3903         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3904         (WebCore::JSCSSStyleDeclaration::putDelegate):
3905         * bindings/js/JSDOMBinding.cpp:
3906         (WebCore::throwSetterTypeError):
3907         * bindings/js/JSDOMBinding.h:
3908         * bindings/js/JSDOMStringMapCustom.cpp:
3909         (WebCore::JSDOMStringMap::putDelegate):
3910         * bindings/js/JSDOMWindowBase.cpp:
3911         (WebCore::JSDOMWindowBase::updateDocument):
3912         * bindings/js/JSDOMWindowCustom.cpp:
3913         (WebCore::JSDOMWindow::put):
3914         (WebCore::JSDOMWindow::putByIndex):
3915         * bindings/js/JSHTMLAppletElementCustom.cpp:
3916         (WebCore::JSHTMLAppletElement::putDelegate):
3917         * bindings/js/JSHTMLEmbedElementCustom.cpp:
3918         (WebCore::JSHTMLEmbedElement::putDelegate):
3919         * bindings/js/JSHTMLObjectElementCustom.cpp:
3920         (WebCore::JSHTMLObjectElement::putDelegate):
3921         * bindings/js/JSLocationCustom.cpp:
3922         (WebCore::JSLocation::putDelegate):
3923         (WebCore::JSLocationPrototype::putDelegate):
3924         * bindings/js/JSPluginElementFunctions.cpp:
3925         (WebCore::pluginElementCustomPut):
3926         * bindings/js/JSPluginElementFunctions.h:
3927         * bindings/js/JSStorageCustom.cpp:
3928         (WebCore::JSStorage::putDelegate):
3929         * bindings/scripts/CodeGeneratorJS.pm:
3930         (GenerateHeader):
3931         (GenerateImplementation):
3932         (GeneratePrototypeDeclaration):
3933         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3934         (WebCore::setJSTestActiveDOMObjectConstructor):
3935         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3936         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
3937         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3938         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
3939         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3940         (WebCore::setJSTestCustomNamedGetterConstructor):
3941         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3942         (WebCore::setJSTestEventConstructorConstructor):
3943         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3944         (WebCore::setJSTestEventTargetConstructor):
3945         * bindings/scripts/test/JS/JSTestException.cpp:
3946         (WebCore::setJSTestExceptionConstructor):
3947         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3948         (WebCore::setJSTestGenerateIsReachableConstructor):
3949         * bindings/scripts/test/JS/JSTestInterface.cpp:
3950         (WebCore::setJSTestInterfaceConstructor):
3951         (WebCore::JSTestInterface::put):
3952         (WebCore::JSTestInterface::putByIndex):
3953         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
3954         (WebCore::setJSTestInterfaceImplementsStr2):
3955         (WebCore::setJSTestInterfaceImplementsStr3):
3956         (WebCore::setJSTestInterfaceImplementsNode):
3957         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
3958         (WebCore::setJSTestInterfaceSupplementalStr2):
3959         (WebCore::setJSTestInterfaceSupplementalStr3):
3960         (WebCore::setJSTestInterfaceSupplementalNode):
3961         * bindings/scripts/test/JS/JSTestInterface.h:
3962         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3963         (WebCore::setJSTestJSBuiltinConstructorConstructor):
3964         (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
3965         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3966         (WebCore::setJSTestMediaQueryListListenerConstructor):
3967         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3968         (WebCore::setJSTestNamedConstructorConstructor):
3969         * bindings/scripts/test/JS/JSTestNode.cpp:
3970         (WebCore::setJSTestNodeConstructor):
3971         (WebCore::setJSTestNodeName):
3972         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3973         (WebCore::setJSTestNondeterministicConstructor):
3974         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
3975         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
3976         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
3977         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
3978         * bindings/scripts/test/JS/JSTestObj.cpp:
3979         (WebCore::setJSTestObjConstructor):
3980         (WebCore::setJSTestObjConstructorStaticStringAttr):
3981         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
3982         (WebCore::setJSTestObjEnumAttr):
3983         (WebCore::setJSTestObjByteAttr):
3984         (WebCore::setJSTestObjOctetAttr):
3985         (WebCore::setJSTestObjShortAttr):
3986         (WebCore::setJSTestObjUnsignedShortAttr):
3987         (WebCore::setJSTestObjLongAttr):
3988         (WebCore::setJSTestObjLongLongAttr):
3989         (WebCore::setJSTestObjUnsignedLongLongAttr):
3990         (WebCore::setJSTestObjStringAttr):
3991         (WebCore::setJSTestObjTestObjAttr):
3992         (WebCore::setJSTestObjLenientTestObjAttr):
3993         (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
3994         (WebCore::setJSTestObjXMLObjAttr):
3995         (WebCore::setJSTestObjCreate):
3996         (WebCore::setJSTestObjReflectedStringAttr):
3997         (WebCore::setJSTestObjReflectedIntegralAttr):
3998         (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
3999         (WebCore::setJSTestObjReflectedBooleanAttr):
4000         (WebCore::setJSTestObjReflectedURLAttr):
4001         (WebCore::setJSTestObjReflectedCustomIntegralAttr):
4002         (WebCore::setJSTestObjReflectedCustomBooleanAttr):
4003         (WebCore::setJSTestObjReflectedCustomURLAttr):
4004         (WebCore::setJSTestObjTypedArrayAttr):
4005         (WebCore::setJSTestObjAttrWithGetterException):
4006         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
4007         (WebCore::setJSTestObjAttrWithSetterException):
4008         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
4009         (WebCore::setJSTestObjStringAttrWithGetterException):
4010         (WebCore::setJSTestObjStringAttrWithSetterException):
4011         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
4012         (WebCore::setJSTestObjCustomAttr):
4013         (WebCore::setJSTestObjOnfoo):
4014         (WebCore::setJSTestObjWithScriptStateAttribute):
4015         (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
4016         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
4017         (WebCore::setJSTestObjWithScriptStateAttributeRaises):