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