c3415418ef4d974e7dfa1bf70ab0700cd95595dc
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-30  Matt Rajca  <mrajca@apple.com>
2
3         MediaSession: Use setSessionInternal to set the default media session in HTMLMediaElement's constructor
4         https://bugs.webkit.org/show_bug.cgi?id=146465
5
6         Reviewed by Eric Carlson.
7
8         * html/HTMLMediaElement.cpp:
9         (WebCore::HTMLMediaElement::HTMLMediaElement):
10
11 2015-06-30  Matt Rajca  <mrajca@apple.com>
12
13         Media Session: implement algorithm for updating a media element's session (6.1)
14         https://bugs.webkit.org/show_bug.cgi?id=146460
15
16         Reviewed by Darin Adler.
17
18         In addition to storing a pointer to the new media session, we now:
19
20         - pause the media element if it is 'active' in the current media session
21         - remove the media element from the current media session
22         - release the current media session if there are no more active media elements
23         - set the default media session if the new media session is null
24         - update the 'kind' attribute to match the kind of the new media session
25
26         * Modules/mediasession/MediaSession.cpp:
27         (WebCore::MediaSession::isMediaElementActive):
28         (WebCore::MediaSession::hasActiveMediaElements):
29         * Modules/mediasession/MediaSession.h:
30         * html/HTMLMediaElement.cpp:
31         (WebCore::HTMLMediaElement::setSession):
32         (WebCore::HTMLMediaElement::setSessionInternal):
33         * html/HTMLMediaElement.h:
34
35 2015-06-29  Anders Carlsson  <andersca@apple.com>
36
37         Get rid of unused WKSI functions
38         https://bugs.webkit.org/show_bug.cgi?id=146443
39
40         Reviewed by Tim Horton.
41
42         * platform/graphics/cg/PathCG.cpp:
43         (WebCore::Path::platformAddPathForRoundedRect):
44         Just call CGPathAddRoundedRect directly.
45
46         * platform/ios/WebCoreSystemInterfaceIOS.mm:
47         * platform/mac/WebCoreSystemInterface.h:
48         * platform/mac/WebCoreSystemInterface.mm:
49
50 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
51
52         [Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
53         https://bugs.webkit.org/show_bug.cgi?id=146408
54
55         Reviewed by Darin Adler.
56
57         Current tests cover the case already.
58
59         * Modules/streams/ReadableStream.cpp:
60         (WebCore::ReadableStream::pull): Call finishPull() in a postTask to delay it and simulate the promise
61         resolution.
62
63 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
64
65         [Streams API] Synced bad strategy test with reference implementation
66         https://bugs.webkit.org/show_bug.cgi?id=146411
67
68         Reviewed by Darin Adler.
69
70         Current tests cover the case.
71
72         * bindings/js/ReadableJSStream.cpp:
73         (WebCore::ReadableJSStream::retrieveChunkSize): Check for negative size then running the JavaScript function.
74
75 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr>
76
77         [Streams API] Remove ReadableStream.getReader() custom binding
78         https://bugs.webkit.org/show_bug.cgi?id=146404
79
80         Reviewed by Darin Adler.
81
82         Covered by existing tests.
83
84         * Modules/streams/ReadableStream.cpp:
85         (WebCore::ReadableStream::getReader): Updated to take an exception.
86         * Modules/streams/ReadableStream.h:
87         * Modules/streams/ReadableStream.idl: Updated to remove custom binding.
88         * bindings/js/JSReadableStreamCustom.cpp:
89         (WebCore::JSReadableStream::getReader): Deleted.
90         * bindings/js/JSReadableStreamReaderCustom.cpp:
91         (WebCore::constructJSReadableStreamReader): Updated to pass an exception to getReader.
92
93 2015-06-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
94
95         [Streams API] ReadableStreamReader.closed should use DOMPromise
96         https://bugs.webkit.org/show_bug.cgi?id=146406
97
98         Reviewed by Darin Adler.
99
100         Added storage of ClosedPromise as Optional of ReadableStream.
101         Updated code accordingly.
102
103         Covered by existing tests.
104
105         * Modules/streams/ReadableStream.cpp:
106         (WebCore::ReadableStream::clearCallbacks):
107         (WebCore::ReadableStream::releaseReader):
108         (WebCore::ReadableStream::changeStateToErrored):
109         (WebCore::ReadableStream::closed):
110         * Modules/streams/ReadableStream.h:
111         * Modules/streams/ReadableStreamReader.cpp:
112         (WebCore::ReadableStreamReader::closed):
113         * Modules/streams/ReadableStreamReader.h:
114         * bindings/js/JSReadableStreamReaderCustom.cpp:
115         (WebCore::JSReadableStreamReader::closed):
116
117 2015-06-29  Simon Fraser  <simon.fraser@apple.com>
118
119         [iOS WK2] WKWebViews in Facebook app start off black
120         https://bugs.webkit.org/show_bug.cgi?id=146445
121         rdar://problem/21600433
122
123         Reviewed by Tim Horton.
124
125         If -isOpaque is toggled on a WKWebView, we failed to make the page tiles non-opaque
126         for a while. After r183775, RenderLayerCompositor::rootBackgroundTransparencyChanged() was called,
127         but only considered the computed document background color, and not the view transparency.
128         
129         Fix by having rootBackgroundTransparencyChanged() simply use viewHasTransparentBackground(),
130         which checks the FrameView transparency. Now we just need to store a transparency bool rather
131         than the old color (we only checked its alpha anyway).
132
133         * rendering/RenderLayerCompositor.cpp:
134         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
135
136 2015-06-29  Dean Jackson  <dino@apple.com>
137
138         WebKit should use 80% black background for PiP indicator
139         https://bugs.webkit.org/show_bug.cgi?id=146444
140         <rdar://problem/21555726>
141
142         Reviewed by Sam Weinig.
143
144         Change the black background to a slightly less black background.
145         This also involved making the placard artwork white, in order
146         to keep it visible against the new grey.
147
148         * Modules/mediacontrols/mediaControlsiOS.css:
149         (audio::-webkit-media-controls-wireless-playback-status):
150         (audio::-webkit-media-controls-wireless-playback-status.small):
151         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
152
153 2015-06-29  Brady Eidson  <beidson@apple.com>
154
155         Flag sync XHRs from the network process so they can be handled appropriately.
156         <rdar://problem/21579162> and https://bugs.webkit.org/show_bug.cgi?id=146441
157
158         Reviewed by Darin Adler.
159
160         * platform/network/ResourceHandleClient.h:
161         (WebCore::ResourceHandleClient::loadingSynchronousXHR): Added so clients of asynchronous
162           loads can signal they should be treated like synchronous loads at the platform level.
163
164         * platform/network/cf/ResourceHandleCFNet.cpp:
165         (WebCore::ResourceHandle::start): Adjust SchedulingBehavior based on the client.
166
167         * platform/network/mac/ResourceHandleMac.mm:
168         (WebCore::ResourceHandle::start): Adjust SchedulingBehavior based on the client.
169
170 2015-06-29  Chris Fleizach  <cfleizach@apple.com>
171
172         AX: PlatformSpeechSynthesizer code doesn't catch Objective-C exceptions
173         https://bugs.webkit.org/show_bug.cgi?id=146419
174
175         Reviewed by Simon Fraser.
176
177         Make sure ObjC exception resulting from calling into the platform cause problems in WebKit.
178
179         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
180         (-[WebSpeechSynthesisWrapper speakUtterance:]):
181         (-[WebSpeechSynthesisWrapper pause]):
182         (-[WebSpeechSynthesisWrapper resume]):
183         (-[WebSpeechSynthesisWrapper cancel]):
184         (-[WebSpeechSynthesisWrapper speechSynthesizer:didStartSpeechUtterance:]):
185         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
186         (WebCore::PlatformSpeechSynthesizer::pause):
187
188 2015-06-29  Matt Rajca  <mrajca@apple.com>
189
190         Removing an element from a media session should also remove it from the sets of active participating elements
191         https://bugs.webkit.org/show_bug.cgi?id=146420
192
193         Reviewed by Eric Carlson.
194
195         * Modules/mediasession/MediaSession.cpp:
196         (WebCore::MediaSession::removeMediaElement):
197
198 2015-06-29  Dean Jackson  <dino@apple.com>
199
200         Temporarily disable PICTURE_SIZES
201         https://bugs.webkit.org/show_bug.cgi?id=146435
202         <rdar://problem/21087013>
203
204         Reviewed by Tim Horton.
205
206         Temporarily disable PICTURE_SIZES because it causes problems with out
207         of date <picture> polyfills.
208
209         * Configurations/FeatureDefines.xcconfig:
210
211 2015-06-29  Tim Horton  <timothy_horton@apple.com>
212
213         Fix the build.
214
215         * editing/cocoa/HTMLConverter.mm:
216         * platform/spi/cocoa/NSAttributedStringSPI.h:
217
218 2015-06-29  Tim Horton  <timothy_horton@apple.com>
219
220         Fix the build.
221
222         * platform/spi/cocoa/NSAttributedStringSPI.h:
223
224 2015-06-29  Tim Horton  <timothy_horton@apple.com>
225
226         Fix the build.
227
228         * platform/spi/cocoa/NSAttributedStringSPI.h:
229
230 2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
231
232         Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
233         https://bugs.webkit.org/show_bug.cgi?id=146379
234
235         Reviewed by Darin Adler.
236
237         The bug was caused by WebKit not updating the font panel when the typing style changes.
238         There was also a bug that WebKit never updated font attributes on OS X.
239
240         Fixed the bugs by always updating the font panel after applying style instead of only
241         when the selection changes and setting the font attributes.
242
243         I tried really had to write a WebKit API test but I couldn't get it to work so there are
244         no new tests :(
245
246         * WebCore.xcodeproj/project.pbxproj:
247         * editing/Editor.cpp:
248         (WebCore::Editor::applyStyle):
249         (WebCore::Editor::shouldApplyStyle):
250         (WebCore::Editor::applyParagraphStyle):
251         (WebCore::Editor::applyStyleToSelection):
252         (WebCore::Editor::applyParagraphStyleToSelection):
253         (WebCore::Editor::selectionStartHasStyle):
254         (WebCore::Editor::document):
255         (WebCore::Editor::styleForSelectionStart): Deleted.
256         * editing/Editor.h:
257         * editing/cocoa/EditorCocoa.h: Added. Shares the declaration for NSUnderlineStyle in iOS.
258         * editing/cocoa/EditorCocoa.mm: Added.
259         (WebCore::Editor::styleForSelectionStart): Moved from Editor.cpp
260         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle): Extracted from iOS's
261         fontAttributesForSelectionStart implementation.
262         * editing/cocoa/HTMLConverter.mm:
263         * editing/ios/EditorIOS.mm:
264         (WebCore::Editor::fontAttributesForSelectionStart):
265         * editing/mac/EditorMac.mm:
266         (WebCore::Editor::fontAttributesForSelectionStart):
267         * loader/EmptyClients.h:
268         * page/EditorClient.h:
269
270 2015-06-29  Matt Rajca  <mrajca@apple.com>
271
272         MediaSession: use a HashSet for the collection of participating elements
273         https://bugs.webkit.org/show_bug.cgi?id=146421
274
275         Reviewed by Eric Carlson.
276
277         * Modules/mediasession/MediaSession.cpp:
278         (WebCore::MediaSession::addMediaElement):
279         (WebCore::MediaSession::removeMediaElement):
280         * Modules/mediasession/MediaSession.h:
281
282 2015-06-29  Dean Jackson  <dino@apple.com>
283
284         Setting to enable/disable media controls sizing on page zoom
285         https://bugs.webkit.org/show_bug.cgi?id=146423
286         <rdar://problem/18379634>
287
288         Reviewed by Eric Carlson.
289
290         Add a new setting "MediaControlsScaleWithPageZoom" that can disable
291         the behaviour we currently implement on iOS, where the media controls
292         attempt to remain at a fixed size independent of page zoom.
293
294         * html/HTMLMediaElement.cpp:
295         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Do not
296         set this value to true if the new setting is disabled.
297         * page/Settings.cpp:
298         * page/Settings.in: Add the new setting.
299
300 2015-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
301
302         WebRTC: Update the MediaStream API
303         https://bugs.webkit.org/show_bug.cgi?id=146313
304
305         Reviewed by Eric Carlson.
306
307         Update the MediaStream API (MediaStream, MediaStreamTrack and
308         RealtimeMediaSource) to match the Media Capture and Stream
309         specification [1]. Notable changes:
310
311         Updated event handling to synchronously update corresponding
312         state/attributes as events are dispatched.
313
314         Removed 'new' state from MediaStreamTrack. A track is either 'live' or
315         'ended'. As a consequence 'started' event is also removed.
316
317         MediaStreamTrack always has a source (disconnected source concept was
318         removed from the spec). Therefore, more state can be kept at the source
319         without going away.
320
321         Calculate MediaStream.active internally, from the track set, instead of
322         setting it externally.
323
324         Updated RealtimeMediaSource Observer interface.
325
326         Replaced MediaStream's separate audio and video track lists with a
327         single track set (more aligned with spec).
328
329         Updated MediaStream constructor to adopt instead of clone track
330         arguments (or tracks from MediaStream argument).
331
332         Removed MediaStreamTrack.getSources() and corresponding test (removed
333         from spec).
334
335         Test status: 3 added, 8 existing enabled (some updated) and 1 removed.
336
337         [1] http://w3c.github.io/mediacapture-main/archives/20150523/getusermedia.html
338
339         Tests: fast/mediastream/MediaStreamTrack-clone.html
340                fast/mediastream/MediaStreamTrack-kind.html
341                fast/mediastream/MediaStreamTrack-stop.html
342
343         * Modules/mediastream/MediaStream.cpp:
344         (WebCore::MediaStream::create):
345         (WebCore::MediaStream::MediaStream):
346         (WebCore::MediaStream::clone):
347         (WebCore::MediaStream::addTrack):
348         (WebCore::MediaStream::removeTrack):
349         (WebCore::MediaStream::getTrackById):
350         (WebCore::MediaStream::getAudioTracks):
351         (WebCore::MediaStream::getVideoTracks):
352         (WebCore::MediaStream::getTracks):
353         (WebCore::MediaStream::contextDestroyed):
354         (WebCore::MediaStream::trackDidEnd):
355         (WebCore::MediaStream::activeStatusChanged):
356         (WebCore::MediaStream::didAddTrackToPrivate):
357         (WebCore::MediaStream::didRemoveTrackFromPrivate):
358         (WebCore::MediaStream::internalAddTrack):
359         (WebCore::MediaStream::internalRemoveTrack):
360         (WebCore::MediaStream::scheduleActiveStateChange):
361         (WebCore::MediaStream::activityEventTimerFired):
362         (WebCore::MediaStream::trackVectorForType):
363         (WebCore::MediaStream::~MediaStream): Deleted.
364         (WebCore::MediaStream::registry): Deleted.
365         (WebCore::MediaStream::addObserver): Deleted.
366         (WebCore::MediaStream::removeObserver): Deleted.
367         * Modules/mediastream/MediaStream.h:
368         * Modules/mediastream/MediaStream.idl:
369         * Modules/mediastream/MediaStreamTrack.cpp:
370         (WebCore::MediaStreamTrack::MediaStreamTrack):
371         (WebCore::MediaStreamTrack::~MediaStreamTrack):
372         (WebCore::MediaStreamTrack::kind):
373         (WebCore::MediaStreamTrack::id):
374         (WebCore::MediaStreamTrack::label):
375         (WebCore::MediaStreamTrack::enabled):
376         (WebCore::MediaStreamTrack::setEnabled):
377         (WebCore::MediaStreamTrack::muted):
378         (WebCore::MediaStreamTrack::readonly):
379         (WebCore::MediaStreamTrack::remote):
380         (WebCore::MediaStreamTrack::readyState):
381         (WebCore::MediaStreamTrack::ended):
382         (WebCore::MediaStreamTrack::clone):
383         (WebCore::MediaStreamTrack::stopProducingData):
384         (WebCore::MediaStreamTrack::states):
385         (WebCore::MediaStreamTrack::getCapabilities):
386         (WebCore::MediaStreamTrack::applyConstraints):
387         (WebCore::MediaStreamTrack::trackEnded):
388         (WebCore::MediaStreamTrack::trackMutedChanged):
389         (WebCore::MediaStreamTrack::stop):
390         (WebCore::MediaStreamTrack::getConstraints): Deleted.
391         (WebCore::MediaStreamTrack::addObserver): Deleted.
392         (WebCore::MediaStreamTrack::removeObserver): Deleted.
393         (WebCore::MediaStreamTrack::configureTrackRendering): Deleted.
394         (WebCore::MediaStreamTrack::activeDOMObjectName): Deleted.
395         (WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
396         * Modules/mediastream/MediaStreamTrack.h:
397         * Modules/mediastream/MediaStreamTrack.idl:
398         * Modules/mediastream/RTCPeerConnection.cpp:
399         (WebCore::RTCPeerConnection::didRemoveRemoteStream): Deleted.
400         * Modules/mediastream/UserMediaRequest.cpp:
401         (WebCore::UserMediaRequest::didCreateStream):
402         * platform/mediastream/MediaStreamPrivate.cpp:
403         (WebCore::MediaStreamPrivate::create):
404         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
405         (WebCore::MediaStreamPrivate::tracks):
406         (WebCore::MediaStreamPrivate::updateActiveState):
407         (WebCore::MediaStreamPrivate::addTrack):
408         (WebCore::MediaStreamPrivate::removeTrack):
409         * platform/mediastream/MediaStreamPrivate.h:
410         (WebCore::MediaStreamPrivate::active): Deleted.
411         * platform/mediastream/MediaStreamTrackPrivate.cpp:
412         (WebCore::MediaStreamTrackPrivate::create):
413         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
414         (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate):
415         (WebCore::MediaStreamTrackPrivate::label):
416         (WebCore::MediaStreamTrackPrivate::setEnabled):
417         (WebCore::MediaStreamTrackPrivate::endTrack):
418         (WebCore::MediaStreamTrackPrivate::clone):
419         (WebCore::MediaStreamTrackPrivate::type):
420         (WebCore::MediaStreamTrackPrivate::applyConstraints):
421         (WebCore::MediaStreamTrackPrivate::sourceStopped):
422         (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
423         (WebCore::MediaStreamTrackPrivate::preventSourceFromStopping):
424         (WebCore::MediaStreamTrackPrivate::muted): Deleted.
425         (WebCore::MediaStreamTrackPrivate::readonly): Deleted.
426         (WebCore::MediaStreamTrackPrivate::remote): Deleted.
427         (WebCore::MediaStreamTrackPrivate::constraints): Deleted.
428         (WebCore::MediaStreamTrackPrivate::states): Deleted.
429         (WebCore::MediaStreamTrackPrivate::capabilities): Deleted.
430         * platform/mediastream/MediaStreamTrackPrivate.h:
431         (WebCore::MediaStreamTrackPrivate::id):
432         (WebCore::MediaStreamTrackPrivate::ended):
433         (WebCore::MediaStreamTrackPrivate::enabled):
434         (WebCore::MediaStreamTrackPrivate::setClient):
435         (WebCore::MediaStreamTrackPrivate::source): Deleted.
436         (WebCore::MediaStreamTrackPrivate::client): Deleted.
437         * platform/mediastream/RealtimeMediaSource.cpp:
438         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
439         (WebCore::RealtimeMediaSource::reset):
440         (WebCore::RealtimeMediaSource::setMuted):
441         (WebCore::RealtimeMediaSource::readonly):
442         (WebCore::RealtimeMediaSource::stop):
443         (WebCore::RealtimeMediaSource::requestStop):
444         (WebCore::RealtimeMediaSource::addObserver): Deleted.
445         (WebCore::RealtimeMediaSource::removeObserver): Deleted.
446         * platform/mediastream/RealtimeMediaSource.h:
447         (WebCore::RealtimeMediaSource::stopped):
448         (WebCore::RealtimeMediaSource::id): Deleted.
449         (WebCore::RealtimeMediaSource::muted): Deleted.
450         (WebCore::RealtimeMediaSource::setReadonly): Deleted.
451         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
452         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Deleted.
453         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
454         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Deleted.
455
456 2015-06-29  Benjamin Poulain  <benjamin@webkit.org>
457
458         Make the NFA transitions range-based
459         https://bugs.webkit.org/show_bug.cgi?id=146338
460
461         Reviewed by Alex Christensen.
462
463         Change the NFA to use range based transition for any kind of transition.
464         The fallback transition is also absorbed as ranges.
465
466         Previously, the NFA would only have single transitions and a fallback
467         transition for all cases not covered by single transitions.
468
469         The problem with that design was that character ranges (e.g. [a-z]) were
470         extended as individual transitions. Something like [^a] would cover
471         most of the alphabet with transitions.
472         When converting the NFA to DFA, the time is proportional to the number of states
473         multiplied by the number of transitions. With many individual transitions,
474         the run time was an order of magnitude higher than what we want.
475
476         This patch changes the NFA to only handle ranges of characters. A single transition
477         becomes a range with the character as first and last character in the range
478         ('a' becomes 'a' to 'a').
479         Ranges of characters are handled direclty (e.g. [a-z] becomes a single 'a' to 'z' transition).
480
481         In the context of the state machines, ranges have identifies (the target of the transitions).
482         When two ranges collide, they have to be split such that each part retain its target
483         except the intersection that gets the union of the targets.
484
485         Handling the union of ranges efficiently is critical because we have to do
486         it for every NFA node in any subset when building the DFA. The helper
487         class that does that is MutableRange.
488
489         The union of ranges is done efficiently because of preconditions on our list of ranges:
490         -The ranges must be sorted.
491         -No range in a list can intersect any other range in the same list.
492
493         To merge two ranges, we can go over them in order and split them part by part.
494         It is easy to find what goes where because they are both sorted and we can
495         compare the characters of each to know how to move forward.
496         The time to merge 2 range list is proportional to O(n+m) where 'n' and 'm' are
497         the number of ranges in each list.
498
499         Since taking the union of two lists usually create new ranges, we have to allocate
500         those somewhere efficiently. To do that, MutableRange support an inline capacity,
501         which is used for the NFAToDFA Convertion.
502
503         ---
504
505         With ranges, the NFA-to-DFA conversion changes very little:
506         -Each NFA nodes contains a list of ranges and each range has a list of targets.
507         -The subset construction select any number of NFA nodes corresponding to
508          a single deterministic state.
509         -For the subset, we can use MutableRange to merge the ranges of every
510          NFA node in the set. The resulting list has rangeis with targets corresponding
511          to the union of all the transitions.
512         -We go over all the ranges the same way we used to go over the transitions.
513          Since the DFA does not support ranges, the ranges are spread as individual
514          transitions + fallback transition.
515
516         ---
517
518         With the efficient merging solved, we still need the actual NFA to use ranges
519         instead of individual transitions.
520
521         I could have used MutableRange for that but it is not the most compact
522         way to represent ranges that do not need merging.
523
524         Instead, the NFA uses a custom structure: ImmutableNFA. It is basically
525         the same thing, but in that one you cannot change a list of range
526         after creating it.
527
528         Consequently, the sorted ranges in ImmutableNFA are also subsequent
529         in memory, which is really nice to go over them efficiently
530         when merging ranges in the NFA-to-DFA conversion. :)
531
532         When building the NFA, we don't know all the transitions when creating
533         each node, BUT we know that we have very few node "unfinished" at any
534         time. Since we build by going depth-first in the prefix-tree, we only
535         have the max-depth of live nodes in the worst case.
536
537         To help building the NFA out of the prefix tree, we have
538         ImmutableNFANodeBuilder. It keeps all the informations about a NFA node,
539         but in a non-compact, mutable form. When a ImmutableNFANodeBuilder
540         is destroyed, it serialize the information into the immutable NFA.
541
542         * WebCore.xcodeproj/project.pbxproj:
543         * contentextensions/CombinedURLFilters.cpp:
544         (WebCore::ContentExtensions::generateNFAForSubtree):
545         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
546         * contentextensions/ContentExtensionCompiler.cpp:
547         (WebCore::ContentExtensions::compileRuleList):
548         * contentextensions/DFA.cpp:
549         (WebCore::ContentExtensions::DFA::empty):
550         * contentextensions/DFA.h:
551         * contentextensions/ImmutableNFA.h: Added.
552         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator*):
553         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator->):
554         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator==):
555         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator!=):
556         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator++):
557         (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::begin):
558         (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::end):
559         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator*):
560         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator->):
561         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator==):
562         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator!=):
563         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator++):
564         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::data):
565         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::begin):
566         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::end):
567         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::debugPrint):
568         (WebCore::ContentExtensions::ImmutableNFA::transitionsForNode):
569         (WebCore::ContentExtensions::ImmutableNFA::root):
570         (WebCore::ContentExtensions::ImmutableNFA::finalize):
571         (WebCore::ContentExtensions::ImmutableNFA::memoryUsed):
572         * contentextensions/ImmutableNFANodeBuilder.h: Added.
573         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::ImmutableNFANodeBuilder):
574         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::~ImmutableNFANodeBuilder):
575         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addTransition):
576         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addEpsilonTransition):
577         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::setActions):
578         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::operator=):
579         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::finalize):
580         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::sinkActions):
581         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::sinkTransitions):
582         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::sinkEpsilonTransitions):
583         * contentextensions/MutableRange.h: Added.
584         (WebCore::ContentExtensions::MutableRange::MutableRange):
585         (WebCore::ContentExtensions::MutableRange::operator=):
586         (WebCore::ContentExtensions::MutableRange::size):
587         * contentextensions/MutableRangeList.h: Added.
588         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator*):
589         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator->):
590         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator==):
591         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator!=):
592         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator++):
593         (WebCore::ContentExtensions::MutableRangeList::begin):
594         (WebCore::ContentExtensions::MutableRangeList::end):
595         (WebCore::ContentExtensions::MutableRangeList::appendRange):
596         (WebCore::ContentExtensions::MutableRangeList::extend):
597         (WebCore::ContentExtensions::MutableRangeList::isEmpty):
598         (WebCore::ContentExtensions::MutableRangeList::clear):
599         (WebCore::ContentExtensions::MutableRangeList::debugPrint):
600         (WebCore::ContentExtensions::MutableRangeList::insertBetween):
601         (WebCore::ContentExtensions::MutableRangeList::initializeFrom):
602         * contentextensions/NFA.cpp:
603         (WebCore::ContentExtensions::NFA::debugPrintDot):
604         (WebCore::ContentExtensions::NFA::NFA): Deleted.
605         (WebCore::ContentExtensions::NFA::createNode): Deleted.
606         (WebCore::ContentExtensions::NFA::memoryUsed): Deleted.
607         (WebCore::ContentExtensions::NFA::addTransition): Deleted.
608         (WebCore::ContentExtensions::NFA::addEpsilonTransition): Deleted.
609         (WebCore::ContentExtensions::NFA::addTransitionsOnAnyCharacter): Deleted.
610         (WebCore::ContentExtensions::NFA::setActions): Deleted.
611         (WebCore::ContentExtensions::NFA::graphSize): Deleted.
612         (WebCore::ContentExtensions::NFA::restoreToGraphSize): Deleted.
613         (WebCore::ContentExtensions::printRange): Deleted.
614         (WebCore::ContentExtensions::printTransitions): Deleted.
615         * contentextensions/NFA.h:
616         (WebCore::ContentExtensions::NFA::root): Deleted.
617         (WebCore::ContentExtensions::NFA::addRuleId): Deleted.
618         * contentextensions/NFANode.h:
619         * contentextensions/NFAToDFA.cpp:
620         (WebCore::ContentExtensions::epsilonClosureExcludingSelf):
621         (WebCore::ContentExtensions::resolveEpsilonClosures):
622         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
623         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
624         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::convert):
625         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::extend):
626         (WebCore::ContentExtensions::createCombinedTransition):
627         (WebCore::ContentExtensions::canUseFallbackTransition):
628         (WebCore::ContentExtensions::findBestFallbackTarget):
629         (WebCore::ContentExtensions::getOrCreateDFANode):
630         (WebCore::ContentExtensions::NFAToDFA::convert):
631         (WebCore::ContentExtensions::populateTransitions): Deleted.
632         * contentextensions/NFAToDFA.h:
633         * contentextensions/Term.h:
634         (WebCore::ContentExtensions::Term::Term):
635         (WebCore::ContentExtensions::Term::generateGraph):
636         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
637         (WebCore::ContentExtensions::Term::Term::generateGraph): Deleted.
638
639 2015-06-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
640
641         Binding generator should allow using JSC::Value for "any" parameter in lieu of ScriptValue
642         https://bugs.webkit.org/show_bug.cgi?id=146403
643
644         Reviewed by Darin Adler.
645
646         Covered by existing tests.
647
648         Enabling new APIs to use JSC::JSValue by using implicit case from ScriptValue to JSC::JSValue.
649         Updated binding generator to include ScruptValue header in the needed JSXX.cpp files.
650         Applied approach to ReadableStreamController.error.
651
652         * Modules/streams/ReadableStreamController.h:
653         (WebCore::ReadableStreamController::error):
654         * Modules/streams/ReadableStreamController.idl:
655         * bindings/js/JSReadableStreamControllerCustom.cpp:
656         (WebCore::constructJSReadableStreamController): Deleted.
657         * bindings/js/ReadableJSStream.cpp:
658         (WebCore::ReadableJSStream::error):
659         * bindings/js/ReadableJSStream.h:
660         * bindings/scripts/CodeGeneratorJS.pm:
661         (JSValueToNative):
662         * bindings/scripts/test/JS/JSTestObj.cpp:
663
664 2015-06-29  Anders Carlsson  <andersca@apple.com>
665
666         Use DISPATCH_SOURCE_TYPE_MEMORYPRESSURE instead of DISPATCH_SOURCE_TYPE_MEMORYSTATUS
667         https://bugs.webkit.org/show_bug.cgi?id=146413
668         rdar://problem/21295036
669
670         Reviewed by Andreas Kling.
671
672         Replace SPI with API.
673
674         * WebCore.xcodeproj/project.pbxproj:
675         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
676         (WebCore::MemoryPressureHandler::install):
677         * platform/mac/WebCoreSystemInterface.h:
678         * platform/spi/cocoa/DispatchSPI.h: Removed.
679
680 2015-06-29  Andreas Kling  <akling@apple.com>
681
682         [iOS] Pausing a media element should discard buffered data immediately if under memory pressure.
683         <https://webkit.org/b/146410>
684         <rdar://problem/20366883>
685
686         Reviewed by Darin Adler.
687
688         When moving a media element into paused state, call purgeBufferedDataIfPossible()
689         right away if the system is under memory pressure.
690
691         This ensures that mediaserverd drops its forward-looking frame queue right
692         away instead of waiting for a new pressure notification.
693
694         * html/HTMLMediaElement.cpp:
695         (WebCore::HTMLMediaElement::pauseInternal):
696
697 2015-06-29  Matt Rajca  <mrajca@apple.com>
698
699         Media Session: Media elements should report a null session for Default sessions
700         https://bugs.webkit.org/show_bug.cgi?id=146373
701
702         Reviewed by Eric Carlson.
703
704         If a media element's current session is a 'Default' media session, its session property should report null in
705         the JavaScript API.
706
707         * Modules/mediasession/MediaSession.h:
708         * html/HTMLMediaElement.cpp:
709         (WebCore::HTMLMediaElement::session):
710
711 2015-06-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
712
713         [Mac] Disable QTKit by default.
714         https://bugs.webkit.org/show_bug.cgi?id=146352
715
716         Reviewed by Darin Adler.
717         
718         Fix the the requirement for enabling QTKit and AVFoundation.
719
720         * page/Settings.cpp:
721         (WebCore::invalidateAfterGenericFamilyChange): Remove the requirement
722         for enabling QTKit and AVFoundation. The initial state of QTKit should
723         be disabled on all OS X ports. And the initial state of AVFoundation
724         should be enabled  on all OS X ports.
725
726 2015-06-29  Hyungwook Lee  <hyungwook.lee@navercorp.com>
727
728         [EFL] Purge unused favicons from IconDatabase after 30 days.
729         https://bugs.webkit.org/show_bug.cgi?id=146334
730
731         Reviewed by Gyuyoung Kim.
732
733         We need purge unused favicons from IconDatabase for database size control.
734
735         * loader/icon/IconDatabase.cpp:
736         (WebCore::IconDatabase::performURLImport):
737
738 2015-06-26  Matt Rajca  <mrajca@apple.com>
739
740         Add support for 'Default' media session types
741         https://bugs.webkit.org/show_bug.cgi?id=146355
742
743         Reviewed by Darin Adler.
744
745         * Modules/mediasession/MediaSession.cpp:
746         (WebCore::MediaSession::MediaSession): Added a new constructor for creating 'Default' media sessions.
747         (WebCore::MediaSession::kind): 'Default' media sessions are represented by an empty string.
748         * Modules/mediasession/MediaSession.h:
749         * dom/Document.cpp:
750         (WebCore::Document::defaultMediaSession): Lazily construct the default media session.
751         * dom/Document.h:
752         * html/HTMLMediaElement.cpp:
753         (WebCore::HTMLMediaElement::HTMLMediaElement): New media elements are assigned to the 'Default' media session.
754
755 2015-06-28  Andreas Kling  <akling@apple.com>
756
757         [iOS] Drop buffered data in paused media elements on memory pressure.
758         <https://webkit.org/b/146369>
759         <rdar://problem/20366883>
760
761         Reviewed by Eric Carlson.
762
763         To avoid getting crushed under mediaserverd memory growth when viewing
764         a page with multiple media elements, add a step to the memory pressure
765         handler that drops buffered data from all media elements that are
766         not currently playing.
767
768         On a test page with a bunch of embedded YouTube videos, this pass frees
769         up ~4MB per paused video when the system memory pressure hits.
770
771         * html/HTMLMediaElement.cpp:
772         (WebCore::HTMLMediaElement::allMediaElements):
773         (WebCore::HTMLMediaElement::HTMLMediaElement):
774         (WebCore::HTMLMediaElement::~HTMLMediaElement):
775         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
776         * html/HTMLMediaElement.h:
777         * platform/MemoryPressureHandler.cpp:
778         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
779
780 2015-06-28  Chris Dumez  <cdumez@apple.com>
781
782         Crash: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::CachedFrameBase::restore + 333
783         https://bugs.webkit.org/show_bug.cgi?id=146388
784         <rdar://problem/21567343>
785
786         Reviewed by Darin Adler.
787
788         Pages that are currently loading are not supposed to go into the
789         PageCache. However, PageCache::canCache() only checks if the
790         FrameLoader's documentLoader is loading. If the subframe is in
791         provisional load stage, we would fail to detect that the frame is
792         actually loading because the FrameLoader active documentLoader would
793         be the provisional documentLoader, not the regular documentLoader.
794         Therefore, the page would get added to the PageCache and the frame
795         would keep loading while in the PageCache.
796
797         On http://www.audiusa.com/models, this is what was happening. It was
798         crashing because the subframe would finish loading while in the
799         PageCache, in which case we would fire the 'load' event and the
800         content 'load' event handler would then proceed to remove the iframe.
801         Upon restoring the PageCache entry, we would run into trouble as we
802         would have a CachedFrame whose Frame has been removed.
803
804         The solution proposed is to prevent page-caching if a subframe is in
805         provisional load stage.
806
807         Test: http/tests/navigation/page-cache-iframe-provisional-load.html
808
809         * history/PageCache.cpp:
810         (WebCore::logCanCacheFrameDecision):
811         (WebCore::PageCache::canCachePageContainingThisFrame):
812         * page/DiagnosticLoggingKeys.cpp:
813         (WebCore::DiagnosticLoggingKeys::provisionalLoadKey):
814         * page/DiagnosticLoggingKeys.h:
815
816 2015-06-28  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
817
818         [Streams API] Add support for chunks with customized sizes
819         https://bugs.webkit.org/show_bug.cgi?id=146312
820
821         Reviewed by Darin Adler.
822
823         Covered by rebased tests.
824
825         * bindings/js/ReadableJSStream.cpp:
826         (WebCore::ReadableJSStream::read): Decrement totalQueueSize with the chunk specific size.
827         (WebCore::ReadableJSStream::enqueue): Calls retrieveSize, enqueue chunk with its size and increment totalQueueSize.
828         (WebCore::ReadableJSStream::retrieveChunkSize): Calls size JS callback and convert it to double.
829         * bindings/js/ReadableJSStream.h:
830
831 2015-06-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
832
833         [Streams API]Remove ReadableStreamController.close custom binding
834         https://bugs.webkit.org/show_bug.cgi?id=146380
835
836         Reviewed by Darin Adler.
837
838         No change in behavior.
839
840         * Modules/streams/ReadableStreamController.h:
841         (WebCore::ReadableStreamController::close): Calling ReadableJSStream close method.
842         * Modules/streams/ReadableStreamController.idl: Removed Custom.
843         * bindings/js/JSReadableStreamControllerCustom.cpp:
844         (WebCore::JSReadableStreamController::close): Deleted.
845         * bindings/js/ReadableJSStream.cpp:
846         (WebCore::ReadableJSStream::close): Moved custom binding code here.
847         * bindings/js/ReadableJSStream.h:
848
849 2015-06-27  Chris Fleizach  <cfleizach@apple.com>
850
851         AX: implement @aria-roledescription
852         https://bugs.webkit.org/show_bug.cgi?id=146274
853
854         Reviewed by Darin Adler.
855
856         Add support for aria-roledescription.
857
858         Test: accessibility/aria-roledescription.html
859
860         * accessibility/AccessibilityObject.cpp:
861         (WebCore::AccessibilityObject::hasHighlighting):
862         (WebCore::AccessibilityObject::roleDescription):
863         (WebCore::nodeHasPresentationRole):
864         * accessibility/AccessibilityObject.h:
865         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
866         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
867         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
868         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
869         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
870         (-[WebAccessibilityObjectWrapper roleDescription]):
871
872 2015-06-27  Darin Adler  <darin@apple.com>
873
874         Fix the build.
875
876         * platform/network/cf/ResourceErrorCF.cpp:
877         (WebCore::ResourceError::cfError): Take out log statement. Add FIXME comment
878         that explains part of the reason we may get null here.
879         * platform/network/mac/ResourceErrorMac.mm:
880         (WebCore::createNSErrorFromResourceErrorBase): Ditto.
881
882 2015-06-27  David Kilzer  <ddkilzer@apple.com>
883
884         Crash in WebCore::ResourceError::cfError() after provisional load failed
885         <http://webkit.org/b/146384>
886
887         Reviewed by Darin Adler.
888
889         This is a speculative fix based on the crashing stack.
890
891         * platform/network/cf/ResourceErrorCF.cpp:
892         (WebCore::ResourceError::cfError): Add NULL check.
893         * platform/network/mac/ResourceErrorMac.mm:
894         (WebCore::createNSErrorFromResourceErrorBase): Add nil check in
895         case we ever turn off USE(CFNETWORK) for iOS.
896
897 2015-06-27  Eric Carlson  <eric.carlson@apple.com>
898
899         [Mac] Only flag a video element as eligible for auto-play to AppleTV one time
900         https://bugs.webkit.org/show_bug.cgi?id=146386
901
902         Reviewed by Brent Fulgham.
903
904         * Modules/mediasession/WebMediaSessionManager.cpp:
905         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): Drive-by fix - early 
906           return when there are no clients.
907
908         * html/HTMLMediaElement.cpp:
909         (WebCore::HTMLMediaElement::pendingActionTimerFired): Set m_failedToPlayToWirelessTarget if the
910           media engine is still unable to play to the wireless target.
911         (WebCore::HTMLMediaElement::prepareForLoad): Clear m_failedToPlayToWirelessTarget.
912         (WebCore::HTMLMediaElement::mediaState): Don't set the ExternalDeviceAutoPlayCandidate flag
913           if m_failedToPlayToWirelessTarget is true.
914         * html/HTMLMediaElement.h:
915
916 2015-06-27  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
917
918         [Streams API] Implement ReadableStreamController.desiredSize property
919         https://bugs.webkit.org/show_bug.cgi?id=146311
920
921         Reviewed by Darin Adler.
922
923         Covered by rebased tests.
924
925         * Modules/streams/ReadableStreamController.h: Adding desiredSize getter.
926         (WebCore::ReadableStreamController::desiredSize): Ditto.
927         * Modules/streams/ReadableStreamController.idl: Added desiredSize attribute.
928
929 2015-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>
930
931         [GTK][SOUP] Implement WebCore::PublicSuffix for soup and enable PUBLIC_SUFFIX_LIST for GTK+
932         https://bugs.webkit.org/show_bug.cgi?id=146318
933
934         Reviewed by Sergio Villar Senin.
935
936         This is covered by unit tests.
937
938         * PlatformGTK.cmake:
939         * platform/soup/PublicSuffixSoup.cpp: Added.
940         (WebCore::isPublicSuffix):
941         (WebCore::topPrivatelyControlledDomain):
942
943 2015-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
944
945         [iOS] AppleGothic has been superseded by Apple SD Gothic Neo
946         https://bugs.webkit.org/show_bug.cgi?id=146372
947         <rdar://problem/21574004>
948
949         Reviewed by Dean Jackson.
950
951         Test: fast/text/hangul-generic-font-families.html
952
953         * page/mac/SettingsMac.mm:
954         (WebCore::Settings::initializeDefaultFontFamilies):
955
956 2015-06-26  Matt Daiter  <mdaiter@apple.com>
957
958         Supporting getStartDate and added tests
959         https://bugs.webkit.org/show_bug.cgi?id=145676
960         <rdar://problem/20876076>
961
962         Reviewed by Brent Fulgham.
963
964         Test: http/tests/media/hls/video-controller-getStartDate.html
965
966         * bindings/js/JSDOMBinding.cpp:
967         (WebCore::jsDateOrNaN):
968         * bindings/js/JSDOMBinding.h:
969         * bindings/scripts/CodeGeneratorJS.pm: Added features to return 
970         NaN for Date
971         * bindings/scripts/CodeGeneratorGObject.pm: Needed to add
972         type checking code for GObject (no date)
973         (NativeToJSValue):
974         * bindings/scripts/IDLAttributes.txt: 
975         * html/HTMLMediaElement.cpp: Added getStartDate function
976         (WebCore::HTMLMediaElement::getStartDate):
977         * html/HTMLMediaElement.h: Needed to add declarations
978         * html/HTMLMediaElement.idl: Needed to modify for returning NaN
979         * platform/graphics/MediaPlayer.cpp:
980         (WebCore::MediaPlayer::getStartDate):
981         * platform/graphics/MediaPlayer.h:
982         * platform/graphics/MediaPlayerPrivate.h: Added in Mac-specific platform
983         (WebCore::MediaPlayerPrivateInterface::getStartDate):
984         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
985         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
986         (WebCore::MediaPlayerPrivateAVFoundationObjC::getStartDate):
987
988 2015-06-26  Beth Dakin  <bdakin@apple.com>
989
990         WebPage::getPositionInformation() should not copy an image that is larger than the  
991         screen
992         https://bugs.webkit.org/show_bug.cgi?id=146367
993
994         Reviewed by Tim Horton.
995
996         Export the rect version of this function too.
997         * platform/graphics/GraphicsContext.h:
998
999 2015-06-26  Eric Carlson  <eric.carlson@apple.com>
1000
1001         [Mac] Muted videos should not automatically play to AppleTV
1002         https://bugs.webkit.org/show_bug.cgi?id=146366
1003
1004         Reviewed by Dean Jackson.
1005
1006         * html/HTMLMediaElement.cpp:
1007         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_initiallyMuted.
1008         (WebCore::HTMLMediaElement::scheduleDelayedAction): Support CheckMediaState.
1009         (WebCore::HTMLMediaElement::setReadyState): Set m_initiallyMuted to true if the element is
1010           muted or the volume is less than 5%.
1011         (WebCore::HTMLMediaElement::setMuted): Update media state asynchronously so multiple state
1012           changes can be coalesced.
1013         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Ditto.
1014         (WebCore::HTMLMediaElement::setPlaying): Ditto.
1015         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
1016         (WebCore::HTMLMediaElement::removeEventListener): Ditto.
1017         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): Ditto.
1018         (WebCore::HTMLMediaElement::updateMediaState): Update after a timer when passed UpdateMediaState::Asynchronously.
1019         (WebCore::HTMLMediaElement::mediaState): Don't set the ExternalDeviceAutoPlayCandidate flag if
1020           m_initiallyMuted is true.
1021         * html/HTMLMediaElement.h:
1022         * html/HTMLMediaElementEnums.h:
1023
1024 2015-06-26  Daniel Bates  <dabates@apple.com>
1025
1026         Rolling out r184660
1027         https://bugs.webkit.org/show_bug.cgi?id=145200
1028
1029         Reverting r184660 because it caused a regression.
1030
1031         * English.lproj/Localizable.strings:
1032         * html/TextFieldInputType.cpp:
1033         (WebCore::TextFieldInputType::createAutoFillButton): Deleted.
1034         * platform/LocalizedStrings.cpp:
1035         (WebCore::AXAutoFillButtonText): Deleted.
1036         * platform/LocalizedStrings.h:
1037         * platform/efl/LocalizedStringsEfl.cpp:
1038         (WebCore::AXAutoFillButtonText): Deleted.
1039         * platform/gtk/LocalizedStringsGtk.cpp:
1040         (WebCore::AXAutoFillButtonText): Deleted.
1041
1042 2015-06-26  Daniel Bates  <dabates@apple.com>
1043
1044         Rolling out r185881
1045         https://bugs.webkit.org/show_bug.cgi?id=146243
1046         And
1047         r185828
1048         https://bugs.webkit.org/show_bug.cgi?id=145241
1049
1050         Reverting r185881 and r185828 because the latter caused a regression.
1051
1052         * accessibility/AccessibilityRenderObject.cpp:
1053         (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Deleted.
1054         (WebCore::AccessibilityRenderObject::accessibilityHitTest): Deleted.
1055         * accessibility/AccessibilityRenderObject.h:
1056
1057 2015-06-26  Dean Jackson  <dino@apple.com>
1058
1059         No audio on animated page with the attached fixed layout epub
1060         https://bugs.webkit.org/show_bug.cgi?id=146365
1061
1062         Reviewed by Eric Carlson.
1063
1064         The new restriction RequireUserGestureForAudioRateChange conflicted
1065         with existing clients who expected RequireUserGestureForRateChange
1066         to allow autoplaying audio. Update the logic to ensure that
1067         RequireUserGestureForRateChange covers all media when set to
1068         false.
1069
1070         This may require a revisit once we're using RequireUserGestureForAudioRateChange
1071         in production, because the global setting will trump that, and
1072         most clients have the global setting to false. We'll need to come
1073         up with a way to allow legacy clients to preserve their behaviour.
1074
1075         * html/HTMLMediaElement.cpp:
1076         (WebCore::HTMLMediaElement::HTMLMediaElement): Only restrict audio
1077         if RequireUserGestureForRateChange is also false.
1078
1079 2015-06-25  Anders Carlsson  <andersca@apple.com>
1080
1081         Get rid of ScrollbarThemeClient now that it's unused
1082         https://bugs.webkit.org/show_bug.cgi?id=146327
1083
1084         Reviewed by Beth Dakin.
1085
1086         * WebCore.vcxproj/WebCore.vcxproj:
1087         * WebCore.vcxproj/WebCore.vcxproj.filters:
1088         * WebCore.xcodeproj/project.pbxproj:
1089         * platform/Scrollbar.cpp:
1090         (WebCore::Scrollbar::scrollbarOverlayStyle): Deleted.
1091         (WebCore::Scrollbar::isScrollableAreaActive): Deleted.
1092         (WebCore::Scrollbar::isScrollViewScrollbar): Deleted.
1093         (WebCore::Scrollbar::root): Deleted.
1094         * platform/Scrollbar.h:
1095         (WebCore::Scrollbar::isCustomScrollbar):
1096         (WebCore::Scrollbar::orientation):
1097         (WebCore::Scrollbar::value):
1098         (WebCore::Scrollbar::currentPos):
1099         (WebCore::Scrollbar::visibleSize):
1100         (WebCore::Scrollbar::totalSize):
1101         (WebCore::Scrollbar::maximum):
1102         (WebCore::Scrollbar::controlSize):
1103         (WebCore::Scrollbar::lineStep):
1104         (WebCore::Scrollbar::pageStep):
1105         (WebCore::Scrollbar::pressedPart):
1106         (WebCore::Scrollbar::hoveredPart):
1107         (WebCore::Scrollbar::enabled):
1108         (WebCore::Scrollbar::styleChanged):
1109         (WebCore::Scrollbar::isAlphaLocked):
1110         (WebCore::Scrollbar::setIsAlphaLocked):
1111         * platform/ScrollbarTheme.h:
1112         * platform/ScrollbarThemeClient.h: Removed.
1113         (WebCore::ScrollbarThemeClient::~ScrollbarThemeClient): Deleted.
1114         * platform/mac/ScrollbarThemeMac.mm:
1115         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
1116         * rendering/RenderScrollbarTheme.cpp:
1117
1118 2015-06-26  Chris Dumez  <cdumez@apple.com>
1119
1120         Prevent new loads while in PageCache (or being added to PageCache)
1121         https://bugs.webkit.org/show_bug.cgi?id=146299
1122         <rdar://problem/21523788>
1123
1124         Reviewed by Darin Adler.
1125
1126         Generalize the change in r185337 to prevent new loads while in the
1127         PageCache (or being added to the PageCache), instead of merely
1128         preventing new loads in pagehide event handlers. We should never
1129         have any pages that are still loading inside the PageCache.
1130
1131         The fix in r185337 was apparently insufficient to address the
1132         problem so generalizing the check / policy will hopefully catch
1133         more cases where content is able to start loads while being added
1134         to the PageCache. This patch also removes some of the complexity
1135         added in r185337 as it is no longer needed.
1136
1137         No new tests, already covered by:
1138         http/tests/navigation/image-load-in-pagehide-handler.html
1139         http/tests/navigation/subframe-pagehide-handler-starts-load.html
1140         http/tests/navigation/subframe-pagehide-handler-starts-load2.html
1141
1142         * loader/FrameLoader.cpp:
1143         (WebCore::FrameLoader::stopLoading):
1144         (WebCore::FrameLoader::loadURL):
1145         (WebCore::FrameLoader::loadWithDocumentLoader):
1146         (WebCore::FrameLoader::stopAllLoaders):
1147         (WebCore::FrameLoader::handleBeforeUnloadEvent):
1148         (WebCore::FrameLoader::FrameLoader): Deleted.
1149         * loader/FrameLoader.h:
1150         (WebCore::FrameLoader::pageDismissalEventBeingDispatched):
1151         * loader/ImageLoader.cpp:
1152         (WebCore::pageIsBeingDismissed):
1153         * loader/cache/CachedResource.cpp:
1154         (WebCore::CachedResource::load):
1155         * loader/cache/CachedResourceLoader.cpp:
1156         (WebCore::CachedResourceLoader::requestImage):
1157         * page/Page.cpp:
1158         (WebCore::Page::inPageCache):
1159         * page/Page.h:
1160         (WebCore::Page::group): Deleted.
1161
1162 2015-06-26  Simon Fraser  <simon.fraser@apple.com>
1163
1164         [OS X] Change the layer tiling threshold from 2000 to 2048 pixels
1165         https://bugs.webkit.org/show_bug.cgi?id=146353
1166
1167         Reviewed by Tim Horton.
1168
1169         Programmers love powers of two.
1170
1171         * platform/graphics/ca/GraphicsLayerCA.cpp:
1172
1173 2015-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
1174
1175         [Cocoa] Sans-serif generic font family should map to PingFang
1176         https://bugs.webkit.org/show_bug.cgi?id=146333
1177         <rdar://problem/21521217>
1178
1179         Reviewed by Alexey Proskuryakov.
1180
1181         Also performs a little bit of cleanup.
1182
1183         Test: fast/text/han-generic-font-families.html
1184
1185         * page/mac/SettingsMac.mm:
1186         (WebCore::sansSerifTraditionalHanFontFamily):
1187         (WebCore::sansSerifSimplifiedHanFontFamily):
1188         (WebCore::Settings::initializeDefaultFontFamilies):
1189
1190 2015-06-26  Per Arne Vollan  <peavo@outlook.com>
1191
1192         [Curl] Compile errors; ResourceResponseBase::resourceLoadTiming() has changed return type.
1193         https://bugs.webkit.org/show_bug.cgi?id=146343
1194
1195         Reviewed by Brent Fulgham.
1196
1197         * platform/network/curl/ResourceHandleManager.cpp:
1198         (WebCore::calculateWebTimingInformations):
1199         (WebCore::headerCallback):
1200         (WebCore::ResourceHandleManager::initializeHandle):
1201         (WebCore::ResourceHandleManager::initCookieSession):
1202         (WebCore::sockoptfunction): Deleted.
1203
1204 2015-06-26  Chris Fleizach  <cfleizach@apple.com>
1205
1206         iOS speech synthesizer should expose names
1207         https://bugs.webkit.org/show_bug.cgi?id=146319
1208
1209         Reviewed by Mario Sanchez Prada.
1210
1211         Use newer API to get the name and identifier of each voice asset.
1212
1213         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
1214         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
1215
1216 2015-06-26  Csaba Osztrogonác  <ossy@webkit.org>
1217
1218         [EFL] Remove unnecessary overriden methods from ScrollBarEfl
1219         https://bugs.webkit.org/show_bug.cgi?id=146342
1220
1221         Reviewed by Gyuyoung Kim.
1222
1223         * platform/efl/ScrollbarEfl.cpp:
1224         (WebCore::ScrollbarEfl::setParent): Deleted.
1225         (WebCore::ScrollbarEfl::setFrameRect): Deleted.
1226         (WebCore::ScrollbarEfl::frameRectsChanged): Deleted.
1227         (WebCore::ScrollbarEfl::invalidate): Deleted.
1228         * platform/efl/ScrollbarEfl.h:
1229
1230 2015-06-26  Csaba Osztrogonác  <ossy@webkit.org>
1231
1232         Convert some of WebCore/dom over to range-for loops
1233         https://bugs.webkit.org/show_bug.cgi?id=126250
1234
1235         Reviewed by Darin Adler.
1236
1237         Based on the original patch of Sam Weinig <sam@webkit.org>.
1238
1239         * dom/ContainerNode.cpp:
1240         (WebCore::ContainerNode::replaceChild):
1241         (WebCore::willRemoveChildren):
1242         (WebCore::ContainerNode::appendChild):
1243         * dom/MutationObserver.cpp:
1244         (WebCore::MutationObserver::disconnect):
1245         (WebCore::MutationObserver::getObservedNodes):
1246         (WebCore::MutationObserver::deliver):
1247         * dom/MutationObserverInterestGroup.cpp:
1248         (WebCore::MutationObserverInterestGroup::isOldValueRequested):
1249         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
1250         * dom/MutationObserverRegistration.cpp:
1251         (WebCore::MutationObserverRegistration::clearTransientRegistrations):
1252         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet):
1253         * dom/Node.cpp:
1254         (WebCore::Node::dumpStatistics):
1255         (WebCore::collectMatchingObserversForMutation):
1256         (WebCore::Node::notifyMutationObserversNodeWillDetach):
1257
1258 2015-06-25  Lucas Forschler  <lforschler@apple.com>
1259
1260         Unreviewed build fix.
1261         
1262         * platform/audio/VectorMath.cpp:
1263         (WebCore::VectorMath::vsmul):
1264         (WebCore::VectorMath::vadd):
1265         (WebCore::VectorMath::vmul):
1266         (WebCore::VectorMath::zvmul):
1267
1268 2015-06-25  Stephanie Lewis  <slewis@apple.com>
1269
1270         Build fix.
1271
1272         Unreviewed.
1273
1274         * platform/audio/DirectConvolver.cpp:
1275         (WebCore::DirectConvolver::process):
1276
1277 2015-06-25  Chris Fleizach  <cfleizach@apple.com>
1278
1279         AX: improve list heuristics (presentational use versus actual lists)
1280         https://bugs.webkit.org/show_bug.cgi?id=134187
1281
1282         Rolling this change back in. 
1283         It was taken out to allow clients to have time to update their expectations of what is a list vs. a group
1284
1285         Test: accessibility/list-detection2.html
1286
1287         * accessibility/AccessibilityList.cpp:
1288         (WebCore::AccessibilityList::isDescriptionList):
1289         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
1290         (WebCore::AccessibilityList::determineAccessibilityRole):
1291         * accessibility/AccessibilityList.h:
1292
1293 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
1294
1295         Unreviewed build fix after r185964.
1296
1297         Correct a few pointers-that-should-be-references-now errors.
1298
1299         * platform/win/PopupMenuWin.cpp:
1300         (WebCore::AccessiblePopupMenu::accLocation):
1301         (WebCore::AccessiblePopupMenu::accHitTest):
1302
1303 2015-06-25  Doug Russell  <d_russell@apple.com>
1304
1305         Bug 146300 AX: AccessibilityObject focus events that don't cause a selection 
1306         change can leave m_isSynchronizingSelection set to true
1307         https://bugs.webkit.org/show_bug.cgi?id=146300
1308
1309         Reviewed by Chris Fleizach.
1310
1311         Added a clearTextSelectionIntent() convenience function to be used after any
1312         event that can, but isn't guaranteed to result in a selection change. Matches
1313         calls to setTextSelectionIntent() convenience function.
1314         Added support for tests listening for focus change notifications.
1315
1316         Test: platform/mac/accessibility/focus-setting-selection-syncronizing-not-clearing.html
1317
1318         * accessibility/AccessibilityRenderObject.cpp:
1319         (WebCore::clearTextSelectionIntent):
1320         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1321         (WebCore::AccessibilityRenderObject::setFocused):
1322         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
1323         * accessibility/mac/AXObjectCacheMac.mm:
1324         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
1325
1326 2015-06-25  Alex Christensen  <achristensen@webkit.org>
1327
1328         [Content Extensions] Add a way to match a domain but not subdomains
1329         https://bugs.webkit.org/show_bug.cgi?id=146241
1330         rdar://problem/21557754
1331
1332         Reviewed by Darin Adler.
1333
1334         This patch makes it possible to have a trigger with an if-domain apply to sub2.sub1.webkit.org
1335         but not sub1.webkit.org by making the domains default to only applying to the domain and not subdomains.
1336         To make a domain apply to a domain and any subdomains, the domain must begin with a '*'.
1337
1338         * contentextensions/CombinedURLFilters.cpp:
1339         (WebCore::ContentExtensions::CombinedURLFilters::addDomain):
1340         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
1341         Make domains apply only to the exact domain unless there is a * at the beginning,
1342         in which case they apply to the domain and any subdomains.
1343
1344 2015-06-25  Simon Fraser  <simon.fraser@apple.com>
1345
1346         [iOS WK2] Swiping back just after scrolling can cause some tiles to disappear
1347         https://bugs.webkit.org/show_bug.cgi?id=146329
1348         rdar://problem/21233010
1349
1350         Reviewed by Tim Horton.
1351
1352         Have the Compositing log channel dump the visible rect used for layer flushing.
1353
1354         * rendering/RenderLayerCompositor.cpp:
1355         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1356
1357 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
1358
1359         [WIN] Enable WEB_TIMING API
1360         https://bugs.webkit.org/show_bug.cgi?id=146330
1361         <rdar://problem/21530765>
1362
1363         Reviewed by Dean Jackson.
1364
1365         Tested by internal HLS tests.
1366
1367         Enable WEB_TIMING features on Windows by activating the feature flag,
1368         and correcting some build errors.
1369
1370         * platform/network/cf/ResourceHandleCFNet.cpp:
1371         (WebCore::ResourceHandle::start): "setCollectionTimingData" is only
1372         defined for PLATFORM(COCOA).
1373         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1374         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
1375         The 'ResourceHandle::getConnectionTimingData' method is only defined
1376         for PLATFORM(COCOA).
1377
1378 2015-06-25  Dean Jackson  <dino@apple.com>
1379
1380         Inline media controls disappear when returning a video to inline
1381         https://bugs.webkit.org/show_bug.cgi?id=146328
1382         <rdar://problem/21142862>
1383
1384         Reviewed by Tim Horton.
1385
1386         We were getting into a state where the controls were being
1387         hidden via a timer while we were in fullscreen or on
1388         another tab. Meanwhile, we could exit from such
1389         a condition to a point where the controls were
1390         not visible, but not completely removed from the DOM, confusing
1391         the logic that decided whether to show them on tap.
1392
1393         * Modules/mediacontrols/mediaControlsApple.js:
1394         (Controller.prototype.hideControls): If we are in the act of hiding
1395         controls, we can clear any existing timers that are going to try
1396         to hide them again.
1397         (Controller.prototype.resetHideControlsTimer): Make sure we null
1398         out the hideTimer object, since we look at its value often to
1399         decide whether or not a timer exists.
1400         * Modules/mediacontrols/mediaControlsiOS.js:
1401         (ControllerIOS.prototype.handlePlayButtonTouchEnd): If the user
1402         taps play, then we should call showControls, which resets the hide
1403         timers amongst other things. We need to do this due to the next change,
1404         so that a timer started before we pressed play doesn't cause the
1405         controls to instantly disappear as soon as we start playing.
1406         (ControllerIOS.prototype.handleWrapperTouchStart): We can get into
1407         the state where controls are invisible but still in the tree. Since the
1408         controlsAreHidden() logic only looks for the latter, we need to also
1409         look for invisible when the user taps for the controls. Yes, this
1410         naming doesn't make much sense :(
1411
1412 2015-06-25  Joseph Pecoraro  <pecoraro@apple.com>
1413
1414         [Mac] Web Inspector: Window dragging on toolbar should behave more like native window dragging
1415         https://bugs.webkit.org/show_bug.cgi?id=146324
1416
1417         Reviewed by Timothy Hatcher.
1418
1419         * inspector/InspectorFrontendClient.h:
1420         * inspector/InspectorFrontendClientLocal.h:
1421         Do nothing or pass it up to the the frontend client.
1422
1423         * inspector/InspectorFrontendHost.h:
1424         * inspector/InspectorFrontendHost.idl:
1425         * inspector/InspectorFrontendHost.cpp:
1426         (WebCore::InspectorFrontendHost::startWindowDrag):
1427         Add a new host function to get native window dragging behavior.
1428
1429 2015-06-25  Tim Horton  <timothy_horton@apple.com>
1430
1431         Viewport units are wrong when scaled in 2-up mode, cause content to hop around on apple.com/music
1432         https://bugs.webkit.org/show_bug.cgi?id=146322
1433         <rdar://problem/21413884>
1434
1435         Reviewed by Simon Fraser.
1436
1437         * page/FrameView.cpp:
1438         (WebCore::FrameView::viewportSizeForCSSViewportUnits):
1439         Use the fixed layout size, if enabled, instead of the visibleContentRect,
1440         for the viewport unit size. This ensures that viewport units take up the whole
1441         fixed-layout viewport, not just the size of the view scaled by the page scale
1442         (which visibleContentRect provides).
1443
1444 2015-06-25  Eric Carlson  <eric.carlson@apple.com>
1445
1446         [Mac] AirPlay menu button still doesn't always show on page load
1447         https://bugs.webkit.org/show_bug.cgi?id=146325
1448
1449         Reviewed by Dean Jackson.
1450
1451         * html/HTMLMediaElement.cpp:
1452         (WebCore::HTMLMediaElement::mediaState): A player that can't currently play to a wireless 
1453           target does require target monitoring if an availability event listner has been registered,
1454           otherwise we may not register for availability change notifications.
1455
1456 2015-06-25  Anders Carlsson  <andersca@apple.com>
1457
1458         Stop using ScrollbarThemeClient and just use Scrollbar directly
1459         https://bugs.webkit.org/show_bug.cgi?id=146320
1460
1461         Reviewed by Tim Horton.
1462
1463         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
1464         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
1465         * platform/ScrollableArea.cpp:
1466         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
1467         * platform/Scrollbar.cpp:
1468         (WebCore::Scrollbar::Scrollbar):
1469         (WebCore::Scrollbar::~Scrollbar):
1470         (WebCore::Scrollbar::offsetDidChange):
1471         (WebCore::Scrollbar::updateThumb):
1472         (WebCore::Scrollbar::paint):
1473         (WebCore::thumbUnderMouse):
1474         (WebCore::Scrollbar::autoscrollPressedPart):
1475         (WebCore::Scrollbar::startTimerIfNeeded):
1476         (WebCore::Scrollbar::moveThumb):
1477         (WebCore::Scrollbar::setHoveredPart):
1478         (WebCore::Scrollbar::setPressedPart):
1479         (WebCore::Scrollbar::mouseMoved):
1480         (WebCore::Scrollbar::mouseUp):
1481         (WebCore::Scrollbar::mouseDown):
1482         (WebCore::Scrollbar::setEnabled):
1483         * platform/ScrollbarTheme.h:
1484         (WebCore::ScrollbarTheme::updateEnabledState):
1485         (WebCore::ScrollbarTheme::paint):
1486         (WebCore::ScrollbarTheme::hitTest):
1487         (WebCore::ScrollbarTheme::updateScrollbarOverlayStyle):
1488         (WebCore::ScrollbarTheme::invalidateParts):
1489         (WebCore::ScrollbarTheme::invalidatePart):
1490         (WebCore::ScrollbarTheme::paintTickmarks):
1491         (WebCore::ScrollbarTheme::shouldCenterOnThumb):
1492         (WebCore::ScrollbarTheme::shouldSnapBackToDragOrigin):
1493         (WebCore::ScrollbarTheme::shouldDragDocumentInsteadOfThumb):
1494         (WebCore::ScrollbarTheme::thumbPosition):
1495         (WebCore::ScrollbarTheme::thumbLength):
1496         (WebCore::ScrollbarTheme::trackPosition):
1497         (WebCore::ScrollbarTheme::trackLength):
1498         (WebCore::ScrollbarTheme::registerScrollbar):
1499         (WebCore::ScrollbarTheme::unregisterScrollbar):
1500         * platform/ScrollbarThemeComposite.cpp:
1501         (WebCore::ScrollbarThemeComposite::paint):
1502         (WebCore::ScrollbarThemeComposite::hitTest):
1503         (WebCore::ScrollbarThemeComposite::invalidatePart):
1504         (WebCore::ScrollbarThemeComposite::splitTrack):
1505         (WebCore::usedTotalSize):
1506         (WebCore::ScrollbarThemeComposite::thumbPosition):
1507         (WebCore::ScrollbarThemeComposite::thumbLength):
1508         (WebCore::ScrollbarThemeComposite::minimumThumbLength):
1509         (WebCore::ScrollbarThemeComposite::trackPosition):
1510         (WebCore::ScrollbarThemeComposite::trackLength):
1511         (WebCore::ScrollbarThemeComposite::thumbRect):
1512         * platform/ScrollbarThemeComposite.h:
1513         (WebCore::ScrollbarThemeComposite::willPaintScrollbar):
1514         (WebCore::ScrollbarThemeComposite::didPaintScrollbar):
1515         (WebCore::ScrollbarThemeComposite::paintScrollbarBackground):
1516         (WebCore::ScrollbarThemeComposite::paintTrackBackground):
1517         (WebCore::ScrollbarThemeComposite::paintTrackPiece):
1518         (WebCore::ScrollbarThemeComposite::paintButton):
1519         (WebCore::ScrollbarThemeComposite::paintThumb):
1520         (WebCore::ScrollbarThemeComposite::constrainTrackRectToTrackPieces):
1521         * platform/efl/ScrollbarThemeEfl.h:
1522         * platform/gtk/ScrollbarThemeGtk.cpp:
1523         (WebCore::ScrollbarThemeGtk::hasThumb):
1524         (WebCore::ScrollbarThemeGtk::backButtonRect):
1525         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
1526         (WebCore::ScrollbarThemeGtk::trackRect):
1527         (WebCore::ScrollbarThemeGtk::registerScrollbar):
1528         (WebCore::ScrollbarThemeGtk::unregisterScrollbar):
1529         (WebCore::ScrollbarThemeGtk::updateScrollbarsFrameThickness):
1530         (WebCore::ScrollbarThemeGtk::thumbRect):
1531         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
1532         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
1533         (WebCore::ScrollbarThemeGtk::paintThumb):
1534         (WebCore::ScrollbarThemeGtk::paintButton):
1535         (WebCore::ScrollbarThemeGtk::paint):
1536         (WebCore::ScrollbarThemeGtk::shouldCenterOnThumb):
1537         (WebCore::ScrollbarThemeGtk::buttonSize):
1538         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
1539         * platform/gtk/ScrollbarThemeGtk.h:
1540         (WebCore::ScrollbarThemeGtk::hasButtons):
1541         * platform/ios/ScrollbarThemeIOS.h:
1542         * platform/ios/ScrollbarThemeIOS.mm:
1543         (WebCore::ScrollbarThemeIOS::registerScrollbar):
1544         (WebCore::ScrollbarThemeIOS::unregisterScrollbar):
1545         (WebCore::ScrollbarThemeIOS::hasButtons):
1546         (WebCore::ScrollbarThemeIOS::hasThumb):
1547         (WebCore::ScrollbarThemeIOS::backButtonRect):
1548         (WebCore::ScrollbarThemeIOS::forwardButtonRect):
1549         (WebCore::ScrollbarThemeIOS::trackRect):
1550         (WebCore::ScrollbarThemeIOS::minimumThumbLength):
1551         (WebCore::ScrollbarThemeIOS::shouldCenterOnThumb):
1552         (WebCore::ScrollbarThemeIOS::paint):
1553         * platform/mac/ScrollAnimatorMac.mm:
1554         (scrollbarPainterForScrollbar):
1555         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
1556         (-[WebScrollbarPartAnimation startAnimation]):
1557         (-[WebScrollbarPainterDelegate mouseLocationInScrollerForScrollerImp:]):
1558         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
1559         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
1560         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]):
1561         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1562         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
1563         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
1564         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
1565         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
1566         (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
1567         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
1568         (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
1569         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
1570         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
1571         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
1572         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
1573         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
1574         * platform/mac/ScrollbarThemeMac.h:
1575         * platform/mac/ScrollbarThemeMac.mm:
1576         (WebCore::ScrollbarThemeMac::registerScrollbar):
1577         (WebCore::ScrollbarThemeMac::unregisterScrollbar):
1578         (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
1579         (WebCore::ScrollbarThemeMac::painterForScrollbar):
1580         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
1581         (WebCore::ScrollbarThemeMac::hasButtons):
1582         (WebCore::ScrollbarThemeMac::hasThumb):
1583         (WebCore::ScrollbarThemeMac::backButtonRect):
1584         (WebCore::ScrollbarThemeMac::forwardButtonRect):
1585         (WebCore::ScrollbarThemeMac::trackRect):
1586         (WebCore::ScrollbarThemeMac::minimumThumbLength):
1587         (WebCore::ScrollbarThemeMac::shouldCenterOnThumb):
1588         (WebCore::ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb):
1589         (WebCore::ScrollbarThemeMac::updateEnabledState):
1590         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
1591         (WebCore::ScrollbarThemeMac::paint):
1592         * platform/mock/ScrollbarThemeMock.cpp:
1593         (WebCore::ScrollbarThemeMock::trackRect):
1594         (WebCore::ScrollbarThemeMock::paintTrackBackground):
1595         (WebCore::ScrollbarThemeMock::paintThumb):
1596         * platform/mock/ScrollbarThemeMock.h:
1597         (WebCore::ScrollbarThemeMock::hasButtons): Deleted.
1598         (WebCore::ScrollbarThemeMock::hasThumb): Deleted.
1599         (WebCore::ScrollbarThemeMock::backButtonRect): Deleted.
1600         (WebCore::ScrollbarThemeMock::forwardButtonRect): Deleted.
1601         (WebCore::ScrollbarThemeMock::maxOverlapBetweenPages): Deleted.
1602         (WebCore::ScrollbarThemeMock::isMockTheme): Deleted.
1603         * platform/win/ScrollbarThemeSafari.cpp:
1604         (WebCore::ScrollbarThemeSafari::hasButtons):
1605         (WebCore::ScrollbarThemeSafari::hasThumb):
1606         (WebCore::ScrollbarThemeSafari::backButtonRect):
1607         (WebCore::ScrollbarThemeSafari::forwardButtonRect):
1608         (WebCore::ScrollbarThemeSafari::trackRect):
1609         (WebCore::ScrollbarThemeSafari::minimumThumbLength):
1610         (WebCore::ScrollbarThemeSafari::shouldCenterOnThumb):
1611         (WebCore::ScrollbarThemeSafari::paintTrackBackground):
1612         (WebCore::ScrollbarThemeSafari::paintButton):
1613         (WebCore::ScrollbarThemeSafari::paintThumb):
1614         * platform/win/ScrollbarThemeSafari.h:
1615         * platform/win/ScrollbarThemeWin.cpp:
1616         (WebCore::ScrollbarThemeWin::hasThumb):
1617         (WebCore::ScrollbarThemeWin::backButtonRect):
1618         (WebCore::ScrollbarThemeWin::forwardButtonRect):
1619         (WebCore::ScrollbarThemeWin::trackRect):
1620         (WebCore::ScrollbarThemeWin::shouldCenterOnThumb):
1621         (WebCore::ScrollbarThemeWin::shouldSnapBackToDragOrigin):
1622         (WebCore::ScrollbarThemeWin::paintTrackBackground):
1623         (WebCore::ScrollbarThemeWin::paintTrackPiece):
1624         (WebCore::ScrollbarThemeWin::paintButton):
1625         (WebCore::paintGripper):
1626         (WebCore::ScrollbarThemeWin::paintThumb):
1627         * platform/win/ScrollbarThemeWin.h:
1628         * rendering/RenderScrollbar.h:
1629         (isType):
1630         * rendering/RenderScrollbarPart.cpp:
1631         (WebCore::RenderScrollbarPart::styleDidChange):
1632         (WebCore::RenderScrollbarPart::imageChanged):
1633         * rendering/RenderScrollbarTheme.cpp:
1634         (WebCore::RenderScrollbarTheme::buttonSizesAlongTrackAxis):
1635         (WebCore::RenderScrollbarTheme::hasButtons):
1636         (WebCore::RenderScrollbarTheme::hasThumb):
1637         (WebCore::RenderScrollbarTheme::minimumThumbLength):
1638         (WebCore::RenderScrollbarTheme::backButtonRect):
1639         (WebCore::RenderScrollbarTheme::forwardButtonRect):
1640         (WebCore::RenderScrollbarTheme::trackRect):
1641         (WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
1642         (WebCore::RenderScrollbarTheme::willPaintScrollbar):
1643         (WebCore::RenderScrollbarTheme::didPaintScrollbar):
1644         (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
1645         (WebCore::RenderScrollbarTheme::paintTrackBackground):
1646         (WebCore::RenderScrollbarTheme::paintTrackPiece):
1647         (WebCore::RenderScrollbarTheme::paintButton):
1648         (WebCore::RenderScrollbarTheme::paintThumb):
1649         (WebCore::RenderScrollbarTheme::paintTickmarks):
1650         * rendering/RenderScrollbarTheme.h:
1651
1652 2015-06-24  Matt Rajca  <mrajca@apple.com>
1653
1654         MediaSession: fall back to "content" kind when an unsupported media session kind is passed in
1655         https://bugs.webkit.org/show_bug.cgi?id=146293
1656
1657         Reviewed by Eric Carlson.
1658
1659         * Modules/mediasession/MediaSession.cpp:
1660         (WebCore::MediaSession::parseKind): Parse the media session kind to one of the four supported types.
1661         (WebCore::MediaSession::MediaSession):
1662         (WebCore::MediaSession::kind): Format the value as a string (which the JS bindings expect).
1663         * Modules/mediasession/MediaSession.h: The media session kind is now stored as an enum rather than a string
1664           since we only support a small, fixed number of values.
1665
1666 2015-06-25  Eric Carlson  <eric.carlson@apple.com>
1667
1668         [Mac] Crash in WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget
1669         https://bugs.webkit.org/show_bug.cgi?id=146317
1670
1671         Reviewed by Brent Fulgham.
1672
1673         * html/HTMLMediaElement.cpp:
1674         (WebCore::HTMLMediaElement::mediaState): NULL-check m_player before using it.
1675
1676 2015-06-25  Commit Queue  <commit-queue@webkit.org>
1677
1678         Unreviewed, rolling out r185956.
1679         https://bugs.webkit.org/show_bug.cgi?id=146321
1680
1681         Causes massive crashes on test bots (Requested by bfulgham on
1682         #webkit).
1683
1684         Reverted changeset:
1685
1686         "Enabling MEDIA_STREAM"
1687         https://bugs.webkit.org/show_bug.cgi?id=145947
1688         http://trac.webkit.org/changeset/185956
1689
1690 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
1691
1692         [Win] Update MediaPlayerPrivateAVFoundationCF::supportsType
1693         https://bugs.webkit.org/show_bug.cgi?id=146302
1694         <rdar://problem/19726553>
1695
1696         Reviewed by Eric Carlson.
1697
1698         Tested by existing media tests.
1699
1700         Update the AVFoundationCF version of 'supportsType' to more closely match the AVFoundation
1701         version. Use this new code when the necessary AVFoundationCF functions are present.
1702
1703         * AVFoundationSupport.py: Check for presence of AVCFURLAssetIsPlayableExtendedMIMEType.
1704         (fileContains): Added helper function.
1705         * WebCore.vcxproj/WebCoreGenerated.vcxproj: Add AVFoundationSupport.py to project file to make
1706         maintenance easier.
1707         * WebCore.vcxproj/WebCoreGenerated.vcxproj.filters: Ditto.
1708         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1709         (WebCore::MediaPlayerPrivateAVFoundation::isUnsupportedMIMEType): Moved from ObjC version.
1710         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList): Ditto.
1711         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1712         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add missing declaration.
1713         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1714         (WebCore::avfMIMETypes): Added CF version of AVFoundation code.
1715         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType): Update to use new AVCF
1716         method if it is available.
1717         (WebCore::MediaPlayerPrivateAVFoundationCF::languageOfPrimaryAudioTrack): Handle case of a
1718         null language locale. This is a drive-by fix of a bug found during testing.
1719         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1720         (WebCore::isUnsupportedMIMEType): Deleted.
1721         (WebCore::staticMIMETypeList): Deleted.
1722
1723 2015-06-25  Matthew Daiter  <mdaiter@apple.com>
1724
1725         Enabling MEDIA_STREAM
1726         https://bugs.webkit.org/show_bug.cgi?id=145947
1727         <rdar://problem/21365829>
1728
1729         Reviewed by Brent Fulgham.
1730
1731         * Configurations/FeatureDefines.xcconfig:
1732         * Modules/mediastream/UserMediaClient.h:
1733         * WebCore.xcodeproj/project.pbxproj:
1734         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1735         * platform/mock/UserMediaClientMock.h:
1736
1737 2015-06-25  Zalan Bujtas  <zalan@apple.com>
1738
1739         Do not send touch events to the slider's thumb when it does not have a renderer.
1740         https://bugs.webkit.org/show_bug.cgi?id=146307
1741         rdar://problem/21539399
1742
1743         Reviewed by Simon Fraser.
1744
1745         Bail out early if either the touch target or the renderer() is null.
1746
1747         Test: fast/events/touch/input-range-with-thumb-display-none-crash.html
1748
1749         * html/shadow/SliderThumbElement.cpp:
1750         (WebCore::findTouchWithIdentifier):
1751         (WebCore::SliderThumbElement::handleTouchStart):
1752         (WebCore::SliderThumbElement::handleTouchMove):
1753         (WebCore::SliderThumbElement::handleTouchEndAndCancel):
1754
1755 2015-06-25  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1756
1757         [Streams API] Implement HighWaterMark
1758         https://bugs.webkit.org/show_bug.cgi?id=146235
1759
1760         Reviewed by Darin Adler.
1761
1762         Retrieval of HighWaterMark parameter from arguments passed to the ReadableStream JS constructor.
1763         Retrieval of size function callback from arguments passed to the ReadableStream JS constructor.
1764         Calling doPull() if buffer size is below HighWaterMark.
1765
1766         Covered by rebased tests.
1767
1768         * Modules/streams/ReadableStream.cpp:
1769         (WebCore::ReadableStream::pull): Adding precise check for HWM.
1770         * Modules/streams/ReadableStream.h: Introducing hasEnoughValues.
1771         * bindings/js/ReadableJSStream.cpp:
1772         (WebCore::getHighWaterMark): Utility routine to get properly HWM value.
1773         (WebCore::ReadableJSStream::create): Retrieval of HWM and size function.
1774         (WebCore::ReadableJSStream::ReadableJSStream):
1775         * bindings/js/ReadableJSStream.h: Adding hasEnoughValues and desiredSize prototypes.
1776
1777 2015-06-25  Tim Horton  <timothy_horton@apple.com>
1778
1779         Try to fix the iOS EWS build.
1780
1781         * platform/spi/cocoa/SecuritySPI.h:
1782
1783 2015-06-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1784
1785         [GTK] Empty gtk-font-name setting causes WebProcess crash rendering pages
1786         https://bugs.webkit.org/show_bug.cgi?id=146246
1787
1788         Reviewed by Sergio Villar Senin.
1789
1790         Return early if system font is empty.
1791
1792         * rendering/RenderThemeGtk.cpp:
1793         (WebCore::RenderThemeGtk::updateCachedSystemFontDescription):
1794
1795 2015-06-24  Chris Dumez  <cdumez@apple.com>
1796
1797         Unreviewed, EFL build fix after r185940.
1798
1799         Members were initialized in wrong order.
1800
1801         * Modules/mediastream/MediaDeviceInfo.cpp:
1802         (WebCore::MediaDeviceInfo::MediaDeviceInfo):
1803
1804 2015-06-24  Chris Dumez  <cdumez@apple.com>
1805
1806         Unreviewed, Build fix after r185940.
1807
1808         Move implementation inside WebCore namespace.
1809
1810         * Modules/mediastream/MediaDeviceInfo.cpp:
1811
1812 2015-06-24  Chris Dumez  <cdumez@apple.com>
1813
1814         Unreviewed, speculative GTK build fix after 185940.
1815
1816         Add new cpp file to CMakeLists.txt.
1817
1818         * CMakeLists.txt:
1819
1820 2015-06-24  Matt Daiter  <mdaiter@apple.com>
1821
1822         Building MediaDeviceInfo for enumerateDevices
1823         https://bugs.webkit.org/show_bug.cgi?id=146257
1824         <rdar://problem/21513462>
1825
1826         Reviewed by Eric Carlson.
1827
1828         MediaDeviceInfo necessary for enumerateDevices
1829
1830         * CMakeLists.txt: Added MediaDevicesInfo.idl
1831         * DerivedSources.make: Added MediaDevicesInfo.idl
1832         * Modules/mediastream/MediaDeviceInfo.h: Created class for MediaDevicesInfo
1833         (WebCore::MediaDeviceInfo::create): Allocates class
1834         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Creates class for public
1835         (WebCore::MediaDeviceInfo::~MediaDeviceInfo): 
1836         (WebCore::MediaDeviceInfo::label):
1837         (WebCore::MediaDeviceInfo::deviceId):
1838         (WebCore::MediaDeviceInfo::groupId):
1839         (WebCore::MediaDeviceInfo::kind):
1840         * Modules/mediastream/MediaDeviceInfo.idl:
1841         * WebCore.xcodeproj/project.pbxproj:
1842
1843 2015-06-24  Anders Carlsson  <andersca@apple.com>
1844
1845         Detect view services by using the "com.apple.UIKit.vends-view-services" entitlement
1846         https://bugs.webkit.org/show_bug.cgi?id=146301
1847
1848         Reviewed by Tim Horton.
1849
1850         * WebCore.xcodeproj/project.pbxproj:
1851         * platform/spi/cocoa/SecuritySPI.h:
1852
1853 2015-06-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
1854
1855         Add a new color -apple-wireless-playback-target-active
1856         https://bugs.webkit.org/show_bug.cgi?id=146269
1857         <rdar://problem/21465189>
1858
1859         Reviewed by Dean Jackson.
1860
1861         At the moment we use -apple-system-blue to indicate an Airplay route is
1862         active. This might not always be blue, so we need to add another system
1863         color with a name that will allow us to change the underlying color.
1864         Initially -apple-wireless-playback-target-active will be an alias to
1865         -apple-system-blue.
1866
1867         Existing tests are modified to include the new color value.
1868
1869         * Modules/mediacontrols/mediaControlsApple.js:
1870         (Controller.prototype.updateWirelessTargetPickerButton):
1871         * Modules/mediacontrols/mediaControlsiOS.css:
1872         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
1873         Use the new color value in the media controls.
1874         
1875         * css/CSSParser.cpp:
1876         (WebCore::isAppleLegacyCssValueKeyword): Returns true if the value keyword
1877         has an '-apple' prefix which has to be replaced by '-webkit'
1878         
1879         (WebCore::cssValueKeywordID): Call a new function which handles all the
1880         '-apple' legacy keywords.
1881         
1882         * css/CSSValueKeywords.in: Define the new color keyword.
1883         
1884         * rendering/RenderThemeIOS.mm:
1885         (WebCore::RenderThemeIOS::systemColor):
1886         * rendering/RenderThemeMac.mm:
1887         (WebCore::RenderThemeMac::systemColor):
1888         Define the value of the new color keyword to be an alias of systemBlueColor.
1889
1890 2015-06-24  Matt Rajca  <mrajca@apple.com>
1891
1892         MediaSession: propagate MediaSessionMetadata to WebPageProxy
1893         https://bugs.webkit.org/show_bug.cgi?id=146282
1894
1895         Reviewed by Darin Adler and Tim Horton.
1896
1897         * Modules/mediasession/MediaSession.cpp:
1898         (WebCore::MediaSession::setMetadata):
1899
1900 2015-06-24  Chris Dumez  <cdumez@apple.com>
1901
1902         Null dereference in DocumentLoader::areAllLoadersPageCacheAcceptable()
1903         https://bugs.webkit.org/show_bug.cgi?id=146286
1904         <rdar://problem/21523788>
1905
1906         Reviewed by Sam Weinig.
1907
1908         Add null check for the Page in areAllLoadersPageCacheAcceptable()
1909         to fix this top crasher until I can investigate how this can happen.
1910
1911         * loader/DocumentLoader.cpp:
1912         (WebCore::areAllLoadersPageCacheAcceptable):
1913
1914 2015-06-24  Anders Carlsson  <andersca@apple.com>
1915
1916         Move PluginMainThreadScheduler to WebKit/win
1917         https://bugs.webkit.org/show_bug.cgi?id=146289
1918
1919         Reviewed by Tim Horton.
1920
1921         * CMakeLists.txt:
1922         * Configurations/WebCore.xcconfig:
1923         * WebCore.vcxproj/WebCore.vcxproj:
1924         * WebCore.vcxproj/WebCore.vcxproj.filters:
1925         * WebCore.xcodeproj/project.pbxproj:
1926         * plugins/PluginMainThreadScheduler.cpp:
1927         (WebCore::PluginMainThreadScheduler::scheduler): Deleted.
1928         (WebCore::PluginMainThreadScheduler::PluginMainThreadScheduler): Deleted.
1929         (WebCore::PluginMainThreadScheduler::scheduleCall): Deleted.
1930         (WebCore::PluginMainThreadScheduler::registerPlugin): Deleted.
1931         (WebCore::PluginMainThreadScheduler::unregisterPlugin): Deleted.
1932         (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Deleted.
1933         (WebCore::PluginMainThreadScheduler::dispatchCalls): Deleted.
1934         (WebCore::PluginMainThreadScheduler::mainThreadCallback): Deleted.
1935         * plugins/PluginMainThreadScheduler.h:
1936         (WebCore::PluginMainThreadScheduler::Call::Call): Deleted.
1937         (WebCore::PluginMainThreadScheduler::Call::performCall): Deleted.
1938
1939 2015-06-24  Dean Jackson  <dino@apple.com>
1940
1941         Better fix for Element with blur backdrop-filter shows edge duplication and dark edges
1942         https://bugs.webkit.org/show_bug.cgi?id=146287
1943         <rdar://problem/21530437>
1944
1945         Reviewed by Simon Fraser.
1946
1947         There is no need to carry around a bit in FilterOperations indicating what
1948         type of source property the object came from. Whether or not to clip to the
1949         bounds of the filter region is purely a property of the type of CALayer
1950         we are applying the filter to.
1951
1952         This basically reverts r185846.
1953
1954         Covered by the test for the previous commit.
1955
1956         * css/CSSPropertyNames.in:
1957         * css/StyleBuilderConverter.h:
1958         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): Deleted.
1959         * page/animation/CSSPropertyAnimation.cpp:
1960         (WebCore::blendFilterOperations): Deleted.
1961         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Set the normalized
1962         edges property if we are a CABackdropLayer.
1963         * platform/graphics/filters/FilterOperations.cpp:
1964         (WebCore::FilterOperations::operator==):
1965         (WebCore::FilterOperations::operationsMatch):
1966         (WebCore::FilterOperations::operator=): Deleted.
1967         * platform/graphics/filters/FilterOperations.h:
1968         (WebCore::FilterOperations::isUsedForBackdropFilters): Deleted.
1969         (WebCore::FilterOperations::setUsedForBackdropFilters): Deleted.
1970
1971 2015-06-24  Doug Russell  <d_russell@apple.com>
1972
1973         Bug 146177 - AX: AXObjectCache should try to use an unignored accessibilityObject 
1974         when posting a selection notification when on the border between two accessibilityObjects
1975         https://bugs.webkit.org/show_bug.cgi?id=146177
1976
1977         Reviewed by Darin Adler.
1978
1979         Add support for position to be passed for selection changes to allow checking.
1980         for boundaries in the case of ignored elements.
1981         Add support for searching for unignored siblings of AccessibilityObjects.
1982         Include AccessibilityObject wrappers in notifications for tests.
1983
1984         Test: platform/mac/accessibility/selection-element-tabbing-to-link.html
1985
1986         * accessibility/AXObjectCache.cpp:
1987         (WebCore::AXObjectCache::postTextStateChangeNotification):
1988         * accessibility/AXObjectCache.h:
1989         * accessibility/AccessibilityObject.cpp:
1990         (WebCore::AccessibilityObject::previousSiblingUnignored):
1991         (WebCore::AccessibilityObject::nextSiblingUnignored):
1992         * accessibility/AccessibilityObject.h:
1993         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1994         (isValueTypeSupported):
1995         (arrayRemovingNonSupportedTypes):
1996         (dictionaryRemovingNonSupportedTypes):
1997         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
1998         * editing/mac/FrameSelectionMac.mm:
1999         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
2000
2001 2015-06-24  Anders Carlsson  <andersca@apple.com>
2002
2003         Enable -Winconsistent-missing-override when building with Xcode
2004         https://bugs.webkit.org/show_bug.cgi?id=146288
2005
2006         Reviewed by Sam Weinig.
2007
2008         * Configurations/Base.xcconfig:
2009         * Modules/encryptedmedia/MediaKeySession.h:
2010         * Modules/webdatabase/DatabaseTask.h:
2011         * html/DateTimeLocalInputType.h:
2012         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
2013         * page/scrolling/mac/ScrollingCoordinatorMac.h:
2014         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2015         (WebCore::MediaPlayerPrivateAVFoundation::platformLayer): Deleted.
2016         (WebCore::MediaPlayerPrivateAVFoundation::supportsScanning): Deleted.
2017         (WebCore::MediaPlayerPrivateAVFoundation::fileSize): Deleted.
2018         (WebCore::MediaPlayerPrivateAVFoundation::engineDescription): Deleted.
2019         (WebCore::MediaPlayerPrivateAVFoundation::platformErrorCode): Deleted.
2020         (WebCore::MediaPlayerPrivateAVFoundation::notifyTrackModeChanged): Deleted.
2021         * platform/graphics/avfoundation/VideoTrackPrivateAVF.h:
2022         (WebCore::VideoTrackPrivateAVF::trackIndex): Deleted.
2023         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
2024         (WebCore::CDMSessionAVFoundationObjC::type): Deleted.
2025         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2026         (WebCore::CDMSessionMediaSourceAVFObjC::type): Deleted.
2027         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2028         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsAcceleratedRendering): Deleted.
2029         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget): Deleted.
2030         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2031         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential): Deleted.
2032         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToContinueWithoutCredential): Deleted.
2033         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCancellation): Deleted.
2034         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToPerformDefaultHandling): Deleted.
2035         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedChallengeRejection): Deleted.
2036         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2037         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Deleted.
2038         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2039         (WebCore::MediaPlayerPrivateQTKit::supportsScanning): Deleted.
2040         (WebCore::MediaPlayerPrivateQTKit::networkState): Deleted.
2041         (WebCore::MediaPlayerPrivateQTKit::readyState): Deleted.
2042         (WebCore::MediaPlayerPrivateQTKit::maximumDurationToCacheMediaTime): Deleted.
2043         (WebCore::MediaPlayerPrivateQTKit::engineDescription): Deleted.
2044         * platform/mac/ScrollAnimatorMac.h:
2045         * platform/mac/SerializedPlatformRepresentationMac.h:
2046         (WebCore::SerializedPlatformRepresentationMac::platformType): Deleted.
2047         * platform/mac/ThemeMac.h:
2048         (WebCore::ThemeMac::controlRequiresPreWhiteSpace): Deleted.
2049         * testing/MockCDM.cpp:
2050         (WebCore::MockCDMSession::setClient): Deleted.
2051
2052 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2053
2054         Improve JSDOMPromise callPromiseFunction naming
2055         https://bugs.webkit.org/show_bug.cgi?id=146280
2056
2057         Unreviewed.
2058
2059         No change in behavior.
2060
2061         * bindings/js/JSDOMPromise.h:
2062         (WebCore::callPromiseFunction):
2063
2064 2015-06-24  Tim Horton  <timothy_horton@apple.com>
2065
2066         REGRESSION (r185804): Crash selecting time in the form on https://backup.brighthorizons.com/BackupCareRequest.aspx
2067         <rdar://problem/21525376>
2068
2069         Reviewed by Sam Weinig.
2070
2071         * page/TextIndicator.cpp:
2072         (WebCore::TextIndicator::createWithRange):
2073         Null check.
2074
2075 2015-06-24  Zalan Bujtas  <zalan@apple.com>
2076
2077         Subpixel rendering: roundToDevicePixel() snaps to wrong value.
2078         https://bugs.webkit.org/show_bug.cgi?id=146273
2079         rdar://problem/18509840
2080
2081         Reviewed by Simon Fraser.
2082
2083         Due to the floating point approximate representation, we can't always produce
2084         the correct snap value. This patch addresses the issue by removing redundant kFixedPointDenominator multiplication
2085         and by changing the rounding in roundToDevicePixel() from float to double.
2086
2087         API test is added.
2088
2089         * platform/LayoutUnit.h:
2090         (WebCore::roundToDevicePixel):
2091
2092 2015-06-23  Matt Rajca  <mrajca@apple.com>
2093
2094         MediaSession: Support setting of metadata
2095         https://bugs.webkit.org/show_bug.cgi?id=146253
2096
2097         Reviewed by Eric Carlson.
2098
2099         * Modules/mediasession/MediaSession.cpp:
2100         (WebCore::MediaSession::MediaSession): Store a reference to the document so we can use it in setMetadata.
2101         (WebCore::MediaSession::setMetadata): Implemented as described in the Media Session spec.
2102         * Modules/mediasession/MediaSession.h:
2103         * Modules/mediasession/MediaSession.idl: Added the setMetadata method.
2104         * Modules/mediasession/MediaSessionMetadata.h:
2105         (WebCore::MediaSessionMetadata::MediaSessionMetadata): Added to keep track of media session metadata.
2106         (WebCore::MediaSessionMetadata::title):
2107         (WebCore::MediaSessionMetadata::artist):
2108         (WebCore::MediaSessionMetadata::album):
2109         (WebCore::MediaSessionMetadata::artworkURL):
2110         * WebCore.xcodeproj/project.pbxproj: Added MediaSessionMetadata.h.
2111
2112 2015-06-24  Daniel Bates  <dabates@apple.com>
2113
2114         Content Security Policy error message when frame load is blocked does not read well
2115         https://bugs.webkit.org/show_bug.cgi?id=146279
2116
2117         Reviewed by Csaba Osztrogonác.
2118
2119         Substitute "Refused to load frame" for "Refused to frame" as the prefix of the error message
2120         emitted when the Content Security Policy of the page blocks a frame load.
2121
2122         * page/ContentSecurityPolicy.cpp:
2123         (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
2124
2125 2015-06-11  Sergio Villar Senin  <svillar@igalia.com>
2126
2127         intrinsic size keywords don't work for heights
2128         https://bugs.webkit.org/show_bug.cgi?id=113610
2129
2130         Reviewed by Darin Adler.
2131
2132         Based on Blink's r148314 & r150355 by <cbiesinger@chromium.org>.
2133
2134         Adds intrinsic values support to heigh & min/max-height. This involves the
2135         following changes:
2136         - RenderBox needs to pass the content height through to computeLogicalHeight and
2137         related functions, which needs it to resolve max-content, et. al.
2138         - Make the callers pass the content height to this function. Some callers pass
2139         logicalHeight() (adjusted for border/padding) which works because if
2140         logicalHeight is not the content height, then it is the height we ended up using,
2141         so the constrain* functions will just constrain to that value again.
2142         - Parsing code needs to be adjusted to support intrinsic values for heights.
2143
2144         Tests: fast/css-intrinsic-dimensions/height-css-tables-collapsed.html
2145                fast/css-intrinsic-dimensions/height-css-tables.html
2146                fast/css-intrinsic-dimensions/height-flexbox.html
2147                fast/css-intrinsic-dimensions/height-positioned-replaced.html
2148                fast/css-intrinsic-dimensions/height-positioned.html
2149                fast/css-intrinsic-dimensions/height-replaced.html
2150                fast/css-intrinsic-dimensions/height-tables-collapsed.html
2151                fast/css-intrinsic-dimensions/height-tables.html
2152                fast/css-intrinsic-dimensions/height.html
2153
2154         * css/CSSParser.cpp:
2155         (WebCore::CSSParser::isValidSize): Refactored from validateWidth and
2156         validateHeight.
2157         (WebCore::CSSParser::parseValue):
2158         (WebCore::CSSParser::validateWidth): Deleted.
2159         (WebCore::CSSParser::validateHeight): Deleted.
2160         * css/CSSParser.h:
2161         * platform/Length.h:
2162         (WebCore::Length::isFillAvailable):
2163         (WebCore::Length::isFitContent):
2164         * rendering/RenderBox.cpp:
2165         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
2166         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
2167         (WebCore::RenderBox::computeLogicalHeight):
2168         (WebCore::RenderBox::computeLogicalHeightUsing):
2169         (WebCore::RenderBox::computeContentLogicalHeight):
2170         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
2171         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
2172         (WebCore::RenderBox::computePercentageLogicalHeight):
2173         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2174         (WebCore::RenderBox::availableLogicalHeight):
2175         (WebCore::RenderBox::availableLogicalHeightUsing):
2176         (WebCore::RenderBox::computePositionedLogicalHeight):
2177         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2178         * rendering/RenderBox.h:
2179         * rendering/RenderFlexibleBox.cpp:
2180         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2181         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
2182         * rendering/RenderFlowThread.cpp:
2183         (WebCore::RenderFlowThread::addForcedRegionBreak):
2184         * rendering/RenderGrid.cpp:
2185         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2186         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
2187         * rendering/RenderMultiColumnSet.cpp:
2188         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
2189         * rendering/RenderReplaced.cpp:
2190         (WebCore::RenderReplaced::hasReplacedLogicalHeight):
2191         * rendering/RenderTable.cpp:
2192         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
2193         (WebCore::RenderTable::layout):
2194
2195 2015-06-24  Commit Queue  <commit-queue@webkit.org>
2196
2197         Unreviewed, rolling out r185906.
2198         https://bugs.webkit.org/show_bug.cgi?id=146276
2199
2200         MSVC doesn't yet provide a const-qualified std::array<T,
2201         N>::size(), failing to compile the static_assert (Requested by
2202         zdobersek on #webkit).
2203
2204         Reverted changeset:
2205
2206         "Improve the source code generated by make_names.pl"
2207         https://bugs.webkit.org/show_bug.cgi?id=146208
2208         http://trac.webkit.org/changeset/185906
2209
2210 2015-06-24  Zan Dobersek  <zdobersek@igalia.com>
2211
2212         Improve the source code generated by make_names.pl
2213         https://bugs.webkit.org/show_bug.cgi?id=146208
2214
2215         Reviewed by Darin Adler.
2216
2217         Clean up and optimize the output that's generated by the make_names.pl script
2218         when generating large sets of DOM names for attributes and tags.
2219
2220         The GenerateStrings() function in the StaticString.pm module is split into
2221         GenerateStringData() and GenerateASCIILiteral() so that the two new functions
2222         can be used independently, with the original function still being called when
2223         generating font names.
2224
2225         Tags and attributes have the corresponding static QualifiedName globals defined
2226         as before. After that, two static const std::array<> objects are defined for
2227         both types -- the first is an ordered array of addresses of the QualifiedName
2228         objects (corresponding to the C array that was defined in getHTMLTags(),
2229         getSVGAttrs() etc.), and the second is an ordered array of StringImpl::StaticASCIILiteral
2230         objects that replaces separately defined StringImpl::StaticASCIILiteral objects
2231         and the additional tables that contained pairs of QualifiedName object addresses
2232         and the corresponding StaticASCIILiteral object references in the init() function.
2233         This is all generated by the printStaticData() function in make_names.pl.
2234
2235         The printQualifiedNameCreation() function generates a static_assert() that ensures
2236         that the corresponding std::array<QualifiedName*> and std::array<StaticASCIILiteral>
2237         objects have the same amount of items, and then sets up a loop that walks through
2238         the two arrays and properly constructs the QualifiedName objects from the static
2239         literal data.
2240
2241         On the GTK port, this shaves off ~54kB from the final stripped shared library
2242         on a 64-bit build, and ~21kB on a 32-bit build.
2243
2244         * bindings/scripts/StaticString.pm:
2245         (GenerateStringData):
2246         (GenerateASCIILiteral):
2247         (GenerateStrings):
2248         * dom/make_names.pl:
2249         (printCppHead):
2250         (printNamesCppFile):
2251         (printStaticData):
2252         (printQualifiedNameCreation):
2253         (printInit): Deleted.
2254         (printDefinitions): Deleted.
2255
2256 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2257
2258         Refactor UserMediaRequest to share more codes between MediaDevices.getUserMedia and legacy webkitGetUserMedia
2259         https://bugs.webkit.org/show_bug.cgi?id=146237
2260
2261         Reviewed by Darin Adler.
2262
2263         Covered by existing tests, no change in behavior.
2264
2265         * Modules/mediastream/MediaConstraintsImpl.cpp:
2266         (WebCore::MediaConstraintsImpl::create): Simplified error handling by removing exception code parameter.
2267         * Modules/mediastream/MediaConstraintsImpl.h: Ditto.
2268         * Modules/mediastream/MediaDevices.cpp:
2269         (WebCore::MediaDevices::getUserMedia): Removed code now in UserMediaRequest::start.
2270         * Modules/mediastream/NavigatorUserMedia.cpp:
2271         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Ditto.
2272         * Modules/mediastream/UserMediaRequest.cpp:
2273         (WebCore::parseOptions): Simplified error handling by removing exception code parameter.
2274         (WebCore::UserMediaRequest::start): Renamed create in start and added common code.
2275         * Modules/mediastream/UserMediaRequest.h:
2276
2277 2015-06-23  Andreas Kling  <akling@apple.com>
2278
2279         Should reduce tile coverage for the first paint after a tab switch.
2280         <https://webkit.org/b/146252>
2281         <rdar://problem/19821583>
2282
2283         Reviewed by Darin Adler.
2284
2285         Reduce the number of tiles we need to paint after switching tabs,
2286         to shorten the time it takes before we can flush pixels to screen.
2287
2288         We accomplish this by piggybacking on the "speculative tiling enabled"
2289         mode of FrameView, which was previously only used to throttle painting
2290         and layer flushes during page load.
2291
2292         When a FrameView becomes visible, which is what happens when you
2293         switch to its tab, we revert the speculative tiling optimization to
2294         its initial state, and reset the "scrolled by user" flag.
2295
2296         In practice this means that after switching tabs, we only generate
2297         enough tiles to fill the viewport. Then, after 500ms has passed
2298         or the user scrolls the page, we go back to the usual speculative
2299         tiling mode.
2300
2301         * page/FrameView.cpp:
2302         (WebCore::FrameView::show):
2303
2304 2015-06-23  Anders Carlsson  <andersca@apple.com>
2305
2306         Remove windowResizerRect code, nobody is using it anymore
2307         https://bugs.webkit.org/show_bug.cgi?id=146265
2308
2309         Reviewed by Beth Dakin.
2310
2311         * loader/EmptyClients.h:
2312         * page/Chrome.cpp:
2313         (WebCore::Chrome::windowResizerRect): Deleted.
2314         * page/Chrome.h:
2315         * page/ChromeClient.h:
2316         * page/FrameView.cpp:
2317         (WebCore::FrameView::windowResizerRect): Deleted.
2318         * page/FrameView.h:
2319         * platform/ScrollView.cpp:
2320         (WebCore::ScrollView::ScrollView): Deleted.
2321         (WebCore::ScrollView::windowResizerRectChanged): Deleted.
2322         (WebCore::ScrollView::containsScrollbarsAvoidingResizer): Deleted.
2323         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount): Deleted.
2324         (WebCore::ScrollView::setParent): Deleted.
2325         * platform/ScrollView.h:
2326         (WebCore::ScrollView::windowResizerRect): Deleted.
2327         * platform/Scrollbar.cpp:
2328         (WebCore::Scrollbar::Scrollbar): Deleted.
2329         (WebCore::Scrollbar::setFrameRect): Deleted.
2330         (WebCore::Scrollbar::setParent): Deleted.
2331         * platform/Scrollbar.h:
2332
2333 2015-06-23  Dean Jackson  <dino@apple.com>
2334
2335         Media controls are missing the white backdrop in UIWebViews
2336         https://bugs.webkit.org/show_bug.cgi?id=146251
2337         <rdar://problem/20181345>
2338
2339         Reviewed by Simon Fraser.
2340
2341         Implement two new CALayer subclasses that explicitly set
2342         something that resembles the system appearance for
2343         media-controls-dark-bar-background and media-controls-light-bar-background.
2344         This way, WebKit1 clients get a visible result.
2345
2346         Creating the actual system recipes is tracked by:
2347         https://bugs.webkit.org/show_bug.cgi?id=146250
2348
2349         * WebCore.xcodeproj/project.pbxproj: Add new files.
2350         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2351         (PlatformCALayerCocoa::PlatformCALayerCocoa): Use the new CALayer subclasses for
2352         the appropriate layer types.
2353         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h: Added.
2354         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm: Added.
2355         (-[WebLightSystemBackdropLayer init]):
2356         (-[WebLightSystemBackdropLayer setBackgroundColor:]): Only set to a light grey.
2357         (-[WebDarkSystemBackdropLayer init]):
2358         (-[WebDarkSystemBackdropLayer setBackgroundColor:]): Only set to a dark grey.
2359
2360 2015-06-18  Matt Rajca  <mrajca@apple.com>
2361
2362         Support releasing media sessions
2363         https://bugs.webkit.org/show_bug.cgi?id=146132
2364
2365         Reviewed by Darin Adler.
2366
2367         * Modules/mediasession/MediaSession.cpp: Implemented as described in the Media Session spec.
2368         (WebCore::MediaSession::releaseSession):
2369         (WebCore::MediaSession::releaseInternal):
2370         * Modules/mediasession/MediaSession.h:
2371
2372 2015-06-23  Chris Fleizach  <cfleizach@apple.com>
2373
2374         AX: iOS: VoiceOver and ARIA: has popup property not announced
2375         https://bugs.webkit.org/show_bug.cgi?id=146188
2376
2377         Reviewed by Darin Adler.
2378
2379         Expose the existing "has popup" property to the iOS Accessibility API.
2380
2381         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2382         (-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
2383
2384 2015-06-23  Javier Fernandez  <jfernandez@igalia.com>
2385
2386         [CSS Grid Layout] Performance optimization: avoid computing overflow alignment if not needed
2387         https://bugs.webkit.org/show_bug.cgi?id=146231
2388
2389         Reviewed by Sergio Villar Senin.
2390
2391         We don't need to apply any overflow handling if alignment value don't have a potential
2392         risk of data loss, as it's the case of 'start' value.
2393
2394         This patch avoid computing the overflow in all the cases, since it adds an unneeded
2395         overhead which affects performance.
2396
2397         New code improves performance around 3%-8%, depending on the grid tests.
2398
2399         No new tests, no new funcitonality.
2400
2401         * rendering/RenderGrid.cpp:
2402         (WebCore::RenderGrid::rowPositionForChild):
2403         (WebCore::RenderGrid::columnPositionForChild):
2404
2405 2015-06-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2406
2407         MediaDevices.getUserMedia should migrate from callbacks to DOMPromise
2408         https://bugs.webkit.org/show_bug.cgi?id=146200
2409
2410         Reviewed by Darin Adler.
2411
2412         Introduced DOMPromiseWithCallback to resolve/reject promises while allowing promise clients to use a typed callback approach.
2413         Migrated MediaDevices.getUserMedia from callbacks to DOMPromiseWithCallback.
2414         Removed MediaDevices.getUserMedia custom binding.
2415
2416         Covered by existing tests.
2417
2418         * CMakeLists.txt: Removing custom binding.
2419         * Modules/mediastream/MediaDevices.cpp:
2420         (WebCore::MediaDevices::getUserMedia): Moving from callback to promise.
2421         * Modules/mediastream/MediaDevices.h: Ditto.
2422         * Modules/mediastream/MediaDevices.idl: Removing custom binding.
2423         * Modules/mediastream/NavigatorUserMedia.cpp:
2424         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Converting from promise callback to API callbacks.
2425         * Modules/mediastream/UserMediaRequest.cpp:
2426         (WebCore::UserMediaRequest::create): Moving from callback to promise.
2427         (WebCore::UserMediaRequest::UserMediaRequest): Ditto.
2428         (WebCore::UserMediaRequest::didCreateStream): Ditto.
2429         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Ditto.
2430         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Ditto.
2431         * Modules/mediastream/UserMediaRequest.h: Ditto.
2432         * bindings/js/JSDOMPromise.h: Introducing DOMPromiseWithCallback and removing crypto specific header.
2433         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback):
2434         (WebCore::Error>::resolve):
2435         (WebCore::Error>::reject):
2436         * bindings/js/JSMediaDevicesCustom.cpp: Removed.
2437         * bindings/js/JSSubtleCryptoCustom.cpp: Updating headers.
2438
2439 2015-06-23  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2440
2441         [Streams API] Implement ReadableStream js source "'cancel" callback
2442         https://bugs.webkit.org/show_bug.cgi?id=146204
2443
2444         Reviewed by Darin Adler.
2445
2446         Calling "cancel" JS function when web app is cancelling a JS readable stream.
2447         Handling of promise returned value in case of async cancel.
2448
2449         Covered by rebased tests.
2450
2451         * bindings/js/ReadableJSStream.cpp:
2452         (WebCore::ReadableJSStream::invoke): Refactoring to pass cancel reason or controller to the JS function.
2453         (WebCore::ReadableJSStream::doStart): Ditto.
2454         (WebCore::startReadableStreamAsync): Renaming readableStream as protectedStream.
2455         (WebCore::createPullResultFulfilledFunction): Ditto.
2456         (WebCore::ReadableJSStream::doPull): Refactoring to pass cancel reason or controller to the JS function.
2457         (WebCore::createCancelResultFulfilledFunction): Cancel promise fullfil callback.
2458         (WebCore::createCancelResultRejectedFunction): Cancel promise reject callback.
2459         (WebCore::ReadableJSStream::doCancel): Calling cancel JS callback and handling promise returned value.
2460         * bindings/js/ReadableJSStream.h: Refactoring to pass cancel reason or controller to the JS function.
2461
2462 2015-06-22  Ryuan Choi  <ryuan.choi@navercorp.com>
2463
2464         [EFL] Hyphenation is not supported
2465         https://bugs.webkit.org/show_bug.cgi?id=89830
2466
2467         Reviewed by Gyuyoung Kim.
2468
2469         Share libHyphen backend of GTK port.
2470
2471         Rebased fast/text/hyphenate-*.html
2472
2473         * PlatformEfl.cmake:
2474         * PlatformGTK.cmake:
2475         * platform/efl/FileSystemEfl.cpp:
2476         (WebCore::listDirectory): Deleted because of lack of functionality.
2477         eina_file_ls returns full directory path so fnmatch fails to check dict file.
2478         This patch reuse Posix implementation instead of EFL port specific function.
2479         * platform/posix/FileSystemPOSIX.cpp: Ditto.
2480         * platform/text/gtk/HyphenationLibHyphen.cpp: Moved to platform/text/hyphen
2481         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2482         Renamed from Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp.
2483         (WebCore::scanTestDictionariesDirectoryIfNecessary):
2484         Added PLATFORM guard and EFL implementation for the test directory
2485
2486 2015-06-22  Chris Dumez  <cdumez@apple.com>
2487
2488         [WK1] WebAllowDenyPolicyListener.denyOnlyThisRequest() should not start a new permission request
2489         https://bugs.webkit.org/show_bug.cgi?id=146228
2490         <rdar://problem/15179262>
2491
2492         Reviewed by Daniel Bates.
2493
2494         Add Geolocation::resetIsAllowed() API that merely resets
2495         m_allowGeolocation to Unknown, so that we will request the permission
2496         again the next time a position is requested.
2497
2498         * Modules/geolocation/Geolocation.h:
2499         (WebCore::Geolocation::resetIsAllowed):
2500
2501 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
2502
2503         ASSERT(!m_zOrderListsDirty) when mousing over web view with incremental rendering suppressed
2504         https://bugs.webkit.org/show_bug.cgi?id=146225
2505
2506         Reviewed by Zalan Bujtas.
2507
2508         Update RenderLayer's z-order lists when hit testing. There's no guarantee that they've
2509         been updated; this happens to work most of the time because painting updates them,
2510         but if incremental rendering is suppressed, we may not have painted yet.
2511         
2512         Easy to hit on webkit.org in MiniBrowser, but I wasn't able to make a reduced testcase.
2513
2514         * rendering/RenderLayer.cpp:
2515         (WebCore::RenderLayer::hitTest):
2516         (WebCore::RenderLayer::updateLayerListsIfNeeded): Flip the order of the tests, since checking
2517         dirty bits is cheaper than calling isStackingContext().
2518
2519 2015-06-22  Dean Jackson  <dino@apple.com>
2520
2521         Rename PlatformCA*Mac to PlatformCA*Cocoa
2522         https://bugs.webkit.org/show_bug.cgi?id=146224
2523         <rdar://problem/21497182>
2524
2525         Reviewed by Simon Fraser.
2526
2527         Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
2528         to the more accurate Cocoa suffix.
2529
2530         * WebCore.xcodeproj/project.pbxproj:
2531         * page/mac/ServicesOverlayController.mm:
2532         * platform/graphics/ca/GraphicsLayerCA.cpp:
2533         * platform/graphics/ca/PlatformCAAnimation.h:
2534         * platform/graphics/ca/PlatformCALayer.h:
2535         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Renamed from Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp.
2536         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h.
2537         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm.
2538         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm.
2539         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h.
2540         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm.
2541         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h.
2542         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm.
2543         * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
2544         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
2545         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
2546         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2547         * platform/graphics/ca/mac/WebTiledBackingLayer.mm:
2548
2549 2015-06-22  Alex Christensen  <achristensen@webkit.org>
2550
2551         [cssjit] Disable compiling scrollbar pseudoclass selectors
2552         https://bugs.webkit.org/show_bug.cgi?id=146220
2553
2554         Reviewed by Benjamin Poulain.
2555
2556         * cssjit/SelectorCompiler.cpp:
2557         (WebCore::SelectorCompiler::addScrollbarPseudoClassType):
2558         Don't compile selectors with scrollbar pseudoclasses.
2559
2560 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
2561
2562         -webkit-clip-path clips incorrectly if the element bounds go beyond the top edge of the page
2563         https://bugs.webkit.org/show_bug.cgi?id=146218
2564         rdar://problem/21127840
2565
2566         Reviewed by Zalan Bujtas.
2567
2568         The clip path is computed using the RenderLayer's bounding box, so needs to be offset
2569         by the offsetFromRenderer when set on the mask layer.
2570
2571         Test: compositing/masks/compositing-clip-path-origin.html
2572
2573         * rendering/RenderLayerBacking.cpp:
2574         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
2575
2576 2015-06-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2577
2578         Web sockets should be treated as active mixed content
2579         https://bugs.webkit.org/show_bug.cgi?id=140624
2580
2581         Reviewed by Sam Weinig.
2582
2583         Tests: http/tests/security/mixedContent/websocket/insecure-websocket-in-iframe.html
2584                http/tests/security/mixedContent/websocket/insecure-websocket-in-main-frame.html
2585
2586         * Modules/websockets/WebSocket.cpp:
2587         (WebCore::WebSocket::connect): Block ws:// WebSocket connections from https:// pages, and
2588         emit the onerror event after doing so.
2589         * platform/SchemeRegistry.cpp:
2590         (WebCore::secureSchemes): Add wss:// to the list of secure schemes.
2591
2592 2015-06-22  Dean Jackson  <dino@apple.com>
2593
2594         Element with blur backdrop-filter shows edge duplication and dark edges
2595         https://bugs.webkit.org/show_bug.cgi?id=146215
2596         <rdar://problem/20367695>
2597
2598         Reviewed by Tim Horton.
2599
2600         The input images to backdrop filters should duplicate their edge pixels
2601         outwards, rather than using transparent pixels. This is a flag we
2602         set on the Gaussian blur, but means we have to remember if the
2603         FilterOperations list came from a regular filter or a backdrop filter.
2604
2605         Test: css3/filters/backdrop/blur-input-bounds.html
2606
2607         * css/CSSPropertyNames.in: New custom convertor for backdrop-filter.
2608         * css/StyleBuilderConverter.h:
2609         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): New convertor
2610         that sets the backdrop flag, but is otherwise the same as a normal filter
2611         convertor.
2612         * page/animation/CSSPropertyAnimation.cpp:
2613         (WebCore::blendFilterOperations): Inherit the backdrop flag if either of our
2614         inputs has it.
2615         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Set the inputNormalizeEdges
2616         key on the CAFilter if necessary.
2617         * platform/graphics/filters/FilterOperations.cpp: Add a new flag indicating if
2618         these operations are intended for backdrops.
2619         (WebCore::FilterOperations::operator=):
2620         (WebCore::FilterOperations::operator==):
2621         * platform/graphics/filters/FilterOperations.h:
2622         (WebCore::FilterOperations::isUsedForBackdropFilters):
2623         (WebCore::FilterOperations::setUsedForBackdropFilters):
2624
2625 2015-06-22  Tim Horton  <timothy_horton@apple.com>
2626
2627         [TextIndicator] Text shifts one pixel to the left when I force click to bring up Lookup in Mail messages
2628         https://bugs.webkit.org/show_bug.cgi?id=146214
2629         <rdar://problem/20782970>
2630
2631         Reviewed by Dean Jackson.
2632
2633         * page/mac/TextIndicatorWindow.mm:
2634         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
2635         (WebCore::TextIndicatorWindow::setTextIndicator):
2636         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]): Deleted.
2637         When the WebView is at a nonintegral position, we can end up needing a TextIndicator
2638         with a nonintegral position. We need to round the window position, so we need to apply
2639         the fractional part to the indicator layers inside, not to the window.
2640
2641 2015-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
2642
2643         [iOS] Arabic text styled with Georgia is rendered as boxes
2644         https://bugs.webkit.org/show_bug.cgi?id=145681
2645         <rdar://problem/21169844>
2646
2647         Reviewed by Darin Adler.
2648
2649         Georgia doesn't support Arabic, so we ask CoreText what font does support Arabic. It returns
2650         TimesNewRomanPSMT. However, WebKit explicitly disallows this font on iOS. Therefore, instead
2651         of using TimesNewRomanPSMT, we will simply just use GeezaPro.
2652
2653         Test: fast/text/arabic-times-new-roman.html
2654
2655         * platform/graphics/ios/FontCacheIOS.mm:
2656         (WebCore::FontCache::systemFallbackForCharacters):
2657         * platform/graphics/Font.h: Let FontCacheIOS call fontFamilyShouldNotBeUsedForArabic()
2658         * platform/graphics/cocoa/FontCocoa.mm:
2659         (WebCore::fontFamilyShouldNotBeUsedForArabic):
2660
2661 2015-06-22  Alex Christensen  <achristensen@webkit.org>
2662
2663         Unreviewed non-mac debug build fix after r185840.
2664
2665         * loader/ResourceLoader.cpp:
2666         (WebCore::ResourceLoader::willSendRequest):
2667         Added enable flag around assertion.
2668
2669 2015-06-20  Alex Christensen  <achristensen@webkit.org>
2670
2671         [Content Extensions] Add SPI to reload without content blocking.
2672         https://bugs.webkit.org/show_bug.cgi?id=146128
2673         rdar://problem/20351903
2674
2675         Reviewed by Sam Weinig.
2676
2677         * html/HTMLMediaElement.cpp:
2678         (WebCore::HTMLMediaElement::loadResource):
2679         * loader/ResourceLoader.cpp:
2680         (WebCore::ResourceLoader::willSendRequest):
2681         * loader/cache/CachedResourceLoader.cpp:
2682         (WebCore::CachedResourceLoader::requestResource):
2683         * page/DOMWindow.cpp:
2684         (WebCore::DOMWindow::open):
2685         * page/Page.h:
2686         (WebCore::Page::userContentController):
2687         (WebCore::Page::userContentExtensionsEnabled):
2688         (WebCore::Page::setUserContentExtensionsEnabled):
2689         (WebCore::Page::group):
2690         * page/UserContentController.cpp:
2691         (WebCore::UserContentController::removeAllUserContentExtensions):
2692         (WebCore::UserContentController::processContentExtensionRulesForLoad):
2693         (WebCore::UserContentController::actionsForResourceLoad):
2694         * page/UserContentController.h:
2695
2696 2015-06-22  Zalan Bujtas  <zalan@apple.com>
2697
2698         REGRESSION(r169105) Dangling renderer pointer in SelectionSubtreeRoot::SelectionSubtreeData.
2699         https://bugs.webkit.org/show_bug.cgi?id=146116
2700         rdar://problem/20959369
2701
2702         Reviewed by Brent Fulgham.
2703
2704         This patch ensures that we don't adjust the selection unless the visual selection still matches this subtree root.
2705
2706         When multiple selection roots are present we need to ensure that a RenderObject
2707         only shows up in one of them.
2708         RenderView::splitSelectionBetweenSubtrees(), as the name implies, splits the
2709         selection and sets the selection range (start/end) on each selection root.
2710         However, SelectionSubtreeRoot::adjustForVisibleSelection() later recomputes the range
2711         based on visible selection and that could end up collecting renderers as selection start/end
2712         from another selection subtree.
2713         RenderObject's holds the last selection state (RenderObject::setSelectionState).
2714         If we set a renderer first as "on selection border" and later "inside" using multiple selection roots,
2715         we can't clean up selections properly when this object gets destroyed.
2716         One of the roots ends up with a dangling RenderObject pointer.
2717
2718         Test: fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees.html
2719
2720         * rendering/SelectionSubtreeRoot.cpp:
2721         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
2722
2723 2015-06-22  Jeremy Jones  <jeremyj@apple.com>
2724
2725         Do not exit fullscreen when starting PiP since this is done automatically.
2726         https://bugs.webkit.org/show_bug.cgi?id=144871
2727
2728         Reviewed by Darin Adler.
2729
2730         Since we don't explicitly exit fullscreen, update state in shouldExitFullscreenWithReason()
2731
2732         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Declare shouldExitFullscreenWithReason().
2733         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2734         (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Forward to WebVideoFullscreenInterfaceAVKit.
2735         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Added.
2736         (WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Remove enter fullscreen code.
2737         * platform/spi/cocoa/AVKitSPI.h: Add missing enums.
2738
2739 2015-06-22  Daniel Bates  <dabates@apple.com>
2740
2741         AX: UI Automation cannot find AutoFill or search cancel buttons
2742         https://bugs.webkit.org/show_bug.cgi?id=145241
2743         <rdar://problem/21051411>
2744
2745         Reviewed by Chris Fleizach.
2746
2747         Add support for hit testing the search cancel button and AutoFill button so that
2748         they can be accessed by UI Automation.
2749
2750         Currently the accessibility hit test machinery ignores nodes in a shadow tree.
2751         So, it neither finds the <input type="search"> cancel button nor the AutoFill button
2752         when it performs a hit test. Therefore these buttons cannot be accessed using
2753         UI Automation.
2754
2755         Tests: accessibility/hit-test-input-auto-fill-button.html
2756                accessibility/hit-test-input-search-cancel-button.html
2757                accessibility/input-search-cancel-button.html
2758
2759         * accessibility/AccessibilityRenderObject.cpp:
2760         (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Added; returns
2761         the AccessibilityObject for the search cancel button or AutoFill text field decoration as applicable.
2762         (WebCore::AccessibilityRenderObject::accessibilityHitTest): Check whether the hit node
2763         is a text field decoration.
2764
2765 2015-06-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2766
2767         [Streams API] Implement ReadableStream cancel (abstract part)
2768         https://bugs.webkit.org/show_bug.cgi?id=146111
2769
2770         Reviewed by Darin Adler.
2771
2772         This patch implements ReadableStream and ReadableStreamReader cancel.
2773         The reader delegates cancellation to its stream.
2774
2775         This patch also ensures that controller.close() will not throw in case cancellation is on-going.
2776
2777         A follow-up patch will implement the calling of 'cancel' JS callback for JS sources.
2778
2779         Covered by rebased tests.
2780
2781         * Modules/streams/ReadableStream.cpp:
2782         (WebCore::ReadableStream::cancel): Checks whether locked or not before cancelling.
2783         (WebCore::ReadableStream::cancelNoCheck): Cancel without lock check.
2784         (WebCore::ReadableStream::notifyCancelSucceeded): Async cancel callback.
2785         (WebCore::ReadableStream::notifyCancelFailed): Ditto.
2786         * Modules/streams/ReadableStream.h:
2787         * Modules/streams/ReadableStream.idl: Cleaned up IDL.
2788         * Modules/streams/ReadableStreamReader.cpp:
2789         (WebCore::ReadableStreamReader::cancel):
2790         * Modules/streams/ReadableStreamReader.h:
2791         * Modules/streams/ReadableStreamReader.idl: Cleaned up IDL
2792         * bindings/js/JSReadableStreamControllerCustom.cpp:
2793         (WebCore::JSReadableStreamController::close):
2794         * bindings/js/JSReadableStreamCustom.cpp:
2795         (WebCore::JSReadableStream::cancel):
2796         * bindings/js/JSReadableStreamReaderCustom.cpp:
2797         (WebCore::JSReadableStreamReader::cancel):
2798         * bindings/js/ReadableJSStream.cpp:
2799         (WebCore::ReadableJSStream::doCancel):
2800         * bindings/js/ReadableJSStream.h:
2801
2802 2015-06-22  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2803
2804         WebRTC: Navigator.webkitGetUserMedia() requires three arguments
2805         https://bugs.webkit.org/show_bug.cgi?id=146022
2806
2807         Reviewed by Eric Carlson.
2808
2809         Updated custom binding to make the third error callback argument
2810         mandatory. Updated and unskipped three tests (for the GTK+ port).
2811
2812         * bindings/js/JSNavigatorCustom.cpp:
2813         (WebCore::JSNavigator::webkitGetUserMedia):
2814
2815 2015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2816
2817         Unreviewed. Fix GTK+ build after r185818.
2818
2819         Actually rollout r185320.
2820
2821         * platform/network/soup/DNSSoup.cpp:
2822         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
2823         (WebCore::DNSResolveQueue::platformResolve):
2824         (WebCore::gotProxySettingsCallback): Deleted.
2825         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
2826
2827 2015-06-16  Gavin Barraclough  <barraclough@apple.com>
2828
2829         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
2830         https://bugs.webkit.org/show_bug.cgi?id=146198
2831
2832         Unreviewed rollout.
2833
2834         * platform/network/DNSResolveQueue.cpp:
2835         (WebCore::DNSResolveQueue::DNSResolveQueue):
2836         (WebCore::DNSResolveQueue::isUsingProxy):
2837         (WebCore::DNSResolveQueue::add):
2838         (WebCore::DNSResolveQueue::timerFired):
2839         * platform/network/DNSResolveQueue.h:
2840         * platform/network/cf/DNSCFNet.cpp:
2841         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
2842         (WebCore::clientCallback):
2843         (WebCore::DNSResolveQueue::platformResolve):
2844         (WebCore::proxyIsEnabledInSystemPreferences): Deleted.
2845         (WebCore::isUsingProxy): Deleted.
2846         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
2847         * platform/network/soup/DNSSoup.cpp:
2848
2849 2015-06-21  Alexey Proskuryakov  <ap@apple.com>
2850
2851         REGRESSION (r172975): navigator.language unable to tell region for Traditional Chinese users
2852         https://bugs.webkit.org/show_bug.cgi?id=146121
2853         rdar://problem/21395180
2854
2855         Reviewed by Darin Adler.
2856
2857         Revert to previous behavior, which is wrong in many ways, but not as wrong as the new one.
2858
2859         * platform/mac/Language.mm:
2860         (WebCore::httpStyleLanguageCode):
2861         (WebCore::platformUserPreferredLanguages):
2862         * platform/spi/cf/CFBundleSPI.h:
2863
2864 2015-06-19  Andy Estes  <aestes@apple.com>
2865
2866         Give Node::didNotifySubtreeInsertions() a better name
2867         https://bugs.webkit.org/show_bug.cgi?id=146170
2868
2869         Reviewed by Darin Adler.
2870
2871         didNotifySubtreeInsertions() is not a good name. It sounds like we are notifying the subtree insertions, which doesn't make sense.
2872
2873         This function is really about notifying the Node that the subtree it's a part of has finished being inserted into the DOM
2874         (i.e. all nodes have received their call to insertedInto()). Change the name to finishedInsertingSubtree() to better reflect this.
2875
2876         * dom/ContainerNode.cpp:
2877         (WebCore::ContainerNode::notifyChildInserted):
2878         * dom/ContainerNodeAlgorithms.h:
2879         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
2880         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
2881         * dom/Element.cpp:
2882         (WebCore::Element::addShadowRoot):
2883         * dom/Node.h:
2884         (WebCore::Node::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2885         (WebCore::Node::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2886         * dom/ScriptElement.cpp:
2887         (WebCore::ScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2888         (WebCore::ScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2889         * dom/ScriptElement.h:
2890         * html/HTMLFrameElementBase.cpp:
2891         (WebCore::HTMLFrameElementBase::insertedInto):
2892         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2893         (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2894         * html/HTMLFrameElementBase.h:
2895         * html/HTMLScriptElement.cpp:
2896         (WebCore::HTMLScriptElement::insertedInto):
2897         (WebCore::HTMLScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2898         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2899         * html/HTMLScriptElement.h:
2900         * svg/SVGFEImageElement.cpp:
2901         (WebCore::SVGFEImageElement::insertedInto):
2902         (WebCore::SVGFEImageElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2903         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2904         * svg/SVGFEImageElement.h:
2905         * svg/SVGMPathElement.cpp:
2906         (WebCore::SVGMPathElement::insertedInto):
2907         (WebCore::SVGMPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2908         (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2909         * svg/SVGMPathElement.h:
2910         * svg/SVGScriptElement.cpp:
2911         (WebCore::SVGScriptElement::insertedInto):
2912         (WebCore::SVGScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2913         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2914         * svg/SVGScriptElement.h:
2915         * svg/SVGTRefElement.cpp:
2916         (WebCore::SVGTRefElement::insertedInto):
2917         (WebCore::SVGTRefElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2918         (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2919         * svg/SVGTRefElement.h:
2920         * svg/SVGTextPathElement.cpp:
2921         (WebCore::SVGTextPathElement::insertedInto):
2922         (WebCore::SVGTextPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2923         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2924         * svg/SVGTextPathElement.h:
2925         * svg/animation/SVGSMILElement.cpp:
2926         (WebCore::SVGSMILElement::insertedInto):
2927         (WebCore::SVGSMILElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2928         (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2929         * svg/animation/SVGSMILElement.h:
2930
2931 2015-06-21  Philip Chimento  <philip.chimento@gmail.com>
2932
2933         libwebkit2gtk fails to link without opengl
2934         https://bugs.webkit.org/show_bug.cgi?id=138332
2935
2936         Reviewed by Carlos Garcia Campos.
2937
2938         * CMakeLists.txt: The third-party ANGLE directories need to be
2939         included even if ENABLE(GRAPHICS_CONTEXT_3D) is false. They must
2940         be included after the OpenGL headers as the comment says.
2941         * platform/graphics/texmap/BitmapTexturePool.cpp: Remove
2942         reference to no longer existent header file.
2943
2944 2015-06-20  Tim Horton  <timothy_horton@apple.com>
2945
2946         Deselection of text causes a noticeable jump on force touch machines
2947         https://bugs.webkit.org/show_bug.cgi?id=146173
2948         <rdar://problem/20992842>
2949
2950         Reviewed by Sam Weinig.
2951
2952         When we have a TextIndicator of type Crossfade, we end up putting
2953         a layer with the blue highlight + text painted into it on top of the
2954         content, and cross-fading that layer to the yellow-highlighted text.
2955
2956         This is necessary for BounceAndCrossfade TextIndicators, because the
2957         blue highlight has to bounce, but is not necessary for Crossfade-only
2958         ones; we can just fade in the yellow highlight on top of the
2959         existing blue page highlight, and all is well.
2960
2961         So, get rid of the Crossfade TextIndicator type and use FadeIn, separately
2962         keeping track of whether or not we can add a margin (we still can't
2963         add a margin to TextIndicators that indicate the page's current selection,
2964         because the blue highlight cannot have the margin applied to it, and we
2965         want the bounds to match exactly).
2966
2967         * page/TextIndicator.cpp:
2968         (WebCore::TextIndicator::createWithRange):
2969         If the range is the same as the selection, turn off the margin.
2970         We were previously doing this based on the presentation transition, but now
2971         there's no difference in presentation transition in this case.
2972
2973         (WebCore::TextIndicator::createWithSelectionInFrame):
2974         (WebCore::TextIndicator::wantsBounce):
2975         (WebCore::TextIndicator::wantsContentCrossfade):
2976         (WebCore::TextIndicator::wantsFadeIn):
2977         (WebCore::TextIndicator::wantsManualAnimation):
2978         * page/TextIndicator.h:
2979         Get rid of TextIndicatorPresentationTransition::Crossfade.
2980
2981         (WebCore::TextIndicator::setWantsMargin):
2982         (WebCore::TextIndicator::wantsMargin):
2983         Keep track of whether we want a margin.
2984
2985         * page/mac/TextIndicatorWindow.mm:
2986         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
2987         Determine if we should use a margin based on wantsMargin instead of the
2988         presentation transition.
2989
2990 2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
2991
2992         [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
2993         https://bugs.webkit.org/show_bug.cgi?id=146171
2994
2995         Reviewed by Gyuyoung Kim.
2996
2997         * platform/efl/EflInspectorUtilities.cpp:
2998         (WebCore::inspectorResourcePath): Only used WEB_INSPECTOR_DIR which CMake decides properly.
2999
3000 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3001
3002         Fix absolute value warning in LocalizedStringsGtk.cpp
3003         https://bugs.webkit.org/show_bug.cgi?id=145919
3004
3005         Reviewed by Martin Robinson.
3006
3007         Use abs(static_cast<int>(time)) rather than static_cast<int>(abs(time)) to avoid clang's
3008         warnings about passing a float to abs() instead of std::abs(). Also, because casting an int
3009         to an int is silly.
3010
3011         * platform/gtk/LocalizedStringsGtk.cpp:
3012         (WebCore::localizedMediaTimeDescription):
3013
3014 2015-06-19  Devin Rousso  <drousso@apple.com>
3015
3016         Web Inspector: Highlight currently edited CSS selector
3017         https://bugs.webkit.org/show_bug.cgi?id=145658
3018
3019         Reviewed by Joseph Pecoraro.
3020
3021         Test: inspector/dom/highlight-multiple-shapes.html
3022
3023         * inspector/InspectorController.cpp:
3024         (WebCore::InspectorController::buildObjectForHighlightedNode):
3025         * inspector/InspectorController.h:
3026         * inspector/InspectorDOMAgent.cpp:
3027         (WebCore::InspectorDOMAgent::highlightSelector): Gets a list of all nodes matching a given selector string and highlights each of them.
3028         * inspector/InspectorDOMAgent.h:
3029         * inspector/InspectorOverlay.cpp:
3030         (WebCore::InspectorOverlay::hideHighlight):
3031         (WebCore::InspectorOverlay::highlightNodeList): Loops through a given NodeList to create highlightObjects for each of them.
3032         (WebCore::InspectorOverlay::shouldShowOverlay):
3033         (WebCore::buildObjectForElementData): Don't show flow fragments when highlighting multiple nodes.
3034         (WebCore::InspectorOverlay::buildHighlightObjectForNode):
3035         (WebCore::InspectorOverlay::buildObjectForHighlightedNode): Now returns an array containing the highlightObject for each highligthed node.
3036         (WebCore::InspectorOverlay::drawNodeHighlight): Now sends an array to the InspectorOverlayPage.js to provide support for highlighting multiple nodes.
3037         * inspector/InspectorOverlay.h:
3038         * inspector/InspectorOverlayPage.js: Now expects an array as its parameter and loops through it to highlight each node given.
3039         If the parameter array contains more than one element, do not draw the textbox containing info on that node.
3040         (drawNodeHighlight):
3041
3042 2015-06-19  Joseph Pecoraro  <pecoraro@apple.com>
3043
3044         Crash under WebCore::PageConsoleClient::addMessage attempting to log insecure content message in ImageDocument
3045         https://bugs.webkit.org/show_bug.cgi?id=146096
3046
3047         Reviewed by Timothy Hatcher.
3048
3049         Was able to reproduce this using a user stylesheet with an http css font
3050         on a pdf (ImageDocument) main document loaded over https. Was unable to
3051         create a reliable test for this scenario.
3052
3053         * page/PageConsoleClient.cpp:
3054         (WebCore::getParserLocationForConsoleMessage):
3055         The scriptableDocumentParser could be null, such as in an ImageDocument.
3056
3057 2015-06-19  Dean Jackson  <dino@apple.com>
3058
3059         Extremely large canvas crashes on pre-El Capitan machines
3060         https://bugs.webkit.org/show_bug.cgi?id=146169
3061         <rdar://problem/21410046>
3062
3063         Reviewed by Tim Horton.
3064
3065         On machines before El Capitan, make the maximum canvas size
3066         8k by 8k.
3067
3068         Covered by existing tests.
3069
3070         * html/HTMLCanvasElement.cpp:
3071
3072 2015-06-19  Tim Horton  <timothy_horton@apple.com>
3073
3074         Selection services cannot be invoked when force click is enabled
3075         https://bugs.webkit.org/show_bug.cgi?id=146166
3076         <rdar://problem/21468362>
3077
3078         Reviewed by Darin Adler.
3079
3080         * page/mac/ServicesOverlayController.h:
3081         Turn Highlight::Type into something we can use for dirty flags.
3082
3083         * page/mac/ServicesOverlayController.mm:
3084         (WebCore::ServicesOverlayController::Highlight::createForSelection):
3085         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
3086         (WebCore::ServicesOverlayController::ServicesOverlayController):
3087         (WebCore::ServicesOverlayController::selectionRectsDidChange):
3088         (WebCore::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
3089         (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
3090         (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
3091         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
3092         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
3093         (WebCore::ServicesOverlayController::buildSelectionHighlight):
3094         (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
3095         (WebCore::ServicesOverlayController::determineActiveHighlight):
3096         (WebCore::ServicesOverlayController::didScrollFrame):
3097         (WebCore::ServicesOverlayController::handleClick):
3098         Coalesce highlight rebuilding so that things (like TextIndicator creation)
3099         that change the selection and then reset it immediately don't cause us
3100         to lose the active highlight.
3101
3102         This also means that if the selection changes multiple times in a runloop
3103         (easily possible from script), we won't waste a lot of time rebuilding highlights.
3104
3105         (WebCore::ServicesOverlayController::didRebuildPotentialHighlights):
3106         Merged into buildPotentialHighlightsIfNeeded.
3107
3108 2015-06-19  Matt Baker  <mattbaker@apple.com>
3109
3110         Web Inspector: TimelineAgent needs to handle nested runloops
3111         https://bugs.webkit.org/show_bug.cgi?id=145090
3112
3113         Reviewed by Joseph Pecoraro.
3114
3115         Previously nested run loops caused InspectorTimelineAgent to prematurely pop the current run loop record. This
3116         patch adds a counter to track the run loop nesting level, and rendering frame records are only pushed/popped
3117         when the nesting level is zero. Run loop entry/exit notifications received while the debugger is paused do not
3118         affect the nesting level.
3119
3120         * inspector/InspectorTimelineAgent.cpp:
3121         (WebCore::InspectorTimelineAgent::internalStart):
3122         (WebCore::InspectorTimelineAgent::internalStop):
3123         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
3124         * inspector/InspectorTimelineAgent.h:
3125
3126 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
3127
3128         Follow-up fix to r185766.
3129         https://bugs.webkit.org/show_bug.cgi?id=22132
3130
3131         Reviewed by Zalan Bujtas.
3132
3133         Suggested by Darin Adler in the bug.
3134
3135         * platform/graphics/filters/FETile.cpp:
3136         (WebCore::FETile::platformApplySoftware): Use WTF::move when passing
3137         the new tileImageCopy RefPtr.
3138
3139 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3140
3141         [SOUP] Fix return-type-c-linkage warning after r185553
3142         https://bugs.webkit.org/show_bug.cgi?id=146014
3143
3144         Reviewed by Martin Robinson.
3145
3146         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
3147         (webkitSoupRequestGenericGetRequest): Return a pointer rather than a reference.
3148         * platform/network/soup/WebKitSoupRequestGeneric.h: webkitSoupRequestGenericGetRequest now
3149         returns a pointer rather than a reference.
3150
3151 2015-06-19  Dean Jackson  <dino@apple.com>
3152
3153         Played <audio> looks invisible against the gray background
3154         https://bugs.webkit.org/show_bug.cgi?id=146164
3155         <rdar://problem/21014284>
3156
3157         Reviewed by Brent Fulgham.
3158
3159         The plus-darker blend mode was not allowing any white to
3160         show through in the rendering. We don't need this for
3161         audio controls, where we draw on an opaque grey background.
3162
3163         * Modules/mediacontrols/mediaControlsiOS.css:
3164         (audio::-webkit-media-controls-panel): Darken the color of the controls a
3165         little to make white stand out more.
3166         (audio::-webkit-media-controls-timeline): Remove the plus-darker blending.
3167         (video::-webkit-media-controls-timeline): Apply blending only to video.
3168
3169 2015-06-19  Andy Estes  <aestes@apple.com>
3170
3171         Various assertion failures occur when executing script in the midst of DOM insertion
3172         https://bugs.webkit.org/show_bug.cgi?id=132482
3173
3174         Reviewed by Darin Adler.
3175
3176         Prior to this change, when an element containing a <script> child was inserted into a document, the script was
3177         executed in ScriptElement::insertedInto(). That script can access nodes that follow it in the newly-inserted
3178         hierarchy but are not yet fully inserted, leading to at least the following problems:
3179
3180             - The script could remove a node that is not yet marked as in the document.
3181             - The script could remove a named <map> that has yet to be added to TreeScope::m_imageMapsByName.
3182             - The script could remove a form control that has yet to be added to FormController::m_formElementsWithState.
3183
3184         These scenarios all result in assertion failures. This change ensures that each node in the newly-inserted
3185         hierarchy is fully inserted before executing any scripts.
3186
3187         Tests: fast/dom/element-removed-while-inserting-parent-crash.html
3188                fast/dom/named-map-removed-while-inserting-parent-crash.html
3189                fast/forms/form-control-removed-while-inserting-parent-crash.html
3190                svg/dom/element-removed-while-inserting-parent-crash.html
3191
3192         * dom/ScriptElement.cpp:
3193         (WebCore::ScriptElement::shouldNotifySubtreeInsertions): Renamed from insertedInto().
3194         Returned true in the case where insertedInto() would've called prepareScript().
3195         (WebCore::ScriptElement::didNotifySubtreeInsertions): Called prepareScript().
3196         (WebCore::ScriptElement::insertedInto): Renamed to shouldNotifySubtreeInsertions().
3197         * dom/ScriptElement.h:
3198         * html/HTMLScriptElement.cpp:
3199         (WebCore::HTMLScriptElement::insertedInto): If shouldNotifySubtreeInsertions() is true, returned InsertionShouldCallDidNotifySubtreeInsertions.
3200         Otherwise, returned InsertionDone.
3201         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
3202         * html/HTMLScriptElement.h:
3203         * svg/SVGScriptElement.cpp:
3204         (WebCore::SVGScriptElement::insertedInto): Did the same as HTMLScriptElement::insertedInto().
3205         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
3206         * svg/SVGScriptElement.h:
3207
3208 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
3209
3210         All calls of ImageBuffer::create should null check the return value
3211         https://bugs.webkit.org/show_bug.cgi?id=22132
3212
3213         Reviewed by Zalan Bujtas.
3214
3215         ImageBuffer::create returns nullptr for a number of reasons, and should be
3216         expected to do so. We missed this check in a few places, resulting in
3217         crashes on some systems. Likewise, ImageBuffer::copyImage may return nullptr
3218         in normal use and should be checked.
3219
3220         * platform/graphics/BitmapImage.cpp:
3221         (WebCore::BitmapImage::drawPattern): Add nullptr check for create and copyImage. Remove
3222         extra call to 'setImageObserver'.
3223         * platform/graphics/cairo/ImageBufferCairo.cpp:
3224         (WebCore::ImageBuffer::drawPattern): Add nullptr check for copyImage.
3225         * platform/graphics/cg/ImageBufferCG.cpp:
3226         (WebCore::ImageBuffer::drawPattern): Add nullptr checks for copyImage.
3227         * platform/graphics/filters/FETile.cpp:
3228         (WebCore::FETile::platformApplySoftware): Add nullptr check for copyImage.
3229         * platform/graphics/filters/FilterEffect.cpp:
3230         (WebCore::FilterEffect::asImageBuffer): Add nullptr check for create.
3231         (WebCore::FilterEffect::openCLImageToImageBuffer): Ditto.
3232         * platform/graphics/texmap/BitmapTexture.cpp:
3233         (WebCore::BitmapTexture::updateContents): Add nullptr checks for create and copyImage.
3234         * svg/graphics/SVGImage.cpp:
3235         (WebCore::SVGImage::drawPatternForContainer): Add nullptr check for copyImage.
3236
3237 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
3238
3239         Get CAContext directly for CALayer instead of walking the layer tree.
3240         https://bugs.webkit.org/show_bug.cgi?id=146138
3241         <rdar://problem/21455974>
3242
3243         Reviewed by Darin Adler.
3244
3245         This will get the context directly from the CALayer instead of getting all CAContexts, walking the layer tree 
3246         to the root and comparing that against each CAContext's root layer.
3247
3248         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3249         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
3250
3251 2015-06-18  Brent Fulgham  <bfulgham@apple.com>
3252
3253         [iOS] scrollIntoViewIfNeeded is not working with scroll-snap points
3254         https://bugs.webkit.org/show_bug.cgi?id=145318
3255         <rdar://problem/21081501>
3256
3257         Reviewed by Simon Fraser.
3258
3259         Use the ScrollController in iOS to track the scroll snap point state.
3260         We do not need the animation implementation or timers since the actual
3261         animation is handled by UIKit.
3262
3263         This change lets us communicate the current offset into the scroll snap
3264         offset vector between the WebProcess and RemoteScrollingTree so that
3265         both sides stay in sync regardless of whether user gestures or style
3266         updates have caused us to shift to a different snap point.
3267
3268         * page/scrolling/AsyncScrollingCoordinator.cpp:
3269         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Set the
3270         current horizontal and vertical scroll snap offset indices.
3271         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Ditto.
3272         * page/scrolling/AsyncScrollingCoordinator.h: Mark the setActiveScrollSnapIndices
3273         for export so that it can be reached by the UIProcess.
3274         * page/scrolling/ScrollingCoordinator.h: Keep track of horizontal and
3275         vertical scroll snap offset indices.
3276         * page/scrolling/ScrollingStateScrollingNode.cpp:
3277         (WebCore::ScrollingStateScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
3278         (WebCore::ScrollingStateScrollingNode::setCurrentVerticalSnapPointIndex): Added.
3279         * page/scrolling/ScrollingStateScrollingNode.h:
3280         (WebCore::ScrollingStateScrollingNode::currentHorizontalSnapPointIndex): Added.
3281         (WebCore::ScrollingStateScrollingNode::currentVerticalSnapPointIndex): Added.
3282         * page/scrolling/ScrollingTree.h:
3283         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3284         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Update the scroll snap
3285         point offset indices if either has changed.
3286         * page/scrolling/ScrollingTreeScrollingNode.h:
3287         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex): Added.
3288         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex): Added.
3289         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
3290         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Added.
3291         * page/scrolling/ThreadedScrollingTree.cpp:
3292         (WebCore::ThreadedScrollingTree::currentSnapPointIndicesDidChange): New method
3293         to handle notifications about scroll snap index changes from the UIProcess.
3294         * page/scrolling/ThreadedScrollingTree.h:
3295         * page/scrolling/ios/ScrollingTreeIOS.cpp:
3296         (WebCore::ScrollingTreeIOS::currentSnapPointIndicesDidChange): New method
3297         to handle notifications about scroll snap index changes from the UIProcess.
3298         * page/scrolling/ios/ScrollingTreeIOS.h:
3299         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3300         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Update scroll
3301         snap point current offset indices if they have changed.
3302         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Remove unneeded
3303         PLATFORM(MAC) macro.
3304         * platform/ScrollAnimator.cpp:
3305         (WebCore::ScrollAnimator::ScrollAnimator): We have a ScrollController if we are
3306         supporting scroll snap points or rubber banding.
3307         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): This method is not needed
3308         for iOS builds.
3309         (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): Enable this on iOS.
3310         (WebCore::ScrollAnimator::updateScrollSnapState): Renamed from 'updateScrollAnimatorsAndTimers'
3311         and enabled on iOS.
3312         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Deleted.
3313         * platform/ScrollAnimator.h: Enable some scroll snap methods on iOS.
3314         * platform/ScrollableArea.cpp:
3315         (WebCore::ScrollableArea::handleWheelEvent): Enable scroll snap index bookkeeping on iOS, too.
3316         (WebCore::ScrollableArea::updateScrollSnapState): Revise to call 'updateScrollSnapState' instead
3317         of 'updateScrollAnimatorsAndTimers'.
3318         * platform/cocoa/ScrollController.h: Enable some methods on iOS. Reorder methods to
3319         reduce the number of macros needed to do so.
3320         * platform/cocoa/ScrollController.mm:
3321         (systemUptime): Only build for Mac.
3322         (WebCore::ScrollController::ScrollController): Disable rubber band-specific members on iOS.
3323         (WebCore::ScrollController::handleWheelEvent): Only build this on Mac.
3324         (WebCore::ScrollController::isRubberBandInProgress): Always return 'false' on iOS.
3325         (WebCore::ScrollController::startSnapRubberbandTimer): Only build this on Mac.
3326         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
3327         (WebCore::ScrollController::scrollSnapPointState): Enable on iOS.
3328         (WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Only build on Mac.
3329         (WebCore::ScrollController::updateScrollSnapState): renamed from 'updateScrollAnimatorsAndTimers'
3330         (WebCore::ScrollController::startScrollSnapTimer): Only build on Mac.
3331         (WebCore::ScrollController::initializeGlideParameters): Ditto.
3332         (WebCore::ScrollController::activeScrollSnapIndexForAxis): Enable on iOS.
3333         (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): Ditto.
3334         (WebCore::ScrollController::beginScrollSnapAnimation): Only build on Mac.
3335         (WebCore::ScrollController::computeGlideDelta): Ditto.
3336         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Deleted.
3337         * rendering/RenderLayerCompositor.cpp:
3338         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Capture any changes in scroll
3339         snap offset indices.
3340
3341 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
3342
3343         Fullscreen view should not update bounds of video when in PiP.
3344         https://bugs.webkit.org/show_bug.cgi?id=146134
3345
3346         Reviewed by Darin Adler.
3347
3348         Don't update bounds on video layer when it is not a child.
3349
3350         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3351         (-[WebAVVideoLayer setBounds:]):
3352
3353 2015-06-19  Zalan Bujtas  <zalan@apple.com>
3354
3355         RenderRubyText requires RenderRubyRun parent.
3356         https://bugs.webkit.org/show_bug.cgi?id=146148
3357         rdar://problem/21423319
3358
3359         Reviewed by Simon Fraser.
3360
3361         RenderRubyText expects its parent to be RenderRubyRun and since a
3362         a non-block <rt> requires anonymous wrapper, we should check whether
3363         the display type is actually block.
3364
3365         Test: fast/ruby/crash-when-ruby-rt-is-non-block.html
3366
3367         * html/RubyTextElement.cpp:
3368         (WebCore::RubyTextElement::createElementRenderer):
3369
3370 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
3371
3372         cancelPreviousPerformRequestsWithTarget for -resolveBounds in wrong class.
3373         https://bugs.webkit.org/show_bug.cgi?id=146140
3374
3375         Reviewed by Eric Carlson.
3376
3377         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3378         (-[WebCALayerHostWrapper dealloc]): Added.
3379         (-[WebAVVideoLayer dealloc]): Deleted.
3380
3381 2015-06-19  Per Arne Vollan  <peavo@outlook.com>
3382
3383         [WinCairo] Null pointer crash in BitmapTexture::updateContents.
3384         https://bugs.webkit.org/show_bug.cgi?id=146147
3385
3386         Reviewed by Brent Fulgham.
3387
3388         Added null pointer check.
3389
3390         * platform/graphics/texmap/BitmapTexture.cpp:
3391         (WebCore::BitmapTexture::updateContents):
3392
3393 2015-06-19  Anders Carlsson  <andersca@apple.com>
3394
3395         Spintracer treats the web process as hung when it's showing JavaScript dialogs in the UI process
3396         https://bugs.webkit.org/show_bug.cgi?id=146124
3397         rdar://problem/21449395
3398
3399         Reviewed by Geoffrey Garen.
3400
3401         * platform/spi/cg/CoreGraphicsSPI.h:
3402
3403 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
3404
3405         Remove unnecessary svn:executable flags
3406         https://bugs.webkit.org/show_bug.cgi?id=146107
3407
3408         Reviewed by Alexey Proskuryakov.
3409
3410         * html/canvas/CanvasRenderingContext2D.cpp: Removed property svn:executable.
3411         * mathml/MathMLMencloseElement.cpp: Removed property svn:executable.
3412         * mathml/MathMLMencloseElement.h: Removed property svn:executable.
3413         * platform/efl/RenderThemeEfl.cpp: Removed property svn:executable.
3414         * rendering/mathml/RenderMathMLMenclose.cpp: Removed property svn:executable.
3415         * rendering/mathml/RenderMathMLMenclose.h: Removed property svn:executable.
3416
3417 2015-06-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3418
3419         Bindings generator should generate code to catch exception and reject promises for Promise-based APIs
3420         https://bugs.webkit.org/show_bug.cgi?id=146060
3421
3422         Reviewed by Darin Adler.
3423
3424         The binding generator splits the function that binds JS to the DOM class implementation in two for functions returning promise.
3425         The first function, called from JS, is responsible of casting this to the expected JSXXX class.
3426         If casting fails, an exception is raised. Otherwise, it calls the second function.
3427         After calling the second function, it checks whether an exception is raised, in which case it returns a rejected promise.
3428         The second function is responsible of argument conversion and calling the DOM class function.
3429
3430         Covered by expectations and AudioContext promise still working.
3431         A test case is added for a promise returning function taking a typed argument as input (if argument value cannot be typed, the promise is rejected).
3432         A second test case is a promise-returning function that can raise an exception. In that case the DOMException is used as rejection value.
3433
3434         As can be seen from generated code, this generalized code adds a mandatory check (is there an exception?) at the end of the function.
3435         This check is done even in cases we know there will be no exception.
3436         This may be covered by another patch if this optimization is thought useful enough.
3437
3438         * bindings/js/JSDOMPromise.cpp:
3439         (WebCore::rejectPromiseWithExceptionIfAny): Utility method for the binding code.
3440         (WebCore::callPromiseFunction): Ditto.
3441         * bindings/js/JSDOMPromise.h:
3442         * bindings/scripts/CodeGeneratorJS.pm:
3443         (GenerateImplementation):
3444         (GenerateFunctionCastedThis): Extracted from GenerateImplementationFunctionCall to reuse it in case of promise-returning functions.
3445         (GenerateImplementationFunctionCall):
3446         (GenerateCallbackImplementation): Deleted.
3447         * bindings/scripts/test/JS/JSTestObj.cpp:
3448         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
3449         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
3450         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
3451         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
3452         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
3453         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
3454         * bindings/scripts/test/TestObj.idl:
3455
3456 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
3457
3458         Disable UIWindow for fullscreen video for selected clients.
3459         https://bugs.webkit.org/show_bug.cgi?id=145852
3460
3461         Reviewed by Simon Fraser.
3462
3463         Disable UIWindow for fullscreen video doesn't work everywhere (rdar://problem/21315993), so just disable it when creating a UIWindow won't work.
3464         Fix some interface hiding and layout problems that showed up in the non UIWindow code path.
3465
3466         * platform/RuntimeApplicationChecksIOS.h:
3467         * platform/RuntimeApplicationChecksIOS.mm: Remove iAD bundle identifier.
3468         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3469         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Opt out of UIWindow when hosted in another process. And fix view parenting for non-window case.
3470         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Fix for AVKit exit fullscreen complaining about -needsLayout.
3471
3472         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
3473         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
3474         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
3475         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
3476         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
3477         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
3478         These hide and show the view controller where we hide and show the window.
3479
3480 2015-06-18  Dean Jackson  <dino@apple.com>
3481
3482         Provide a way for web developers to draw a Theme-specific Wireless Playback icon
3483         https://bugs.webkit.org/show_bug.cgi?id=146123
3484         <rdar://problem/21119287>
3485
3486         Reviewed by Simon Fraser.
3487
3488         Implement a -webkit-named-image() CSS <image> generator that allows a site to
3489         request artwork by name and get the platform variant. At the moment
3490         we only support "wireless-playback" which returns a generic image everywhere
3491         but Cocoa platforms, where we render the AirPlay icon.
3492
3493         In order to do this I added a ThemeCocoa to share any Theme code between
3494         Mac and iOS.
3495
3496         Test: fast/css/named-icons.html
3497
3498         * WebCore.xcodeproj/project.pbxproj: Add new files CSSNamedImageValue, NamedImageGeneratedImage and ThemeCocoa.
3499
3500         * css/CSSImageGeneratorValue.cpp: Handle the new NamedImageClass in the switch statements for downcasting.
3501         (WebCore::CSSImageGeneratorValue::image):
3502         (WebCore::CSSImageGeneratorValue::isFixedSize):
3503         (WebCore::CSSImageGeneratorValue::isPending):
3504         (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
3505
3506         * css/CSSNamedImageValue.cpp: New class. Just holds a name String.
3507         (WebCore::CSSNamedImageValue::customCSSText):
3508         (WebCore::CSSNamedImageValue::image):
3509         (WebCore::CSSNamedImageValue::equals):
3510         * css/CSSNamedImageValue.h:
3511         (WebCore::CSSNamedImageValue::create):
3512         (WebCore::CSSNamedImageValue::isFixedSize):
3513         (WebCore::CSSNamedImageValue::isPending):
3514         (WebCore::CSSNamedImageValue::CSSNamedImageValue):
3515
3516         * css/CSSParser.cpp:
3517         (WebCore::CSSParser::isGeneratedImageValue): Allow "-webkit-named-image(".
3518         (WebCore::CSSParser::parseGeneratedImage): Call parseNamedImage if we hit named-icon.
3519         (WebCore::CSSParser::parseNamedImage): Parse the function looking for a CSS ident.
3520         * css/CSSParser.h:
3521
3522         * css/CSSValue.cpp: Handle NamedImageClass in the various switch statements.
3523         (WebCore::CSSValue::equals):
3524         (WebCore::CSSValue::cssText):
3525         (WebCore::CSSValue::destroy):
3526         * css/CSSValue.h:
3527         (WebCore::CSSValue::isNamedImageValue): Helper to detect the correct CSSValue subclass.
3528
3529         * platform/Theme.cpp:
3530         (WebCore::Theme::drawNamedImage): Draw a generic wireless playback icon.
3531         * platform/Theme.h: Add drawNamedImage.
3532
3533         * platform/cocoa/ThemeCocoa.cpp: New shared base class for ThemeMac and ThemeIOS.
3534         (WebCore::fitContextToBox):
3535         (WebCore::ThemeCocoa::drawNamedImage): Draw an AirPlay icon for wireless playback.
3536         * platform/cocoa/ThemeCocoa.h:
3537
3538         * platform/graphics/CrossfadeGeneratedImage.h: Drive-by removal of unnecessary forward class definition.
3539
3540         * platform/graphics/ImageBuffer.h: Add NamedImageGeneratedImage as a friend class.
3541
3542         * platform/graphics/NamedImageGeneratedImage.cpp: New class. Calls into the Theme to render the artwork.
3543         (WebCore::NamedImageGeneratedImage::NamedImageGeneratedImage):
3544         (WebCore::NamedImageGeneratedImage::draw):
3545         (WebCore::NamedImageGeneratedImage::drawPattern):
3546         * platform/graphics/NamedImageGeneratedImage.h:
3547
3548         * platform/ios/ThemeIOS.h: Inherit from ThemeCocoa.
3549         * platform/mac/ThemeMac.h: Ditto.
3550
3551 2015-06-18  KyungTae Kim  <ktf.kim@samsung.com> and Myles C. Maxfield  <mmaxfield@apple.com>
3552
3553         [CSS3] Add support for the word-break:keep-all CSS property
3554         https://bugs.webkit.org/show_bug.cgi?id=123782
3555
3556         Reviewed by Darin Adler.
3557
3558         Add support for word-break:keep-all CSS property by CSS3 spec:
3559         http://www.w3.org/TR/2013/WD-css-text-3-20131010/#word-break-property
3560
3561         Test: fast/text/word-break-keep-all.html
3562
3563         * css/CSSParser.cpp:
3564         (WebCore::isValidKeywordPropertyAndValue):
3565         * css/CSSPrimitiveValueMappings.h:
3566         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3567         (WebCore::CSSPrimitiveValue::operator EWordBreak):
3568         * css/CSSValueKeywords.in:
3569         * rendering/RenderText.cpp:
3570         (WebCore::RenderText::computePreferredLogicalWidths):
3571         * rendering/break_lines.h:
3572         (WebCore::nextBreakablePositionKeepingAllWords):
3573         (WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP):
3574         (WebCore::isBreakable):
3575         * rendering/line/BreakingContext.h:
3576         (WebCore::BreakingContext::handleText):
3577         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
3578         * rendering/style/RenderStyleConstants.h:
3579
3580 2015-06-18  Jon Lee  <jonlee@apple.com>
3581
3582         Update AVKit usage of pip
3583         https://bugs.webkit.org/show_bug.cgi?id=146095
3584         <rdar://problem/21386853>
3585
3586         Reviewed by Eric Carlson.
3587
3588         - Rename enum VideoFullscreenModeOptimized to VideoFullscreenModePictureInPicture
3589         - Rename MediaElementSession::allowsAlternateFullscreen to allowsPictureInPicture
3590         - Rename Settings::allowsAlternateFullscreen to allowsPictureInPictureMediaPlayback
3591         - Update AVKit calls and AVKitSPI.h
3592         - Rename WebVideoFullscreenInterfaceAVKit delegate functions and member variables
3593
3594         * html/HTMLMediaElement.cpp:
3595         * html/HTMLVideoElement.cpp:
3596         * html/MediaElementSession.cpp:
3597         (WebCore::MediaElementSession::allowsPictureInPicture): Renamed.
3598         (WebCore::MediaElementSession::allowsAlternateFullscreen): Deleted.
3599         * html/MediaElementSession.h:
3600         * page/Settings.cpp:
3601         * page/Settings.in:
3602         * platform/graphics/MediaPlayerEnums.h:
3603         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3604         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3605         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Remove unused setIsOptimized.
3606         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3607         * platform/spi/cocoa/AVKitSPI.h: Remove unused typedef.
3608         * platform/spi/mac/AVFoundationSPI.h:
3609
3610 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
3611
3612         Fix crash when entering fullscreen during exit fullscreen animation.
3613         https://bugs.webkit.org/show_bug.cgi?id=146117
3614
3615         Reviewed by Simon Fraser.
3616
3617         Because enterFullscreen can be called during exitFullscreen animation, the exit fullscreen teardown
3618         should not imply a fullscreen state change on video element.
3619
3620         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3621         (WebVideoFullscreenControllerContext::exitFullscreen): May be called from mainThread
3622         (-[WebVideoFullscreenController exitFullscreen]): May be called from mainThread
3623         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3624         (WebVideoFullscreenModelVideoElement::setVideoElement): 
3625         Changing associated video element does not imply fullscreen mode change.
3626
3627 2015-06-18  Brian J. Burg  <burg@cs.washington.edu>
3628
3629         Web Inspector: improve generated types for objects passed to backend commands
3630         https://bugs.webkit.org/show_bug.cgi?id=146091
3631
3632         Reviewed by Joseph Pecoraro.
3633
3634         Update type signatures for backend command implementations. In a few cases, clean
3635         up relevant helper function signatures and copy data out of parameter objects where
3636         the code previously held onto a reference.
3637
3638         No new tests, no behavior changed.
3639
3640         * inspector/InspectorCSSAgent.cpp:
3641         (WebCore::computePseudoClassMask):
3642         (WebCore::InspectorCSSAgent::setStyleText):
3643         (WebCore::InspectorCSSAgent::setRuleSelector):
3644         (WebCore::InspectorCSSAgent::forcePseudoState):
3645         * inspector/InspectorCSSAgent.h:
3646         * inspector/InspectorDOMAgent.cpp:
3647         (WebCore::parseColor):
3648         (WebCore::parseConfigColor):
3649         (WebCore::parseQuad):
3650         (WebCore::InspectorDOMAgent::performSearch):
3651         (WebCore::InspectorDOMAgent::setSearchingForNode):
3652         (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
3653         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
3654         (WebCore::InspectorDOMAgent::highlightRect):
3655         (WebCore::InspectorDOMAgent::highlightQuad):
3656         (WebCore::InspectorDOMAgent::innerHighlightQuad):
3657         (WebCore::InspectorDOMAgent::highlightNode):
3658         (WebCore::InspectorDOMAgent::highlightFrame):
3659         * inspector/InspectorDOMAgent.h:
3660         * inspector/InspectorDOMStorageAgent.cpp:
3661         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
3662         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
3663         (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
3664         (WebCore::InspectorDOMStorageAgent::findStorageArea):
3665         * inspector/InspectorDOMStorageAgent.h:
3666         * inspector/InspectorIndexedDBAgent.cpp:
3667         (WebCore::InspectorIndexedDBAgent::requestData):
3668         * inspector/InspectorIndexedDBAgent.h:
3669         * inspector/InspectorReplayAgent.cpp:
3670         (WebCore::InspectorReplayAgent::replayToPosition):
3671         * inspector/InspectorReplayAgent.h:
3672         * inspector/InspectorResourceAgent.cpp:
3673         (WebCore::InspectorResourceAgent::willSendRequest):
3674         (WebCore::InspectorResourceAgent::setExtraHTTPHeaders):
3675         Clean up extraHTTPHeaders to copy header key/values out of the InspectorObject, rather
3676         than retaining the protocol object indefinitely. This matches the ownership scheme used
3677         everywhere else.
3678
3679         * inspector/InspectorResourceAgent.h:
3680         * inspector/InspectorStyleSheet.h:
3681         (WebCore::InspectorCSSId::InspectorCSSId):
3682         * inspector/InspectorWorkerAgent.cpp:
3683         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
3684         * inspector/InspectorWorkerAgent.h:
3685
3686 2015-06-18  Anders Carlsson  <andersca@apple.com>
3687
3688         Remove shouldInterruptJavaScript
3689         https://bugs.webkit.org/show_bug.cgi?id=146118
3690
3691         Reviewed by Antti Koivisto.
3692
3693         The WebKit SPI methods for deciding whether JavaScript execution should be interrupted hasn't been used
3694         for many releases. Furthermore, they don't make sense in the multi-process architecture since it's still possible
3695         to interrupt execution (by closing the browser tab or window) from the UI process.
3696
3697         * bindings/js/JSDOMWindowBase.cpp:
3698         (WebCore::JSDOMWindowBase::shouldInterruptScript):
3699         * loader/EmptyClients.h:
3700         * page/Chrome.cpp:
3701         (WebCore::Chrome::shouldInterruptJavaScript): Deleted.
3702         * page/Chrome.h:
3703         * page/ChromeClient.h:
3704
3705 2015-06-18  Benjamin Poulain  <bpoulain@apple.com>
3706
3707         [CSS JIT][ARMv7] The pseudo element early exit trashes r6
3708         https://bugs.webkit.org/show_bug.cgi?id=146078
3709
3710         Reviewed by Alex Christensen.
3711
3712         The pseudo element early failure runs before we generate the prologue.
3713         The reason is that we can often exit immediately on function entry, before
3714         we even touch any memory.
3715
3716         On ARMv7, we don't have many spare registers so the MacroAssembler
3717         uses r6 as a scratch register and the client code is expected to save
3718         it.
3719
3720         In the early failure case, we were not pushing r6 before using the MacroAssembler
3721         and its value could be trashed.
3722
3723         This patch push the macro assembler registers separately from the prologue.
3724
3725         For restoring the registers, a new function generateFunctionEnding() encapsulate
3726         the pop() and ret().
3727
3728         * cssjit/SelectorCompiler.cpp:
3729         (WebCore::SelectorCompiler::SelectorCodeGenerator::pushMacroAssemblerRegisters):
3730         (WebCore::SelectorCompiler::SelectorCodeGenerator::popMacroAssemblerRegisters):
3731         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
3732         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
3733         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
3734
3735         * cssjit/StackAllocator.h:
3736         (WebCore::StackAllocator::operator=):
3737         We have a new case for the stack allocator: some stack changes are conditional
3738         at compile time instead of runtime. This is easy to deal with by overriding
3739         the stack if a path is not taken at compile time.
3740
3741 2015-06-17  Conrad Shultz  <conrad_shultz@apple.com>
3742
3743         REGRESSION: js/dom/navigator-plugins-crash.html asserts a lot
3744         https://bugs.webkit.org/show_bug.cgi?id=144399
3745
3746         Reviewed by Darin Adler.
3747
3748         Earlier work made the array of web-visible plug-ins dynamic, but allowed DOMPlugin (and, indirectly by extension,
3749         DOMMimeType) to continue keeping a reference to a plug-in in terms of an index into that array. This superficially
3750         appeared correct since DOMPlugin immutably holds onto a PluginData instance, which in turn immutably holds onto a
3751         Page instance. PluginStrategy::getWebVisiblePluginInfo() is passed this Page, which is used to determine the contents
3752         of the plugin array. The expectation was that keeping an index would still be safe since the Page is not changing,
3753         but this is not strictly correct since relevant attributes of the Page and/or the available plugins may still change.
3754
3755         It's not entirely clear why the test failures are intermittent and occur only on certain configurations, but address
3756         them by eliminating the incorrect storage of indexes in favor of keeping copies of the relevant plugin info itself.
3757
3758         * plugins/DOMMimeType.cpp:
3759         (WebCore::DOMMimeType::DOMMimeType):
3760         Instead of storing the MIME type index, retrieve and store the MIME class info and plugin info.
3761         (WebCore::DOMMimeType::type):
3762         Directly access the m_mimeClassInfo member.
3763         (WebCore::DOMMimeType::suffixes):
3764         Ditto.
3765         (WebCore::DOMMimeType::description):
3766         Ditto.
3767         (WebCore::DOMMimeType::enabledPlugin):
3768         Directly access the m_pluginInfo member.
3769         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
3770
3771         * plugins/DOMMimeType.h:
3772         Update member variables.
3773
3774         * plugins/DOMPlugin.cpp:
3775         (WebCore::DOMPlugin::DOMPlugin):
3776         Instead of storing the plugin index, store the plugin info directly.
3777         (WebCore::DOMPlugin::name):
3778         Directly access m_pluginInfo.
3779         (WebCore::DOMPlugin::filename):
3780         Ditto.
3781         (WebCore::DOMPlugin::description):
3782         Ditto.
3783         (WebCore::DOMPlugin::length):
3784         Ditto.
3785         (WebCore::DOMPlugin::item):
3786         Access m_pluginInfo directly; find the matching plug-in based on matching PluginInfo (for which an overloaded
3787         comparator is supplied below).
3788         (WebCore::DOMPlugin::pluginInfo): Deleted.
3789
3790         * plugins/DOMPlugin.h:
3791         Update member variables.
3792         (WebCore::DOMPlugin::create):
3793         Accept a PluginInfo instead of a plugin index.
3794
3795         * plugins/DOMPluginArray.cpp:
3796         (WebCore::DOMPluginArray::item):
3797         (WebCore::DOMPluginArray::namedItem):
3798
3799         * plugins/PluginData.h:
3800         (WebCore::operator==):
3801         Added; compare PluginInfo structs on the basis of member equality.
3802
3803 2015-06-17  Alex Christensen  <achristensen@webkit.org>
3804
3805         [Content Extensions] Log blocked loads to the WebInspector console
3806         https://bugs.webkit.org/show_bug.cgi?id=146089
3807
3808         Reviewed by Joseph Pecoraro.
3809
3810         * contentextensions/ContentExtensionsBackend.cpp:
3811         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
3812         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
3813         Log which URLs are blocked and the URL of the page they are blocked from.
3814
3815 2015-06-18  Joseph Pecoraro  <pecoraro@apple.com>
3816
3817         Crash under WebCore::DOMWindow::dispatchMessageEventWithOriginCheck attempting to log console message
3818         https://bugs.webkit.org/show_bug.cgi?id=146093
3819
3820         Reviewed by Timothy Hatcher.
3821
3822         * page/DOMWindow.cpp:
3823         (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
3824         The console could be null so null check its use.
3825
3826 2015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
3827
3828         Suppress null-conversion warnings in ANGLE
3829         https://bugs.webkit.org/show_bug.cgi?id=145125
3830
3831         Reviewed by Alex Christensen.
3832
3833         * CMakeLists.txt:
3834
3835 2015-06-18  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
3836
3837         [Streams API] Implement ReadableStreamReader.releaseLock
3838         https://bugs.webkit.org/show_bug.cgi?id=145299
3839
3840         Reviewed by Darin Adler.
3841
3842         Covered by rebased tests.
3843
3844         * Modules/streams/ReadableStream.cpp:
3845         (WebCore::ReadableStream::close): Moving some close code to newly added releaseReader.
3846         (WebCore::ReadableStream::releaseReader): Implements reader release and callbacks finalization.
3847         (WebCore::ReadableStream::changeStateToErrored): Calls releaseReader.
3848         * Modules/streams/ReadableStream.h:
3849         (WebCore::ReadableStream::hasReadPendingRequests): Added to enable reader.releaseLock throwing if read requests are pending.
3850         * Modules/streams/ReadableStreamReader.cpp:
3851         (WebCore::ReadableStreamReader::releaseLock): Implementation of releaseLock
3852         * Modules/streams/ReadableStreamReader.h:
3853         * Modules/streams/ReadableStreamReader.idl:
3854         (WebCore::releaseLock): Deleted.
3855
3856 2015-06-18  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3857
3858         GObject and ObjC bindings generator should not generate code for promise-based APIs
3859         https://bugs.webkit.org/show_bug.cgi?id=146059
3860
3861         Reviewed by Darin Adler.
3862
3863         Covered by rebased expectations.
3864
3865         * bindings/scripts/CodeGeneratorGObject.pm:
3866         (SkipFunction): Disabling GObject DOM binding for functions returning promises.
3867         * bindings/scripts/CodeGeneratorObjC.pm:
3868         (SkipFunction): Disabling ObjC DOM binding for functions returning promises.
3869         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Rebasing expectation.
3870         (webkit_dom_test_obj_get_read_only_long_attr): Deleted.
3871         (webkit_dom_test_obj_get_read_only_string_attr): Deleted.
3872         * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Rebasing expectation.
3873         * bindings/scripts/test/ObjC/DOMTestObj.h: Ditto.
3874         * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
3875         (core): Deleted.
3876
3877 2015-06-17  Ryuan Choi  <ryuan.choi@navercorp.com>
3878
3879         [EFL] test_ewk2_context_url_scheme_register has been crashed since r185553
3880         https://bugs.webkit.org/show_bug.cgi?id=146075
3881
3882         Reviewed by Carlos Garcia Campos.
3883
3884         Since r185553, CustomProtocolManager sends StartLoading message to UIProcess
3885         with request of SoupGenericRequest instead of request itself.
3886         But, request of SoupGenericRequest is nullptr in EFL port because EFL port
3887         does not use m_initiatingPageID.
3888
3889         This patch updates request of SoupGenericRequest although m_initiatingPageID is null.
3890
3891         * platform/network/soup/ResourceRequestSoup.cpp: 
3892         (WebCore::ResourceRequest::updateSoupRequest):
3893
3894 2015-06-17  Daniel Bates  <dabates@apple.com>
3895
3896         Client may receive began editing callback for already focused text field
3897         https://bugs.webkit.org/show_bug.cgi?id=146074
3898         <rdar://problem/21293562>
3899
3900         Reviewed by Darin Adler.
3901
3902         Fixes an issue where the client would be notified that began editing in a text field
3903         for each programmatic DOM focus event dispatched at the text field regardless of
3904         whether the field was focused. The client should only be notified that began editing
3905         exactly once when a text field becomes focused (either programmatically or by user interaction).
3906
3907         * html/TextFieldInputType.cpp:
3908         (WebCore::TextFieldInputType::forwardEvent): Move logic to dispatch editing began callback from here...
3909         (WebCore::TextFieldInputType::handleFocusEvent): to here. This function is called when the
3910         text field becomes newly focused.
3911         * html/TextFieldInputType.h:
3912
3913 2015-06-17  Alex Christensen  <achristensen@webkit.org>
3914
3915         [Content Extensions] Fail to parse invalid arrays
3916         https://bugs.webkit.org/show_bug.cgi?id=146079
3917         rdar://problem/21422649
3918
3919         Reviewed by Benjamin Poulain.
3920
3921         Covered by new and corrected API tests.
3922
3923         * contentextensions/ContentExtensionParser.cpp:
3924         (WebCore::ContentExtensions::loadTrigger):
3925         Fail to parse invalid arrays for if-domain, unless-domain, resource-type, and load-type arrays.
3926
3927 2015-06-16  Jon Honeycutt  <jhoneycutt@apple.com>
3928
3929         Position::findParent() should take a reference
3930         https://bugs.webkit.org/show_bug.cgi?id=146038
3931
3932         Reviewed by Darin Adler.
3933
3934         * dom/Position.cpp:
3935         (WebCore::Position::containerNode):
3936         (WebCore::Position::parentAnchoredEquivalent):
3937         Pass a reference; there is already a null check.
3938         (WebCore::Position::previous):
3939         Add a missing null check. Code below this expects that node is non-null.
3940         (WebCore::Position::next):
3941         Ditto.
3942         (WebCore::Position::atStartOfTree):
3943         (WebCore::Position::atEndOfTree):
3944         Pass a reference.
3945         (WebCore::Position::findParent):
3946         Changed to take a reference.
3947
3948         * dom/Position.h:
3949         Ditto.
3950
3951 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
3952
3953         Overflow regions with scroll snap points are not reliably rubber banding
3954         https://bugs.webkit.org/show_bug.cgi?id=142522
3955         <rdar://problem/20100726>
3956
3957         Reviewed by Darin Adler.
3958
3959         When computing the target scroll destination, update the nearest snap point index
3960         and other bookkeeping, but keep the original gesture target if it would have taken
3961         us beyond either limit of the scroll container.
3962
3963         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3964         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3965         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtents): Add new method
3966         to support client API.
3967         * platform/ScrollAnimator.cpp:
3968         (WebCore::ScrollAnimator::scrollExtents): Add new method to support client API.
3969         * platform/ScrollAnimator.h:
3970         * platform/cocoa/ScrollController.h:
3971         (WebCore::ScrollControllerClient::scrollExtents): Added new pure virtual method to API.
3972         * platform/cocoa/ScrollController.mm:
3973         (WebCore::ScrollController::beginScrollSnapAnimation): Hold onto original user gesture
3974         target, and use that instead of our nearest snap point if the gesture takes us past
3975         either extreme of the scroll container.
3976
3977 2015-06-17  Tim Horton  <timothy_horton@apple.com>
3978
3979         Swipe gesture can get stuck, preventing scrolling and other gestures
3980         https://bugs.webkit.org/show_bug.cgi?id=146088
3981         <rdar://problem/16056087>
3982
3983         Reviewed by Darin Adler.
3984
3985         * WebCore.xcodeproj/project.pbxproj:
3986         * platform/spi/mac/NSEventSPI.h: Added.
3987         Add an SPI header.
3988
3989 2015-06-16  Matt Rajca  <mrajca@apple.com>
3990
3991         MediaSession: handle MediaEventTrackNext and MediaEventTrackPrevious events
3992         https://bugs.webkit.org/show_bug.cgi?id=146028
3993
3994         Reviewed by Darin Adler.
3995
3996         * Modules/mediasession/MediaRemoteControls.idl: Added nexttrack/previoustrack event handlers.
3997         * Modules/mediasession/MediaSession.cpp: Dispatch the nexttrack/previoustrack events.
3998         (WebCore::MediaSession::skipToNextTrack):
3999         (WebCore::MediaSession::skipToPreviousTrack):
4000         * Modules/mediasession/MediaSession.h:
4001         * Modules/mediasession/MediaSessionManager.cpp: Skip to the next/previous track as described in the media session spec.
4002         (WebCore::MediaSessionManager::skipToNextTrack):
4003         (WebCore::MediaSessionManager::skipToPreviousTrack):
4004         * Modules/mediasession/MediaSessionManager.h:
4005         * dom/EventNames.h: Added