[WinCairo] Unreviewed build fix.,
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-04-15  Brent Fulgham  <bfulgham@apple.com>
2
3         [WinCairo] Unreviewed build fix.,
4
5         * platform/network/curl/MultipartHandle.cpp:
6         (WebCore::MultipartHandle::parseHeadersIfPossible): Correct for new method signature.
7
8 2016-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
9
10         ASSERT when loading github.com
11         https://bugs.webkit.org/show_bug.cgi?id=156604
12         <rdar://problem/19890634>
13
14         Reviewed by Darin Adler.
15
16         HTMLFormControlElement::m_isValid is a cache of the results of the valid() function.
17         When cloning the node, we were preserving each individual item, but not the state
18         of the cache. Therefore, the cache and the attributes didn't agree with each other.
19
20         Test: fast/forms/checkValidity-cloneNode-crash.html
21
22         * html/HTMLInputElement.cpp:
23         (WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):
24
25 2016-04-15  Brent Fulgham  <bfulgham@apple.com>
26
27         Remove support for X-Frame-Options in `<meta>`
28         https://bugs.webkit.org/show_bug.cgi?id=156625
29         <rdar://problem/25748714>
30
31         Reviewed by Darin Adler.
32
33         Follow RFC7034 (Section 4), which recommends that 'X-Frame-Options' be ignored when delivered as part of
34         a '<meta http-equiv="...">' tag. This brings us in line with Firefox, Edge, and Blink.
35
36         Tests: http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html
37                http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow.html
38                http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html
39                http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html
40                http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored.html
41
42         * dom/Document.cpp:
43         (WebCore::Document::processHttpEquiv): Log error message instead of blocking the load.
44
45 2016-04-15  Jer Noble  <jer.noble@apple.com>
46
47         Audio elements should be able to have a controls manager.
48         https://bugs.webkit.org/show_bug.cgi?id=156630
49
50         Reviewed by Beth Dakin.
51
52         Now that there is no longer a architectural restriction about what kind of media elements
53         can be used with WebPlaybackSessionManager, allow audio elements to create a controls
54         manager.
55
56         Drive-by fix: clear the controls manager when destroying the media player due to entering
57         the page cache, and when destroying the media element.
58
59         * html/HTMLMediaElement.cpp:
60         (WebCore::HTMLMediaElement::~HTMLMediaElement):
61         (WebCore::HTMLMediaElement::updatePlayState):
62         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
63         * html/MediaElementSession.cpp:
64         (WebCore::MediaElementSession::canControlControlsManager):
65
66 2016-04-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
67
68         Calling SVGAnimatedPropertyTearOff::animationEnded() will crash if the SVG property is not animating
69         https://bugs.webkit.org/show_bug.cgi?id=156549
70
71         Reviewed by Darin Adler.
72
73         A speculative fix for a crash which may happen when calling animationEnded()
74         of any SVGAnimatedProperty while it is not animating.
75
76         * svg/SVGAnimatedTypeAnimator.h:
77         (WebCore::SVGAnimatedTypeAnimator::executeAction):
78
79 2016-04-15  Jer Noble  <jer.noble@apple.com>
80
81         Unreviewed build fix for iOS simulator. Assert the correct variable.
82
83         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
84         (-[WebAVPlayerLayer layoutSublayers]):
85         (-[WebAVPlayerLayer resolveBounds]):
86         (-[WebAVPlayerLayer setVideoGravity:]):
87
88 2016-04-14  Jer Noble  <jer.noble@apple.com>
89
90         Allow WebVideoFullscreenManager and Proxy to be used by audio elements.
91         https://bugs.webkit.org/show_bug.cgi?id=156564
92
93         Reviewed by Beth Dakin.
94
95         No new tests; this refactors existing functionality into new classes.
96
97         Tease apart the various WebVideoFullscreen{Interface,Model}{AVKit,Mac,VideoElement} into new
98         WebPlaybackSession… classes dealing exclusively with playback state and commands, leaving
99         fullscreen state and commands in the WebVideoFullscreen… classes. Specifically, create the
100         following new classes:
101
102         - WebPlaybackSessionInterface (copied from WebVideoFullscreenInterface)
103         - WebPlaybackSessionModelMediaElement (copied from WebVideoFullscreenModelMediaElement)
104         - WebPlaybackSessionModel (copied from WebVideoFullscreenModel)
105         - WebPlaybackSessionInterfaceAVKit (copied from WebVideoFullscreenInterfaceAVKit)
106         - WebPlaybackSessionInterfaceMac (copied from WebVideoFullscreenInterfaceMac)
107
108         WebVideoFullscreenInterface and WebVideoFullscreenModel now inherit from
109         WebPlaybackSessionInterface and WebPlaybackSessionModel, respectively. The concrete
110         WebVideoFullscreen… subclasses each take their respective WebPlaybackSession… subclasses and
111         fulfill their WebPlaybackSession interfaces through composition.
112
113         As part of this big tease-apart, the WebAVPlayerController class needs to be exposed in a
114         header (as it's accessed by two different classes now), so that class is moved into its own
115         implementation and header files.
116
117         The one case where a change in a WebPlaybackSession… class needs to be reflected in a
118         WebVideoFullscreen… class is in WebPlaybackSessionInterfaceAVKit, where
119         WebVideoFullscreenInterfaceAVKit needs to be notified when external playback becomes dis/en-
120         abled, so a new WebPlaybackSessionInterfaceAVKitClient interface has been added to allow the
121         WebPlaybackSession… to notify the WebVideoFullscreen….
122
123         The responsibility for the "controls manager" has moved from the WebVideoFullscreen… classes
124         to the WebPlaybackSession… classes, so the ChromeClient interface for creating and destroying
125         those controls is similarly renamed from setUpVideoControlsManager() to
126         setUpPlaybackControlsManager().
127
128         * WebCore.xcodeproj/project.pbxproj:
129         * html/HTMLMediaElement.cpp:
130         (WebCore::HTMLMediaElement::updatePlayState):
131         * page/ChromeClient.h:
132         * platform/cocoa/WebPlaybackSessionInterface.h: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h.
133         (WebCore::WebPlaybackSessionInterface::~WebPlaybackSessionInterface):
134         * platform/cocoa/WebPlaybackSessionModel.h: Added.
135         (WebCore::WebPlaybackSessionModel::~WebPlaybackSessionModel):
136         * platform/cocoa/WebPlaybackSessionModelMediaElement.h: Added.
137         (WebCore::WebPlaybackSessionModelMediaElement::create):
138         (WebCore::WebPlaybackSessionModelMediaElement::mediaElement):
139         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: Added.
140         (WebPlaybackSessionModelMediaElement::WebPlaybackSessionModelMediaElement):
141         (WebPlaybackSessionModelMediaElement::~WebPlaybackSessionModelMediaElement):
142         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
143         (WebPlaybackSessionModelMediaElement::setMediaElement):
144         (WebPlaybackSessionModelMediaElement::handleEvent):
145         (WebPlaybackSessionModelMediaElement::updateForEventName):
146         (WebPlaybackSessionModelMediaElement::play):
147         (WebPlaybackSessionModelMediaElement::pause):
148         (WebPlaybackSessionModelMediaElement::togglePlayState):
149         (WebPlaybackSessionModelMediaElement::beginScrubbing):
150         (WebPlaybackSessionModelMediaElement::endScrubbing):
151         (WebPlaybackSessionModelMediaElement::seekToTime):
152         (WebPlaybackSessionModelMediaElement::fastSeek):
153         (WebPlaybackSessionModelMediaElement::beginScanningForward):
154         (WebPlaybackSessionModelMediaElement::beginScanningBackward):
155         (WebPlaybackSessionModelMediaElement::endScanning):
156         (WebPlaybackSessionModelMediaElement::selectAudioMediaOption):
157         (WebPlaybackSessionModelMediaElement::selectLegibleMediaOption):
158         (WebPlaybackSessionModelMediaElement::updateLegibleOptions):
159         (WebPlaybackSessionModelMediaElement::observedEventNames):
160         (WebPlaybackSessionModelMediaElement::eventNameAll):
161         * platform/cocoa/WebPlaybackSessionModelVideoElement.cpp: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
162         (WebPlaybackSessionModelVideoElement::WebPlaybackSessionModelVideoElement):
163         (WebPlaybackSessionModelVideoElement::~WebPlaybackSessionModelVideoElement):
164         (WebPlaybackSessionModelVideoElement::setWebVideoFullscreenInterface):
165         (WebPlaybackSessionModelVideoElement::setVideoElement):
166         (WebPlaybackSessionModelVideoElement::handleEvent):
167         (WebPlaybackSessionModelVideoElement::updateForEventName):
168         (WebPlaybackSessionModelVideoElement::play):
169         (WebPlaybackSessionModelVideoElement::pause):
170         (WebPlaybackSessionModelVideoElement::togglePlayState):
171         (WebPlaybackSessionModelVideoElement::beginScrubbing):
172         (WebPlaybackSessionModelVideoElement::endScrubbing):
173         (WebPlaybackSessionModelVideoElement::seekToTime):
174         (WebPlaybackSessionModelVideoElement::fastSeek):
175         (WebPlaybackSessionModelVideoElement::beginScanningForward):
176         (WebPlaybackSessionModelVideoElement::beginScanningBackward):
177         (WebPlaybackSessionModelVideoElement::endScanning):
178         (WebPlaybackSessionModelVideoElement::selectAudioMediaOption):
179         (WebPlaybackSessionModelVideoElement::selectLegibleMediaOption):
180         (WebPlaybackSessionModelVideoElement::updateLegibleOptions):
181         (WebPlaybackSessionModelVideoElement::observedEventNames):
182         (WebPlaybackSessionModelVideoElement::eventNameAll):
183         * platform/cocoa/WebVideoFullscreenInterface.h:
184         * platform/cocoa/WebVideoFullscreenModel.h:
185         (WebCore::WebVideoFullscreenModel::~WebVideoFullscreenModel): Deleted.
186         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
187         (WebCore::WebVideoFullscreenModelVideoElement::create):
188         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
189         (WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement):
190         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface):
191         (WebVideoFullscreenModelVideoElement::setVideoElement):
192         (WebVideoFullscreenModelVideoElement::play):
193         (WebVideoFullscreenModelVideoElement::pause):
194         (WebVideoFullscreenModelVideoElement::togglePlayState):
195         (WebVideoFullscreenModelVideoElement::beginScrubbing):
196         (WebVideoFullscreenModelVideoElement::endScrubbing):
197         (WebVideoFullscreenModelVideoElement::seekToTime):
198         (WebVideoFullscreenModelVideoElement::fastSeek):
199         (WebVideoFullscreenModelVideoElement::beginScanningForward):
200         (WebVideoFullscreenModelVideoElement::beginScanningBackward):
201         (WebVideoFullscreenModelVideoElement::endScanning):
202         (WebVideoFullscreenModelVideoElement::selectAudioMediaOption):
203         (WebVideoFullscreenModelVideoElement::selectLegibleMediaOption):
204         (WebVideoFullscreenModelVideoElement::handleEvent): Deleted.
205         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): Deleted.
206         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
207         (WebVideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
208         (WebVideoFullscreenModelVideoElement::observedEventNames): Deleted.
209         (WebVideoFullscreenModelVideoElement::eventNameAll): Deleted.
210         (WebVideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
211         (WebVideoFullscreenModelVideoElement::isVisible): Deleted.
212         * platform/ios/WebAVPlayerController.h: Added.
213         * platform/ios/WebAVPlayerController.mm: Added.
214         (-[WebAVPlayerController dealloc]):
215         (-[WebAVPlayerController resetState]):
216         (-[WebAVPlayerController player]):
217         (-[WebAVPlayerController forwardingTargetForSelector:]):
218         (-[WebAVPlayerController play:]):
219         (-[WebAVPlayerController pause:]):
220         (-[WebAVPlayerController togglePlayback:]):
221         (-[WebAVPlayerController togglePlaybackEvenWhenInBackground:]):
222         (-[WebAVPlayerController isPlaying]):
223         (-[WebAVPlayerController setPlaying:]):
224         (+[WebAVPlayerController keyPathsForValuesAffectingPlaying]):
225         (-[WebAVPlayerController beginScrubbing:]):
226         (-[WebAVPlayerController endScrubbing:]):
227         (-[WebAVPlayerController seekToTime:]):
228         (-[WebAVPlayerController currentTimeWithinEndTimes]):
229         (-[WebAVPlayerController setCurrentTimeWithinEndTimes:]):
230         (+[WebAVPlayerController keyPathsForValuesAffectingCurrentTimeWithinEndTimes]):
231         (-[WebAVPlayerController hasLiveStreamingContent]):
232         (+[WebAVPlayerController keyPathsForValuesAffectingHasLiveStreamingContent]):
233         (-[WebAVPlayerController skipBackwardThirtySeconds:]):
234         (-[WebAVPlayerController gotoEndOfSeekableRanges:]):
235         (-[WebAVPlayerController canScanForward]):
236         (+[WebAVPlayerController keyPathsForValuesAffectingCanScanForward]):
237         (-[WebAVPlayerController beginScanningForward:]):
238         (-[WebAVPlayerController endScanningForward:]):
239         (-[WebAVPlayerController beginScanningBackward:]):
240         (-[WebAVPlayerController endScanningBackward:]):
241         (-[WebAVPlayerController canSeekToBeginning]):
242         (+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToBeginning]):
243         (-[WebAVPlayerController seekToBeginning:]):
244         (-[WebAVPlayerController seekChapterBackward:]):
245         (-[WebAVPlayerController canSeekToEnd]):
246         (+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToEnd]):
247         (-[WebAVPlayerController seekToEnd:]):
248         (-[WebAVPlayerController seekChapterForward:]):
249         (-[WebAVPlayerController hasMediaSelectionOptions]):
250         (+[WebAVPlayerController keyPathsForValuesAffectingHasMediaSelectionOptions]):
251         (-[WebAVPlayerController hasAudioMediaSelectionOptions]):
252         (+[WebAVPlayerController keyPathsForValuesAffectingHasAudioMediaSelectionOptions]):
253         (-[WebAVPlayerController hasLegibleMediaSelectionOptions]):
254         (+[WebAVPlayerController keyPathsForValuesAffectingHasLegibleMediaSelectionOptions]):
255         (-[WebAVPlayerController currentAudioMediaSelectionOption]):
256         (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
257         (-[WebAVPlayerController currentLegibleMediaSelectionOption]):
258         (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
259         (-[WebAVPlayerController isPlayingOnExternalScreen]):
260         (+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]):
261         (-[WebAVPlayerController isPictureInPictureInterrupted]):
262         (-[WebAVPlayerController setPictureInPictureInterrupted:]):
263         * platform/ios/WebPlaybackSessionInterfaceAVKit.h: Added.
264         (WebCore::WebPlaybackSessionInterfaceAVKitClient::~WebPlaybackSessionInterfaceAVKitClient):
265         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm: Added.
266         (WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
267         (WebCore::WebPlaybackSessionInterfaceAVKit::~WebPlaybackSessionInterfaceAVKit):
268         (WebCore::WebPlaybackSessionInterfaceAVKit::resetMediaState):
269         (WebCore::WebPlaybackSessionInterfaceAVKit::setWebPlaybackSessionModel):
270         (WebCore::WebPlaybackSessionInterfaceAVKit::setDuration):
271         (WebCore::WebPlaybackSessionInterfaceAVKit::setCurrentTime):
272         (WebCore::WebPlaybackSessionInterfaceAVKit::setBufferedTime):
273         (WebCore::WebPlaybackSessionInterfaceAVKit::setRate):
274         (WebCore::WebPlaybackSessionInterfaceAVKit::setSeekableRanges):
275         (WebCore::WebPlaybackSessionInterfaceAVKit::setCanPlayFastReverse):
276         (WebCore::mediaSelectionOptions):
277         (WebCore::WebPlaybackSessionInterfaceAVKit::setAudioMediaSelectionOptions):
278         (WebCore::WebPlaybackSessionInterfaceAVKit::setLegibleMediaSelectionOptions):
279         (WebCore::WebPlaybackSessionInterfaceAVKit::setExternalPlayback):
280         (WebCore::WebPlaybackSessionInterfaceAVKit::setWirelessVideoPlaybackDisabled):
281         (WebCore::WebPlaybackSessionInterfaceAVKit::wirelessVideoPlaybackDisabled):
282         (WebCore::WebPlaybackSessionInterfaceAVKit::invalidate):
283         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
284         (WebVideoFullscreenControllerContext::setUpFullscreen):
285         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
286         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
287         (-[WebAVPlayerViewControllerDelegate fullscreenInterface]):
288         (-[WebAVPlayerViewControllerDelegate setFullscreenInterface:]):
289         (-[WebAVPlayerLayer fullscreenInterface]):
290         (-[WebAVPlayerLayer setFullscreenInterface:]):
291         (-[WebAVPlayerLayer layoutSublayers]):
292         (-[WebAVPlayerLayer resolveBounds]):
293         (-[WebAVPlayerLayer setVideoGravity:]):
294         (WebVideoFullscreenInterfaceAVKit::create):
295         (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
296         (WebVideoFullscreenInterfaceAVKit::~WebVideoFullscreenInterfaceAVKit):
297         (WebVideoFullscreenInterfaceAVKit::playerController):
298         (WebVideoFullscreenInterfaceAVKit::resetMediaState):
299         (WebVideoFullscreenInterfaceAVKit::setDuration):
300         (WebVideoFullscreenInterfaceAVKit::setCurrentTime):
301         (WebVideoFullscreenInterfaceAVKit::setBufferedTime):
302         (WebVideoFullscreenInterfaceAVKit::setRate):
303         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
304         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges):
305         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse):
306         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
307         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
308         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
309         (WebVideoFullscreenInterfaceAVKit::externalPlaybackEnabledChanged):
310         (WebVideoFullscreenInterfaceAVKit::setWirelessVideoPlaybackDisabled):
311         (WebVideoFullscreenInterfaceAVKit::wirelessVideoPlaybackDisabled):
312         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
313         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
314         (WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoPictureInPicture):
315         (-[WebAVPlayerViewControllerDelegate playerViewControllerWillStartPictureInPicture:]): Deleted.
316         (-[WebAVPlayerViewControllerDelegate playerViewControllerDidStartPictureInPicture:]): Deleted.
317         (-[WebAVPlayerViewControllerDelegate playerViewControllerFailedToStartPictureInPicture:withError:]): Deleted.
318         (-[WebAVPlayerViewControllerDelegate playerViewControllerWillStopPictureInPicture:]): Deleted.
319         (-[WebAVPlayerViewControllerDelegate playerViewControllerDidStopPictureInPicture:]): Deleted.
320         (convertToExitFullScreenReason): Deleted.
321         (-[WebAVPlayerViewControllerDelegate playerViewController:shouldExitFullScreenWithReason:]): Deleted.
322         (-[WebAVPlayerViewControllerDelegate playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]): Deleted.
323         (-[WebAVPlayerLayer init]): Deleted.
324         (-[WebAVPlayerLayer dealloc]): Deleted.
325         (-[WebAVPlayerLayer videoGravity]): Deleted.
326         (-[WebAVPlayerLayer videoRect]): Deleted.
327         (+[WebAVPlayerLayer keyPathsForValuesAffectingVideoRect]): Deleted.
328         (WebAVPictureInPicturePlayerLayerView_layerClass): Deleted.
329         (getWebAVPictureInPicturePlayerLayerViewClass): Deleted.
330         (WebAVPlayerLayerView_layerClass): Deleted.
331         (WebAVPlayerLayerView_playerController): Deleted.
332         (WebAVPlayerLayerView_setPlayerController): Deleted.
333         (WebAVPlayerLayerView_videoView): Deleted.
334         (WebAVPlayerLayerView_setVideoView): Deleted.
335         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView): Deleted.
336         (WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView): Deleted.
337         (WebAVPlayerLayerView_pictureInPicturePlayerLayerView): Deleted.
338         (WebAVPlayerLayerView_dealloc): Deleted.
339         (getWebAVPlayerLayerViewClass): Deleted.
340         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): Deleted.
341         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenChangeObserver): Deleted.
342         (WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Deleted.
343         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Deleted.
344         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Deleted.
345         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Deleted.
346         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Deleted.
347         (WebVideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): Deleted.
348         (WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture): Deleted.
349         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): Deleted.
350         (WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Deleted.
351         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Deleted.
352         (WebVideoFullscreenInterfaceAVKit::watchdogTimerFired): Deleted.
353         (WebVideoFullscreenInterfaceAVKit::setMode): Deleted.
354         (WebVideoFullscreenInterfaceAVKit::clearMode): Deleted.
355         (WebCore::supportsPictureInPicture): Deleted.
356         * platform/mac/WebPlaybackSessionInterfaceMac.h: Added.
357         * platform/mac/WebPlaybackSessionInterfaceMac.mm: Copied from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
358         (-[WebAVMediaSelectionOptionMac localizedDisplayName]):
359         (-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]):
360         (-[WebPlaybackControlsManager initWithWebPlaybackSessionInterfaceMac:]):
361         (-[WebPlaybackControlsManager timing]):
362         (-[WebPlaybackControlsManager setTiming:]):
363         (-[WebPlaybackControlsManager seekableTimeRanges]):
364         (-[WebPlaybackControlsManager setSeekableTimeRanges:]):
365         (-[WebPlaybackControlsManager isSeeking]):
366         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
367         (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
368         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]):
369         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
370         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
371         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
372         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]):
373         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
374         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
375         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
376         (WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
377         (WebCore::WebPlaybackSessionInterfaceMac::setWebPlaybackSessionModel):
378         (WebCore::WebPlaybackSessionInterfaceMac::setDuration):
379         (WebCore::WebPlaybackSessionInterfaceMac::setCurrentTime):
380         (WebCore::WebPlaybackSessionInterfaceMac::setRate):
381         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
382         (WebCore::mediaSelectionOptions):
383         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
384         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
385         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
386         (WebCore::WebPlaybackSessionInterfaceMac::ensureControlsManager):
387         (WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager):
388         * platform/mac/WebVideoFullscreenInterfaceMac.h:
389         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
390         (WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
391         (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel):
392         (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
393         (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
394         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
395         (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
396         (WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
397         (WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
398         (WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
399         (WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac): Deleted.
400         (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenChangeObserver): Deleted.
401         (WebCore::WebVideoFullscreenInterfaceMac::setMode): Deleted.
402         (WebCore::WebVideoFullscreenInterfaceMac::clearMode): Deleted.
403         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen): Deleted.
404         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen): Deleted.
405         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen): Deleted.
406         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode): Deleted.
407         (WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen): Deleted.
408         (WebCore::WebVideoFullscreenInterfaceMac::invalidate): Deleted.
409         (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline): Deleted.
410         (WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions): Deleted.
411         (WebCore::supportsPictureInPicture): Deleted.
412
413 2016-04-15  Chris Dumez  <cdumez@apple.com>
414
415         [COCOA] Do not unnecessarily initialize ResourceResponse::m_httpVersion as part of common fields
416         https://bugs.webkit.org/show_bug.cgi?id=156606
417
418         Reviewed by Darin Adler.
419
420         Do not unnecessarily initialize ResourceResponse::m_httpVersion as part of common fields.
421
422         We previously initialized m_httpVersion when calling platformLazyInit(CommonFieldsOnly),
423         even though this is not a common field. The corresponding getter/setter in
424         HTTPResponseBase call lazyInit(AllFields).
425
426         * platform/network/cf/ResourceResponseCFNet.cpp:
427         (WebCore::ResourceResponse::platformLazyInit):
428         * platform/network/cocoa/ResourceResponseCocoa.mm:
429         (WebCore::ResourceResponse::platformLazyInit):
430
431 2016-04-15  John Wilander  <wilander@apple.com>
432
433         Refactor WebSockets handshake to use StringView instead of String for header validation.
434         https://bugs.webkit.org/show_bug.cgi?id=155602
435
436         Reviewed by Darin Adler.
437
438         No new tests. Existing test have been augmented.
439
440         * Modules/websockets/WebSocketHandshake.cpp:
441         (WebCore::WebSocketHandshake::readServerHandshake):
442             Made sure failure reason was set consistently with makeString().
443         (WebCore::headerHasValidHTTPVersion):
444             Now operates on the HTTP status line with StringView.
445         (WebCore::WebSocketHandshake::readStatusLine):
446             Now operates on the HTTP status line with StringView.
447         (WebCore::WebSocketHandshake::readHTTPHeaders):
448             Now operates on header names with StringView.
449             Made sure failure reason was set consistently with makeString() and ASCIILiteral().
450         (WebCore::WebSocketHandshake::checkResponseHeaders):
451             Made sure failure reason was set consistently with ASCIILiteral().
452         * platform/network/HTTPParsers.cpp:
453         (WebCore::parseHTTPRequestLine):
454             Made sure failure reason was set consistently with ASCIILiteral().
455         (WebCore::isValidHeaderNameCharacter):
456             Inlined function to check if a character is allowed in an HTTP header name according to RFC 7230.
457             https://tools.ietf.org/html/rfc7230 (June 2014)
458         (WebCore::parseHTTPHeader):
459         * platform/network/HTTPParsers.h:
460             Now receives the HTTP header name as a StringView.
461             Checks that header names only contain valid characters according to RFC 7230 (see above).
462         * platform/network/ResourceRequestBase.cpp:
463         (WebCore::ResourceRequestBase::addHTTPHeaderField):
464         * platform/network/ResourceRequestBase.h:
465              Now has an overloaded function which receives the HTTP header name as an HTTPHeaderName enum value.
466         * platform/network/ResourceResponseBase.cpp:
467         (WebCore::ResourceResponseBase::addHTTPHeaderField):
468         * platform/network/ResourceResponseBase.h:
469              Now has an overloaded function which receives the HTTP header name as an HTTPHeaderName enum value.
470
471 2016-04-15  Joanmarie Diggs  <jdiggs@igalia.com>
472
473         AX: Presentational role on SVG elements is trumped by child 'title' and 'desc' elements
474         https://bugs.webkit.org/show_bug.cgi?id=156519
475
476         Reviewed by Chris Fleizach.
477
478         Override the presentational role on SVG elements which have a child 'title' or 'desc'
479         element. As a result of this change, AccessibilitySVGRoot objects would be exposed
480         with an AccessibilityRole of UnknownRole. Therefore map included AccessibilitySVGRoot
481         objects to GroupRole as per the SVG Accessibility API Mapping specification.
482
483         Also use indexOfBestMatchingLanguageInList() to identify which child 'title' or 'desc'
484         element is the best match for the parent element.
485
486         New Test: accessibility/w3c-svg-content-language-attribute.html
487
488         Also: Update w3c-svg-presentational-role.html expectations because there are test cases
489         in which elements are now being included in the accessibility tree as a result of this
490         change. Also add new test cases which lack child 'title' and 'desc' elements.
491
492         * accessibility/AccessibilityNodeObject.h:
493         * accessibility/AccessibilitySVGElement.cpp:
494         (WebCore::AccessibilitySVGElement::childElementWithMatchingLanguage):
495         (WebCore::AccessibilitySVGElement::accessibilityDescription):
496         (WebCore::AccessibilitySVGElement::helpText):
497         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored):
498         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute):
499         * accessibility/AccessibilitySVGElement.h:
500         * accessibility/AccessibilitySVGRoot.h:
501
502 2016-04-15  Chris Dumez  <cdumez@apple.com>
503
504         Rename [GlobalContext] extended attribute to [Exposed] and align with WebIDL
505         https://bugs.webkit.org/show_bug.cgi?id=156615
506
507         Reviewed by Youenn Fablet.
508
509         Rename [GlobalContext] extended attribute to [Exposed] and align with WebIDL:
510         - http://heycam.github.io/webidl/#Exposed
511
512         * bindings/scripts/IDLAttributes.txt:
513         Stop recognizing [GlobalContext] and start recognizing [Exposed].
514
515         * bindings/scripts/IDLParser.pm:
516         (parseIdentifierList):
517         (parseExtendedAttributeRest2):
518         Add IDL parser support for having a list of identifiers as value
519         for an IDL extended attribute, e.g. Exposed=(Window, Worker).
520
521         * bindings/scripts/preprocess-idls.pl:
522         Tweak existing support for [GlobalContext] to use [Exposed] instead
523         and support the new syntax.
524
525         (getInterfaceExtendedAttributesFromIDL):
526         Do not split on commas that are within brackets.
527
528         * Modules/fetch/FetchBody.idl:
529         * Modules/fetch/FetchHeaders.idl:
530         * Modules/fetch/FetchRequest.idl:
531         * Modules/fetch/FetchResponse.idl:
532         * Modules/streams/ByteLengthQueuingStrategy.idl:
533         * Modules/streams/CountQueuingStrategy.idl:
534         * Modules/streams/ReadableStream.idl:
535         * Modules/streams/ReadableStreamController.idl:
536         * Modules/streams/ReadableStreamReader.idl:
537         * Modules/websockets/WebSocket.idl:
538         * dom/MessageChannel.idl:
539         * dom/MessageEvent.idl:
540         * fileapi/Blob.idl:
541         * fileapi/FileReader.idl:
542         * fileapi/FileReaderSync.idl:
543         * html/DOMURL.idl:
544         * html/ImageData.idl:
545         * page/EventSource.idl:
546         * workers/DedicatedWorkerGlobalScope.idl:
547         * workers/WorkerGlobalScope.idl:
548         * workers/WorkerLocation.idl:
549         * xml/XMLHttpRequest.idl:
550         * xml/XMLHttpRequestEventTarget.idl:
551         Use [Exposed] instead of [GlobalContext] to match their respective
552         specifications.
553
554 2016-04-15  Carlos Garcia Campos  <cgarcia@igalia.com>
555
556         Selection.deleteFromDocument should not leave a selection character
557         https://bugs.webkit.org/show_bug.cgi?id=151442
558
559         Reviewed by Michael Catanzaro.
560
561         This is a merge of Blink r172511:
562         https://codereview.chromium.org/255453003
563
564         Let Selection.deleteFromDocument not delete a character when the
565         selection is a caret.
566
567         Selection.deleteFromDocument delete a character when the selection
568         is a caret.
569         However, current standard says that Selection.deleteFromDocument
570         does nothing when the selection is a caret:
571         https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-deletefromdocument
572         Both IE10 and FireFox seem following the spec.
573
574         Test: imported/blink/editing/selection/deleteFromDocument-undo-crash.html
575
576         * page/DOMSelection.cpp:
577         (WebCore::DOMSelection::deleteFromDocument): Deleted.
578
579 2016-04-15  Antti Koivisto  <antti@apple.com>
580
581         Fix return value nullptr -> false.
582
583         * style/StyleSharingResolver.cpp:
584         (WebCore::Style::SharingResolver::canShareStyleWithElement):
585
586 2016-04-14  Antti Koivisto  <antti@apple.com>
587
588         AffectsNextSibling style relation marking is inefficient
589         https://bugs.webkit.org/show_bug.cgi?id=156593
590
591         Reviewed by Benjamin Poulain.
592
593         We currently add a Style::Relation entry for each sibling to mark. With long sibling lists this can be inefficient
594         in terms of both memory and speed. Instead make a single entry that includes the sibling count to mark.
595
596         * css/SelectorChecker.cpp:
597         (WebCore::addStyleRelation):
598
599             When adding AffectsNextSibling entry check if the last entry in the style relation vector has the
600             same type and is part of the same sibling chain. If so just update the existing entry.
601
602         * cssjit/SelectorCompiler.cpp:
603         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
604
605             The same thing in hand-crafted macro assembler.
606
607         * cssjit/SelectorCompiler.h:
608
609             Stop lying about the constness of the CheckingContext.
610
611         * style/StyleRelations.cpp:
612         (WebCore::Style::commitRelations):
613
614             Mark as many sibling elements as the value indicates.
615
616         * style/StyleRelations.h:
617         (WebCore::Style::Relation::Relation):
618
619             Make element a pointer so we can udpate it.
620
621 2016-04-15  Brady Eidson  <beidson@apple.com>
622
623         Add the message property to DOMError.
624         https://bugs.webkit.org/show_bug.cgi?id=139173
625
626         Reviewed by Alex Christensen.
627
628         No new tests (Updated existing tests).
629         
630         Adding this property brings us up to date with other browsers, and will help
631         test the few web features that still use DOMError.
632
633         * Modules/indexeddb/IDBOpenDBRequest.cpp:
634         (WebCore::IDBOpenDBRequest::onError):
635         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
636
637         * Modules/indexeddb/IDBRequest.cpp:
638         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
639         (WebCore::IDBRequest::onError):
640
641         * Modules/indexeddb/IDBTransaction.cpp:
642         (WebCore::IDBTransaction::didCreateIndexOnServer):
643
644         * Modules/mediastream/NavigatorUserMediaError.h:
645         (WebCore::NavigatorUserMediaError::NavigatorUserMediaError):
646
647         * dom/DOMError.cpp:
648         (WebCore::DOMError::DOMError):
649
650         * dom/DOMError.h:
651         (WebCore::DOMError::create):
652         (WebCore::DOMError::message):
653         * dom/DOMError.idl:
654
655 2016-04-14  Brent Fulgham  <bfulgham@apple.com>
656
657         Make <a download> a runtime enabled option
658         https://bugs.webkit.org/show_bug.cgi?id=156583
659         <rdar://problem/25733449>
660
661         Reviewed by Alex Christensen.
662
663         Mark the download attribute interface as EnabledAtRuntime=DownloadAttribute.
664         Add DownloadAttribute runtime flag getter and setter.
665
666         * bindings/generic/RuntimeEnabledFeatures.h:
667         (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled):
668         (WebCore::RuntimeEnabledFeatures::setDownloadAttributeEnabled):
669         (WebCore::RuntimeEnabledFeatures::downloadAttributeEnabled):
670         * html/HTMLAnchorElement.cpp:
671         (WebCore::HTMLAnchorElement::handleClick):
672         * html/HTMLAnchorElement.idl:
673
674 2016-04-14  David Kilzer  <ddkilzer@apple.com>
675
676         REGRESSION (r158956): Remove vestigial range code in FileReaderLoader class after removing ENABLE(STREAM)
677         <http://webkit.org/b/156609>
678
679         Reviewed by Brent Fulgham.
680
681         This code was left behind when ENABLE(STREAM) was removed in
682         November 2013.
683
684         * fileapi/FileReaderLoader.cpp:
685         (WebCore::FileReaderLoader::FileReaderLoader): Remove
686         initializers.
687         (WebCore::FileReaderLoader::start): Remove code that uses
688         m_hasRange, which is always false.
689         (WebCore::FileReaderLoader::didReceiveResponse): Ditto.
690         * fileapi/FileReaderLoader.h:
691         (WebCore::FileReaderLoader): Remove unused instance variables.
692
693 2016-04-14  Alex Christensen  <achristensen@webkit.org>
694
695         Build fix after r199549.
696         https://bugs.webkit.org/show_bug.cgi?id=156580
697
698         * CMakeLists.txt:
699         * PlatformEfl.cmake:
700         * PlatformGTK.cmake:
701         * PlatformWin.cmake:
702         KillRingNone.cpp is indeed platform-specific. KillRingMac.mm is used instead only on Mac.
703
704 2016-04-14  Dean Jackson  <dino@apple.com>
705
706         CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::CachedResource::addClientToSet + 27
707         https://bugs.webkit.org/show_bug.cgi?id=156602
708         <rdar://problem/18921091>
709
710         Reviewed by Simon Fraser.
711
712         The CSS property list-style-image is inherited, so a transition on a parent
713         might cause a transition on a child. On that child, the value might be between
714         two generated crossfade images which haven't yet resolved, causing a crash.
715
716         Test: transitions/crossfade-transition.html
717
718         * css/CSSCrossfadeValue.cpp:
719         (WebCore::CSSCrossfadeValue::blend): Return null if there are no cached images.
720         * page/animation/CSSPropertyAnimation.cpp:
721         (WebCore::blendFunc): If we don't have an actual image to blend between, fall
722         out to the default case.
723
724 2016-04-14  Antonio Gomes  <tonikitoo@webkit.org>
725
726         Allow listbox content and scrollbar to intrude padding area.
727         https://bugs.webkit.org/show_bug.cgi?id=128489
728
729         Reviewed by Myles C. Maxfield.
730
731         Originally when the RenderListBox::controlClipRect method was implemented (see [1]), it used
732         to allow its content (<option>'s) to intrude padding to get rendered. Overlay scrollbars were also
733         allowed to paint over the padding area, if necessary.
734
735         [2] changed this behavior to restrict list-box'es content within the content box rect (excluding padding and border).
736
737         This had two consequences:
738         1) it made WebKit disallow list-box' content to intrude the padding area, diverging from other vendors.
739         like Firefox and Chrome.
740         2) Since overlay scrollbar might get painted over the padding area, if any, [2] could result
741         in the scrollbar being clipped out if padding-right is set (or padding-left in case of RTL content).
742
743         Patch changed WebKit back so that it allows list-box' content and overlay scrollbars to intrude the
744         padding area, matching other browsers vendors
745
746         [1] https://trac.webkit.org/changeset/18819/trunk/WebCore/rendering/RenderListBox.cpp
747         [2] https://trac.webkit.org/changeset/19037/trunk/WebCore/rendering/RenderListBox.cpp
748
749         Tests: fast/forms/listbox-selection-3.html
750                fast/forms/listbox-padding-clip-selected.html
751                fast/forms/listbox-padding-clip-expected-mismatch.html (renamed from listbox-padding-clip-overlay-expected.html)
752                fast/forms/listbox-padding-clip-overlay-expected-mismatch.html (renamed from listbox-padding-clip-expected.html)
753
754         * rendering/RenderListBox.cpp:
755         (WebCore::RenderListBox::numVisibleItems): changed to allow list-box items to get rendered on the padding-bottom area.
756         This matches Firefox and Chrome.
757         (WebCore::RenderListBox::listIndexAtOffset): relax the check for a given list-box item at a specific offset in the vertical axis.
758         This means if an list-box item has its content painted into the padding-bottom area, it will be actionable by mouse clicking.
759         This matches Firefox and Chrome.
760         (WebCore::RenderListBox::controlClipRect): clips list-box content against the padding box rect rather than the content box rect,
761         to allow its list-box items' content intrude the padding area.
762         This matches Firefox and Chrome.
763
764 2016-04-14  Antti Koivisto  <antti@apple.com>
765
766         Collapsed border cache invalidation can lead to O(n^2) during style resolve
767         https://bugs.webkit.org/show_bug.cgi?id=156570
768
769         Reviewed by Darin Adler.
770
771         RenderTable::invalidateCollapsedBorders traverses all cells. It is called when table cell border changes.
772         This can result in O(n^2) during style resolve.
773
774         * rendering/RenderTable.cpp:
775         (WebCore::RenderTable::layout):
776         (WebCore::RenderTable::invalidateCollapsedBorders):
777
778             For cell border style change invalidate the hasEmptyCollapsedBorder bits only for the neighbouring cells.
779             They are the only ones that can be affected.
780
781         * rendering/RenderTable.h:
782         (WebCore::RenderTable::collapsedBordersAreValid):
783         (WebCore::RenderTable::collapsedEmptyBorderIsPresent):
784         (WebCore::RenderTable::currentBorderValue):
785         * rendering/RenderTableCell.cpp:
786         (WebCore::RenderTableCell::styleDidChange):
787
788 2016-04-14  Manuel Rego Casasnovas  <rego@igalia.com>
789
790         [css-grid] Implement CSSGridTemplateAreasValue::equals
791         https://bugs.webkit.org/show_bug.cgi?id=156578
792
793         Reviewed by Darin Adler.
794
795         This was causing an infinite loop setting grid-template-areas
796         from JavaScript.
797
798         The reason was that CSSGridTemplateAreasValue needs
799         an specific implementation of equals() method.
800
801         Test: fast/css-grid-layout/grid-template-areas-infinite-loop.html
802
803         * css/CSSGridTemplateAreasValue.cpp:
804         (WebCore::CSSGridTemplateAreasValue::equals):
805         * css/CSSGridTemplateAreasValue.h:
806
807 2016-04-14  Brent Fulgham  <bfulgham@apple.com>
808
809         [CMake] Clean up CMake files
810         https://bugs.webkit.org/show_bug.cgi?id=156580
811
812         Reviewed by Alex Christensen.
813
814         Revise the various CMake input files to reduce the amount of duplicated file references in
815         the various ports.
816
817         * CMakeLists.txt:
818         * PlatformAppleWin.cmake:
819         * PlatformEfl.cmake:
820         * PlatformGTK.cmake:
821         * PlatformWin.cmake:
822         * PlatformWinCairo.cmake:
823
824 2016-04-14  Frederic Wang  <fred.wang@free.fr>
825
826         RenderMathMLOperator: Add helper function to retrieve italic correction
827         https://bugs.webkit.org/show_bug.cgi?id=156572
828
829         Reviewed by Darin Adler.
830
831         No new tests, the helper function will only be used in bug 153918.
832
833         * rendering/mathml/RenderMathMLOperator.cpp:
834         (WebCore::RenderMathMLOperator::italicCorrection): Return the italic correction from the MATH table if it's a large operator.
835         * rendering/mathml/RenderMathMLOperator.h: Declare italicCorrection.
836
837 2016-04-14  Frederic Wang  <fwang@igalia.com>
838
839         RenderMathMLOperator: Move glyph measuring helper functions outside the class
840         https://bugs.webkit.org/show_bug.cgi?id=156571
841
842         Reviewed by Darin Adler.
843
844         No new tests, this is just a simple refactoring to prepare the patch
845         for bug 156542, without any behavior change.
846
847         * rendering/mathml/RenderMathMLOperator.cpp: MATHML_OPDICT_SIZE was removed in bug 152242, so no need to undef it.
848         (WebCore::boundsForGlyph): Static inline helper function moved from the RenderMathMLOperator class.
849         (WebCore::heightForGlyph): Ditto.
850         (WebCore::advanceWidthForGlyph): Ditto and renamed.
851         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Rename advanceForGlyph.
852         (WebCore::RenderMathMLOperator::findStretchyData): Ditto.
853         (WebCore::RenderMathMLOperator::updateStyle): Ditto.
854         (WebCore::RenderMathMLOperator::paintGlyph): Ditto.
855         (WebCore::RenderMathMLOperator::paint): Ditto.
856         (WebCore::RenderMathMLOperator::trailingSpaceError): Ditto.
857         (WebCore::RenderMathMLOperator::setOperatorProperties): Deleted.
858         (WebCore::RenderMathMLOperator::boundsForGlyph): Deleted.
859         (WebCore::RenderMathMLOperator::heightForGlyph): Deleted.
860         (WebCore::RenderMathMLOperator::advanceForGlyph): Deleted.
861         * rendering/mathml/RenderMathMLOperator.h:
862
863 2016-04-14  Frederic Wang  <fred.wang@free.fr>
864
865         Set some RenderMathMLOperator members as final
866         https://bugs.webkit.org/show_bug.cgi?id=156574
867
868         Reviewed by Darin Adler.
869
870         No new tests, this is only a simple refactoring without behavior change.
871
872         * rendering/mathml/RenderMathMLOperator.h: Replace "override" with "final" for some members.
873
874 2016-04-14  Frederic Wang  <fwang@igalia.com>
875
876         Ensure that RenderMathMLOperator::stretchTo functions are called with stretchy operators that have the correct direction
877         https://bugs.webkit.org/show_bug.cgi?id=156542
878
879         Reviewed by Darin Adler.
880
881         In the RenderMathMLUnderOver refactoring (r199293), we avoided doing a
882         horizontal stretchTo call for non-stretchy operators. Here we do the
883         same for RenderMathMLRow and avoid doing a vertical stretchTo call for
884         horizontal or non-stretchy operators. We also add appropriate ASSERT in
885         the RenderMathMLOperator::stretchTo functions. To avoid failing tests
886         with DOM/style update, we make our updates a bit stricter. Hopefully,
887         we could manage such things better in the future (bug 156536).
888
889         Tests: mathml/presentation/row-nonstretchy-or-horizontal.html
890                mathml/presentation/underover-nonstretchy-or-vertical.html
891
892         * mathml/MathMLTextElement.cpp:
893         (WebCore::MathMLTextElement::parseAttribute): Replace setOperatorFlagAndScheduleLayoutIfNeeded with a stronger rendering update.
894         Also ensure that this is done when the lspace/rspace attributes change.
895         This avoids breaking mathml/presentation/mo-lspace-rspace-dynamic.html
896         * rendering/mathml/RenderMathMLOperator.cpp:
897         (WebCore::RenderMathMLOperator::stretchTo): Add ASSERT to ensure that it is only called with stretchy operators that have the correct direction.
898         (WebCore::RenderMathMLOperator::styleDidChange): Do a stronger rendering update when the style changes.
899         This avoids breaking mathml/presentation/style-changed.html
900         (WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded): Deleted.
901         * rendering/mathml/RenderMathMLOperator.h: Make updateFromElement public so that it can be called from MathMLTextElement::parseAttribute
902         Remove setOperatorFlagAndScheduleLayoutIfNeeded and declare styleDidChange.
903         * rendering/mathml/RenderMathMLRow.cpp:
904         (WebCore::RenderMathMLRow::layoutRowItems): Only call stretchTo for vertical stretchy operators.
905
906 2016-04-14  Anders Carlsson  <andersca@apple.com>
907
908         When FileInputType::setFiles is called with an empty file list, the last set icon is not cleared
909         https://bugs.webkit.org/show_bug.cgi?id=156582
910
911         Reviewed by Beth Dakin.
912
913         * html/FileInputType.cpp:
914         (WebCore::FileInputType::requestIcon):
915
916 2016-04-14  Darin Adler  <darin@apple.com>
917
918         Remove UsePointersEvenForNonNullableObjectArguments from Internals
919         https://bugs.webkit.org/show_bug.cgi?id=156539
920
921         Reviewed by Alex Christensen.
922
923         * html/HTMLImageElement.idl: Exported this so it can be used as the type for
924         a function argument in Internals.idl.
925         * html/HTMLInputElement.idl: Ditto.
926         * html/HTMLLinkElement.idl: Ditto.
927         * html/HTMLSelectElement.idl: Ditto.
928
929         * testing/Internals.cpp:
930         (WebCore::InspectorStubFrontend::InspectorStubFrontend): Take a Page&.
931         (WebCore::Internals::create): Take a Document&.
932         (WebCore::Internals::resetToConsistentState): Take a Page&.
933         (WebCore::Internals::Internals): Take a Document&.
934         (WebCore::Internals::settings): Use nullptr instead of 0.
935         (WebCore::Internals::address): Take a Node&.
936         (WebCore::Internals::nodeNeedsStyleRecalc): Take a Node& and no ExceptionCode&.
937         (WebCore::Internals::styleChangeType): Ditto.
938         (WebCore::Internals::xhrResponseSource): Take an XMLHttpRequest&.
939         (WebCore::Internals::isSharingStyleSheetContents): Take two
940         HTMLLinkElement&.
941         (WebCore::Internals::isStyleSheetLoadingSubresources): Take an HTMLLinkElement&.
942         (WebCore::Internals::imageFrameIndex): Take an HTMLImageElement& and no
943         ExceptionCode&. Also return an unsigned rather than size_t, since the IDL expects
944         unsigned long, which means unsigned in C++ code.
945         (WebCore::Internals::treeScopeRootNode): Take a Node& and no ExceptionCode&.
946         (WebCore::Internals::parentTreeScope): Ditto.
947         (WebCore::Internals::pauseAnimationAtTimeOnElement): Take an Element&.
948         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
949         (WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
950         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
951         (WebCore::Internals::attached): Deleted.
952         (WebCore::Internals::elementRenderTreeAsText): Take an Element&.
953         (WebCore::Internals::hasPausedImageAnimations): Take an Element& and no
954         ExceptionCode&.
955         (WebCore::Internals::computedStyleIncludingVisitedInfo): Take a Node& and no
956         ExceptionCode&.
957         (WebCore::Internals::ensureShadowRoot): Take an Element&.
958         (WebCore::Internals::ensureUserAgentShadowRoot): Take an Element& and no
959         ExceptionCode&.
960         (WebCore::Internals::createShadowRoot): Take an Element&.
961         (WebCore::Internals::shadowRoot): Take an Element& and no ExceptionCode&.
962         (WebCore::Internals::shadowRootType): Take a Node&.
963         (WebCore::Internals::includerFor): Deleted.
964         (WebCore::Internals::shadowPseudoId): Take an Element& and no ExceptionCode&.
965         (WebCore::Internals::setShadowPseudoId): Ditto.
966         (WebCore::Internals::visiblePlaceholder): Take an Element&.
967         (WebCore::Internals::selectColorInColorChooser): Take an HTMLInputElement&.
968         (WebCore::Internals::boundingBox): Take an Element& and no ExceptionCode&.
969         (WebCore::Internals::markerCountForNode): Take a Node&.
970         (WebCore::Internals::markerAt): Ditto.
971         (WebCore::Internals::markerRangeForNode): Ditto.
972         (WebCore::Internals::markerDescriptionForNode): Ditto.
973         (WebCore::Internals::addTextMatchMarker): Take a const Range&.
974         (WebCore::Internals::setScrollViewPosition): Take int instead of long; long in
975         IDL means int in C++ code.
976         (WebCore::Internals::wasLastChangeUserEdit): Take an Element&.
977         (WebCore::Internals::elementShouldAutoComplete): Take an HTMLInputElement&.
978         (WebCore::Internals::setEditingValue): Take an HTMLInputElement& and no
979         ExceptionCode&.
980         (WebCore::Internals::setAutofilled): Ditto.
981         (WebCore::Internals::setShowAutoFillButton): Ditto.
982         (WebCore::Internals::scrollElementToRect): Take an Element& and int instead of long.
983         (WebCore::Internals::autofillFieldName): Take an Element&.
984         (WebCore::Internals::rangeFromLocationAndLength): Take an Element& and no ExceptionCode&.
985         (WebCore::Internals::locationFromRange): Ditto.
986         (WebCore::Internals::lengthFromRange): Take an Element& and const Range& and no
987         ExceptionCode&.
988         (WebCore::Internals::rangeAsText): Take const Range& an no ExceptionCode&.
989         (WebCore::Internals::subrange): Take Range& an no ExceptionCode&.
990         (WebCore::Internals::nodesFromRect): Take a Document&.
991         (WebCore::Internals::openDummyInspectorFrontend): Ditto.
992         (WebCore::Internals::layerTreeAsText): Take an Element&.
993         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
994         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
995         (WebCore::Internals::displayListForElement): Ditto.
996         (WebCore::Internals::replayDisplayListForElement): Ditto.
997         (WebCore::Internals::counterValue): Ditto.
998         (WebCore::Internals::pageNumber): Ditto.
999         (WebCore::Internals::webkitWillEnterFullScreenForElement): Ditto.
1000         (WebCore::Internals::webkitDidEnterFullScreenForElement): Ditto.
1001         (WebCore::Internals::webkitWillExitFullScreenForElement): Ditto.
1002         (WebCore::Internals::webkitDidExitFullScreenForElement): Ditto.
1003         (WebCore::Internals::layerFlushCount): Return unsigned instead of unsigned long.
1004         IDL unsigned long means unsigned in C++ code.
1005         (WebCore::Internals::styleRecalcCount): Ditto.
1006         (WebCore::Internals::compositingUpdateCount): Ditto.
1007         (WebCore::Internals::deserializeBuffer): Take an ArrayBuffer&.
1008         (WebCore::Internals::markerTextForListItem): Take an Element& and no ExceptionCode&.
1009         (WebCore::Internals::toolTipFromElement): Ditto.
1010         (WebCore::Internals::getImageSourceURL): Ditto.
1011         (WebCore::Internals::simulateAudioInterruption): Take an HTMLMediaElement&.
1012         (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
1013         (WebCore::Internals::isSelectPopupVisible): Take an HTMLSelectElement&.
1014         (WebCore::Internals::closestTimeToTimeRanges): Take a TimeRange&.
1015         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Take an Element&.
1016         (WebCore::Internals::isPluginSnapshotted): Take an Element& and no ExceptionCode&.
1017         (WebCore::Internals::bufferedSamplesForTrackID): Take a SourceBuffer&.
1018         (WebCore::Internals::setShouldGenerateTimestamps): Ditto.
1019         (WebCore::Internals::setMediaElementRestrictions): Take an HTMLMediaElement&.
1020         (WebCore::Internals::elementIsBlockingDisplaySleep): Take an HTMLMediaElement&.
1021         (WebCore::Internals::setAudioContextRestrictions): Take an AudioContext&.
1022         (WebCore::Internals::scrollSnapOffsets): Take an Element&.
1023         (WebCore::Internals::getCurrentMediaControlsStatusForElement): Take an HTMLMediaElement&.
1024         (WebCore::Internals::userVisibleString): Take a const DOMURL&.
1025         (WebCore::Internals::composedTreeAsText): Take a Node&.
1026
1027         * testing/Internals.h: Update for all the changes listed above.
1028
1029         * testing/Internals.idl: Removed UsePointersEvenForNonNullableObjectArguments. Removed
1030         many unneeded [RaisesException]. Used more specific types for many arguments. Removed
1031         unused, and unimplemented, attached and includedFor functions. Made the node argument to
1032         updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks nullable as well as optional.
1033
1034         * testing/Internals.mm:
1035         (WebCore::Internals::userVisibleString): Take a const DOMURL&.
1036
1037         * testing/js/WebCoreTestSupport.cpp:
1038         (WebCoreTestSupport::injectInternalsObject): Pass a Document& rather than a Document*.
1039         (WebCoreTestSupport::resetInternalsObject): Pass a Page& rather than a Page*.
1040
1041 2016-04-14  Daniel Bates  <dabates@apple.com>
1042
1043         CSP: Ignore report-only policy delivered via meta element
1044         https://bugs.webkit.org/show_bug.cgi?id=156565
1045         <rdar://problem/25718167>
1046
1047         Reviewed by Brent Fulgham.
1048
1049         Only honor a report-only policy delivered via the HTTP header Content-Security-Policy-Report-Only
1050         or X-WebKit-CSP-Report-Only as per section Content-Security-Policy-Report-Only Header Field of 
1051         the Content Security Policy Level 2 spec., <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015).
1052
1053         Currently we honor a report-only policy delivered via a meta element or an HTTP header. Instead
1054         we should only honor such a policy when delivered via an HTTP header.
1055
1056         Tests: http/tests/security/contentSecurityPolicy/1.1/reportonly-in-meta-ignored2.html
1057                http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-and-sends-report.php
1058                http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode.php
1059                http/tests/security/contentSecurityPolicy/report-multiple-violations-01.php
1060                http/tests/security/contentSecurityPolicy/report-multiple-violations-02.php
1061                http/tests/security/contentSecurityPolicy/report-only-report-uri-missing.php
1062
1063         * dom/Document.cpp:
1064         (WebCore::Document::processHttpEquiv): Do not process policy for HTTP equivalent header
1065         Content-Security-Policy-Report-Only and X-WebKit-CSP-Report-Only.
1066
1067 2016-04-14  Antoine Quint  <graouts@apple.com>
1068
1069         Dashboard is spelled as Dashbard in several source files
1070         https://bugs.webkit.org/show_bug.cgi?id=156577
1071
1072         Reviewed by Eric Carlson.
1073
1074         * html/HTMLCanvasElement.cpp:
1075         (WebCore::HTMLCanvasElement::getContext):
1076         * html/canvas/CanvasGradient.cpp:
1077         (WebCore::CanvasGradient::CanvasGradient):
1078         (WebCore::CanvasGradient::addColorStop):
1079         * html/canvas/CanvasGradient.h:
1080         (WebCore::CanvasGradient::setDashboardCompatibilityMode):
1081
1082 2016-04-14  Antoine Quint  <graouts@apple.com>
1083
1084         WebGL based canvases composite incorrectly after changing size
1085         https://bugs.webkit.org/show_bug.cgi?id=152556
1086         <rdar://problem/24012678>
1087
1088         Reviewed by Dean Jackson.
1089
1090         On iOS, we use the CAEAGLLayer's bounds to set the size of the backing store.
1091         However, that layer's bounds is also used to size the layer during layout. If
1092         the canvas backing store is resized after layout has been performed, the call
1093         to setBounds loses the layout value and the <canvas> element is incorrectly
1094         sized on screen.
1095
1096         To address this, when updating the backing store, we keep track of the previous
1097         layer bounds so we can reset it after we sized the backing store.
1098
1099         Test: webgl/webgl-backing-store-size-update.html
1100
1101         * platform/graphics/GraphicsContext3D.h:
1102         * platform/graphics/mac/GraphicsContext3DMac.mm:
1103         (WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable):
1104
1105 2016-04-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1106
1107         Unreviewed. Fix GObject DOM bindings API break after r199392.
1108
1109         Since r199392 webkit_dom_attr_set_value() no longer raises exceptions, but we need to keep the GError parameter
1110         to keep backwards compatibility.
1111
1112         * bindings/scripts/CodeGeneratorGObject.pm:
1113         (FunctionUsedToRaiseException):
1114
1115 2016-04-13  Daniel Bates  <dabates@apple.com>
1116
1117         CSP: Nested browsing context created for <object> or <embed> should respect object-src directive
1118         https://bugs.webkit.org/show_bug.cgi?id=156563
1119         <rdar://problem/25715713>
1120
1121         Reviewed by Darin Adler.
1122
1123         As per section object-src of the Content Security Policy Level 2 spec.,
1124         <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015), a nested browsing
1125         context created for an HTML object or HTML embed element should respect the object-src directive.
1126
1127         Currently a nested browsing context created for an HTML object or HTML embed element respects
1128         the child-src directive or frame-src directive (in that order). Instead such nested browsing
1129         contexts should respect the object-src directive.
1130
1131         Tests: http/tests/security/contentSecurityPolicy/object-src-allows-embed-blocked-by-child-src.html
1132                http/tests/security/contentSecurityPolicy/object-src-allows-embed-blocked-by-frame-src.html
1133                http/tests/security/contentSecurityPolicy/object-src-allows-object-blocked-by-child-src.html
1134                http/tests/security/contentSecurityPolicy/object-src-allows-object-blocked-by-frame-src.html
1135                http/tests/security/contentSecurityPolicy/object-src-blocks-embed-allowed-by-child-src.html
1136                http/tests/security/contentSecurityPolicy/object-src-blocks-embed-allowed-by-frame-src.html
1137                http/tests/security/contentSecurityPolicy/object-src-blocks-object-allowed-by-child-src.html
1138                http/tests/security/contentSecurityPolicy/object-src-blocks-object-allowed-by-frame-src.html
1139
1140         * loader/PolicyChecker.cpp:
1141         (WebCore::isAllowedByContentSecurityPolicy): Added. Checks whether the specified URL is allowed by the
1142         object-src or the child-src/frame-src directive for a plugin element and non-plugin element, respectively.
1143         (WebCore::PolicyChecker::checkNavigationPolicy): Modified to call isAllowedByContentSecurityPolicy().
1144
1145 2016-04-13  Daniel Bates  <dabates@apple.com>
1146
1147         CSP: Remove experimental directive reflected-xss
1148         https://bugs.webkit.org/show_bug.cgi?id=156554
1149
1150         Reviewed by Brent Fulgham.
1151
1152         The Content Security Policy directive reflected-xss was removed from the Content Security
1153         Policy Level 2 spec., <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015).
1154         This directive was considered experimental and was guarded by a run-time flag that was never
1155         enabled by default. We should remove support for this directive.
1156
1157         * html/parser/XSSAuditor.cpp:
1158         (WebCore::XSSAuditor::XSSAuditor): Initialize m_xssProtection to XSSProtectionDisposition::Enabled.
1159         (WebCore::XSSAuditor::init): Write logic in terms of enum class XSSProtectionDisposition.
1160         (WebCore::XSSAuditor::filterToken): Ditto.
1161         (WebCore::combineXSSProtectionHeaderAndCSP): Deleted.
1162         * html/parser/XSSAuditor.h: Change data type of m_xssProtection from ContentSecurityPolicy::ReflectedXSSDisposition
1163         to XSSProtectionDisposition.
1164         * html/parser/XSSAuditorDelegate.cpp: Ditto.
1165         (WebCore::buildConsoleError): Remove logic to emit a remarks in the console error when a XSS is
1166         blocked because of the directive reflected-xss. Also substituted "because" for "as" in the remark
1167         added to the error message when the XSS Auditor is enabled because the server did not send HTTP
1168         header X-XSS-Protection.
1169         * html/parser/XSSAuditorDelegate.h:
1170         (WebCore::XSSInfo::XSSInfo): Removed argument didSendCSPHeader as we are removing support for the
1171         directive reflected-xss.
1172         * page/csp/ContentSecurityPolicy.cpp:
1173         (WebCore::ContentSecurityPolicy::reflectedXSSDisposition): Deleted.
1174         (WebCore::ContentSecurityPolicy::reportInvalidReflectedXSS): Deleted.
1175         * page/csp/ContentSecurityPolicy.h:
1176         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1177         (WebCore::ContentSecurityPolicyDirectiveList::ContentSecurityPolicyDirectiveList): Remove initialization
1178         of m_reflectedXSSDisposition as we are removing support for the directive reflected-xss.
1179         (WebCore::ContentSecurityPolicyDirectiveList::parseReflectedXSS): Deleted.
1180         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Remove logic to parse directive reflected-xss.
1181         * page/csp/ContentSecurityPolicyDirectiveList.h:
1182         (WebCore::ContentSecurityPolicyDirectiveList::reflectedXSSDisposition): Deleted.
1183         * page/csp/ContentSecurityPolicyDirectiveNames.cpp:
1184         * page/csp/ContentSecurityPolicyDirectiveNames.h:
1185         * page/csp/ContentSecurityPolicySourceList.cpp:
1186         (WebCore::isCSPDirectiveName):
1187         (WebCore::isExperimentalDirectiveName): Deleted.
1188         * platform/network/HTTPParsers.cpp:
1189         (WebCore::parseXSSProtectionHeader): Write it terms of enum class XSSProtectionDisposition.
1190         * platform/network/HTTPParsers.h: Define enum class XSSProtectionDisposition. Change return type
1191         of parseXSSProtectionHeader() from ContentSecurityPolicy::ReflectedXSSDisposition to XSSProtectionDisposition
1192         as we are removing the former.
1193
1194 2016-04-13  Brady Eidson  <beidson@apple.com>
1195
1196         Modern IDB (Blob support): Support retrieving Blobs from IDB.
1197         https://bugs.webkit.org/show_bug.cgi?id=156367
1198
1199         Reviewed by Alex Christensen.
1200
1201         No new tests (No testable change in behavior yet, current tests pass).
1202
1203         This patch does the following:
1204         - Pulls BlobURLs and stored filenames out of IDB whenever an IDB record is fetched.
1205         - Adds those URLs and filenames to IDBValue.
1206         - Uses IDBValue in more places instead of SharedBuffer/ThreadSafeBuffer.
1207         - Teaches SerializedScriptValue, Blob, and File how to read the URLs and filenames when they exist.
1208         - Teaches the Blob registry to register a new type of Blob that is not a "File" but is backed by one.
1209
1210         * Modules/indexeddb/IDBCursor.cpp:
1211         (WebCore::IDBCursor::setGetResult):
1212         
1213         * Modules/indexeddb/IDBGetResult.h:
1214         (WebCore::IDBGetResult::IDBGetResult):
1215         
1216         * Modules/indexeddb/IDBRequest.cpp:
1217         (WebCore::IDBRequest::setResultToStructuredClone):
1218         * Modules/indexeddb/IDBRequest.h:
1219         
1220         * Modules/indexeddb/IDBTransaction.cpp:
1221         (WebCore::IDBTransaction::didGetRecordOnServer):
1222         
1223         * Modules/indexeddb/IDBValue.cpp:
1224         (WebCore::IDBValue::IDBValue):
1225         * Modules/indexeddb/IDBValue.h:
1226         
1227         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
1228         (WebCore::IDBServer::MemoryIndexCursor::currentData):
1229         
1230         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1231         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
1232         
1233         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1234         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1235         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
1236         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
1237         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1238         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1239         
1240         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1241         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
1242         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
1243         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1244         (WebCore::IDBServer::SQLiteIDBCursor::currentValue):
1245         (WebCore::IDBServer::SQLiteIDBCursor::currentValueBuffer): Deleted.
1246         
1247         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
1248         (WebCore::IDBServer::SQLiteIDBTransaction::backingStore):
1249         
1250         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1251         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
1252         
1253         * bindings/js/IDBBindingUtilities.cpp:
1254         (WebCore::deserializeIDBValueDataToJSValue):
1255         (WebCore::deserializeIDBValueData):
1256         (WebCore::deserializeIDBValue):
1257         * bindings/js/IDBBindingUtilities.h:
1258         
1259         * bindings/js/SerializedScriptValue.cpp:
1260         (WebCore::CloneDeserializer::deserialize):
1261         (WebCore::CloneDeserializer::CloneDeserializer):
1262         (WebCore::CloneDeserializer::readFile):
1263         (WebCore::CloneDeserializer::readTerminal):
1264         (WebCore::CloneDeserializer::blobFilePathForBlobURL):
1265         (WebCore::SerializedScriptValue::deserialize):
1266         * bindings/js/SerializedScriptValue.h:
1267
1268         * fileapi/Blob.cpp:
1269         (WebCore::Blob::Blob):
1270         * fileapi/Blob.h:
1271         (WebCore::Blob::deserialize):
1272
1273         * fileapi/File.cpp:
1274         (WebCore::File::File):
1275
1276         * fileapi/ThreadableBlobRegistry.cpp:
1277         (WebCore::threadableQueue):
1278         (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked):
1279         * fileapi/ThreadableBlobRegistry.h:
1280
1281         * platform/CrossThreadTask.h:
1282         (WebCore::createCrossThreadTask):
1283
1284         * platform/network/BlobRegistry.h:
1285
1286         * platform/network/BlobRegistryImpl.cpp:
1287         (WebCore::BlobRegistryImpl::registerBlobURL):
1288         (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
1289         * platform/network/BlobRegistryImpl.h:
1290
1291 2016-04-13  Zalan Bujtas  <zalan@apple.com>
1292
1293         Text on compositing layer with negative letter-spacing is truncated.
1294         https://bugs.webkit.org/show_bug.cgi?id=156550
1295         <rdar://problem/24212140>
1296
1297         Reviewed by Antti Koivisto.
1298
1299         Negative letter-spacing affects the right edge of content's visual overflow (for both RTL and LTR).
1300         This is similar to how normal line layout adjusts it at InlineFlowBox::addTextBoxVisualOverflow().
1301
1302         Test: fast/text/negative-letter-spacing-visual-overflow.html
1303
1304         * rendering/SimpleLineLayoutFunctions.cpp:
1305         (WebCore::SimpleLineLayout::computeOverflow):
1306         (WebCore::SimpleLineLayout::paintFlow):
1307         (WebCore::SimpleLineLayout::collectFlowOverflow):
1308
1309 2016-04-13  Eric Carlson  <eric.carlson@apple.com>
1310
1311         [iOS] remote command should be considered user events
1312         https://bugs.webkit.org/show_bug.cgi?id=156546
1313         <rdar://problem/25560877>
1314
1315         Reviewed by Jer Noble.
1316
1317         Test: media/remote-control-command-is-user-gesture.html
1318
1319         * html/HTMLMediaElement.cpp:
1320         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Increment/decrement 
1321           m_processingRemoteControlCommand around calling remote command method.
1322         (WebCore::HTMLMediaElement::processingUserGesture): Return true if called while handling
1323           a remote control command.
1324         * html/HTMLMediaElement.h:
1325
1326 2016-04-13  Antonio Gomes  <tonikitoo@webkit.org>
1327
1328         Non-resizable text field looks resizable
1329         https://bugs.webkit.org/show_bug.cgi?id=152271
1330
1331         Reviewed by Darin Adler.
1332
1333         The 'resizability' of an HTML element is controlled by its 'resize' CSS property value.
1334         By default it is 'none', but certain HTML elements, including <textarea>, have it
1335         set to 'both' by default (defined in html.css). These values mean no resize at all, and
1336         resizable in both vertical and horizontal axis, respectively.
1337         Additionally, 'vertical' and 'horizontal' values are also valid.
1338
1339         Problem here is that the way WebKit handles the 'resize' property on single line
1340         input elements (e.g. <input>) is different than other engines (read Gecko, Blink and Presto):
1341
1342         - Match: WebKit, Firefox, Presto and Blink all force single line input elements to be non-resizable,
1343         regardless of either the 'resize' properly is set or not.
1344
1345         - Mismatch: WebKit is the only engine that actually paints the resize control on single line
1346         input elements, even it having no effect.
1347
1348         On WebKit, this happens because the 'resize' property is wrongly implemented as 'inheritable',
1349         differently from other engines. In the way WebKit contructs its RenderTree, 'resize' property
1350         ends up spilling out of <input> and entering its shadow representation, carrying the 'resize'
1351         property on.
1352
1353         Patch fixes this by making the 'resize' properly be non-inherited, matching other vendors
1354         and the spec [1].
1355
1356         [1] https://drafts.csswg.org/css-ui/#resize
1357
1358         Tests: fast/css/resize-not-inherited.html
1359                fast/css/resize-single-line-input-no-paint.html
1360
1361         * rendering/style/RenderStyle.h:
1362         * rendering/style/StyleRareInheritedData.cpp:
1363         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1364         (WebCore::StyleRareInheritedData::operator==):
1365         * rendering/style/StyleRareInheritedData.h:
1366         * rendering/style/StyleRareNonInheritedData.cpp:
1367         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1368         (WebCore::StyleRareNonInheritedData::operator==):
1369         * rendering/style/StyleRareNonInheritedData.h:
1370
1371 2016-04-13  Darin Adler  <darin@apple.com>
1372
1373         Remove UsePointersEvenForNonNullableObjectArguments from DataTransfer
1374         https://bugs.webkit.org/show_bug.cgi?id=156495
1375
1376         Reviewed by Chris Dumez.
1377
1378         * dom/DataTransfer.idl: Removed UsePointersEvenForNonNullableObjectArguments
1379         and marked the element argument to setDragImage as nullable.
1380
1381 2016-04-13  Brady Eidson  <beidson@apple.com>
1382
1383         Modern IDB (Blob support): Support deleting stored blob files.
1384         https://bugs.webkit.org/show_bug.cgi?id=156523
1385
1386         Reviewed by Alex Christensen.
1387
1388         No new tests (No testable change in behavior yet, current tests pass).
1389
1390         There's 3 points in time when we need to delete blob files (and records of them):
1391         1 - When deleting a specific object store record.
1392         2 - When deleting an entire object store.
1393         3 - When deleting a whole database.
1394         
1395         This patch does those three things.
1396
1397         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1398         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
1399         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
1400         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
1401         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1402         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
1403         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
1404         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1405
1406         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1407         (WebCore::IDBServer::SQLiteIDBTransaction::commit):
1408         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
1409         (WebCore::IDBServer::SQLiteIDBTransaction::addRemovedBlobFile):
1410         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
1411
1412 2016-04-13  Frederic Wang  <fwang@igalia.com>
1413
1414         Fix two coding mistakes in MathMLInlineContainerElement::childrenChanged
1415         https://bugs.webkit.org/show_bug.cgi?id=156538
1416
1417         Reviewed by Darin Adler.
1418
1419         We fix the call to updateOperatorProperties inside MathMLInlineContainerElement::childrenChanged
1420         for the <math> and <msqrt> tags.
1421
1422         The <math> tag is already a RenderMathMLRow so the hasTagName(mathTag)
1423         conditional is never executed. The tag does not create any anonymous
1424         wrapper so we do not need a special case for it anyway.
1425
1426         The <msqrt> tag is not a RenderMathMLRow (yet). However, the anonymous
1427         wrapper behaving as a RenderMathMLRow is actually the last child, not
1428         the first one.
1429
1430         No new tests, this is already covered by mathml/presentation/mo-form-dynamic.html
1431         Note that for some reason the coding error for <msqrt> only shows up
1432         after the refactoring of bug 152244.
1433
1434         * mathml/MathMLInlineContainerElement.cpp:
1435         (WebCore::MathMLInlineContainerElement::childrenChanged): Fix the two mistakes and add some FIXME comments.
1436
1437 2016-04-12  Chris Dumez  <cdumez@apple.com>
1438
1439         Attr.value should not be nullable
1440         https://bugs.webkit.org/show_bug.cgi?id=156515
1441
1442         Reviewed by Benjamin Poulain.
1443
1444         Update Attr.value so that it is no longer nullable, as per:
1445         https://dom.spec.whatwg.org/#interface-attr
1446
1447         This aligns our behavior with Firefox and Chrome as well.
1448
1449         Test: fast/dom/Attr/value-not-nullable.html
1450
1451         * dom/Attr.cpp:
1452         (WebCore::Attr::setValueForBindings):
1453         (WebCore::Attr::setNodeValue):
1454         (WebCore::Attr::setValue):
1455         * dom/Attr.h:
1456         * dom/Attr.idl:
1457
1458 2016-04-12  Konstantin Tokarev  <annulen@yandex.ru>
1459
1460         Fixed uninitialization of Node::DataUnion with GCC 4.8.
1461         https://bugs.webkit.org/show_bug.cgi?id=156507
1462
1463         Reviewed by Michael Catanzaro.
1464
1465         This change fixes run time crashes caused by access to uninitialized
1466         memory in Node::renderer().
1467
1468         No new tests needed.
1469
1470         * dom/Node.h:
1471
1472 2016-04-12  Eric Carlson  <eric.carlson@apple.com>
1473
1474         [iOS] do not exit AirPlay when the screen locks
1475         https://bugs.webkit.org/show_bug.cgi?id=156502
1476         <rdar://problem/24616592>
1477
1478         Reviewed by Jer Noble.
1479
1480         * html/HTMLMediaElement.cpp:
1481         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Add logging.
1482         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): Don't tell the media engine to purge 
1483           data if it is playing to a wireless target because that will drop the connection.
1484
1485         * html/MediaElementSession.cpp:
1486         (WebCore::MediaElementSession::playbackPermitted): Add logging.
1487         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget): Drive by fix: iOS doesn't 
1488           have an explicit playbackTarget, don't test for it.
1489         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget): Ditto.
1490
1491 2016-04-12  Gavin Barraclough  <barraclough@apple.com>
1492
1493         WebKit should adopt journal_mode=wal for all SQLite databases.
1494         https://bugs.webkit.org/show_bug.cgi?id=133496
1495
1496         Rubber stamped by Chris Dumez.
1497
1498         Temporarily disable on iOS - this broke a test.
1499         (storage/websql/alter-to-info-table.html)
1500
1501         * platform/sql/SQLiteDatabase.cpp:
1502         (WebCore::SQLiteDatabase::open):
1503
1504 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
1505
1506         Web Inspector: Keyboard shortcut for "Inspect Element" only works when Web Inspector is open.
1507         https://bugs.webkit.org/show_bug.cgi?id=111193
1508         <rdar://problem/13325889>
1509
1510         Reviewed by Timothy Hatcher.
1511
1512         * inspector/InspectorClient.h:
1513         (WebCore::InspectorClient::elementSelectionChanged):
1514         * inspector/InspectorDOMAgent.cpp:
1515         (WebCore::InspectorDOMAgent::setSearchingForNode):
1516         Inform the client when element selection changes.
1517
1518 2016-04-12  Chris Dumez  <cdumez@apple.com>
1519
1520         Regression(r199360): assertion hit in Element::fastGetAttribute()
1521         https://bugs.webkit.org/show_bug.cgi?id=156509
1522
1523         Reviewed by Ryosuke Niwa.
1524
1525         Stop using fastGetAttribute() / setAttributeWithoutSynchronization()
1526         given that DOMTokenList is used for the class attribute and we need
1527         to synchronize in this case.
1528
1529         No new tests, already covered by existing tests.
1530
1531         * html/DOMTokenList.cpp:
1532         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
1533         (WebCore::DOMTokenList::tokens):
1534
1535 2016-04-12  Myles C. Maxfield  <mmaxfield@apple.com>
1536
1537         [RTL Scrollbars] Overlay scrollbars push contents inwards
1538         https://bugs.webkit.org/show_bug.cgi?id=156225
1539         <rdar://problem/25137040>
1540
1541         Reviewed by Darin Adler.
1542
1543         The contents should be pushed in by the occupied width of the
1544         scrollbar, which is 0 for overlay scrollbars.
1545
1546         Test: fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html
1547
1548         * rendering/RenderLayer.cpp:
1549         (WebCore::RenderLayer::computeScrollDimensions):
1550
1551 2016-04-12  Myles C. Maxfield  <mmaxfield@apple.com>
1552
1553         [OS X] Flakey crash after ScrollAnimatorMac destruction
1554         https://bugs.webkit.org/show_bug.cgi?id=156372
1555
1556         Reviewed by Darin Adler.
1557
1558         Previously, we were disabling the mock scrollbars using JavaScript after
1559         the WebView was created. However, enabling these mock scrollbars can be
1560         triggered with a bit of state inside the WebPreferences object, which
1561         means WebKit clients can change it at any point. DumpRenderTree is doing
1562         this during the document's lifetime.
1563
1564         This means that the creation of the Scrollbar objects saw a non-mock
1565         ScrollbarTheme, but the destruction of the Scrollbar objects saw a mock
1566         ScrollbarTheme. Therefore, the non-mock ScrollbarTheme doesn't get
1567         cleaned up correctly (ScrollAnimatorMac::willRemoveVerticalScrollbar()
1568         returns early because it sees that there is nothing to deregister
1569         due to the ScrollbarTheme being mocked).
1570
1571         This cleanup is necessary because it sets the NSScrollerImp's delegate
1572         to nil before the NSScrollerImpDelegate gets destroyed. Because the
1573         cleanup wasn't happening, the delegate pointer wasn't getting set to
1574         nil, so the pointer was dangling, and AppKit was following it and
1575         crashing.
1576
1577         Because the clients of this bit of state can change it at any time,
1578         it is incorrect to change it in JavaScript. Instead, the client must
1579         manage this bit of state (so the client and the web process are always
1580         in sync). Therefore, the correct way to set this bit of state must be
1581         done in the test runner rather than Javascript internals. The mechanism
1582         we have to do that is the <!-- webkit-test-runner --> comment at the
1583         beginning of the test. This patch migrates to this mechanism and removes
1584         the old internals method.
1585
1586         Test: fast/scrolling/rtl-scrollbars-animation-property.html
1587
1588         * page/Settings.cpp:
1589         * testing/Internals.cpp:
1590         (WebCore::Internals::setMockScrollbarsEnabled): Deleted.
1591         * testing/Internals.h:
1592         * testing/Internals.idl:
1593
1594 2016-04-12  Darin Adler  <darin@apple.com>
1595
1596         Remove UsePointersEvenForNonNullableObjectArguments from SVG lists
1597         https://bugs.webkit.org/show_bug.cgi?id=156494
1598
1599         Reviewed by Chris Dumez.
1600
1601         * bindings/scripts/CodeGenerator.pm:
1602         (ShouldPassWrapperByReference): For now, don't do this for any tear-off classes.
1603         This includes the items stored in most SVG list classes.
1604
1605         * svg/SVGLengthList.idl: Removed UsePointersEvenForNonNullableObjectArguments.
1606         * svg/SVGNumberList.idl: Ditto.
1607         * svg/SVGPointList.idl: Ditto.
1608         * svg/SVGTransformList.idl: Ditto.
1609
1610         * svg/SVGPathSegList.idl: Removed UsePointersEvenForNonNullableObjectArguments.
1611         Marked the arguments nullable, and added FIXMEs about returning later since they
1612         don't really need to be nullable. But fixing this requires some reworking of the
1613         SVG list template and it's not urgent at this time. Preserves behavior where we
1614         get an exception when passing null, it's just an SVG exception instead of TypeError.
1615
1616 2016-04-12  Chris Dumez  <cdumez@apple.com>
1617
1618         Lazily update tokens in DOMTokenList when the associated attribute value changes
1619         https://bugs.webkit.org/show_bug.cgi?id=156474
1620
1621         Reviewed by Ryosuke Niwa.
1622
1623         Lazily update tokens in DOMTokenList when the associated attribute value
1624         changes for performance. Constructing the sanitized vector of tokens
1625         every time the associated Element attribute changes is too expensive.
1626         Instead, we mark the vector as dirty whenever the attribute changes, and
1627         we only construct the sanitized vector when it is actually required.
1628
1629         Also do some renaming for clarity.
1630
1631         There is no web-exposed behavior change.
1632
1633         * dom/Element.cpp:
1634         (WebCore::Element::classAttributeChanged):
1635         * html/DOMTokenList.cpp:
1636         (WebCore::DOMTokenList::contains):
1637         (WebCore::DOMTokenList::addInternal):
1638         (WebCore::DOMTokenList::removeInternal):
1639         (WebCore::DOMTokenList::toggle):
1640         (WebCore::DOMTokenList::value):
1641         (WebCore::DOMTokenList::setValue):
1642         (WebCore::DOMTokenList::updateTokensFromAttributeValue):
1643         (WebCore::DOMTokenList::associatedAttributeValueChanged):
1644         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
1645         (WebCore::DOMTokenList::tokens):
1646         (WebCore::DOMTokenList::DOMTokenList): Deleted.
1647         * html/DOMTokenList.h:
1648         (WebCore::DOMTokenList::tokens):
1649         (WebCore::DOMTokenList::length):
1650         (WebCore::DOMTokenList::item):
1651         * html/HTMLAnchorElement.cpp:
1652         (WebCore::HTMLAnchorElement::parseAttribute):
1653         * html/HTMLIFrameElement.cpp:
1654         (WebCore::HTMLIFrameElement::parseAttribute):
1655         * html/HTMLLinkElement.cpp:
1656         (WebCore::HTMLLinkElement::parseAttribute):
1657         * html/HTMLOutputElement.cpp:
1658         (WebCore::HTMLOutputElement::parseAttribute):
1659
1660 2016-04-12  Darin Adler  <darin@apple.com>
1661
1662         Remove UsePointersEvenForNonNullableObjectArguments from HTMLMediaElement
1663         https://bugs.webkit.org/show_bug.cgi?id=156492
1664
1665         Reviewed by Chris Dumez.
1666
1667         * html/HTMLMediaElement.idl: Removed UsePointersEvenForNonNullableObjectArguments,
1668         sorted remaining class attributes, simplified #if around canPlayType a bit,
1669         removed comment that is not all that useful, made the argument to
1670         webkitSetMediaKeys nullable since the implementation supports that.
1671
1672 2016-04-12  Eric Carlson  <eric.carlson@apple.com>
1673
1674         [iOS] media title sometimes remain in Control Center after tab is closed
1675         https://bugs.webkit.org/show_bug.cgi?id=156243
1676         <rdar://problem/20167445>
1677
1678         Reviewed by Darin Adler.
1679
1680         * Modules/webaudio/AudioContext.h: Implement characteristics.
1681
1682         * html/HTMLMediaElement.cpp:
1683         (WebCore::HTMLMediaElement::mediaLoadingFailed): Call mediaSession->clientCharacteristicsChanged.
1684         (WebCore::HTMLMediaElement::setReadyState): Ditto.
1685         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
1686         (WebCore::HTMLMediaElement::stop): Call mediaSession->stopSession.
1687         (WebCore::HTMLMediaElement::characteristics): New, return current characteristics.
1688         * html/HTMLMediaElement.h:
1689
1690         * platform/audio/PlatformMediaSession.cpp:
1691         (WebCore::PlatformMediaSession::stopSession): Suspend playback, and remove the session 
1692           from the manager, it will never play again.
1693         (WebCore::PlatformMediaSession::characteristics): Return client characteristics.
1694         (WebCore::PlatformMediaSession::clientCharacteristicsChanged):
1695         * platform/audio/PlatformMediaSession.h:
1696
1697         * platform/audio/PlatformMediaSessionManager.cpp:
1698         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess): Call stopSession 
1699           instead of pauseSession to signal that playback will never start again.
1700         * platform/audio/PlatformMediaSessionManager.h:
1701
1702         * platform/audio/ios/MediaSessionManagerIOS.h:
1703         * platform/audio/ios/MediaSessionManagerIOS.mm:
1704         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Add logging.
1705         (WebCore::MediaSessionManageriOS::removeSession): Update NowPlaying.
1706         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Add logging.
1707         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Update NowPlaying.
1708         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): New, return the first session
1709           that is an audio or video element with playable audio. WebAudio is not currently controllable
1710           so it isn't appropriate to show it in the NowPlaying info center.
1711         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Remember the last state passed to
1712           NowPlaying so we can call it only when something has changed.
1713
1714 2016-04-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1715
1716         [GTK] Rework scrollbars theming code for GTK+ 3.20
1717         https://bugs.webkit.org/show_bug.cgi?id=156462
1718
1719         Reviewed by Michael Catanzaro.
1720
1721         In r199292, we reworked the theming code to ensure it works with the new GTK+ CSS theming system. The same is
1722         needed for scrollbars, this patch uses the RenderThemeGadget classes introduced in r199292 to render the native
1723         scrollbars. The code is now split in 3 parts: stub methods for GTK+2 (since this file is compiled for
1724         WebCoreGTK, but not used), the implementation for GTK+ < 3.20 and the implementation for GTK+ >= 3.20. This
1725         reduces the amount of ifdefed code, and ensures that changes in new code don't break the rendering with older
1726         versions of GTK+. I noticed that we were overriding both, the specific paint methods to render scrollbars
1727         parts and the global paint method that renders all the scrollbar parts. We don't really need the specific paint
1728         methods, so I've removed the implemention leaving only the paint method. This also allows us to get rid of the
1729         GtkStyleContext cache.
1730
1731         * platform/gtk/RenderThemeGadget.cpp:
1732         (WebCore::RenderThemeGadget::create): Handle scrollbars gadgets.
1733         (WebCore::appendElementToPath): In case of scrollbar gadget, use the scrollbar GType when creating the path to
1734         be able to get non-CSS style properties.
1735         (WebCore::RenderThemeGadget::opacity): Add method to get the opacity CSS style property.
1736         (WebCore::RenderThemeScrollbarGadget::RenderThemeScrollbarGadget): Initialize m_steppers option set with the
1737         steppers used by the theme.
1738         * platform/gtk/RenderThemeGadget.h:
1739         * platform/gtk/ScrollbarThemeGtk.cpp:
1740         (WebCore::themeChangedCallback):
1741         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
1742         (WebCore::createStyleContext):
1743         (WebCore::createChildStyleContext):
1744         (WebCore::ScrollbarThemeGtk::themeChanged):
1745         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
1746         (WebCore::scrollbarPartStateFlags):
1747         (WebCore::scrollbarGadgetForLayout):
1748         (WebCore::contentsGadgetForLayout):
1749         (WebCore::ScrollbarThemeGtk::trackRect):
1750         (WebCore::ScrollbarThemeGtk::hasThumb):
1751         (WebCore::ScrollbarThemeGtk::backButtonRect):
1752         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
1753         (WebCore::ScrollbarThemeGtk::paint):
1754         (WebCore::paintStepper):
1755         (WebCore::adjustRectAccordingToMargin):
1756         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
1757         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
1758         * platform/gtk/ScrollbarThemeGtk.h:
1759
1760 2016-03-17  Sergio Villar Senin  <svillar@igalia.com>
1761
1762         [css-grid] Add parsing support for <auto-repeat> syntax
1763         https://bugs.webkit.org/show_bug.cgi?id=155583
1764
1765         Reviewed by Antti Koivisto.
1766
1767         The repeat() notation allows now to specify auto-fill or auto-fit instead of
1768         a fixed number of repetitions meaning that it will be automatically computed
1769         depending on the available space.
1770
1771         This patch just adds the parsing support, the expansion of the repeat notation
1772         will be implemented in a follow up patch because it cannot be done at
1773         parsing level (since it requires knowledge about the available space).
1774
1775         Test: fast/css-grid-layout/grid-element-auto-repeat-get-set.html
1776
1777         * CMakeLists.txt:
1778         * css/CSSGridAutoRepeatValue.cpp: Added.
1779         (WebCore::CSSGridAutoRepeatValue::customCSSText):
1780         * css/CSSGridAutoRepeatValue.h: Added.
1781         (WebCore::CSSGridAutoRepeatValue::create):
1782         (WebCore::CSSGridAutoRepeatValue::autoRepeatID):
1783         (WebCore::CSSGridAutoRepeatValue::CSSGridAutoRepeatValue):
1784         * css/CSSParser.cpp:
1785         (WebCore::allTracksAreFixedSized):
1786         (WebCore::CSSParser::parseGridTrackList):
1787         (WebCore::CSSParser::parseGridTrackRepeatFunction):
1788         (WebCore::CSSParser::parseGridTrackSize):
1789         (WebCore::CSSParser::parseGridBreadth):
1790         * css/CSSParser.h:
1791         * css/CSSValue.cpp:
1792         (WebCore::CSSValue::equals):
1793         (WebCore::CSSValue::cssText):
1794         (WebCore::CSSValue::destroy):
1795         * css/CSSValue.h:
1796         (WebCore::CSSValue::isGridAutoRepeatValue):
1797         * css/CSSValueKeywords.in:
1798
1799 2016-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1800
1801         [JSC] addStaticGlobals should emit SymbolTableEntry watchpoints to encourage constant folding in DFG
1802         https://bugs.webkit.org/show_bug.cgi?id=155110
1803
1804         Reviewed by Saam Barati.
1805
1806         * bindings/js/JSDOMWindowBase.cpp:
1807         (WebCore::JSDOMWindowBase::updateDocument):
1808
1809 2016-04-12  Sergio Villar Senin  <svillar@igalia.com>
1810
1811         [css-grid] Pass GridSizingData instead of columnTracks to track sizing methods
1812         https://bugs.webkit.org/show_bug.cgi?id=156466
1813
1814         Reviewed by Darin Adler.
1815
1816         Several methods used to compute the items' size contribution to the tracks they span in, get
1817         as an argument a vector with the sizes of the column tracks.
1818
1819         In order to support grids with orthogonal flows (among other things) it's much better to
1820         pass the GridSizingData struct and let those methods decide whether to use the columns or
1821         the rows.
1822
1823         No new tests as this is just a minor refactoring with no change in behavior.
1824
1825         * rendering/RenderGrid.cpp:
1826         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1827         (WebCore::RenderGrid::logicalContentHeightForChild):
1828         (WebCore::RenderGrid::minSizeForChild):
1829         (WebCore::RenderGrid::minContentForChild):
1830         (WebCore::RenderGrid::maxContentForChild):
1831         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1832         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
1833         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
1834         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
1835         * rendering/RenderGrid.h:
1836
1837 2016-04-11  Darin Adler  <darin@apple.com>
1838
1839         Remove UsePointersEvenForNonNullableObjectArguments from HTMLOptionsCollection
1840         https://bugs.webkit.org/show_bug.cgi?id=156491
1841
1842         Reviewed by Chris Dumez.
1843
1844         * html/HTMLOptionsCollection.cpp:
1845         (WebCore::HTMLOptionsCollection::add): Take a reference instead of a pointer.
1846         * html/HTMLOptionsCollection.h: Removed unneeded forward declaration. Changed
1847         add to take a reference instead of a pointer for the element to add. Used
1848         final instead of override on virtual functions.
1849         * html/HTMLOptionsCollection.idl: Removed now-unneeded attribute
1850         UsePointersEvenForNonNullableObjectArguments; the only function affected was
1851         add, and the overloading code was already checking for null.
1852
1853 2016-04-11  Darin Adler  <darin@apple.com>
1854
1855         Remove UsePointersEvenForNonNullableObjectArguments from HTMLSelectElement
1856         https://bugs.webkit.org/show_bug.cgi?id=156458
1857
1858         Reviewed by Chris Dumez.
1859
1860         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1861         (WebCore::JSHTMLOptionsCollection::remove): Updated to call remove with a reference
1862         rather than a pointer.
1863
1864         * bindings/js/JSHTMLSelectElementCustom.cpp:
1865         (WebCore::JSHTMLSelectElement::remove): Updated to call remove with a reference
1866         rather than a pointer.
1867         (WebCore::selectIndexSetter): Updated to call setOption with a reference rather
1868         than a pointer.
1869
1870         * bindings/scripts/CodeGeneratorGObject.pm:
1871         (GenerateFunction): Added basic support for passing wrappers by reference.
1872         GObject bindings already check arguments for null, so didn't add any new checks.
1873
1874         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
1875         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
1876         * bindings/scripts/test/GObject/WebKitDOMTestCallbackFunction.cpp:
1877         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
1878         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1879         Updated.
1880
1881         * editing/FrameSelection.cpp: Updated includes.
1882
1883         * html/HTMLOptionElement.cpp:
1884         (WebCore::HTMLOptionElement::setSelected): Pass reference when calling
1885         HTMLSelectElement::optionSelectionStateChanged.
1886         (WebCore::HTMLOptionElement::insertedInto): Ditto.
1887
1888         * html/HTMLOptionsCollection.cpp:
1889         (WebCore::HTMLOptionsCollection::add): Moved null checking behavior here.
1890         Preserves existing "silently do nothing if null".
1891         (WebCore::HTMLOptionsCollection::remove): Changed function to take a reference
1892         instead of a pointer.
1893
1894         * html/HTMLOptionsCollection.h: Updated include. Changed remove to take a
1895         reference instead of a pointer.
1896
1897         * html/HTMLSelectElement.cpp:
1898         (WebCore::HTMLSelectElement::add): Changed to take a reference instead of
1899         a pointer. Also removed unneeded protect code, since insertBefore already
1900         protects itself, and unneeded call to updateValidity, since the
1901         HTMLSelectElement::childrenChanged function already calls updateValidity.
1902         (WebCore::HTMLSelectElement::remove): Changed to take a reference instead
1903         of a pointer.
1904         (WebCore::HTMLSelectElement::setOption): Changed to take a reference
1905         instead of a pointer.
1906         (WebCore::HTMLSelectElement::setLength): Renamed "newLen" to "newLength".
1907         Use Ref instead of RefPtr for result of createElement, which makes the
1908         argument passed to add be a reference rather than a pointer.
1909         (WebCore::HTMLSelectElement::willRespondToMouseClickEvents): Put the #if
1910         for this here instead of in the header.
1911         (WebCore::HTMLSelectElement::optionSelectionStateChanged): Changed to take
1912         a reference instead of a pointer for the option element.
1913
1914         * html/HTMLSelectElement.h: Removed unneeded includes. Derive privately
1915         from TypeAheadDataSource instead of publicly. Make all overrides final
1916         except for the one that is actually overridden by a derived class.
1917         Changed the arguments of the add, remove, setOption, and
1918         optionSelectionStateChanged functions to be references instead of pointers.
1919         Tweaked formatting a bit and used nullptr instead of 0. Override
1920         willRespondToMouseClickEvents on all platforms, not just iOS.
1921
1922         * html/HTMLSelectElement.idl: Removed UsePointersEvenForNonNullableObjectArguments.
1923         Removed a comment that is no longer needed. Made some types nullable to match
1924         the specification, in places that currently have no effect on code generation.
1925         Added a FIXME comment about the argument to setCustomValidity incorrectly being
1926         marked as nullable.
1927
1928 2016-04-11  Brent Fulgham  <bfulgham@apple.com>
1929
1930         Use WeakPtrs to avoid using deallocated Widgets and ScrollableAreas
1931         https://bugs.webkit.org/show_bug.cgi?id=156420
1932         <rdar://problem/25637378>
1933
1934         Reviewed by Darin Adler.
1935
1936         Avoid the risk of using deallocated Widgets and ScrollableAreas by using WeakPtrs instead of
1937         bare pointers. This allows us to remove some explicit calls to get ScrollableArea and Widget
1938         members in the event handling logic. Instead, null checks are sufficient to ensure we never
1939         accidentally dereference a deleted element.
1940
1941         1. Modify the ScrollableArea class to support vending WeakPtrs.
1942         2. Modify the Event Handling code to use WeakPtrs to hold ScrollableArea and RenderWidget
1943            objects, and to null-check these elements after event handling dispatching is finished
1944            to handle cases where these objects are destroyed.
1945
1946         Test: fast/events/wheel-event-destroys-frame.html
1947               fast/events/wheel-event-destroys-overflow.html
1948
1949         * page/EventHandler.cpp:
1950         (WebCore::EventHandler::platformPrepareForWheelEvents): Change signature for WeakPtr.
1951         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
1952         (WebCore::EventHandler::platformNotifyIfEndGesture): Ditto.
1953         (WebCore::widgetForElement): Change to return a WeakPtr.
1954         (WebCore::EventHandler::handleWheelEvent): Use WeakPtrs to hold elements that might be destroyed
1955         during event handling.
1956         * page/EventHandler.h:
1957         * page/mac/EventHandlerEfl.cpp: Rename passWheelEventToWidget to widgetDidHandleWheelEvent.
1958         * page/mac/EventHandlerGtk.cpp: Ditto.
1959         * page/mac/EventHandlerIOS.mm: Ditto.
1960         * page/mac/EventHandlerMac.mm:
1961         (WebCore::scrollableAreaForEventTarget): Renamed from scrollViewForEventTarget. Return
1962         a WeakPtr rather than a bare pointer.
1963         (WebCore::scrollableAreaForContainerNode): Return WeakPtr rather than bare pointer.
1964         (WebCore::EventHandler::completeWidgetWheelEvent): Added.
1965         (WebCore::EventHandler::passWheelEventToWidget): Deleted.
1966         (WebCore::EventHandler::platformPrepareForWheelEvents): Convert to WeakPtrs.
1967         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
1968         (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Ditto.
1969         (WebCore::EventHandler::platformNotifyIfEndGesture): Ditto.
1970         (WebCore::EventHandler::widgetDidHandleWheelEvent): Renamed from passWheelEventToWidget.
1971         (WebCore::EventHandler::widgetForEventTarget): Converted from static function to static
1972         method so it can be shared with EventHandlerMac.
1973         (WebCore::scrollViewForEventTarget): Deleted.
1974         * page/mac/EventHandlerWin.cpp: Rename passWheelEventToWidget to widgetDidHandleWheelEvent.
1975         * platform/ScrollableArea.cpp:
1976         * platform/ScrollableArea.h:
1977         (WebCore::ScrollableArea::createWeakPtr): Added.
1978         * platform/Widget.h:
1979         (WebCore::ScrollableArea::createWeakPtr): Added.
1980
1981 2016-04-11  Dean Jackson  <dino@apple.com>
1982
1983         putImageData needs to premultiply input
1984         https://bugs.webkit.org/show_bug.cgi?id=156488
1985         <rdar://problem/25672675>
1986
1987         Reviewed by Zalan Bujtas.
1988
1989         I made a mistake in r187534 as I was converting get and putImageData
1990         to use Accelerate. The incoming data is unmultiplied, and should
1991         be premultiplied before copying into the backing store. I was
1992         accidentally unmultiplying unmultiplied data, which caused
1993         some pretty psychedelic results.
1994
1995         Test: fast/canvas/putImageData-unmultiplied.html
1996
1997         * platform/graphics/cg/ImageBufferDataCG.cpp:
1998         (WebCore::ImageBufferData::putData): Call premultiply, not unpremultiply.
1999
2000 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
2001
2002         When clearing cache, also clear AVFoundation cache.
2003         https://bugs.webkit.org/show_bug.cgi?id=155783
2004         rdar://problem/25252541
2005
2006         Reviewed by Darin Adler.
2007
2008         Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
2009         can then be used to manage the cache storage used by AVFoundation. It is used to query the
2010         contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
2011         clearMediaCache() and clearMediaCacheForOrigins().
2012
2013         Use SecurityOrigin instead of the less formal site String to represent origins in the cache.
2014
2015         * html/HTMLMediaElement.cpp:
2016         (WebCore::sharedMediaCacheDirectory): Added.
2017         (WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
2018         (WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
2019         (WebCore::HTMLMediaElement::originsInMediaCache): Added.
2020         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
2021         (WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
2022         (WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
2023         (WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
2024         (WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
2025         * html/HTMLMediaElement.h:
2026         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
2027         * platform/graphics/MediaPlayer.cpp:
2028         (WebCore::addMediaEngine): Add new cache methods.
2029         (WebCore::addToHash): Added.
2030         (WebCore::MediaPlayer::originsInMediaCache): Added.
2031         (WebCore::MediaPlayer::clearMediaCache): Added parameter.
2032         (WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
2033         (WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
2034         (WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
2035         * platform/graphics/MediaPlayer.h:
2036         (WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
2037         * platform/graphics/MediaPlayerPrivate.h:
2038         (WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
2039         (WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
2040         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
2041         (WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
2042         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
2043         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2044         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2045         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
2046         (WebCore::assetCacheForPath): Added.
2047         (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
2048         (WebCore::toSystemClockTime): Added.
2049         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
2050         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
2051         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
2052         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2053         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2054         (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
2055         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
2056         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
2057         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
2058         (WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
2059         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
2060         * platform/spi/mac/AVFoundationSPI.h:
2061
2062 2016-04-11  Commit Queue  <commit-queue@webkit.org>
2063
2064         Unreviewed, rolling out r199310.
2065         https://bugs.webkit.org/show_bug.cgi?id=156483
2066
2067         This change turns many indexeddb tests into crashes (Requested
2068         by jwtan on #webkit).
2069
2070         Reverted changeset:
2071
2072         "Clean up IDBBindingUtilities."
2073         https://bugs.webkit.org/show_bug.cgi?id=156472
2074         http://trac.webkit.org/changeset/199310
2075
2076 2016-04-11  Commit Queue  <commit-queue@webkit.org>
2077
2078         Unreviewed, rolling out r199315.
2079         https://bugs.webkit.org/show_bug.cgi?id=156482
2080
2081         This change broke the OS X Yosemite build. (Requested by jwtan
2082         on #webkit).
2083
2084         Reverted changeset:
2085
2086         "When clearing cache, also clear AVFoundation cache."
2087         https://bugs.webkit.org/show_bug.cgi?id=155783
2088         http://trac.webkit.org/changeset/199315
2089
2090 2016-04-11  Brian Burg  <bburg@apple.com>
2091
2092         Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
2093         https://bugs.webkit.org/show_bug.cgi?id=156407
2094         <rdar://problem/25627659>
2095
2096         Reviewed by Joseph Pecoraro.
2097
2098         * inspector/InspectorDatabaseAgent.cpp: Don't use deleted subclasses.
2099
2100 2016-04-11  Commit Queue  <commit-queue@webkit.org>
2101
2102         Unreviewed, rolling out r198909.
2103         https://bugs.webkit.org/show_bug.cgi?id=156479
2104
2105         made double-click-and-drag on text drag instead of
2106         highlighting (Requested by alexchristensen_ on #webkit).
2107
2108         Reverted changeset:
2109
2110         "eventMayStartDrag() does not check for shiftKey or
2111         isOverLink"
2112         https://bugs.webkit.org/show_bug.cgi?id=155746
2113         http://trac.webkit.org/changeset/198909
2114
2115 2016-04-11  Chris Dumez  <cdumez@apple.com>
2116
2117         [WebIDL] Add support for [ImplementedAs] for EventHandler attributes
2118         https://bugs.webkit.org/show_bug.cgi?id=156421
2119
2120         Reviewed by Darin Adler.
2121
2122         Add support for [ImplementedAs] for EventHandler attributes so we can
2123         get rid of some ugly name hard-coding in the bindings generator.
2124
2125         * Modules/notifications/Notification.idl:
2126         * bindings/scripts/CodeGeneratorJS.pm:
2127         (EventHandlerAttributeEventName):
2128         * bindings/scripts/test/JS/JSTestObj.cpp:
2129         (WebCore::jsTestObjOnwebkitfoo):
2130         (WebCore::setJSTestObjOnwebkitfoo):
2131         * bindings/scripts/test/TestObj.idl:
2132         * dom/Element.idl:
2133         * page/DOMWindow.idl:
2134
2135 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
2136
2137         When clearing cache, also clear AVFoundation cache.
2138         https://bugs.webkit.org/show_bug.cgi?id=155783
2139         rdar://problem/25252541
2140
2141         Reviewed by Darin Adler.
2142
2143         Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
2144         can then be used to manage the cache storage used by AVFoundation. It is used to query the
2145         contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
2146         clearMediaCache() and clearMediaCacheForOrigins().
2147
2148         Use SecurityOrigin instead of the less formal site String to represent origins in the cache.
2149
2150         * html/HTMLMediaElement.cpp:
2151         (WebCore::sharedMediaCacheDirectory): Added.
2152         (WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
2153         (WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
2154         (WebCore::HTMLMediaElement::originsInMediaCache): Added.
2155         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
2156         (WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
2157         (WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
2158         (WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
2159         (WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
2160         * html/HTMLMediaElement.h:
2161         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
2162         * platform/graphics/MediaPlayer.cpp:
2163         (WebCore::addMediaEngine): Add new cache methods.
2164         (WebCore::addToHash): Added.
2165         (WebCore::MediaPlayer::originsInMediaCache): Added.
2166         (WebCore::MediaPlayer::clearMediaCache): Added parameter.
2167         (WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
2168         (WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
2169         (WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
2170         * platform/graphics/MediaPlayer.h:
2171         (WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
2172         * platform/graphics/MediaPlayerPrivate.h:
2173         (WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
2174         (WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
2175         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
2176         (WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
2177         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
2178         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2179         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2180         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
2181         (WebCore::assetCacheForPath): Added.
2182         (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
2183         (WebCore::toSystemClockTime): Added.
2184         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
2185         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
2186         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
2187         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2188         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2189         (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
2190         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
2191         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
2192         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
2193         (WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
2194         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
2195         * platform/spi/mac/AVFoundationSPI.h:
2196
2197 2016-04-11  Antoine Quint  <graouts@apple.com>
2198
2199         [WebGL2] Use Open GL ES 3.0 to back WebGL2 contexts
2200         https://bugs.webkit.org/show_bug.cgi?id=141178
2201
2202         Reviewed by Dean Jackson.
2203
2204         We add a new `useGLES3` attribute when creating a GraphicsContext3D in the event that the
2205         context type is "webgl2". This attribute is then read by the GraphicsContext3D constructor
2206         to request an Open GL ES 3.0 backend when creating the EAGLContext on iOS.
2207
2208         * html/canvas/WebGLRenderingContextBase.cpp:
2209         (WebCore::WebGLRenderingContextBase::create):
2210         * platform/graphics/GraphicsContext3D.h:
2211         (WebCore::GraphicsContext3D::Attributes::Attributes):
2212         * platform/graphics/mac/GraphicsContext3DMac.mm:
2213         (WebCore::GraphicsContext3D::GraphicsContext3D):
2214
2215 2016-04-11  Jiewen Tan  <jiewen_tan@apple.com>
2216
2217         fast/loader/opaque-base-url.html crashing during mac and ios debug tests
2218         https://bugs.webkit.org/show_bug.cgi?id=156179
2219         <rdar://problem/25507719>
2220
2221         Reviewed by Ryosuke Niwa.
2222
2223         Navigate to about:blank if the provided src of an iframe/frame cannot be
2224         resolved to a valid URL.
2225
2226         Test: fast/loader/iframe-src-invalid-url.html
2227
2228         * loader/SubframeLoader.cpp:
2229         (WebCore::SubframeLoader::requestFrame):
2230
2231 2016-04-11  Said Abou-Hallawa  <sabouhallawa@apple,com>
2232
2233         Merge CG ImageSource and non CG ImageSource implementation in one file
2234         https://bugs.webkit.org/show_bug.cgi?id=155456
2235
2236         Reviewed by Darin Adler.
2237
2238         ImageSource for CG and CG code paths look very similar. All the platform
2239         specific code can be moved to ImageDecoder classes for CG and non CG. And
2240         we can have the ImageSource be platform independent and we get rid of
2241         ImageSourceCG.cpp.
2242
2243         Test: fast/images/image-subsampling.html
2244
2245         * CMakeLists.txt:
2246         * PlatformAppleWin.cmake:
2247         * PlatformMac.cmake:
2248         * WebCore.xcodeproj/project.pbxproj:
2249         Delete ImageSourceCG.cpp form all make files and add ImageSource.cpp to
2250         CMakeLists.txt.
2251         
2252         * platform/Cursor.cpp:
2253         (WebCore::determineHotSpot):
2254         * platform/graphics/BitmapImage.cpp:
2255         (WebCore::BitmapImage::hotSpot):
2256         (WebCore::BitmapImage::getHotSpot): Deleted.
2257         * platform/graphics/BitmapImage.h:
2258         * platform/graphics/Image.h:
2259         (WebCore::Image::hotSpot):
2260         (WebCore::Image::getHotSpot): Deleted.
2261         Rename getHotSpot() to hotSpot() and change it to return Optional<IntPoint>.
2262         
2263         * platform/graphics/ImageSource.cpp:
2264         (WebCore::ImageSource::~ImageSource): Remove clear(true) call. It does nothing.
2265         (WebCore::ImageSource::clearFrameBufferCache): A wrapper which calls ImageDecoder::clearFrameBufferCache().
2266         (WebCore::ImageSource::clear): Calls clearFrameBufferCache() which will do nothing for CG.
2267         
2268         (WebCore::ImageSource::ensureDecoderIsCreated): Change SharedBuffer* to
2269         const SharedBuffer& and remove the call to ImageDecoder::setMaxNumPixels().
2270         The value of const static int CG ImageDecoder::m_maxNumPixels will be set
2271         based on IMAGE_DECODER_DOWN_SAMPLING.
2272         
2273         (WebCore::ImageSource::setData): Pass SharedBuffer& to the underlying functions.
2274         
2275         (WebCore::ImageSource::calculateMaximumSubsamplingLevel): Returns the maximum
2276         subsampling level allowed for an image.
2277         
2278         (WebCore::ImageSource::subsamplingLevelForScale): Converts from a scale to
2279         SubsamplingLevel taking into consideration the maximumSubsamplingLevel for
2280         a particular image.
2281         
2282         (WebCore::ImageSource::bytesDecodedToDetermineProperties): Returns the number
2283         of encoded bytes which can determine the image properties. For non CG it's
2284         zero. For CG it is a maximum value which can be corrected later.
2285         
2286         (WebCore::ImageSource::isSizeAvailable):
2287         (WebCore::ImageSource::sizeRespectingOrientation):
2288         (WebCore::ImageSource::frameCount):
2289         (WebCore::ImageSource::repetitionCount):
2290         (WebCore::ImageSource::filenameExtension):
2291         (WebCore::ImageSource::getHotSpot):
2292         (WebCore::ImageSource::frameIsCompleteAtIndex):
2293         (WebCore::ImageSource::frameHasAlphaAtIndex):
2294         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
2295         (WebCore::ImageSource::frameSizeAtIndex):
2296         (WebCore::ImageSource::frameBytesAtIndex):
2297         (WebCore::ImageSource::frameDurationAtIndex):
2298         (WebCore::ImageSource::orientationAtIndex):
2299         (WebCore::ImageSource::createFrameImageAtIndex):
2300         These are wrappers for the ImageDecoder APIs. The purpose of these functions
2301         is to ensure the ImageDecoder is created.
2302         
2303         (WebCore::ImageSource::dump): Called from BitmapImage::dump().
2304         
2305         (WebCore::ImageSource::getHotSpot): Deleted.
2306         
2307         * platform/graphics/ImageSource.h:
2308         (WebCore::ImageSource::setAllowSubsampling): Called from BitmapImage::setAllowSubsampling().
2309         
2310         (WebCore::ImageSource::maxPixelsPerDecodedImage): Deleted.
2311         (WebCore::ImageSource::setMaxPixelsPerDecodedImage): Deleted.
2312         Setting maxPixelsPerDecodedImage was moved to the non CG ImageDecoder.
2313         
2314         * platform/graphics/cg/ImageDecoderCG.cpp:
2315         (WebCore::ImageDecoder::setData): Change SharedBuffer* to SharedBuffer&.
2316
2317         (WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
2318         The code was moved to ImageSource::subsamplingLevelForScale().
2319         
2320         * platform/graphics/cg/ImageDecoderCG.h:
2321         (WebCore::ImageDecoder::create): Make the prototype of this function
2322         suitable for CG and non CG cases.
2323         (WebCore::ImageDecoder::clearFrameBufferCache): Empty functions for CG.
2324         
2325         * platform/graphics/cg/ImageSourceCG.cpp: Removed.
2326         
2327         * platform/image-decoders/ImageDecoder.cpp:
2328         (WebCore::ImageDecoder::frameIsCompleteAtIndex): A mew function to return
2329         whether the frame decoding is complete or not.
2330         
2331         (WebCore::ImageDecoder::frameHasAlphaAtIndex): Simplify the logic.
2332         
2333         (WebCore::ImageDecoder::frameDurationAtIndex): The code was moved from
2334         ImageSource::frameDurationAtIndex() in ImageSource.cpp.
2335         
2336         (WebCore::ImageDecoder::createFrameImageAtIndex): The code was moved from
2337         ImageSource::createFrameImageAtIndex() in ImageSource.cpp.
2338         
2339         * platform/image-decoders/ImageDecoder.h:
2340         (WebCore::ImageDecoder::ImageDecoder): Initialize the members in class.
2341         (WebCore::ImageDecoder::~ImageDecoder): Fix the braces style.
2342         (WebCore::ImageDecoder::setData): Change the type of the argument from
2343         SharedBuffer* to SharedBuffer&.
2344         (WebCore::ImageDecoder::frameSizeAtIndex): Add the argument SubsamplingLevel
2345         so it can have the same prototype as CG.
2346         (WebCore::ImageDecoder::orientationAtIndex): Rename it to the same of CG.
2347         
2348         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
2349         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
2350         (WebCore::ImageDecoder::subsamplingLevelForScale): Add these functions
2351         and return the default values so we do not have to add directive compiled
2352         non CG blocks in ImageSource.cpp.
2353
2354         (WebCore::ImageDecoder::hotSpot): Return Optional<IntPoint>.
2355         
2356         (WebCore::ImageDecoder::orientation): Deleted.
2357         (WebCore::ImageDecoder::setMaxNumPixels): Deleted.
2358         
2359         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
2360         (WebCore::BMPImageDecoder::setData):
2361         * platform/image-decoders/bmp/BMPImageDecoder.h:
2362         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2363         (WebCore::GIFImageDecoder::setData):
2364         (WebCore::GIFImageDecoder::decode):
2365         * platform/image-decoders/gif/GIFImageDecoder.h:
2366         * platform/image-decoders/gif/GIFImageReader.h:
2367         (GIFImageReader::setData):
2368         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2369         (WebCore::ICOImageDecoder::setData):
2370         Use reference SharedBuffer instead of pointer SharedBuffer.
2371         
2372         (WebCore::ICOImageDecoder::hotSpot):
2373         (WebCore::ICOImageDecoder::hotSpotAtIndex):
2374         Change hotSpot() to return Optional<IntPoint>.
2375         * platform/image-decoders/ico/ICOImageDecoder.h:
2376                 
2377         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
2378         Pass reference SharedBuffer instead of pointer SharedBuffer.
2379
2380 2016-04-08  Said Abou-Hallawa  <sabouhallawa@apple,com>
2381
2382         Timing attack on SVG feComposite filter circumvents same-origin policy
2383         https://bugs.webkit.org/show_bug.cgi?id=154338
2384
2385         Reviewed by Oliver Hunt.
2386
2387         Ensure the FEComposite arithmetic filter is clamping the resulted color
2388         components in a constant time.
2389
2390         * platform/graphics/filters/FEComposite.cpp:
2391         (WebCore::clampByte):
2392         (WebCore::computeArithmeticPixels):
2393
2394 2016-04-11  Brady Eidson  <beidson@apple.com>
2395
2396         Clean up IDBBindingUtilities.
2397         https://bugs.webkit.org/show_bug.cgi?id=156472
2398
2399         Reviewed by Alex Christensen.
2400
2401         No new tests (No change in behavior).
2402
2403         - Get rid of a whole bunch of unused functions (since we got rid of Legacy IDB).
2404         - Make more functions deal in ExecState/ScriptExecutionContexts instead of DOMRequestState.
2405         - Make more functions deal in JSValue instead of Deprecated::ScriptValue.
2406
2407         * bindings/scripts/IDLAttributes.txt: Add a new attribute to signify that an implementation returns
2408           JSValues instead of Deprecated::ScriptState
2409         * bindings/scripts/CodeGeneratorJS.pm:
2410         (NativeToJSValue): Use that new attribute.
2411         
2412         * Modules/indexeddb/IDBAny.cpp:
2413         (WebCore::IDBAny::IDBAny):
2414         (WebCore::IDBAny::scriptValue):
2415         * Modules/indexeddb/IDBAny.h:
2416         (WebCore::IDBAny::create):
2417         * Modules/indexeddb/IDBCursor.cpp:
2418         (WebCore::IDBCursor::key):
2419         (WebCore::IDBCursor::primaryKey):
2420         (WebCore::IDBCursor::value):
2421         (WebCore::IDBCursor::update):
2422         (WebCore::IDBCursor::continueFunction):
2423         (WebCore::IDBCursor::deleteFunction):
2424         (WebCore::IDBCursor::setGetResult):
2425         * Modules/indexeddb/IDBCursor.h:
2426         * Modules/indexeddb/IDBCursor.idl:
2427         * Modules/indexeddb/IDBCursorWithValue.idl:
2428         * Modules/indexeddb/IDBFactory.cpp:
2429         (WebCore::IDBFactory::cmp):
2430         * Modules/indexeddb/IDBIndex.cpp:
2431         (WebCore::IDBIndex::count):
2432         (WebCore::IDBIndex::get):
2433         (WebCore::IDBIndex::getKey):
2434         * Modules/indexeddb/IDBKeyRange.cpp:
2435         (WebCore::IDBKeyRange::lowerValue):
2436         (WebCore::IDBKeyRange::upperValue):
2437         (WebCore::IDBKeyRange::only):
2438         (WebCore::IDBKeyRange::lowerBound):
2439         (WebCore::IDBKeyRange::upperBound):
2440         (WebCore::IDBKeyRange::bound):
2441         * Modules/indexeddb/IDBKeyRange.h:
2442         * Modules/indexeddb/IDBKeyRange.idl:
2443         * Modules/indexeddb/IDBObjectStore.cpp:
2444         (WebCore::IDBObjectStore::get):
2445         (WebCore::IDBObjectStore::modernDelete):
2446         (WebCore::IDBObjectStore::count):
2447         * Modules/indexeddb/IDBRequest.cpp:
2448         (WebCore::IDBRequest::setResult):
2449         (WebCore::IDBRequest::setResultToStructuredClone):
2450         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2451         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
2452         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
2453         * bindings/js/IDBBindingUtilities.cpp:
2454         (WebCore::idbKeyPathFromValue):
2455         (WebCore::deserializeIDBValueDataToJSValue):
2456         (WebCore::scriptValueToIDBKey):
2457         (WebCore::idbKeyDataToScriptValue):
2458         (WebCore::idbKeyDataToJSValue): Deleted.
2459         (WebCore::injectIDBKeyIntoScriptValue): Deleted.
2460         (WebCore::createIDBKeyFromScriptValueAndKeyPath): Deleted.
2461         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
2462         (WebCore::canInjectIDBKeyIntoScriptValue): Deleted.
2463         (WebCore::deserializeIDBValue): Deleted.
2464         (WebCore::deserializeIDBValueData): Deleted.
2465         (WebCore::deserializeIDBValueBuffer): Deleted.
2466         (WebCore::idbValueDataToJSValue): Deleted.
2467         (WebCore::idbKeyToScriptValue): Deleted.
2468         * bindings/js/IDBBindingUtilities.h:
2469         * bindings/js/JSIDBAnyCustom.cpp:
2470         (WebCore::toJS):
2471         * bindings/js/JSIDBDatabaseCustom.cpp:
2472         (WebCore::JSIDBDatabase::createObjectStore):
2473         * bindings/js/JSIDBObjectStoreCustom.cpp:
2474         (WebCore::JSIDBObjectStore::createIndex):
2475         * dom/ScriptExecutionContext.cpp:
2476         (WebCore::ScriptExecutionContext::execState):
2477         * dom/ScriptExecutionContext.h:
2478         * inspector/InspectorIndexedDBAgent.cpp:
2479
2480 2016-04-09  Gavin Barraclough  <barraclough@apple.com>
2481
2482         WebKit should adopt journal_mode=wal for all SQLite databases.
2483         https://bugs.webkit.org/show_bug.cgi?id=133496
2484
2485         Reviewed by Darin Adler.
2486
2487         The statement intended to enable WAL mode is always failing because it is missing a
2488         prepare(). Fix this. We were also previously permitting SQLITE_OK results - this
2489         was in error (we were only getting these because stepping the unprepared statement
2490         returned SQLITE_OK). Also set the SQLITE_OPEN_AUTOPROXY flag when opening the
2491         database - this will improve perfomance when the database is accessed via an AFP
2492         mount.
2493
2494         This exposed a bug, that deleteAllDatabases does not actually delete the databases on
2495         iOS, for testing to reset back to a known state between tests it should be doing so.
2496
2497         * Modules/webdatabase/DatabaseTracker.cpp:
2498         (WebCore::DatabaseTracker::deleteAllDatabases):
2499             - force databases to actually be deleted on iOS.
2500               This method is only used from testing code (DumpRenderTree / WebKitTestRunner).
2501         (WebCore::DatabaseTracker::deleteOrigin):
2502             - added IOSDeletionMode.
2503         (WebCore::DatabaseTracker::deleteDatabaseFile):
2504             - added IOSDeletionMode, modified to actually delete if this is set.
2505         * Modules/webdatabase/DatabaseTracker.h:
2506             - added IOSDeletionMode.
2507         * platform/sql/SQLiteDatabase.cpp:
2508         (WebCore::SQLiteDatabase::open):
2509             - call prepareAndStep(), only check for SQLITE_ROW result.
2510         * platform/sql/SQLiteFileSystem.cpp:
2511         (WebCore::SQLiteFileSystem::openDatabase):
2512             - should set SQLITE_OPEN_AUTOPROXY flag when opening database.
2513
2514 2016-04-11  Zalan Bujtas  <zalan@apple.com>
2515
2516         Simplify InlineTextBox::selectionStartEnd()
2517         https://bugs.webkit.org/show_bug.cgi?id=156459
2518
2519         Reviewed by Darin Adler.
2520
2521         No change in functionality.
2522
2523         * rendering/InlineTextBox.cpp:
2524         (WebCore::InlineTextBox::selectionState):
2525         (WebCore::InlineTextBox::paint):
2526         (WebCore::InlineTextBox::selectionStartEnd):
2527         (WebCore::InlineTextBox::paintSelection):
2528         (WebCore::InlineTextBox::paintCompositionBackground):
2529         * rendering/InlineTextBox.h:
2530         * rendering/svg/SVGInlineTextBox.cpp:
2531         (WebCore::SVGInlineTextBox::paintSelectionBackground):
2532         (WebCore::SVGInlineTextBox::paintText):
2533
2534 2016-04-11  Zalan Bujtas  <zalan@apple.com>
2535
2536         REGRESSION (r193857): Text selection causes text to disappear.
2537         https://bugs.webkit.org/show_bug.cgi?id=156448
2538         rdar://problem/25578952
2539
2540         Reviewed by Simon Fraser.
2541
2542         Apparently when the end position of the selection range is smaller than the start position, we need
2543         to repaint the entire text as it indicates selection clearing.
2544
2545         Test: fast/text/text-disappear-on-deselect.html
2546
2547         * rendering/TextPainter.cpp:
2548         (WebCore::TextPainter::paintText):
2549
2550 2016-04-05  Oliver Hunt  <oliver@apple.com>
2551
2552         Remove compile time define for SEPARATED_HEAP
2553         https://bugs.webkit.org/show_bug.cgi?id=155508
2554
2555         Reviewed by Mark Lam.
2556
2557         * Configurations/FeatureDefines.xcconfig:
2558
2559 2016-04-11  Chris Dumez  <cdumez@apple.com>
2560
2561         Merge AttributedDOMTokenList into DOMTokenList
2562         https://bugs.webkit.org/show_bug.cgi?id=156468
2563
2564         Reviewed by Ryosuke Niwa.
2565
2566         Merge AttributedDOMTokenList into DOMTokenList to simplify the code.
2567         DOMTokenList is not constructible and AttributedDOMTokenList is its
2568         only constructible subclass after r196123.
2569
2570         * CMakeLists.txt:
2571         * WebCore.xcodeproj/project.pbxproj:
2572         * dom/Element.cpp:
2573         (WebCore::Element::classList):
2574         * dom/ElementRareData.h:
2575         (WebCore::ElementRareData::classList):
2576         (WebCore::ElementRareData::setClassList):
2577         * html/AttributeDOMTokenList.cpp: Removed.
2578         * html/AttributeDOMTokenList.h: Removed.
2579         * html/DOMTokenList.cpp:
2580         (WebCore::DOMTokenList::DOMTokenList):
2581         (WebCore::DOMTokenList::attributeValueChanged):
2582         (WebCore::DOMTokenList::updateAfterTokenChange):
2583         * html/DOMTokenList.h:
2584         (WebCore::DOMTokenList::ref):
2585         (WebCore::DOMTokenList::deref):
2586         (WebCore::DOMTokenList::element):
2587         (WebCore::DOMTokenList::~DOMTokenList): Deleted.
2588         (WebCore::DOMTokenList::updateAfterTokenChange): Deleted.
2589         * html/HTMLAnchorElement.cpp:
2590         (WebCore::HTMLAnchorElement::relList):
2591         * html/HTMLAnchorElement.h:
2592         * html/HTMLIFrameElement.cpp:
2593         (WebCore::HTMLIFrameElement::sandbox):
2594         * html/HTMLIFrameElement.h:
2595         * html/HTMLLinkElement.cpp:
2596         (WebCore::HTMLLinkElement::sizes):
2597         (WebCore::HTMLLinkElement::relList):
2598         * html/HTMLLinkElement.h:
2599         * html/HTMLOutputElement.cpp:
2600         (WebCore::HTMLOutputElement::htmlFor):
2601         * html/HTMLOutputElement.h:
2602
2603 2016-04-11  Chris Dumez  <cdumez@apple.com>
2604
2605         DOMTokenList.contains() should not throw
2606         https://bugs.webkit.org/show_bug.cgi?id=156453
2607
2608         Reviewed by Ryosuke Niwa.
2609
2610         DOMTokenList.contains() should not throw if the input token is invalid:
2611         https://github.com/whatwg/dom/commit/6d3076e3cbcba662489b272a718bc6b8c0082a74
2612
2613         We now return false in such cases, instead of throwing, which should be
2614         safe with regards to backward compatibility.
2615
2616         No new tests, already covered by existing tests.
2617
2618         * html/DOMTokenList.cpp:
2619         (WebCore::DOMTokenList::contains):
2620         * html/DOMTokenList.h:
2621         * html/DOMTokenList.idl:
2622
2623 2016-04-11  Frederic Wang  <fwang@igalia.com>
2624
2625         Refactor RenderMathMLFraction layout to avoid using flexbox
2626         https://bugs.webkit.org/show_bug.cgi?id=153917
2627
2628         Reviewed by Sergio Villar Senin.
2629
2630         Based on a patch by Alejandro G. Castro <alex@igalia.com>
2631
2632         Implement the layoutBlock method to handle the layout calculations
2633         directly in the class. This also fixes parsing of absolute values for
2634         linethickness attribute (e.g. 10px) and adds support for the AxisHeight
2635         and FractionRuleThickness MATH parameters.
2636
2637         Test: mathml/opentype/fraction-line.html
2638
2639         * accessibility/AccessibilityRenderObject.cpp:
2640         (WebCore::AccessibilityRenderObject::mathLineThickness): Use the thickness relative to the
2641         default line thickness since that's really what is expected by mathml-line-fraction.html
2642         * css/mathml.css: Remove flexbox properties for mfrac.
2643         (mfrac): Deleted.
2644         (mfrac > *): Deleted.
2645         (mfrac[numalign="left"] > :first-child): Deleted.
2646         (mfrac[numalign="right"] > :first-child): Deleted.
2647         (mfrac[denomalign="left"] > :last-child): Deleted.
2648         (mfrac[denomalign="right"] > :last-child): Deleted.
2649         (mfrac > :first-child): Deleted.
2650         (mfrac > :last-child): Deleted.
2651         (mfrac): Deleted.
2652         * rendering/mathml/RenderMathMLBlock.cpp: Introduce a helper function to retrieve the math
2653         axis height.
2654         (WebCore::RenderMathMLBlock::mathAxisHeight):
2655         * rendering/mathml/RenderMathMLBlock.h: Declare mathAxisHeight.
2656         * rendering/mathml/RenderMathMLFraction.cpp:
2657         (WebCore::RenderMathMLFraction::RenderMathMLFraction):
2658         (WebCore::RenderMathMLFraction::parseAlignmentAttribute): Helper function to parse the align
2659         attribute.
2660         (WebCore::RenderMathMLFraction::isValid): Helper function to verify whether the child list
2661         is valid with respect to the MathML specificitation.
2662         (WebCore::RenderMathMLFraction::numerator): Helper function to retrieve the numerator.
2663         (WebCore::RenderMathMLFraction::denominator): Helper function to retrieve the denominator.
2664         (WebCore::RenderMathMLFraction::updateFromElement): Use the FractionRuleThickness parameter
2665         when avaiable to calculate the default linethickness.
2666         Fix computation of linethickness for absolute values (e.g. 10px), the default linethickness
2667         must not be involved for such values.
2668         We no longer need to manage style of anonymous wrappers.
2669         (WebCore::RenderMathMLFraction::unembellishedOperator): Use the helper function and we no
2670         longer care about anonymous wrappers.
2671         (WebCore::RenderMathMLFraction::computePreferredLogicalWidths): Implement this function
2672         without using flexbox.
2673         (WebCore::RenderMathMLFraction::horizontalOffset): Helper function to get the horizontal
2674         offsets of children depending of the alignment.
2675         (WebCore::RenderMathMLFraction::layoutBlock): Implement this function without using flexbox.
2676         (WebCore::RenderMathMLFraction::paint): Do not paint if the fraction is invalid. Use helper
2677         function. Use the width of the renderer (instead of the one of the denominator) as the
2678         length of the fraction bar.
2679         (WebCore::RenderMathMLFraction::firstLineBaseline): Use the helper functions to get children
2680         and axis height.
2681         (WebCore::RenderMathMLFraction::paintChildren): Temporary function to remove in a
2682         follow-up patch.
2683         (WebCore::RenderMathMLFraction::fixChildStyle): Deleted. We no longer need to manage style
2684         of anonymous wrappers.
2685         (WebCore::RenderMathMLFraction::addChild): Deleted. We no longer need to manage
2686         anonymous wrappers.
2687         (WebCore::RenderMathMLFraction::styleDidChange): We no longer need to manage style of
2688         anonymous wrappers.
2689         (WebCore::RenderMathMLFraction::layout): Deleted.
2690         * rendering/mathml/RenderMathMLFraction.h: Replace lineThickness with relativeLineThickness,
2691         as needed by the accessibility code. Update function and members declarations.
2692
2693 2016-04-11  Commit Queue  <commit-queue@webkit.org>
2694
2695         Unreviewed, rolling out r199290.
2696         https://bugs.webkit.org/show_bug.cgi?id=156465
2697
2698         broke 300 tests (Requested by mcatanzaro on #webkit).
2699
2700         Reverted changeset:
2701
2702         "Merge CG ImageSource and non CG ImageSource implementation in
2703         one file"
2704         https://bugs.webkit.org/show_bug.cgi?id=155456
2705         http://trac.webkit.org/changeset/199290
2706
2707 2016-04-11  Frederic Wang  <fwang@igalia.com>
2708
2709         Refactor RenderMathMLUnderOver layout functions to avoid using flexbox
2710         https://bugs.webkit.org/show_bug.cgi?id=153742
2711
2712         Reviewed by Sergio Villar Senin.
2713
2714         Based on a patch by Javier Fernandez <jfernandez@igalia.com>
2715
2716         Refactor the UnderOver renderer to use its own layoutBlock method that
2717         does all the layout calculations without considering the flexbox
2718         restrictions.
2719
2720         * css/mathml.css:
2721         (mo, mfrac, munder, mover, munderover): Delete the underover elements from the line defining
2722         the column direction.
2723         (munder, mover, munderover): Deleted. This flexbox property is no longer needed.
2724         (mover > :last-child, munderover > :last-child): Deleted. This flexbox property is no longer
2725         needed.
2726         * rendering/mathml/RenderMathMLUnderOver.cpp:
2727         (WebCore::RenderMathMLUnderOver::firstLineBaseline): Use ascentForChild.
2728         (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Avoid stretching
2729         operators that are not stretchy.
2730         (WebCore::RenderMathMLUnderOver::isValid): Helper function to ensure that the child list is
2731         valid with respect to the MathML specification.
2732         (WebCore::RenderMathMLUnderOver::base): Added. Helper function.
2733         (WebCore::RenderMathMLUnderOver::under): Added. Helper function.
2734         (WebCore::RenderMathMLUnderOver::over): Added. Helper function.
2735         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): Added.
2736         The preferred width is the maximum preferred width of the base, under and over scripts.
2737         (WebCore::RenderMathMLUnderOver::horizontalOffset): Added, helper to calculate the
2738         horizontal position of children (horizontally centered).
2739         (WebCore::RenderMathMLUnderOver::layoutBlock): Added, it lays out the base, underscript and
2740         overscript. It calculates the exact logical width, which may differ from the preferred width when
2741         one child contains stretchy operators. It later sets the locations of children accordingly
2742         and sets the heigth of the render element.
2743         (WebCore::RenderMathMLUnderOver::paintChildren): Added, we have to use the usual traverse
2744         instead of the one that comes from the flexbox. This will be removed in a follow-up patch.
2745         (WebCore::RenderMathMLUnderOver::layout): Deleted.
2746         * rendering/mathml/RenderMathMLUnderOver.h: Added new functions definitions.
2747
2748 2016-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2749
2750         [GTK] Rework the theming code for GTK+ 3.20
2751         https://bugs.webkit.org/show_bug.cgi?id=156333
2752
2753         Reviewed by Michael Catanzaro.
2754
2755         During the 3.19 GTK+ release cycle, the GTK+ css system was reworked, making themes and programs rendering
2756         themed widgets, incompatible with the new system. We were trying to fix our rendering every time GTK+ broke
2757         something, but we were just changing whatever it was needed to make our rendering look like current GTK+ with
2758         the default theme Adwaita. This means that our rendering will be broken for other themes or that changes in
2759         Adwaita can break our rendering. This solution was good enough to ensure WebKitGTK+ 2.12 looked good with GTK+
2760         3.20, but it doesn't work in the long term. We need to ensure that our theming code honors the new GTK+ CSS
2761         properties (max-width, min-width, margin, padding, border, ...) in all the cases, not only the cases where
2762         Adwaita uses them like we currently do.
2763         This patch splits all rendering methods to keep the current code for previous GTK+ versions and adds new code
2764         for GTK+ >= 3.20 using the new RenderThemeGadget classes. This makes the code easier to read, since there aren't
2765         ifdef blocks in the functions, and we ensure we don't break previous rendering.
2766
2767         * PlatformGTK.cmake: Add new files to compilation.
2768         * html/shadow/SpinButtonElement.cpp:
2769         (WebCore::SpinButtonElement::defaultEventHandler): Check the button layout used by the theme to decide the
2770         current buttons state.
2771         * platform/gtk/RenderThemeGadget.cpp: Added.
2772         (WebCore::RenderThemeGadget::create):
2773         (WebCore::createStyleContext):
2774         (WebCore::appendElementToPath):
2775         (WebCore::RenderThemeGadget::RenderThemeGadget):
2776         (WebCore::RenderThemeGadget::~RenderThemeGadget):
2777         (WebCore::RenderThemeGadget::marginBox):
2778         (WebCore::RenderThemeGadget::borderBox):
2779         (WebCore::RenderThemeGadget::paddingBox):
2780         (WebCore::RenderThemeGadget::contentsBox):
2781         (WebCore::RenderThemeGadget::color):
2782         (WebCore::RenderThemeGadget::backgroundColor):
2783         (WebCore::RenderThemeGadget::minimumSize):
2784         (WebCore::RenderThemeGadget::preferredSize):
2785         (WebCore::RenderThemeGadget::render):
2786         (WebCore::RenderThemeGadget::renderFocus):
2787         (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget):
2788         (WebCore::RenderThemeTextFieldGadget::RenderThemeTextFieldGadget):
2789         (WebCore::RenderThemeTextFieldGadget::minimumSize):
2790         (WebCore::RenderThemeToggleGadget::RenderThemeToggleGadget):
2791         (WebCore::RenderThemeToggleGadget::render):
2792         (WebCore::RenderThemeArrowGadget::RenderThemeArrowGadget):
2793         (WebCore::RenderThemeArrowGadget::render):
2794         (WebCore::RenderThemeIconGadget::RenderThemeIconGadget):
2795         (WebCore::RenderThemeIconGadget::gtkIconSizeForPixelSize):
2796         (WebCore::RenderThemeIconGadget::render):
2797         (WebCore::RenderThemeIconGadget::minimumSize):
2798         * platform/gtk/RenderThemeGadget.h: Added.
2799         (WebCore::RenderThemeGadget::context):
2800         * rendering/RenderTheme.h:
2801         (WebCore::RenderTheme::innerSpinButtonLayout): Added this method to allow themes use a different layout for the
2802         buttons.
2803         * rendering/RenderThemeGtk.cpp:
2804         (WebCore::themeChangedCallback): Just moved this code to a common place.
2805         (WebCore::RenderThemeGtk::RenderThemeGtk): Initialize the theme monitor in the constructor.
2806         (WebCore::createStyleContext): Remove the render parts that are specific to GTK+ 3.20.
2807         (WebCore::RenderThemeGtk::adjustRepaintRect): Moved inside a GTK+ < 3.20 ifdef block.
2808         (WebCore::themePartStateFlags): Helper function to get the GtkStateFlags of a theme part for a given RenderObject.
2809         (WebCore::shrinkToMinimumSizeAndCenterRectangle): Move this common code to a helper function.
2810         (WebCore::setToggleSize):
2811         (WebCore::paintToggle):
2812         (WebCore::RenderThemeGtk::paintButton):
2813         (WebCore::RenderThemeGtk::popupInternalPaddingBox):
2814         (WebCore::RenderThemeGtk::paintMenuList):
2815         (WebCore::RenderThemeGtk::adjustTextFieldStyle): For GTK+ 3.20 we need to ensure a minimum size for spin buttons,
2816         so if the text field is for a spin button, we adjust the desired size here.
2817         (WebCore::RenderThemeGtk::paintTextField): In GTK+ 3.20 the CSS gadgets used to render spin buttons are
2818         different, so we check here if this is the entry of a spin button to use the right gadgets.
2819         (WebCore::adjustSearchFieldIconStyle):
2820         (WebCore::RenderThemeGtk::paintTextArea):
2821         (WebCore::RenderThemeGtk::adjustSearchFieldResultsButtonStyle):
2822         (WebCore::RenderThemeGtk::paintSearchFieldResultsButton):
2823         (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
2824         (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
2825         (WebCore::paintSearchFieldIcon):
2826         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
2827         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
2828         (WebCore::centerRectVerticallyInParentInputElement): Moved inside a GTK+ < 3.20 ifdef block.
2829         (WebCore::RenderThemeGtk::paintSliderTrack):
2830         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
2831         (WebCore::RenderThemeGtk::paintSliderThumb):
2832         (WebCore::RenderThemeGtk::progressBarRectForBounds): Ensure a minimum size of progress bars in GTK+ 3.20.
2833         (WebCore::RenderThemeGtk::paintProgressBar):
2834         (WebCore::RenderThemeGtk::innerSpinButtonLayout): Use an horizontal layout for spin buttons.
2835         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
2836         (WebCore::RenderThemeGtk::paintInnerSpinButton):
2837         (WebCore::styleColor):
2838         (WebCore::RenderThemeGtk::paintMediaButton):
2839         * rendering/RenderThemeGtk.h:
2840
2841 2016-04-11  Antti Koivisto  <antti@apple.com>
2842
2843         Implement functional :host() pseudo class
2844         https://bugs.webkit.org/show_bug.cgi?id=156397
2845         <rdar://problem/25621445>
2846
2847         Reviewed by Darin Adler.
2848
2849         We already support :host. Add functional syntax too.
2850
2851         * css/CSSGrammar.y.in:
2852
2853             Parse functional :host().
2854
2855         * css/CSSParser.cpp:
2856         (WebCore::CSSParser::detectFunctionTypeToken):
2857         * css/CSSParserValues.cpp:
2858         (WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector):
2859         * css/CSSParserValues.h:
2860         * css/ElementRuleCollector.cpp:
2861         (WebCore::ElementRuleCollector::matchedRuleList):
2862         (WebCore::ElementRuleCollector::addMatchedRule):
2863
2864             Factor some shared code here.
2865
2866         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
2867
2868             Instead of using the generic paths use a :host specific code path for matching.
2869             This makes it easier to avoid :host matching when it shouldn't.
2870
2871         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
2872         * css/ElementRuleCollector.h:
2873         * css/RuleSet.cpp:
2874         (WebCore::computeMatchBasedOnRuleHash):
2875
2876             :host is always handled by the special matching path.
2877
2878         * css/SelectorChecker.cpp:
2879         (WebCore::SelectorChecker::match):
2880         (WebCore::SelectorChecker::matchHostPseudoClass):
2881
2882             Add a function specifically for checking :host. In always fails on the normal code paths.
2883             Check the argument selector if provided.
2884
2885         (WebCore::hasScrollbarPseudoElement):
2886         * css/SelectorChecker.h:
2887
2888 2016-04-11  Said Abou-Hallawa  <sabouhallawa@apple,com>
2889
2890         Merge CG ImageSource and non CG ImageSource implementation in one file
2891         https://bugs.webkit.org/show_bug.cgi?id=155456
2892
2893         Reviewed by Darin Adler.
2894
2895         ImageSource for CG and CG code paths look very similar. All the platform
2896         specific code can be moved to ImageDecoder classes for CG and non CG. And
2897         we can have the ImageSource be platform independent and we get rid of
2898         ImageSourceCG.cpp.
2899
2900         Test: fast/images/image-subsampling.html
2901
2902         * CMakeLists.txt:
2903         * PlatformAppleWin.cmake:
2904         * PlatformMac.cmake:
2905         * WebCore.xcodeproj/project.pbxproj:
2906         Delete ImageSourceCG.cpp form all make files and add ImageSource.cpp to
2907         CMakeLists.txt.
2908         
2909         * platform/Cursor.cpp:
2910         (WebCore::determineHotSpot):
2911         * platform/graphics/BitmapImage.cpp:
2912         (WebCore::BitmapImage::hotSpot):
2913         (WebCore::BitmapImage::getHotSpot): Deleted.
2914         * platform/graphics/BitmapImage.h:
2915         * platform/graphics/Image.h:
2916         (WebCore::Image::hotSpot):
2917         (WebCore::Image::getHotSpot): Deleted.
2918         Rename getHotSpot() to hotSpot() and change it to return Optional<IntPoint>.
2919         
2920         * platform/graphics/ImageSource.cpp:
2921         (WebCore::ImageSource::~ImageSource): Remove clear(true) call. It does nothing.
2922         (WebCore::ImageSource::clearFrameBufferCache): A wrapper which calls ImageDecoder::clearFrameBufferCache().
2923         (WebCore::ImageSource::clear): Calls clearFrameBufferCache() which will do nothing for CG.
2924         
2925         (WebCore::ImageSource::ensureDecoderIsCreated): Change SharedBuffer* to
2926         const SharedBuffer& and remove the call to ImageDecoder::setMaxNumPixels().
2927         The value of const static int CG ImageDecoder::m_maxNumPixels will be set
2928         based on IMAGE_DECODER_DOWN_SAMPLING.
2929         
2930         (WebCore::ImageSource::setData): Pass SharedBuffer& to the underlying functions.
2931         
2932         (WebCore::ImageSource::calculateMaximumSubsamplingLevel): Returns the maximum
2933         subsampling level allowed for an image.
2934         
2935         (WebCore::ImageSource::subsamplingLevelForScale): Converts from a scale to
2936         SubsamplingLevel taking into consideration the maximumSubsamplingLevel for
2937         a particular image.
2938         
2939         (WebCore::ImageSource::bytesDecodedToDetermineProperties): Returns the number
2940         of encoded bytes which can determine the image properties. For non CG it's
2941         zero. For CG it is a maximum value which can be corrected later.
2942         
2943         (WebCore::ImageSource::isSizeAvailable):
2944         (WebCore::ImageSource::sizeRespectingOrientation):
2945         (WebCore::ImageSource::frameCount):
2946         (WebCore::ImageSource::repetitionCount):
2947         (WebCore::ImageSource::filenameExtension):
2948         (WebCore::ImageSource::getHotSpot):
2949         (WebCore::ImageSource::frameIsCompleteAtIndex):
2950         (WebCore::ImageSource::frameHasAlphaAtIndex):
2951         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
2952         (WebCore::ImageSource::frameSizeAtIndex):
2953         (WebCore::ImageSource::frameBytesAtIndex):
2954         (WebCore::ImageSource::frameDurationAtIndex):
2955         (WebCore::ImageSource::orientationAtIndex):
2956         (WebCore::ImageSource::createFrameImageAtIndex):
2957         These are wrappers for the ImageDecoder APIs. The purpose of these functions
2958         is to ensure the ImageDecoder is created.
2959         
2960         (WebCore::ImageSource::dump): Called from BitmapImage::dump().
2961         
2962         (WebCore::ImageSource::getHotSpot): Deleted.
2963         
2964         * platform/graphics/ImageSource.h:
2965         (WebCore::ImageSource::setAllowSubsampling): Called from BitmapImage::setAllowSubsampling().
2966         
2967         (WebCore::ImageSource::maxPixelsPerDecodedImage): Deleted.
2968         (WebCore::ImageSource::setMaxPixelsPerDecodedImage): Deleted.
2969         Setting maxPixelsPerDecodedImage was moved to the non CG ImageDecoder.
2970         
2971         * platform/graphics/cg/ImageDecoderCG.cpp:
2972         (WebCore::ImageDecoder::setData): Change SharedBuffer* to SharedBuffer&.
2973
2974         (WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
2975         The code was moved to ImageSource::subsamplingLevelForScale().
2976         
2977         * platform/graphics/cg/ImageDecoderCG.h:
2978         (WebCore::ImageDecoder::create): Make the prototype of this function
2979         suitable for CG and non CG cases.
2980         (WebCore::ImageDecoder::clearFrameBufferCache): Empty functions for CG.
2981         
2982         * platform/graphics/cg/ImageSourceCG.cpp: Removed.
2983         
2984         * platform/image-decoders/ImageDecoder.cpp:
2985         (WebCore::ImageDecoder::frameIsCompleteAtIndex): A mew function to return
2986         whether the frame decoding is complete or not.
2987         
2988         (WebCore::ImageDecoder::frameHasAlphaAtIndex): Simplify the logic.
2989         
2990         (WebCore::ImageDecoder::frameDurationAtIndex): The code was moved from
2991         ImageSource::frameDurationAtIndex() in ImageSource.cpp.
2992         
2993         (WebCore::ImageDecoder::createFrameImageAtIndex): The code was moved from
2994         ImageSource::createFrameImageAtIndex() in ImageSource.cpp.
2995         
2996         * platform/image-decoders/ImageDecoder.h:
2997         (WebCore::ImageDecoder::ImageDecoder): Initialize the members in class.
2998         (WebCore::ImageDecoder::~ImageDecoder): Fix the braces style.
2999         (WebCore::ImageDecoder::setData): Change the type of the argument from
3000         SharedBuffer* to SharedBuffer&.
3001         (WebCore::ImageDecoder::frameSizeAtIndex): Add the argument SubsamplingLevel
3002         so it can have the same prototype as CG.
3003         (WebCore::ImageDecoder::orientationAtIndex): Rename it to the same of CG.
3004         
3005         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
3006         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
3007         (WebCore::ImageDecoder::subsamplingLevelForScale): Add these functions
3008         and return the default values so we do not have to add directive compiled
3009         non CG blocks in ImageSource.cpp.
3010
3011         (WebCore::ImageDecoder::hotSpot): Return Optional<IntPoint>.
3012         
3013         (WebCore::ImageDecoder::orientation): Deleted.
3014         (WebCore::ImageDecoder::setMaxNumPixels): Deleted.
3015         
3016         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
3017         (WebCore::BMPImageDecoder::setData):
3018         * platform/image-decoders/bmp/BMPImageDecoder.h:
3019         * platform/image-decoders/gif/GIFImageDecoder.cpp:
3020         (WebCore::GIFImageDecoder::setData):
3021         (WebCore::GIFImageDecoder::decode):
3022         * platform/image-decoders/gif/GIFImageDecoder.h:
3023         * platform/image-decoders/gif/GIFImageReader.h:
3024         (GIFImageReader::setData):
3025         * platform/image-decoders/ico/ICOImageDecoder.cpp:
3026         (WebCore::ICOImageDecoder::setData):
3027         Use reference SharedBuffer instead of pointer SharedBuffer.
3028         
3029         (WebCore::ICOImageDecoder::hotSpot):
3030         (WebCore::ICOImageDecoder::hotSpotAtIndex):
3031         Change hotSpot() to return Optional<IntPoint>.
3032         * platform/image-decoders/ico/ICOImageDecoder.h:
3033                 
3034         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
3035         Pass reference SharedBuffer instead of pointer SharedBuffer.
3036
3037 2016-04-11  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
3038
3039         [CMake] Make FOLDER property INHERITED
3040         https://bugs.webkit.org/show_bug.cgi?id=156460
3041
3042         Reviewed by Brent Fulgham.
3043
3044         * CMakeLists.txt:
3045         Set FOLDER property as a directory property not a target property
3046
3047 2016-04-10  Sam Weinig  <sam@webkit.org>
3048
3049         Fix the build.
3050
3051         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3052         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
3053
3054 2016-04-08  Sam Weinig  <sam@webkit.org>
3055
3056         Remove support for custom target picker actions
3057         <rdar://problem/24987783>
3058         https://bugs.webkit.org/show_bug.cgi?id=156434
3059
3060         Reviewed by Eric Carlson.
3061
3062         This mostly entailed rolling out r197429 and r197569.
3063
3064         * Modules/mediasession/WebMediaSessionManager.cpp:
3065         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
3066         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
3067         (WebCore::WebMediaSessionManager::clientStateDidChange):
3068         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
3069         (WebCore::WebMediaSessionManager::configureNewClients):
3070         (WebCore::WebMediaSessionManager::customPlaybackActionSelected): Deleted.
3071         * Modules/mediasession/WebMediaSessionManager.h:
3072         * Modules/mediasession/WebMediaSessionManagerClient.h:
3073         * dom/Document.cpp:
3074         (WebCore::Document::removePlaybackTargetPickerClient):
3075         (WebCore::Document::showPlaybackTargetPicker):
3076         (WebCore::Document::playbackTargetPickerClientStateDidChange):
3077         (WebCore::Document::setShouldPlayToPlaybackTarget):
3078         (WebCore::Document::customPlaybackActionSelected): Deleted.
3079         * dom/Document.h:
3080         * html/HTMLMediaElement.cpp:
3081         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
3082         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
3083         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless):
3084         (WebCore::HTMLMediaElement::customPlaybackActionSelected): Deleted.
3085         (WebCore::HTMLMediaElement::playbackTargetPickerCustomActionName): Deleted.
3086         * html/HTMLMediaElement.h:
3087         * html/MediaElementSession.cpp:
3088         (WebCore::MediaElementSession::showPlaybackTargetPicker):
3089         (WebCore::MediaElementSession::hasWirelessPlaybackTargets):
3090         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
3091         (WebCore::MediaElementSession::mediaStateDidChange):
3092         (WebCore::MediaElementSession::customPlaybackActionSelected): Deleted.
3093         * html/MediaElementSession.h:
3094         * page/ChromeClient.h:
3095         * page/Page.cpp:
3096         (WebCore::Page::removePlaybackTargetPickerClient):
3097         (WebCore::Page::showPlaybackTargetPicker):
3098         (WebCore::Page::setShouldPlayToPlaybackTarget):
3099         (WebCore::Page::ensureTestTrigger):
3100         (WebCore::Page::customPlaybackActionSelected): Deleted.
3101         * page/Page.h:
3102         (WebCore::Page::testTrigger):
3103         * platform/audio/PlatformMediaSession.h:
3104         (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
3105         (WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
3106         (WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
3107         (WebCore::PlatformMediaSessionClient::customPlaybackActionSelected): Deleted.
3108         * platform/graphics/MediaPlaybackTargetClient.h:
3109         * platform/graphics/MediaPlaybackTargetPicker.cpp:
3110         (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
3111         (WebCore::MediaPlaybackTargetPicker::addPendingAction):
3112         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
3113         * platform/graphics/MediaPlaybackTargetPicker.h:
3114         (WebCore::MediaPlaybackTargetPicker::availableDevicesDidChange):
3115         (WebCore::MediaPlaybackTargetPicker::currentDeviceDidChange):
3116         (WebCore::MediaPlaybackTargetPicker::Client::customPlaybackActionSelected): Deleted.
3117         (WebCore::MediaPlaybackTargetPicker::customPlaybackActionSelected): Deleted.
3118         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
3119         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3120         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
3121         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
3122         * platform/mac/WebVideoFullscreenInterfaceMac.h:
3123         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
3124         (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):
3125         (WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions):
3126         (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback): Deleted.
3127         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
3128         (WebCore::MediaPlaybackTargetPickerMock::timerFired):
3129         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
3130         * platform/mock/MediaPlaybackTargetPickerMock.h:
3131         * platform/spi/cocoa/AVKitSPI.h:
3132
3133 2016-04-09  Konstantin Tokarev  <annulen@yandex.ru>
3134
3135         Fixed compilation of JPEGImageDecoder with libjpeg v9.
3136         https://bugs.webkit.org/show_bug.cgi?id=156445
3137
3138         Reviewed by Michael Catanzaro.
3139
3140         ICU defines TRUE and FALSE macros, breaking libjpeg v9 headers.
3141
3142         No new tests needed.
3143
3144         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
3145
3146 2016-04-09  Commit Queue  <commit-queue@webkit.org>
3147
3148         Unreviewed, rolling out r199242.
3149         https://bugs.webkit.org/show_bug.cgi?id=156442
3150
3151         Caused many many leaks (Requested by ap on #webkit).
3152
3153         Reverted changeset:
3154
3155         "Web Inspector: get rid of InspectorBasicValue and
3156         InspectorString subclasses"
3157         https://bugs.webkit.org/show_bug.cgi?id=156407
3158         http://trac.webkit.org/changeset/199242
3159
3160 2016-04-09  Commit Queue  <commit-queue@webkit.org>
3161
3162         Unreviewed, rolling out r199268.
3163         https://bugs.webkit.org/show_bug.cgi?id=156440
3164
3165         Broke Windows build (Requested by ap on #webkit).
3166
3167         Reverted changeset:
3168
3169         "Implement functional :host() pseudo class"
3170         https://bugs.webkit.org/show_bug.cgi?id=156397
3171         http://trac.webkit.org/changeset/199268
3172
3173 2016-04-09  Antti Koivisto  <antti@apple.com>
3174
3175         Implement functional :host() pseudo class
3176         https://bugs.webkit.org/show_bug.cgi?id=156397
3177         <rdar://problem/25621445>
3178
3179         Reviewed by Darin Adler.
3180
3181         We already support :host. Add functional syntax too.
3182
3183         * css/CSSGrammar.y.in:
3184
3185             Parse functional :host().
3186
3187         * css/CSSParser.cpp:
3188         (WebCore::CSSParser::detectFunctionTypeToken):
3189         * css/CSSParserValues.cpp:
3190         (WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector):
3191         * css/CSSParserValues.h:
3192         * css/ElementRuleCollector.cpp:
3193         (WebCore::ElementRuleCollector::matchedRuleList):
3194         (WebCore::ElementRuleCollector::addMatchedRule):
3195
3196             Factor some shared code here.
3197
3198         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
3199
3200             Instead of using the generic paths use a :host specific code path for matching.
3201             This makes it easier to avoid :host matching when it shouldn't.
3202
3203         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
3204         * css/ElementRuleCollector.h:
3205         * css/RuleSet.cpp:
3206         (WebCore::computeMatchBasedOnRuleHash):
3207
3208             :host is always handled by the special matching path.
3209
3210         * css/SelectorChecker.cpp:
3211         (WebCore::SelectorChecker::match):
3212         (WebCore::SelectorChecker::matchHostPseudoClass):
3213
3214             Add a function specifically for checking :host. In always fails on the normal code paths.
3215             Check the argument selector if provided.
3216
3217         (WebCore::hasScrollbarPseudoElement):
3218         * css/SelectorChecker.h:
3219
3220 2016-04-07  Darin Adler  <darin@apple.com>
3221
3222         Improve IDL support for object arguments that are neither optional nor nullable
3223         https://bugs.webkit.org/show_bug.cgi?id=156149
3224
3225         Reviewed by Chris Dumez.
3226
3227         After this patch, we are almost ready to change some more DOM functions to
3228         use references instead of pointers. Remaining blocking issue is lack of support
3229         for ShouldPassWrapperByReference in the gobject bindings.
3230
3231         * bindings/objc/ExceptionHandlers.h: Add NO_RETURN to raiseDOMException.
3232         Added a new raiseTypeErrorException. Re-indented header and removed unneeded
3233         include and forward declarations.
3234
3235         * bindings/objc/ExceptionHandlers.mm:
3236         (WebCore::raiseDOMException): Added RELEASE_ASSERT_NOT_REACHED so the compiler
3237         will understand this is NO_RETURN. Also updated FIXME comment.
3238         (WebCore::raiseTypeErrorException): Added.
3239
3240         * bindings/scripts/CodeGenerator.pm: Removed unneeded code that allows the type
3241         "AtomicString" in IDL files.
3242         (ShouldPassWrapperByReference): Added. Contains the logic from the function in
3243         the JavaScript code generator that was named IsPointerParameterPassedByReference,
3244         minus a couple checks that are unneeded. For use in other code generators so they
3245         are all consistent about how they call the DOM implementation.
3246
3247         * bindings/scripts/CodeGeneratorGObject.pm:
3248         (SkipFunction): Removed support for unused CustomBinding extended attribute.
3249
3250         * bindings/scripts/CodeGeneratorJS.pm:
3251         (GenerateHeader): Removed support for unused CustomBinding extended attribute.
3252         (GenerateImplementation): Ditto. Also changed type checking code to throw a
3253         type error in a more efficient way, using throwVMTypeError directly.
3254         (GenerateParametersCheck): Rearranged code a bit so that arguments that need to
3255         be passed in unusual ways are handled all in one place. Use WTFMove for newly
3256         created NodeFilter objects. Simplified the reference logic so it doesn't need
3257         to do an additional check to see if a type is a callback. Also changed type
3258         checking code to throw a type error in a more efficient way, using throwVMTypeError
3259         directly. Also corrected mistake where null checking code was throwing
3260         TYPE_MISMATCH_ERR instead of a type error.
3261         (GetNativeType): Coding style tweak.
3262         (ShouldPassWrapperByReference): Renamed from IsPointerParameterPassedByReference.
3263         Changed to call underlying ShouldPassWrapperByReference function in the language-
3264         independent code generator.
3265         (GenerateConstructorDefinition): Updated for name change.
3266
3267         * bindings/scripts/CodeGeneratorObjC.pm:
3268         (SkipFunction): Removed support for unused CustomBinding extended attribute.
3269         (GenerateImplementation): Added code to null check and pass a reference when
3270         ShouldPassWrapperByReference returns true.
3271
3272         * bindings/scripts/IDLAttributes.txt: Sorted in the AppleCopyright and
3273         UsePointersEvenForNonNullableObjectArguments arguments. Removed the unused
3274         CPPPureInterface and CustomBinding attributes.
3275
3276         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Regenerated test results.
3277         * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
3278         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
3279         * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
3280         * bindings/scripts/test/JS/JSTestObj.h: Ditto.
3281         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
3282         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
3283         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm: Ditto.
3284         * bindings/scripts/test/ObjC/DOMTestCallback.mm: Ditto.
3285         * bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm: Ditto.
3286         * bindings/scripts/test/ObjC/DOMTestInterface.mm: Ditto.
3287         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: Ditto.
3288         * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
3289
3290         * bindings/scripts/test/TestObj.idl: Removed test for CustomBinding.
3291
3292         * dom/DOMImplementation.idl: Fixed #if so that only the return type is different
3293         between JavaScript and the other bindings. Without this change, the different
3294         bindings got different results for ShouldPassWrapperByReference. Also formatted
3295         functions all on a single line.
3296
3297         * dom/EventListener.idl: Removed CPPPureInterface, since it had no effect.
3298         * dom/EventTarget.idl: Ditto.
3299
3300 2016-04-08  Chris Dumez  <cdumez@apple.com>
3301
3302         [WebIDL] Add support for [ExportMacro=XXX] IDL extended attribute
3303         https://bugs.webkit.org/show_bug.cgi?id=156428
3304
3305         Reviewed by Ryosuke Niwa.
3306
3307         Add support for [ExportMacro=XXX] IDL extended attribute (e.g. [ExportMacro=WEBCORE_EXPORT])
3308         so developers can indicate in the IDL which macro to use to export the generated JS bindings
3309         class.
3310
3311         We previously supported this by hard-coding JS class names in the bindings generator which
3312         was ugly.
3313
3314         * Modules/mediasession/MediaSession.idl:
3315         * Modules/mediasource/SourceBuffer.idl:
3316         * Modules/notifications/Notification.idl:
3317         * Modules/webaudio/AudioContext.idl:
3318         * bindings/scripts/CodeGeneratorJS.pm:
3319         (GetExportMacroForJSClass):
3320         (GenerateHeader):
3321         (AddIncludesForType): Deleted.
3322         (AddToImplIncludes): Deleted.
3323         * bindings/scripts/IDLAttributes.txt:
3324         * bindings/scripts/test/TestInterface.idl:
3325         * bindings/scripts/test/TestNode.idl:
3326         * css/CSSStyleDeclaration.idl:
3327         * dom/ClientRect.idl:
3328         * dom/ClientRectList.idl:
3329         * dom/Document.idl:
3330         * dom/Element.idl:
3331         * dom/Node.idl:
3332         * dom/Range.idl:
3333         * fileapi/File.idl:
3334         * html/DOMURL.idl:
3335         * html/HTMLElement.idl:
3336         * html/HTMLMediaElement.idl:
3337         * html/TimeRanges.idl:
3338         * html/canvas/DOMPath.idl:
3339         * inspector/ScriptProfile.idl:
3340         * inspector/ScriptProfileNode.idl:
3341         * page/DOMWindow.idl:
3342         * page/make_settings.pl:
3343         (generateInternalSettingsIdlFile):
3344         * testing/InternalSettings.idl:
3345         * testing/Internals.idl:
3346         * testing/MallocStatistics.idl:
3347         * testing/MemoryInfo.idl:
3348         * testing/TypeConversions.idl:
3349         * xml/XMLHttpRequest.idl:
3350
3351 2016-04-08  Joseph Pecoraro  <pecoraro@apple.com>
3352
3353         Web Inspector: XHRs and Web Worker scripts are not searchable
3354         https://bugs.webkit.org/show_bug.cgi?id=154214
3355         <rdar://problem/24643587>
3356